From owner-svn-src-all@freebsd.org Sun Dec 25 00:35:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BCC9C8071D; Sun, 25 Dec 2016 00:35:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC6A1336; Sun, 25 Dec 2016 00:35:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBP0Z0Mm011638; Sun, 25 Dec 2016 00:35:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBP0Z0Yc011637; Sun, 25 Dec 2016 00:35:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612250035.uBP0Z0Yc011637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Dec 2016 00:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310531 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 00:35:01 -0000 Author: markj Date: Sun Dec 25 00:35:00 2016 New Revision: 310531 URL: https://svnweb.freebsd.org/changeset/base/310531 Log: MFC r310423, r310454: Revert part of r300109. Modified: stable/11/sys/kern/subr_sleepqueue.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/11/sys/kern/subr_sleepqueue.c Sat Dec 24 23:51:27 2016 (r310530) +++ stable/11/sys/kern/subr_sleepqueue.c Sun Dec 25 00:35:00 2016 (r310531) @@ -880,7 +880,7 @@ int sleepq_broadcast(void *wchan, int flags, int pri, int queue) { struct sleepqueue *sq; - struct thread *td; + struct thread *td, *tdn; int wakeup_swapper; CTR2(KTR_PROC, "sleepq_broadcast(%p, %d)", wchan, flags); @@ -892,9 +892,14 @@ sleepq_broadcast(void *wchan, int flags, KASSERT(sq->sq_type == (flags & SLEEPQ_TYPE), ("%s: mismatch between sleep/wakeup and cv_*", __func__)); - /* Resume all blocked threads on the sleep queue. */ + /* + * Resume all blocked threads on the sleep queue. The last thread will + * be given ownership of sq and may re-enqueue itself before + * sleepq_resume_thread() returns, so we must cache the "next" queue + * item at the beginning of the final iteration. + */ wakeup_swapper = 0; - while ((td = TAILQ_FIRST(&sq->sq_blocked[queue])) != NULL) { + TAILQ_FOREACH_SAFE(td, &sq->sq_blocked[queue], td_slpq, tdn) { thread_lock(td); wakeup_swapper |= sleepq_resume_thread(sq, td, pri); thread_unlock(td); From owner-svn-src-all@freebsd.org Sun Dec 25 09:40:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34361C8F8FE; Sun, 25 Dec 2016 09:40:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 012FF1FF5; Sun, 25 Dec 2016 09:40:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBP9ejkt031074; Sun, 25 Dec 2016 09:40:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBP9ej60031054; Sun, 25 Dec 2016 09:40:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612250940.uBP9ej60031054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Dec 2016 09:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310534 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 09:40:46 -0000 Author: mav Date: Sun Dec 25 09:40:44 2016 New Revision: 310534 URL: https://svnweb.freebsd.org/changeset/base/310534 Log: Improve third-party copy error reporting. For EXTENDED COPY: - improve parameters checking to report some errors before copy start; - forward sense data from copy target as descriptor in case of error; - report which CSCD reported error in sense key specific information. For WRITE USING TOKEN: - pass through real sense data from copy target instead of reporting our copy error, since for initiator its a "simple" write, not a copy. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Sun Dec 25 08:02:37 2016 (r310533) +++ head/sys/cam/ctl/ctl_tpc.c Sun Dec 25 09:40:44 2016 (r310534) @@ -82,6 +82,8 @@ struct tpc_list; TAILQ_HEAD(runl, tpc_io); struct tpc_io { union ctl_io *io; + uint8_t target; + uint32_t cscd; uint64_t lun; struct tpc_list *list; struct runl run; @@ -134,6 +136,11 @@ struct tpc_list { int completed; time_t last_active; TAILQ_HEAD(, tpc_io) allio; + struct scsi_sense_data fwd_sense_data; + uint8_t fwd_sense_len; + uint8_t fwd_scsi_status; + uint8_t fwd_target; + uint16_t fwd_cscd; struct scsi_sense_data sense_data; uint8_t sense_len; uint8_t scsi_status; @@ -809,6 +816,44 @@ tpc_resolve(struct tpc_list *list, uint1 list->init_port, &list->cscd[idx], ss, pb, pbo)); } +static void +tpc_set_io_error_sense(struct tpc_list *list) +{ + int flen; + uint8_t csi[4]; + uint8_t sks[3]; + uint8_t fbuf[4 + 64]; + + scsi_ulto4b(list->curseg, csi); + if (list->fwd_cscd <= 0x07ff) { + sks[0] = SSD_SKS_SEGMENT_VALID; + scsi_ulto2b((uint8_t *)&list->cscd[list->fwd_cscd] - + list->params, &sks[1]); + } else + sks[0] = 0; + if (list->fwd_scsi_status) { + fbuf[0] = 0x0c; + fbuf[2] = list->fwd_target; + flen = list->fwd_sense_len; + if (flen > 64) { + flen = 64; + fbuf[2] |= SSD_FORWARDED_FSDT; + } + fbuf[1] = 2 + flen; + fbuf[3] = list->fwd_scsi_status; + bcopy(&list->fwd_sense_data, &fbuf[4], flen); + flen += 4; + } else + flen = 0; + ctl_set_sense(list->ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_COPY_ABORTED, + /*asc*/ 0x0d, /*ascq*/ 0x01, + SSD_ELEM_COMMAND, sizeof(csi), csi, + sks[0] ? SSD_ELEM_SKS : SSD_ELEM_SKIP, sizeof(sks), sks, + flen ? SSD_ELEM_DESC : SSD_ELEM_SKIP, flen, fbuf, + SSD_ELEM_NONE); +} + static int tpc_process_b2b(struct tpc_list *list) { @@ -820,6 +865,7 @@ tpc_process_b2b(struct tpc_list *list) off_t srclba, dstlba, numbytes, donebytes, roundbytes; int numlba; uint32_t srcblock, dstblock, pb, pbo, adj; + uint16_t scscd, dcscd; uint8_t csi[4]; scsi_ulto4b(list->curseg, csi); @@ -834,11 +880,7 @@ tpc_process_b2b(struct tpc_list *list) ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); } else if (list->error) { - ctl_set_sense(list->ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, - SSD_ELEM_COMMAND, sizeof(csi), csi, - SSD_ELEM_NONE); + tpc_set_io_error_sense(list); return (CTL_RETVAL_ERROR); } list->cursectors += list->segsectors; @@ -848,8 +890,10 @@ tpc_process_b2b(struct tpc_list *list) TAILQ_INIT(&list->allio); seg = (struct scsi_ec_segment_b2b *)list->seg[list->curseg]; - sl = tpc_resolve(list, scsi_2btoul(seg->src_cscd), &srcblock, NULL, NULL); - dl = tpc_resolve(list, scsi_2btoul(seg->dst_cscd), &dstblock, &pb, &pbo); + scscd = scsi_2btoul(seg->src_cscd); + dcscd = scsi_2btoul(seg->dst_cscd); + sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); + dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); if (sl >= CTL_MAX_LUNS || dl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, @@ -860,10 +904,10 @@ tpc_process_b2b(struct tpc_list *list) } if (pbo > 0) pbo = pb - pbo; - sdstp = &list->cscd[scsi_2btoul(seg->src_cscd)].dtsp; + sdstp = &list->cscd[scscd].dtsp; if (scsi_3btoul(sdstp->block_length) != 0) srcblock = scsi_3btoul(sdstp->block_length); - ddstp = &list->cscd[scsi_2btoul(seg->dst_cscd)].dtsp; + ddstp = &list->cscd[dcscd].dtsp; if (scsi_3btoul(ddstp->block_length) != 0) dstblock = scsi_3btoul(ddstp->block_length); numlba = scsi_2btoul(seg->number_of_blocks); @@ -924,6 +968,8 @@ tpc_process_b2b(struct tpc_list *list) /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tior->io->io_hdr.retries = 3; + tior->target = SSD_FORWARDED_SDS_EXSRC; + tior->cscd = scscd; tior->lun = sl; tior->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tior; @@ -943,6 +989,8 @@ tpc_process_b2b(struct tpc_list *list) /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tiow->io->io_hdr.retries = 3; + tiow->target = SSD_FORWARDED_SDS_EXDST; + tiow->cscd = dcscd; tiow->lun = dl; tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tiow; @@ -970,6 +1018,7 @@ tpc_process_verify(struct tpc_list *list struct scsi_ec_segment_verify *seg; struct tpc_io *tio; uint64_t sl; + uint16_t cscd; uint8_t csi[4]; scsi_ulto4b(list->curseg, csi); @@ -983,11 +1032,7 @@ tpc_process_verify(struct tpc_list *list ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); } else if (list->error) { - ctl_set_sense(list->ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, - SSD_ELEM_COMMAND, sizeof(csi), csi, - SSD_ELEM_NONE); + tpc_set_io_error_sense(list); return (CTL_RETVAL_ERROR); } else return (CTL_RETVAL_COMPLETE); @@ -995,7 +1040,8 @@ tpc_process_verify(struct tpc_list *list TAILQ_INIT(&list->allio); seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; - sl = tpc_resolve(list, scsi_2btoul(seg->src_cscd), NULL, NULL, NULL); + cscd = scsi_2btoul(seg->src_cscd); + sl = tpc_resolve(list, cscd, NULL, NULL, NULL); if (sl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, @@ -1018,6 +1064,8 @@ tpc_process_verify(struct tpc_list *list tio->io = tpcl_alloc_io(); ctl_scsi_tur(tio->io, /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tio->io->io_hdr.retries = 3; + tio->target = SSD_FORWARDED_SDS_EXSRC; + tio->cscd = cscd; tio->lun = sl; tio->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tio; list->stage++; @@ -1033,6 +1081,7 @@ tpc_process_register_key(struct tpc_list struct tpc_io *tio; uint64_t dl; int datalen; + uint16_t cscd; uint8_t csi[4]; scsi_ulto4b(list->curseg, csi); @@ -1047,11 +1096,7 @@ tpc_process_register_key(struct tpc_list ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); } else if (list->error) { - ctl_set_sense(list->ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, - SSD_ELEM_COMMAND, sizeof(csi), csi, - SSD_ELEM_NONE); + tpc_set_io_error_sense(list); return (CTL_RETVAL_ERROR); } else return (CTL_RETVAL_COMPLETE); @@ -1059,7 +1104,8 @@ tpc_process_register_key(struct tpc_list TAILQ_INIT(&list->allio); seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; - dl = tpc_resolve(list, scsi_2btoul(seg->dst_cscd), NULL, NULL, NULL); + cscd = scsi_2btoul(seg->dst_cscd); + dl = tpc_resolve(list, cscd, NULL, NULL, NULL); if (dl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, @@ -1084,6 +1130,8 @@ tpc_process_register_key(struct tpc_list scsi_8btou64(seg->res_key), scsi_8btou64(seg->sa_res_key), /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tio->io->io_hdr.retries = 3; + tio->target = SSD_FORWARDED_SDS_EXDST; + tio->cscd = cscd; tio->lun = dl; tio->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tio; list->stage++; @@ -1185,9 +1233,17 @@ tpc_process_wut(struct tpc_list *list) ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); } else if (list->error) { - ctl_set_sense(list->ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); + if (list->fwd_scsi_status) { + list->ctsio->io_hdr.status = + CTL_SCSI_ERROR | CTL_AUTOSENSE; + list->ctsio->scsi_status = list->fwd_scsi_status; + list->ctsio->sense_data = list->fwd_sense_data; + list->ctsio->sense_len = list->fwd_sense_len; + } else { + ctl_set_invalid_field(list->ctsio, + /*sks_valid*/ 0, /*command*/ 0, + /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); + } return (CTL_RETVAL_ERROR); } list->cursectors += list->segsectors; @@ -1210,9 +1266,8 @@ tpc_process_wut(struct tpc_list *list) if (tpc_skip_ranges(list->token->range, list->token->nrange, list->offset_into_rod + list->cursectors * dstblock / srcblock, &srange, &soffset) != 0) { - ctl_set_sense(list->ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x04, SSD_ELEM_NONE); + ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, + /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); return (CTL_RETVAL_ERROR); } @@ -1233,9 +1288,8 @@ tpc_process_wut(struct tpc_list *list) } if (numbytes % srcblock != 0 || numbytes % dstblock != 0) { - ctl_set_sense(list->ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x26, /*ascq*/ 0x0A, SSD_ELEM_NONE); + ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, + /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); return (CTL_RETVAL_ERROR); } @@ -1337,9 +1391,17 @@ complete: ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); } else if (list->error) { - ctl_set_sense(list->ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); + if (list->fwd_scsi_status) { + list->ctsio->io_hdr.status = + CTL_SCSI_ERROR | CTL_AUTOSENSE; + list->ctsio->scsi_status = list->fwd_scsi_status; + list->ctsio->sense_data = list->fwd_sense_data; + list->ctsio->sense_len = list->fwd_sense_len; + } else { + ctl_set_invalid_field(list->ctsio, + /*sks_valid*/ 0, /*command*/ 0, + /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); + } return (CTL_RETVAL_ERROR); } list->cursectors += list->segsectors; @@ -1616,9 +1678,17 @@ tpc_done(union ctl_io *io) } } - if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) + if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) { tio->list->error = 1; - else + if (io->io_hdr.io_type == CTL_IO_SCSI && + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SCSI_ERROR) { + tio->list->fwd_scsi_status = io->scsiio.scsi_status; + tio->list->fwd_sense_data = io->scsiio.sense_data; + tio->list->fwd_sense_len = io->scsiio.sense_len; + tio->list->fwd_target = tio->target; + tio->list->fwd_cscd = tio->cscd; + } + } else atomic_add_int(&tio->list->curops, 1); if (!tio->list->error && !tio->list->abort) { while ((tior = TAILQ_FIRST(&tio->run)) != NULL) { @@ -1637,6 +1707,8 @@ ctl_extended_copy_lid1(struct ctl_scsiio { struct scsi_extended_copy *cdb; struct scsi_extended_copy_lid1_data *data; + struct scsi_ec_cscd *cscd; + struct scsi_ec_segment *seg; struct ctl_lun *lun; struct tpc_list *list, *tlist; uint8_t *ptr; @@ -1715,6 +1787,17 @@ ctl_extended_copy_lid1(struct ctl_scsiio list->flags = data->flags; list->params = ctsio->kern_data_ptr; list->cscd = (struct scsi_ec_cscd *)&data->data[0]; + ptr = &data->data[0]; + for (off = 0; off < lencscd; off += sizeof(struct scsi_ec_cscd)) { + cscd = (struct scsi_ec_cscd *)(ptr + off); + if (cscd->type_code != EC_CSCD_ID) { + free(list, M_CTL); + ctl_set_sense(ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST, + /*asc*/ 0x26, /*ascq*/ 0x07, SSD_ELEM_NONE); + goto done; + } + } ptr = &data->data[lencscd]; for (nseg = 0, off = 0; off < lenseg; nseg++) { if (nseg >= TPC_MAX_SEGS) { @@ -1724,9 +1807,19 @@ ctl_extended_copy_lid1(struct ctl_scsiio /*asc*/ 0x26, /*ascq*/ 0x08, SSD_ELEM_NONE); goto done; } - list->seg[nseg] = (struct scsi_ec_segment *)(ptr + off); + seg = (struct scsi_ec_segment *)(ptr + off); + if (seg->type_code != EC_SEG_B2B && + seg->type_code != EC_SEG_VERIFY && + seg->type_code != EC_SEG_REGISTER_KEY) { + free(list, M_CTL); + ctl_set_sense(ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST, + /*asc*/ 0x26, /*ascq*/ 0x09, SSD_ELEM_NONE); + goto done; + } + list->seg[nseg] = seg; off += sizeof(struct scsi_ec_segment) + - scsi_2btoul(list->seg[nseg]->descr_length); + scsi_2btoul(seg->descr_length); } list->inl = &data->data[lencscd + lenseg]; list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); @@ -1770,6 +1863,8 @@ ctl_extended_copy_lid4(struct ctl_scsiio { struct scsi_extended_copy *cdb; struct scsi_extended_copy_lid4_data *data; + struct scsi_ec_cscd *cscd; + struct scsi_ec_segment *seg; struct ctl_lun *lun; struct tpc_list *list, *tlist; uint8_t *ptr; @@ -1848,6 +1943,17 @@ ctl_extended_copy_lid4(struct ctl_scsiio list->flags = data->flags; list->params = ctsio->kern_data_ptr; list->cscd = (struct scsi_ec_cscd *)&data->data[0]; + ptr = &data->data[0]; + for (off = 0; off < lencscd; off += sizeof(struct scsi_ec_cscd)) { + cscd = (struct scsi_ec_cscd *)(ptr + off); + if (cscd->type_code != EC_CSCD_ID) { + free(list, M_CTL); + ctl_set_sense(ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST, + /*asc*/ 0x26, /*ascq*/ 0x07, SSD_ELEM_NONE); + goto done; + } + } ptr = &data->data[lencscd]; for (nseg = 0, off = 0; off < lenseg; nseg++) { if (nseg >= TPC_MAX_SEGS) { @@ -1857,9 +1963,19 @@ ctl_extended_copy_lid4(struct ctl_scsiio /*asc*/ 0x26, /*ascq*/ 0x08, SSD_ELEM_NONE); goto done; } - list->seg[nseg] = (struct scsi_ec_segment *)(ptr + off); + seg = (struct scsi_ec_segment *)(ptr + off); + if (seg->type_code != EC_SEG_B2B && + seg->type_code != EC_SEG_VERIFY && + seg->type_code != EC_SEG_REGISTER_KEY) { + free(list, M_CTL); + ctl_set_sense(ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST, + /*asc*/ 0x26, /*ascq*/ 0x09, SSD_ELEM_NONE); + goto done; + } + list->seg[nseg] = seg; off += sizeof(struct scsi_ec_segment) + - scsi_2btoul(list->seg[nseg]->descr_length); + scsi_2btoul(seg->descr_length); } list->inl = &data->data[lencscd + lenseg]; list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); From owner-svn-src-all@freebsd.org Sun Dec 25 13:34:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E9BFC8DC52; Sun, 25 Dec 2016 13:34:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3A6017D9; Sun, 25 Dec 2016 13:34:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPDY3N4028482; Sun, 25 Dec 2016 13:34:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPDY2Nn028478; Sun, 25 Dec 2016 13:34:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612251334.uBPDY2Nn028478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Dec 2016 13:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310539 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 13:34:04 -0000 Author: mav Date: Sun Dec 25 13:34:02 2016 New Revision: 310539 URL: https://svnweb.freebsd.org/changeset/base/310539 Log: Remove CTL_MAX_LUNS from places where it is not required. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_tpc.c head/sys/cam/ctl/ctl_tpc_local.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Dec 25 12:00:56 2016 (r310538) +++ head/sys/cam/ctl/ctl.c Sun Dec 25 13:34:02 2016 (r310539) @@ -1218,7 +1218,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -2906,18 +2906,18 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k; + int j, k; struct ctl_port *port; struct ctl_frontend *fe; mtx_lock(&softc->ctl_lock); printf("CTL Persistent Reservation information start:\n"); - for (i = 0; i < CTL_MAX_LUNS; i++) { - lun = softc->ctl_luns[i]; - - if ((lun == NULL) - || ((lun->flags & CTL_LUN_DISABLED) != 0)) + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + if ((lun->flags & CTL_LUN_DISABLED) != 0) { + mtx_unlock(&lun->lun_lock); continue; + } for (j = 0; j < CTL_MAX_PORTS; j++) { if (lun->pr_keys[j] == NULL) @@ -2925,11 +2925,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ if (lun->pr_keys[j][k] == 0) continue; - printf(" LUN %d port %d iid %d key " - "%#jx\n", i, j, k, + printf(" LUN %ju port %d iid %d key " + "%#jx\n", lun->lun, j, k, (uintmax_t)lun->pr_keys[j][k]); } } + mtx_unlock(&lun->lun_lock); } printf("CTL Persistent Reservation information end\n"); printf("CTL Ports:\n"); @@ -3312,7 +3313,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, sbuf_printf(sb, "\ton\n"); for (j = 0; j < CTL_MAX_LUNS; j++) { plun = ctl_lun_map_from_port(port, j); - if (plun >= CTL_MAX_LUNS) + if (plun == UINT32_MAX) continue; sbuf_printf(sb, "\t%u\n", @@ -3380,8 +3381,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } if (port->status & CTL_PORT_STATUS_ONLINE) { STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= - CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == + UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_port(lun, lm->port, -1, @@ -3509,7 +3510,7 @@ ctl_lun_map_set(struct ctl_port *port, u } old = port->lun_map[plun]; port->lun_map[plun] = glun; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { if (port->lun_enable != NULL) port->lun_enable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3526,7 +3527,7 @@ ctl_lun_map_unset(struct ctl_port *port, return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old != UINT32_MAX) { if (port->lun_disable != NULL) port->lun_disable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3540,7 +3541,7 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id >= CTL_MAX_LUNS) + if (port->lun_map == NULL || lun_id == UINT32_MAX) return (lun_id); return (port->lun_map[lun_id]); } @@ -7142,7 +7143,7 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->status & CTL_PORT_STATUS_HA_SHARED) @@ -7234,7 +7235,7 @@ ctl_report_tagret_port_groups(struct ctl if (!softc->is_single && (port->status & CTL_PORT_STATUS_HA_SHARED) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -7259,7 +7260,7 @@ ctl_report_tagret_port_groups(struct ctl continue; if (port->status & CTL_PORT_STATUS_HA_SHARED) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -9078,7 +9079,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); num_luns = 0; for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { - if (ctl_lun_map_from_port(port, targ_lun_id) < CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } mtx_unlock(&softc->ctl_lock); @@ -9138,7 +9139,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); - if (lun_id >= CTL_MAX_LUNS) + if (lun_id == UINT32_MAX) continue; lun = softc->ctl_luns[lun_id]; if (lun == NULL) @@ -9774,7 +9775,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->init_devid) @@ -9825,7 +9826,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, pd->relative_port_id); if (port->init_devid) { @@ -11882,7 +11883,7 @@ ctl_target_reset(struct ctl_softc *softc port = ctl_io_port(&io->io_hdr); STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; retval += ctl_do_lun_reset(lun, io, ua_type); } Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Sun Dec 25 12:00:56 2016 (r310538) +++ head/sys/cam/ctl/ctl_frontend.c Sun Dec 25 13:34:02 2016 (r310539) @@ -316,8 +316,8 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_enable(port->targ_lun_arg, l); } @@ -338,7 +338,7 @@ ctl_port_online(struct ctl_port *port) } port->status |= CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -360,8 +360,8 @@ ctl_port_offline(struct ctl_port *port) if (port->lun_disable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_disable(port->targ_lun_arg, l); } @@ -373,7 +373,7 @@ ctl_port_offline(struct ctl_port *port) mtx_lock(&softc->ctl_lock); port->status &= ~CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Sun Dec 25 12:00:56 2016 (r310538) +++ head/sys/cam/ctl/ctl_tpc.c Sun Dec 25 13:34:02 2016 (r310539) @@ -894,7 +894,7 @@ tpc_process_b2b(struct tpc_list *list) dcscd = scsi_2btoul(seg->dst_cscd); sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); - if (sl >= CTL_MAX_LUNS || dl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX || dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1042,7 +1042,7 @@ tpc_process_verify(struct tpc_list *list seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->src_cscd); sl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (sl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1106,7 +1106,7 @@ tpc_process_register_key(struct tpc_list seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->dst_cscd); dl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (dl >= CTL_MAX_LUNS) { + if (dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Sun Dec 25 12:00:56 2016 (r310538) +++ head/sys/cam/ctl/ctl_tpc_local.c Sun Dec 25 13:34:02 2016 (r310539) @@ -290,7 +290,7 @@ tpcl_resolve(struct ctl_softc *softc, in port = NULL; STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; if (lun->lun_devid == NULL) continue; From owner-svn-src-all@freebsd.org Sun Dec 25 14:54:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15818C90F98; Sun, 25 Dec 2016 14:54:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8C0112A3; Sun, 25 Dec 2016 14:54:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPEsqOm062012; Sun, 25 Dec 2016 14:54:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPEsqBJ062011; Sun, 25 Dec 2016 14:54:52 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612251454.uBPEsqBJ062011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 25 Dec 2016 14:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310540 - stable/11/share/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 14:54:53 -0000 Author: dim Date: Sun Dec 25 14:54:51 2016 New Revision: 310540 URL: https://svnweb.freebsd.org/changeset/base/310540 Log: MFC r304696: In addition to creating subdirectories under .OBJDIR for SRCS with relative paths, also create them for DPSRCS. This is needed for builds that generate files during the depend stage, which cannot be compiled by themselves, since those have to be put in DPSRCS. Modified: stable/11/share/mk/bsd.obj.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.obj.mk ============================================================================== --- stable/11/share/mk/bsd.obj.mk Sun Dec 25 13:34:02 2016 (r310539) +++ stable/11/share/mk/bsd.obj.mk Sun Dec 25 14:54:51 2016 (r310540) @@ -102,7 +102,7 @@ obj: .PHONY fi; \ ${ECHO} "${CANONICALOBJDIR} created for ${.CURDIR}"; \ fi -.for dir in ${SRCS:H:O:u} +.for dir in ${SRCS:H:O:u} ${DPSRCS:H:O:u} @if ! test -d ${CANONICALOBJDIR}/${dir}/; then \ mkdir -p ${CANONICALOBJDIR}/${dir}; \ if ! test -d ${CANONICALOBJDIR}/${dir}/; then \ From owner-svn-src-all@freebsd.org Sun Dec 25 14:58:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D23A1C8F1ED; Sun, 25 Dec 2016 14:58:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACABD15D9; Sun, 25 Dec 2016 14:58:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPEwoC8062334; Sun, 25 Dec 2016 14:58:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPEwoM3062332; Sun, 25 Dec 2016 14:58:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612251458.uBPEwoM3062332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 25 Dec 2016 14:58:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310541 - stable/11/lib/libcompiler_rt X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 14:58:51 -0000 Author: dim Date: Sun Dec 25 14:58:50 2016 New Revision: 310541 URL: https://svnweb.freebsd.org/changeset/base/310541 Log: MFC r306266 (by emaste): libcompiler_rt: use ${SRCTOP} for the top of the FreeBSD tree MFC r306377 (by emaste): libcompiler_rt: move file list to Makefile.inc for reuse elsewhere Also switch to the style used in the clang390-import branch to reduce future conflicts. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8039 Added: stable/11/lib/libcompiler_rt/Makefile.inc - copied unchanged from r306377, head/lib/libcompiler_rt/Makefile.inc Modified: stable/11/lib/libcompiler_rt/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcompiler_rt/Makefile ============================================================================== --- stable/11/lib/libcompiler_rt/Makefile Sun Dec 25 14:54:51 2016 (r310540) +++ stable/11/lib/libcompiler_rt/Makefile Sun Dec 25 14:58:50 2016 (r310541) @@ -8,225 +8,9 @@ NO_PIC= WARNS?= 2 CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN -CFLAGS+=-I${.CURDIR}/../../contrib/libcxxrt +CFLAGS+=-I${SRCTOP}/contrib/libcxxrt -.if ${MACHINE_CPUARCH} == "amd64" -CRTARCH=x86_64 -.else -CRTARCH=${MACHINE_CPUARCH} -.endif - -CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib/builtins - -.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC} - -SRCF= absvdi2 \ - absvsi2 \ - absvti2 \ - addvdi3 \ - addvsi3 \ - addvti3 \ - apple_versioning \ - ashldi3 \ - ashlti3 \ - ashrdi3 \ - ashrti3 \ - clear_cache \ - clzdi2 \ - clzsi2 \ - clzti2 \ - cmpdi2 \ - cmpti2 \ - ctzdi2 \ - ctzsi2 \ - ctzti2 \ - divdc3 \ - divdi3 \ - divmoddi4 \ - divmodsi4 \ - divsc3 \ - divtc3 \ - divti3 \ - divxc3 \ - enable_execute_stack \ - eprintf \ - extendhfsf2 \ - ffsdi2 \ - ffsti2 \ - fixdfdi \ - fixdfti \ - fixsfdi \ - fixsfti \ - fixunsdfdi \ - fixunsdfsi \ - fixunsdfti \ - fixunssfdi \ - fixunssfsi \ - fixunssfti \ - fixunsxfdi \ - fixunsxfsi \ - fixunsxfti \ - fixxfdi \ - fixxfti \ - floatdidf \ - floatdisf \ - floatditf \ - floatdixf \ - floatsitf \ - floattidf \ - floattisf \ - floattixf \ - floatundidf \ - floatundisf \ - floatunditf \ - floatundixf \ - floatunsidf \ - floatunsisf \ - floatuntidf \ - floatuntisf \ - floatuntixf \ - gcc_personality_v0 \ - int_util \ - lshrdi3 \ - lshrti3 \ - moddi3 \ - modti3 \ - muldc3 \ - muldi3 \ - mulodi4 \ - mulosi4 \ - muloti4 \ - mulsc3 \ - multi3 \ - mulvdi3 \ - mulvsi3 \ - mulvti3 \ - multc3 \ - mulxc3 \ - negdf2 \ - negdi2 \ - negsf2 \ - negti2 \ - negvdi2 \ - negvsi2 \ - negvti2 \ - paritydi2 \ - paritysi2 \ - parityti2 \ - popcountdi2 \ - popcountsi2 \ - popcountti2 \ - powidf2 \ - powisf2 \ - powitf2 \ - powixf2 \ - subvdi3 \ - subvsi3 \ - subvti3 \ - trampoline_setup \ - truncdfhf2 \ - truncsfhf2 \ - ucmpdi2 \ - ucmpti2 \ - udivdi3 \ - udivmoddi4 \ - udivmodsi4 \ - udivmodti4 \ - udivti3 \ - umoddi3 \ - umodti3 - -# 128-bit quad precision long double support, only used on arm64 -.if ${MACHINE_CPUARCH} == "aarch64" -SRCF+= addtf3 \ - comparetf2 \ - divtf3 \ - extenddftf2 \ - extendsftf2 \ - fixtfdi \ - fixtfsi \ - fixtfti \ - fixunstfdi \ - fixunstfsi \ - fixunstfti \ - floatunsitf \ - multf3 \ - subtf3 \ - trunctfdf2 \ - trunctfsf2 -.endif - -# These are already shipped by libc.a on arm and mips -.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" -SRCF+= adddf3 \ - addsf3 \ - divdf3 \ - divsf3 \ - extendsfdf2 \ - fixdfsi \ - fixsfsi \ - floatsidf \ - floatsisf \ - muldf3 \ - mulsf3 \ - subdf3 \ - subsf3 \ - truncdfsf2 -.endif - -.if ${MACHINE_CPUARCH} != "arm" -SRCF+= comparedf2 \ - comparesf2 -.endif - -.if ${MACHINE_CPUARCH} != "mips" -SRCF+= divsi3 \ - modsi3 \ - udivsi3 \ - umodsi3 -.endif - -# FreeBSD-specific atomic intrinsics. -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6" -.PATH: ${.CURDIR}/../../sys/arm/arm - -SRCF+= stdatomic -CFLAGS+= -DEMIT_SYNC_ATOMICS -.elif ${MACHINE_CPUARCH} == "mips" -.PATH: ${.CURDIR}/../../sys/mips/mips - -SRCF+= stdatomic -.endif - -.for file in ${SRCF} -.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") && \ - exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) -SRCS+= ${file}vfp.S -. elif exists(${CRTSRC}/${CRTARCH}/${file}.S) -SRCS+= ${file}.S -. else -SRCS+= ${file}.c -. endif -.endfor - -.if ${MACHINE_CPUARCH} == "arm" -SRCS+= aeabi_div0.c \ - aeabi_idivmod.S \ - aeabi_ldivmod.S \ - aeabi_memcmp.S \ - aeabi_memcpy.S \ - aeabi_memmove.S \ - aeabi_memset.S \ - aeabi_uidivmod.S \ - aeabi_uldivmod.S \ - bswapdi2.S \ - bswapsi2.S \ - switch16.S \ - switch32.S \ - switch8.S \ - switchu8.S \ - sync_synchronize.S -.endif +.include "Makefile.inc" .if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a Copied: stable/11/lib/libcompiler_rt/Makefile.inc (from r306377, head/lib/libcompiler_rt/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libcompiler_rt/Makefile.inc Sun Dec 25 14:58:50 2016 (r310541, copy of r306377, head/lib/libcompiler_rt/Makefile.inc) @@ -0,0 +1,216 @@ +# $FreeBSD$ + +CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} + +CRTSRC= ${SRCTOP}/contrib/compiler-rt/lib/builtins + +.PATH: ${CRTSRC}/${CRTARCH} +.PATH: ${CRTSRC} + +SRCF+= absvdi2 +SRCF+= absvsi2 +SRCF+= absvti2 +SRCF+= addvdi3 +SRCF+= addvsi3 +SRCF+= addvti3 +SRCF+= apple_versioning +SRCF+= ashldi3 +SRCF+= ashlti3 +SRCF+= ashrdi3 +SRCF+= ashrti3 +SRCF+= clear_cache +SRCF+= clzdi2 +SRCF+= clzsi2 +SRCF+= clzti2 +SRCF+= cmpdi2 +SRCF+= cmpti2 +SRCF+= ctzdi2 +SRCF+= ctzsi2 +SRCF+= ctzti2 +SRCF+= divdc3 +SRCF+= divdi3 +SRCF+= divmoddi4 +SRCF+= divmodsi4 +SRCF+= divsc3 +SRCF+= divtc3 +SRCF+= divti3 +SRCF+= divxc3 +SRCF+= enable_execute_stack +SRCF+= eprintf +SRCF+= extendhfsf2 +SRCF+= ffsdi2 +SRCF+= ffsti2 +SRCF+= fixdfdi +SRCF+= fixdfti +SRCF+= fixsfdi +SRCF+= fixsfti +SRCF+= fixunsdfdi +SRCF+= fixunsdfsi +SRCF+= fixunsdfti +SRCF+= fixunssfdi +SRCF+= fixunssfsi +SRCF+= fixunssfti +SRCF+= fixunsxfdi +SRCF+= fixunsxfsi +SRCF+= fixunsxfti +SRCF+= fixxfdi +SRCF+= fixxfti +SRCF+= floatdidf +SRCF+= floatdisf +SRCF+= floatditf +SRCF+= floatdixf +SRCF+= floatsitf +SRCF+= floattidf +SRCF+= floattisf +SRCF+= floattixf +SRCF+= floatundidf +SRCF+= floatundisf +SRCF+= floatunditf +SRCF+= floatundixf +SRCF+= floatunsidf +SRCF+= floatunsisf +SRCF+= floatuntidf +SRCF+= floatuntisf +SRCF+= floatuntixf +SRCF+= gcc_personality_v0 +SRCF+= int_util +SRCF+= lshrdi3 +SRCF+= lshrti3 +SRCF+= moddi3 +SRCF+= modti3 +SRCF+= muldc3 +SRCF+= muldi3 +SRCF+= mulodi4 +SRCF+= mulosi4 +SRCF+= muloti4 +SRCF+= mulsc3 +SRCF+= multi3 +SRCF+= mulvdi3 +SRCF+= mulvsi3 +SRCF+= mulvti3 +SRCF+= multc3 +SRCF+= mulxc3 +SRCF+= negdf2 +SRCF+= negdi2 +SRCF+= negsf2 +SRCF+= negti2 +SRCF+= negvdi2 +SRCF+= negvsi2 +SRCF+= negvti2 +SRCF+= paritydi2 +SRCF+= paritysi2 +SRCF+= parityti2 +SRCF+= popcountdi2 +SRCF+= popcountsi2 +SRCF+= popcountti2 +SRCF+= powidf2 +SRCF+= powisf2 +SRCF+= powitf2 +SRCF+= powixf2 +SRCF+= subvdi3 +SRCF+= subvsi3 +SRCF+= subvti3 +SRCF+= trampoline_setup +SRCF+= truncdfhf2 +SRCF+= truncsfhf2 +SRCF+= ucmpdi2 +SRCF+= ucmpti2 +SRCF+= udivdi3 +SRCF+= udivmoddi4 +SRCF+= udivmodsi4 +SRCF+= udivmodti4 +SRCF+= udivti3 +SRCF+= umoddi3 +SRCF+= umodti3 + +# 128-bit quad precision long double support, only used on arm64 +.if ${MACHINE_CPUARCH} == "aarch64" +SRCF+= addtf3 +SRCF+= comparetf2 +SRCF+= divtf3 +SRCF+= extenddftf2 +SRCF+= extendsftf2 +SRCF+= fixtfdi +SRCF+= fixtfsi +SRCF+= fixtfti +SRCF+= fixunstfdi +SRCF+= fixunstfsi +SRCF+= fixunstfti +SRCF+= floatunsitf +SRCF+= multf3 +SRCF+= subtf3 +SRCF+= trunctfdf2 +SRCF+= trunctfsf2 +.endif + +# These are already shipped by libc.a on arm and mips +.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +SRCF+= adddf3 +SRCF+= addsf3 +SRCF+= divdf3 +SRCF+= divsf3 +SRCF+= extendsfdf2 +SRCF+= fixdfsi +SRCF+= fixsfsi +SRCF+= floatsidf +SRCF+= floatsisf +SRCF+= muldf3 +SRCF+= mulsf3 +SRCF+= subdf3 +SRCF+= subsf3 +SRCF+= truncdfsf2 +.endif + +.if ${MACHINE_CPUARCH} != "arm" +SRCF+= comparedf2 +SRCF+= comparesf2 +.endif + +.if ${MACHINE_CPUARCH} != "mips" +SRCF+= divsi3 +SRCF+= modsi3 +SRCF+= udivsi3 +SRCF+= umodsi3 +.endif + +# FreeBSD-specific atomic intrinsics. +.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6" +.PATH: ${SRCTOP}/sys/arm/arm + +SRCF+= stdatomic +CFLAGS+= -DEMIT_SYNC_ATOMICS +.elif ${MACHINE_CPUARCH} == "mips" +.PATH: ${SRCTOP}/sys/mips/mips + +SRCF+= stdatomic +.endif + +.for file in ${SRCF} +.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ + && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) +SRCS+= ${file}vfp.S +. elif exists(${CRTSRC}/${CRTARCH}/${file}.S) +SRCS+= ${file}.S +. else +SRCS+= ${file}.c +. endif +.endfor + +.if ${MACHINE_CPUARCH} == "arm" +SRCS+= aeabi_div0.c +SRCS+= aeabi_idivmod.S +SRCS+= aeabi_ldivmod.S +SRCS+= aeabi_memcmp.S +SRCS+= aeabi_memcpy.S +SRCS+= aeabi_memmove.S +SRCS+= aeabi_memset.S +SRCS+= aeabi_uidivmod.S +SRCS+= aeabi_uldivmod.S +SRCS+= bswapdi2.S +SRCS+= bswapsi2.S +SRCS+= switch16.S +SRCS+= switch32.S +SRCS+= switch8.S +SRCS+= switchu8.S +SRCS+= sync_synchronize.S +.endif From owner-svn-src-all@freebsd.org Sun Dec 25 15:06:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 182C6C8F537; Sun, 25 Dec 2016 15:06:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB3A71C1C; Sun, 25 Dec 2016 15:06:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPF60sE066373; Sun, 25 Dec 2016 15:06:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPF60NF066370; Sun, 25 Dec 2016 15:06:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612251506.uBPF60NF066370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 25 Dec 2016 15:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310542 - stable/11/contrib/jemalloc/include/jemalloc/internal X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 15:06:01 -0000 Author: dim Date: Sun Dec 25 15:05:59 2016 New Revision: 310542 URL: https://svnweb.freebsd.org/changeset/base/310542 Log: Merge r304542 from projects/clang390-import (this fix was obsoleted in head by an update to jemalloc 4.3.1 in r308473): Temporarily fix "macro expansion producing 'defined' has undefined behavior" in jemalloc, by defining JEMALLOC_CLOCK_GETTIME in a portable manner. Modified: stable/11/contrib/jemalloc/include/jemalloc/internal/nstime.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/jemalloc/include/jemalloc/internal/nstime.h ============================================================================== --- stable/11/contrib/jemalloc/include/jemalloc/internal/nstime.h Sun Dec 25 14:58:50 2016 (r310541) +++ stable/11/contrib/jemalloc/include/jemalloc/internal/nstime.h Sun Dec 25 15:05:59 2016 (r310542) @@ -1,8 +1,11 @@ /******************************************************************************/ #ifdef JEMALLOC_H_TYPES -#define JEMALLOC_CLOCK_GETTIME defined(_POSIX_MONOTONIC_CLOCK) \ - && _POSIX_MONOTONIC_CLOCK >= 0 +#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 +#define JEMALLOC_CLOCK_GETTIME 1 +#else +#define JEMALLOC_CLOCK_GETTIME 0 +#endif typedef struct nstime_s nstime_t; From owner-svn-src-all@freebsd.org Sun Dec 25 15:39:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3F47C8E321; Sun, 25 Dec 2016 15:39:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73B0CFCD; Sun, 25 Dec 2016 15:39:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPFdq00079001; Sun, 25 Dec 2016 15:39:52 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPFdqFR079000; Sun, 25 Dec 2016 15:39:52 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612251539.uBPFdqFR079000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 25 Dec 2016 15:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310543 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 15:39:53 -0000 Author: bapt Date: Sun Dec 25 15:39:52 2016 New Revision: 310543 URL: https://svnweb.freebsd.org/changeset/base/310543 Log: Fix build of lib32 libraries for amd64 and powerpc64 with cross toolchain Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sun Dec 25 15:05:59 2016 (r310542) +++ head/Makefile.libcompat Sun Dec 25 15:39:52 2016 (r310543) @@ -85,7 +85,7 @@ LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTM .if ${X_COMPILER_VERSION} >= 40800 && \ (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ - -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ + -nostdinc++ .endif .endif From owner-svn-src-all@freebsd.org Sun Dec 25 16:21:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66304C90305; Sun, 25 Dec 2016 16:21:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E65875E; Sun, 25 Dec 2016 16:21:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPGLnIe097213; Sun, 25 Dec 2016 16:21:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPGLnsn097212; Sun, 25 Dec 2016 16:21:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612251621.uBPGLnsn097212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 25 Dec 2016 16:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310544 - stable/11/sys/dev/iscsi_initiator X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 16:21:50 -0000 Author: dim Date: Sun Dec 25 16:21:49 2016 New Revision: 310544 URL: https://svnweb.freebsd.org/changeset/base/310544 Log: MFC r305078 (by emaste): iscsi_initiator: make logout_req::reason unsigned char Previously this reported an error from Clang 3.9.0: implict conversion from 'int' to 'char' changes value from 128 to -128. Discussed with: dim, trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7699 Modified: stable/11/sys/dev/iscsi_initiator/iscsi.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi_initiator/iscsi.h ============================================================================== --- stable/11/sys/dev/iscsi_initiator/iscsi.h Sun Dec 25 15:39:52 2016 (r310543) +++ stable/11/sys/dev/iscsi_initiator/iscsi.h Sun Dec 25 16:21:49 2016 (r310544) @@ -356,7 +356,7 @@ typedef struct text_req { typedef struct logout_req { char cmd; // 0x06 - char reason; // 0 - close session + u_char reason; // 0 - close session // 1 - close connection // 2 - remove the connection for recovery char _2[2]; From owner-svn-src-all@freebsd.org Sun Dec 25 16:37:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 536C8C90607; Sun, 25 Dec 2016 16:37:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08E4BC8E; Sun, 25 Dec 2016 16:37:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPGbaWn003367; Sun, 25 Dec 2016 16:37:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPGba3s003365; Sun, 25 Dec 2016 16:37:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612251637.uBPGba3s003365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 25 Dec 2016 16:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310545 - in stable/11/sys: conf modules/bwn X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 16:37:37 -0000 Author: dim Date: Sun Dec 25 16:37:35 2016 New Revision: 310545 URL: https://svnweb.freebsd.org/changeset/base/310545 Log: MFC r305393: Make some additional -Wconstant-conversion warnings from clang 3.9.0 in bwn(4) non-fatal for now. Modified: stable/11/sys/conf/files stable/11/sys/modules/bwn/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sun Dec 25 16:21:49 2016 (r310544) +++ stable/11/sys/conf/files Sun Dec 25 16:37:35 2016 (r310545) @@ -1201,13 +1201,13 @@ dev/bwi/bwiphy.c optional bwi dev/bwi/bwirf.c optional bwi dev/bwi/if_bwi.c optional bwi dev/bwi/if_bwi_pci.c optional bwi pci -# XXX Work around clang warning, until maintainer approves fix. +# XXX Work around clang warnings, until maintainer approves fix. dev/bwn/if_bwn.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/bwn/if_bwn_pci.c optional bwn pci bhnd dev/bwn/if_bwn_phy_common.c optional bwn siba_bwn dev/bwn/if_bwn_phy_g.c optional bwn siba_bwn \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" + compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION}" dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/bwn/if_bwn_phy_n.c optional bwn siba_bwn Modified: stable/11/sys/modules/bwn/Makefile ============================================================================== --- stable/11/sys/modules/bwn/Makefile Sun Dec 25 16:21:49 2016 (r310544) +++ stable/11/sys/modules/bwn/Makefile Sun Dec 25 16:37:35 2016 (r310545) @@ -28,7 +28,7 @@ SRCS+= device_if.h bus_if.h pci_if.h opt .include -# XXX Work around clang warning, until maintainer approves fix. +# XXX Work around clang warnings, until maintainer approves fix. CWARNFLAGS.if_bwn.c= ${NO_WSOMETIMES_UNINITIALIZED} -CWARNFLAGS.if_bwn_phy_g.c= ${NO_WSOMETIMES_UNINITIALIZED} +CWARNFLAGS.if_bwn_phy_g.c= ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION} CWARNFLAGS.if_bwn_phy_lp.c= ${NO_WSOMETIMES_UNINITIALIZED} From owner-svn-src-all@freebsd.org Sun Dec 25 17:01:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFD7DC90E41; Sun, 25 Dec 2016 17:01:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EF651893; Sun, 25 Dec 2016 17:01:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPH1wxt011962; Sun, 25 Dec 2016 17:01:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPH1wMa011960; Sun, 25 Dec 2016 17:01:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612251701.uBPH1wMa011960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 25 Dec 2016 17:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310546 - in stable/11/sys: conf modules/si X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 17:01:59 -0000 Author: dim Date: Sun Dec 25 17:01:58 2016 New Revision: 310546 URL: https://svnweb.freebsd.org/changeset/base/310546 Log: Similar to r310545, make some additional -Wconstant-conversion warnings from clang 3.9.0 in si(4) non-fatal for now. Direct commit to stable/11, since si(4) has been deleted from head. Modified: stable/11/sys/conf/files stable/11/sys/modules/si/Makefile Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sun Dec 25 16:37:35 2016 (r310545) +++ stable/11/sys/conf/files Sun Dec 25 17:01:58 2016 (r310546) @@ -2558,7 +2558,8 @@ dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci -dev/si/si.c optional si +dev/si/si.c optional si \ + compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" dev/si/si2_z280.c optional si dev/si/si3_t225.c optional si dev/si/si_eisa.c optional si eisa Modified: stable/11/sys/modules/si/Makefile ============================================================================== --- stable/11/sys/modules/si/Makefile Sun Dec 25 16:37:35 2016 (r310545) +++ stable/11/sys/modules/si/Makefile Sun Dec 25 17:01:58 2016 (r310546) @@ -9,3 +9,5 @@ SRCS+= opt_compat.h opt_debug_si.h opt_e SRCS.DEV_EISA=si_eisa.c eisa_if.h .include + +CWARNFLAGS.si.c= ${NO_WCONSTANT_CONVERSION} From owner-svn-src-all@freebsd.org Sun Dec 25 17:37:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4668C90A9B; Sun, 25 Dec 2016 17:37:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3BFB1142; Sun, 25 Dec 2016 17:37:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPHbIZq027942; Sun, 25 Dec 2016 17:37:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPHbIhd027939; Sun, 25 Dec 2016 17:37:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612251737.uBPHbIhd027939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 25 Dec 2016 17:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310547 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 17:37:19 -0000 Author: tuexen Date: Sun Dec 25 17:37:18 2016 New Revision: 310547 URL: https://svnweb.freebsd.org/changeset/base/310547 Log: Remove a KASSERT which is not always true. In case of the empty queue tp->snd_holes and tcp_sackhole_insert() failing due to memory shortage, tp->snd_holes will be empty. This problem was hit when stress tests where performed by pho. PR: 215513 Reported by: pho Tested by: pho Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_sack.c Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Sun Dec 25 17:01:58 2016 (r310546) +++ head/sys/netinet/tcp_sack.c Sun Dec 25 17:37:18 2016 (r310547) @@ -470,9 +470,6 @@ tcp_sack_doack(struct tcpcb *tp, struct tp->snd_fack = sblkp->end; sack_changed = 1; } - /* We must have at least one SACK hole in scoreboard. */ - KASSERT(!TAILQ_EMPTY(&tp->snd_holes), - ("SACK scoreboard must not be empty")); cur = TAILQ_LAST(&tp->snd_holes, sackhole_head); /* Last SACK hole. */ /* * Since the incoming sack blocks are sorted, we can process them From owner-svn-src-all@freebsd.org Sun Dec 25 17:53:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 871CAC9003C; Sun, 25 Dec 2016 17:53:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23EF11D9E; Sun, 25 Dec 2016 17:53:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPHrCw0036011; Sun, 25 Dec 2016 17:53:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPHrBld035996; Sun, 25 Dec 2016 17:53:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612251753.uBPHrBld035996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 25 Dec 2016 17:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310550 - in vendor/heirloom-doctools/dist: checknr eqn eqn/eqn.d grap mpm pic ptx refer soelim troff troff/libhnj troff/nroff.d troff/troff.d troff/troff.d/dhtml troff/troff.d/dpost.d ... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 17:53:13 -0000 Author: bapt Date: Sun Dec 25 17:53:10 2016 New Revision: 310550 URL: https://svnweb.freebsd.org/changeset/base/310550 Log: Import heirloom doctools 2016-11-06 Added: vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in (contents, props changed) vendor/heirloom-doctools/dist/grap/grap.1.in (contents, props changed) vendor/heirloom-doctools/dist/ptx/ptx.1.in (contents, props changed) vendor/heirloom-doctools/dist/refer/lookbib.1.in (contents, props changed) vendor/heirloom-doctools/dist/refer/refer.1.in (contents, props changed) vendor/heirloom-doctools/dist/refer/roffbib.1.in (contents, props changed) vendor/heirloom-doctools/dist/soelim/soelim.1.in (contents, props changed) vendor/heirloom-doctools/dist/troff/nroff.d/nroff.1.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.1.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/B.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/BI.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/C.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CB.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CI.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CR.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CW.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/H.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HB.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HI.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/I.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/R.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/S.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/mcolor.7.in (contents, props changed) vendor/heirloom-doctools/dist/troff/troff.d/troff.1.in (contents, props changed) vendor/heirloom-doctools/dist/vgrind/vgrind.1.in (contents, props changed) Deleted: vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7 vendor/heirloom-doctools/dist/grap/grap.1 vendor/heirloom-doctools/dist/ptx/ptx.1 vendor/heirloom-doctools/dist/refer/lookbib.1 vendor/heirloom-doctools/dist/refer/refer.1 vendor/heirloom-doctools/dist/refer/roffbib.1 vendor/heirloom-doctools/dist/soelim/soelim.1 vendor/heirloom-doctools/dist/troff/nroff.d/nroff.1 vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.1 vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/B vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/BI vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/C vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CB vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CI vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CR vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CW vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/H vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HB vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HI vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/I vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/R vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/S vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/mcolor.7 vendor/heirloom-doctools/dist/troff/troff.d/troff.1 vendor/heirloom-doctools/dist/vgrind/vgrind.1 Modified: vendor/heirloom-doctools/dist/checknr/checknr.c vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk vendor/heirloom-doctools/dist/eqn/io.c vendor/heirloom-doctools/dist/grap/Makefile.mk vendor/heirloom-doctools/dist/grap/grapl.l vendor/heirloom-doctools/dist/grap/main.c vendor/heirloom-doctools/dist/mpm/page.cc vendor/heirloom-doctools/dist/pic/input.c vendor/heirloom-doctools/dist/pic/main.c vendor/heirloom-doctools/dist/pic/picl.l vendor/heirloom-doctools/dist/ptx/Makefile.mk vendor/heirloom-doctools/dist/ptx/ptx.c vendor/heirloom-doctools/dist/refer/Makefile.mk vendor/heirloom-doctools/dist/refer/hunt2.c vendor/heirloom-doctools/dist/soelim/Makefile.mk vendor/heirloom-doctools/dist/soelim/soelim.c vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk vendor/heirloom-doctools/dist/troff/libhnj/test.c vendor/heirloom-doctools/dist/troff/n1.c vendor/heirloom-doctools/dist/troff/n2.c vendor/heirloom-doctools/dist/troff/n3.c vendor/heirloom-doctools/dist/troff/n5.c vendor/heirloom-doctools/dist/troff/n7.c vendor/heirloom-doctools/dist/troff/n8.c vendor/heirloom-doctools/dist/troff/n9.c vendor/heirloom-doctools/dist/troff/ni.c vendor/heirloom-doctools/dist/troff/nii.c vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk vendor/heirloom-doctools/dist/troff/nroff.d/n6.c vendor/heirloom-doctools/dist/troff/nroff.d/pt.h vendor/heirloom-doctools/dist/troff/tdef.h vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/afm.c vendor/heirloom-doctools/dist/troff/troff.d/afm.h vendor/heirloom-doctools/dist/troff/troff.d/dhtml/dhtml.l vendor/heirloom-doctools/dist/troff/troff.d/dhtml/lib.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/misc.c vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/makefont.c vendor/heirloom-doctools/dist/troff/troff.d/otf.c vendor/heirloom-doctools/dist/troff/troff.d/otfdump.c vendor/heirloom-doctools/dist/troff/troff.d/pt.h vendor/heirloom-doctools/dist/troff/troff.d/t10.c vendor/heirloom-doctools/dist/troff/troff.d/t6.c vendor/heirloom-doctools/dist/troff/troff.d/ta.c vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/Makefile.mk vendor/heirloom-doctools/dist/troff/troff.d/troff.h vendor/heirloom-doctools/dist/vgrind/Makefile.mk vendor/heirloom-doctools/dist/vgrind/regexp.c vendor/heirloom-doctools/dist/vgrind/vgrindefs.c Modified: vendor/heirloom-doctools/dist/checknr/checknr.c ============================================================================== --- vendor/heirloom-doctools/dist/checknr/checknr.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/checknr/checknr.c Sun Dec 25 17:53:10 2016 (r310550) @@ -427,7 +427,7 @@ prop(int i) /* ARGSUSED */ static void -chkcmd(char *line, char *mac) +chkcmd(char *line __unused, char *mac) { int i; Modified: vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk Sun Dec 25 17:53:10 2016 (r310550) @@ -8,7 +8,7 @@ FLAGS = -I. -I.. -I../../include $(DEFIN .c.o: $(CC) $(_CFLAGS) $(FLAGS) -c $< -all: eqn +all: eqn eqnchar.7 eqn: $(OBJ) $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o eqn @@ -29,10 +29,13 @@ install: $(INSTALL) -c -m 644 eqnchar.7 $(ROOT)$(MANDIR)/man7/eqnchar.7 clean: - rm -f $(OBJ) eqn e.c y.tab.* core log *~ + rm -f $(OBJ) eqn e.c y.tab.* core log *~ eqnchar.7 mrproper: clean +eqnchar.7: eqnchar.7.in + sed 's"/usr/pub/"$(ROOT)$(PUBDIR)/"' eqnchar.7.in > $@ + diacrit.o: ../diacrit.c ../e.h y.tab.h eqnbox.o: ../eqnbox.c ../e.h font.o: ../font.c ../e.h Added: vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in Sun Dec 25 17:53:10 2016 (r310550) @@ -0,0 +1,212 @@ +'\" e +.\" Sccsid @(#)eqnchar.7b 1.2 (gritter) 12/9/05 +.\" Derived from eqnchar(7), Unix 7th edition: +.\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" Redistributions of source code and documentation must retain the +.\" above copyright notice, this list of conditions and the following +.\" disclaimer. +.\" 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. +.\" All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed or owned by Caldera +.\" International, Inc. +.\" Neither the name of Caldera International, Inc. nor the names of +.\" other contributors may be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA +.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE +.\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.TH EQNCHAR 7 "12/9/05" "Heirloom Documentation Tools" "BSD System Compatibility" +.EQ +tdefine ciplus % "\o'\(pl\(ci'" % +ndefine ciplus % O+ % +tdefine citimes % "\o'\(mu\(ci'" % +ndefine citimes % Ox % +tdefine =wig % "\(eq\h'-\w'\(eq'u-\w'\s-2\(ap'u/2u'\v'-.4m'\s-2\z\(ap\(ap\s+2\v'.4m'\h'\w'\(eq'u-\w'\s-2\(ap'u/2u'" % +ndefine =wig % ="~" % +tdefine bigstar % "\o'\(pl\(mu'" % +ndefine bigstar % X|- % +tdefine =dot % "\z\(eq\v'-.6m'\h'.2m'\s+2.\s-2\v'.6m'\h'.1m'" % +ndefine =dot % = dot % +tdefine orsign % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'.15m'\s+2" % +ndefine orsign % \e/ % +tdefine andsign % "\s-2\v'-.15m'\z\(sl\(sl\h'-.05m'\z\e\e\v'.15m'\s+2" % +ndefine andsign % /\e % +tdefine =del % "\v'.3m'\z=\v'-.6m'\h'.3m'\s-1\(*D\s+1\v'.3m'" % +ndefine =del % = to DELTA % +tdefine oppA % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'-.15m'\h'-.75m'\z-\z-\h'.2m'\z-\z-\v'.3m'\h'.4m'\s+2" % +ndefine oppA % V- % +tdefine oppE %"\s-3\v'.2m'\z\(em\v'-.5m'\z\(em\v'-.5m'\z\(em\v'.55m'\h'.9m'\z\(br\z\(br\v'.25m'\s+3" % +ndefine oppE % E/ % +tdefine incl % "\s-1\z\(or\h'-.1m'\v'-.45m'\z\(em\v'.7m'\z\(em\v'.2m'\(em\v'-.45m'\s+1" % +ndefine incl % C_ % +tdefine nomem % "\o'\(mo\(sl'" % +ndefine nomem % C-/ % +tdefine angstrom % "\fR\zA\v'-.3m'\h'.2m'\(de\v'.3m'\fP\h'.2m'" % +ndefine angstrom % A to o % +tdefine star %{ roman "\v'.5m'\s+3*\s-3\v'-.5m'"}% +ndefine star % * % +tdefine || % \(or\(or % +tdefine wig % "\z>\v'.4m'\(ap\v'-.4m'" % +ndefine >wig %{ > from "~" }% +tdefine langle % "\s-3\b'\(sl\e'\s0" % +ndefine langle %<% +tdefine rangle % "\s-3\b'\e\(sl'\s0" % +ndefine rangle %>% +tdefine hbar % "\zh\v'-.6m'\h'.05m'\(ru\v'.6m'" % +ndefine hbar % h\u-\d % +ndefine ppd % _| % +tdefine ppd % "\o'\(ru\s-2\(or\s+2'" % +tdefine <-> % "\o'\(<-\(->'" % +ndefine <-> % "<-->" % +tdefine <=> % "\s-2\z<\v'.05m'\h'.2m'\z=\h'.55m'=\h'-.6m'\v'-.05m'>\s+2" % +ndefine <=> % "<=>" % +tdefine |< % "\o'<\(or'" % +ndefine |< % <| % +tdefine |> % "\o'>\(or'" % +ndefine |> % |> % +tdefine ang % "\v'-.15m'\z\s-2\(sl\s+2\v'.15m'\(ru" % +ndefine ang % /_ % +tdefine rang % "\z\(or\h'.15m'\(ru" % +ndefine rang % L % +tdefine 3dot % "\v'-.8m'\z.\v'.5m'\z.\v'.5m'.\v'-.2m'" % +ndefine 3dot % .\u.\u.\d\d % +tdefine thf % ".\v'-.5m'.\v'.5m'." % +ndefine thf % ..\u.\d % +tdefine quarter % roman \(14 % +ndefine quarter % 1/4 % +tdefine 3quarter % roman \(34 % +ndefine 3quarter % 3/4 % +tdefine degree % \(de % +ndefine degree % nothing sup o % +tdefine square % \(sq % +ndefine square % [] % +tdefine circle % \(ci % +ndefine circle % O % +tdefine blot % "\fB\(sq\fP" % +ndefine blot % HIX % +tdefine bullet % \(bu % +ndefine bullet % oxe % +tdefine -wig % "\(~=" % +ndefine -wig % - to "~" % +tdefine wig % \(ap % +ndefine wig % "~" % +tdefine prop % \(pt % +ndefine prop % oc % +tdefine empty % \(es % +ndefine empty % O/ % +tdefine member % \(mo % +ndefine member % C- % +tdefine cup % \(cu % +ndefine cup % U % +define cap % \(ca % +define subset % \(sb % +define supset % \(sp % +define !subset % \(ib % +define !supset % \(ip % +.EN +.SH NAME +eqnchar \- special character definitions for eqn +.SH SYNOPSIS +.HP +.ad l +.nh +.B eqn /usr/pub/eqnchar +.RB [ files ] +.B | troff +.RB [ options ] +.HP +.B neqn /usr/pub/eqnchar +.RB [ files ] +.B | nroff +.RB [ options ] +.br +.hy 1 +.ad b +.SH DESCRIPTION +.I Eqnchar +contains +.I troff +and +.I nroff +character definitions for constructing characters that are not +available on the Graphic Systems typesetter. +These definitions are primarily intended for use with +.I eqn +and +.IR neqn . +It contains +definitions for the following characters +.PP +.nf +.ta \w'angstrom 'u \n(.lu/3u +\w'angstrom 'u \n(.lu*2u/3u +\w'angstrom 'u +.EQ +"ciplus" ciplus "|\||" || "square" square +.EN +.EQ +"citimes" citimes "langle" langle "circle" circle +.EN +.EQ +"wig" wig "rangle" rangle "blot" blot +.EN +.EQ +"-wig" -wig "hbar" hbar "bullet" bullet +.EN +.EQ +">wig" >wig "ppd" ppd "prop" prop +.EN +.EQ +"" <-> "empty" empty +.EN +.EQ +"=wig" =wig "<=>" <=> "member" member +.EN +.EQ +"star" star "|\|" |< "nomem" nomem +.EN +.EQ +"bigstar" bigstar "|\|>" |> "cup" cup +.EN +.EQ +"=dot" =dot "ang" ang "cap" cap +.EN +.EQ +"orsign" orsign "rang" rang "incl" incl +.EN +.EQ +"andsign" andsign "3dot" 3dot "subset" subset +.EN +.EQ +"=del" =del "thf" thf "supset" supset +.EN +.EQ +"oppA" oppA "quarter" quarter "!subset" !subset +.EN +.EQ +"oppE" oppE "3quarter" 3quarter "!supset" !supset +.EN +.EQ +"angstrom" angstrom "degree" degree +.EN +.SH FILES +/usr/pub/eqnchar +.SH SEE ALSO +troff(1), eqn(1) Modified: vendor/heirloom-doctools/dist/eqn/io.c ============================================================================== --- vendor/heirloom-doctools/dist/eqn/io.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/eqn/io.c Sun Dec 25 17:53:10 2016 (r310550) @@ -25,6 +25,7 @@ #include #include #include +#include "global.h" static char *in; /* input buffer */ static size_t insize; /* input buffer size */ @@ -283,7 +284,7 @@ setfile(int argc, char **argv) { } void -yyerror(char *unused) {;} +yyerror(char *unused __unused) {;} void init(void) { Modified: vendor/heirloom-doctools/dist/grap/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/grap/Makefile.mk Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/grap/Makefile.mk Sun Dec 25 17:53:10 2016 (r310550) @@ -8,7 +8,7 @@ YFLAGS = -d .c.o: $(CC) $(_CFLAGS) $(FLAGS) -c $< -all: grap.c grapl.c grap +all: grap.c grapl.c grap grap.1 grap: $(OBJ) $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -lm -o grap @@ -23,10 +23,13 @@ install: $(INSTALL) -c -m 644 grap.1 $(ROOT)$(MANDIR)/man1/grap.1 clean: - rm -f $(OBJ) grapl.c grap.c y.tab.h grap core log *~ + rm -f $(OBJ) grapl.c grap.c y.tab.h grap core log *~ grap.1 mrproper: clean +grap.1: grap.1.in + sed 's"/usr/ucblib/"$(ROOT)$(LIBDIR)/"' grap.1.in > $@ + coord.o: coord.c grap.h y.tab.h for.o: for.c grap.h y.tab.h frame.o: frame.c grap.h y.tab.h Added: vendor/heirloom-doctools/dist/grap/grap.1.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/dist/grap/grap.1.in Sun Dec 25 17:53:10 2016 (r310550) @@ -0,0 +1,430 @@ +.\" +.\" Changes by Gunnar Ritter, Freiburg i. Br., Germany, October 2005. +.\" +.\" Derived from Plan 9 v4 /opt/unix/plan9v4/sys/man/1/grap +.\" +.\" Copyright (C) 2003, Lucent Technologies Inc. and others. +.\" All Rights Reserved. +.\" +.\" Distributed under the terms of the Lucent Public License Version 1.02. +.\" +.\" Sccsid @(#)grap.1 1.5 (gritter) 2/2/07 +.TH GRAP 1 "2/2/07" "Heirloom Documentation Tools" "User Commands" +.SH NAME +grap \- pic preprocessor for drawing graphs +.SH SYNOPSIS +\fBgrap\fR [\fB\-SU\fR] [\fIfile\fR] +.SH DESCRIPTION +.I Grap +is a +.IR pic (1) +preprocessor for drawing graphs on a typesetter. +Graphs are surrounded by the +.I troff +`commands' +.B \&.G1 +and +.BR \&.G2 . +Data are scaled and plotted, +with tick marks supplied automatically. +Commands exist to modify the frame, +add labels, override the default ticks, +change the plotting style, +define coordinate ranges and transformations, +and include data from files. +In addition, +.I grap +provides the same loops, conditionals, and macro processing that +.I pic +does. +.PP +.BI frame +.B ht +.I e +.B wid +.I e +.B top +.B dotted +.IR ... : +Set the frame around the graph to specified +.B ht +and +.BR wid ; +default is 2 by 3 (inches). +The line +.I styles +.RB ( dotted , +.BR dashed , +.BR invis , +.BR solid +(default)) +of the +.I sides +.RB ( top , +.BR bot , +.BR left , +.BR right ) +of the frame can be set +independently. +.PP +.B label +.I side +.B \&"a label" +.B \&"as a set of strings" +.IR adjust : +Place label on specified side; default side is bottom. +.I adjust +is +.B up +(or +.B down +.B left +.BR right ) +.I expr +to shift default position; +.B width +.I expr +sets the width explicitly. +.PP +.BI ticks +.I side +.B in +.B at +.IR "optname expr, expr, ..." : +Put ticks on +.I side +at +.I "expr, ..., +and label with +.I \&"expr"\f1. +If any +.I expr +is followed by "...", label tick with "...", +and turn off all automatic labels. +If "..." contains +.BR %f 's, +they will be interpreted as +.B printf +formatting instructions for the tick value. +Ticks point +.B in +or +.B out +(default out). +Tick iterator: instead of +.B at +.IR \&... , +use +.BI from +.I expr +.B to +.I expr +.B by +.I "op expr +where +.I op +is optionally +.B +\-*/ +for additive or multiplicative steps. +.B by +can be omitted, to give steps of size 1. +If no ticks are requested, they are supplied automatically; +suppress this with +.B ticks +.BR off . +Automatic ticks normally +leave a margin of 7% on each side; set this to anything by +.B margin +.B = +.IR expr . +.PP +.B grid +.I "side linedesc" +.B at +.IR "optname expr, expr, ..." : +Draw grids perpendicular to +.I side +in style +.I linedesc +at +.I "expr, ....\& +Iterators and labels work as with ticks. +.PP +.B coord +.I optname +.B x +.I "min, max" +.B y +.I "min, max" +.B "log x +.BR " log y" : +Set range of coords and optional log scaling on either or both. +This overrides computation of data range. +Default value of +.I optname +is current coordinate system +(each +.B coord +defines a new coordinate system). +.PP +.B plot +.I \&"str" +.B at +.IR point ; +.B +.I \&"str" +.B at +.IR point : +Put +.I str +at +.IR point . +Text position can be qualified with +.BR rjust , +.BR ljust , +.BR above , +.BR below +after "...". +.PP +.B line +.B from +.I point +.B to +.IR "point linedesc" : +Draw line from here to there. +.B arrow +works in place of +.BR line . +.PP +.B next +.I optname +.B at +.IR "point linedesc" : +Continue plot of data in +.I optname to +.IR point ; +default is current. +.PP +.BI draw +.IR "optname linedesc ..." : +Set mode for +.BR next : +use this style from now on, +and plot "..." at each point (if given). +.PP +.BI new +.IR "optname linedesc ..." : +Set mode for +.BR next , +but disconnect from previous. +.PP +A list of numbers +.I "x y1 y2 y3 ... +is treated as +.B plot +.B bullet +.B at +.IR x,y1 ; +.B plot +.B bullet +.B at +.IR x,y2 ; +etc., or as +.B next +.B at +.I x,y1 +etc., if +.B draw +is specified. +Abscissae of 1,2,3,... are provided if there is only one input number per line. +.PP +A +point +.I "optname expr, expr +maps the point to the named coordinate system. +A +.I linedesc +is one of +.B dot +.B dash +.B invis +.B solid +optionally followed by an expression. +.PP +.BI define +.I name +.BI { whatever } \f1: +Define a macro. +There are macros already defined for standard plotting +symbols like +.BR bullet , +.BR circle , +.BR star , +.BR plus , +etc., in +.BR /sys/lib/grap.defines , +which is included if it exists. +.PP +.I var +.B = +.IR expr : +Evaluate an expression. +Operators are +.B= +.B + +.B \- +.B * +and +.BR / . +Functions are +.B log +and +.B exp +(both base 10), +.BR sin , +.BR cos , +.BR sqrt ; +.B rand +returns random number on [0,1); +.BI max( e , e )\f1, +.BI min( e , e )\f1, +.BI int( e )\f1. +.PP +.B print +.IR expr ; +.B print +\fR"\f2...\fR"\f1: +As a debugging aid, print +.I expr +or +.I string +on the standard error. +.PP +.B copy +\fR"\fIfile name\fR"\fR: +Include this file right here. +.PP +.B copy +.B thru +.IR macro : +Pass rest of input (until +.BR \&.G2 ) +through +.IR macro , +treating each field (non-blank, or "...") as an argument. +.I macro +can be the name of a macro previously defined, +or the body of one in place, like +.BR "/plot $1 at $2,$3/" . +.PP +.B copy +.B thru +.I macro +.B until +\fR"\fIstring\fR"\fR: +Stop copy when input is +.I string +(left-justified). +.PP +.BI pic +.IR "remainder of line" : +Copy to output with leading blanks removed. +.PP +.BI graph +.IR "Name pic-position" : +Start a new frame, place it at specified position, +e.g., +.B graph +.B Thing2 +.BR "with .sw at Thing1.se + (0.1,0)" . +.I Name +must be capitalized to keep +.I pic +happy. +.PP +.BI \&. "anything at beginning of +.IR line : +Copied verbatim. +.PP +.B sh +.BI % anything +.BR % : +Pass everything between the +.BR % 's +to the shell; +as with macros, +.B % +may be any character and +.I anything +may include newlines. +The +.B \-S +option disables execution of the shell command; +the +.B \-U +option reverts the effect of a previous +.IR \-S . +.PP +.B # +.IR anything : +A comment, which is discarded. +.PP +Order is mostly irrelevant; no category is mandatory. +Any arguments on the +.B \&.G1 +line are placed on the generated +.B \&.PS +line for +.IR pic . +.\".SH EXAMPLES +.\".EX +.\".ps -1 +.\".vs -1 +.\"\&.G1 +.\"frame ht 1 top invis right invis +.\"coord x 0, 10 y 1, 3 log y +.\"ticks left in at 1 "bottommost tick", 2,3 "top tick" +.\"ticks bot in from 0 to 10 by 2 +.\"label bot "silly graph" +.\"label left "left side label" "here" +.\"grid left dashed at 2.5 +.\"copy thru / circle at $1,$2 / +.\"1 1 +.\"2 1.5 +.\"3 2 +.\"4 1.5 +.\"10 3 +.\"\&.G2 +.\".G1 +.\"frame ht 1 top invis right invis +.\"coord x 0, 10 y 1, 3 log y +.\"ticks left in at 1 "bottommost tick", 2,3 "top tick" +.\"ticks bot in from 0 to 10 by 2 +.\"label bot "silly graph" +.\"label left "left side label" "here" +.\"grid left dashed at 2.5 +.\"copy thru / circle at $1,$2 / +.\"1 1 +.\"2 1.5 +.\"3 2 +.\"4 1.5 +.\"10 3 +.\".G2 +.\".ps +.\".vs +.\".EE +.SH FILES +.TP +.B /usr/ucblib/grap.defines +definitions of standard plotting characters, e.g., bullet +.\".SH SOURCE +.\".B /sys/src/cmd/grap +.SH "SEE ALSO" +.IR pic (1), +.IR troff (1) +.br +J. L. Bentley and B. W. Kernighan, +``GRAP\(emA Language for Typesetting Graphs'', +.I +Unix Research System Programmer's Manual, +Tenth Edition, Volume 2. Modified: vendor/heirloom-doctools/dist/grap/grapl.l ============================================================================== --- vendor/heirloom-doctools/dist/grap/grapl.l Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/grap/grapl.l Sun Dec 25 17:53:10 2016 (r310550) @@ -12,6 +12,7 @@ /* Sccsid @(#)grapl.l 1.4 (gritter) 11/22/05 */ %} +%option nounput %Start A str def thru sh %{ @@ -237,10 +238,3 @@ WS [ \t] . { CADD; } %% - -#ifdef FLEX_SCANNER -void xxcruft(void) -{ - unput(0); -} -#endif /* FLEX_SCANNER */ Modified: vendor/heirloom-doctools/dist/grap/main.c ============================================================================== --- vendor/heirloom-doctools/dist/grap/main.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/grap/main.c Sun Dec 25 17:53:10 2016 (r310550) @@ -17,8 +17,12 @@ #include #include #include "grap.h" +#include "global.h" #include "y.tab.h" +static void onintr(int n); +static void fpecatch(int n); + int dbg = 0; #define GRAPDEFINES LIBDIR "/grap.defines" @@ -48,8 +52,6 @@ extern void getdata(void); int main(int argc, char *argv[]) { - extern void onintr(int), fpecatch(int); - if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); signal(SIGFPE, fpecatch); @@ -102,14 +104,14 @@ main(int argc, char *argv[]) } /*ARGSUSED*/ -void onintr(int n) +static void onintr(int n __unused) { if (!dbg) unlink(tempfile); exit(1); } -void fpecatch(int n) +static void fpecatch(int n) { WARNING("floating point exception"); onintr(n); Modified: vendor/heirloom-doctools/dist/mpm/page.cc ============================================================================== --- vendor/heirloom-doctools/dist/mpm/page.cc Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/mpm/page.cc Sun Dec 25 17:53:10 2016 (r310550) @@ -147,25 +147,9 @@ static void justify(stream *scratch, int } } -// If r were added to s, would the height of the composed result be at most maxht? -int wouldfit(range *r, stream *s, int maxht) -{ - if (r->rawht() + s->rawht() <= maxht) - return 1; // the conservative test succeeded - stream scratch; // local playground for costly test - for (stream cd = *s; cd.more(); cd.advance()) - scratch.append(cd.current()); - scratch.append(r); - movefloats(&scratch, ((double) scratch.rawht())/maxht); - trimspace(&scratch); - int retval = scratch.height() <= maxht; - scratch.freeall(); - return retval; -} - // If s1 were added to s, would the height of the composed result be at most maxht? // The computational structure is similar to that above. -int wouldfit(stream *s1, stream *s, int maxht) +static int wouldfit(stream *s1, stream *s, int maxht) { if (s1->rawht() + s->rawht() <= maxht) return 1; @@ -316,7 +300,7 @@ void multicol::dump() } // From the head of queue qp, peel off a piece whose raw height is at most space. -int peeloff(stream *qp, int space) +static int peeloff(stream *qp, int space) { stream *s1 = qp->current()->children(); if (!(s1 && s1->more() && s1->current()->height() <= space)) Modified: vendor/heirloom-doctools/dist/pic/input.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/input.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/pic/input.c Sun Dec 25 17:53:10 2016 (r310550) @@ -492,8 +492,6 @@ void eprint(void) /* try to print contex ep = ebuf; } -void yywrap(void) {} - static char *newfile = 0; /* filename for file copy */ char *untilstr = 0; /* string that terminates a thru */ int thru = 0; /* 1 if copying thru macro */ Modified: vendor/heirloom-doctools/dist/pic/main.c ============================================================================== --- vendor/heirloom-doctools/dist/pic/main.c Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/pic/main.c Sun Dec 25 17:53:10 2016 (r310550) @@ -17,6 +17,7 @@ #include "pic.h" #include "y.tab.h" +static void reset(void); extern const char version[]; obj **objlist = 0; /* store the elements here */ @@ -208,7 +209,7 @@ void getdata(void) char *p, *buf = NULL, *buf1 = NULL; size_t size = 0; int ln; - void reset(void), openpl(char *), closepl(char *); + void openpl(char *), closepl(char *); int yyparse(void); curfile->lineno = 0; @@ -281,7 +282,7 @@ void getdata(void) free(buf1); } -void reset(void) +static void reset(void) { obj *op; int i; Modified: vendor/heirloom-doctools/dist/pic/picl.l ============================================================================== --- vendor/heirloom-doctools/dist/pic/picl.l Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/pic/picl.l Sun Dec 25 17:53:10 2016 (r310550) @@ -12,6 +12,8 @@ /* Sccsid @(#)picl.l 1.9 (gritter) 8/6/06 */ %} +%option noyywrap +%option nounput %Start A str def xsc br thru sh %e 1700 %k 150 @@ -47,7 +49,6 @@ extern struct symtab symtab[]; int yyback(int *, int); int yylook(void); -int yywrap(void); #define CADD cbuf[clen++]=yytext[0]; \ if (clen>=CBUFLEN-1) { WARNING("string too long", cbuf); BEGIN A; } Modified: vendor/heirloom-doctools/dist/ptx/Makefile.mk ============================================================================== --- vendor/heirloom-doctools/dist/ptx/Makefile.mk Sun Dec 25 17:40:18 2016 (r310549) +++ vendor/heirloom-doctools/dist/ptx/Makefile.mk Sun Dec 25 17:53:10 2016 (r310550) @@ -5,7 +5,7 @@ FLAGS = -DLIBDIR='"$(LIBDIR)"' $(EUC) -I .c.o: $(CC) $(_CFLAGS) $(FLAGS) -c $< -all: ptx +all: ptx ptx.1 ptx: $(OBJ) $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o ptx @@ -18,6 +18,12 @@ install: $(INSTALL) -c -m 644 eign $(ROOT)$(LIBDIR)/eign clean: - rm -f $(OBJ) ptx core log *~ + rm -f $(OBJ) ptx core log *~ ptx.1 mrproper: clean + +ptx.1: ptx.1.in + sed -e "s'/usr/5bin/sort'`which sort`'" \ + -e 's"/usr/ucblib/doctools/tmac/"$(ROOT)$(BINDIR)/"' \ + -e 's"/usr/ucblib/"$(ROOT)$(LIBDIR)/"' \ + ptx.1.in > $@ Added: vendor/heirloom-doctools/dist/ptx/ptx.1.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/dist/ptx/ptx.1.in Sun Dec 25 17:53:10 2016 (r310550) @@ -0,0 +1,158 @@ +.\" +.\" Sccsid @(#)ptx.1 1.6 (gritter) 2/2/07 +.\" Parts taken from ptx(1), Unix 7th edition: +.\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" Redistributions of source code and documentation must retain the +.\" above copyright notice, this list of conditions and the following +.\" disclaimer. +.\" 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. +.\" All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed or owned by Caldera +.\" International, Inc. +.\" Neither the name of Caldera International, Inc. nor the names of +.\" other contributors may be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA +.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE +.\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.Dd February 2, 2007 +.Dt PTX 1 +.Os +.Sh NAME +.Nm ptx +.Nd permuted index +.Sh SYNOPSIS +.Nm +.Op Fl ftr +.Op Fl w Ar n +.Op Fl g Ar n +.Op Fl o Ar only +.Op Fl i Ar ignore +.Op Fl b Ar break +.Op Ar input Op Ar output +.Sh DESCRIPTION +.Nm +generates a permuted index to file +.Ar input +on file +.Ar output +(standard input and output default). +It has three phases: the first does the permutation, generating +one line for each keyword in an input line. +The keyword is rotated to the front. +The permuted file is then +sorted. +Finally, the sorted lines are rotated so the keyword +comes at the middle of the page. +.Nm +produces output in the form: +.Bd -literal -offset XXXXX +\&.xx "tail" "before keyword" "keyword and after" "head" +.Ed +.Pp +where .xx may be an +.Cm nroff +or +.Xr troff 1 +macro +for user-defined formatting. +Once choice for this macro is supplied in the +.Sq Fl mptx +macro package. +The +.Em before keyword +and +.Em keyword and after +fields incorporate as much of the line as will fit +around the keyword when it is printed at the middle of the page. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 25 17:54:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F5ADC900C0; Sun, 25 Dec 2016 17:54:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 037FA1F07; Sun, 25 Dec 2016 17:54:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPHsO4l036102; Sun, 25 Dec 2016 17:54:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPHsN3v036095; Sun, 25 Dec 2016 17:54:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612251754.uBPHsN3v036095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 25 Dec 2016 17:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310551 - in vendor/heirloom-doctools/20161106: . checknr col eqn eqn/checkeq.d eqn/eqn.d eqn/eqnchar.d eqn/neqn.d grap include mpm pic picpack ptx refer soelim tbl troff troff/libhnj t... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 17:54:25 -0000 Author: bapt Date: Sun Dec 25 17:54:23 2016 New Revision: 310551 URL: https://svnweb.freebsd.org/changeset/base/310551 Log: Tag import of heirloom doctools 2016-11-06 Added: vendor/heirloom-doctools/20161106/ - copied from r306788, vendor/heirloom-doctools/dist/ vendor/heirloom-doctools/20161106/compat.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/compat.c vendor/heirloom-doctools/20161106/eqn/eqn.d/eqnchar.7.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/eqn/eqn.d/eqnchar.7.in vendor/heirloom-doctools/20161106/grap/grap.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/grap.1.in vendor/heirloom-doctools/20161106/ptx/ptx.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/ptx/ptx.1.in vendor/heirloom-doctools/20161106/refer/lookbib.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/lookbib.1.in vendor/heirloom-doctools/20161106/refer/refer.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/refer.1.in vendor/heirloom-doctools/20161106/refer/roffbib.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/roffbib.1.in vendor/heirloom-doctools/20161106/soelim/soelim.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/soelim/soelim.1.in vendor/heirloom-doctools/20161106/troff/nroff.d/nroff.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/nroff.1.in vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.1.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/B.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/B.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/BI.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/BI.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/C.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/C.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CB.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CB.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CI.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CI.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CR.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CR.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CW.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/CW.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/H.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/H.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HB.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HB.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HI.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/HI.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/I.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/I.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/R.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/R.in vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/S.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/S.in vendor/heirloom-doctools/20161106/troff/troff.d/tmac.d/mcolor.7.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/mcolor.7.in vendor/heirloom-doctools/20161106/troff/troff.d/troff.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/troff.1.in vendor/heirloom-doctools/20161106/vgrind/vgrind.1.in - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/vgrind.1.in Replaced: vendor/heirloom-doctools/20161106/checknr/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/checknr/Makefile.mk vendor/heirloom-doctools/20161106/checknr/checknr.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/checknr/checknr.c vendor/heirloom-doctools/20161106/col/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/col/Makefile.mk vendor/heirloom-doctools/20161106/configure - copied unchanged from r307921, vendor/heirloom-doctools/dist/configure vendor/heirloom-doctools/20161106/eqn/checkeq.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/checkeq.d/checkeq.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/checkeq.d/checkeq.c vendor/heirloom-doctools/20161106/eqn/diacrit.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/diacrit.c vendor/heirloom-doctools/20161106/eqn/e.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/e.h vendor/heirloom-doctools/20161106/eqn/eqn.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/eqn/eqn.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/eqnbox.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnbox.c vendor/heirloom-doctools/20161106/eqn/eqnchar.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/eqnchar.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/eqnchar.d/genutf8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/eqnchar.d/genutf8.c vendor/heirloom-doctools/20161106/eqn/funny.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/funny.c vendor/heirloom-doctools/20161106/eqn/integral.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/integral.c vendor/heirloom-doctools/20161106/eqn/io.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/eqn/io.c vendor/heirloom-doctools/20161106/eqn/lex.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/lex.c vendor/heirloom-doctools/20161106/eqn/lookup.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/lookup.c vendor/heirloom-doctools/20161106/eqn/matrix.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/matrix.c vendor/heirloom-doctools/20161106/eqn/neqn.d/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/eqn/neqn.d/Makefile.mk vendor/heirloom-doctools/20161106/eqn/paren.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/paren.c vendor/heirloom-doctools/20161106/eqn/shift.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/shift.c vendor/heirloom-doctools/20161106/eqn/text.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/eqn/text.c vendor/heirloom-doctools/20161106/grap/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/Makefile.mk vendor/heirloom-doctools/20161106/grap/coord.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/coord.c vendor/heirloom-doctools/20161106/grap/grap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/grap.h vendor/heirloom-doctools/20161106/grap/grapl.l - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/grapl.l vendor/heirloom-doctools/20161106/grap/input.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/input.c vendor/heirloom-doctools/20161106/grap/main.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/grap/main.c vendor/heirloom-doctools/20161106/grap/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/grap/misc.c vendor/heirloom-doctools/20161106/include/global.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/include/global.h vendor/heirloom-doctools/20161106/mk.config - copied unchanged from r307921, vendor/heirloom-doctools/dist/mk.config vendor/heirloom-doctools/20161106/mpm/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/mpm/Makefile.mk vendor/heirloom-doctools/20161106/mpm/misc.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/mpm/misc.h vendor/heirloom-doctools/20161106/mpm/page.cc - copied unchanged from r310550, vendor/heirloom-doctools/dist/mpm/page.cc vendor/heirloom-doctools/20161106/pic/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/pic/Makefile.mk vendor/heirloom-doctools/20161106/pic/arcgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/arcgen.c vendor/heirloom-doctools/20161106/pic/blockgen.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/blockgen.c vendor/heirloom-doctools/20161106/pic/for.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/for.c vendor/heirloom-doctools/20161106/pic/input.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/pic/input.c vendor/heirloom-doctools/20161106/pic/main.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/pic/main.c vendor/heirloom-doctools/20161106/pic/misc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/misc.c vendor/heirloom-doctools/20161106/pic/pic.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pic.h vendor/heirloom-doctools/20161106/pic/picl.l - copied unchanged from r310550, vendor/heirloom-doctools/dist/pic/picl.l vendor/heirloom-doctools/20161106/pic/pltroff.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/pltroff.c vendor/heirloom-doctools/20161106/pic/symtab.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/pic/symtab.c vendor/heirloom-doctools/20161106/picpack/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/picpack/Makefile.mk vendor/heirloom-doctools/20161106/picpack/picpack.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/picpack/picpack.c vendor/heirloom-doctools/20161106/ptx/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/ptx/Makefile.mk vendor/heirloom-doctools/20161106/ptx/ptx.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/ptx/ptx.c vendor/heirloom-doctools/20161106/refer/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/Makefile.mk vendor/heirloom-doctools/20161106/refer/deliv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/deliv2.c vendor/heirloom-doctools/20161106/refer/glue1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue1.c vendor/heirloom-doctools/20161106/refer/glue3.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/refer/glue3.c vendor/heirloom-doctools/20161106/refer/glue4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue4.c vendor/heirloom-doctools/20161106/refer/glue5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/glue5.c vendor/heirloom-doctools/20161106/refer/hunt1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt1.c vendor/heirloom-doctools/20161106/refer/hunt2.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/refer/hunt2.c vendor/heirloom-doctools/20161106/refer/hunt5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt5.c vendor/heirloom-doctools/20161106/refer/hunt6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt6.c vendor/heirloom-doctools/20161106/refer/hunt7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt7.c vendor/heirloom-doctools/20161106/refer/hunt8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt8.c vendor/heirloom-doctools/20161106/refer/hunt9.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/hunt9.c vendor/heirloom-doctools/20161106/refer/inv1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv1.c vendor/heirloom-doctools/20161106/refer/inv2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv2.c vendor/heirloom-doctools/20161106/refer/inv3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv3.c vendor/heirloom-doctools/20161106/refer/inv5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv5.c vendor/heirloom-doctools/20161106/refer/inv6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/inv6.c vendor/heirloom-doctools/20161106/refer/mkey1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey1.c vendor/heirloom-doctools/20161106/refer/mkey2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/mkey2.c vendor/heirloom-doctools/20161106/refer/refer..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer..c vendor/heirloom-doctools/20161106/refer/refer0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer0.c vendor/heirloom-doctools/20161106/refer/refer1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer1.c vendor/heirloom-doctools/20161106/refer/refer2.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer2.c vendor/heirloom-doctools/20161106/refer/refer3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer3.c vendor/heirloom-doctools/20161106/refer/refer5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer5.c vendor/heirloom-doctools/20161106/refer/refer6.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer6.c vendor/heirloom-doctools/20161106/refer/refer7.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer7.c vendor/heirloom-doctools/20161106/refer/refer8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/refer8.c vendor/heirloom-doctools/20161106/refer/shell.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/shell.c vendor/heirloom-doctools/20161106/refer/sortbib.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/sortbib.c vendor/heirloom-doctools/20161106/refer/tick.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/refer/tick.c vendor/heirloom-doctools/20161106/soelim/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/soelim/Makefile.mk vendor/heirloom-doctools/20161106/soelim/soelim.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/soelim/soelim.c vendor/heirloom-doctools/20161106/tbl/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/tbl/Makefile.mk vendor/heirloom-doctools/20161106/tbl/t..c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t..c vendor/heirloom-doctools/20161106/tbl/t0.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t0.c vendor/heirloom-doctools/20161106/tbl/t1.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t1.c vendor/heirloom-doctools/20161106/tbl/t3.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t3.c vendor/heirloom-doctools/20161106/tbl/t4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t4.c vendor/heirloom-doctools/20161106/tbl/t5.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t5.c vendor/heirloom-doctools/20161106/tbl/t8.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/t8.c vendor/heirloom-doctools/20161106/tbl/tb.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tb.c vendor/heirloom-doctools/20161106/tbl/tc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tc.c vendor/heirloom-doctools/20161106/tbl/te.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/te.c vendor/heirloom-doctools/20161106/tbl/tg.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tg.c vendor/heirloom-doctools/20161106/tbl/tm.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tm.c vendor/heirloom-doctools/20161106/tbl/ts.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/ts.c vendor/heirloom-doctools/20161106/tbl/tt.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tt.c vendor/heirloom-doctools/20161106/tbl/tu.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tu.c vendor/heirloom-doctools/20161106/tbl/tv.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/tbl/tv.c vendor/heirloom-doctools/20161106/troff/ext.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/ext.h vendor/heirloom-doctools/20161106/troff/libhnj/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/libhnj/Makefile.mk vendor/heirloom-doctools/20161106/troff/libhnj/hnjalloc.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/libhnj/hnjalloc.c vendor/heirloom-doctools/20161106/troff/libhnj/test.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/libhnj/test.c vendor/heirloom-doctools/20161106/troff/n1.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n1.c vendor/heirloom-doctools/20161106/troff/n2.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n2.c vendor/heirloom-doctools/20161106/troff/n3.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n3.c vendor/heirloom-doctools/20161106/troff/n4.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/n4.c vendor/heirloom-doctools/20161106/troff/n5.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n5.c vendor/heirloom-doctools/20161106/troff/n7.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n7.c vendor/heirloom-doctools/20161106/troff/n8.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n8.c vendor/heirloom-doctools/20161106/troff/n9.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/n9.c vendor/heirloom-doctools/20161106/troff/ni.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/ni.c vendor/heirloom-doctools/20161106/troff/nii.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nii.c vendor/heirloom-doctools/20161106/troff/nroff.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/nroff.d/draw.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/draw.c vendor/heirloom-doctools/20161106/troff/nroff.d/n10.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/nroff.d/n10.c vendor/heirloom-doctools/20161106/troff/nroff.d/n6.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/n6.c vendor/heirloom-doctools/20161106/troff/nroff.d/pt.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/nroff.d/pt.h vendor/heirloom-doctools/20161106/troff/tdef.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/tdef.h vendor/heirloom-doctools/20161106/troff/troff.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/afm.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/afm.c vendor/heirloom-doctools/20161106/troff/troff.d/afm.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/afm.h vendor/heirloom-doctools/20161106/troff/troff.d/devaps/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/devaps/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/dhtml/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/dhtml/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/dhtml/dhtml.l - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dhtml/dhtml.l vendor/heirloom-doctools/20161106/troff/troff.d/dhtml/lib.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dhtml/lib.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/color.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/color.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/dpost.h vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/draw.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/draw.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/gen.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/gen.h vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/misc.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/misc.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/ps_include.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/ps_include.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/request.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/request.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/request.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/dpost.d/request.h vendor/heirloom-doctools/20161106/troff/troff.d/draw.c - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/draw.c vendor/heirloom-doctools/20161106/troff/troff.d/font/Makefile.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/troff/troff.d/font/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/makefont.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/font/devhtml/makefont.c vendor/heirloom-doctools/20161106/troff/troff.d/fontmap.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.c vendor/heirloom-doctools/20161106/troff/troff.d/fontmap.h - copied unchanged from r307809, vendor/heirloom-doctools/dist/troff/troff.d/fontmap.h vendor/heirloom-doctools/20161106/troff/troff.d/otf.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/otf.c vendor/heirloom-doctools/20161106/troff/troff.d/otfdump.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/otfdump.c vendor/heirloom-doctools/20161106/troff/troff.d/pt.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/pt.h vendor/heirloom-doctools/20161106/troff/troff.d/t10.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/t10.c vendor/heirloom-doctools/20161106/troff/troff.d/t6.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/t6.c vendor/heirloom-doctools/20161106/troff/troff.d/ta.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/ta.c vendor/heirloom-doctools/20161106/troff/troff.d/tmac.d/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/tmac.d/Makefile.mk vendor/heirloom-doctools/20161106/troff/troff.d/troff.h - copied unchanged from r310550, vendor/heirloom-doctools/dist/troff/troff.d/troff.h vendor/heirloom-doctools/20161106/version.mk - copied unchanged from r307921, vendor/heirloom-doctools/dist/version.mk vendor/heirloom-doctools/20161106/vgrind/Makefile.mk - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/Makefile.mk vendor/heirloom-doctools/20161106/vgrind/regexp.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/regexp.c vendor/heirloom-doctools/20161106/vgrind/vfontedpr.c - copied unchanged from r307809, vendor/heirloom-doctools/dist/vgrind/vfontedpr.c vendor/heirloom-doctools/20161106/vgrind/vgrindefs.c - copied unchanged from r310550, vendor/heirloom-doctools/dist/vgrind/vgrindefs.c Deleted: vendor/heirloom-doctools/20161106/eqn/eqn.d/eqnchar.7 vendor/heirloom-doctools/20161106/grap/grap.1 vendor/heirloom-doctools/20161106/picpack/getopt.c vendor/heirloom-doctools/20161106/ptx/ptx.1 vendor/heirloom-doctools/20161106/refer/lookbib.1 vendor/heirloom-doctools/20161106/refer/refer.1 vendor/heirloom-doctools/20161106/refer/roffbib.1 vendor/heirloom-doctools/20161106/soelim/soelim.1 vendor/heirloom-doctools/20161106/troff/nroff.d/nroff.1 vendor/heirloom-doctools/20161106/troff/troff.d/devaps/getopt.c vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/dpost.1 vendor/heirloom-doctools/20161106/troff/troff.d/dpost.d/getopt.c vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/B vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/BI vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/C vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CB vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CI vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CR vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/CW vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/H vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HB vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/HI vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/I vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/R vendor/heirloom-doctools/20161106/troff/troff.d/font/devhtml/S vendor/heirloom-doctools/20161106/troff/troff.d/tmac.d/mcolor.7 vendor/heirloom-doctools/20161106/troff/troff.d/troff.1 vendor/heirloom-doctools/20161106/vgrind/vgrind.1 Copied: vendor/heirloom-doctools/20161106/checknr/Makefile.mk (from r307921, vendor/heirloom-doctools/dist/checknr/Makefile.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/checknr/Makefile.mk Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/checknr/Makefile.mk) @@ -0,0 +1,21 @@ +OBJ = checknr.o + +FLAGS = $(DEFINES) -I../include + +.c.o: + $(CC) $(_CFLAGS) $(FLAGS) -c $< + +all: checknr + +checknr: $(OBJ) + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o checknr + +install: + $(INSTALL) -c checknr $(ROOT)$(BINDIR)/checknr + $(STRIP) $(ROOT)$(BINDIR)/checknr + $(INSTALL) -c -m 644 checknr.1 $(ROOT)$(MANDIR)/man1/checknr.1 + +clean: + rm -f $(OBJ) checknr core log *~ + +mrproper: clean Copied: vendor/heirloom-doctools/20161106/checknr/checknr.c (from r310550, vendor/heirloom-doctools/dist/checknr/checknr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/checknr/checknr.c Sun Dec 25 17:54:23 2016 (r310551, copy of r310550, vendor/heirloom-doctools/dist/checknr/checknr.c) @@ -0,0 +1,637 @@ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + + +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* from OpenSolaris "checknr.c 1.8 05/06/02 SMI" */ + +/* + * Portions Copyright (c) 2005 Gunnar Ritter, Freiburg i. Br., Germany + */ +#if __GNUC__ >= 3 && __GNUC_MINOR__ >= 4 || __GNUC__ >= 4 +#define USED __attribute__ ((used)) +#elif defined __GNUC__ +#define USED __attribute__ ((unused)) +#else +#define USED +#endif +static const char sccsid[] USED = "@(#)/usr/ucb/checknr.sl 1.3 (gritter) 11/6/05"; + +/* + * checknr: check an nroff/troff input file for matching macro calls. + * we also attempt to match size and font changes, but only the embedded + * kind. These must end in \s0 and \fP resp. Maybe more sophistication + * later but for now think of these restrictions as contributions to + * structured typesetting. + */ +#include +#include +#include +#include +#include +#include "global.h" + +static int maxstk; /* Stack size */ +#define MAXBR 100 /* Max number of bracket pairs known */ +#define MAXCMDS 500 /* Max number of commands known */ + +/* + * The stack on which we remember what we've seen so far. + */ +static struct stkstr { + int opno; /* number of opening bracket */ + int pl; /* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */ + int parm; /* parm to size, font, etc */ + int lno; /* line number the thing came in in */ +} *stk; +static int stktop; + +/* + * The kinds of opening and closing brackets. + */ +static struct brstr { + char *opbr; + char *clbr; +} br[MAXBR] = { + /* A few bare bones troff commands */ +#define SZ 0 + { "sz", "sz" }, /* also \s */ +#define FT 1 + { "ft", "ft" }, /* also \f */ + /* the -mm package */ + { "AL", "LE" }, + { "AS", "AE" }, + { "BL", "LE" }, + { "BS", "BE" }, + { "DF", "DE" }, + { "DL", "LE" }, + { "DS", "DE" }, + { "FS", "FE" }, + { "ML", "LE" }, + { "NS", "NE" }, + { "RL", "LE" }, + { "VL", "LE" }, + /* the -ms package */ + { "AB", "AE" }, + { "BD", "DE" }, + { "CD", "DE" }, + { "DS", "DE" }, + { "FS", "FE" }, + { "ID", "DE" }, + { "KF", "KE" }, + { "KS", "KE" }, + { "LD", "DE" }, + { "LG", "NL" }, + { "QS", "QE" }, + { "RS", "RE" }, + { "SM", "NL" }, + { "XA", "XE" }, + { "XS", "XE" }, + /* The -me package */ + { "(b", ")b" }, + { "(c", ")c" }, + { "(d", ")d" }, + { "(f", ")f" }, + { "(l", ")l" }, + { "(q", ")q" }, + { "(x", ")x" }, + { "(z", ")z" }, + /* Things needed by preprocessors */ + { "EQ", "EN" }, + { "TS", "TE" }, + /* Refer */ + { "[", "]" }, + { NULL, NULL } +}; + +/* + * All commands known to nroff, plus macro packages. + * Used so we can complain about unrecognized commands. + */ +static char *knowncmds[MAXCMDS] = { +"$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t", +"(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", +"+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", +"@c", "@e", "@f", "@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", +"AE", "AF", "AI", "AL", "AM", "AS", "AT", "AU", "AX", "B", "B1", "B2", +"BD", "BE", "BG", "BL", "BS", "BT", "BX", "C1", "C2", "CD", "CM", "CT", +"D", "DA", "DE", "DF", "DL", "DS", "DT", "EC", "EF", "EG", "EH", "EM", +"EN", "EQ", "EX", "FA", "FD", "FE", "FG", "FJ", "FK", "FL", "FN", "FO", +"FQ", "FS", "FV", "FX", "H", "HC", "HD", "HM", "HO", "HU", "I", "ID", +"IE", "IH", "IM", "IP", "IX", "IZ", "KD", "KE", "KF", "KQ", "KS", "LB", +"LC", "LD", "LE", "LG", "LI", "LP", "MC", "ME", "MF", "MH", "ML", "MR", +"MT", "ND", "NE", "NH", "NL", "NP", "NS", "OF", "OH", "OK", "OP", "P", +"P1", "PF", "PH", "PP", "PT", "PX", "PY", "QE", "QP", "QS", "R", "RA", +"RC", "RE", "RL", "RP", "RQ", "RS", "RT", "S", "S0", "S2", "S3", "SA", +"SG", "SH", "SK", "SM", "SP", "SY", "T&", "TA", "TB", "TC", "TD", "TE", +"TH", "TL", "TM", "TP", "TQ", "TR", "TS", "TX", "UL", "US", "UX", "VL", +"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "[", "[-", "[0", +"[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", +"][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", +"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", +"chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", "ds", +"dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", +"evc", "ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", +"fp", "ft", "ftr", "fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", +"ht", "hw", "hx", "hy", "hylang", "i", "ie", "if", "ig", "in", "ip", +"it", "ix", "kern", "kernafter", "kernbefore", "kernpair", "lc", "lg", +"lhang", "lc_ctype", "li", "ll", "ln", "lo", "lp", "ls", "lt", "m1", +"m2", "m3", "m4", "mc", "mk", "mo", "n1", "n2", "na", "ne", "nf", "nh", +"nl", "nm", "nn", "np", "nr", "ns", "nx", "of", "oh", "os", "pa", +"papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", "q", +"r", "rb", "rd", "re", "recursionlimit", "return", "rhang", "rm", +"rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", "so", +"sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", +"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", +0 +}; + +static int lineno; /* current line number in input file */ +static char *line; /* the current line */ +static size_t linesize; /* allocated size of current line */ +static char *cfilename; /* name of current file */ +static int nfiles; /* number of files to process */ +static int fflag; /* -f: ignore \f */ +static int sflag; /* -s: ignore \s */ +static int ncmds; /* size of knowncmds */ +static int slot; /* slot in knowncmds found by binsrch */ + +static void growstk(void); +static void usage(void); +static void process(FILE *f); +static void complain(int i); +static void prop(int i); +static void chkcmd(char *line, char *mac); +static void nomatch(char *mac); +static int eq(char *s1, char *s2); +static void pe(int lineno); +static void checkknown(char *mac); +static void addcmd(char *line); +static void addmac(char *mac); +static int binsrch(char *mac); + +static void +growstk(void) +{ + stktop++; + if (stktop >= maxstk) { + maxstk *= 2; + stk = realloc(stk, sizeof *stk * maxstk); + } +} + +int +main(int argc, char **argv) +{ + FILE *f; + int i; + char *cp, *cq, c; + + stk = calloc(sizeof *stk, maxstk = 100); + /* Figure out how many known commands there are */ + while (knowncmds[ncmds]) + ncmds++; + while (argc > 1 && argv[1][0] == '-') { + switch (argv[1][1]) { + + /* -a: add pairs of macros */ + case 'a': + /* look for empty macro slots */ + for (i = 0; br[i].opbr; i++) + ; + cp = &argv[1][3]; + while (*cp) { + size_t s; + if (i >= MAXBR - 3) { + printf("Only %d known pairs allowed\n", + MAXBR/2); + exit(1); + } + for (cq = cp; *cq && *cq != '.'; cq++); + if (*cq != '.') + usage(); + *cq = 0; + s = cq - cp + 1; + br[i].opbr = malloc(s); + n_strcpy(br[i].opbr, cp, s); + *cq = '.'; + cp = &cq[1]; + for (cq = cp; *cq && *cq != '.'; cq++); + c = *cq; + *cq = 0; + s = cq - cp + 1; + br[i].clbr = malloc(s); + n_strcpy(br[i].clbr, cp, s); + *cq = c; + cp = c ? &cq[1] : cq; + /* knows pairs are also known cmds */ + addmac(br[i].opbr); + addmac(br[i].clbr); + i++; + } + break; + + /* -c: add known commands */ + case 'c': + cp = &argv[1][3]; + while (*cp) { + for (cq = cp; *cq && *cq != '.'; cq++); + c = *cq; + *cq = 0; + addmac(cp); + *cq = c; + cp = c ? &cq[1] : cq; + } + break; + + /* -f: ignore font changes */ + case 'f': + fflag = 1; + break; + + /* -s: ignore size changes */ + case 's': + sflag = 1; + break; + default: + usage(); + } + argc--; argv++; + } + + nfiles = argc - 1; + + if (nfiles > 0) { + for (i = 1; i < argc; i++) { + cfilename = argv[i]; + f = fopen(cfilename, "r"); + if (f == NULL) { + perror(cfilename); + exit(1); + } + else { + process(f); + fclose(f); + } + } + } else { + cfilename = "stdin"; + process(stdin); + } + return (0); +} + +static void +usage(void) +{ + printf("Usage: checknr -s -f -a.xx.yy.xx.yy... -c.xx.xx.xx...\n"); + exit(1); +} + +static void +process(FILE *f) +{ + int i, n; + char mac[512]; /* The current macro or nroff command */ + int pl; + + stktop = -1; + for (lineno = 1; getline(&line, &linesize, f) > 0; lineno++) { + if (line[0] == '.') { + /* + * find and isolate the macro/command name. + */ + strncpy(mac, line+1, sizeof mac-1)[sizeof mac-1] = 0; + if (isspace(mac[0]&0377)) { + pe(lineno); + printf("Empty command\n"); + } else { + for (i = 1; mac[i]; i++) + if (isspace(mac[i]&0377)) { + mac[i] = 0; + break; + } + } + + /* + * Is it a known command? + */ + checkknown(mac); + + /* + * Should we add it? + */ + if (eq(mac, "de")) + addcmd(line); + + chkcmd(line, mac); + } + + /* + * At this point we process the line looking + * for \s and \f. + */ + for (i = 0; line[i]; i++) + if (line[i] == '\\' && (i == 0 || line[i-1] != '\\')) { + if (!sflag && line[++i] == 's') { + pl = line[++i]&0377; + if (isdigit(pl)) { + n = pl - '0'; + pl = ' '; + } else + n = 0; + while (isdigit(line[++i]&0377)) + n = 10 * n + line[i] - '0'; + i--; + if (n == 0) { + if (stk[stktop].opno == SZ) { + stktop--; + } else { + pe(lineno); + printf( + "unmatched \\s0\n"); + } + } else { + growstk(); + stk[stktop].opno = SZ; + stk[stktop].pl = pl; + stk[stktop].parm = n; + stk[stktop].lno = lineno; + } + } else if (!fflag && line[i] == 'f') { + n = line[++i]; + if (n == 'P') { + if (stk[stktop].opno == FT) { + stktop--; + } else { + pe(lineno); + printf( + "unmatched \\fP\n"); + } + } else { + growstk(); + stk[stktop].opno = FT; + stk[stktop].pl = 1; + stk[stktop].parm = n; + stk[stktop].lno = lineno; + } + } + } + } + /* + * We've hit the end and look at all this stuff that hasn't been + * matched yet! Complain, complain. + */ + for (i = stktop; i >= 0; i--) { + complain(i); + } +} + +static void +complain(int i) +{ + pe(stk[i].lno); + printf("Unmatched "); + prop(i); + printf("\n"); +} + +static void +prop(int i) +{ + if (stk[i].pl == 0) + printf(".%s", br[stk[i].opno].opbr); + else switch (stk[i].opno) { + case SZ: + printf("\\s%c%d", stk[i].pl, stk[i].parm); + break; + case FT: + printf("\\f%c", stk[i].parm); + break; + default: + printf("Bug: stk[%d].opno = %d = .%s, .%s", + i, stk[i].opno, br[stk[i].opno].opbr, + br[stk[i].opno].clbr); + } +} + +/* ARGSUSED */ +static void +chkcmd(char *line __unused, char *mac) +{ + int i; + + /* + * Check to see if it matches top of stack. + */ + if (stktop >= 0 && eq(mac, br[stk[stktop].opno].clbr)) + stktop--; /* OK. Pop & forget */ + else { + /* No. Maybe it's an opener */ + for (i = 0; br[i].opbr; i++) { + if (eq(mac, br[i].opbr)) { + /* Found. Push it. */ + growstk(); + stk[stktop].opno = i; + stk[stktop].pl = 0; + stk[stktop].parm = 0; + stk[stktop].lno = lineno; + break; + } + /* + * Maybe it's an unmatched closer. + * NOTE: this depends on the fact + * that none of the closers can be + * openers too. + */ + if (eq(mac, br[i].clbr)) { + nomatch(mac); + break; + } + } + } +} + +static void +nomatch(char *mac) +{ + int i, j; + + /* + * Look for a match further down on stack + * If we find one, it suggests that the stuff in + * between is supposed to match itself. + */ + for (j = stktop; j >= 0; j--) + if (eq(mac, br[stk[j].opno].clbr)) { + /* Found. Make a good diagnostic. */ + if (j == stktop-2) { + /* + * Check for special case \fx..\fR and don't + * complain. + */ + if (stk[j+1].opno == FT && + stk[j+1].parm != 'R' && + stk[j+2].opno == FT && + stk[j+2].parm == 'R') { + stktop = j -1; + return; + } + /* + * We have two unmatched frobs. Chances are + * they were intended to match, so we mention + * them together. + */ + pe(stk[j+1].lno); + prop(j+1); + printf(" does not match %d: ", stk[j+2].lno); + prop(j+2); + printf("\n"); + } else for (i = j+1; i <= stktop; i++) { + complain(i); + } + stktop = j-1; + return; + } + /* Didn't find one. Throw this away. */ + pe(lineno); + printf("Unmatched .%s\n", mac); +} + +/* eq: are two strings equal? */ +static int +eq(char *s1, char *s2) +{ + return (strcmp(s1, s2) == 0); +} + +/* print the first part of an error message, given the line number */ +static void +pe(int lineno) +{ + if (nfiles > 1) + printf("%s: ", cfilename); + printf("%d: ", lineno); +} + +static void +checkknown(char *mac) +{ + + if (eq(mac, ".")) + return; + if (binsrch(mac) >= 0) + return; + if (mac[0] == '\\' && mac[1] == '"') /* comments */ + return; + + pe(lineno); + printf("Unknown command: .%s\n", mac); +} + +/* + * We have a .de xx line in "line". Add xx to the list of known commands. + */ +static void +addcmd(char *line) +{ + char *mac; + + /* grab the macro being defined */ + mac = line+4; + while (isspace(*mac&0377)) + mac++; + if (*mac == 0) { + pe(lineno); + printf("illegal define: %s\n", line); + return; + } + mac[2] = 0; + if (isspace(mac[1]&0377) || mac[1] == '\\') + mac[1] = 0; + addmac(mac); +} + +/* + * Add mac to the list. We should really have some kind of tree + * structure here but this is a quick-and-dirty job and I just don't + * have time to mess with it. (I wonder if this will come back to haunt + * me someday?) Anyway, I claim that .de is fairly rare in user + * nroff programs, and the loop below is pretty fast. + */ +static void +addmac(char *mac) +{ + char **src, **dest, **loc; + size_t s; + + if (binsrch(mac) >= 0) { /* it's OK to redefine something */ +#ifdef DEBUG + printf("binsrch(%s) -> already in table\n", mac); +#endif + return; + } + /* binsrch sets slot as a side effect */ +#ifdef DEBUG +printf("binsrch(%s) -> %d\n", mac, slot); +#endif + if (ncmds >= MAXCMDS) { + printf("Only %d known commands allowed\n", MAXCMDS); + exit(1); + } + loc = &knowncmds[slot]; + src = &knowncmds[ncmds-1]; + dest = src+1; + while (dest > loc) + *dest-- = *src--; + s = strlen(mac) + 1; + *loc = malloc(s); + n_strcpy(*loc, mac, s); + ncmds++; +#ifdef DEBUG + printf("after: %s %s %s %s %s, %d cmds\n", + knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], + knowncmds[slot+1], knowncmds[slot+2], ncmds); +#endif +} + +/* + * Do a binary search in knowncmds for mac. + * If found, return the index. If not, return -1. + */ +static int +binsrch(char *mac) +{ + char *p; /* pointer to current cmd in list */ + int d; /* difference if any */ + int mid; /* mid point in binary search */ + int top, bot; /* boundaries of bin search, inclusive */ + + top = ncmds-1; + bot = 0; + while (top >= bot) { + mid = (top+bot)/2; + p = knowncmds[mid]; + d = p[0] - mac[0]; + if (d == 0) + d = strcmp(&p[1], &mac[1]); + if (d == 0) + return (mid); + if (d < 0) + bot = mid + 1; + else + top = mid - 1; + } + slot = bot; /* place it would have gone */ + return (-1); +} Copied: vendor/heirloom-doctools/20161106/col/Makefile.mk (from r307921, vendor/heirloom-doctools/dist/col/Makefile.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/col/Makefile.mk Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/col/Makefile.mk) @@ -0,0 +1,22 @@ +BIN = col + +OBJ = col.o + +FLAGS = $(DEFINES) -I../include + +all: $(BIN) + +$(BIN): $(OBJ) + $(CC) ${_CFLAGS} $(_LDFLAGS) $(OBJ) -o $(BIN) + +install: + $(INSTALL) -c $(BIN) $(ROOT)$(BINDIR)/$(BIN) + $(STRIP) $(ROOT)$(BINDIR)/$(BIN) + +clean: + rm -f $(OBJ) $(BIN) core log *~ + +mrproper: clean + +.c.o: + ${CC} ${_CFLAGS} $(FLAGS) -c $< Copied: vendor/heirloom-doctools/20161106/compat.c (from r307809, vendor/heirloom-doctools/dist/compat.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/compat.c Sun Dec 25 17:54:23 2016 (r310551, copy of r307809, vendor/heirloom-doctools/dist/compat.c) @@ -0,0 +1,47 @@ +/* Carsten Kunze, 2016 */ + +#include + +#ifndef HAVE_STRLCPY +size_t +strlcpy(char *dst, const char *src, size_t dstsize) { + size_t srcsize; + /* Not conform to strlcpy, but avoids to access illegal memory in case + * of unterminated strings */ + for (srcsize = 0; srcsize < dstsize; srcsize++) + if (!src[srcsize]) + break; + if (dstsize > srcsize) + dstsize = srcsize; + else if (dstsize) + dstsize--; + if (dstsize) + /* assumes non-overlapping buffers */ + memcpy(dst, src, dstsize); + dst[dstsize] = 0; + return srcsize; +} +#endif + +#ifndef HAVE_STRLCAT +size_t +strlcat(char *dst, const char *src, size_t dstsize) { + size_t ld, ls; + for (ld = 0; ld < dstsize - 1; ld++) + if (!dst[ld]) + break; + dst += ld; + dstsize -= ld; + for (ls = 0; ls < dstsize; ls++) + if (!src[ls]) + break; + if (dstsize > ls) + dstsize = ls; + else if (dstsize) + dstsize--; + if (dstsize) + memcpy(dst, src, dstsize); + dst[dstsize] = 0; + return ld + ls; +} +#endif Copied: vendor/heirloom-doctools/20161106/configure (from r307921, vendor/heirloom-doctools/dist/configure) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/configure Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/configure) @@ -0,0 +1,236 @@ +#!/bin/sh + +# Copyright (c) 2016, Carsten Kunze +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +usage () { + echo "Usage: $0 [-s]" + echo " -s Silence output" + exit $1 +} + +SFLAG= +MAKE= +DEFS= +LIB_LEX= +LIB_CURSES= +cat /dev/null > compat.h + +while [ $# -gt 0 ]; do + case $1 in + -s) SFLAG=1;; + *) + echo "$0: $1: Unknown option" >&2 + usage 1;; + esac + shift +done + +check_for () { + [ -e $LOG ] && echo >>$LOG + A="Checking for $1 ... " + echo "$A" >>$LOG + [ -z "$SFLAG" ] && printf "$A" +} + +compile () { + rm -f ${TMPNAM}.o $TMPNAM $OUT $ERR + $MAKE -f $OUTMK $TMPNAM > $OUT 2> $ERR + RESULT=$? + cat $OUT $ERR >> $LOG + if [ $RESULT -eq 0 ]; then true; else false; fi +} + +test_result () { + RESULT=$? + RESULT_TEXT=${1:-0} # 1: omit "no", 2: say nothing + if [ $RESULT -eq 0 ]; then + echo success >>$LOG + [ -z "$SFLAG" -a $RESULT_TEXT -lt 2 ] && \ + echo "yes$PASS_TEXT" + PASS_TEXT= + [ -e $TMPC ] && rm -f $TMPC + true + else + [ -z "$SFLAG" -a $RESULT_TEXT -lt 1 ] && echo no + if [ -e $TMPC ]; then + echo "Failed program:" >>$LOG + pr -n -t $TMPC >>$LOG + rm -f $TMPC + fi + false + fi +} + +gen_mk () { + [ $# -eq 0 ] && rm -f $OUTMK + [ -n "$LEX" ] && echo "LEX=$LEX" >> $OUTMK + [ -n "$FLOAT_STORE" ] && echo "FLOAT_STORE=$FLOAT_STORE" >> $OUTMK + [ -n "$DEFS" ] && echo "DEFINES=$DEFS" >> $OUTMK + [ -n "$INCDIR_CURSES" ] && echo "INCDIR_CURSES=$INCDIR_CURSES" >> $OUTMK + [ -n "$RPATH_CURSES" ] && echo "RPATH_CURSES=$RPATH_CURSES" >> $OUTMK + [ -n "$LIBDIR_CURSES" ] && echo "LIBDIR_CURSES=$LIBDIR_CURSES" \ + >> $OUTMK + [ -n "$LIB_CURSES" ] && echo "LIB_CURSES=$LIB_CURSES" >> $OUTMK + [ -n "$LIB_AVLBST" ] && echo "LIB_AVLBST=$LIB_AVLBST" >> $OUTMK + [ -n "$LIB_LEX" ] && echo "LIB_LEX=$LIB_LEX" >> $OUTMK + [ -n "$__CDBG" ] && echo "__CDBG=$__CDBG" >> $OUTMK + [ -n "$__CLDBG" ] && echo "__CLDBG=$__CLDBG" >> $OUTMK + cat $INMK >> $OUTMK || exit 1 +} +check_make () { + check_for "make(1)" + + cat <$TMPMK +all: + true +EOT + make -f $TMPMK >> $LOG 2>&1 + test_result && { + MAKE=make + return + } + + echo "Failed makefile:" >>$LOG + pr -n -t $TMPMK >>$LOG + + check_for "bmake(1)" + + cat <$TMPMK +all: + true +EOT + bmake -f $TMPMK >> $LOG 2>&1 + test_result && MAKE=bmake +} +check_lex () { + check_for '$(LEX)' + + cat <$TMPL +%% +%% +int main() { return 0; } +int yywrap(void) { return 0; } +EOT + compile + test_result && return + + check_for 'flex(1)' + + LEX=flex + gen_mk + compile + test_result && return + + check_for 'lex(1)' + + LEX=lex + gen_mk + compile + test_result && return +} +check_strlcpy () { + check_for "strlcpy(3)" + + cat <$TMPC +#include +int +main(int argc, char **argv) { + char a[10]; + (void)argc; + strlcpy(a, *argv, sizeof a); + return 0; +} +EOT + compile + if test_result; then + DEFS="$DEFS -DHAVE_STRLCPY" + else + H=compat.h + grep -q '' $H 2>/dev/null || cat <>$H +#include +EOT + cat <>$H +size_t strlcpy(char *, const char *, size_t); +EOT + fi +} +check_strlcat () { + check_for "strlcat(3)" + + cat <$TMPC +#include +int +main(int argc, char **argv) { + char a[10]; + (void)argc; + *a = 0; + strlcat(a, *argv, sizeof a); + return 0; +} +EOT + compile + if test_result; then + DEFS="$DEFS -DHAVE_STRLCAT" + else + H=compat.h + grep -q '' $H 2>/dev/null || cat <>$H +#include +EOT + cat <>$H +size_t strlcat(char *, const char *, size_t); +EOT + fi +} +check_wcslcpy () { + check_for "wcslcpy(3)" + + cat <$TMPC +#include +#include +int +main() { + wchar_t a, b; + a = getwchar(); + wcslcpy(&b, &a, 1); + return 0; +} +EOT + compile + test_result && DEFS="$DEFS -DHAVE_WCSLCPY" +} + [ ! -s compat.h ] && rm compat.h +OUTMK=cfg.mk +INMK=mk.config +CFG=config +TMPNAM=.$CFG +TMPMK=${TMPNAM}.mk +TMPC=${TMPNAM}.c +TMPL=${TMPNAM}.l +OUT=${TMPNAM}.out +ERR=${TMPNAM}.err +LOG=${CFG}.log +rm -f $LOG +gen_mk + +check_make +#check_Sanitizer +check_lex +check_strlcpy +check_strlcat +check_wcslcpy + +gen_mk +cat version.mk >> $OUTMK || exit 1 +rm -f $TMPNAM* Copied: vendor/heirloom-doctools/20161106/eqn/checkeq.d/Makefile.mk (from r307921, vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/heirloom-doctools/20161106/eqn/checkeq.d/Makefile.mk Sun Dec 25 17:54:23 2016 (r310551, copy of r307921, vendor/heirloom-doctools/dist/eqn/checkeq.d/Makefile.mk) @@ -0,0 +1,23 @@ +VPATH=.. +OBJ = checkeq.o + +FLAGS = + +.c.o: + $(CC) $(_CFLAGS) $(FLAGS) -c $< + +all: checkeq + +checkeq: $(OBJ) + $(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o checkeq + +install: + $(INSTALL) -c checkeq $(ROOT)$(BINDIR)/checkeq + $(STRIP) $(ROOT)$(BINDIR)/checkeq + rm -f $(ROOT)$(MANDIR)/man1/checkeq.1 + ln -s eqn.1 $(ROOT)$(MANDIR)/man1/checkeq.1 + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 25 19:38:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7443CC90198; Sun, 25 Dec 2016 19:38:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38EF114E8; Sun, 25 Dec 2016 19:38:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPJc714077452; Sun, 25 Dec 2016 19:38:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPJc7rb077451; Sun, 25 Dec 2016 19:38:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612251938.uBPJc7rb077451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 25 Dec 2016 19:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310552 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 19:38:08 -0000 Author: kib Date: Sun Dec 25 19:38:07 2016 New Revision: 310552 URL: https://svnweb.freebsd.org/changeset/base/310552 Log: Some style. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D8901 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sun Dec 25 17:54:23 2016 (r310551) +++ head/sys/kern/kern_event.c Sun Dec 25 19:38:07 2016 (r310552) @@ -591,7 +591,7 @@ timer2sbintime(intptr_t data, int flags) case NOTE_SECONDS: #ifdef __LP64__ if (data > (SBT_MAX / SBT_1S)) - return SBT_MAX; + return (SBT_MAX); #endif return ((sbintime_t)data << 32); case NOTE_MSECONDS: /* FALLTHROUGH */ @@ -600,7 +600,7 @@ timer2sbintime(intptr_t data, int flags) int64_t secs = data / 1000; #ifdef __LP64__ if (secs > (SBT_MAX / SBT_1S)) - return SBT_MAX; + return (SBT_MAX); #endif return (secs << 32 | MS_TO_SBT(data % 1000)); } @@ -610,7 +610,7 @@ timer2sbintime(intptr_t data, int flags) int64_t secs = data / 1000000; #ifdef __LP64__ if (secs > (SBT_MAX / SBT_1S)) - return SBT_MAX; + return (SBT_MAX); #endif return (secs << 32 | US_TO_SBT(data % 1000000)); } @@ -620,11 +620,11 @@ timer2sbintime(intptr_t data, int flags) int64_t secs = data / 1000000000; #ifdef __LP64__ if (secs > (SBT_MAX / SBT_1S)) - return SBT_MAX; + return (SBT_MAX); #endif return (secs << 32 | US_TO_SBT(data % 1000000000)); } - return NS_TO_SBT(data); + return (NS_TO_SBT(data)); default: break; } From owner-svn-src-all@freebsd.org Sun Dec 25 19:49:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59539C904B8; Sun, 25 Dec 2016 19:49:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 286A119D5; Sun, 25 Dec 2016 19:49:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPJn9oK081354; Sun, 25 Dec 2016 19:49:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPJn9TS081353; Sun, 25 Dec 2016 19:49:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612251949.uBPJn9TS081353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Dec 2016 19:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310553 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 19:49:10 -0000 Author: hselasky Date: Sun Dec 25 19:49:09 2016 New Revision: 310553 URL: https://svnweb.freebsd.org/changeset/base/310553 Log: Improve LinuxKPI device support. Only delete own BSD devices and not the ones obtained through devclass_get_device(). Some minor code cleanups while at it. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/device.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Sun Dec 25 19:38:07 2016 (r310552) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Sun Dec 25 19:49:09 2016 (r310553) @@ -63,6 +63,14 @@ struct device { struct device *parent; struct list_head irqents; device_t bsddev; + /* + * The following flag is used to determine if the LinuxKPI is + * responsible for detaching the BSD device or not. If the + * LinuxKPI got the BSD device using devclass_get_device(), it + * must not try to detach or delete it, because it's already + * done somewhere else. + */ + bool bsddev_attached_here; dev_t devt; struct class *class; void (*release)(struct device *dev); @@ -208,23 +216,36 @@ static inline struct device *kobj_to_dev static inline void device_initialize(struct device *dev) { - device_t bsddev; + device_t bsddev = NULL; + int unit = -1; - bsddev = NULL; if (dev->devt) { - int unit = MINOR(dev->devt); + unit = MINOR(dev->devt); bsddev = devclass_get_device(dev->class->bsdclass, unit); + dev->bsddev_attached_here = false; + } else if (dev->parent == NULL) { + bsddev = devclass_get_device(dev->class->bsdclass, 0); + dev->bsddev_attached_here = false; + } else { + dev->bsddev_attached_here = true; + } + + if (bsddev == NULL && dev->parent != NULL) { + bsddev = device_add_child(dev->parent->bsddev, + dev->class->kobj.name, unit); } + if (bsddev != NULL) device_set_softc(bsddev, dev); dev->bsddev = bsddev; + MPASS(dev->bsddev != NULL); kobject_init(&dev->kobj, &linux_dev_ktype); } static inline int device_add(struct device *dev) -{ +{ if (dev->bsddev != NULL) { if (dev->devt == 0) dev->devt = makedev(0, device_get_unit(dev->bsddev)); @@ -256,13 +277,13 @@ device_create_groups_vargs(struct class goto error; } - device_initialize(dev); dev->devt = devt; dev->class = class; dev->parent = parent; dev->groups = groups; dev->release = device_create_release; - dev->bsddev = devclass_get_device(dev->class->bsdclass, MINOR(devt)); + /* device_initialize() needs the class and parent to be set */ + device_initialize(dev); dev_set_drvdata(dev, drvdata); retval = kobject_set_name_vargs(&dev->kobj, fmt, args); @@ -298,17 +319,21 @@ device_create_with_groups(struct class * static inline int device_register(struct device *dev) { - device_t bsddev; - int unit; + device_t bsddev = NULL; + int unit = -1; - bsddev = NULL; - unit = -1; + if (dev->bsddev != NULL) + goto done; if (dev->devt) { unit = MINOR(dev->devt); bsddev = devclass_get_device(dev->class->bsdclass, unit); + dev->bsddev_attached_here = false; } else if (dev->parent == NULL) { bsddev = devclass_get_device(dev->class->bsdclass, 0); + dev->bsddev_attached_here = false; + } else { + dev->bsddev_attached_here = true; } if (bsddev == NULL && dev->parent != NULL) { bsddev = device_add_child(dev->parent->bsddev, @@ -320,6 +345,7 @@ device_register(struct device *dev) device_set_softc(bsddev, dev); } dev->bsddev = bsddev; +done: kobject_init(&dev->kobj, &linux_dev_ktype); kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); @@ -334,7 +360,7 @@ device_unregister(struct device *dev) bsddev = dev->bsddev; dev->bsddev = NULL; - if (bsddev != NULL) { + if (bsddev != NULL && dev->bsddev_attached_here) { mtx_lock(&Giant); device_delete_child(device_get_parent(bsddev), bsddev); mtx_unlock(&Giant); @@ -350,7 +376,7 @@ device_del(struct device *dev) bsddev = dev->bsddev; dev->bsddev = NULL; - if (bsddev != NULL) { + if (bsddev != NULL && dev->bsddev_attached_here) { mtx_lock(&Giant); device_delete_child(device_get_parent(bsddev), bsddev); mtx_unlock(&Giant); From owner-svn-src-all@freebsd.org Sun Dec 25 19:49:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72059C9053B; Sun, 25 Dec 2016 19:49:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8AA1B7A; Sun, 25 Dec 2016 19:49:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPJnZeO081413; Sun, 25 Dec 2016 19:49:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPJnZnv081411; Sun, 25 Dec 2016 19:49:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612251949.uBPJnZnv081411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 25 Dec 2016 19:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310554 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 19:49:36 -0000 Author: kib Date: Sun Dec 25 19:49:35 2016 New Revision: 310554 URL: https://svnweb.freebsd.org/changeset/base/310554 Log: Some optimizations for kqueue timers. There is no need to do two allocations per kqueue timer. Gather all data needed by the timer callout into the structure and allocate it at once. Use the structure to preserve the result of timer2sbintime(), to not perform repeated 64bit calculations in callout. Remove tautological casts. Remove now unused p_nexttime [1]. Noted by: markj [1] Reviewed by: markj (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week X-MFC note: do not remove p_nexttime Differential revision: https://reviews.freebsd.org/D8901 Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sun Dec 25 19:49:09 2016 (r310553) +++ head/sys/kern/kern_event.c Sun Dec 25 19:49:35 2016 (r310554) @@ -631,23 +631,29 @@ timer2sbintime(intptr_t data, int flags) return (-1); } +struct kq_timer_cb_data { + struct callout c; + sbintime_t next; /* next timer event fires at */ + sbintime_t to; /* precalculated timer period */ +}; + static void filt_timerexpire(void *knx) { - struct callout *calloutp; struct knote *kn; + struct kq_timer_cb_data *kc; kn = knx; kn->kn_data++; KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */ - if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { - calloutp = (struct callout *)kn->kn_hook; - *kn->kn_ptr.p_nexttime += timer2sbintime(kn->kn_sdata, - kn->kn_sfflags); - callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, - filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); - } + if ((kn->kn_flags & EV_ONESHOT) != 0) + return; + + kc = kn->kn_ptr.p_v; + kc->next += kc->to; + callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kn, + PCPU_GET(cpuid), C_ABSOLUTE); } /* @@ -656,16 +662,16 @@ filt_timerexpire(void *knx) static int filt_timerattach(struct knote *kn) { - struct callout *calloutp; + struct kq_timer_cb_data *kc; sbintime_t to; unsigned int ncallouts; - if ((intptr_t)kn->kn_sdata < 0) + if (kn->kn_sdata < 0) return (EINVAL); - if ((intptr_t)kn->kn_sdata == 0 && (kn->kn_flags & EV_ONESHOT) == 0) + if (kn->kn_sdata == 0 && (kn->kn_flags & EV_ONESHOT) == 0) kn->kn_sdata = 1; /* Only precision unit are supported in flags so far */ - if (kn->kn_sfflags & ~NOTE_TIMER_PRECMASK) + if ((kn->kn_sfflags & ~NOTE_TIMER_PRECMASK) != 0) return (EINVAL); to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); @@ -680,13 +686,12 @@ filt_timerattach(struct knote *kn) kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ - kn->kn_ptr.p_nexttime = malloc(sizeof(sbintime_t), M_KQUEUE, M_WAITOK); - calloutp = malloc(sizeof(*calloutp), M_KQUEUE, M_WAITOK); - callout_init(calloutp, 1); - kn->kn_hook = calloutp; - *kn->kn_ptr.p_nexttime = to + sbinuptime(); - callout_reset_sbt_on(calloutp, *kn->kn_ptr.p_nexttime, 0, - filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); + kn->kn_ptr.p_v = kc = malloc(sizeof(*kc), M_KQUEUE, M_WAITOK); + callout_init(&kc->c, 1); + kc->next = to + sbinuptime(); + kc->to = to; + callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kn, + PCPU_GET(cpuid), C_ABSOLUTE); return (0); } @@ -694,13 +699,12 @@ filt_timerattach(struct knote *kn) static void filt_timerdetach(struct knote *kn) { - struct callout *calloutp; + struct kq_timer_cb_data *kc; unsigned int old; - calloutp = (struct callout *)kn->kn_hook; - callout_drain(calloutp); - free(calloutp, M_KQUEUE); - free(kn->kn_ptr.p_nexttime, M_KQUEUE); + kc = kn->kn_ptr.p_v; + callout_drain(&kc->c); + free(kc, M_KQUEUE); old = atomic_fetchadd_int(&kq_ncallouts, -1); KASSERT(old > 0, ("Number of callouts cannot become negative")); kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sun Dec 25 19:49:09 2016 (r310553) +++ head/sys/sys/event.h Sun Dec 25 19:49:35 2016 (r310554) @@ -231,7 +231,6 @@ struct knote { struct proc *p_proc; /* proc pointer */ struct kaiocb *p_aio; /* AIO job pointer */ struct aioliojob *p_lio; /* LIO job pointer */ - sbintime_t *p_nexttime; /* next timer event fires at */ void *p_v; /* generic other pointer */ } kn_ptr; struct filterops *kn_fop; From owner-svn-src-all@freebsd.org Sun Dec 25 20:17:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E9BEC90CAE; Sun, 25 Dec 2016 20:17:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE3BB33; Sun, 25 Dec 2016 20:17:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPKHFHq093567; Sun, 25 Dec 2016 20:17:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPKHFeC093566; Sun, 25 Dec 2016 20:17:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612252017.uBPKHFeC093566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Dec 2016 20:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310555 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 20:17:16 -0000 Author: mav Date: Sun Dec 25 20:17:15 2016 New Revision: 310555 URL: https://svnweb.freebsd.org/changeset/base/310555 Log: Some random code cleaning. - Reduce indentation. - Remove extra braces. - Add few missing savety checks. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Dec 25 19:49:35 2016 (r310554) +++ head/sys/cam/ctl/ctl.c Sun Dec 25 20:17:15 2016 (r310555) @@ -424,7 +424,7 @@ static int ctl_init(void); void ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); -static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num, struct ctl_ooa *ooa_hdr, struct ctl_ooa_entry *kern_entries); @@ -1024,27 +1024,27 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun < CTL_MAX_LUNS && - (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) != NULL) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && - msg->ua.ua_set) - memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); - if (msg->ua.ua_all) { - if (msg->ua.ua_set) - ctl_est_ua_all(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua_all(lun, iid, msg->ua.ua_type); - } else { - if (msg->ua.ua_set) - ctl_est_ua(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua(lun, iid, msg->ua.ua_type); - } - mtx_unlock(&lun->lun_lock); - } else + if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); + return; + } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && msg->ua.ua_set) + memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); + if (msg->ua.ua_all) { + if (msg->ua.ua_set) + ctl_est_ua_all(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua_all(lun, iid, msg->ua.ua_type); + } else { + if (msg->ua.ua_set) + ctl_est_ua(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua(lun, iid, msg->ua.ua_type); + } + mtx_unlock(&lun->lun_lock); } static void @@ -1058,8 +1058,8 @@ ctl_isc_lun_sync(struct ctl_softc *softc targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -1289,8 +1289,8 @@ ctl_isc_mode_sync(struct ctl_softc *soft targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -2193,7 +2193,7 @@ ctl_create_iid(struct ctl_port *port, in * command on this side (XFER mode) or tell the other side to execute it * (SER_ONLY mode). */ -static int +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { struct ctl_softc *softc = control_softc; @@ -2201,7 +2201,6 @@ ctl_serialize_other_sc_cmd(struct ctl_sc struct ctl_port *port; struct ctl_lun *lun; const struct ctl_cmd_entry *entry; - int retval = 0; uint32_t targ_lun; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; @@ -2216,24 +2215,10 @@ ctl_serialize_other_sc_cmd(struct ctl_sc } /* Make sure that we know about this LUN. */ - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - /* - * If the LUN is invalid, pretend that it doesn't exist. - * It will go away as soon as all pending I/O has been - * completed. - */ - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - lun = NULL; - } - } else { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); - lun = NULL; - } - if (lun == NULL) { + /* * The other node would not send this request to us unless * received announce that we are primary node for this LUN. @@ -2243,6 +2228,18 @@ ctl_serialize_other_sc_cmd(struct ctl_sc ctl_set_busy(ctsio); goto badjuju; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + + /* + * If the LUN is invalid, pretend that it doesn't exist. + * It will go away as soon as all pending I/Os completed. + */ + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + ctl_set_busy(ctsio); + goto badjuju; + } entry = ctl_get_cmd_entry(ctsio, NULL); if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) { @@ -2314,10 +2311,9 @@ badjuju: msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.scsi), M_WAITOK); - retval = 1; + ctl_free_io((union ctl_io *)ctsio); break; } - return (retval); } /* @@ -2685,9 +2681,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } mtx_lock(&softc->ctl_lock); - if (((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0) - && ((ooa_hdr->lun_num >= CTL_MAX_LUNS) - || (softc->ctl_luns[ooa_hdr->lun_num] == NULL))) { + if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 && + (ooa_hdr->lun_num >= CTL_MAX_LUNS || + softc->ctl_luns[ooa_hdr->lun_num] == NULL)) { mtx_unlock(&softc->ctl_lock); free(entries, M_CTL); printf("%s: CTL_GET_OOA: invalid LUN %ju\n", @@ -2739,49 +2735,37 @@ ctl_ioctl(struct cdev *dev, u_long cmd, #ifdef CTL_IO_DELAY mtx_lock(&softc->ctl_lock); - - if ((delay_info->lun_id >= CTL_MAX_LUNS) - || (softc->ctl_luns[delay_info->lun_id] == NULL)) { + if (delay_info->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delay_info->lun_id]) == NULL) { + mtx_unlock(&softc->ctl_lock); delay_info->status = CTL_DELAY_STATUS_INVALID_LUN; - } else { - lun = softc->ctl_luns[delay_info->lun_id]; - mtx_lock(&lun->lun_lock); - - delay_info->status = CTL_DELAY_STATUS_OK; - - switch (delay_info->delay_type) { - case CTL_DELAY_TYPE_CONT: - break; - case CTL_DELAY_TYPE_ONESHOT: - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_TYPE; - break; - } - - switch (delay_info->delay_loc) { - case CTL_DELAY_LOC_DATAMOVE: - lun->delay_info.datamove_type = - delay_info->delay_type; - lun->delay_info.datamove_delay = - delay_info->delay_secs; - break; - case CTL_DELAY_LOC_DONE: - lun->delay_info.done_type = - delay_info->delay_type; - lun->delay_info.done_delay = - delay_info->delay_secs; - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_LOC; - break; - } - mtx_unlock(&lun->lun_lock); + break; } - + mtx_lock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); + delay_info->status = CTL_DELAY_STATUS_OK; + switch (delay_info->delay_type) { + case CTL_DELAY_TYPE_CONT: + case CTL_DELAY_TYPE_ONESHOT: + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_TYPE; + break; + } + switch (delay_info->delay_loc) { + case CTL_DELAY_LOC_DATAMOVE: + lun->delay_info.datamove_type = delay_info->delay_type; + lun->delay_info.datamove_delay = delay_info->delay_secs; + break; + case CTL_DELAY_LOC_DONE: + lun->delay_info.done_type = delay_info->delay_type; + lun->delay_info.done_delay = delay_info->delay_secs; + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_LOC; + break; + } + mtx_unlock(&lun->lun_lock); #else delay_info->status = CTL_DELAY_STATUS_NOT_IMPLEMENTED; #endif /* CTL_IO_DELAY */ @@ -2832,8 +2816,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[err_desc->lun_id]; - if (lun == NULL) { + if (err_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[err_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); free(new_err_desc, M_CTL); printf("%s: CTL_ERROR_INJECT: invalid LUN %ju\n", @@ -2876,8 +2860,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, delete_done = 0; mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[delete_desc->lun_id]; - if (lun == NULL) { + if (delete_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delete_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); printf("%s: CTL_ERROR_INJECT_DELETE: invalid LUN %ju\n", __func__, (uintmax_t)delete_desc->lun_id); @@ -8540,8 +8524,8 @@ ctl_hndl_per_res_out_on_other_sc(union c targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -11436,18 +11420,17 @@ ctl_failover_lun(union ctl_io *rio) /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - return; - } - } else { + if (targ_lun > CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + return; + } if (softc->ha_mode == CTL_HA_MODE_XFER) { TAILQ_FOREACH_SAFE(io, &lun->ooa_queue, ooa_links, next_io) { @@ -11515,15 +11498,13 @@ ctl_scsiio_precheck(struct ctl_softc *so struct ctl_lun *lun; const struct ctl_cmd_entry *entry; uint32_t initidx, targ_lun; - int retval; - - retval = 0; + int retval = 0; lun = NULL; - targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - if ((targ_lun < CTL_MAX_LUNS) - && ((lun = softc->ctl_luns[targ_lun]) != NULL)) { + if (targ_lun < CTL_MAX_LUNS) + lun = softc->ctl_luns[targ_lun]; + if (lun) { /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been @@ -11533,29 +11514,22 @@ ctl_scsiio_precheck(struct ctl_softc *so if (lun->flags & CTL_LUN_DISABLED) { mtx_unlock(&lun->lun_lock); lun = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = - lun->be_lun; + } + } + ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; + if (lun) { + ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = + lun->be_lun; - /* - * Every I/O goes into the OOA queue for a - * particular LUN, and stays there until completion. - */ + /* + * Every I/O goes into the OOA queue for a particular LUN, + * and stays there until completion. + */ #ifdef CTL_TIME_IO - if (TAILQ_EMPTY(&lun->ooa_queue)) { - lun->idle_time += getsbinuptime() - - lun->last_busy; - } + if (TAILQ_EMPTY(&lun->ooa_queue)) + lun->idle_time += getsbinuptime() - lun->last_busy; #endif - TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, - ooa_links); - } - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; + TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); } /* Get command entry and return error if it is unsuppotyed. */ @@ -11972,7 +11946,7 @@ ctl_lun_reset(struct ctl_softc *softc, u targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12051,7 +12025,7 @@ ctl_abort_task_set(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12136,7 +12110,7 @@ ctl_abort_task(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12261,7 +12235,7 @@ ctl_query_task(union ctl_io *io, int tas softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12301,7 +12275,7 @@ ctl_query_async_event(union ctl_io *io) softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12384,29 +12358,25 @@ ctl_run_task(union ctl_io *io) static void ctl_handle_isc(union ctl_io *io) { - int free_io; - struct ctl_lun *lun; struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + const struct ctl_cmd_entry *entry; uint32_t targ_lun; targ_lun = io->io_hdr.nexus.targ_mapped_lun; - lun = softc->ctl_luns[targ_lun]; - switch (io->io_hdr.msg_type) { case CTL_MSG_SERIALIZE: - free_io = ctl_serialize_other_sc_cmd(&io->scsiio); + ctl_serialize_other_sc_cmd(&io->scsiio); break; - case CTL_MSG_R2R: { - const struct ctl_cmd_entry *entry; - - /* - * This is only used in SER_ONLY mode. - */ - free_io = 0; + case CTL_MSG_R2R: /* Only used in SER_ONLY mode. */ entry = ctl_get_cmd_entry(&io->scsiio, NULL); + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_done(io); + break; + } mtx_lock(&lun->lun_lock); - if (ctl_scsiio_lun_check(lun, - entry, (struct ctl_scsiio *)io) != 0) { + if (ctl_scsiio_lun_check(lun, entry, &io->scsiio) != 0) { mtx_unlock(&lun->lun_lock); ctl_done(io); break; @@ -12415,51 +12385,46 @@ ctl_handle_isc(union ctl_io *io) mtx_unlock(&lun->lun_lock); ctl_enqueue_rtr(io); break; - } case CTL_MSG_FINISH_IO: if (softc->ha_mode == CTL_HA_MODE_XFER) { - free_io = 0; ctl_done(io); - } else { - free_io = 1; - mtx_lock(&lun->lun_lock); - TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, - ooa_links); - ctl_check_blocked(lun); - mtx_unlock(&lun->lun_lock); + break; } + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_free_io(io); + break; + } + mtx_lock(&lun->lun_lock); + TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); + ctl_check_blocked(lun); + mtx_unlock(&lun->lun_lock); + ctl_free_io(io); break; case CTL_MSG_PERS_ACTION: ctl_hndl_per_res_out_on_other_sc( (union ctl_ha_msg *)&io->presio.pr_msg); - free_io = 1; + ctl_free_io(io); break; case CTL_MSG_BAD_JUJU: - free_io = 0; ctl_done(io); break; - case CTL_MSG_DATAMOVE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE: /* Only used in XFER mode */ ctl_datamove_remote(io); break; - case CTL_MSG_DATAMOVE_DONE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE_DONE: /* Only used in XFER mode */ io->scsiio.be_move_done(io); break; case CTL_MSG_FAILOVER: ctl_failover_lun(io); - free_io = 1; + ctl_free_io(io); break; default: - free_io = 1; printf("%s: Invalid message type %d\n", __func__, io->io_hdr.msg_type); + ctl_free_io(io); break; } - if (free_io) - ctl_free_io(io); } @@ -13360,37 +13325,33 @@ ctl_queue_sense(union ctl_io *io) struct ctl_softc *softc; uint32_t initidx, targ_lun; - softc = control_softc; - CTL_DEBUG_PRINT(("ctl_queue_sense\n")); + softc = control_softc; + port = ctl_io_port(&ctsio->io_hdr); + targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); + /* * LUN lookup will likely move to the ctl_work_thread() once we * have our new queueing infrastructure (that doesn't put things on * a per-LUN queue initially). That is so that we can handle * things like an INQUIRY to a LUN that we don't have enabled. We * can't deal with that right now. + * If we don't have a LUN for this, just toss the sense information. */ mtx_lock(&softc->ctl_lock); - - /* - * If we don't have a LUN for this, just toss the sense - * information. - */ - port = ctl_io_port(&ctsio->io_hdr); - targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); - if ((targ_lun < CTL_MAX_LUNS) - && (softc->ctl_luns[targ_lun] != NULL)) - lun = softc->ctl_luns[targ_lun]; - else + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + mtx_unlock(&softc->ctl_lock); goto bailout; - - initidx = ctl_get_initindex(&io->io_hdr.nexus); - + } mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + /* * Already have CA set for this LUN...toss the sense information. */ + initidx = ctl_get_initindex(&io->io_hdr.nexus); if (ctl_is_set(lun->have_ca, initidx)) { mtx_unlock(&lun->lun_lock); goto bailout; @@ -13403,10 +13364,7 @@ ctl_queue_sense(union ctl_io *io) mtx_unlock(&lun->lun_lock); bailout: - mtx_unlock(&softc->ctl_lock); - ctl_free_io(io); - return (CTL_RETVAL_COMPLETE); } #endif From owner-svn-src-all@freebsd.org Sun Dec 25 20:19:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB449C90DD0; Sun, 25 Dec 2016 20:19:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAA0ED23; Sun, 25 Dec 2016 20:19:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPKJWJJ093699; Sun, 25 Dec 2016 20:19:32 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPKJWQ1093698; Sun, 25 Dec 2016 20:19:32 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201612252019.uBPKJWQ1093698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 25 Dec 2016 20:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310556 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 20:19:34 -0000 Author: jhibbits Date: Sun Dec 25 20:19:32 2016 New Revision: 310556 URL: https://svnweb.freebsd.org/changeset/base/310556 Log: Use the correct format specifier for physmem chunk sizes. Arguments are unsigned, so should be printed as unsigned. Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sun Dec 25 20:17:15 2016 (r310555) +++ head/sys/powerpc/powerpc/machdep.c Sun Dec 25 20:19:32 2016 (r310556) @@ -199,7 +199,7 @@ cpu_startup(void *dummy) phys_avail[indx + 1] - phys_avail[indx]; #ifdef __powerpc64__ - printf("0x%016jx - 0x%016jx, %jd bytes (%jd pages)\n", + printf("0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n", #else printf("0x%09jx - 0x%09jx, %ju bytes (%ju pages)\n", #endif From owner-svn-src-all@freebsd.org Sun Dec 25 21:41:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43ABBC90E13; Sun, 25 Dec 2016 21:41:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11D171BB2; Sun, 25 Dec 2016 21:41:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPLfe28028870; Sun, 25 Dec 2016 21:41:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPLfesO028869; Sun, 25 Dec 2016 21:41:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612252141.uBPLfesO028869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Dec 2016 21:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310557 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 21:41:41 -0000 Author: hselasky Date: Sun Dec 25 21:41:40 2016 New Revision: 310557 URL: https://svnweb.freebsd.org/changeset/base/310557 Log: Use correct integer type when computing the maximum physical address for kmem_alloc_contig(). Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Dec 25 20:19:32 2016 (r310556) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Dec 25 21:41:40 2016 (r310557) @@ -136,8 +136,8 @@ alloc_pages(gfp_t gfp_mask, unsigned int size_t size; size = PAGE_SIZE << order; - page = kmem_alloc_contig(kmem_arena, size, gfp_mask, 0, -1, - size, 0, VM_MEMATTR_DEFAULT); + page = kmem_alloc_contig(kmem_arena, size, gfp_mask, + 0, ~(vm_paddr_t)0, size, 0, VM_MEMATTR_DEFAULT); if (page == 0) return (NULL); return (virt_to_page(page)); From owner-svn-src-all@freebsd.org Sun Dec 25 22:32:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55931C91992; Sun, 25 Dec 2016 22:32:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 240C612D5; Sun, 25 Dec 2016 22:32:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPMWGH4049821; Sun, 25 Dec 2016 22:32:16 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPMWG0H049600; Sun, 25 Dec 2016 22:32:16 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201612252232.uBPMWG0H049600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 25 Dec 2016 22:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310558 - stable/10/tests/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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 22:32:17 -0000 Author: jilles Date: Sun Dec 25 22:32:16 2016 New Revision: 310558 URL: https://svnweb.freebsd.org/changeset/base/310558 Log: MFC r309836: Add some tests for reaper functionality (in procctl()). Added: stable/10/tests/sys/kern/reaper.c - copied unchanged from r309836, head/tests/sys/kern/reaper.c Modified: stable/10/tests/sys/kern/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/Makefile ============================================================================== --- stable/10/tests/sys/kern/Makefile Sun Dec 25 21:41:40 2016 (r310557) +++ stable/10/tests/sys/kern/Makefile Sun Dec 25 22:32:16 2016 (r310558) @@ -8,6 +8,7 @@ TESTSDIR= ${TESTSBASE}/sys/kern ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= ptrace_test +ATF_TESTS_C+= reaper ATF_TESTS_C+= unix_seqpacket_test ATF_TESTS_C+= unix_passfd_test TEST_METADATA.unix_seqpacket_test+= timeout="15" Copied: stable/10/tests/sys/kern/reaper.c (from r309836, head/tests/sys/kern/reaper.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tests/sys/kern/reaper.c Sun Dec 25 22:32:16 2016 (r310558, copy of r309836, head/tests/sys/kern/reaper.c) @@ -0,0 +1,494 @@ +/*- + * Copyright (c) 2016 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +ATF_TC_WITHOUT_HEAD(reaper_wait_child_first); +ATF_TC_BODY(reaper_wait_child_first, tc) +{ + pid_t parent, child, grandchild, pid; + int status, r; + int pip[2]; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[1]) != 0) + _exit(100); + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) { + if (read(pip[0], &(uint8_t){ 0 }, 1) != 0) + _exit(102); + if (getppid() != parent) + _exit(103); + _exit(2); + } else + _exit(3); + } + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(3, r); + + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + pid = waitpid(-1, &status, 0); + ATF_REQUIRE(pid > 0 && pid != child); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(2, r); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TC_WITHOUT_HEAD(reaper_wait_grandchild_first); +ATF_TC_BODY(reaper_wait_grandchild_first, tc) +{ + pid_t parent, child, grandchild, pid; + int status, r; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) + _exit(2); + else { + if (waitid(P_PID, grandchild, NULL, + WNOWAIT | WEXITED) != 0) + _exit(102); + _exit(3); + } + } + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(3, r); + + pid = waitpid(-1, &status, 0); + ATF_REQUIRE(pid > 0 && pid != child); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(2, r); +} + +ATF_TC_WITHOUT_HEAD(reaper_status); +ATF_TC_BODY(reaper_status, tc) +{ + struct procctl_reaper_status st; + ssize_t sr; + pid_t parent, child, pid; + int r, status; + int pip[2]; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_STATUS, &st); + ATF_REQUIRE_EQ(0, r); + ATF_CHECK_EQ(0, st.rs_flags & REAPER_STATUS_OWNED); + ATF_CHECK(st.rs_children > 0); + ATF_CHECK(st.rs_descendants > 0); + ATF_CHECK(st.rs_descendants >= st.rs_children); + ATF_CHECK(st.rs_reaper != parent); + ATF_CHECK(st.rs_reaper > 0); + + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = procctl(P_PID, parent, PROC_REAP_STATUS, &st); + ATF_REQUIRE_EQ(0, r); + ATF_CHECK_EQ(REAPER_STATUS_OWNED, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(0, st.rs_children); + ATF_CHECK_EQ(0, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(-1, st.rs_pid); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[0]) != 0) + _exit(100); + if (procctl(P_PID, parent, PROC_REAP_STATUS, &st) != 0) + _exit(101); + if (write(pip[1], &st, sizeof(st)) != (ssize_t)sizeof(st)) + _exit(102); + if (procctl(P_PID, getpid(), PROC_REAP_STATUS, &st) != 0) + _exit(103); + if (write(pip[1], &st, sizeof(st)) != (ssize_t)sizeof(st)) + _exit(104); + _exit(0); + } + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + sr = read(pip[0], &st, sizeof(st)); + ATF_REQUIRE_EQ((ssize_t)sizeof(st), sr); + ATF_CHECK_EQ(REAPER_STATUS_OWNED, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(1, st.rs_children); + ATF_CHECK_EQ(1, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(child, st.rs_pid); + sr = read(pip[0], &st, sizeof(st)); + ATF_REQUIRE_EQ((ssize_t)sizeof(st), sr); + ATF_CHECK_EQ(0, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(1, st.rs_children); + ATF_CHECK_EQ(1, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(child, st.rs_pid); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + ATF_CHECK_EQ(0, status); + + r = procctl(P_PID, parent, PROC_REAP_STATUS, &st); + ATF_REQUIRE_EQ(0, r); + ATF_CHECK_EQ(REAPER_STATUS_OWNED, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(0, st.rs_children); + ATF_CHECK_EQ(0, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(-1, st.rs_pid); +} + +ATF_TC_WITHOUT_HEAD(reaper_getpids); +ATF_TC_BODY(reaper_getpids, tc) +{ + struct procctl_reaper_pidinfo info[10]; + ssize_t sr; + pid_t parent, child, grandchild, pid; + int r, status, childidx; + int pipa[2], pipb[2]; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(0, info[0].pi_flags & REAPER_PIDINFO_VALID); + + r = pipe(pipa); + ATF_REQUIRE_EQ(0, r); + r = pipe(pipb); + ATF_REQUIRE_EQ(0, r); + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pipa[1]) != 0) + _exit(100); + if (close(pipb[0]) != 0) + _exit(100); + if (read(pipa[0], &(uint8_t){ 0 }, 1) != 1) + _exit(101); + grandchild = fork(); + if (grandchild == -1) + _exit(102); + if (grandchild == 0) { + if (write(pipb[1], &(uint8_t){ 0 }, 1) != 1) + _exit(103); + if (read(pipa[0], &(uint8_t){ 0 }, 1) != 1) + _exit(104); + _exit(0); + } + for (;;) + pause(); + } + r = close(pipa[0]); + ATF_REQUIRE_EQ(0, r); + r = close(pipb[1]); + ATF_REQUIRE_EQ(0, r); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID | REAPER_PIDINFO_CHILD, + info[0].pi_flags & (REAPER_PIDINFO_VALID | REAPER_PIDINFO_CHILD)); + ATF_CHECK_EQ(child, info[0].pi_pid); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(0, info[1].pi_flags & REAPER_PIDINFO_VALID); + + sr = write(pipa[1], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + sr = read(pipb[0], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[0].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[1].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(0, info[2].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(child, info[1].pi_subtree); + childidx = info[1].pi_pid == child ? 1 : 0; + ATF_CHECK_EQ(REAPER_PIDINFO_CHILD, + info[childidx].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK_EQ(0, info[childidx ^ 1].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK(info[childidx].pi_pid == child); + grandchild = info[childidx ^ 1].pi_pid; + ATF_CHECK(grandchild > 0); + ATF_CHECK(grandchild != child); + ATF_CHECK(grandchild != parent); + + r = kill(child, SIGTERM); + ATF_REQUIRE_EQ(0, r); + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[0].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(0, info[1].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(REAPER_PIDINFO_CHILD, + info[0].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK_EQ(grandchild, info[0].pi_pid); + + sr = write(pipa[1], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[0].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(0, info[1].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(REAPER_PIDINFO_CHILD, + info[0].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK_EQ(grandchild, info[0].pi_pid); + + pid = waitpid(grandchild, &status, 0); + ATF_REQUIRE_EQ(grandchild, pid); + ATF_CHECK_EQ(0, status); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(0, info[0].pi_flags & REAPER_PIDINFO_VALID); + + r = close(pipa[1]); + ATF_REQUIRE_EQ(0, r); + r = close(pipb[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_badsig); +ATF_TC_BODY(reaper_kill_badsig, tc) +{ + struct procctl_reaper_kill params; + pid_t parent; + int r; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + params.rk_sig = -1; + params.rk_flags = 0; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK(r == -1 && errno == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_sigzero); +ATF_TC_BODY(reaper_kill_sigzero, tc) +{ + struct procctl_reaper_kill params; + pid_t parent; + int r; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + params.rk_sig = 0; + params.rk_flags = 0; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK(r == -1 && errno == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_empty); +ATF_TC_BODY(reaper_kill_empty, tc) +{ + struct procctl_reaper_kill params; + pid_t parent; + int r; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + params.rk_sig = SIGTERM; + params.rk_flags = 0; + params.rk_killed = 77; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK(r == -1 && errno == ESRCH); + ATF_CHECK_EQ(0, params.rk_killed); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_normal); +ATF_TC_BODY(reaper_kill_normal, tc) +{ + struct procctl_reaper_kill params; + ssize_t sr; + pid_t parent, child, grandchild, pid; + int r, status; + int pip[2]; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[0]) != 0) + _exit(100); + grandchild = fork(); + if (grandchild == -1) + _exit(101); + if (grandchild == 0) { + if (write(pip[1], &(uint8_t){ 0 }, 1) != 1) + _exit(102); + for (;;) + pause(); + } + for (;;) + pause(); + } + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + sr = read(pip[0], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + + params.rk_sig = SIGTERM; + params.rk_flags = 0; + params.rk_killed = 77; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(2, params.rk_killed); + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM); + + pid = waitpid(-1, &status, 0); + ATF_REQUIRE(pid > 0); + ATF_CHECK(pid != parent); + ATF_CHECK(pid != child); + ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, reaper_wait_child_first); + ATF_TP_ADD_TC(tp, reaper_wait_grandchild_first); + ATF_TP_ADD_TC(tp, reaper_status); + ATF_TP_ADD_TC(tp, reaper_getpids); + ATF_TP_ADD_TC(tp, reaper_kill_badsig); + ATF_TP_ADD_TC(tp, reaper_kill_sigzero); + ATF_TP_ADD_TC(tp, reaper_kill_empty); + ATF_TP_ADD_TC(tp, reaper_kill_normal); + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Mon Dec 26 01:18:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5641EC90AB6; Mon, 26 Dec 2016 01:18:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16E7819A0; Mon, 26 Dec 2016 01:18:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ1I8Zv015292; Mon, 26 Dec 2016 01:18:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ1I8Dm015288; Mon, 26 Dec 2016 01:18:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612260118.uBQ1I8Dm015288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Dec 2016 01:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310559 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 01:18:09 -0000 Author: hselasky Date: Mon Dec 26 01:18:07 2016 New Revision: 310559 URL: https://svnweb.freebsd.org/changeset/base/310559 Log: Implement register and unregister chrdev in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Sun Dec 25 22:32:16 2016 (r310558) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon Dec 26 01:18:07 2016 (r310559) @@ -95,7 +95,7 @@ cdev_add(struct linux_cdev *cdev, dev_t args.mda_gid = 0; args.mda_mode = 0700; args.mda_si_drv1 = cdev; - args.mda_unit = MINOR(dev); + args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s", kobject_name(&cdev->kobj)); @@ -121,7 +121,7 @@ cdev_add_ext(struct linux_cdev *cdev, de args.mda_gid = gid; args.mda_mode = mode; args.mda_si_drv1 = cdev; - args.mda_unit = MINOR(dev); + args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); @@ -142,6 +142,8 @@ cdev_del(struct linux_cdev *cdev) kobject_put(&cdev->kobj); } +struct linux_cdev *linux_find_cdev(const char *name, unsigned major, unsigned minor); + #define cdev linux_cdev #endif /* _LINUX_CDEV_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sun Dec 25 22:32:16 2016 (r310558) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Mon Dec 26 01:18:07 2016 (r310559) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -151,6 +151,39 @@ struct file_operations { #define FMODE_WRITE FWRITE #define FMODE_EXEC FEXEC +int __register_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops); +int __register_chrdev_p(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops, uid_t uid, + gid_t gid, int mode); +void __unregister_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name); + +static inline void +unregister_chrdev(unsigned int major, const char *name) +{ + + __unregister_chrdev(major, 0, 256, name); +} + +static inline int +register_chrdev(unsigned int major, const char *name, + const struct file_operations *fops) +{ + + return (__register_chrdev(major, 0, 256, name, fops)); +} + +static inline int +register_chrdev_p(unsigned int major, const char *name, + const struct file_operations *fops, uid_t uid, gid_t gid, int mode) +{ + + return (__register_chrdev_p(major, 0, 256, name, fops, uid, gid, mode)); +} + static inline int register_chrdev_region(dev_t dev, unsigned range, const char *name) { @@ -184,7 +217,7 @@ static inline dev_t iminor(struct inode *inode) { - return dev2unit(inode->v_rdev); + return (MINOR(dev2unit(inode->v_rdev))); } static inline struct inode * Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 25 22:32:16 2016 (r310558) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 26 01:18:07 2016 (r310559) @@ -1418,6 +1418,82 @@ linux_irq_handler(void *ent) irqe->handler(irqe->irq, irqe->arg); } +struct linux_cdev * +linux_find_cdev(const char *name, unsigned major, unsigned minor) +{ + int unit = MKDEV(major, minor); + struct cdev *cdev; + + dev_lock(); + LIST_FOREACH(cdev, &linuxcdevsw.d_devs, si_list) { + struct linux_cdev *ldev = cdev->si_drv1; + if (dev2unit(cdev) == unit && + strcmp(kobject_name(&ldev->kobj), name) == 0) { + break; + } + } + dev_unlock(); + + return (cdev != NULL ? cdev->si_drv1 : NULL); +} + +int +__register_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops) +{ + struct linux_cdev *cdev; + int ret = 0; + int i; + + for (i = baseminor; i < baseminor + count; i++) { + cdev = cdev_alloc(); + cdev_init(cdev, fops); + kobject_set_name(&cdev->kobj, name); + + ret = cdev_add(cdev, makedev(major, i), 1); + if (ret != 0) + break; + } + return (ret); +} + +int +__register_chrdev_p(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name, + const struct file_operations *fops, uid_t uid, + gid_t gid, int mode) +{ + struct linux_cdev *cdev; + int ret = 0; + int i; + + for (i = baseminor; i < baseminor + count; i++) { + cdev = cdev_alloc(); + cdev_init(cdev, fops); + kobject_set_name(&cdev->kobj, name); + + ret = cdev_add_ext(cdev, makedev(major, i), uid, gid, mode); + if (ret != 0) + break; + } + return (ret); +} + +void +__unregister_chrdev(unsigned int major, unsigned int baseminor, + unsigned int count, const char *name) +{ + struct linux_cdev *cdevp; + int i; + + for (i = baseminor; i < baseminor + count; i++) { + cdevp = linux_find_cdev(name, major, i); + if (cdevp != NULL) + cdev_del(cdevp); + } +} + #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; #endif From owner-svn-src-all@freebsd.org Mon Dec 26 02:51:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D645C901BA; Mon, 26 Dec 2016 02:51:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC7814B8; Mon, 26 Dec 2016 02:51:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ2p3iV052299; Mon, 26 Dec 2016 02:51:03 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ2p3iX052298; Mon, 26 Dec 2016 02:51:03 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612260251.uBQ2p3iX052298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 26 Dec 2016 02:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310560 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 02:51:04 -0000 Author: gonzo Date: Mon Dec 26 02:51:03 2016 New Revision: 310560 URL: https://svnweb.freebsd.org/changeset/base/310560 Log: [vchi] replace non-reproducible __DATE__/__TIME__ with hardcoded string Although vchiq_build_date and vchiq_build_time are not used in current vchi driver at the moment, make sure these value will not leak into build later on if at some point they will be refered in some new imported code PR: 215494 Reported by: emaste MFC after: 1 week Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_version.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_version.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_version.c Mon Dec 26 01:18:07 2016 (r310559) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_version.c Mon Dec 26 02:51:03 2016 (r310560) @@ -35,8 +35,8 @@ VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_hostname, "dc4-arm-01" ); VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_version, "9245b4c35b99b3870e1f7dc598c5692b3c66a6f0 (tainted)" ); -VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_time, __TIME__ ); -VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_date, __DATE__ ); +VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_time, "not available" ); +VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_date, "not available" ); const char *vchiq_get_build_hostname( void ) { From owner-svn-src-all@freebsd.org Mon Dec 26 06:02:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC13DC843BE; Mon, 26 Dec 2016 06:02:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4D0DFD; Mon, 26 Dec 2016 06:02:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ62jTb033377; Mon, 26 Dec 2016 06:02:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ62jrg033376; Mon, 26 Dec 2016 06:02:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260602.uBQ62jrg033376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310561 - stable/11/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:02:46 -0000 Author: ngie Date: Mon Dec 26 06:02:45 2016 New Revision: 310561 URL: https://svnweb.freebsd.org/changeset/base/310561 Log: MFC r310203: Clean up parse_ip(..) - Clean up trailing whitespace - Fix variable alignment Modified: stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Mon Dec 26 02:51:03 2016 (r310560) +++ stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Mon Dec 26 06:02:45 2016 (r310561) @@ -603,9 +603,9 @@ parse_oid_string(struct snmp_toolinfo *s static int32_t parse_ip(struct snmp_value * value, char * val) { - uint32_t v; - int32_t i; char *endptr, *str; + int32_t i; + uint32_t v; str = val; for (i = 0; i < 4; i++) { @@ -617,8 +617,8 @@ parse_ip(struct snmp_value * value, char str = endptr + 1; value->v.ipaddress[i] = (uint8_t) v; } - value->syntax = SNMP_SYNTAX_IPADDRESS; + return (0); } From owner-svn-src-all@freebsd.org Mon Dec 26 06:04:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93616C8446E; Mon, 26 Dec 2016 06:04:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62631F65; Mon, 26 Dec 2016 06:04:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ64Aw1033507; Mon, 26 Dec 2016 06:04:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ64Aae033506; Mon, 26 Dec 2016 06:04:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260604.uBQ64Aae033506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:04: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: r310562 - stable/10/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:04:11 -0000 Author: ngie Date: Mon Dec 26 06:04:10 2016 New Revision: 310562 URL: https://svnweb.freebsd.org/changeset/base/310562 Log: MFstable/11 r310561: MFC r310203: Clean up parse_ip(..) - Clean up trailing whitespace - Fix variable alignment Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Mon Dec 26 06:02:45 2016 (r310561) +++ stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Mon Dec 26 06:04:10 2016 (r310562) @@ -603,9 +603,9 @@ parse_oid_string(struct snmp_toolinfo *s static int32_t parse_ip(struct snmp_value * value, char * val) { - uint32_t v; - int32_t i; char *endptr, *str; + int32_t i; + uint32_t v; str = val; for (i = 0; i < 4; i++) { @@ -617,8 +617,8 @@ parse_ip(struct snmp_value * value, char str = endptr + 1; value->v.ipaddress[i] = (uint8_t) v; } - value->syntax = SNMP_SYNTAX_IPADDRESS; + return (0); } From owner-svn-src-all@freebsd.org Mon Dec 26 06:05:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E38B9C844F1; Mon, 26 Dec 2016 06:05:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98AFB10D0; Mon, 26 Dec 2016 06:05:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ65lso033623; Mon, 26 Dec 2016 06:05:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ65lpf033622; Mon, 26 Dec 2016 06:05:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260605.uBQ65lpf033622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310563 - stable/11/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:05:49 -0000 Author: ngie Date: Mon Dec 26 06:05:47 2016 New Revision: 310563 URL: https://svnweb.freebsd.org/changeset/base/310563 Log: MFC r310196: Fix some minor typos with begemotBridgeTpLearnedEntryDiscards and begemotBridgeTpMaxAddresses Bump LAST-UPDATED for the MIB, per the change Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Mon Dec 26 06:04:10 2016 (r310562) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Mon Dec 26 06:05:47 2016 (r310563) @@ -41,7 +41,7 @@ IMPORTS FROM BEGEMOT-MIB; begemotBridge MODULE-IDENTITY - LAST-UPDATED "200708060000Z" + LAST-UPDATED "201612170000Z" ORGANIZATION "Sofia University St. Kliment Ohridski" CONTACT-INFO " Shteryana Shopova @@ -56,6 +56,9 @@ begemotBridge MODULE-IDENTITY E-Mail: syrinx@FreeBSD.org" DESCRIPTION "The Begemot MIB for managing bridge interfaces." + REVISION "201612170000Z" + DESCRIPTION + "Address some minor typos and grammar mistakes." REVISION "200708060000Z" DESCRIPTION "Third revision adds begemotBridgeBasePortPrivate @@ -856,7 +859,7 @@ begemotBridgeTpLearnedEntryDiscards OBJE DESCRIPTION "The total number of Forwarding Database entries that would have been learnt, but have been discarded due to Forwarding - Address Table having reached it's maximum entries limit." + Address Table having reached its maximum entries limit." ::= { begemotBridgeTpEntry 1 } begemotBridgeTpAgingTime OBJECT-TYPE @@ -874,7 +877,7 @@ begemotBridgeTpMaxAddresses OBJECT-TYPE MAX-ACCESS read-write STATUS current DESCRIPTION - "The maximum number of entires that this bridge can + "The maximum number of entries that this bridge can learn in it's Forwarding Address Table and use for making forwarding decisions." ::= { begemotBridgeTpEntry 3 } From owner-svn-src-all@freebsd.org Mon Dec 26 06:06:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58CF5C8457D; Mon, 26 Dec 2016 06:06:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DF991287; Mon, 26 Dec 2016 06:06:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ66tE9033719; Mon, 26 Dec 2016 06:06:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ66tqB033718; Mon, 26 Dec 2016 06:06:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260606.uBQ66tqB033718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:06: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: r310564 - stable/10/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:06:56 -0000 Author: ngie Date: Mon Dec 26 06:06:55 2016 New Revision: 310564 URL: https://svnweb.freebsd.org/changeset/base/310564 Log: MFstable/11 r310563: MFC r310196: Fix some minor typos with begemotBridgeTpLearnedEntryDiscards and begemotBridgeTpMaxAddresses Bump LAST-UPDATED for the MIB, per the change Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Mon Dec 26 06:05:47 2016 (r310563) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Mon Dec 26 06:06:55 2016 (r310564) @@ -41,7 +41,7 @@ IMPORTS FROM BEGEMOT-MIB; begemotBridge MODULE-IDENTITY - LAST-UPDATED "200708060000Z" + LAST-UPDATED "201612170000Z" ORGANIZATION "Sofia University St. Kliment Ohridski" CONTACT-INFO " Shteryana Shopova @@ -56,6 +56,9 @@ begemotBridge MODULE-IDENTITY E-Mail: syrinx@FreeBSD.org" DESCRIPTION "The Begemot MIB for managing bridge interfaces." + REVISION "201612170000Z" + DESCRIPTION + "Address some minor typos and grammar mistakes." REVISION "200708060000Z" DESCRIPTION "Third revision adds begemotBridgeBasePortPrivate @@ -856,7 +859,7 @@ begemotBridgeTpLearnedEntryDiscards OBJE DESCRIPTION "The total number of Forwarding Database entries that would have been learnt, but have been discarded due to Forwarding - Address Table having reached it's maximum entries limit." + Address Table having reached its maximum entries limit." ::= { begemotBridgeTpEntry 1 } begemotBridgeTpAgingTime OBJECT-TYPE @@ -874,7 +877,7 @@ begemotBridgeTpMaxAddresses OBJECT-TYPE MAX-ACCESS read-write STATUS current DESCRIPTION - "The maximum number of entires that this bridge can + "The maximum number of entries that this bridge can learn in it's Forwarding Address Table and use for making forwarding decisions." ::= { begemotBridgeTpEntry 3 } From owner-svn-src-all@freebsd.org Mon Dec 26 06:08:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E281AC84616; Mon, 26 Dec 2016 06:08:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34F1142A; Mon, 26 Dec 2016 06:08:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ68K6M033830; Mon, 26 Dec 2016 06:08:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ68KUu033829; Mon, 26 Dec 2016 06:08:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260608.uBQ68KUu033829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310565 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:08:22 -0000 Author: ngie Date: Mon Dec 26 06:08:20 2016 New Revision: 310565 URL: https://svnweb.freebsd.org/changeset/base/310565 Log: MFC r310202: Clean up trailing and leading whitespace Fix variable type alignment in snmp_dialog(..) Modified: stable/11/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpclient.c Mon Dec 26 06:06:55 2016 (r310564) +++ stable/11/contrib/bsnmp/lib/snmpclient.c Mon Dec 26 06:08:20 2016 (r310565) @@ -8,7 +8,7 @@ * * Author: Harti Brandt * Kendy Kutzner - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,7 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -1236,23 +1236,23 @@ snmp_send_packet(struct snmp_pdu * pdu) return (-1); } - pdu->request_id = snmp_next_reqid(&snmp_client); + pdu->request_id = snmp_next_reqid(&snmp_client); - b.asn_ptr = buf; - b.asn_len = snmp_client.txbuflen; - if (snmp_pdu_encode(pdu, &b)) { + b.asn_ptr = buf; + b.asn_len = snmp_client.txbuflen; + if (snmp_pdu_encode(pdu, &b)) { seterr(&snmp_client, "%s", strerror(errno)); free(buf); return (-1); } - if (snmp_client.dump_pdus) - snmp_pdu_dump(pdu); + if (snmp_client.dump_pdus) + snmp_pdu_dump(pdu); - if ((ret = send(snmp_client.fd, buf, b.asn_ptr - buf, 0)) == -1) { + if ((ret = send(snmp_client.fd, buf, b.asn_ptr - buf, 0)) == -1) { seterr(&snmp_client, "%s", strerror(errno)); free(buf); - return (-1); + return (-1); } free(buf); @@ -1269,7 +1269,7 @@ snmp_timeout(void * listentry_ptr) #if 0 warnx("snmp request %i timed out, attempt (%i/%i)", - listentry->reqid, listentry->retrycount, snmp_client.retries); + listentry->reqid, listentry->retrycount, snmp_client.retries); #endif listentry->retrycount++; @@ -1314,7 +1314,7 @@ snmp_pdu_send(struct snmp_pdu *pdu, snmp listentry->callback = func; listentry->arg = arg; listentry->retrycount=1; - listentry->timeout_id = + listentry->timeout_id = snmp_client.timeout_start(&snmp_client.timeout, snmp_timeout, listentry); @@ -1463,7 +1463,7 @@ snmp_receive_packet(struct snmp_pdu *pdu return (+1); } -static int +static int snmp_deliver_packet(struct snmp_pdu * resp) { struct sent_pdu *listentry; @@ -1548,7 +1548,7 @@ ok_getnext(const struct snmp_pdu * req, &resp->bindings[i].var)) { if (i != 0) warnx("SNMP GETNEXT: inconsistent table " - "response"); + "response"); return (0); } if (resp->version != SNMP_V1 && @@ -1654,7 +1654,7 @@ ok_set(const struct snmp_pdu * req, cons /* * Simple checks for response PDUs against request PDUs. Return values: 1=ok, - * 0=nosuchname or similar, -1=failure, -2=no response at all + * 0=nosuchname or similar, -1=failure, -2=no response at all */ int snmp_pdu_check(const struct snmp_pdu *req, @@ -1681,12 +1681,12 @@ snmp_pdu_check(const struct snmp_pdu *re int snmp_dialog(struct snmp_v1_pdu *req, struct snmp_v1_pdu *resp) { - u_int i; - int32_t reqid; - int ret; - struct timeval tv = snmp_client.timeout; + struct timeval tv = snmp_client.timeout; struct timeval end; struct snmp_pdu pdu; + u_int i; + int32_t reqid; + int ret; /* * Make a copy of the request and replace the syntaxes by NULL @@ -1698,11 +1698,11 @@ snmp_dialog(struct snmp_v1_pdu *req, str for (i = 0; i < pdu.nbindings; i++) pdu.bindings[i].syntax = SNMP_SYNTAX_NULL; } - - for (i = 0; i <= snmp_client.retries; i++) { + + for (i = 0; i <= snmp_client.retries; i++) { (void)gettimeofday(&end, NULL); timeradd(&end, &snmp_client.timeout, &end); - if ((reqid = snmp_send_packet(&pdu)) == -1) + if ((reqid = snmp_send_packet(&pdu)) == -1) return (-1); for (;;) { (void)gettimeofday(&tv, NULL); @@ -1717,16 +1717,16 @@ snmp_dialog(struct snmp_v1_pdu *req, str if (reqid == resp->request_id) return (0); /* not for us */ - (void)snmp_deliver_packet(resp); + (void)snmp_deliver_packet(resp); } if (ret < 0 && errno == EPIPE) /* stream closed */ return (-1); } - } + } errno = ETIMEDOUT; seterr(&snmp_client, "retry count exceeded"); - return (-1); + return (-1); } int From owner-svn-src-all@freebsd.org Mon Dec 26 06:09:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67774C84698; Mon, 26 Dec 2016 06:09:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267C915D5; Mon, 26 Dec 2016 06:09:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ699oN033921; Mon, 26 Dec 2016 06:09:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ699rf033920; Mon, 26 Dec 2016 06:09:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260609.uBQ699rf033920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:09: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: r310566 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:09:10 -0000 Author: ngie Date: Mon Dec 26 06:09:09 2016 New Revision: 310566 URL: https://svnweb.freebsd.org/changeset/base/310566 Log: MFstable/11 r310565: MFC r310202: Clean up trailing and leading whitespace Fix variable type alignment in snmp_dialog(..) Modified: stable/10/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.c Mon Dec 26 06:08:20 2016 (r310565) +++ stable/10/contrib/bsnmp/lib/snmpclient.c Mon Dec 26 06:09:09 2016 (r310566) @@ -8,7 +8,7 @@ * * Author: Harti Brandt * Kendy Kutzner - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,7 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -1236,23 +1236,23 @@ snmp_send_packet(struct snmp_pdu * pdu) return (-1); } - pdu->request_id = snmp_next_reqid(&snmp_client); + pdu->request_id = snmp_next_reqid(&snmp_client); - b.asn_ptr = buf; - b.asn_len = snmp_client.txbuflen; - if (snmp_pdu_encode(pdu, &b)) { + b.asn_ptr = buf; + b.asn_len = snmp_client.txbuflen; + if (snmp_pdu_encode(pdu, &b)) { seterr(&snmp_client, "%s", strerror(errno)); free(buf); return (-1); } - if (snmp_client.dump_pdus) - snmp_pdu_dump(pdu); + if (snmp_client.dump_pdus) + snmp_pdu_dump(pdu); - if ((ret = send(snmp_client.fd, buf, b.asn_ptr - buf, 0)) == -1) { + if ((ret = send(snmp_client.fd, buf, b.asn_ptr - buf, 0)) == -1) { seterr(&snmp_client, "%s", strerror(errno)); free(buf); - return (-1); + return (-1); } free(buf); @@ -1269,7 +1269,7 @@ snmp_timeout(void * listentry_ptr) #if 0 warnx("snmp request %i timed out, attempt (%i/%i)", - listentry->reqid, listentry->retrycount, snmp_client.retries); + listentry->reqid, listentry->retrycount, snmp_client.retries); #endif listentry->retrycount++; @@ -1314,7 +1314,7 @@ snmp_pdu_send(struct snmp_pdu *pdu, snmp listentry->callback = func; listentry->arg = arg; listentry->retrycount=1; - listentry->timeout_id = + listentry->timeout_id = snmp_client.timeout_start(&snmp_client.timeout, snmp_timeout, listentry); @@ -1463,7 +1463,7 @@ snmp_receive_packet(struct snmp_pdu *pdu return (+1); } -static int +static int snmp_deliver_packet(struct snmp_pdu * resp) { struct sent_pdu *listentry; @@ -1548,7 +1548,7 @@ ok_getnext(const struct snmp_pdu * req, &resp->bindings[i].var)) { if (i != 0) warnx("SNMP GETNEXT: inconsistent table " - "response"); + "response"); return (0); } if (resp->version != SNMP_V1 && @@ -1654,7 +1654,7 @@ ok_set(const struct snmp_pdu * req, cons /* * Simple checks for response PDUs against request PDUs. Return values: 1=ok, - * 0=nosuchname or similar, -1=failure, -2=no response at all + * 0=nosuchname or similar, -1=failure, -2=no response at all */ int snmp_pdu_check(const struct snmp_pdu *req, @@ -1681,12 +1681,12 @@ snmp_pdu_check(const struct snmp_pdu *re int snmp_dialog(struct snmp_v1_pdu *req, struct snmp_v1_pdu *resp) { - u_int i; - int32_t reqid; - int ret; - struct timeval tv = snmp_client.timeout; + struct timeval tv = snmp_client.timeout; struct timeval end; struct snmp_pdu pdu; + u_int i; + int32_t reqid; + int ret; /* * Make a copy of the request and replace the syntaxes by NULL @@ -1698,11 +1698,11 @@ snmp_dialog(struct snmp_v1_pdu *req, str for (i = 0; i < pdu.nbindings; i++) pdu.bindings[i].syntax = SNMP_SYNTAX_NULL; } - - for (i = 0; i <= snmp_client.retries; i++) { + + for (i = 0; i <= snmp_client.retries; i++) { (void)gettimeofday(&end, NULL); timeradd(&end, &snmp_client.timeout, &end); - if ((reqid = snmp_send_packet(&pdu)) == -1) + if ((reqid = snmp_send_packet(&pdu)) == -1) return (-1); for (;;) { (void)gettimeofday(&tv, NULL); @@ -1717,16 +1717,16 @@ snmp_dialog(struct snmp_v1_pdu *req, str if (reqid == resp->request_id) return (0); /* not for us */ - (void)snmp_deliver_packet(resp); + (void)snmp_deliver_packet(resp); } if (ret < 0 && errno == EPIPE) /* stream closed */ return (-1); } - } + } errno = ETIMEDOUT; seterr(&snmp_client, "retry count exceeded"); - return (-1); + return (-1); } int From owner-svn-src-all@freebsd.org Mon Dec 26 06:10:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD2AFC84721; Mon, 26 Dec 2016 06:10:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78F4F1733; Mon, 26 Dec 2016 06:10:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ6ALjk034042; Mon, 26 Dec 2016 06:10:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ6ALHc034041; Mon, 26 Dec 2016 06:10:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260610.uBQ6ALHc034041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310567 - stable/11/etc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:10:22 -0000 Author: ngie Date: Mon Dec 26 06:10:21 2016 New Revision: 310567 URL: https://svnweb.freebsd.org/changeset/base/310567 Log: MFC r310457: Clean up trailing whitespace No functional change Modified: stable/11/etc/snmpd.config Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/snmpd.config ============================================================================== --- stable/11/etc/snmpd.config Mon Dec 26 06:09:09 2016 (r310566) +++ stable/11/etc/snmpd.config Mon Dec 26 06:10:21 2016 (r310567) @@ -127,7 +127,7 @@ snmpEnableAuthenTraps = 2 # The following block creates a user with name "bsnmp" and sets privacy # and encryption options to SHA256 message digests and AES encryption # for this user. -# +# # usmUserStatus.$(engine).$(user1) = 5 # usmUserAuthProtocol.$(engine).$(user1) = $(HMACSHAAuthProtocol) # usmUserAuthKeyChange.$(engine).$(user1) = $(user1passwd) @@ -170,7 +170,7 @@ snmpEnableAuthenTraps = 2 # vacmSecurityToGroupStatus.$(securityModelUSM).$(read) = 4 # vacmGroupName.$(securityModelUSM).$(read) = $(write) -# +# # The OID of the .iso.org.dod.internet subtree # # internetoid := 1.3.6.1 @@ -193,7 +193,7 @@ snmpEnableAuthenTraps = 2 # vacmAccessReadViewName.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = "internet" # -# Read-write access for SNMPv2 users +# Read-write access for SNMPv2 users # # vacmAccessStatus.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = 4 # vacmAccessReadViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet" From owner-svn-src-all@freebsd.org Mon Dec 26 06:11:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A51C84795; Mon, 26 Dec 2016 06:11:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B706D19B0; Mon, 26 Dec 2016 06:11:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ6BhXI034833; Mon, 26 Dec 2016 06:11:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ6Bhs6034832; Mon, 26 Dec 2016 06:11:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260611.uBQ6Bhs6034832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06: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: r310568 - 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:11:45 -0000 Author: ngie Date: Mon Dec 26 06:11:43 2016 New Revision: 310568 URL: https://svnweb.freebsd.org/changeset/base/310568 Log: MFstable/11 r310567: MFC r310457: Clean up trailing whitespace No functional change Modified: stable/10/etc/snmpd.config Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/snmpd.config ============================================================================== --- stable/10/etc/snmpd.config Mon Dec 26 06:10:21 2016 (r310567) +++ stable/10/etc/snmpd.config Mon Dec 26 06:11:43 2016 (r310568) @@ -127,7 +127,7 @@ snmpEnableAuthenTraps = 2 # The following block creates a user with name "bsnmp" and sets privacy # and encryption options to SHA256 message digests and AES encryption # for this user. -# +# # usmUserStatus.$(engine).$(user1) = 5 # usmUserAuthProtocol.$(engine).$(user1) = $(HMACSHAAuthProtocol) # usmUserAuthKeyChange.$(engine).$(user1) = $(user1passwd) @@ -170,7 +170,7 @@ snmpEnableAuthenTraps = 2 # vacmSecurityToGroupStatus.$(securityModelUSM).$(read) = 4 # vacmGroupName.$(securityModelUSM).$(read) = $(write) -# +# # The OID of the .iso.org.dod.internet subtree # # internetoid := 1.3.6.1 @@ -193,7 +193,7 @@ snmpEnableAuthenTraps = 2 # vacmAccessReadViewName.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = "internet" # -# Read-write access for SNMPv2 users +# Read-write access for SNMPv2 users # # vacmAccessStatus.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = 4 # vacmAccessReadViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet" From owner-svn-src-all@freebsd.org Mon Dec 26 06:16:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1455FC849A3; Mon, 26 Dec 2016 06:16:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A581D1CF0; Mon, 26 Dec 2016 06:16:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ6GUdY037904; Mon, 26 Dec 2016 06:16:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ6GS1x037876; Mon, 26 Dec 2016 06:16:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260616.uBQ6GS1x037876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310569 - in stable/11/contrib/libarchive: cpio/test libarchive/test tar/test X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:16:32 -0000 Author: ngie Date: Mon Dec 26 06:16:27 2016 New Revision: 310569 URL: https://svnweb.freebsd.org/changeset/base/310569 Log: MFC r309869: Merge changes from vendor to address several Coverity issues with contrib/libarchive's tests Obtained from: libarchive (ebe29c, fd0ea2, f9e3de) Modified: stable/11/contrib/libarchive/cpio/test/test_option_J_upper.c stable/11/contrib/libarchive/cpio/test/test_option_Z_upper.c stable/11/contrib/libarchive/cpio/test/test_option_u.c stable/11/contrib/libarchive/cpio/test/test_option_y.c stable/11/contrib/libarchive/libarchive/test/read_open_memory.c stable/11/contrib/libarchive/libarchive/test/test_fuzz.c stable/11/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c stable/11/contrib/libarchive/libarchive/test/test_read_set_format.c stable/11/contrib/libarchive/tar/test/main.c stable/11/contrib/libarchive/tar/test/test_leading_slash.c stable/11/contrib/libarchive/tar/test/test_option_a.c stable/11/contrib/libarchive/tar/test/test_option_b.c stable/11/contrib/libarchive/tar/test/test_option_b64encode.c stable/11/contrib/libarchive/tar/test/test_option_gid_gname.c stable/11/contrib/libarchive/tar/test/test_option_grzip.c stable/11/contrib/libarchive/tar/test/test_option_j.c stable/11/contrib/libarchive/tar/test/test_option_lrzip.c stable/11/contrib/libarchive/tar/test/test_option_lz4.c stable/11/contrib/libarchive/tar/test/test_option_lzma.c stable/11/contrib/libarchive/tar/test/test_option_lzop.c stable/11/contrib/libarchive/tar/test/test_option_r.c stable/11/contrib/libarchive/tar/test/test_option_uid_uname.c stable/11/contrib/libarchive/tar/test/test_option_uuencode.c stable/11/contrib/libarchive/tar/test/test_option_xz.c stable/11/contrib/libarchive/tar/test/test_option_z.c stable/11/contrib/libarchive/tar/test/test_stdio.c stable/11/contrib/libarchive/tar/test/test_version.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/cpio/test/test_option_J_upper.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_J_upper.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/cpio/test/test_option_J_upper.c Mon Dec 26 06:16:27 2016 (r310569) @@ -47,10 +47,13 @@ DEFINE_TEST(test_option_J_upper) } failure("-J option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an xz signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\3757zXZ", 5); +done: + free(p); } Modified: stable/11/contrib/libarchive/cpio/test/test_option_Z_upper.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_Z_upper.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/cpio/test/test_option_Z_upper.c Mon Dec 26 06:16:27 2016 (r310569) @@ -47,10 +47,13 @@ DEFINE_TEST(test_option_Z_upper) } failure("-Z option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has a compress signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x1f\x9d", 2); +done: + free(p); } Modified: stable/11/contrib/libarchive/cpio/test/test_option_u.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_u.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/cpio/test/test_option_u.c Mon Dec 26 06:16:27 2016 (r310569) @@ -49,6 +49,7 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "a", 1); + free(p); /* Recreate the file with a single "b" */ assertMakeFile("f", 0644, "b"); @@ -68,6 +69,7 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "a", 1); + free(p); /* Copy the file to the "copy" dir with -u (force) */ r = systemf("echo f| %s -pud copy >copy.out 2>copy.err", @@ -78,4 +80,5 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "b", 1); + free(p); } Modified: stable/11/contrib/libarchive/cpio/test/test_option_y.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_option_y.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/cpio/test/test_option_y.c Mon Dec 26 06:16:27 2016 (r310569) @@ -46,11 +46,14 @@ DEFINE_TEST(test_option_y) } failure("-y option is broken"); assertEqualInt(r, 0); - return; + goto done; } assertTextFileContents("1 block\n", "archive.err"); /* Check that the archive file has a bzip2 signature. */ + free(p); p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "BZh9", 4); +done: + free(p); } Modified: stable/11/contrib/libarchive/libarchive/test/read_open_memory.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/read_open_memory.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/libarchive/test/read_open_memory.c Mon Dec 26 06:16:27 2016 (r310569) @@ -86,21 +86,7 @@ static int read_open_memory_internal(struct archive *a, const void *buff, size_t size, size_t read_size, int level) { - struct read_memory_data *mine; - - mine = (struct read_memory_data *)malloc(sizeof(*mine)); - if (mine == NULL) { - archive_set_error(a, ENOMEM, "No memory"); - return (ARCHIVE_FATAL); - } - memset(mine, 0, sizeof(*mine)); - mine->start = mine->p = (const unsigned char *)buff; - mine->end = mine->start + size; - mine->read_size = read_size; - mine->copy_buff_offset = 32; - mine->copy_buff_size = read_size + mine->copy_buff_offset * 2; - mine->copy_buff = malloc(mine->copy_buff_size); - memset(mine->copy_buff, 0xA5, mine->copy_buff_size); + struct read_memory_data *mine = NULL; switch (level) { case 3: @@ -109,6 +95,20 @@ read_open_memory_internal(struct archive archive_read_set_open_callback(a, memory_read_open); archive_read_set_skip_callback(a, memory_read_skip); case 1: + mine = malloc(sizeof(*mine)); + if (mine == NULL) { + archive_set_error(a, ENOMEM, "No memory"); + return (ARCHIVE_FATAL); + } + memset(mine, 0, sizeof(*mine)); + mine->start = mine->p = (const unsigned char *)buff; + mine->end = mine->start + size; + mine->read_size = read_size; + mine->copy_buff_offset = 32; + mine->copy_buff_size = read_size + mine->copy_buff_offset * 2; + mine->copy_buff = malloc(mine->copy_buff_size); + memset(mine->copy_buff, 0xA5, mine->copy_buff_size); + archive_read_set_read_callback(a, memory_read); archive_read_set_close_callback(a, memory_read_close); archive_read_set_callback_data(a, mine); @@ -213,7 +213,8 @@ memory_read_close(struct archive *a, voi { struct read_memory_data *mine = (struct read_memory_data *)client_data; (void)a; /* UNUSED */ - free(mine->copy_buff); + if (mine != NULL) + free(mine->copy_buff); free(mine); return (ARCHIVE_OK); } Modified: stable/11/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_fuzz.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/libarchive/test/test_fuzz.c Mon Dec 26 06:16:27 2016 (r310569) @@ -104,16 +104,19 @@ test_fuzz(const struct files *filesets) } if (!assert(size < buffsize)) { free(rawimage); + rawimage = NULL; continue; } } else { for (i = 0; filesets[n].names[i] != NULL; ++i) { tmp = slurpfile(&size, filesets[n].names[i]); - char *newraw = (char *)realloc(rawimage, oldsize + size); + char *newraw = realloc(rawimage, oldsize + size); if (!assert(newraw != NULL)) { free(rawimage); + rawimage = NULL; + free(tmp); continue; } rawimage = newraw; @@ -123,14 +126,21 @@ test_fuzz(const struct files *filesets) free(tmp); } } - if (size == 0) + if (size == 0) { + free(rawimage); + rawimage = NULL; continue; + } image = malloc(size); assert(image != NULL); if (image == NULL) { free(rawimage); + rawimage = NULL; return; } + + assert(rawimage != NULL); + srand((unsigned)time(NULL)); for (i = 0; i < 1000; ++i) { @@ -162,6 +172,7 @@ test_fuzz(const struct files *filesets) Sleep(100); #endif } + assert(f != NULL); assertEqualInt((size_t)size, fwrite(image, 1, (size_t)size, f)); fclose(f); @@ -195,7 +206,7 @@ test_fuzz(const struct files *filesets) archive_read_close(a); } archive_read_free(a); -} + } free(image); free(rawimage); } Modified: stable/11/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 26 06:16:27 2016 (r310569) @@ -1327,6 +1327,7 @@ test_callbacks(void) if (assert((m = archive_match_new()) != NULL)) { archive_entry_free(ae); archive_read_free(a); + archive_match_free(m); return; } Modified: stable/11/contrib/libarchive/libarchive/test/test_read_set_format.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_read_set_format.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/libarchive/test/test_read_set_format.c Mon Dec 26 06:16:27 2016 (r310569) @@ -219,8 +219,8 @@ DEFINE_TEST(test_read_append_filter_wron /* bunzip2 will write to stderr, redirect it to a file */ fflush(stderr); fgetpos(stderr, &pos); - fd = dup(fileno(stderr)); - fp = freopen("stderr1", "w", stderr); + assert((fd = dup(fileno(stderr))) != -1); + fp = freopen("stderr1", "w", stderr); #endif assert((a = archive_read_new()) != NULL); @@ -238,10 +238,10 @@ DEFINE_TEST(test_read_append_filter_wron if (fp != NULL) { fflush(stderr); dup2(fd, fileno(stderr)); - close(fd); clearerr(stderr); - fsetpos(stderr, &pos); + (void)fsetpos(stderr, &pos); } + close(fd); assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1"); #endif } Modified: stable/11/contrib/libarchive/tar/test/main.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/main.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/main.c Mon Dec 26 06:16:27 2016 (r310569) @@ -1060,7 +1060,7 @@ assertion_file_contains_lines_any_order( char **expected = NULL; char *p, **actual = NULL; char c; - int expected_failure = 0, actual_failure = 0; + int expected_failure = 0, actual_failure = 0, retval = 0; assertion_count(file, line); @@ -1081,8 +1081,7 @@ assertion_file_contains_lines_any_order( if (expected == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); - free(expected); - return (0); + goto done; } for (i = 0; lines[i] != NULL; ++i) { expected[i] = strdup(lines[i]); @@ -1103,8 +1102,7 @@ assertion_file_contains_lines_any_order( if (actual == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); - free(expected); - return (0); + goto done; } for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { @@ -1141,27 +1139,27 @@ assertion_file_contains_lines_any_order( ++actual_failure; } if (expected_failure == 0 && actual_failure == 0) { - free(buff); - free(expected); - free(actual); - return (1); + retval = 1; + goto done; } failure_start(file, line, "File doesn't match: %s", pathname); for (i = 0; i < expected_count; ++i) { - if (expected[i] != NULL) { + if (expected[i] != NULL) logprintf(" Expected but not present: %s\n", expected[i]); - free(expected[i]); - } } for (j = 0; j < actual_count; ++j) { if (actual[j] != NULL) logprintf(" Present but not expected: %s\n", actual[j]); } failure_finish(NULL); +done: + free(actual); free(buff); + for (i = 0; i < expected_count; ++i) + free(expected[i]); free(expected); - free(actual); - return (0); + + return (retval); } /* Verify that a text file does not contains the specified strings */ @@ -1590,7 +1588,7 @@ is_symlink(const char *file, int line, * really not much point in bothering with this. */ return (0); #else - char buff[300]; + char buff[301]; struct stat st; ssize_t linklen; int r; @@ -1607,7 +1605,7 @@ is_symlink(const char *file, int line, return (0); if (contents == NULL) return (1); - linklen = readlink(pathname, buff, sizeof(buff)); + linklen = readlink(pathname, buff, sizeof(buff) - 1); if (linklen < 0) { failure_start(file, line, "Can't read symlink %s", pathname); failure_finish(NULL); @@ -2324,7 +2322,7 @@ extract_reference_file(const char *name) for (;;) { if (fgets(buff, sizeof(buff), in) == NULL) { /* TODO: This is a failure. */ - return; + goto done; } if (memcmp(buff, "begin ", 6) == 0) break; @@ -2365,6 +2363,7 @@ extract_reference_file(const char *name) } } fclose(out); +done: fclose(in); } @@ -2958,8 +2957,8 @@ main(int argc, char **argv) strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp), "%Y-%m-%dT%H.%M.%S", localtime(&now)); - sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname, - tmpdir_timestamp, i); + snprintf(tmpdir, sizeof(tmpdir), "%s/%s.%s-%03d", tmp, + progname, tmpdir_timestamp, i); if (assertMakeDir(tmpdir,0755)) break; if (i >= 999) { Modified: stable/11/contrib/libarchive/tar/test/test_leading_slash.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_leading_slash.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_leading_slash.c Mon Dec 26 06:16:27 2016 (r310569) @@ -44,6 +44,7 @@ DEFINE_TEST(test_leading_slash) if (assertFileExists("test.err")) { errfile = slurpfile(&errfile_size, "test.err"); assert(strstr(errfile, expected_errmsg) != NULL); + free(errfile); } } Modified: stable/11/contrib/libarchive/tar/test/test_option_a.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_a.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_a.c Mon Dec 26 06:16:27 2016 (r310569) @@ -43,6 +43,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test2: archive it with .taZ suffix. */ assertEqualInt(0, @@ -53,6 +54,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test3: archive it with .tar.Z.uu suffix. */ assertEqualInt(0, @@ -63,6 +65,7 @@ DEFINE_TEST(test_option_a) assert(s > 12); failure("The archive should be uuencoded"); assertEqualMem(p, "begin 644 -\n", 12); + free(p); /* Test4: archive it with .zip suffix. */ assertEqualInt(0, @@ -73,6 +76,7 @@ DEFINE_TEST(test_option_a) assert(s > 4); failure("The archive should be zipped"); assertEqualMem(p, "\x50\x4b\x03\x04", 4); + free(p); /* Test5: archive it with .tar.Z suffix and --uuencode option. */ assertEqualInt(0, @@ -84,6 +88,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed, ignoring --uuencode option"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test6: archive it with .xxx suffix(unknown suffix) and * --uuencode option. */ @@ -96,6 +101,7 @@ DEFINE_TEST(test_option_a) assert(s > 12); failure("The archive should be uuencoded"); assertEqualMem(p, "begin 644 -\n", 12); + free(p); /* Test7: archive it with .tar.Z suffix using a long-name option. */ assertEqualInt(0, @@ -107,4 +113,5 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_b.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_b.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_b.c Mon Dec 26 06:16:27 2016 (r310569) @@ -78,4 +78,6 @@ DEFINE_TEST(test_option_b) * Note: It's not possible to verify at this level that blocks * are getting written with the */ + + free(testprog_ustar); } Modified: stable/11/contrib/libarchive/tar/test/test_option_b64encode.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_b64encode.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_b64encode.c Mon Dec 26 06:16:27 2016 (r310569) @@ -42,6 +42,7 @@ DEFINE_TEST(test_option_b64encode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin-base64 644", 16); + free(p); /* Archive it with uuencode only. */ assertEqualInt(0, @@ -51,4 +52,5 @@ DEFINE_TEST(test_option_b64encode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin-base64 644", 16); + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_gid_gname.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_gid_gname.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_gid_gname.c Mon Dec 26 06:16:27 2016 (r310569) @@ -53,6 +53,7 @@ DEFINE_TEST(test_option_gid_gname) /* Should force gid and gname fields in ustar header. */ assertEqualMem(data + 116, "000021 \0", 8); assertEqualMem(data + 297, "foofoofoo\0", 10); + free(data); /* Again with just --gname */ failure("Error invoking %s c", testprog); @@ -65,6 +66,8 @@ DEFINE_TEST(test_option_gid_gname) /* Gid should be unchanged from original reference. */ assertEqualMem(data + 116, reference + 116, 8); assertEqualMem(data + 297, "foofoofoo\0", 10); + free(data); + free(reference); /* Again with --gid and force gname to empty. */ failure("Error invoking %s c", testprog); @@ -77,6 +80,7 @@ DEFINE_TEST(test_option_gid_gname) assertEqualMem(data + 116, "000021 \0", 8); /* Gname field in ustar header should be empty. */ assertEqualMem(data + 297, "\0", 1); + free(data); /* TODO: It would be nice to verify that --gid= by itself * will look up the associated gname and use that, but Modified: stable/11/contrib/libarchive/tar/test/test_option_grzip.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_grzip.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_grzip.c Mon Dec 26 06:16:27 2016 (r310569) @@ -45,8 +45,11 @@ DEFINE_TEST(test_option_grzip) testprog)); p = slurpfile(&s, "archive.err"); p[s] = '\0'; + free(p); + /* Check that the archive file has an grzip signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12); + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_j.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_j.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_j.c Mon Dec 26 06:16:27 2016 (r310569) @@ -42,15 +42,18 @@ DEFINE_TEST(test_option_j) if (r != 0) { if (!canBzip2()) { skipping("bzip2 is not supported on this platform"); - return; + goto done; } failure("-j option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); assertEmptyFile("archive.err"); /* Check that the archive file has a bzip2 signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "BZh9", 4); +done: + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_lrzip.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_lrzip.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_lrzip.c Mon Dec 26 06:16:27 2016 (r310569) @@ -45,8 +45,10 @@ DEFINE_TEST(test_option_lrzip) testprog)); p = slurpfile(&s, "archive.err"); p[s] = '\0'; + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "LRZI\x00", 5); + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_lz4.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_lz4.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_lz4.c Mon Dec 26 06:16:27 2016 (r310569) @@ -43,7 +43,7 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Unsupported compression") != NULL) { skipping("This version of bsdtar was compiled " "without lz4 support"); - return; + goto done; } /* POSIX permits different handling of the spawnp * system call used to launch the subsidiary @@ -52,7 +52,7 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Can't launch") != NULL && !canLz4()) { skipping("This version of bsdtar uses an external lz4 program " "but no such program is available on this system."); - return; + goto done; } /* Some systems successfully spawn the new process, * but fail to exec a program within that process. @@ -61,14 +61,18 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Can't write") != NULL && !canLz4()) { skipping("This version of bsdtar uses an external lz4 program " "but no such program is available on this system."); - return; + goto done; } failure("--lz4 option is broken: %s", p); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lz4 signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x04\x22\x4d\x18", 4); + +done: + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_lzma.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_lzma.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_lzma.c Mon Dec 26 06:16:27 2016 (r310569) @@ -48,10 +48,13 @@ DEFINE_TEST(test_option_lzma) } failure("--lzma option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x5d\00\00", 3); +done: + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_lzop.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_lzop.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_lzop.c Mon Dec 26 06:16:27 2016 (r310569) @@ -42,14 +42,17 @@ DEFINE_TEST(test_option_lzop) if (r != 0) { if (!canLzop()) { skipping("lzop is not supported on this platform"); - return; + goto done; } failure("--lzop option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9); +done: + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_r.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_r.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_r.c Mon Dec 26 06:16:27 2016 (r310569) @@ -36,6 +36,10 @@ DEFINE_TEST(test_option_r) size_t s, buff_size_rounded; int r, i; + buff = NULL; + p0 = NULL; + p1 = NULL; + /* Create an archive with one file. */ assertMakeFile("f1", 0644, "abc"); r = systemf("%s cf archive.tar --format=ustar f1 >step1.out 2>step1.err", testprog); @@ -47,11 +51,9 @@ DEFINE_TEST(test_option_r) /* Do some basic validation of the constructed archive. */ p0 = slurpfile(&s, "archive.tar"); if (!assert(p0 != NULL)) - return; - if (!assert(s >= 2048)) { - free(p0); - return; - } + goto done; + if (!assert(s >= 2048)) + goto done; assertEqualMem(p0 + 0, "f1", 3); assertEqualMem(p0 + 512, "abc", 3); assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8); @@ -60,10 +62,8 @@ DEFINE_TEST(test_option_r) /* Edit that file with a lot more data and update the archive with a new copy. */ buff = malloc(buff_size); assert(buff != NULL); - if (buff == NULL) { - free(p0); - return; - } + if (buff == NULL) + goto done; for (i = 0; i < (int)buff_size; ++i) buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26]; @@ -77,10 +77,8 @@ DEFINE_TEST(test_option_r) /* The constructed archive should just have the new entry appended. */ p1 = slurpfile(&s, "archive.tar"); - if (!assert(p1 != NULL)) { - free(p0); - return; - } + if (!assert(p1 != NULL)) + goto done; buff_size_rounded = ((buff_size + 511) / 512) * 512; assert(s >= 2560 + buff_size_rounded); /* Verify first entry is unchanged. */ @@ -105,10 +103,8 @@ DEFINE_TEST(test_option_r) /* Validate the constructed archive. */ p1 = slurpfile(&s, "archive.tar"); - if (!assert(p1 != NULL)) { - free(p0); - return; - } + if (!assert(p1 != NULL)) + goto done; assert(s >= 3584 + buff_size_rounded); /* Verify first two entries are unchanged. */ assertEqualMem(p0, p1, 1536 + buff_size_rounded); @@ -118,7 +114,6 @@ DEFINE_TEST(test_option_r) /* Verify end-of-archive marker. */ assertEqualMem(p1 + 2560 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8); assertEqualMem(p1 + 3072 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8); - free(p0); free(p1); /* Unpack everything */ @@ -132,4 +127,7 @@ DEFINE_TEST(test_option_r) /* Verify that the second copy of f1 overwrote the first. */ assertFileContents(buff, (int)strlen(buff), "f1"); +done: + free(buff); + free(p0); } Modified: stable/11/contrib/libarchive/tar/test/test_option_uid_uname.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_uid_uname.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_uid_uname.c Mon Dec 26 06:16:27 2016 (r310569) @@ -53,6 +53,7 @@ DEFINE_TEST(test_option_uid_uname) /* Should force uid and uname fields in ustar header. */ assertEqualMem(data + 108, "000021 \0", 8); assertEqualMem(data + 265, "foofoofoo\0", 10); + free(data); /* Again with just --uid */ failure("Error invoking %s c", testprog); @@ -65,6 +66,7 @@ DEFINE_TEST(test_option_uid_uname) assertEqualMem(data + 108, "000021 \0", 8); /* Uname field in ustar header should be empty. */ assertEqualMem(data + 265, "\0", 1); + free(data); /* Again with just --uname */ failure("Error invoking %s c", testprog); @@ -77,4 +79,7 @@ DEFINE_TEST(test_option_uid_uname) /* Uid should be unchanged from original reference. */ assertEqualMem(data + 108, reference + 108, 8); assertEqualMem(data + 265, "foofoofoo\0", 10); + free(data); + + free(reference); } Modified: stable/11/contrib/libarchive/tar/test/test_option_uuencode.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_uuencode.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_uuencode.c Mon Dec 26 06:16:27 2016 (r310569) @@ -42,6 +42,7 @@ DEFINE_TEST(test_option_uuencode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin 644", 9); + free(p); /* Archive it with uuencode only. */ assertEqualInt(0, @@ -51,4 +52,5 @@ DEFINE_TEST(test_option_uuencode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin 644", 9); + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_xz.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_xz.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_xz.c Mon Dec 26 06:16:27 2016 (r310569) @@ -44,14 +44,17 @@ DEFINE_TEST(test_option_xz) if (strstr(p, "Unsupported compression") != NULL) { skipping("This version of bsdtar was compiled " "without xz support"); - return; + goto done; } failure("--xz option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an xz signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6); +done: + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_option_z.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_z.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_option_z.c Mon Dec 26 06:16:27 2016 (r310569) @@ -42,14 +42,17 @@ DEFINE_TEST(test_option_z) if (r != 0) { if (!canGzip()) { skipping("gzip is not supported on this platform"); - return; + goto done; } failure("-z option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has a gzip signature. */ p = slurpfile(&s, "archive.out"); assert(s > 4); assertEqualMem(p, "\x1f\x8b\x08\x00", 4); +done: + free(p); } Modified: stable/11/contrib/libarchive/tar/test/test_stdio.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_stdio.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_stdio.c Mon Dec 26 06:16:27 2016 (r310569) @@ -116,6 +116,7 @@ DEFINE_TEST(test_stdio) assertEqualInt((int)s, 3); assertEqualMem(p, "abc", 3); /* TODO: Verify xvf.err */ + free(p); /* 'xvf -' should generate list on stderr, empty stdout. */ r = systemf("%s xvf - < archive >xvf-.out 2>xvf-.err", testprog); Modified: stable/11/contrib/libarchive/tar/test/test_version.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_version.c Mon Dec 26 06:11:43 2016 (r310568) +++ stable/11/contrib/libarchive/tar/test/test_version.c Mon Dec 26 06:16:27 2016 (r310569) @@ -53,7 +53,7 @@ DEFINE_TEST(test_version) assert(s > 6); failure("Version must start with 'bsdtar': ``%s''", p); if (!assertEqualMem(q, "bsdtar ", 7)) - return; + goto done; q += 7; s -= 7; /* Version number is a series of digits and periods. */ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) { @@ -98,5 +98,6 @@ DEFINE_TEST(test_version) failure("Version output must end with \\n or \\r\\n"); if (*q == '\r') { ++q; --s; } assertEqualMem(q, "\n", 1); +done: free(p); } From owner-svn-src-all@freebsd.org Mon Dec 26 06:25:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5DBFC84CEF; Mon, 26 Dec 2016 06:25:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CCCF1F5; Mon, 26 Dec 2016 06:25:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ6Pgpl041783; Mon, 26 Dec 2016 06:25:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ6Pd3l041756; Mon, 26 Dec 2016 06:25:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260625.uBQ6Pd3l041756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:25: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: r310570 - in stable/10/contrib/libarchive: cpio/test libarchive/test tar/test X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:25:43 -0000 Author: ngie Date: Mon Dec 26 06:25:39 2016 New Revision: 310570 URL: https://svnweb.freebsd.org/changeset/base/310570 Log: MFstable/11 r310569: MFC r309869: Merge changes from vendor to address several Coverity issues with contrib/libarchive's tests Obtained from: libarchive (ebe29c, fd0ea2, f9e3de) Modified: stable/10/contrib/libarchive/cpio/test/test_option_J_upper.c stable/10/contrib/libarchive/cpio/test/test_option_Z_upper.c stable/10/contrib/libarchive/cpio/test/test_option_u.c stable/10/contrib/libarchive/cpio/test/test_option_y.c stable/10/contrib/libarchive/libarchive/test/read_open_memory.c stable/10/contrib/libarchive/libarchive/test/test_fuzz.c stable/10/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c stable/10/contrib/libarchive/libarchive/test/test_read_set_format.c stable/10/contrib/libarchive/tar/test/main.c stable/10/contrib/libarchive/tar/test/test_leading_slash.c stable/10/contrib/libarchive/tar/test/test_option_a.c stable/10/contrib/libarchive/tar/test/test_option_b.c stable/10/contrib/libarchive/tar/test/test_option_b64encode.c stable/10/contrib/libarchive/tar/test/test_option_gid_gname.c stable/10/contrib/libarchive/tar/test/test_option_grzip.c stable/10/contrib/libarchive/tar/test/test_option_j.c stable/10/contrib/libarchive/tar/test/test_option_lrzip.c stable/10/contrib/libarchive/tar/test/test_option_lz4.c stable/10/contrib/libarchive/tar/test/test_option_lzma.c stable/10/contrib/libarchive/tar/test/test_option_lzop.c stable/10/contrib/libarchive/tar/test/test_option_r.c stable/10/contrib/libarchive/tar/test/test_option_uid_uname.c stable/10/contrib/libarchive/tar/test/test_option_uuencode.c stable/10/contrib/libarchive/tar/test/test_option_xz.c stable/10/contrib/libarchive/tar/test/test_option_z.c stable/10/contrib/libarchive/tar/test/test_stdio.c stable/10/contrib/libarchive/tar/test/test_version.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/cpio/test/test_option_J_upper.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_J_upper.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/cpio/test/test_option_J_upper.c Mon Dec 26 06:25:39 2016 (r310570) @@ -47,10 +47,13 @@ DEFINE_TEST(test_option_J_upper) } failure("-J option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an xz signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\3757zXZ", 5); +done: + free(p); } Modified: stable/10/contrib/libarchive/cpio/test/test_option_Z_upper.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_Z_upper.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/cpio/test/test_option_Z_upper.c Mon Dec 26 06:25:39 2016 (r310570) @@ -47,10 +47,13 @@ DEFINE_TEST(test_option_Z_upper) } failure("-Z option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has a compress signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x1f\x9d", 2); +done: + free(p); } Modified: stable/10/contrib/libarchive/cpio/test/test_option_u.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_u.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/cpio/test/test_option_u.c Mon Dec 26 06:25:39 2016 (r310570) @@ -49,6 +49,7 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "a", 1); + free(p); /* Recreate the file with a single "b" */ assertMakeFile("f", 0644, "b"); @@ -68,6 +69,7 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "a", 1); + free(p); /* Copy the file to the "copy" dir with -u (force) */ r = systemf("echo f| %s -pud copy >copy.out 2>copy.err", @@ -78,4 +80,5 @@ DEFINE_TEST(test_option_u) p = slurpfile(&s, "copy/f"); assertEqualInt(s, 1); assertEqualMem(p, "b", 1); + free(p); } Modified: stable/10/contrib/libarchive/cpio/test/test_option_y.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_y.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/cpio/test/test_option_y.c Mon Dec 26 06:25:39 2016 (r310570) @@ -46,11 +46,14 @@ DEFINE_TEST(test_option_y) } failure("-y option is broken"); assertEqualInt(r, 0); - return; + goto done; } assertTextFileContents("1 block\n", "archive.err"); /* Check that the archive file has a bzip2 signature. */ + free(p); p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "BZh9", 4); +done: + free(p); } Modified: stable/10/contrib/libarchive/libarchive/test/read_open_memory.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/read_open_memory.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/libarchive/test/read_open_memory.c Mon Dec 26 06:25:39 2016 (r310570) @@ -86,21 +86,7 @@ static int read_open_memory_internal(struct archive *a, const void *buff, size_t size, size_t read_size, int level) { - struct read_memory_data *mine; - - mine = (struct read_memory_data *)malloc(sizeof(*mine)); - if (mine == NULL) { - archive_set_error(a, ENOMEM, "No memory"); - return (ARCHIVE_FATAL); - } - memset(mine, 0, sizeof(*mine)); - mine->start = mine->p = (const unsigned char *)buff; - mine->end = mine->start + size; - mine->read_size = read_size; - mine->copy_buff_offset = 32; - mine->copy_buff_size = read_size + mine->copy_buff_offset * 2; - mine->copy_buff = malloc(mine->copy_buff_size); - memset(mine->copy_buff, 0xA5, mine->copy_buff_size); + struct read_memory_data *mine = NULL; switch (level) { case 3: @@ -109,6 +95,20 @@ read_open_memory_internal(struct archive archive_read_set_open_callback(a, memory_read_open); archive_read_set_skip_callback(a, memory_read_skip); case 1: + mine = malloc(sizeof(*mine)); + if (mine == NULL) { + archive_set_error(a, ENOMEM, "No memory"); + return (ARCHIVE_FATAL); + } + memset(mine, 0, sizeof(*mine)); + mine->start = mine->p = (const unsigned char *)buff; + mine->end = mine->start + size; + mine->read_size = read_size; + mine->copy_buff_offset = 32; + mine->copy_buff_size = read_size + mine->copy_buff_offset * 2; + mine->copy_buff = malloc(mine->copy_buff_size); + memset(mine->copy_buff, 0xA5, mine->copy_buff_size); + archive_read_set_read_callback(a, memory_read); archive_read_set_close_callback(a, memory_read_close); archive_read_set_callback_data(a, mine); @@ -213,7 +213,8 @@ memory_read_close(struct archive *a, voi { struct read_memory_data *mine = (struct read_memory_data *)client_data; (void)a; /* UNUSED */ - free(mine->copy_buff); + if (mine != NULL) + free(mine->copy_buff); free(mine); return (ARCHIVE_OK); } Modified: stable/10/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_fuzz.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/libarchive/test/test_fuzz.c Mon Dec 26 06:25:39 2016 (r310570) @@ -104,16 +104,19 @@ test_fuzz(const struct files *filesets) } if (!assert(size < buffsize)) { free(rawimage); + rawimage = NULL; continue; } } else { for (i = 0; filesets[n].names[i] != NULL; ++i) { tmp = slurpfile(&size, filesets[n].names[i]); - char *newraw = (char *)realloc(rawimage, oldsize + size); + char *newraw = realloc(rawimage, oldsize + size); if (!assert(newraw != NULL)) { free(rawimage); + rawimage = NULL; + free(tmp); continue; } rawimage = newraw; @@ -123,14 +126,21 @@ test_fuzz(const struct files *filesets) free(tmp); } } - if (size == 0) + if (size == 0) { + free(rawimage); + rawimage = NULL; continue; + } image = malloc(size); assert(image != NULL); if (image == NULL) { free(rawimage); + rawimage = NULL; return; } + + assert(rawimage != NULL); + srand((unsigned)time(NULL)); for (i = 0; i < 1000; ++i) { @@ -162,6 +172,7 @@ test_fuzz(const struct files *filesets) Sleep(100); #endif } + assert(f != NULL); assertEqualInt((size_t)size, fwrite(image, 1, (size_t)size, f)); fclose(f); @@ -195,7 +206,7 @@ test_fuzz(const struct files *filesets) archive_read_close(a); } archive_read_free(a); -} + } free(image); free(rawimage); } Modified: stable/10/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 26 06:25:39 2016 (r310570) @@ -1327,6 +1327,7 @@ test_callbacks(void) if (assert((m = archive_match_new()) != NULL)) { archive_entry_free(ae); archive_read_free(a); + archive_match_free(m); return; } Modified: stable/10/contrib/libarchive/libarchive/test/test_read_set_format.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_read_set_format.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/libarchive/test/test_read_set_format.c Mon Dec 26 06:25:39 2016 (r310570) @@ -219,8 +219,8 @@ DEFINE_TEST(test_read_append_filter_wron /* bunzip2 will write to stderr, redirect it to a file */ fflush(stderr); fgetpos(stderr, &pos); - fd = dup(fileno(stderr)); - fp = freopen("stderr1", "w", stderr); + assert((fd = dup(fileno(stderr))) != -1); + fp = freopen("stderr1", "w", stderr); #endif assert((a = archive_read_new()) != NULL); @@ -238,10 +238,10 @@ DEFINE_TEST(test_read_append_filter_wron if (fp != NULL) { fflush(stderr); dup2(fd, fileno(stderr)); - close(fd); clearerr(stderr); - fsetpos(stderr, &pos); + (void)fsetpos(stderr, &pos); } + close(fd); assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1"); #endif } Modified: stable/10/contrib/libarchive/tar/test/main.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/main.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/main.c Mon Dec 26 06:25:39 2016 (r310570) @@ -1060,7 +1060,7 @@ assertion_file_contains_lines_any_order( char **expected = NULL; char *p, **actual = NULL; char c; - int expected_failure = 0, actual_failure = 0; + int expected_failure = 0, actual_failure = 0, retval = 0; assertion_count(file, line); @@ -1081,8 +1081,7 @@ assertion_file_contains_lines_any_order( if (expected == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); - free(expected); - return (0); + goto done; } for (i = 0; lines[i] != NULL; ++i) { expected[i] = strdup(lines[i]); @@ -1103,8 +1102,7 @@ assertion_file_contains_lines_any_order( if (actual == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); - free(expected); - return (0); + goto done; } for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { @@ -1141,27 +1139,27 @@ assertion_file_contains_lines_any_order( ++actual_failure; } if (expected_failure == 0 && actual_failure == 0) { - free(buff); - free(expected); - free(actual); - return (1); + retval = 1; + goto done; } failure_start(file, line, "File doesn't match: %s", pathname); for (i = 0; i < expected_count; ++i) { - if (expected[i] != NULL) { + if (expected[i] != NULL) logprintf(" Expected but not present: %s\n", expected[i]); - free(expected[i]); - } } for (j = 0; j < actual_count; ++j) { if (actual[j] != NULL) logprintf(" Present but not expected: %s\n", actual[j]); } failure_finish(NULL); +done: + free(actual); free(buff); + for (i = 0; i < expected_count; ++i) + free(expected[i]); free(expected); - free(actual); - return (0); + + return (retval); } /* Verify that a text file does not contains the specified strings */ @@ -1590,7 +1588,7 @@ is_symlink(const char *file, int line, * really not much point in bothering with this. */ return (0); #else - char buff[300]; + char buff[301]; struct stat st; ssize_t linklen; int r; @@ -1607,7 +1605,7 @@ is_symlink(const char *file, int line, return (0); if (contents == NULL) return (1); - linklen = readlink(pathname, buff, sizeof(buff)); + linklen = readlink(pathname, buff, sizeof(buff) - 1); if (linklen < 0) { failure_start(file, line, "Can't read symlink %s", pathname); failure_finish(NULL); @@ -2324,7 +2322,7 @@ extract_reference_file(const char *name) for (;;) { if (fgets(buff, sizeof(buff), in) == NULL) { /* TODO: This is a failure. */ - return; + goto done; } if (memcmp(buff, "begin ", 6) == 0) break; @@ -2365,6 +2363,7 @@ extract_reference_file(const char *name) } } fclose(out); +done: fclose(in); } @@ -2958,8 +2957,8 @@ main(int argc, char **argv) strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp), "%Y-%m-%dT%H.%M.%S", localtime(&now)); - sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname, - tmpdir_timestamp, i); + snprintf(tmpdir, sizeof(tmpdir), "%s/%s.%s-%03d", tmp, + progname, tmpdir_timestamp, i); if (assertMakeDir(tmpdir,0755)) break; if (i >= 999) { Modified: stable/10/contrib/libarchive/tar/test/test_leading_slash.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_leading_slash.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_leading_slash.c Mon Dec 26 06:25:39 2016 (r310570) @@ -44,6 +44,7 @@ DEFINE_TEST(test_leading_slash) if (assertFileExists("test.err")) { errfile = slurpfile(&errfile_size, "test.err"); assert(strstr(errfile, expected_errmsg) != NULL); + free(errfile); } } Modified: stable/10/contrib/libarchive/tar/test/test_option_a.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_a.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_a.c Mon Dec 26 06:25:39 2016 (r310570) @@ -43,6 +43,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test2: archive it with .taZ suffix. */ assertEqualInt(0, @@ -53,6 +54,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test3: archive it with .tar.Z.uu suffix. */ assertEqualInt(0, @@ -63,6 +65,7 @@ DEFINE_TEST(test_option_a) assert(s > 12); failure("The archive should be uuencoded"); assertEqualMem(p, "begin 644 -\n", 12); + free(p); /* Test4: archive it with .zip suffix. */ assertEqualInt(0, @@ -73,6 +76,7 @@ DEFINE_TEST(test_option_a) assert(s > 4); failure("The archive should be zipped"); assertEqualMem(p, "\x50\x4b\x03\x04", 4); + free(p); /* Test5: archive it with .tar.Z suffix and --uuencode option. */ assertEqualInt(0, @@ -84,6 +88,7 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed, ignoring --uuencode option"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); /* Test6: archive it with .xxx suffix(unknown suffix) and * --uuencode option. */ @@ -96,6 +101,7 @@ DEFINE_TEST(test_option_a) assert(s > 12); failure("The archive should be uuencoded"); assertEqualMem(p, "begin 644 -\n", 12); + free(p); /* Test7: archive it with .tar.Z suffix using a long-name option. */ assertEqualInt(0, @@ -107,4 +113,5 @@ DEFINE_TEST(test_option_a) assert(s > 2); failure("The archive should be compressed"); assertEqualMem(p, "\x1f\x9d", 2); + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_b.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_b.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_b.c Mon Dec 26 06:25:39 2016 (r310570) @@ -78,4 +78,6 @@ DEFINE_TEST(test_option_b) * Note: It's not possible to verify at this level that blocks * are getting written with the */ + + free(testprog_ustar); } Modified: stable/10/contrib/libarchive/tar/test/test_option_b64encode.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_b64encode.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_b64encode.c Mon Dec 26 06:25:39 2016 (r310570) @@ -42,6 +42,7 @@ DEFINE_TEST(test_option_b64encode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin-base64 644", 16); + free(p); /* Archive it with uuencode only. */ assertEqualInt(0, @@ -51,4 +52,5 @@ DEFINE_TEST(test_option_b64encode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin-base64 644", 16); + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_gid_gname.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_gid_gname.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_gid_gname.c Mon Dec 26 06:25:39 2016 (r310570) @@ -53,6 +53,7 @@ DEFINE_TEST(test_option_gid_gname) /* Should force gid and gname fields in ustar header. */ assertEqualMem(data + 116, "000021 \0", 8); assertEqualMem(data + 297, "foofoofoo\0", 10); + free(data); /* Again with just --gname */ failure("Error invoking %s c", testprog); @@ -65,6 +66,8 @@ DEFINE_TEST(test_option_gid_gname) /* Gid should be unchanged from original reference. */ assertEqualMem(data + 116, reference + 116, 8); assertEqualMem(data + 297, "foofoofoo\0", 10); + free(data); + free(reference); /* Again with --gid and force gname to empty. */ failure("Error invoking %s c", testprog); @@ -77,6 +80,7 @@ DEFINE_TEST(test_option_gid_gname) assertEqualMem(data + 116, "000021 \0", 8); /* Gname field in ustar header should be empty. */ assertEqualMem(data + 297, "\0", 1); + free(data); /* TODO: It would be nice to verify that --gid= by itself * will look up the associated gname and use that, but Modified: stable/10/contrib/libarchive/tar/test/test_option_grzip.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_grzip.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_grzip.c Mon Dec 26 06:25:39 2016 (r310570) @@ -45,8 +45,11 @@ DEFINE_TEST(test_option_grzip) testprog)); p = slurpfile(&s, "archive.err"); p[s] = '\0'; + free(p); + /* Check that the archive file has an grzip signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12); + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_j.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_j.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_j.c Mon Dec 26 06:25:39 2016 (r310570) @@ -42,15 +42,18 @@ DEFINE_TEST(test_option_j) if (r != 0) { if (!canBzip2()) { skipping("bzip2 is not supported on this platform"); - return; + goto done; } failure("-j option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); assertEmptyFile("archive.err"); /* Check that the archive file has a bzip2 signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "BZh9", 4); +done: + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_lrzip.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_lrzip.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_lrzip.c Mon Dec 26 06:25:39 2016 (r310570) @@ -45,8 +45,10 @@ DEFINE_TEST(test_option_lrzip) testprog)); p = slurpfile(&s, "archive.err"); p[s] = '\0'; + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "LRZI\x00", 5); + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_lz4.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_lz4.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_lz4.c Mon Dec 26 06:25:39 2016 (r310570) @@ -43,7 +43,7 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Unsupported compression") != NULL) { skipping("This version of bsdtar was compiled " "without lz4 support"); - return; + goto done; } /* POSIX permits different handling of the spawnp * system call used to launch the subsidiary @@ -52,7 +52,7 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Can't launch") != NULL && !canLz4()) { skipping("This version of bsdtar uses an external lz4 program " "but no such program is available on this system."); - return; + goto done; } /* Some systems successfully spawn the new process, * but fail to exec a program within that process. @@ -61,14 +61,18 @@ DEFINE_TEST(test_option_lz4) if (strstr(p, "Can't write") != NULL && !canLz4()) { skipping("This version of bsdtar uses an external lz4 program " "but no such program is available on this system."); - return; + goto done; } failure("--lz4 option is broken: %s", p); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lz4 signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x04\x22\x4d\x18", 4); + +done: + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_lzma.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_lzma.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_lzma.c Mon Dec 26 06:25:39 2016 (r310570) @@ -48,10 +48,13 @@ DEFINE_TEST(test_option_lzma) } failure("--lzma option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x5d\00\00", 3); +done: + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_lzop.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_lzop.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_lzop.c Mon Dec 26 06:25:39 2016 (r310570) @@ -42,14 +42,17 @@ DEFINE_TEST(test_option_lzop) if (r != 0) { if (!canLzop()) { skipping("lzop is not supported on this platform"); - return; + goto done; } failure("--lzop option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an lzma signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9); +done: + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_r.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_r.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_r.c Mon Dec 26 06:25:39 2016 (r310570) @@ -36,6 +36,10 @@ DEFINE_TEST(test_option_r) size_t s, buff_size_rounded; int r, i; + buff = NULL; + p0 = NULL; + p1 = NULL; + /* Create an archive with one file. */ assertMakeFile("f1", 0644, "abc"); r = systemf("%s cf archive.tar --format=ustar f1 >step1.out 2>step1.err", testprog); @@ -47,11 +51,9 @@ DEFINE_TEST(test_option_r) /* Do some basic validation of the constructed archive. */ p0 = slurpfile(&s, "archive.tar"); if (!assert(p0 != NULL)) - return; - if (!assert(s >= 2048)) { - free(p0); - return; - } + goto done; + if (!assert(s >= 2048)) + goto done; assertEqualMem(p0 + 0, "f1", 3); assertEqualMem(p0 + 512, "abc", 3); assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8); @@ -60,10 +62,8 @@ DEFINE_TEST(test_option_r) /* Edit that file with a lot more data and update the archive with a new copy. */ buff = malloc(buff_size); assert(buff != NULL); - if (buff == NULL) { - free(p0); - return; - } + if (buff == NULL) + goto done; for (i = 0; i < (int)buff_size; ++i) buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26]; @@ -77,10 +77,8 @@ DEFINE_TEST(test_option_r) /* The constructed archive should just have the new entry appended. */ p1 = slurpfile(&s, "archive.tar"); - if (!assert(p1 != NULL)) { - free(p0); - return; - } + if (!assert(p1 != NULL)) + goto done; buff_size_rounded = ((buff_size + 511) / 512) * 512; assert(s >= 2560 + buff_size_rounded); /* Verify first entry is unchanged. */ @@ -105,10 +103,8 @@ DEFINE_TEST(test_option_r) /* Validate the constructed archive. */ p1 = slurpfile(&s, "archive.tar"); - if (!assert(p1 != NULL)) { - free(p0); - return; - } + if (!assert(p1 != NULL)) + goto done; assert(s >= 3584 + buff_size_rounded); /* Verify first two entries are unchanged. */ assertEqualMem(p0, p1, 1536 + buff_size_rounded); @@ -118,7 +114,6 @@ DEFINE_TEST(test_option_r) /* Verify end-of-archive marker. */ assertEqualMem(p1 + 2560 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8); assertEqualMem(p1 + 3072 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8); - free(p0); free(p1); /* Unpack everything */ @@ -132,4 +127,7 @@ DEFINE_TEST(test_option_r) /* Verify that the second copy of f1 overwrote the first. */ assertFileContents(buff, (int)strlen(buff), "f1"); +done: + free(buff); + free(p0); } Modified: stable/10/contrib/libarchive/tar/test/test_option_uid_uname.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_uid_uname.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_uid_uname.c Mon Dec 26 06:25:39 2016 (r310570) @@ -53,6 +53,7 @@ DEFINE_TEST(test_option_uid_uname) /* Should force uid and uname fields in ustar header. */ assertEqualMem(data + 108, "000021 \0", 8); assertEqualMem(data + 265, "foofoofoo\0", 10); + free(data); /* Again with just --uid */ failure("Error invoking %s c", testprog); @@ -65,6 +66,7 @@ DEFINE_TEST(test_option_uid_uname) assertEqualMem(data + 108, "000021 \0", 8); /* Uname field in ustar header should be empty. */ assertEqualMem(data + 265, "\0", 1); + free(data); /* Again with just --uname */ failure("Error invoking %s c", testprog); @@ -77,4 +79,7 @@ DEFINE_TEST(test_option_uid_uname) /* Uid should be unchanged from original reference. */ assertEqualMem(data + 108, reference + 108, 8); assertEqualMem(data + 265, "foofoofoo\0", 10); + free(data); + + free(reference); } Modified: stable/10/contrib/libarchive/tar/test/test_option_uuencode.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_uuencode.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_uuencode.c Mon Dec 26 06:25:39 2016 (r310570) @@ -42,6 +42,7 @@ DEFINE_TEST(test_option_uuencode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin 644", 9); + free(p); /* Archive it with uuencode only. */ assertEqualInt(0, @@ -51,4 +52,5 @@ DEFINE_TEST(test_option_uuencode) p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "begin 644", 9); + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_xz.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_xz.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_xz.c Mon Dec 26 06:25:39 2016 (r310570) @@ -44,14 +44,17 @@ DEFINE_TEST(test_option_xz) if (strstr(p, "Unsupported compression") != NULL) { skipping("This version of bsdtar was compiled " "without xz support"); - return; + goto done; } failure("--xz option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has an xz signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6); +done: + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_option_z.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_z.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_option_z.c Mon Dec 26 06:25:39 2016 (r310570) @@ -42,14 +42,17 @@ DEFINE_TEST(test_option_z) if (r != 0) { if (!canGzip()) { skipping("gzip is not supported on this platform"); - return; + goto done; } failure("-z option is broken"); assertEqualInt(r, 0); - return; + goto done; } + free(p); /* Check that the archive file has a gzip signature. */ p = slurpfile(&s, "archive.out"); assert(s > 4); assertEqualMem(p, "\x1f\x8b\x08\x00", 4); +done: + free(p); } Modified: stable/10/contrib/libarchive/tar/test/test_stdio.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_stdio.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_stdio.c Mon Dec 26 06:25:39 2016 (r310570) @@ -116,6 +116,7 @@ DEFINE_TEST(test_stdio) assertEqualInt((int)s, 3); assertEqualMem(p, "abc", 3); /* TODO: Verify xvf.err */ + free(p); /* 'xvf -' should generate list on stderr, empty stdout. */ r = systemf("%s xvf - < archive >xvf-.out 2>xvf-.err", testprog); Modified: stable/10/contrib/libarchive/tar/test/test_version.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_version.c Mon Dec 26 06:16:27 2016 (r310569) +++ stable/10/contrib/libarchive/tar/test/test_version.c Mon Dec 26 06:25:39 2016 (r310570) @@ -53,7 +53,7 @@ DEFINE_TEST(test_version) assert(s > 6); failure("Version must start with 'bsdtar': ``%s''", p); if (!assertEqualMem(q, "bsdtar ", 7)) - return; + goto done; q += 7; s -= 7; /* Version number is a series of digits and periods. */ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) { @@ -98,5 +98,6 @@ DEFINE_TEST(test_version) failure("Version output must end with \\n or \\r\\n"); if (*q == '\r') { ++q; --s; } assertEqualMem(q, "\n", 1); +done: free(p); } From owner-svn-src-all@freebsd.org Mon Dec 26 06:32:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE6F0C91100; Mon, 26 Dec 2016 06:32:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D9D0A14; Mon, 26 Dec 2016 06:32:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ6WgZT045603; Mon, 26 Dec 2016 06:32:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ6WgNd045602; Mon, 26 Dec 2016 06:32:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260632.uBQ6WgNd045602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310571 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:32:43 -0000 Author: ngie Date: Mon Dec 26 06:32:42 2016 New Revision: 310571 URL: https://svnweb.freebsd.org/changeset/base/310571 Log: MFC r310459: Sort #includes per style(9) No functional change Modified: stable/11/contrib/bsnmp/snmpd/action.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/action.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/action.c Mon Dec 26 06:25:39 2016 (r310570) +++ stable/11/contrib/bsnmp/snmpd/action.c Mon Dec 26 06:32:42 2016 (r310571) @@ -38,12 +38,12 @@ #include #include #include +#include +#include +#include #include #include -#include #include -#include -#include #include #include "snmpmod.h" From owner-svn-src-all@freebsd.org Mon Dec 26 06:33:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E915C91164; Mon, 26 Dec 2016 06:33:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D954B7F; Mon, 26 Dec 2016 06:33:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ6XhQr045720; Mon, 26 Dec 2016 06:33:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ6XhIk045719; Mon, 26 Dec 2016 06:33:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260633.uBQ6XhIk045719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 06:33: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: r310572 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:33:44 -0000 Author: ngie Date: Mon Dec 26 06:33:43 2016 New Revision: 310572 URL: https://svnweb.freebsd.org/changeset/base/310572 Log: MFstable/11 r310571: MFC r310459: Sort #includes per style(9) No functional change Modified: stable/10/contrib/bsnmp/snmpd/action.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/action.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/action.c Mon Dec 26 06:32:42 2016 (r310571) +++ stable/10/contrib/bsnmp/snmpd/action.c Mon Dec 26 06:33:43 2016 (r310572) @@ -38,12 +38,12 @@ #include #include #include +#include +#include +#include #include #include -#include #include -#include -#include #include #include "snmpmod.h" From owner-svn-src-all@freebsd.org Mon Dec 26 06:59:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D0DEC91665; Mon, 26 Dec 2016 06:59:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00FFE86B; Mon, 26 Dec 2016 06:59:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ6xN8J054594; Mon, 26 Dec 2016 06:59:23 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ6xNM7054592; Mon, 26 Dec 2016 06:59:23 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612260659.uBQ6xNM7054592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 26 Dec 2016 06:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310573 - stable/11/sys/dev/hyperv/vmbus X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 06:59:24 -0000 Author: sephe Date: Mon Dec 26 06:59:22 2016 New Revision: 310573 URL: https://svnweb.freebsd.org/changeset/base/310573 Log: r310348 hyperv: Unbreak EARLY_AP_STARUP Hyper-V bootstrap by using intrhook Properly working pause and friends are required. Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/vmbus/vmbus.c stable/11/sys/dev/hyperv/vmbus/vmbus_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/vmbus.c Mon Dec 26 06:33:43 2016 (r310572) +++ stable/11/sys/dev/hyperv/vmbus/vmbus.c Mon Dec 26 06:59:22 2016 (r310573) @@ -97,6 +97,9 @@ static int vmbus_probe_guid_method(dev const struct hyperv_guid *); static uint32_t vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu); +#ifdef EARLY_AP_STARTUP +static void vmbus_intrhook(void *); +#endif static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); @@ -1369,6 +1372,21 @@ vmbus_event_proc_dummy(struct vmbus_soft { } +#ifdef EARLY_AP_STARTUP + +static void +vmbus_intrhook(void *xsc) +{ + struct vmbus_softc *sc = xsc; + + if (bootverbose) + device_printf(sc->vmbus_dev, "intrhook\n"); + vmbus_doattach(sc); + config_intrhook_disestablish(&sc->vmbus_intrhook); +} + +#endif /* EARLY_AP_STARTUP */ + static int vmbus_attach(device_t dev) { @@ -1383,7 +1401,14 @@ vmbus_attach(device_t dev) */ vmbus_sc->vmbus_event_proc = vmbus_event_proc_dummy; -#ifndef EARLY_AP_STARTUP +#ifdef EARLY_AP_STARTUP + /* + * Defer the real attach until the pause(9) works as expected. + */ + vmbus_sc->vmbus_intrhook.ich_func = vmbus_intrhook; + vmbus_sc->vmbus_intrhook.ich_arg = vmbus_sc; + config_intrhook_establish(&vmbus_sc->vmbus_intrhook); +#else /* !EARLY_AP_STARTUP */ /* * If the system has already booted and thread * scheduling is possible indicated by the global @@ -1391,8 +1416,8 @@ vmbus_attach(device_t dev) * initialization directly. */ if (!cold) -#endif vmbus_doattach(vmbus_sc); +#endif /* EARLY_AP_STARTUP */ return (0); } Modified: stable/11/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/vmbus_var.h Mon Dec 26 06:33:43 2016 (r310572) +++ stable/11/sys/dev/hyperv/vmbus/vmbus_var.h Mon Dec 26 06:59:22 2016 (r310573) @@ -30,6 +30,7 @@ #define _VMBUS_VAR_H_ #include +#include #include #include @@ -128,6 +129,8 @@ struct vmbus_softc { struct mtx vmbus_chan_lock; TAILQ_HEAD(, vmbus_channel) vmbus_chans; + struct intr_config_hook vmbus_intrhook; + #ifdef NEW_PCIB /* The list of usable MMIO ranges for PCIe pass-through */ struct pcib_host_resources vmbus_mmio_res; From owner-svn-src-all@freebsd.org Mon Dec 26 07:31:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD38C91DFD; Mon, 26 Dec 2016 07:31:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9EC8E0; Mon, 26 Dec 2016 07:31:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ7VGYG070313; Mon, 26 Dec 2016 07:31:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ7VGTZ070312; Mon, 26 Dec 2016 07:31:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612260731.uBQ7VGTZ070312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 07:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310574 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 07:31:17 -0000 Author: ngie Date: Mon Dec 26 07:31:16 2016 New Revision: 310574 URL: https://svnweb.freebsd.org/changeset/base/310574 Log: Fix style(9) - Sort #includes - Delete trailing whitespace No functional change MFC after: 3 days Modified: head/contrib/bsnmp/snmpd/trans_lsock.c Modified: head/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_lsock.c Mon Dec 26 06:59:22 2016 (r310573) +++ head/contrib/bsnmp/snmpd/trans_lsock.c Mon Dec 26 07:31:16 2016 (r310574) @@ -32,15 +32,15 @@ */ #include #include -#include #include +#include +#include +#include #include #include -#include -#include #include -#include +#include #include #include "snmpmod.h" @@ -417,7 +417,7 @@ lsock_send(struct tport *tp, const u_cha return (-1); } } - + return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); } From owner-svn-src-all@freebsd.org Mon Dec 26 08:47:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A79E6C9148B; Mon, 26 Dec 2016 08:47:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 708E5DF7; Mon, 26 Dec 2016 08:47:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ8lZ5A098832; Mon, 26 Dec 2016 08:47:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ8lZoD098831; Mon, 26 Dec 2016 08:47:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612260847.uBQ8lZoD098831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 26 Dec 2016 08:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310575 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 08:47:36 -0000 Author: mav Date: Mon Dec 26 08:47:35 2016 New Revision: 310575 URL: https://svnweb.freebsd.org/changeset/base/310575 Log: Fix improperly used nexus.targ_lun. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Dec 26 07:31:16 2016 (r310574) +++ head/sys/cam/ctl/ctl.c Mon Dec 26 08:47:35 2016 (r310575) @@ -1024,7 +1024,7 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + if (msg->hdr.nexus.targ_mapped_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1074,7 +1074,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc memcmp(&msg->lun.data[0], lun->lun_devid->data, i) != 0)) { mtx_unlock(&lun->lun_lock); printf("%s: Received conflicting HA LUN %d\n", - __func__, msg->hdr.nexus.targ_lun); + __func__, targ_lun); return; } else { /* Record whether peer is primary. */ @@ -1108,7 +1108,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc mtx_unlock(&lun->lun_lock); CTL_DEBUG_PRINT(("%s: Known LUN %d, peer is %s\n", - __func__, msg->hdr.nexus.targ_lun, + __func__, targ_lun, (msg->lun.flags & CTL_LUN_PRIMARY_SC) ? "primary" : "secondary")); From owner-svn-src-all@freebsd.org Mon Dec 26 09:38:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0B3EC8F57C; Mon, 26 Dec 2016 09:38:19 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com [IPv6:2a00:1450:400c:c01::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73D3696A; Mon, 26 Dec 2016 09:38:19 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wj0-x244.google.com with SMTP id kp2so47922540wjc.0; Mon, 26 Dec 2016 01:38:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:references:to:reply-to:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=cLpnfGCTbT6hTiYY5njmZI0jRQPReR+3bvfUyfDIy4M=; b=d7RVxtFINEYv1MEZO44LOeNWvbzFklrVddnI3XkkwClFV1vkG4aIrqV+6xw9otMDXQ f9fPBsY9ahqwl8yrxtZvSVgEmhN5LzXGVBI1UyAHGtzhosvekq8wI0SDtl0we/PSQw9M f5cCky5rkuG8Sv54smymrtLf7oV7GqEuD4tID4gn0EQ9e7aNqrqvncblVZqCeFJSL1YQ 4Mah/l09PuR5SUz/T00V5Tl65eiC+6SexP13FzkQmL0gZINLJ5amdEJX7gr6svmvxN5D MWUA1O/DEbkx2/s93dwqwxo+kOB3JlsUNNG0P6WmjuE+m1TiiT7zsUK7YrBQUbGshesF iNGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:references:to:reply-to:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cLpnfGCTbT6hTiYY5njmZI0jRQPReR+3bvfUyfDIy4M=; b=CG7UZbbWWqiji2nr5KA7HkpO7sofuGgbVBwKGgW//b0jEq9rx0lZCBAcAn/YHa6AJK zVJ2nypTqsEtzoaYO4USp7Ul065HZKTkVgTjbYUCm+xgWJGOOZGsHBVDrFAnSbPDwT9p 71Ke/hmIGApk9sLggi63W67b3d+AvG85phJ3R3VuBgyvpSFUbCA0LJB+brJousEMxw9D lmRUFSY96D4VdogrN0vCGs5WO+Q04z1LFIubAPqZlL7Zc+PPNHxNEjsy8ymjGr6yRBoi PIeUiMf3aVdyYdRr5fxiSol+VROF/w598PApvvusbmjvDG5tq9SW/3A20RHDs2M/d2b6 A8QA== X-Gm-Message-State: AIkVDXL6RlHCvwx9JhoHOi1ninXdJ0fq1TezK8Z/nOVA4SUvK1x3P1P+P+6RE2N0rzo5GA== X-Received: by 10.194.249.72 with SMTP id ys8mr26319681wjc.92.1482745097380; Mon, 26 Dec 2016 01:38:17 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id t194sm29580406wmd.1.2016.12.26.01.38.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Dec 2016 01:38:16 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Subject: Re: svn commit: r310559 - in head/sys/compat/linuxkpi/common: include/linux src References: <201612260118.uBQ1I8Dm015288@repo.freebsd.org> To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: mmel@freebsd.org Message-ID: Date: Mon, 26 Dec 2016 10:38:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <201612260118.uBQ1I8Dm015288@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 09:38:20 -0000 On 26.12.2016 2:18, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Dec 26 01:18:07 2016 > New Revision: 310559 > URL: https://svnweb.freebsd.org/changeset/base/310559 > > Log: > Implement register and unregister chrdev in the LinuxKPI. > > Obtained from: kmacy @ > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/linux/cdev.h > head/sys/compat/linuxkpi/common/include/linux/fs.h > head/sys/compat/linuxkpi/common/src/linux_compat.c > > Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Sun Dec 25 22:32:16 2016 (r310558) > +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon Dec 26 01:18:07 2016 (r310559) > @@ -95,7 +95,7 @@ cdev_add(struct linux_cdev *cdev, dev_t > args.mda_gid = 0; > args.mda_mode = 0700; > args.mda_si_drv1 = cdev; > - args.mda_unit = MINOR(dev); > + args.mda_unit = dev; > > error = make_dev_s(&args, &cdev->cdev, "%s", > kobject_name(&cdev->kobj)); > @@ -121,7 +121,7 @@ cdev_add_ext(struct linux_cdev *cdev, de > args.mda_gid = gid; > args.mda_mode = mode; > args.mda_si_drv1 = cdev; > - args.mda_unit = MINOR(dev); > + args.mda_unit = dev; > > error = make_dev_s(&args, &cdev->cdev, "%s/%d", > kobject_name(&cdev->kobj), MINOR(dev)); > @@ -142,6 +142,8 @@ cdev_del(struct linux_cdev *cdev) > kobject_put(&cdev->kobj); > } > > +struct linux_cdev *linux_find_cdev(const char *name, unsigned major, unsigned minor); > + > #define cdev linux_cdev > > #endif /* _LINUX_CDEV_H_ */ > > Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sun Dec 25 22:32:16 2016 (r310558) > +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Mon Dec 26 01:18:07 2016 (r310559) > @@ -2,7 +2,7 @@ > * Copyright (c) 2010 Isilon Systems, Inc. > * Copyright (c) 2010 iX Systems, Inc. > * Copyright (c) 2010 Panasas, Inc. > - * Copyright (c) 2013 Mellanox Technologies, Ltd. > + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -151,6 +151,39 @@ struct file_operations { > #define FMODE_WRITE FWRITE > #define FMODE_EXEC FEXEC > > +int __register_chrdev(unsigned int major, unsigned int baseminor, > + unsigned int count, const char *name, > + const struct file_operations *fops); > +int __register_chrdev_p(unsigned int major, unsigned int baseminor, > + unsigned int count, const char *name, > + const struct file_operations *fops, uid_t uid, > + gid_t gid, int mode); > +void __unregister_chrdev(unsigned int major, unsigned int baseminor, > + unsigned int count, const char *name); > + > +static inline void > +unregister_chrdev(unsigned int major, const char *name) > +{ > + > + __unregister_chrdev(major, 0, 256, name); > +} > + > +static inline int > +register_chrdev(unsigned int major, const char *name, > + const struct file_operations *fops) > +{ > + > + return (__register_chrdev(major, 0, 256, name, fops)); > +} > + > +static inline int > +register_chrdev_p(unsigned int major, const char *name, > + const struct file_operations *fops, uid_t uid, gid_t gid, int mode) > +{ > + > + return (__register_chrdev_p(major, 0, 256, name, fops, uid, gid, mode)); > +} > + > static inline int > register_chrdev_region(dev_t dev, unsigned range, const char *name) > { > @@ -184,7 +217,7 @@ static inline dev_t > iminor(struct inode *inode) > { > > - return dev2unit(inode->v_rdev); > + return (MINOR(dev2unit(inode->v_rdev))); This breaks many kernels: --- all_subdir_ibcore --- In file included from /usr2/Meloun/svn/src/sys/modules/ibcore/../../ofed/drivers/infiniband/core/ucma.c:34: In file included from /usr2/Meloun/svn/src/sys/modules/ibcore/../../compat/linuxkpi/common/include/linux/file.h:41: /usr2/Meloun/svn/src/sys/modules/ibcore/../../compat/linuxkpi/common/include/linux/fs.h:220:10: error: implicit declaration of function 'MINOR' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return (MINOR(dev2unit(inode->v_rdev))); ^ > } > > static inline struct inode * > > Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c > ============================================================================== > --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 25 22:32:16 2016 (r310558) > +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 26 01:18:07 2016 (r310559) > @@ -1418,6 +1418,82 @@ linux_irq_handler(void *ent) > irqe->handler(irqe->irq, irqe->arg); > } > > +struct linux_cdev * > +linux_find_cdev(const char *name, unsigned major, unsigned minor) > +{ > + int unit = MKDEV(major, minor); > + struct cdev *cdev; > + > + dev_lock(); > + LIST_FOREACH(cdev, &linuxcdevsw.d_devs, si_list) { > + struct linux_cdev *ldev = cdev->si_drv1; > + if (dev2unit(cdev) == unit && > + strcmp(kobject_name(&ldev->kobj), name) == 0) { > + break; > + } > + } > + dev_unlock(); > + > + return (cdev != NULL ? cdev->si_drv1 : NULL); > +} > + > +int > +__register_chrdev(unsigned int major, unsigned int baseminor, > + unsigned int count, const char *name, > + const struct file_operations *fops) > +{ > + struct linux_cdev *cdev; > + int ret = 0; > + int i; > + > + for (i = baseminor; i < baseminor + count; i++) { > + cdev = cdev_alloc(); > + cdev_init(cdev, fops); > + kobject_set_name(&cdev->kobj, name); > + > + ret = cdev_add(cdev, makedev(major, i), 1); > + if (ret != 0) > + break; > + } > + return (ret); > +} > + > +int > +__register_chrdev_p(unsigned int major, unsigned int baseminor, > + unsigned int count, const char *name, > + const struct file_operations *fops, uid_t uid, > + gid_t gid, int mode) > +{ > + struct linux_cdev *cdev; > + int ret = 0; > + int i; > + > + for (i = baseminor; i < baseminor + count; i++) { > + cdev = cdev_alloc(); > + cdev_init(cdev, fops); > + kobject_set_name(&cdev->kobj, name); > + > + ret = cdev_add_ext(cdev, makedev(major, i), uid, gid, mode); > + if (ret != 0) > + break; > + } > + return (ret); > +} > + > +void > +__unregister_chrdev(unsigned int major, unsigned int baseminor, > + unsigned int count, const char *name) > +{ > + struct linux_cdev *cdevp; > + int i; > + > + for (i = baseminor; i < baseminor + count; i++) { > + cdevp = linux_find_cdev(name, major, i); > + if (cdevp != NULL) > + cdev_del(cdevp); > + } > +} > + > #if defined(__i386__) || defined(__amd64__) > bool linux_cpu_has_clflush; > #endif > From owner-svn-src-all@freebsd.org Mon Dec 26 09:48:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2876C8F87A; Mon, 26 Dec 2016 09:48:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85795103F; Mon, 26 Dec 2016 09:48:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5F2641FE157; Mon, 26 Dec 2016 10:48:27 +0100 (CET) Subject: Re: svn commit: r310559 - in head/sys/compat/linuxkpi/common: include/linux src To: mmel@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201612260118.uBQ1I8Dm015288@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <4cd92dee-4cb2-954d-7157-6fcd122131c2@selasky.org> Date: Mon, 26 Dec 2016 10:48:03 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 09:48:37 -0000 On 12/26/16 10:38, Michal Meloun wrote: > > > On 26.12.2016 2:18, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Mon Dec 26 01:18:07 2016 >> New Revision: 310559 >> URL: https://svnweb.freebsd.org/changeset/base/310559 >> >> Log: >> Implement register and unregister chrdev in the LinuxKPI. >> >> Obtained from: kmacy @ >> MFC after: 1 week >> Sponsored by: Mellanox Technologies >> >> Modified: >> head/sys/compat/linuxkpi/common/include/linux/cdev.h >> head/sys/compat/linuxkpi/common/include/linux/fs.h >> head/sys/compat/linuxkpi/common/src/linux_compat.c >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Sun Dec 25 22:32:16 2016 (r310558) >> +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Mon Dec 26 01:18:07 2016 (r310559) >> @@ -95,7 +95,7 @@ cdev_add(struct linux_cdev *cdev, dev_t >> args.mda_gid = 0; >> args.mda_mode = 0700; >> args.mda_si_drv1 = cdev; >> - args.mda_unit = MINOR(dev); >> + args.mda_unit = dev; >> >> error = make_dev_s(&args, &cdev->cdev, "%s", >> kobject_name(&cdev->kobj)); >> @@ -121,7 +121,7 @@ cdev_add_ext(struct linux_cdev *cdev, de >> args.mda_gid = gid; >> args.mda_mode = mode; >> args.mda_si_drv1 = cdev; >> - args.mda_unit = MINOR(dev); >> + args.mda_unit = dev; >> >> error = make_dev_s(&args, &cdev->cdev, "%s/%d", >> kobject_name(&cdev->kobj), MINOR(dev)); >> @@ -142,6 +142,8 @@ cdev_del(struct linux_cdev *cdev) >> kobject_put(&cdev->kobj); >> } >> >> +struct linux_cdev *linux_find_cdev(const char *name, unsigned major, unsigned minor); >> + >> #define cdev linux_cdev >> >> #endif /* _LINUX_CDEV_H_ */ >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sun Dec 25 22:32:16 2016 (r310558) >> +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Mon Dec 26 01:18:07 2016 (r310559) >> @@ -2,7 +2,7 @@ >> * Copyright (c) 2010 Isilon Systems, Inc. >> * Copyright (c) 2010 iX Systems, Inc. >> * Copyright (c) 2010 Panasas, Inc. >> - * Copyright (c) 2013 Mellanox Technologies, Ltd. >> + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. >> * All rights reserved. >> * >> * Redistribution and use in source and binary forms, with or without >> @@ -151,6 +151,39 @@ struct file_operations { >> #define FMODE_WRITE FWRITE >> #define FMODE_EXEC FEXEC >> >> +int __register_chrdev(unsigned int major, unsigned int baseminor, >> + unsigned int count, const char *name, >> + const struct file_operations *fops); >> +int __register_chrdev_p(unsigned int major, unsigned int baseminor, >> + unsigned int count, const char *name, >> + const struct file_operations *fops, uid_t uid, >> + gid_t gid, int mode); >> +void __unregister_chrdev(unsigned int major, unsigned int baseminor, >> + unsigned int count, const char *name); >> + >> +static inline void >> +unregister_chrdev(unsigned int major, const char *name) >> +{ >> + >> + __unregister_chrdev(major, 0, 256, name); >> +} >> + >> +static inline int >> +register_chrdev(unsigned int major, const char *name, >> + const struct file_operations *fops) >> +{ >> + >> + return (__register_chrdev(major, 0, 256, name, fops)); >> +} >> + >> +static inline int >> +register_chrdev_p(unsigned int major, const char *name, >> + const struct file_operations *fops, uid_t uid, gid_t gid, int mode) >> +{ >> + >> + return (__register_chrdev_p(major, 0, 256, name, fops, uid, gid, mode)); >> +} >> + >> static inline int >> register_chrdev_region(dev_t dev, unsigned range, const char *name) >> { >> @@ -184,7 +217,7 @@ static inline dev_t >> iminor(struct inode *inode) >> { >> >> - return dev2unit(inode->v_rdev); >> + return (MINOR(dev2unit(inode->v_rdev))); > > This breaks many kernels: > > --- all_subdir_ibcore --- > In file included from > /usr2/Meloun/svn/src/sys/modules/ibcore/../../ofed/drivers/infiniband/core/ucma.c:34: > In file included from > /usr2/Meloun/svn/src/sys/modules/ibcore/../../compat/linuxkpi/common/include/linux/file.h:41: > /usr2/Meloun/svn/src/sys/modules/ibcore/../../compat/linuxkpi/common/include/linux/fs.h:220:10: error: implicit declaration of function 'MINOR' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > return (MINOR(dev2unit(inode->v_rdev))); > ^ > I'll fix shortly. --HPS From owner-svn-src-all@freebsd.org Mon Dec 26 09:52:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 507D9C8FBF4; Mon, 26 Dec 2016 09:52:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15DB015D9; Mon, 26 Dec 2016 09:52:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ9qJV2025010; Mon, 26 Dec 2016 09:52:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ9qJcC025009; Mon, 26 Dec 2016 09:52:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612260952.uBQ9qJcC025009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 09:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310578 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 09:52:20 -0000 Author: kib Date: Mon Dec 26 09:52:19 2016 New Revision: 310578 URL: https://svnweb.freebsd.org/changeset/base/310578 Log: MFC r310302: Do not clear KN_INFLUX when not owning influx state. PR: 214923 Modified: stable/11/sys/kern/kern_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_event.c ============================================================================== --- stable/11/sys/kern/kern_event.c Mon Dec 26 09:46:55 2016 (r310577) +++ stable/11/sys/kern/kern_event.c Mon Dec 26 09:52:19 2016 (r310578) @@ -2006,6 +2006,7 @@ knote(struct knlist *list, long hint, in struct kqueue *kq; struct knote *kn, *tkn; int error; + bool own_influx; if (list == NULL) return; @@ -2036,11 +2037,14 @@ knote(struct knlist *list, long hint, in */ KQ_UNLOCK(kq); } else if ((lockflags & KNF_NOKQLOCK) != 0) { - kn->kn_status |= KN_INFLUX; + own_influx = (kn->kn_status & KN_INFLUX) == 0; + if (own_influx) + kn->kn_status |= KN_INFLUX; KQ_UNLOCK(kq); error = kn->kn_fop->f_event(kn, hint); KQ_LOCK(kq); - kn->kn_status &= ~KN_INFLUX; + if (own_influx) + kn->kn_status &= ~KN_INFLUX; if (error) KNOTE_ACTIVATE(kn, 1); KQ_UNLOCK_FLUX(kq); From owner-svn-src-all@freebsd.org Mon Dec 26 09:56:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D18B7C8FD3A; Mon, 26 Dec 2016 09:56:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0D961932; Mon, 26 Dec 2016 09:56:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQ9uqDo027371; Mon, 26 Dec 2016 09:56:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQ9uq25027370; Mon, 26 Dec 2016 09:56:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612260956.uBQ9uq25027370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 09:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310580 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 09:56:53 -0000 Author: kib Date: Mon Dec 26 09:56:52 2016 New Revision: 310580 URL: https://svnweb.freebsd.org/changeset/base/310580 Log: MFC r309887: Enable lookup_cap_dotdot and lookup_cap_dotdot_nonlocal. Modified: stable/11/sys/kern/vfs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_lookup.c ============================================================================== --- stable/11/sys/kern/vfs_lookup.c Mon Dec 26 09:54:37 2016 (r310579) +++ stable/11/sys/kern/vfs_lookup.c Mon Dec 26 09:56:52 2016 (r310580) @@ -106,16 +106,11 @@ static int lookup_shared = 1; SYSCTL_INT(_vfs, OID_AUTO, lookup_shared, CTLFLAG_RWTUN, &lookup_shared, 0, "enables shared locks for path name translation"); -/* - * Intent is that lookup_cap_dotdot becomes unconditionally enabled, - * but it defaults to the disabled state until verification efforts - * are complete. - */ -static int lookup_cap_dotdot = 0; +static int lookup_cap_dotdot = 1; SYSCTL_INT(_vfs, OID_AUTO, lookup_cap_dotdot, CTLFLAG_RWTUN, &lookup_cap_dotdot, 0, "enables \"..\" components in path lookup in capability mode"); -static int lookup_cap_dotdot_nonlocal = 0; +static int lookup_cap_dotdot_nonlocal = 1; SYSCTL_INT(_vfs, OID_AUTO, lookup_cap_dotdot_nonlocal, CTLFLAG_RWTUN, &lookup_cap_dotdot_nonlocal, 0, "enables \"..\" components in path lookup in capability mode " From owner-svn-src-all@freebsd.org Mon Dec 26 10:01:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A078EC900DA; Mon, 26 Dec 2016 10:01:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E6D1E3D; Mon, 26 Dec 2016 10:01:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQA1qtR028448; Mon, 26 Dec 2016 10:01:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQA1qAS028447; Mon, 26 Dec 2016 10:01:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261001.uBQA1qAS028447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 10:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310581 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:01:53 -0000 Author: kib Date: Mon Dec 26 10:01:52 2016 New Revision: 310581 URL: https://svnweb.freebsd.org/changeset/base/310581 Log: MFC r309886: When a zombie gets reparented due to the parent exit, send SIGCHLD to the reaper. Modified: stable/11/sys/kern/kern_exit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exit.c ============================================================================== --- stable/11/sys/kern/kern_exit.c Mon Dec 26 09:56:52 2016 (r310580) +++ stable/11/sys/kern/kern_exit.c Mon Dec 26 10:01:52 2016 (r310581) @@ -455,6 +455,11 @@ exit1(struct thread *td, int rval, int s if (!(q->p_flag & P_TRACED)) { proc_reparent(q, q->p_reaper); + if (q->p_state == PRS_ZOMBIE) { + PROC_LOCK(q->p_reaper); + pksignal(q->p_reaper, SIGCHLD, q->p_ksi); + PROC_UNLOCK(q->p_reaper); + } } else { /* * Traced processes are killed since their existence From owner-svn-src-all@freebsd.org Mon Dec 26 10:03:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE8FC90176; Mon, 26 Dec 2016 10:03:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB0E1AE; Mon, 26 Dec 2016 10:03:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQA3Xb4031402; Mon, 26 Dec 2016 10:03:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQA3XnI031401; Mon, 26 Dec 2016 10:03:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612261003.uBQA3XnI031401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Dec 2016 10:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310583 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:03:34 -0000 Author: hselasky Date: Mon Dec 26 10:03:33 2016 New Revision: 310583 URL: https://svnweb.freebsd.org/changeset/base/310583 Log: Fix LINT build. Found by: mmel @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Mon Dec 26 10:02:02 2016 (r310582) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Mon Dec 26 10:03:33 2016 (r310583) @@ -217,7 +217,7 @@ static inline dev_t iminor(struct inode *inode) { - return (MINOR(dev2unit(inode->v_rdev))); + return (minor(dev2unit(inode->v_rdev))); } static inline struct inode * From owner-svn-src-all@freebsd.org Mon Dec 26 10:05:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9B55C9034A; Mon, 26 Dec 2016 10:05:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9119D7AD; Mon, 26 Dec 2016 10:05:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4F03C1FE157; Mon, 26 Dec 2016 11:04:53 +0100 (CET) Subject: Re: svn commit: r310559 - in head/sys/compat/linuxkpi/common: include/linux src To: mmel@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201612260118.uBQ1I8Dm015288@repo.freebsd.org> <4cd92dee-4cb2-954d-7157-6fcd122131c2@selasky.org> From: Hans Petter Selasky Message-ID: <97224f13-5334-f6f0-4917-0b32a3e3ecca@selasky.org> Date: Mon, 26 Dec 2016 11:04:30 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <4cd92dee-4cb2-954d-7157-6fcd122131c2@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:05:03 -0000 Hi, Looks like this build error slipped under my -DNO_CLEAN flag. Sorry . Fixed in r310583 . --HPS From owner-svn-src-all@freebsd.org Mon Dec 26 10:13:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6901CC906CB; Mon, 26 Dec 2016 10:13:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D773CAB; Mon, 26 Dec 2016 10:13:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQADrqM035437; Mon, 26 Dec 2016 10:13:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQADrGG035436; Mon, 26 Dec 2016 10:13:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261013.uBQADrGG035436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 10:13: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: r310584 - 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:13:54 -0000 Author: kib Date: Mon Dec 26 10:13:53 2016 New Revision: 310584 URL: https://svnweb.freebsd.org/changeset/base/310584 Log: MFC r310302: Do not clear KN_INFLUX when not owning influx state. PR: 214923 Modified: stable/10/sys/kern/kern_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Mon Dec 26 10:03:33 2016 (r310583) +++ stable/10/sys/kern/kern_event.c Mon Dec 26 10:13:53 2016 (r310584) @@ -1935,6 +1935,7 @@ knote(struct knlist *list, long hint, in struct kqueue *kq; struct knote *kn, *tkn; int error; + bool own_influx; if (list == NULL) return; @@ -1965,11 +1966,14 @@ knote(struct knlist *list, long hint, in */ KQ_UNLOCK(kq); } else if ((lockflags & KNF_NOKQLOCK) != 0) { - kn->kn_status |= KN_INFLUX; + own_influx = (kn->kn_status & KN_INFLUX) == 0; + if (own_influx) + kn->kn_status |= KN_INFLUX; KQ_UNLOCK(kq); error = kn->kn_fop->f_event(kn, hint); KQ_LOCK(kq); - kn->kn_status &= ~KN_INFLUX; + if (own_influx) + kn->kn_status &= ~KN_INFLUX; if (error) KNOTE_ACTIVATE(kn, 1); KQ_UNLOCK_FLUX(kq); From owner-svn-src-all@freebsd.org Mon Dec 26 10:16:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9696C907C3; Mon, 26 Dec 2016 10:16:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78A20E9E; Mon, 26 Dec 2016 10:16:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQAG5KJ035581; Mon, 26 Dec 2016 10:16:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQAG563035580; Mon, 26 Dec 2016 10:16:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261016.uBQAG563035580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 10:16: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: r310585 - 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:16:06 -0000 Author: kib Date: Mon Dec 26 10:16:05 2016 New Revision: 310585 URL: https://svnweb.freebsd.org/changeset/base/310585 Log: MFC r309886: When a zombie gets reparented due to the parent exit, send SIGCHLD to the reaper. Modified: stable/10/sys/kern/kern_exit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exit.c ============================================================================== --- stable/10/sys/kern/kern_exit.c Mon Dec 26 10:13:53 2016 (r310584) +++ stable/10/sys/kern/kern_exit.c Mon Dec 26 10:16:05 2016 (r310585) @@ -499,6 +499,11 @@ exit1(struct thread *td, int rv) if (!(q->p_flag & P_TRACED)) { proc_reparent(q, q->p_reaper); + if (q->p_state == PRS_ZOMBIE) { + PROC_LOCK(q->p_reaper); + pksignal(q->p_reaper, SIGCHLD, q->p_ksi); + PROC_UNLOCK(q->p_reaper); + } } else { /* * Traced processes are killed since their existence From owner-svn-src-all@freebsd.org Mon Dec 26 10:17:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3212C9085D; Mon, 26 Dec 2016 10:17:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD38A83; Mon, 26 Dec 2016 10:17:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQAHMQp035681; Mon, 26 Dec 2016 10:17:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQAHMnE035676; Mon, 26 Dec 2016 10:17:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612261017.uBQAHMnE035676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 10:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310586 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:17:23 -0000 Author: ngie Date: Mon Dec 26 10:17:22 2016 New Revision: 310586 URL: https://svnweb.freebsd.org/changeset/base/310586 Log: Refactor transport sources a bit to facilitate changes coming down pipeline Add recv callback to transport layer to better facilitate code reuse and readability and for symmetry with send callback. Move recv_dgram and recv_stream to udp_recv and lsock_recv, respectively, and make the beforementioned functions recv callbacks for the udp and lsock transports, respectively. Consolidate the check_priv* functions in their relevant trans*.c source to limit scope/use. Note: this code is roughly based content from the submitter, although this was modified to be more of a direct move from snmpd/main.c to the trans_*.c sources, and to reduce unnecessary static function declarations. MFC after: 2 weeks Submitted by: Thor Steingrimsson Sponsored by: Dell EMC Isilon Modified: head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/snmpd.h head/contrib/bsnmp/snmpd/trans_lsock.c head/contrib/bsnmp/snmpd/trans_udp.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Mon Dec 26 10:16:05 2016 (r310585) +++ head/contrib/bsnmp/snmpd/main.c Mon Dec 26 10:17:22 2016 (r310586) @@ -1024,154 +1024,6 @@ snmp_input_consume(struct port_input *pi pi->length -= pi->consumed; } -static void -check_priv_dgram(struct port_input *pi, struct sockcred *cred) -{ - - /* process explicitly sends credentials */ - if (cred) - pi->priv = (cred->sc_euid == 0); - else - pi->priv = 0; -} - -static void -check_priv_stream(struct port_input *pi) -{ - struct xucred ucred; - socklen_t ucredlen; - - /* obtain the accept time credentials */ - ucredlen = sizeof(ucred); - - if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && - ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) - pi->priv = (ucred.cr_uid == 0); - else - pi->priv = 0; -} - -/* - * Input from a stream socket. - */ -static int -recv_stream(struct port_input *pi) -{ - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Return an error - * the caller must close the transport. */ - return (-1); - } - pi->buflen = buf_size(0); - pi->consumed = 0; - pi->length = 0; - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf + pi->length; - iov[0].iov_len = pi->buflen - pi->length; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - pi->length += len; - - if (pi->cred) - check_priv_stream(pi); - - return (0); -} - -/* - * Input from a datagram socket. - * Each receive should return one datagram. - */ -static int -recv_dgram(struct port_input *pi, struct in_addr *laddr) -{ - u_char embuf[1000]; - char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + - CMSG_SPACE(sizeof(struct in_addr))]; - struct msghdr msg; - struct iovec iov[1]; - ssize_t len; - struct cmsghdr *cmsg; - struct sockcred *cred = NULL; - - if (pi->buf == NULL) { - /* no buffer yet - allocate one */ - if ((pi->buf = buf_alloc(0)) == NULL) { - /* ups - could not get buffer. Read away input - * and drop it */ - (void)recvfrom(pi->fd, embuf, sizeof(embuf), - 0, NULL, NULL); - /* return error */ - return (-1); - } - pi->buflen = buf_size(0); - } - - /* try to get a message */ - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - memset(cbuf, 0, sizeof(cbuf)); - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - msg.msg_flags = 0; - - iov[0].iov_base = pi->buf; - iov[0].iov_len = pi->buflen; - - len = recvmsg(pi->fd, &msg, 0); - - if (len == -1 || len == 0) - /* receive error */ - return (-1); - - if (msg.msg_flags & MSG_TRUNC) { - /* truncated - drop */ - snmpd_stats.silentDrops++; - snmpd_stats.inTooLong++; - return (-1); - } - - pi->length = (size_t)len; - - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level == IPPROTO_IP && - cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_CREDS) - cred = (struct sockcred *)CMSG_DATA(cmsg); - } - - if (pi->cred) - check_priv_dgram(pi, cred); - - return (0); -} - /* * Input from a socket */ @@ -1191,35 +1043,8 @@ snmpd_input(struct port_input *pi, struc #endif struct msghdr msg; struct iovec iov[1]; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; - - /* get input depending on the transport */ - if (pi->stream) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - - ret = recv_stream(pi); - } else { - struct in_addr *laddr; - - memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); - msg.msg_control = cbuf; - msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - if (laddr->s_addr == 0) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - } + ret = tport->transport->vtab->recv(pi); if (ret == -1) return (-1); Modified: head/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- head/contrib/bsnmp/snmpd/snmpd.h Mon Dec 26 10:16:05 2016 (r310585) +++ head/contrib/bsnmp/snmpd/snmpd.h Mon Dec 26 10:17:22 2016 (r310586) @@ -193,6 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); + ssize_t (*recv)(struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: head/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_lsock.c Mon Dec 26 10:16:05 2016 (r310585) +++ head/contrib/bsnmp/snmpd/trans_lsock.c Mon Dec 26 10:17:22 2016 (r310586) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t lsock_recv(struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -67,7 +69,8 @@ const struct transport_def lsock_trans = lsock_stop, lsock_close_port, lsock_init_port, - lsock_send + lsock_send, + lsock_recv }; static struct transport *my_trans; @@ -421,6 +424,73 @@ lsock_send(struct tport *tp, const u_cha return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_stream(struct port_input *pi) +{ + struct xucred ucred; + socklen_t ucredlen; + + /* obtain the accept time credentials */ + ucredlen = sizeof(ucred); + + if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && + ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) + pi->priv = (ucred.cr_uid == 0); + else + pi->priv = 0; +} + +/* + * Receive something + */ +static ssize_t +lsock_recv(struct port_input *pi) +{ + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + + msg.msg_control = NULL; + msg.msg_controllen = 0; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Return an error + * the caller must close the transport. */ + return (-1); + } + pi->buflen = buf_size(0); + pi->consumed = 0; + pi->length = 0; + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf + pi->length; + iov[0].iov_len = pi->buflen - pi->length; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + pi->length += len; + + if (pi->cred) + check_priv_stream(pi); + + return (0); +} + /* * Dependency to create a lsock port */ Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Mon Dec 26 10:16:05 2016 (r310585) +++ head/contrib/bsnmp/snmpd/trans_udp.c Mon Dec 26 10:17:22 2016 (r310586) @@ -32,6 +32,7 @@ */ #include #include +#include #include #include @@ -54,6 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); +static ssize_t udp_recv(struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -63,7 +65,8 @@ const struct transport_def udp_trans = { udp_stop, udp_close_port, udp_init_port, - udp_send + udp_send, + udp_recv }; static struct transport *my_trans; @@ -218,6 +221,123 @@ udp_send(struct tport *tp, const u_char return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); } +static void +check_priv_dgram(struct port_input *pi, struct sockcred *cred) +{ + + /* process explicitly sends credentials */ + if (cred) + pi->priv = (cred->sc_euid == 0); + else + pi->priv = 0; +} + +/* + * Input from a datagram socket. + * Each receive should return one datagram. + */ +static int +recv_dgram(struct port_input *pi, struct in_addr *laddr) +{ + u_char embuf[1000]; + char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + + CMSG_SPACE(sizeof(struct in_addr))]; + struct msghdr msg; + struct iovec iov[1]; + ssize_t len; + struct cmsghdr *cmsg; + struct sockcred *cred = NULL; + + if (pi->buf == NULL) { + /* no buffer yet - allocate one */ + if ((pi->buf = buf_alloc(0)) == NULL) { + /* ups - could not get buffer. Read away input + * and drop it */ + (void)recvfrom(pi->fd, embuf, sizeof(embuf), + 0, NULL, NULL); + /* return error */ + return (-1); + } + pi->buflen = buf_size(0); + } + + /* try to get a message */ + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + memset(cbuf, 0, sizeof(cbuf)); + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + msg.msg_flags = 0; + + iov[0].iov_base = pi->buf; + iov[0].iov_len = pi->buflen; + + len = recvmsg(pi->fd, &msg, 0); + + if (len == -1 || len == 0) + /* receive error */ + return (-1); + + if (msg.msg_flags & MSG_TRUNC) { + /* truncated - drop */ + snmpd_stats.silentDrops++; + snmpd_stats.inTooLong++; + return (-1); + } + + pi->length = (size_t)len; + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == IPPROTO_IP && + cmsg->cmsg_type == IP_RECVDSTADDR) + memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDS) + cred = (struct sockcred *)CMSG_DATA(cmsg); + } + + if (pi->cred) + check_priv_dgram(pi, cred); + + return (0); +} + +/* + * Receive something + */ +static ssize_t +udp_recv(struct port_input *pi) +{ + struct in_addr *laddr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct cmsghdr *cmsgp; + ssize_t ret; + + memset(cbuf, 0, sizeof(cbuf)); + + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsgp = CMSG_FIRSTHDR(&msg); + cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + cmsgp->cmsg_level = IPPROTO_IP; + cmsgp->cmsg_type = IP_SENDSRCADDR; + laddr = (struct in_addr *)CMSG_DATA(cmsgp); + + ret = recv_dgram(pi, laddr); + + if (laddr->s_addr == INADDR_ANY) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } + + return (ret); +} + /* * Port table */ From owner-svn-src-all@freebsd.org Mon Dec 26 10:21:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA428C909F7; Mon, 26 Dec 2016 10:21:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79C0E6A2; Mon, 26 Dec 2016 10:21:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQALSBL038147; Mon, 26 Dec 2016 10:21:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQALSFf038146; Mon, 26 Dec 2016 10:21:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612261021.uBQALSFf038146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 10:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310587 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:21:29 -0000 Author: ngie Date: Mon Dec 26 10:21:28 2016 New Revision: 310587 URL: https://svnweb.freebsd.org/changeset/base/310587 Log: Fix definition for recv_dgram(..); it should be "ssize_t", not "int" I'm not sure why this wasn't flagged as an issue by the compiler, yet MFC after: 3 weeks X-MFC with: r310586 Modified: head/contrib/bsnmp/snmpd/trans_udp.c Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Mon Dec 26 10:17:22 2016 (r310586) +++ head/contrib/bsnmp/snmpd/trans_udp.c Mon Dec 26 10:21:28 2016 (r310587) @@ -236,7 +236,7 @@ check_priv_dgram(struct port_input *pi, * Input from a datagram socket. * Each receive should return one datagram. */ -static int +static ssize_t recv_dgram(struct port_input *pi, struct in_addr *laddr) { u_char embuf[1000]; From owner-svn-src-all@freebsd.org Mon Dec 26 10:24:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D625C90C92; Mon, 26 Dec 2016 10:24:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A30EA1A; Mon, 26 Dec 2016 10:24:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQAOm0K040030; Mon, 26 Dec 2016 10:24:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQAOmhD040029; Mon, 26 Dec 2016 10:24:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612261024.uBQAOmhD040029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 10:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310588 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:24:49 -0000 Author: ngie Date: Mon Dec 26 10:24:48 2016 New Revision: 310588 URL: https://svnweb.freebsd.org/changeset/base/310588 Log: Fix return type for `ret` (recv callback) and sort variables by alignment Again, for reasons I don't yet understand, this is not being flagged by the compiler. Unlike the issue addressed in r310587, this problem existed prior to r310586 MFC after: 2 weeks X-MFC with: r310586, r310587 Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Mon Dec 26 10:21:28 2016 (r310587) +++ head/contrib/bsnmp/snmpd/main.c Mon Dec 26 10:24:48 2016 (r310588) @@ -1035,9 +1035,8 @@ snmpd_input(struct port_input *pi, struc struct snmp_pdu pdu; enum snmpd_input_err ierr, ferr; enum snmpd_proxy_err perr; + ssize_t ret, slen; int32_t vi; - int ret; - ssize_t slen; #ifdef USE_TCPWRAPPERS char client[16]; #endif From owner-svn-src-all@freebsd.org Mon Dec 26 10:41:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52CA8C0B32E; Mon, 26 Dec 2016 10:41:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03EF3875; Mon, 26 Dec 2016 10:41:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQAfqAB047026; Mon, 26 Dec 2016 10:41:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQAfqCs047025; Mon, 26 Dec 2016 10:41:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612261041.uBQAfqCs047025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Dec 2016 10:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310589 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:41:53 -0000 Author: hselasky Date: Mon Dec 26 10:41:51 2016 New Revision: 310589 URL: https://svnweb.freebsd.org/changeset/base/310589 Log: Implement more list header file functions. Add definition guard for the list_head structure. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/list.h Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Mon Dec 26 10:24:48 2016 (r310588) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Mon Dec 26 10:41:51 2016 (r310589) @@ -72,10 +72,18 @@ #define prefetch(x) +#define LINUX_LIST_HEAD_INIT(name) { &(name), &(name) } + +#define LINUX_LIST_HEAD(name) \ + struct list_head name = LINUX_LIST_HEAD_INIT(name) + +#ifndef LIST_HEAD_DEF +#define LIST_HEAD_DEF struct list_head { struct list_head *next; struct list_head *prev; }; +#endif static inline void INIT_LIST_HEAD(struct list_head *list) @@ -91,12 +99,26 @@ list_empty(const struct list_head *head) return (head->next == head); } +static inline int +list_empty_careful(const struct list_head *head) +{ + struct list_head *next = head->next; + + return ((next == head) && (next == head->prev)); +} + +static inline void +__list_del(struct list_head *prev, struct list_head *next) +{ + next->prev = prev; + WRITE_ONCE(prev->next, next); +} + static inline void list_del(struct list_head *entry) { - entry->next->prev = entry->prev; - entry->prev->next = entry->next; + __list_del(entry->prev, entry->next); } static inline void @@ -183,6 +205,11 @@ list_del_init(struct list_head *entry) for (p = list_entry((h)->prev, typeof(*p), field); &(p)->field != (h); \ p = list_entry((p)->field.prev, typeof(*p), field)) +#define list_for_each_entry_safe_reverse(p, n, h, field) \ + for (p = list_entry((h)->prev, typeof(*p), field), \ + n = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ + p = n, n = list_entry(n->field.prev, typeof(*n), field)) + #define list_for_each_entry_continue_reverse(p, h, field) \ for (p = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ p = list_entry((p)->field.prev, typeof(*p), field)) From owner-svn-src-all@freebsd.org Mon Dec 26 11:06:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C779C0BB75; Mon, 26 Dec 2016 11:06:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38D1A1337; Mon, 26 Dec 2016 11:06:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQB6gUZ056166; Mon, 26 Dec 2016 11:06:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQB6fi0056159; Mon, 26 Dec 2016 11:06:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612261106.uBQB6fi0056159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 26 Dec 2016 11:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310590 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 11:06:43 -0000 Author: tuexen Date: Mon Dec 26 11:06:41 2016 New Revision: 310590 URL: https://svnweb.freebsd.org/changeset/base/310590 Log: Whitespace changes. The toolchain for processing the sources has been updated. No functional change. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_bsd_addr.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon Dec 26 10:41:51 2016 (r310589) +++ head/sys/netinet/sctp_asconf.c Mon Dec 26 11:06:41 2016 (r310590) @@ -97,7 +97,7 @@ sctp_asconf_success_response(uint32_t id } static struct mbuf * -sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * error_tlv, +sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t *error_tlv, uint16_t tlv_length) { struct mbuf *m_reply = NULL; @@ -132,7 +132,7 @@ sctp_asconf_error_response(uint32_t id, return (NULL); } if (error_tlv != NULL) { - tlv = (uint8_t *) (error + 1); + tlv = (uint8_t *)(error + 1); memcpy(tlv, error_tlv, tlv_length); } SCTP_BUF_LEN(m_reply) = aph->ph.param_length; @@ -222,7 +222,7 @@ sctp_process_asconf_add_ip(struct sockad #endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *)aph, aparam_length); return (m_reply); } /* end switch */ @@ -237,7 +237,7 @@ sctp_process_asconf_add_ip(struct sockad /* add the address */ if (bad_address) { m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *)aph, aparam_length); } else if (sctp_add_remote_addr(stcb, sa, &net, stcb->asoc.port, SCTP_DONOT_SETSCOPE, @@ -245,7 +245,7 @@ sctp_process_asconf_add_ip(struct sockad SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *) aph, + SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *)aph, aparam_length); } else { /* notify upper layer */ @@ -367,7 +367,7 @@ sctp_process_asconf_delete_ip(struct soc #endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph, aparam_length); return (m_reply); } @@ -377,7 +377,7 @@ sctp_process_asconf_delete_ip(struct soc /* trying to delete the source address! */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph, + SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *)aph, aparam_length); return (m_reply); } @@ -391,7 +391,7 @@ sctp_process_asconf_delete_ip(struct soc /* what error to reply with?? */ m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_REQUEST_REFUSED, (uint8_t *) aph, + SCTP_CAUSE_REQUEST_REFUSED, (uint8_t *)aph, aparam_length); } else if (response_required) { m_reply = @@ -410,7 +410,7 @@ sctp_process_asconf_delete_ip(struct soc /* only one address in the asoc */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete last IP addr!\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_DELETING_LAST_ADDR, (uint8_t *) aph, + SCTP_CAUSE_DELETING_LAST_ADDR, (uint8_t *)aph, aparam_length); } else { if (response_required) { @@ -492,7 +492,7 @@ sctp_process_asconf_set_primary(struct s #endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph, aparam_length); return (m_reply); } @@ -563,7 +563,7 @@ sctp_process_asconf_set_primary(struct s "process_asconf_set_primary: set primary failed!\n"); /* must have been an invalid address, so report */ m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph, aparam_length); } @@ -658,7 +658,7 @@ sctp_handle_asconf(struct mbuf *m, unsig /* skip the lookup address parameter */ offset += sizeof(struct sctp_asconf_chunk); - p_addr = (struct sctp_ipv6addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), (uint8_t *) & aparam_buf); + p_addr = (struct sctp_ipv6addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), (uint8_t *)&aparam_buf); if (p_addr == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: couldn't get lookup addr!\n"); @@ -668,7 +668,7 @@ sctp_handle_asconf(struct mbuf *m, unsig /* param_length is already validated in process_control... */ offset += ntohs(p_addr->ph.param_length); /* skip lookup addr */ /* get pointer to first asconf param in ASCONF */ - aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *) & aparam_buf); + aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *)&aparam_buf); if (aph == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "Empty ASCONF received?\n"); goto send_reply; @@ -765,7 +765,7 @@ sctp_handle_asconf(struct mbuf *m, unsig /* get pointer to next asconf param */ aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), - (uint8_t *) & aparam_buf); + (uint8_t *)&aparam_buf); if (aph == NULL) { /* can't get an asconf paramhdr */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: can't get asconf param hdr!\n"); @@ -1094,7 +1094,7 @@ sctp_path_check_and_react(struct sctp_tc * NOT corresponding to the current nexthop, the path will * not be changed. */ - SCTP_RTALLOC((sctp_route_t *) & net->ro, + SCTP_RTALLOC((sctp_route_t *)&net->ro, stcb->sctp_ep->def_vrf_id, stcb->sctp_ep->fibnum); if (net->ro.ro_rt == NULL) @@ -1104,7 +1104,7 @@ sctp_path_check_and_react(struct sctp_tc switch (net->ro._l_addr.sa.sa_family) { #ifdef INET case AF_INET: - if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro)) { + if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *)&net->ro)) { changed = 1; } break; @@ -1112,7 +1112,7 @@ sctp_path_check_and_react(struct sctp_tc #ifdef INET6 case AF_INET6: if (sctp_v6src_match_nexthop( - &newifa->address.sin6, (sctp_route_t *) & net->ro)) { + &newifa->address.sin6, (sctp_route_t *)&net->ro)) { changed = 1; } break; @@ -2419,8 +2419,10 @@ sctp_is_addr_pending(struct sctp_tcb *st } } - /* we want to find the sequences which consist of ADD -> DEL -> ADD - * or DEL -> ADD */ + /* + * we want to find the sequences which consist of ADD -> DEL -> ADD + * or DEL -> ADD + */ if (add_cnt > del_cnt || (add_cnt == del_cnt && last_param_type == SCTP_ADD_IP_ADDRESS)) { return (1); @@ -2472,8 +2474,10 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_is_addr_restricted(stcb, sctp_ifa) && (!sctp_is_addr_pending(stcb, sctp_ifa))) continue; - /* found a valid local v4 address to - * use */ + /* + * found a valid local v4 address to + * use + */ if (addr_locked == SCTP_ADDR_NOT_LOCKED) SCTP_IPI_ADDR_RUNLOCK(); return (&sctp_ifa->address.sa); @@ -2490,8 +2494,10 @@ sctp_find_valid_localaddr(struct sctp_tc } sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - /* we skip unspecifed - * addresses */ + /* + * we skip unspecifed + * addresses + */ continue; } if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, @@ -2508,8 +2514,10 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_is_addr_restricted(stcb, sctp_ifa) && (!sctp_is_addr_pending(stcb, sctp_ifa))) continue; - /* found a valid local v6 address to - * use */ + /* + * found a valid local v6 address to + * use + */ if (addr_locked == SCTP_ADDR_NOT_LOCKED) SCTP_IPI_ADDR_RUNLOCK(); return (&sctp_ifa->address.sa); @@ -2777,7 +2785,7 @@ sctp_process_initack_addresses(struct sc /* go through the addresses in the init-ack */ ph = (struct sctp_paramhdr *) sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), - (uint8_t *) & tmp_param); + (uint8_t *)&tmp_param); while (ph != NULL) { ptype = ntohs(ph->param_type); plen = ntohs(ph->param_length); @@ -2791,7 +2799,7 @@ sctp_process_initack_addresses(struct sc a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr6_store); + (uint8_t *)&addr6_store); if (plen != sizeof(struct sctp_ipv6addr_param) || a6p == NULL) { return; @@ -2812,7 +2820,7 @@ sctp_process_initack_addresses(struct sc /* get the entire IPv4 address param */ a4p = (struct sctp_ipv4addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr4_store); + (uint8_t *)&addr4_store); if (plen != sizeof(struct sctp_ipv4addr_param) || a4p == NULL) { return; @@ -2874,7 +2882,7 @@ next_addr: if ((offset + sizeof(struct sctp_paramhdr)) > length) return; ph = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, - sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param); + sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param); } /* while */ } @@ -2925,7 +2933,7 @@ sctp_addr_in_initack(struct mbuf *m, uin } /* go through the addresses in the init-ack */ ph = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, - sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param); + sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param); while (ph != NULL) { ptype = ntohs(ph->param_type); plen = ntohs(ph->param_length); @@ -2941,7 +2949,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr6_store); + (uint8_t *)&addr6_store); if (a6p == NULL) { return (0); } @@ -2971,7 +2979,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a4p = (struct sctp_ipv4addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr4_store); + (uint8_t *)&addr4_store); if (a4p == NULL) { return (0); } @@ -2993,7 +3001,7 @@ sctp_addr_in_initack(struct mbuf *m, uin } ph = (struct sctp_paramhdr *) sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), - (uint8_t *) & tmp_param); + (uint8_t *)&tmp_param); } /* while */ /* not found! */ return (0); Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Mon Dec 26 10:41:51 2016 (r310589) +++ head/sys/netinet/sctp_auth.c Mon Dec 26 11:06:41 2016 (r310590) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); void -sctp_clear_chunklist(sctp_auth_chklist_t * chklist) +sctp_clear_chunklist(sctp_auth_chklist_t *chklist) { bzero(chklist, sizeof(*chklist)); /* chklist->num_chunks = 0; */ @@ -73,14 +73,14 @@ sctp_alloc_chunklist(void) } void -sctp_free_chunklist(sctp_auth_chklist_t * list) +sctp_free_chunklist(sctp_auth_chklist_t *list) { if (list != NULL) SCTP_FREE(list, SCTP_M_AUTH_CL); } sctp_auth_chklist_t * -sctp_copy_chunklist(sctp_auth_chklist_t * list) +sctp_copy_chunklist(sctp_auth_chklist_t *list) { sctp_auth_chklist_t *new_list; @@ -102,7 +102,7 @@ sctp_copy_chunklist(sctp_auth_chklist_t * add a chunk to the required chunks list */ int -sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list) +sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list) { if (list == NULL) return (-1); @@ -128,7 +128,7 @@ sctp_auth_add_chunk(uint8_t chunk, sctp_ * delete a chunk from the required chunks list */ int -sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t * list) +sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t *list) { if (list == NULL) return (-1); @@ -144,7 +144,7 @@ sctp_auth_delete_chunk(uint8_t chunk, sc } size_t -sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list) +sctp_auth_get_chklist_size(const sctp_auth_chklist_t *list) { if (list == NULL) return (0); @@ -157,7 +157,7 @@ sctp_auth_get_chklist_size(const sctp_au * guarantee ptr has space for up to 256 bytes */ int -sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * ptr) +sctp_serialize_auth_chunks(const sctp_auth_chklist_t *list, uint8_t *ptr) { int i, count = 0; @@ -174,7 +174,7 @@ sctp_serialize_auth_chunks(const sctp_au } int -sctp_pack_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * ptr) +sctp_pack_auth_chunks(const sctp_auth_chklist_t *list, uint8_t *ptr) { int i, size = 0; @@ -206,8 +206,8 @@ sctp_pack_auth_chunks(const sctp_auth_ch } int -sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks, - sctp_auth_chklist_t * list) +sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks, + sctp_auth_chklist_t *list) { int i; int size; @@ -257,14 +257,14 @@ sctp_alloc_key(uint32_t keylen) } void -sctp_free_key(sctp_key_t * key) +sctp_free_key(sctp_key_t *key) { if (key != NULL) SCTP_FREE(key, SCTP_M_AUTH_KY); } void -sctp_print_key(sctp_key_t * key, const char *str) +sctp_print_key(sctp_key_t *key, const char *str) { uint32_t i; @@ -283,7 +283,7 @@ sctp_print_key(sctp_key_t * key, const c } void -sctp_show_key(sctp_key_t * key, const char *str) +sctp_show_key(sctp_key_t *key, const char *str) { uint32_t i; @@ -302,7 +302,7 @@ sctp_show_key(sctp_key_t * key, const ch } static uint32_t -sctp_get_keylen(sctp_key_t * key) +sctp_get_keylen(sctp_key_t *key) { if (key != NULL) return (key->keylen); @@ -329,7 +329,7 @@ sctp_generate_random_key(uint32_t keylen } sctp_key_t * -sctp_set_key(uint8_t * key, uint32_t keylen) +sctp_set_key(uint8_t *key, uint32_t keylen) { sctp_key_t *new_key; @@ -349,7 +349,7 @@ sctp_set_key(uint8_t * key, uint32_t key * 0 if key1 = key2 */ static int -sctp_compare_key(sctp_key_t * key1, sctp_key_t * key2) +sctp_compare_key(sctp_key_t *key1, sctp_key_t *key2) { uint32_t maxlen; uint32_t i; @@ -400,7 +400,7 @@ sctp_compare_key(sctp_key_t * key1, sctp * order for concatenation */ sctp_key_t * -sctp_compute_hashkey(sctp_key_t * key1, sctp_key_t * key2, sctp_key_t * shared) +sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key2, sctp_key_t *shared) { uint32_t keylen; sctp_key_t *new_key; @@ -474,7 +474,7 @@ sctp_alloc_sharedkey(void) } void -sctp_free_sharedkey(sctp_sharedkey_t * skey) +sctp_free_sharedkey(sctp_sharedkey_t *skey) { if (skey == NULL) return; @@ -500,7 +500,7 @@ sctp_find_sharedkey(struct sctp_keyhead int sctp_insert_sharedkey(struct sctp_keyhead *shared_keys, - sctp_sharedkey_t * new_skey) + sctp_sharedkey_t *new_skey) { sctp_sharedkey_t *skey; @@ -594,7 +594,7 @@ sctp_auth_key_release(struct sctp_tcb *s } static sctp_sharedkey_t * -sctp_copy_sharedkey(const sctp_sharedkey_t * skey) +sctp_copy_sharedkey(const sctp_sharedkey_t *skey) { sctp_sharedkey_t *new_skey; @@ -652,7 +652,7 @@ sctp_alloc_hmaclist(uint16_t num_hmacs) } void -sctp_free_hmaclist(sctp_hmaclist_t * list) +sctp_free_hmaclist(sctp_hmaclist_t *list) { if (list != NULL) { SCTP_FREE(list, SCTP_M_AUTH_HL); @@ -661,7 +661,7 @@ sctp_free_hmaclist(sctp_hmaclist_t * lis } int -sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id) +sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id) { int i; @@ -689,7 +689,7 @@ sctp_auth_add_hmacid(sctp_hmaclist_t * l } sctp_hmaclist_t * -sctp_copy_hmaclist(sctp_hmaclist_t * list) +sctp_copy_hmaclist(sctp_hmaclist_t *list) { sctp_hmaclist_t *new_list; int i; @@ -727,7 +727,7 @@ sctp_default_supported_hmaclist(void) * find the best HMAC id to use for the peer based on local support */ uint16_t -sctp_negotiate_hmacid(sctp_hmaclist_t * peer, sctp_hmaclist_t * local) +sctp_negotiate_hmacid(sctp_hmaclist_t *peer, sctp_hmaclist_t *local) { int i, j; @@ -754,7 +754,7 @@ sctp_negotiate_hmacid(sctp_hmaclist_t * * caller must guarantee ptr has appropriate space */ int -sctp_serialize_hmaclist(sctp_hmaclist_t * list, uint8_t * ptr) +sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr) { int i; uint16_t hmac_id; @@ -800,7 +800,7 @@ sctp_alloc_authinfo(void) } void -sctp_free_authinfo(sctp_authinfo_t * authinfo) +sctp_free_authinfo(sctp_authinfo_t *authinfo) { if (authinfo == NULL) return; @@ -858,7 +858,7 @@ sctp_get_hmac_block_len(uint16_t hmac_al } static void -sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t * ctx) +sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t *ctx) { switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: @@ -875,8 +875,8 @@ sctp_hmac_init(uint16_t hmac_algo, sctp_ } static void -sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t * ctx, - uint8_t * text, uint32_t textlen) +sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t *ctx, + uint8_t *text, uint32_t textlen) { switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: @@ -893,8 +893,8 @@ sctp_hmac_update(uint16_t hmac_algo, sct } static void -sctp_hmac_final(uint16_t hmac_algo, sctp_hash_context_t * ctx, - uint8_t * digest) +sctp_hmac_final(uint16_t hmac_algo, sctp_hash_context_t *ctx, + uint8_t *digest) { switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: @@ -921,8 +921,8 @@ sctp_hmac_final(uint16_t hmac_algo, sctp * resultant digest. */ uint32_t -sctp_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, uint8_t * digest) +sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, uint8_t *digest) { uint32_t digestlen; uint32_t blocklen; @@ -981,8 +981,8 @@ sctp_hmac(uint16_t hmac_algo, uint8_t * /* mbuf version */ uint32_t -sctp_hmac_m(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - struct mbuf *m, uint32_t m_offset, uint8_t * digest, uint32_t trailer) +sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + struct mbuf *m, uint32_t m_offset, uint8_t *digest, uint32_t trailer) { uint32_t digestlen; uint32_t blocklen; @@ -1029,17 +1029,17 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t sctp_hmac_update(hmac_algo, &ctx, ipad, blocklen); /* find the correct starting mbuf and offset (get start of text) */ m_tmp = m; - while ((m_tmp != NULL) && (m_offset >= (uint32_t) SCTP_BUF_LEN(m_tmp))) { + while ((m_tmp != NULL) && (m_offset >= (uint32_t)SCTP_BUF_LEN(m_tmp))) { m_offset -= SCTP_BUF_LEN(m_tmp); m_tmp = SCTP_BUF_NEXT(m_tmp); } /* now use the rest of the mbuf chain for the text */ while (m_tmp != NULL) { if ((SCTP_BUF_NEXT(m_tmp) == NULL) && trailer) { - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, SCTP_BUF_LEN(m_tmp) - (trailer + m_offset)); } else { - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, SCTP_BUF_LEN(m_tmp) - m_offset); } @@ -1064,9 +1064,9 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t * Returns -1 on error, 0 on success. */ int -sctp_verify_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, - uint8_t * digest, uint32_t digestlen) +sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, + uint8_t *digest, uint32_t digestlen) { uint32_t len; uint8_t temp[SCTP_AUTH_DIGEST_LEN_MAX]; @@ -1097,8 +1097,8 @@ sctp_verify_hmac(uint16_t hmac_algo, uin * the keylen exceeds the HMAC block len). */ uint32_t -sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t * key, uint8_t * text, - uint32_t textlen, uint8_t * digest) +sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, uint8_t *text, + uint32_t textlen, uint8_t *digest) { uint32_t digestlen; uint32_t blocklen; @@ -1132,8 +1132,8 @@ sctp_compute_hmac(uint16_t hmac_algo, sc /* mbuf version */ uint32_t -sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t * key, struct mbuf *m, - uint32_t m_offset, uint8_t * digest) +sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *key, struct mbuf *m, + uint32_t m_offset, uint8_t *digest) { uint32_t digestlen; uint32_t blocklen; @@ -1164,7 +1164,7 @@ sctp_compute_hmac_m(uint16_t hmac_algo, } int -sctp_auth_is_supported_hmac(sctp_hmaclist_t * list, uint16_t id) +sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id) { int i; @@ -1422,7 +1422,7 @@ sctp_auth_get_cookie_params(struct sctp_ length += offset; phdr = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, - sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param); + sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param); while (phdr != NULL) { ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); @@ -1489,7 +1489,7 @@ sctp_auth_get_cookie_params(struct sctp_ if (offset + sizeof(struct sctp_paramhdr) > length) break; phdr = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), - (uint8_t *) & tmp_param); + (uint8_t *)&tmp_param); } /* concatenate the full random key */ keylen = sizeof(*p_random) + random_len + sizeof(*hmacs) + hmacs_len; @@ -1599,14 +1599,14 @@ sctp_bzero_m(struct mbuf *m, uint32_t m_ /* find the correct starting mbuf and offset (get start position) */ m_tmp = m; - while ((m_tmp != NULL) && (m_offset >= (uint32_t) SCTP_BUF_LEN(m_tmp))) { + while ((m_tmp != NULL) && (m_offset >= (uint32_t)SCTP_BUF_LEN(m_tmp))) { m_offset -= SCTP_BUF_LEN(m_tmp); m_tmp = SCTP_BUF_NEXT(m_tmp); } /* now use the rest of the mbuf chain */ while ((m_tmp != NULL) && (size > 0)) { - data = mtod(m_tmp, uint8_t *) + m_offset; - if (size > (uint32_t) SCTP_BUF_LEN(m_tmp)) { + data = mtod(m_tmp, uint8_t *)+m_offset; + if (size > (uint32_t)SCTP_BUF_LEN(m_tmp)) { bzero(data, SCTP_BUF_LEN(m_tmp)); size -= SCTP_BUF_LEN(m_tmp); } else { Modified: head/sys/netinet/sctp_auth.h ============================================================================== --- head/sys/netinet/sctp_auth.h Mon Dec 26 10:41:51 2016 (r310589) +++ head/sys/netinet/sctp_auth.h Mon Dec 26 11:06:41 2016 (r310590) @@ -51,12 +51,12 @@ __FBSDID("$FreeBSD$"); typedef union sctp_hash_context { SCTP_SHA1_CTX sha1; SCTP_SHA256_CTX sha256; -} sctp_hash_context_t; +} sctp_hash_context_t; typedef struct sctp_key { uint32_t keylen; uint8_t key[]; -} sctp_key_t; +} sctp_key_t; typedef struct sctp_shared_key { LIST_ENTRY(sctp_shared_key) next; @@ -64,7 +64,7 @@ typedef struct sctp_shared_key { uint32_t refcount; /* reference count */ uint16_t keyid; /* shared key ID */ uint8_t deactivated; /* key is deactivated */ -} sctp_sharedkey_t; +} sctp_sharedkey_t; LIST_HEAD(sctp_keyhead, sctp_shared_key); @@ -72,14 +72,14 @@ LIST_HEAD(sctp_keyhead, sctp_shared_key) typedef struct sctp_auth_chklist { uint8_t chunks[256]; uint8_t num_chunks; -} sctp_auth_chklist_t; +} sctp_auth_chklist_t; /* hmac algos supported list */ typedef struct sctp_hmaclist { uint16_t max_algo; /* max algorithms allocated */ uint16_t num_algo; /* num algorithms used */ uint16_t hmac[]; -} sctp_hmaclist_t; +} sctp_hmaclist_t; /* authentication info */ typedef struct sctp_authinformation { @@ -91,7 +91,7 @@ typedef struct sctp_authinformation { uint16_t active_keyid; /* active send keyid */ uint16_t assoc_keyid; /* current send keyid (cached) */ uint16_t recv_keyid; /* last recv keyid (cached) */ -} sctp_authinfo_t; +} sctp_authinfo_t; @@ -106,42 +106,42 @@ typedef struct sctp_authinformation { /* socket option api functions */ extern sctp_auth_chklist_t *sctp_alloc_chunklist(void); -extern void sctp_free_chunklist(sctp_auth_chklist_t * chklist); -extern void sctp_clear_chunklist(sctp_auth_chklist_t * chklist); -extern sctp_auth_chklist_t *sctp_copy_chunklist(sctp_auth_chklist_t * chklist); -extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list); -extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t * list); -extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list); +extern void sctp_free_chunklist(sctp_auth_chklist_t *chklist); +extern void sctp_clear_chunklist(sctp_auth_chklist_t *chklist); +extern sctp_auth_chklist_t *sctp_copy_chunklist(sctp_auth_chklist_t *chklist); +extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list); +extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t *list); +extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t *list); extern int -sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, - uint8_t * ptr); +sctp_serialize_auth_chunks(const sctp_auth_chklist_t *list, + uint8_t *ptr); extern int -sctp_pack_auth_chunks(const sctp_auth_chklist_t * list, - uint8_t * ptr); +sctp_pack_auth_chunks(const sctp_auth_chklist_t *list, + uint8_t *ptr); extern int -sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks, - sctp_auth_chklist_t * list); +sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks, + sctp_auth_chklist_t *list); /* key handling */ extern sctp_key_t *sctp_alloc_key(uint32_t keylen); -extern void sctp_free_key(sctp_key_t * key); -extern void sctp_print_key(sctp_key_t * key, const char *str); -extern void sctp_show_key(sctp_key_t * key, const char *str); +extern void sctp_free_key(sctp_key_t *key); +extern void sctp_print_key(sctp_key_t *key, const char *str); +extern void sctp_show_key(sctp_key_t *key, const char *str); extern sctp_key_t *sctp_generate_random_key(uint32_t keylen); -extern sctp_key_t *sctp_set_key(uint8_t * key, uint32_t keylen); +extern sctp_key_t *sctp_set_key(uint8_t *key, uint32_t keylen); extern sctp_key_t * -sctp_compute_hashkey(sctp_key_t * key1, sctp_key_t * key2, - sctp_key_t * shared); +sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key2, + sctp_key_t *shared); /* shared key handling */ extern sctp_sharedkey_t *sctp_alloc_sharedkey(void); -extern void sctp_free_sharedkey(sctp_sharedkey_t * skey); +extern void sctp_free_sharedkey(sctp_sharedkey_t *skey); extern sctp_sharedkey_t * sctp_find_sharedkey(struct sctp_keyhead *shared_keys, uint16_t key_id); extern int sctp_insert_sharedkey(struct sctp_keyhead *shared_keys, - sctp_sharedkey_t * new_skey); + sctp_sharedkey_t *new_skey); extern int sctp_copy_skeylist(const struct sctp_keyhead *src, struct sctp_keyhead *dest); @@ -155,42 +155,42 @@ sctp_auth_key_release(struct sctp_tcb *s /* hmac list handling */ extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint16_t num_hmacs); -extern void sctp_free_hmaclist(sctp_hmaclist_t * list); -extern int sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id); -extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t * list); +extern void sctp_free_hmaclist(sctp_hmaclist_t *list); +extern int sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id); +extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t *list); extern sctp_hmaclist_t *sctp_default_supported_hmaclist(void); extern uint16_t -sctp_negotiate_hmacid(sctp_hmaclist_t * peer, - sctp_hmaclist_t * local); -extern int sctp_serialize_hmaclist(sctp_hmaclist_t * list, uint8_t * ptr); +sctp_negotiate_hmacid(sctp_hmaclist_t *peer, + sctp_hmaclist_t *local); +extern int sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr); extern int sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs, uint32_t num_hmacs); extern sctp_authinfo_t *sctp_alloc_authinfo(void); -extern void sctp_free_authinfo(sctp_authinfo_t * authinfo); +extern void sctp_free_authinfo(sctp_authinfo_t *authinfo); /* keyed-HMAC functions */ extern uint32_t sctp_get_auth_chunk_len(uint16_t hmac_algo); extern uint32_t sctp_get_hmac_digest_len(uint16_t hmac_algo); extern uint32_t -sctp_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, uint8_t * digest); +sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, uint8_t *digest); extern int -sctp_verify_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, uint8_t * digest, uint32_t digestlen); +sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, uint8_t *digest, uint32_t digestlen); extern uint32_t -sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t * key, - uint8_t * text, uint32_t textlen, uint8_t * digest); -extern int sctp_auth_is_supported_hmac(sctp_hmaclist_t * list, uint16_t id); +sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, + uint8_t *text, uint32_t textlen, uint8_t *digest); +extern int sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id); /* mbuf versions */ extern uint32_t -sctp_hmac_m(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - struct mbuf *m, uint32_t m_offset, uint8_t * digest, uint32_t trailer); +sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + struct mbuf *m, uint32_t m_offset, uint8_t *digest, uint32_t trailer); extern uint32_t -sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t * key, - struct mbuf *m, uint32_t m_offset, uint8_t * digest); +sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *key, + struct mbuf *m, uint32_t m_offset, uint8_t *digest); /* * authentication routines @@ -212,7 +212,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, struct sctp_auth_chunk *auth, struct sctp_tcb *stcb, uint16_t key_id); extern struct mbuf * sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end, - struct sctp_auth_chunk **auth_ret, uint32_t * offset, + struct sctp_auth_chunk **auth_ret, uint32_t *offset, struct sctp_tcb *stcb, uint8_t chunk); extern int sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *ch, Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Mon Dec 26 10:41:51 2016 (r310589) +++ head/sys/netinet/sctp_bsd_addr.c Mon Dec 26 11:06:41 2016 (r310590) @@ -477,7 +477,7 @@ again_locked: lenat++; *lenat = value; lenat++; - tick_tock = (uint32_t *) lenat; + tick_tock = (uint32_t *)lenat; lenat++; *tick_tock = sctp_get_tick_count(); copyto = (void *)lenat; @@ -498,7 +498,7 @@ no_log: int -sctp_copy_out_packet_log(uint8_t * target, int length) +sctp_copy_out_packet_log(uint8_t *target, int length) { /* * We wind through the packet log starting at start copying up to Modified: head/sys/netinet/sctp_bsd_addr.h ============================================================================== --- head/sys/netinet/sctp_bsd_addr.h Mon Dec 26 10:41:51 2016 (r310589) +++ head/sys/netinet/sctp_bsd_addr.h Mon Dec 26 11:06:41 2016 (r310590) @@ -53,7 +53,7 @@ void sctp_gather_internal_ifa_flags(stru #ifdef SCTP_PACKET_LOGGING void sctp_packet_log(struct mbuf *m); -int sctp_copy_out_packet_log(uint8_t * target, int length); +int sctp_copy_out_packet_log(uint8_t *target, int length); #endif Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Mon Dec 26 10:41:51 2016 (r310589) +++ head/sys/netinet/sctp_cc_functions.c Mon Dec 26 11:06:41 2016 (r310590) @@ -122,7 +122,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc t_ssthresh += net->ssthresh; t_cwnd += net->cwnd; if (net->lastsa > 0) { - t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) net->lastsa; + t_ucwnd_sbw += (uint64_t)net->cwnd / (uint64_t)net->lastsa; } } if (t_ucwnd_sbw == 0) { @@ -150,27 +150,31 @@ sctp_cwnd_update_after_fr(struct sctp_tc if ((asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) || (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2)) { if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) { - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->ssthresh) / - (uint64_t) t_ssthresh); + net->ssthresh = (uint32_t)(((uint64_t)4 * + (uint64_t)net->mtu * + (uint64_t)net->ssthresh) / + (uint64_t)t_ssthresh); } if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2) { uint32_t srtt; srtt = net->lastsa; - /* lastsa>>3; we don't need - * to devide ... */ + /* + * lastsa>>3; we don't need + * to devide ... + */ if (srtt == 0) { srtt = 1; } - /* Short Version => Equal to - * Contel Version MBe */ - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->cwnd) / - ((uint64_t) srtt * + /* + * Short Version => Equal to + * Contel Version MBe + */ + net->ssthresh = (uint32_t)(((uint64_t)4 * + (uint64_t)net->mtu * + (uint64_t)net->cwnd) / + ((uint64_t)srtt * t_ucwnd_sbw)); /* INCREASE FACTOR */ ; } @@ -249,7 +253,7 @@ cc_bw_same(struct sctp_tcb *stcb, struct { uint64_t oth, probepoint; - probepoint = (((uint64_t) net->cwnd) << 32); + probepoint = (((uint64_t)net->cwnd) << 32); if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { /* * rtt increased we don't update bw.. so we don't update the @@ -385,7 +389,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st uint64_t oth, probepoint; /* Bandwidth decreased. */ - probepoint = (((uint64_t) net->cwnd) << 32); + probepoint = (((uint64_t)net->cwnd) << 32); if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { /* rtt increased */ /* Did we add more */ @@ -401,8 +405,10 @@ cc_bw_decrease(struct sctp_tcb *stcb, st net->flight_size, probepoint); if (net->cc_mod.rtcc.ret_from_eq) { - /* Switch over to CA if we are less - * aggressive */ + /* + * Switch over to CA if we are less + * aggressive + */ net->ssthresh = net->cwnd - 1; net->partial_bytes_acked = 0; } @@ -528,7 +534,7 @@ cc_bw_increase(struct sctp_tcb *stcb, st * attention to the inst_ind since our overall sum is increasing. */ /* PROBE POINT 0 */ - probepoint = (((uint64_t) net->cwnd) << 32); + probepoint = (((uint64_t)net->cwnd) << 32); SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), @@ -610,8 +616,8 @@ cc_bw_limit(struct sctp_tcb *stcb, struc */ bw_shift = SCTP_BASE_SYSCTL(sctp_rttvar_bw); rtt = stcb->asoc.my_vtag; - vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); - probepoint = (((uint64_t) net->cwnd) << 32); + vtag = (rtt << 32) | (((uint32_t)(stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); + probepoint = (((uint64_t)net->cwnd) << 32); rtt = net->rtt; if (net->cc_mod.rtcc.rtt_set_this_sack) { net->cc_mod.rtcc.rtt_set_this_sack = 0; @@ -631,7 +637,7 @@ cc_bw_limit(struct sctp_tcb *stcb, struc probepoint |= ((0xb << 16) | inst_ind); } else { inst_ind = net->cc_mod.rtcc.last_inst_ind; - inst_bw = bytes_for_this_rtt / (uint64_t) (net->rtt); + inst_bw = bytes_for_this_rtt / (uint64_t)(net->rtt); /* Can't determine do not change */ probepoint |= ((0xc << 16) | inst_ind); } @@ -703,11 +709,11 @@ sctp_cwnd_update_after_sack_common(struc if (srtt > 0) { uint64_t tmp; - t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) srtt; - t_path_mptcp += (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_Z) / - (((uint64_t) net->mtu) * (uint64_t) srtt); - tmp = (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_N) / - ((uint64_t) net->mtu * (uint64_t) (srtt * srtt)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 26 11:11:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E932C0BF89; Mon, 26 Dec 2016 11:11:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F28BB17E5; Mon, 26 Dec 2016 11:11:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQBBVKO057812; Mon, 26 Dec 2016 11:11:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQBBV0E057811; Mon, 26 Dec 2016 11:11:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612261111.uBQBBV0E057811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 11:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310591 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 11:11:32 -0000 Author: ngie Date: Mon Dec 26 11:11:30 2016 New Revision: 310591 URL: https://svnweb.freebsd.org/changeset/base/310591 Log: Update engine time using update_snmpd_engine_time(..) MFC after: 6 days X-MFC with: r310498 Sponsored by: Dell EMC Isilon Modified: head/contrib/bsnmp/snmpd/trap.c Modified: head/contrib/bsnmp/snmpd/trap.c ============================================================================== --- head/contrib/bsnmp/snmpd/trap.c Mon Dec 26 11:06:41 2016 (r310590) +++ head/contrib/bsnmp/snmpd/trap.c Mon Dec 26 11:11:30 2016 (r310591) @@ -464,7 +464,6 @@ static void snmp_create_v3_trap(struct snmp_pdu *pdu, struct target_param *target, const struct asn_oid *trap_oid) { - uint64_t etime; struct usm_user *usmuser; memset(pdu, 0, sizeof(*pdu)); @@ -487,14 +486,7 @@ snmp_create_v3_trap(struct snmp_pdu *pdu pdu->nbindings = 2; - etime = (get_ticks() - start_tick) / 100ULL; - if (etime < INT32_MAX) - snmpd_engine.engine_time = etime; - else { - start_tick = get_ticks(); - set_snmpd_engine(); - snmpd_engine.engine_time = start_tick; - } + update_snmpd_engine_time(); memcpy(pdu->engine.engine_id, snmpd_engine.engine_id, snmpd_engine.engine_len); From owner-svn-src-all@freebsd.org Mon Dec 26 11:16:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98000C910C6; Mon, 26 Dec 2016 11:16:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66F0B1BBC; Mon, 26 Dec 2016 11:16:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQBGtaN060231; Mon, 26 Dec 2016 11:16:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQBGtHk060230; Mon, 26 Dec 2016 11:16:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612261116.uBQBGtHk060230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 26 Dec 2016 11:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310592 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 11:16:56 -0000 Author: ngie Date: Mon Dec 26 11:16:55 2016 New Revision: 310592 URL: https://svnweb.freebsd.org/changeset/base/310592 Log: style(9): fix trailing whitespace MFC after: 3 days Modified: head/contrib/bsnmp/snmpd/trap.c Modified: head/contrib/bsnmp/snmpd/trap.c ============================================================================== --- head/contrib/bsnmp/snmpd/trap.c Mon Dec 26 11:11:30 2016 (r310591) +++ head/contrib/bsnmp/snmpd/trap.c Mon Dec 26 11:16:55 2016 (r310592) @@ -214,7 +214,7 @@ trapsink_unmodify(struct trapsink *t, st t->version = tdep->rb_version; if (tdep->set & TDEP_COMM) strcpy(t->comm, tdep->rb_comm); - + return (SNMP_ERR_NOERROR); } @@ -538,7 +538,7 @@ snmp_send_trap(const struct asn_oid *tra TAILQ_FOREACH(t, &trapsink_list, link) { if (t->status != TRAPSINK_ACTIVE) continue; - + if (t->version == TRAPSINK_V1) snmp_create_v1_trap(&pdu, t->comm, trap_oid); else From owner-svn-src-all@freebsd.org Mon Dec 26 11:20:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F67AC911A5; Mon, 26 Dec 2016 11:20:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3BB31DB0; Mon, 26 Dec 2016 11:20:41 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQBKeMl060417; Mon, 26 Dec 2016 11:20:40 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQBKefw060416; Mon, 26 Dec 2016 11:20:40 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612261120.uBQBKefw060416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 26 Dec 2016 11:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310593 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 11:20:42 -0000 Author: mmel Date: Mon Dec 26 11:20:40 2016 New Revision: 310593 URL: https://svnweb.freebsd.org/changeset/base/310593 Log: Fix late monitor hotplug event. If system starts without attached monitor, DRM create framebuffer for VT console. Later, when monitor is attached, the hotplug event must issue full modeset procedure to setup CRTC. In original code, this was done in drm_fb_helper_set_par(), but we don't have this function implemented yet. Use unrolled version of drm_fb_helper_set_par() to ensure same functionality. MFC after: 1 month Modified: head/sys/dev/drm2/drm_fb_helper.c Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Mon Dec 26 11:16:55 2016 (r310592) +++ head/sys/dev/drm2/drm_fb_helper.c Mon Dec 26 11:20:40 2016 (r310593) @@ -339,6 +339,7 @@ bool drm_fb_helper_restore_fbdev_mode(st { bool error = false; int i, ret; + for (i = 0; i < fb_helper->crtc_count; i++) { struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set; ret = mode_set->crtc->funcs->set_config(mode_set); @@ -841,6 +842,9 @@ int drm_fb_helper_single_fb_probe(struct struct drm_fb_helper_surface_size sizes; int gamma_size = 0; #if defined(__FreeBSD__) + struct drm_crtc *crtc; + struct drm_device *dev; + int ret; device_t kdev; #endif @@ -942,6 +946,24 @@ int drm_fb_helper_single_fb_probe(struct if (ret != 0) DRM_ERROR("Failed to attach fbd device: %d\n", ret); #endif + } else { + /* Modified version of drm_fb_helper_set_par() */ + dev = fb_helper->dev; + sx_xlock(&dev->mode_config.mutex); + for (i = 0; i < fb_helper->crtc_count; i++) { + crtc = fb_helper->crtc_info[i].mode_set.crtc; + ret = crtc->funcs->set_config(&fb_helper->crtc_info[i].mode_set); + if (ret) { + sx_xunlock(&dev->mode_config.mutex); + return ret; + } + } + sx_xunlock(&dev->mode_config.mutex); + + if (fb_helper->delayed_hotplug) { + fb_helper->delayed_hotplug = false; + drm_fb_helper_hotplug_event(fb_helper); + } } #else if (new_fb) { From owner-svn-src-all@freebsd.org Mon Dec 26 13:20:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72A44C91592; Mon, 26 Dec 2016 13:20:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5F310B8; Mon, 26 Dec 2016 13:20:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x242.google.com with SMTP id d22so10628121qtd.3; Mon, 26 Dec 2016 05:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=q3ctZqxznjooWMbLWf6hPPMeGXPKCnkl/rdCbEldtKE=; b=fa4Tsxhemi8Qb2dATWnyc+XN9jqStAwmWUD2kuXbkvrcjgRZDV+tvtexB6zf986p4B Dl13mwB0i3b7Wm+2vlcc9go+0zIjec7sguhP4vLuKRRn8G54EbRpZR9pw/4WAWvyi6RI Lze8llYDegNkKtqxCEcwvT85ex8nz9fnqn656XNFtSSbReHFATPQm/zsO7R3cCdkqePp 1wJROYQeWSMJznxWEe9R5kwboi2MJqhzQ+iCZzuU126cq1ewzqem2oyuig13zXjrzJhK QNoUd9oRaJFIod4B3p7+kQYe4b5KJHfJqfgTw4y40MujM7u9+auTG73uk71Ei5KZJIej 04dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=q3ctZqxznjooWMbLWf6hPPMeGXPKCnkl/rdCbEldtKE=; b=YlWbUaswok5g7kewRvV2A/tOIOl5ZvrcQSxWoPGUJCQEqv/E0s4mULKCGVvMZ7/fq8 5ibPCKZlmhGf/kqWdprc66Ax+JaczEEx+8kty2aTglgOozJe6WpWtD/sbJuFQLco9FDT k62AIJfglCCaxYv/ZEUUOQ42dxjx+XiuWCqU4augpz3YB3+qOS6okYQEEafCP+5SaHZA 9htFnf+tcedd0qINNGtjTqhZpxUaLqY2299fkFQfsc0eKT+g5WHnAuUHh4nO4Fy09Rs+ HAJk5e1TWQQvGyaigk/5+5LKHPTqMX3zZC+lugV10GjGIm+cgnqgqwPpkXEfX/0PJKkz 6Mng== X-Gm-Message-State: AIkVDXK3vGjf6NCkt6ZwVEa3AKuqFgSwq3L3IXW3/718GdRvfpNiF5ua669C0RljIwow1w== X-Received: by 10.200.38.50 with SMTP id u47mr28434542qtu.288.1482758424114; Mon, 26 Dec 2016 05:20:24 -0800 (PST) Received: from mbp.home ([187.94.175.146]) by smtp.gmail.com with ESMTPSA id 16sm26289834qtn.33.2016.12.26.05.20.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Dec 2016 05:20:23 -0800 (PST) Sender: Renato Botelho From: Renato Botelho Message-Id: <31D36CA7-4D63-43F6-8845-57F6B68E1925@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r293829 - head/sys/net Date: Mon, 26 Dec 2016 11:20:19 -0200 In-Reply-To: <201601131432.u0DEWn2H088657@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Andrey V. Elsukov" To: "Alexander V. Chernikov" References: <201601131432.u0DEWn2H088657@repo.freebsd.org> X-Mailer: Apple Mail (2.3259) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 13:20:25 -0000 Alexander, Looks like this change introduced a bug. It was reported at pfSense and = a ticket was opened at bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D215122 > On 13 Jan 2016, at 12:32, Alexander V. Chernikov = wrote: >=20 > Author: melifaro > Date: Wed Jan 13 14:32:48 2016 > New Revision: 293829 > URL: https://svnweb.freebsd.org/changeset/base/293829 >=20 > Log: > Remove RTF_RNH_LOCKED support from rtalloc1_fib(). >=20 > Last caller using it was eliminated in r293471. >=20 > Sponsored by: Yandex LLC >=20 > Modified: > head/sys/net/route.c > head/sys/net/route.h >=20 > Modified: head/sys/net/route.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/net/route.c Wed Jan 13 14:28:12 2016 = (r293828) > +++ head/sys/net/route.c Wed Jan 13 14:32:48 2016 = (r293829) > @@ -409,7 +409,6 @@ rtalloc1_fib(struct sockaddr *dst, int r > struct rtentry *newrt; > struct rt_addrinfo info; > int err =3D 0, msgtype =3D RTM_MISS; > - int needlock; >=20 > KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); > rnh =3D rt_tables_get_rnh(fibnum, dst->sa_family); > @@ -420,23 +419,16 @@ rtalloc1_fib(struct sockaddr *dst, int r > /* > * Look up the address in the table for that Address Family > */ > - needlock =3D !(ignflags & RTF_RNH_LOCKED); > - if (needlock) > - RADIX_NODE_HEAD_RLOCK(rnh); > -#ifdef INVARIANTS=09 > - else > - RADIX_NODE_HEAD_LOCK_ASSERT(rnh); > -#endif > + RADIX_NODE_HEAD_RLOCK(rnh); > rn =3D rnh->rnh_matchaddr(dst, rnh); > if (rn && ((rn->rn_flags & RNF_ROOT) =3D=3D 0)) { > newrt =3D RNTORT(rn); > RT_LOCK(newrt); > RT_ADDREF(newrt); > - if (needlock) > - RADIX_NODE_HEAD_RUNLOCK(rnh); > - goto done; > + RADIX_NODE_HEAD_RUNLOCK(rnh); > + return (newrt); >=20 > - } else if (needlock) > + } else > RADIX_NODE_HEAD_RUNLOCK(rnh); > =09 > /* > @@ -456,10 +448,7 @@ miss: > bzero(&info, sizeof(info)); > info.rti_info[RTAX_DST] =3D dst; > rt_missmsg_fib(msgtype, &info, 0, err, fibnum); > - }=09 > -done: > - if (newrt) > - RT_LOCK_ASSERT(newrt); > + } > return (newrt); > } >=20 >=20 > Modified: head/sys/net/route.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/net/route.h Wed Jan 13 14:28:12 2016 = (r293828) > +++ head/sys/net/route.h Wed Jan 13 14:32:48 2016 = (r293829) > @@ -175,7 +175,7 @@ struct rtentry { > /* 0x8000000 and up unassigned = */ > #define RTF_STICKY 0x10000000 /* always route dst->src = */ >=20 > -#define RTF_RNH_LOCKED 0x40000000 /* radix node head is = locked */ > +#define RTF_RNH_LOCKED 0x40000000 /* unused */ >=20 > #define RTF_GWFLAG_COMPAT 0x80000000 /* a compatibility bit = for interacting > with existing routing apps */ > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" -- Renato Botelho From owner-svn-src-all@freebsd.org Mon Dec 26 14:28:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60A12C91B86; Mon, 26 Dec 2016 14:28:25 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1721A12; Mon, 26 Dec 2016 14:28:25 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQESO1I041003; Mon, 26 Dec 2016 14:28:24 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQESOCT041000; Mon, 26 Dec 2016 14:28:24 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612261428.uBQESOCT041000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 26 Dec 2016 14:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310599 - in head/sys: conf dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 14:28:25 -0000 Author: mmel Date: Mon Dec 26 14:28:23 2016 New Revision: 310599 URL: https://svnweb.freebsd.org/changeset/base/310599 Log: Import drm_patform.c, an implementation of non-PCI based attachment for graphics drivers. It will be used in upcoming driver for Nvidia Tegra boards. MFC after: 1 month Added: head/sys/dev/drm2/drm_platform.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/drm2/drmP.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Dec 26 12:41:38 2016 (r310598) +++ head/sys/conf/files Mon Dec 26 14:28:23 2016 (r310599) @@ -1544,6 +1544,7 @@ dev/drm2/drm_memory.c optional drm2 dev/drm2/drm_mm.c optional drm2 dev/drm2/drm_modes.c optional drm2 dev/drm2/drm_pci.c optional drm2 +dev/drm2/drm_platform.c optional drm2 dev/drm2/drm_scatter.c optional drm2 dev/drm2/drm_stub.c optional drm2 dev/drm2/drm_sysctl.c optional drm2 Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Mon Dec 26 12:41:38 2016 (r310598) +++ head/sys/dev/drm2/drmP.h Mon Dec 26 14:28:23 2016 (r310599) @@ -1576,6 +1576,10 @@ extern int drm_pcie_get_speed_cap_mask(s #define drm_can_sleep() (DRM_HZ & 1) +/* Platform section */ +int drm_get_platform_dev(device_t kdev, struct drm_device *dev, + struct drm_driver *driver); + /* FreeBSD specific -- should be moved to drm_os_freebsd.h */ #define DRM_GEM_MAPPING_MASK (3ULL << 62) Added: head/sys/dev/drm2/drm_platform.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm_platform.c Mon Dec 26 14:28:23 2016 (r310599) @@ -0,0 +1,183 @@ +/* + * Derived from drm_pci.c + * + * Copyright 2003 José Fonseca. + * Copyright 2003 Leif Delgass. + * Copyright (c) 2009, Code Aurora Forum. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include + +static void drm_platform_free_irq(struct drm_device *dev) +{ + if (dev->irqr == NULL) + return; + + bus_release_resource(dev->dev, SYS_RES_IRQ, + dev->irqrid, dev->irqr); + + dev->irqr = NULL; + dev->irq = 0; +} + +static const char *drm_platform_get_name(struct drm_device *dev) +{ + return dev->driver->name; +} + +static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *master) +{ + int len, ret, id; + + master->unique_len = 13 + strlen(dev->driver->name); + master->unique_size = master->unique_len; + master->unique = malloc(master->unique_len + 1, DRM_MEM_DRIVER, M_NOWAIT); + + if (master->unique == NULL) + return -ENOMEM; + + id = 0; // XXX dev->driver->id; + + /* if only a single instance of the platform device, id will be + * set to -1.. use 0 instead to avoid a funny looking bus-id: + */ + if (id == -1) + id = 0; + + len = snprintf(master->unique, master->unique_len, + "platform:%s:%02d", dev->driver->name, id); + + if (len > master->unique_len) { + DRM_ERROR("Unique buffer overflowed\n"); + ret = -EINVAL; + goto err; + } + + return 0; +err: + return ret; +} + +static int drm_platform_get_irq(struct drm_device *dev) +{ + if (dev->irqr) + return (dev->irq); + + dev->irqr = bus_alloc_resource_any(dev->dev, SYS_RES_IRQ, + &dev->irqrid, RF_SHAREABLE); + if (!dev->irqr) { + dev_err(dev->dev, "Failed to allocate IRQ\n"); + return (0); + } + + dev->irq = (int) rman_get_start(dev->irqr); + + return (dev->irq); +} + +static struct drm_bus drm_platform_bus = { + .bus_type = DRIVER_BUS_PLATFORM, + .get_irq = drm_platform_get_irq, + .free_irq = drm_platform_free_irq, + .get_name = drm_platform_get_name, + .set_busid = drm_platform_set_busid, +}; + +/** + * Register. + * + * \param platdev - Platform device struture + * \return zero on success or a negative number on failure. + * + * Attempt to gets inter module "drm" information. If we are first + * then register the character device and inter module information. + * Try and register, if we fail to register, backout previous work. + */ + +int drm_get_platform_dev(device_t kdev, struct drm_device *dev, + struct drm_driver *driver) +{ + int ret; + + DRM_DEBUG("\n"); + + driver->bus = &drm_platform_bus; + + dev->dev = kdev; + + sx_xlock(&drm_global_mutex); + + ret = drm_fill_in_dev(dev, driver); + + if (ret) { + printf("DRM: Fill_in_dev failed.\n"); + goto err_g1; + } + + if (drm_core_check_feature(dev, DRIVER_MODESET)) { + ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL); + if (ret) + goto err_g1; + } + + ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY); + if (ret) + goto err_g2; + + if (dev->driver->load) { + ret = dev->driver->load(dev, 0); + if (ret) + goto err_g3; + } + + /* setup the grouping for the legacy output */ + if (drm_core_check_feature(dev, DRIVER_MODESET)) { + ret = drm_mode_group_init_legacy_group(dev, + &dev->primary->mode_group); + if (ret) + goto err_g3; + } + +#ifdef FREEBSD_NOTYET + list_add_tail(&dev->driver_item, &driver->device_list); +#endif /* FREEBSD_NOTYET */ + + sx_xunlock(&drm_global_mutex); + + DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", + driver->name, driver->major, driver->minor, driver->patchlevel, + driver->date, dev->primary->index); + + return 0; + +err_g3: + drm_put_minor(&dev->primary); +err_g2: + if (drm_core_check_feature(dev, DRIVER_MODESET)) + drm_put_minor(&dev->control); +err_g1: + sx_xunlock(&drm_global_mutex); + return ret; +} +EXPORT_SYMBOL(drm_get_platform_dev); From owner-svn-src-all@freebsd.org Mon Dec 26 14:36:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A876C91F8E; Mon, 26 Dec 2016 14:36:06 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53139134A; Mon, 26 Dec 2016 14:36:06 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQEa5Kl045714; Mon, 26 Dec 2016 14:36:05 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQEa5vB045711; Mon, 26 Dec 2016 14:36:05 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612261436.uBQEa5vB045711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 26 Dec 2016 14:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310600 - in head/sys/arm: conf nvidia/drm2 nvidia/tegra124 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 14:36:06 -0000 Author: mmel Date: Mon Dec 26 14:36:05 2016 New Revision: 310600 URL: https://svnweb.freebsd.org/changeset/base/310600 Log: Implement drivers for NVIDIA tegra124 display controller, HDMI source and host1x module. Unfortunately, tegra124 SoC doesn't have 2D acceleration engine and 3D requires not yet started nouveau driver. These drivers forms a first non-x86 DRM2 enabled graphic stack. Note, there are 2 outstanding issues: - The code uses gross hack in order to be comply with OBJT_MGTDEVICE pager. (See tegra_bo_init_pager() in tegra_bo.c) - Due to improper(probably) refcounting in drm_gem_mmap_single() (in drm_gem.c), the gem objects are never released. I hope that I will be able to address both issues in finite time, but I don't want to touch x86 world now. MFC after: 1 month Added: head/sys/arm/nvidia/drm2/ head/sys/arm/nvidia/drm2/hdmi.c (contents, props changed) head/sys/arm/nvidia/drm2/hdmi.h (contents, props changed) head/sys/arm/nvidia/drm2/tegra_bo.c (contents, props changed) head/sys/arm/nvidia/drm2/tegra_dc.c (contents, props changed) head/sys/arm/nvidia/drm2/tegra_dc_if.m (contents, props changed) head/sys/arm/nvidia/drm2/tegra_dc_reg.h (contents, props changed) head/sys/arm/nvidia/drm2/tegra_drm.h (contents, props changed) head/sys/arm/nvidia/drm2/tegra_drm_if.m (contents, props changed) head/sys/arm/nvidia/drm2/tegra_drm_subr.c (contents, props changed) head/sys/arm/nvidia/drm2/tegra_fb.c (contents, props changed) head/sys/arm/nvidia/drm2/tegra_hdmi.c (contents, props changed) head/sys/arm/nvidia/drm2/tegra_hdmi_reg.h (contents, props changed) head/sys/arm/nvidia/drm2/tegra_host1x.c (contents, props changed) Modified: head/sys/arm/conf/TEGRA124 head/sys/arm/nvidia/tegra124/files.tegra124 Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Mon Dec 26 14:28:23 2016 (r310599) +++ head/sys/arm/conf/TEGRA124 Mon Dec 26 14:36:05 2016 (r310600) @@ -123,11 +123,10 @@ device pci device re # RealTek 8139C+/8169/8169S/8110S # DRM2 -#device fbd -#device vt -#device splash -#device kbdmux -#device drm2 +device fbd +device vt +device kbdmux +device drm2 # Sound #device sound Added: head/sys/arm/nvidia/drm2/hdmi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/nvidia/drm2/hdmi.c Mon Dec 26 14:36:05 2016 (r310600) @@ -0,0 +1,1229 @@ +/* + * Copyright (C) 2012 Avionic Design GmbH + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#define EXPORT_SYMBOL(x) +#ifndef BIT +#define BIT(x) (1U << (x)) +#endif +#define hdmi_log(fmt, ...) printf(fmt, ##__VA_ARGS__) + +static uint8_t hdmi_infoframe_checksum(uint8_t *ptr, size_t size) +{ + uint8_t csum = 0; + size_t i; + + /* compute checksum */ + for (i = 0; i < size; i++) + csum += ptr[i]; + + return 256 - csum; +} + +static void hdmi_infoframe_set_checksum(void *buffer, size_t size) +{ + uint8_t *ptr = buffer; + + ptr[3] = hdmi_infoframe_checksum(buffer, size); +} + +/** + * hdmi_avi_infoframe_init() - initialize an HDMI AVI infoframe + * @frame: HDMI AVI infoframe + * + * Returns 0 on success or a negative error code on failure. + */ +int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame) +{ + memset(frame, 0, sizeof(*frame)); + + frame->type = HDMI_INFOFRAME_TYPE_AVI; + frame->version = 2; + frame->length = HDMI_AVI_INFOFRAME_SIZE; + + return 0; +} +EXPORT_SYMBOL(hdmi_avi_infoframe_init); + +/** + * hdmi_avi_infoframe_pack() - write HDMI AVI infoframe to binary buffer + * @frame: HDMI AVI infoframe + * @buffer: destination buffer + * @size: size of buffer + * + * Packs the information contained in the @frame structure into a binary + * representation that can be written into the corresponding controller + * registers. Also computes the checksum as required by section 5.3.5 of + * the HDMI 1.4 specification. + * + * Returns the number of bytes packed into the binary buffer or a negative + * error code on failure. + */ +ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer, + size_t size) +{ + uint8_t *ptr = buffer; + size_t length; + + length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; + + if (size < length) + return -ENOSPC; + + memset(buffer, 0, size); + + ptr[0] = frame->type; + ptr[1] = frame->version; + ptr[2] = frame->length; + ptr[3] = 0; /* checksum */ + + /* start infoframe payload */ + ptr += HDMI_INFOFRAME_HEADER_SIZE; + + ptr[0] = ((frame->colorspace & 0x3) << 5) | (frame->scan_mode & 0x3); + + /* + * Data byte 1, bit 4 has to be set if we provide the active format + * aspect ratio + */ + if (frame->active_aspect & 0xf) + ptr[0] |= BIT(4); + + /* Bit 3 and 2 indicate if we transmit horizontal/vertical bar data */ + if (frame->top_bar || frame->bottom_bar) + ptr[0] |= BIT(3); + + if (frame->left_bar || frame->right_bar) + ptr[0] |= BIT(2); + + ptr[1] = ((frame->colorimetry & 0x3) << 6) | + ((frame->picture_aspect & 0x3) << 4) | + (frame->active_aspect & 0xf); + + ptr[2] = ((frame->extended_colorimetry & 0x7) << 4) | + ((frame->quantization_range & 0x3) << 2) | + (frame->nups & 0x3); + + if (frame->itc) + ptr[2] |= BIT(7); + + ptr[3] = frame->video_code & 0x7f; + + ptr[4] = ((frame->ycc_quantization_range & 0x3) << 6) | + ((frame->content_type & 0x3) << 4) | + (frame->pixel_repeat & 0xf); + + ptr[5] = frame->top_bar & 0xff; + ptr[6] = (frame->top_bar >> 8) & 0xff; + ptr[7] = frame->bottom_bar & 0xff; + ptr[8] = (frame->bottom_bar >> 8) & 0xff; + ptr[9] = frame->left_bar & 0xff; + ptr[10] = (frame->left_bar >> 8) & 0xff; + ptr[11] = frame->right_bar & 0xff; + ptr[12] = (frame->right_bar >> 8) & 0xff; + + hdmi_infoframe_set_checksum(buffer, length); + + return length; +} +EXPORT_SYMBOL(hdmi_avi_infoframe_pack); + +/** + * hdmi_spd_infoframe_init() - initialize an HDMI SPD infoframe + * @frame: HDMI SPD infoframe + * @vendor: vendor string + * @product: product string + * + * Returns 0 on success or a negative error code on failure. + */ +int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame, + const char *vendor, const char *product) +{ + memset(frame, 0, sizeof(*frame)); + + frame->type = HDMI_INFOFRAME_TYPE_SPD; + frame->version = 1; + frame->length = HDMI_SPD_INFOFRAME_SIZE; + + strncpy(frame->vendor, vendor, sizeof(frame->vendor)); + strncpy(frame->product, product, sizeof(frame->product)); + + return 0; +} +EXPORT_SYMBOL(hdmi_spd_infoframe_init); + +/** + * hdmi_spd_infoframe_pack() - write HDMI SPD infoframe to binary buffer + * @frame: HDMI SPD infoframe + * @buffer: destination buffer + * @size: size of buffer + * + * Packs the information contained in the @frame structure into a binary + * representation that can be written into the corresponding controller + * registers. Also computes the checksum as required by section 5.3.5 of + * the HDMI 1.4 specification. + * + * Returns the number of bytes packed into the binary buffer or a negative + * error code on failure. + */ +ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer, + size_t size) +{ + uint8_t *ptr = buffer; + size_t length; + + length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; + + if (size < length) + return -ENOSPC; + + memset(buffer, 0, size); + + ptr[0] = frame->type; + ptr[1] = frame->version; + ptr[2] = frame->length; + ptr[3] = 0; /* checksum */ + + /* start infoframe payload */ + ptr += HDMI_INFOFRAME_HEADER_SIZE; + + memcpy(ptr, frame->vendor, sizeof(frame->vendor)); + memcpy(ptr + 8, frame->product, sizeof(frame->product)); + + ptr[24] = frame->sdi; + + hdmi_infoframe_set_checksum(buffer, length); + + return length; +} +EXPORT_SYMBOL(hdmi_spd_infoframe_pack); + +/** + * hdmi_audio_infoframe_init() - initialize an HDMI audio infoframe + * @frame: HDMI audio infoframe + * + * Returns 0 on success or a negative error code on failure. + */ +int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame) +{ + memset(frame, 0, sizeof(*frame)); + + frame->type = HDMI_INFOFRAME_TYPE_AUDIO; + frame->version = 1; + frame->length = HDMI_AUDIO_INFOFRAME_SIZE; + + return 0; +} +EXPORT_SYMBOL(hdmi_audio_infoframe_init); + +/** + * hdmi_audio_infoframe_pack() - write HDMI audio infoframe to binary buffer + * @frame: HDMI audio infoframe + * @buffer: destination buffer + * @size: size of buffer + * + * Packs the information contained in the @frame structure into a binary + * representation that can be written into the corresponding controller + * registers. Also computes the checksum as required by section 5.3.5 of + * the HDMI 1.4 specification. + * + * Returns the number of bytes packed into the binary buffer or a negative + * error code on failure. + */ +ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, + void *buffer, size_t size) +{ + unsigned char channels; + uint8_t *ptr = buffer; + size_t length; + + length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; + + if (size < length) + return -ENOSPC; + + memset(buffer, 0, size); + + if (frame->channels >= 2) + channels = frame->channels - 1; + else + channels = 0; + + ptr[0] = frame->type; + ptr[1] = frame->version; + ptr[2] = frame->length; + ptr[3] = 0; /* checksum */ + + /* start infoframe payload */ + ptr += HDMI_INFOFRAME_HEADER_SIZE; + + ptr[0] = ((frame->coding_type & 0xf) << 4) | (channels & 0x7); + ptr[1] = ((frame->sample_frequency & 0x7) << 2) | + (frame->sample_size & 0x3); + ptr[2] = frame->coding_type_ext & 0x1f; + ptr[3] = frame->channel_allocation; + ptr[4] = (frame->level_shift_value & 0xf) << 3; + + if (frame->downmix_inhibit) + ptr[4] |= BIT(7); + + hdmi_infoframe_set_checksum(buffer, length); + + return length; +} +EXPORT_SYMBOL(hdmi_audio_infoframe_pack); + +/** + * hdmi_vendor_infoframe_init() - initialize an HDMI vendor infoframe + * @frame: HDMI vendor infoframe + * + * Returns 0 on success or a negative error code on failure. + */ +int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame) +{ + memset(frame, 0, sizeof(*frame)); + + frame->type = HDMI_INFOFRAME_TYPE_VENDOR; + frame->version = 1; + + frame->oui = HDMI_IEEE_OUI; + + /* + * 0 is a valid value for s3d_struct, so we use a special "not set" + * value + */ + frame->s3d_struct = HDMI_3D_STRUCTURE_INVALID; + + return 0; +} +EXPORT_SYMBOL(hdmi_vendor_infoframe_init); + +/** + * hdmi_vendor_infoframe_pack() - write a HDMI vendor infoframe to binary buffer + * @frame: HDMI infoframe + * @buffer: destination buffer + * @size: size of buffer + * + * Packs the information contained in the @frame structure into a binary + * representation that can be written into the corresponding controller + * registers. Also computes the checksum as required by section 5.3.5 of + * the HDMI 1.4 specification. + * + * Returns the number of bytes packed into the binary buffer or a negative + * error code on failure. + */ +ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, + void *buffer, size_t size) +{ + uint8_t *ptr = buffer; + size_t length; + + /* empty info frame */ + if (frame->vic == 0 && frame->s3d_struct == HDMI_3D_STRUCTURE_INVALID) + return -EINVAL; + + /* only one of those can be supplied */ + if (frame->vic != 0 && frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID) + return -EINVAL; + + /* for side by side (half) we also need to provide 3D_Ext_Data */ + if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) + frame->length = 6; + else + frame->length = 5; + + length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; + + if (size < length) + return -ENOSPC; + + memset(buffer, 0, size); + + ptr[0] = frame->type; + ptr[1] = frame->version; + ptr[2] = frame->length; + ptr[3] = 0; /* checksum */ + + /* HDMI OUI */ + ptr[4] = 0x03; + ptr[5] = 0x0c; + ptr[6] = 0x00; + + if (frame->vic) { + ptr[7] = 0x1 << 5; /* video format */ + ptr[8] = frame->vic; + } else { + ptr[7] = 0x2 << 5; /* video format */ + ptr[8] = (frame->s3d_struct & 0xf) << 4; + if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) + ptr[9] = (frame->s3d_ext_data & 0xf) << 4; + } + + hdmi_infoframe_set_checksum(buffer, length); + + return length; +} +EXPORT_SYMBOL(hdmi_vendor_infoframe_pack); + +/* + * hdmi_vendor_any_infoframe_pack() - write a vendor infoframe to binary buffer + */ +static ssize_t +hdmi_vendor_any_infoframe_pack(union hdmi_vendor_any_infoframe *frame, + void *buffer, size_t size) +{ + /* we only know about HDMI vendor infoframes */ + if (frame->any.oui != HDMI_IEEE_OUI) + return -EINVAL; + + return hdmi_vendor_infoframe_pack(&frame->hdmi, buffer, size); +} + +/** + * hdmi_infoframe_pack() - write a HDMI infoframe to binary buffer + * @frame: HDMI infoframe + * @buffer: destination buffer + * @size: size of buffer + * + * Packs the information contained in the @frame structure into a binary + * representation that can be written into the corresponding controller + * registers. Also computes the checksum as required by section 5.3.5 of + * the HDMI 1.4 specification. + * + * Returns the number of bytes packed into the binary buffer or a negative + * error code on failure. + */ +ssize_t +hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size) +{ + ssize_t length; + + switch (frame->any.type) { + case HDMI_INFOFRAME_TYPE_AVI: + length = hdmi_avi_infoframe_pack(&frame->avi, buffer, size); + break; + case HDMI_INFOFRAME_TYPE_SPD: + length = hdmi_spd_infoframe_pack(&frame->spd, buffer, size); + break; + case HDMI_INFOFRAME_TYPE_AUDIO: + length = hdmi_audio_infoframe_pack(&frame->audio, buffer, size); + break; + case HDMI_INFOFRAME_TYPE_VENDOR: + length = hdmi_vendor_any_infoframe_pack(&frame->vendor, + buffer, size); + break; + default: + printf("Bad infoframe type %d\n", frame->any.type); + length = -EINVAL; + } + + return length; +} +EXPORT_SYMBOL(hdmi_infoframe_pack); + +static const char *hdmi_infoframe_type_get_name(enum hdmi_infoframe_type type) +{ + if (type < 0x80 || type > 0x9f) + return "Invalid"; + switch (type) { + case HDMI_INFOFRAME_TYPE_VENDOR: + return "Vendor"; + case HDMI_INFOFRAME_TYPE_AVI: + return "Auxiliary Video Information (AVI)"; + case HDMI_INFOFRAME_TYPE_SPD: + return "Source Product Description (SPD)"; + case HDMI_INFOFRAME_TYPE_AUDIO: + return "Audio"; + } + return "Reserved"; +} + +static void hdmi_infoframe_log_header(struct hdmi_any_infoframe *frame) +{ + hdmi_log("HDMI infoframe: %s, version %u, length %u\n", + hdmi_infoframe_type_get_name(frame->type), + frame->version, frame->length); +} + +static const char *hdmi_colorspace_get_name(enum hdmi_colorspace colorspace) +{ + switch (colorspace) { + case HDMI_COLORSPACE_RGB: + return "RGB"; + case HDMI_COLORSPACE_YUV422: + return "YCbCr 4:2:2"; + case HDMI_COLORSPACE_YUV444: + return "YCbCr 4:4:4"; + case HDMI_COLORSPACE_YUV420: + return "YCbCr 4:2:0"; + case HDMI_COLORSPACE_RESERVED4: + return "Reserved (4)"; + case HDMI_COLORSPACE_RESERVED5: + return "Reserved (5)"; + case HDMI_COLORSPACE_RESERVED6: + return "Reserved (6)"; + case HDMI_COLORSPACE_IDO_DEFINED: + return "IDO Defined"; + } + return "Invalid"; +} + +static const char *hdmi_scan_mode_get_name(enum hdmi_scan_mode scan_mode) +{ + switch (scan_mode) { + case HDMI_SCAN_MODE_NONE: + return "No Data"; + case HDMI_SCAN_MODE_OVERSCAN: + return "Overscan"; + case HDMI_SCAN_MODE_UNDERSCAN: + return "Underscan"; + case HDMI_SCAN_MODE_RESERVED: + return "Reserved"; + } + return "Invalid"; +} + +static const char *hdmi_colorimetry_get_name(enum hdmi_colorimetry colorimetry) +{ + switch (colorimetry) { + case HDMI_COLORIMETRY_NONE: + return "No Data"; + case HDMI_COLORIMETRY_ITU_601: + return "ITU601"; + case HDMI_COLORIMETRY_ITU_709: + return "ITU709"; + case HDMI_COLORIMETRY_EXTENDED: + return "Extended"; + } + return "Invalid"; +} + +static const char * +hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect) +{ + switch (picture_aspect) { + case HDMI_PICTURE_ASPECT_NONE: + return "No Data"; + case HDMI_PICTURE_ASPECT_4_3: + return "4:3"; + case HDMI_PICTURE_ASPECT_16_9: + return "16:9"; + case HDMI_PICTURE_ASPECT_RESERVED: + return "Reserved"; + } + return "Invalid"; +} + +static const char * +hdmi_active_aspect_get_name(enum hdmi_active_aspect active_aspect) +{ + if (active_aspect > 0xf) + return "Invalid"; + + switch (active_aspect) { + case HDMI_ACTIVE_ASPECT_16_9_TOP: + return "16:9 Top"; + case HDMI_ACTIVE_ASPECT_14_9_TOP: + return "14:9 Top"; + case HDMI_ACTIVE_ASPECT_16_9_CENTER: + return "16:9 Center"; + case HDMI_ACTIVE_ASPECT_PICTURE: + return "Same as Picture"; + case HDMI_ACTIVE_ASPECT_4_3: + return "4:3"; + case HDMI_ACTIVE_ASPECT_16_9: + return "16:9"; + case HDMI_ACTIVE_ASPECT_14_9: + return "14:9"; + case HDMI_ACTIVE_ASPECT_4_3_SP_14_9: + return "4:3 SP 14:9"; + case HDMI_ACTIVE_ASPECT_16_9_SP_14_9: + return "16:9 SP 14:9"; + case HDMI_ACTIVE_ASPECT_16_9_SP_4_3: + return "16:9 SP 4:3"; + } + return "Reserved"; +} + +static const char * +hdmi_extended_colorimetry_get_name(enum hdmi_extended_colorimetry ext_col) +{ + switch (ext_col) { + case HDMI_EXTENDED_COLORIMETRY_XV_YCC_601: + return "xvYCC 601"; + case HDMI_EXTENDED_COLORIMETRY_XV_YCC_709: + return "xvYCC 709"; + case HDMI_EXTENDED_COLORIMETRY_S_YCC_601: + return "sYCC 601"; + case HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601: + return "Adobe YCC 601"; + case HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB: + return "Adobe RGB"; + case HDMI_EXTENDED_COLORIMETRY_BT2020_CONST_LUM: + return "BT.2020 Constant Luminance"; + case HDMI_EXTENDED_COLORIMETRY_BT2020: + return "BT.2020"; + case HDMI_EXTENDED_COLORIMETRY_RESERVED: + return "Reserved"; + } + return "Invalid"; +} + +static const char * +hdmi_quantization_range_get_name(enum hdmi_quantization_range qrange) +{ + switch (qrange) { + case HDMI_QUANTIZATION_RANGE_DEFAULT: + return "Default"; + case HDMI_QUANTIZATION_RANGE_LIMITED: + return "Limited"; + case HDMI_QUANTIZATION_RANGE_FULL: + return "Full"; + case HDMI_QUANTIZATION_RANGE_RESERVED: + return "Reserved"; + } + return "Invalid"; +} + +static const char *hdmi_nups_get_name(enum hdmi_nups nups) +{ + switch (nups) { + case HDMI_NUPS_UNKNOWN: + return "Unknown Non-uniform Scaling"; + case HDMI_NUPS_HORIZONTAL: + return "Horizontally Scaled"; + case HDMI_NUPS_VERTICAL: + return "Vertically Scaled"; + case HDMI_NUPS_BOTH: + return "Horizontally and Vertically Scaled"; + } + return "Invalid"; +} + +static const char * +hdmi_ycc_quantization_range_get_name(enum hdmi_ycc_quantization_range qrange) +{ + switch (qrange) { + case HDMI_YCC_QUANTIZATION_RANGE_LIMITED: + return "Limited"; + case HDMI_YCC_QUANTIZATION_RANGE_FULL: + return "Full"; + } + return "Invalid"; +} + +static const char * +hdmi_content_type_get_name(enum hdmi_content_type content_type) +{ + switch (content_type) { + case HDMI_CONTENT_TYPE_GRAPHICS: + return "Graphics"; + case HDMI_CONTENT_TYPE_PHOTO: + return "Photo"; + case HDMI_CONTENT_TYPE_CINEMA: + return "Cinema"; + case HDMI_CONTENT_TYPE_GAME: + return "Game"; + } + return "Invalid"; +} + +/** + * hdmi_avi_infoframe_log() - log info of HDMI AVI infoframe + * @level: logging level + * @dev: device + * @frame: HDMI AVI infoframe + */ +static void hdmi_avi_infoframe_log(struct hdmi_avi_infoframe *frame) +{ + hdmi_infoframe_log_header((struct hdmi_any_infoframe *)frame); + + hdmi_log(" colorspace: %s\n", + hdmi_colorspace_get_name(frame->colorspace)); + hdmi_log(" scan mode: %s\n", + hdmi_scan_mode_get_name(frame->scan_mode)); + hdmi_log(" colorimetry: %s\n", + hdmi_colorimetry_get_name(frame->colorimetry)); + hdmi_log(" picture aspect: %s\n", + hdmi_picture_aspect_get_name(frame->picture_aspect)); + hdmi_log(" active aspect: %s\n", + hdmi_active_aspect_get_name(frame->active_aspect)); + hdmi_log(" itc: %s\n", frame->itc ? "IT Content" : "No Data"); + hdmi_log(" extended colorimetry: %s\n", + hdmi_extended_colorimetry_get_name(frame->extended_colorimetry)); + hdmi_log(" quantization range: %s\n", + hdmi_quantization_range_get_name(frame->quantization_range)); + hdmi_log(" nups: %s\n", hdmi_nups_get_name(frame->nups)); + hdmi_log(" video code: %u\n", frame->video_code); + hdmi_log(" ycc quantization range: %s\n", + hdmi_ycc_quantization_range_get_name(frame->ycc_quantization_range)); + hdmi_log(" hdmi content type: %s\n", + hdmi_content_type_get_name(frame->content_type)); + hdmi_log(" pixel repeat: %u\n", frame->pixel_repeat); + hdmi_log(" bar top %u, bottom %u, left %u, right %u\n", + frame->top_bar, frame->bottom_bar, + frame->left_bar, frame->right_bar); +} + +static const char *hdmi_spd_sdi_get_name(enum hdmi_spd_sdi sdi) +{ +; + switch (sdi) { + case HDMI_SPD_SDI_UNKNOWN: + return "Unknown"; + case HDMI_SPD_SDI_DSTB: + return "Digital STB"; + case HDMI_SPD_SDI_DVDP: + return "DVD Player"; + case HDMI_SPD_SDI_DVHS: + return "D-VHS"; + case HDMI_SPD_SDI_HDDVR: + return "HDD Videorecorder"; + case HDMI_SPD_SDI_DVC: + return "DVC"; + case HDMI_SPD_SDI_DSC: + return "DSC"; + case HDMI_SPD_SDI_VCD: + return "Video CD"; + case HDMI_SPD_SDI_GAME: + return "Game"; + case HDMI_SPD_SDI_PC: + return "PC General"; + case HDMI_SPD_SDI_BD: + return "Blu-Ray Disc (BD)"; + case HDMI_SPD_SDI_SACD: + return "Super Audio CD"; + case HDMI_SPD_SDI_HDDVD: + return "HD DVD"; + case HDMI_SPD_SDI_PMP: + return "PMP"; + } + return "Reserved"; +} + +/** + * hdmi_spd_infoframe_log() - log info of HDMI SPD infoframe + * @level: logging level + * @dev: device + * @frame: HDMI SPD infoframe + */ +static void hdmi_spd_infoframe_log(struct hdmi_spd_infoframe *frame) +{ + uint8_t buf[17]; + + hdmi_infoframe_log_header((struct hdmi_any_infoframe *)frame); + + memset(buf, 0, sizeof(buf)); + + strncpy(buf, frame->vendor, 8); + hdmi_log(" vendor: %s\n", buf); + strncpy(buf, frame->product, 16); + hdmi_log(" product: %s\n", buf); + hdmi_log(" source device information: %s (0x%x)\n", + hdmi_spd_sdi_get_name(frame->sdi), frame->sdi); +} + +static const char * +hdmi_audio_coding_type_get_name(enum hdmi_audio_coding_type coding_type) +{ + switch (coding_type) { + case HDMI_AUDIO_CODING_TYPE_STREAM: + return "Refer to Stream Header"; + case HDMI_AUDIO_CODING_TYPE_PCM: + return "PCM"; + case HDMI_AUDIO_CODING_TYPE_AC3: + return "AC-3"; + case HDMI_AUDIO_CODING_TYPE_MPEG1: + return "MPEG1"; + case HDMI_AUDIO_CODING_TYPE_MP3: + return "MP3"; + case HDMI_AUDIO_CODING_TYPE_MPEG2: + return "MPEG2"; + case HDMI_AUDIO_CODING_TYPE_AAC_LC: + return "AAC"; + case HDMI_AUDIO_CODING_TYPE_DTS: + return "DTS"; + case HDMI_AUDIO_CODING_TYPE_ATRAC: + return "ATRAC"; + case HDMI_AUDIO_CODING_TYPE_DSD: + return "One Bit Audio"; + case HDMI_AUDIO_CODING_TYPE_EAC3: + return "Dolby Digital +"; + case HDMI_AUDIO_CODING_TYPE_DTS_HD: + return "DTS-HD"; + case HDMI_AUDIO_CODING_TYPE_MLP: + return "MAT (MLP)"; + case HDMI_AUDIO_CODING_TYPE_DST: + return "DST"; + case HDMI_AUDIO_CODING_TYPE_WMA_PRO: + return "WMA PRO"; + case HDMI_AUDIO_CODING_TYPE_CXT: + return "Refer to CXT"; + } + return "Invalid"; +} + +static const char * +hdmi_audio_sample_size_get_name(enum hdmi_audio_sample_size sample_size) +{ + switch (sample_size) { + case HDMI_AUDIO_SAMPLE_SIZE_STREAM: + return "Refer to Stream Header"; + case HDMI_AUDIO_SAMPLE_SIZE_16: + return "16 bit"; + case HDMI_AUDIO_SAMPLE_SIZE_20: + return "20 bit"; + case HDMI_AUDIO_SAMPLE_SIZE_24: + return "24 bit"; + } + return "Invalid"; +} + +static const char * +hdmi_audio_sample_frequency_get_name(enum hdmi_audio_sample_frequency freq) +{ + switch (freq) { + case HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM: + return "Refer to Stream Header"; + case HDMI_AUDIO_SAMPLE_FREQUENCY_32000: + return "32 kHz"; + case HDMI_AUDIO_SAMPLE_FREQUENCY_44100: + return "44.1 kHz (CD)"; + case HDMI_AUDIO_SAMPLE_FREQUENCY_48000: + return "48 kHz"; + case HDMI_AUDIO_SAMPLE_FREQUENCY_88200: + return "88.2 kHz"; + case HDMI_AUDIO_SAMPLE_FREQUENCY_96000: + return "96 kHz"; + case HDMI_AUDIO_SAMPLE_FREQUENCY_176400: + return "176.4 kHz"; + case HDMI_AUDIO_SAMPLE_FREQUENCY_192000: + return "192 kHz"; + } + return "Invalid"; +} + +static const char * +hdmi_audio_coding_type_ext_get_name(enum hdmi_audio_coding_type_ext ctx) +{ + + switch (ctx) { + case HDMI_AUDIO_CODING_TYPE_EXT_CT: + return "Refer to CT"; + case HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC: + return "HE AAC"; + case HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2: + return "HE AAC v2"; + case HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND: + return "MPEG SURROUND"; + case HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC: + return "MPEG-4 HE AAC"; + case HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC_V2: + return "MPEG-4 HE AAC v2"; + case HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_AAC_LC: + return "MPEG-4 AAC LC"; + case HDMI_AUDIO_CODING_TYPE_EXT_DRA: + return "DRA"; + case HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC_SURROUND: + return "MPEG-4 HE AAC + MPEG Surround"; + case HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_AAC_LC_SURROUND: + return "MPEG-4 AAC LC + MPEG Surround"; + } + return "Reserved"; +} + +/** + * hdmi_audio_infoframe_log() - log info of HDMI AUDIO infoframe + * @level: logging level + * @dev: device + * @frame: HDMI AUDIO infoframe + */ +static void hdmi_audio_infoframe_log(struct hdmi_audio_infoframe *frame) +{ + hdmi_infoframe_log_header((struct hdmi_any_infoframe *)frame); + + if (frame->channels) + hdmi_log(" channels: %u\n", frame->channels - 1); + else + hdmi_log(" channels: Refer to stream header\n"); + hdmi_log(" coding type: %s\n", + hdmi_audio_coding_type_get_name(frame->coding_type)); + hdmi_log(" sample size: %s\n", + hdmi_audio_sample_size_get_name(frame->sample_size)); + hdmi_log(" sample frequency: %s\n", + hdmi_audio_sample_frequency_get_name(frame->sample_frequency)); + hdmi_log(" coding type ext: %s\n", + hdmi_audio_coding_type_ext_get_name(frame->coding_type_ext)); + hdmi_log(" channel allocation: 0x%x\n", + frame->channel_allocation); + hdmi_log(" level shift value: %u dB\n", + frame->level_shift_value); + hdmi_log(" downmix inhibit: %s\n", + frame->downmix_inhibit ? "Yes" : "No"); +} + +static const char * +hdmi_3d_structure_get_name(enum hdmi_3d_structure s3d_struct) +{ + if (s3d_struct < 0 || s3d_struct > 0xf) + return "Invalid"; + + switch (s3d_struct) { + case HDMI_3D_STRUCTURE_FRAME_PACKING: + return "Frame Packing"; + case HDMI_3D_STRUCTURE_FIELD_ALTERNATIVE: + return "Field Alternative"; + case HDMI_3D_STRUCTURE_LINE_ALTERNATIVE: + return "Line Alternative"; + case HDMI_3D_STRUCTURE_SIDE_BY_SIDE_FULL: + return "Side-by-side (Full)"; + case HDMI_3D_STRUCTURE_L_DEPTH: + return "L + Depth"; + case HDMI_3D_STRUCTURE_L_DEPTH_GFX_GFX_DEPTH: + return "L + Depth + Graphics + Graphics-depth"; + case HDMI_3D_STRUCTURE_TOP_AND_BOTTOM: + return "Top-and-Bottom"; + case HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF: + return "Side-by-side (Half)"; + default: + break; + } + return "Reserved"; +} + +/** + * hdmi_vendor_infoframe_log() - log info of HDMI VENDOR infoframe + * @level: logging level + * @dev: device + * @frame: HDMI VENDOR infoframe + */ +static void +hdmi_vendor_any_infoframe_log(union hdmi_vendor_any_infoframe *frame) +{ + struct hdmi_vendor_infoframe *hvf = &frame->hdmi; + + hdmi_infoframe_log_header((struct hdmi_any_infoframe *)frame); + + if (frame->any.oui != HDMI_IEEE_OUI) { + hdmi_log(" not a HDMI vendor infoframe\n"); + return; + } + if (hvf->vic == 0 && hvf->s3d_struct == HDMI_3D_STRUCTURE_INVALID) { + hdmi_log(" empty frame\n"); + return; + } + + if (hvf->vic) + hdmi_log(" HDMI VIC: %u\n", hvf->vic); + if (hvf->s3d_struct != HDMI_3D_STRUCTURE_INVALID) { + hdmi_log(" 3D structure: %s\n", + hdmi_3d_structure_get_name(hvf->s3d_struct)); + if (hvf->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) + hdmi_log(" 3D extension data: %d\n", + hvf->s3d_ext_data); + } +} + +/** + * hdmi_infoframe_log() - log info of HDMI infoframe + * @level: logging level + * @dev: device + * @frame: HDMI infoframe + */ +void hdmi_infoframe_log(union hdmi_infoframe *frame) +{ + switch (frame->any.type) { + case HDMI_INFOFRAME_TYPE_AVI: + hdmi_avi_infoframe_log(&frame->avi); + break; + case HDMI_INFOFRAME_TYPE_SPD: + hdmi_spd_infoframe_log(&frame->spd); + break; + case HDMI_INFOFRAME_TYPE_AUDIO: + hdmi_audio_infoframe_log(&frame->audio); + break; + case HDMI_INFOFRAME_TYPE_VENDOR: + hdmi_vendor_any_infoframe_log(&frame->vendor); + break; + } +} +EXPORT_SYMBOL(hdmi_infoframe_log); + +/** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 26 14:39:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79D82C9107A; Mon, 26 Dec 2016 14:39:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A43D166A; Mon, 26 Dec 2016 14:39:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQEd5b1045943; Mon, 26 Dec 2016 14:39:05 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQEd5n1045942; Mon, 26 Dec 2016 14:39:05 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201612261439.uBQEd5n1045942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 26 Dec 2016 14:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310601 - stable/11/tests/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 14:39:06 -0000 Author: jilles Date: Mon Dec 26 14:39:05 2016 New Revision: 310601 URL: https://svnweb.freebsd.org/changeset/base/310601 Log: MFC r309957: Add tests for reaper receiving SIGCHLD (r309886). PR: 213928 Modified: stable/11/tests/sys/kern/reaper.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/reaper.c ============================================================================== --- stable/11/tests/sys/kern/reaper.c Mon Dec 26 14:36:05 2016 (r310600) +++ stable/11/tests/sys/kern/reaper.c Mon Dec 26 14:39:05 2016 (r310601) @@ -35,6 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include +static void +dummy_sighandler(int sig __unused, siginfo_t *info __unused, void *ctx __unused) +{ +} + ATF_TC_WITHOUT_HEAD(reaper_wait_child_first); ATF_TC_BODY(reaper_wait_child_first, tc) { @@ -129,6 +134,161 @@ ATF_TC_BODY(reaper_wait_grandchild_first ATF_CHECK_EQ(2, r); } +ATF_TC(reaper_sigchld_child_first); +ATF_TC_HEAD(reaper_sigchld_child_first, tc) +{ + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(reaper_sigchld_child_first, tc) +{ + struct sigaction act; + sigset_t mask; + siginfo_t info; + pid_t parent, child, grandchild, pid; + int r; + int pip[2]; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + act.sa_sigaction = dummy_sighandler; + act.sa_flags = SA_SIGINFO | SA_RESTART; + r = sigemptyset(&act.sa_mask); + ATF_REQUIRE_EQ(0, r); + r = sigaction(SIGCHLD, &act, NULL); + ATF_REQUIRE_EQ(0, r); + + r = sigemptyset(&mask); + ATF_REQUIRE_EQ(0, r); + r = sigaddset(&mask, SIGCHLD); + ATF_REQUIRE_EQ(0, r); + r = sigprocmask(SIG_BLOCK, &mask, NULL); + ATF_REQUIRE_EQ(0, r); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[1]) != 0) + _exit(100); + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) { + if (read(pip[0], &(uint8_t){ 0 }, 1) != 0) + _exit(102); + if (getppid() != parent) + _exit(103); + _exit(2); + } else + _exit(3); + } + + r = sigwaitinfo(&mask, &info); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(3, info.si_status); + ATF_CHECK_EQ(child, info.si_pid); + + pid = waitpid(child, NULL, 0); + ATF_REQUIRE_EQ(child, pid); + + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + r = sigwaitinfo(&mask, &info); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(2, info.si_status); + grandchild = info.si_pid; + ATF_REQUIRE(grandchild > 0); + ATF_REQUIRE(grandchild != parent); + ATF_REQUIRE(grandchild != child); + + pid = waitpid(-1, NULL, 0); + ATF_REQUIRE_EQ(grandchild, pid); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TC(reaper_sigchld_grandchild_first); +ATF_TC_HEAD(reaper_sigchld_grandchild_first, tc) +{ + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(reaper_sigchld_grandchild_first, tc) +{ + struct sigaction act; + sigset_t mask; + siginfo_t info; + pid_t parent, child, grandchild, pid; + int r; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + act.sa_sigaction = dummy_sighandler; + act.sa_flags = SA_SIGINFO | SA_RESTART; + r = sigemptyset(&act.sa_mask); + ATF_REQUIRE_EQ(0, r); + r = sigaction(SIGCHLD, &act, NULL); + ATF_REQUIRE_EQ(0, r); + + r = sigemptyset(&mask); + ATF_REQUIRE_EQ(0, r); + r = sigaddset(&mask, SIGCHLD); + ATF_REQUIRE_EQ(0, r); + r = sigprocmask(SIG_BLOCK, &mask, NULL); + ATF_REQUIRE_EQ(0, r); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) + _exit(2); + else { + if (waitid(P_PID, grandchild, NULL, + WNOWAIT | WEXITED) != 0) + _exit(102); + _exit(3); + } + } + + pid = waitpid(child, NULL, 0); + ATF_REQUIRE_EQ(child, pid); + + r = sigwaitinfo(&mask, &info); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(2, info.si_status); + grandchild = info.si_pid; + ATF_REQUIRE(grandchild > 0); + ATF_REQUIRE(grandchild != parent); + ATF_REQUIRE(grandchild != child); + + pid = waitpid(-1, NULL, 0); + ATF_REQUIRE_EQ(grandchild, pid); +} + ATF_TC_WITHOUT_HEAD(reaper_status); ATF_TC_BODY(reaper_status, tc) { @@ -484,6 +644,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, reaper_wait_child_first); ATF_TP_ADD_TC(tp, reaper_wait_grandchild_first); + ATF_TP_ADD_TC(tp, reaper_sigchld_child_first); + ATF_TP_ADD_TC(tp, reaper_sigchld_grandchild_first); ATF_TP_ADD_TC(tp, reaper_status); ATF_TP_ADD_TC(tp, reaper_getpids); ATF_TP_ADD_TC(tp, reaper_kill_badsig); From owner-svn-src-all@freebsd.org Mon Dec 26 16:27:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47C96C9169D; Mon, 26 Dec 2016 16:27:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4F8411A6; Mon, 26 Dec 2016 16:27:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQGR2sK091032; Mon, 26 Dec 2016 16:27:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQGR17F091029; Mon, 26 Dec 2016 16:27:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612261627.uBQGR17F091029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 26 Dec 2016 16:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310604 - stable/11/bin/ed X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 16:27:03 -0000 Author: pfg Date: Mon Dec 26 16:27:01 2016 New Revision: 310604 URL: https://svnweb.freebsd.org/changeset/base/310604 Log: MFC r309873: ed(1): Prevent possible overflows during allocation. Make sure the parameters used for malloc(3) can hold size_t sizes. This should help ed(1) handle bigger data in the future. Modified: stable/11/bin/ed/ed.h stable/11/bin/ed/glbl.c stable/11/bin/ed/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ed/ed.h ============================================================================== --- stable/11/bin/ed/ed.h Mon Dec 26 15:24:12 2016 (r310603) +++ stable/11/bin/ed/ed.h Mon Dec 26 16:27:01 2016 (r310604) @@ -115,7 +115,7 @@ if (--mutex == 0) { \ /* REALLOC: assure at least a minimum size for buffer b */ #define REALLOC(b,n,i,err) \ if ((i) > (n)) { \ - int ti = (n); \ + size_t ti = (n); \ char *ts; \ SPL1(); \ if ((b) != NULL) { \ @@ -141,7 +141,7 @@ if ((i) > (n)) { \ /* REALLOC: assure at least a minimum size for buffer b */ #define REALLOC(b,n,i,err) \ if ((i) > (n)) { \ - int ti = (n); \ + size_t ti = (n); \ char *ts; \ SPL1(); \ if ((ts = (char *) realloc((b), ti += max((i), MINBUFSZ))) == NULL) { \ Modified: stable/11/bin/ed/glbl.c ============================================================================== --- stable/11/bin/ed/glbl.c Mon Dec 26 15:24:12 2016 (r310603) +++ stable/11/bin/ed/glbl.c Mon Dec 26 16:27:01 2016 (r310604) @@ -146,7 +146,7 @@ int set_active_node(line_t *lp) { if (active_last + 1 > active_size) { - int ti = active_size; + size_t ti = active_size; line_t **ts; SPL1(); #if defined(sun) || defined(NO_REALLOC_NULL) Modified: stable/11/bin/ed/main.c ============================================================================== --- stable/11/bin/ed/main.c Mon Dec 26 15:24:12 2016 (r310603) +++ stable/11/bin/ed/main.c Mon Dec 26 16:27:01 2016 (r310604) @@ -1356,7 +1356,7 @@ handle_hup(int signo) char *hup = NULL; /* hup filename */ char *s; char ed_hup[] = "ed.hup"; - int n; + size_t n; if (!sigactive) quit(1); From owner-svn-src-all@freebsd.org Mon Dec 26 16:42:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D007C91C3B; Mon, 26 Dec 2016 16:42:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B7B1C23; Mon, 26 Dec 2016 16:42:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQGgc9b098983; Mon, 26 Dec 2016 16:42:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQGgcIv098982; Mon, 26 Dec 2016 16:42:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612261642.uBQGgcIv098982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 26 Dec 2016 16:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310605 - stable/11/bin/pax X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 16:42:39 -0000 Author: pfg Date: Mon Dec 26 16:42:38 2016 New Revision: 310605 URL: https://svnweb.freebsd.org/changeset/base/310605 Log: MFC r310367: pax(1): Fix a bug with archives smaller than 512 bytes. The problem here is that the archive is too short (< 512 bytes). The buffer routines, try to read at least 512 bytes, even when we try to determine what format file we have, which is wrong. Obtained from: NetBSD (CVS rev 1.26) Modified: stable/11/bin/pax/buf_subs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pax/buf_subs.c ============================================================================== --- stable/11/bin/pax/buf_subs.c Mon Dec 26 16:27:01 2016 (r310604) +++ stable/11/bin/pax/buf_subs.c Mon Dec 26 16:42:38 2016 (r310605) @@ -852,10 +852,13 @@ buf_fill(void) /* * errors require resync, EOF goes to next archive + * but in case we have not determined yet the format, + * this means that we have a very short file, so we + * are done again. */ if (cnt < 0) break; - if (ar_next() < 0) { + if (frmt == NULL || ar_next() < 0) { fini = 1; return(0); } From owner-svn-src-all@freebsd.org Mon Dec 26 16:43:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54A9BC91E13; Mon, 26 Dec 2016 16:43:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2E5A1F74; Mon, 26 Dec 2016 16:43:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQGheRN099807; Mon, 26 Dec 2016 16:43:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQGhexl099806; Mon, 26 Dec 2016 16:43:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612261643.uBQGhexl099806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 26 Dec 2016 16:43: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: r310606 - stable/10/bin/pax X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 16:43:41 -0000 Author: pfg Date: Mon Dec 26 16:43:39 2016 New Revision: 310606 URL: https://svnweb.freebsd.org/changeset/base/310606 Log: MFC r310367: pax(1): Fix a bug with archives smaller than 512 bytes. The problem here is that the archive is too short (< 512 bytes). The buffer routines, try to read at least 512 bytes, even when we try to determine what format file we have, which is wrong. Obtained from: NetBSD (CVS rev 1.26) Modified: stable/10/bin/pax/buf_subs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/pax/buf_subs.c ============================================================================== --- stable/10/bin/pax/buf_subs.c Mon Dec 26 16:42:38 2016 (r310605) +++ stable/10/bin/pax/buf_subs.c Mon Dec 26 16:43:39 2016 (r310606) @@ -852,10 +852,13 @@ buf_fill(void) /* * errors require resync, EOF goes to next archive + * but in case we have not determined yet the format, + * this means that we have a very short file, so we + * are done again. */ if (cnt < 0) break; - if (ar_next() < 0) { + if (frmt == NULL || ar_next() < 0) { fini = 1; return(0); } From owner-svn-src-all@freebsd.org Mon Dec 26 16:45:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57BD7C920FA; Mon, 26 Dec 2016 16:45:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF6F175B; Mon, 26 Dec 2016 16:45:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQGj04e000967; Mon, 26 Dec 2016 16:45:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQGj03c000966; Mon, 26 Dec 2016 16:45:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612261645.uBQGj03c000966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 26 Dec 2016 16:45:00 +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: r310607 - stable/9/bin/pax X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 16:45:01 -0000 Author: pfg Date: Mon Dec 26 16:45:00 2016 New Revision: 310607 URL: https://svnweb.freebsd.org/changeset/base/310607 Log: MFC r310367: pax(1): Fix a bug with archives smaller than 512 bytes. The problem here is that the archive is too short (< 512 bytes). The buffer routines, try to read at least 512 bytes, even when we try to determine what format file we have, which is wrong. Obtained from: NetBSD (CVS rev 1.26) Modified: stable/9/bin/pax/buf_subs.c Modified: stable/9/bin/pax/buf_subs.c ============================================================================== --- stable/9/bin/pax/buf_subs.c Mon Dec 26 16:43:39 2016 (r310606) +++ stable/9/bin/pax/buf_subs.c Mon Dec 26 16:45:00 2016 (r310607) @@ -853,10 +853,13 @@ buf_fill(void) /* * errors require resync, EOF goes to next archive + * but in case we have not determined yet the format, + * this means that we have a very short file, so we + * are done again. */ if (cnt < 0) break; - if (ar_next() < 0) { + if (frmt == NULL || ar_next() < 0) { fini = 1; return(0); } From owner-svn-src-all@freebsd.org Mon Dec 26 17:10:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6073C92756; Mon, 26 Dec 2016 17:10:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95A6419DA; Mon, 26 Dec 2016 17:10:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQHAfm1009808; Mon, 26 Dec 2016 17:10:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQHAfse009807; Mon, 26 Dec 2016 17:10:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201612261710.uBQHAfse009807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 26 Dec 2016 17:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310608 - head/libexec/talkd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 17:10:42 -0000 Author: delphij Date: Mon Dec 26 17:10:41 2016 New Revision: 310608 URL: https://svnweb.freebsd.org/changeset/base/310608 Log: Avoid use after free. Reported by: Clang static code analyzer MFC after: 2 weeks Modified: head/libexec/talkd/table.c Modified: head/libexec/talkd/table.c ============================================================================== --- head/libexec/talkd/table.c Mon Dec 26 16:45:00 2016 (r310607) +++ head/libexec/talkd/table.c Mon Dec 26 17:10:41 2016 (r310608) @@ -82,14 +82,15 @@ static TABLE_ENTRY *table = NIL; CTL_MSG * find_match(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); current_time = tp.tv_sec; if (debug) print_request("find_match", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) @@ -115,7 +116,7 @@ find_match(CTL_MSG *request) CTL_MSG * find_request(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(&tp, NULL); @@ -126,7 +127,8 @@ find_request(CTL_MSG *request) */ if (debug) print_request("find_request", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) From owner-svn-src-all@freebsd.org Mon Dec 26 17:23:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FD3C92BD6; Mon, 26 Dec 2016 17:23:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C387413F0; Mon, 26 Dec 2016 17:23:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQHN9Sa017441; Mon, 26 Dec 2016 17:23:09 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQHN9WI017440; Mon, 26 Dec 2016 17:23:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201612261723.uBQHN9WI017440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 26 Dec 2016 17:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310609 - head/libexec/talkd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 17:23:11 -0000 Author: delphij Date: Mon Dec 26 17:23:09 2016 New Revision: 310609 URL: https://svnweb.freebsd.org/changeset/base/310609 Log: Don't use high precision clock for expiration as only second portion is used. MFC after: 2 weeks Modified: head/libexec/talkd/table.c Modified: head/libexec/talkd/table.c ============================================================================== --- head/libexec/talkd/table.c Mon Dec 26 17:10:41 2016 (r310608) +++ head/libexec/talkd/table.c Mon Dec 26 17:23:09 2016 (r310609) @@ -60,7 +60,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -static struct timeval tp; +static struct timespec ts; typedef struct table_entry TABLE_ENTRY; @@ -85,8 +85,8 @@ find_match(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; if (debug) print_request("find_match", request); for (ptr = table; ptr != NIL; ptr = next) { @@ -119,8 +119,8 @@ find_request(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; /* * See if this is a repeated message, and check for * out of date entries in the table while we are it. @@ -157,8 +157,8 @@ insert_table(CTL_MSG *request, CTL_RESPO TABLE_ENTRY *ptr; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; request->id_num = new_id(); response->id_num = htonl(request->id_num); /* insert a new entry into the top of the list */ From owner-svn-src-all@freebsd.org Mon Dec 26 17:26:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD2A6C92C50; Mon, 26 Dec 2016 17:26:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DBA11612; Mon, 26 Dec 2016 17:26:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQHQPVr017603; Mon, 26 Dec 2016 17:26:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQHQPbp017602; Mon, 26 Dec 2016 17:26:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201612261726.uBQHQPbp017602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 26 Dec 2016 17:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310610 - stable/10/tests/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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 17:26:26 -0000 Author: jilles Date: Mon Dec 26 17:26:25 2016 New Revision: 310610 URL: https://svnweb.freebsd.org/changeset/base/310610 Log: MFC r309957: Add tests for reaper receiving SIGCHLD (r309886). PR: 213928 Modified: stable/10/tests/sys/kern/reaper.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/reaper.c ============================================================================== --- stable/10/tests/sys/kern/reaper.c Mon Dec 26 17:23:09 2016 (r310609) +++ stable/10/tests/sys/kern/reaper.c Mon Dec 26 17:26:25 2016 (r310610) @@ -35,6 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include +static void +dummy_sighandler(int sig __unused, siginfo_t *info __unused, void *ctx __unused) +{ +} + ATF_TC_WITHOUT_HEAD(reaper_wait_child_first); ATF_TC_BODY(reaper_wait_child_first, tc) { @@ -129,6 +134,161 @@ ATF_TC_BODY(reaper_wait_grandchild_first ATF_CHECK_EQ(2, r); } +ATF_TC(reaper_sigchld_child_first); +ATF_TC_HEAD(reaper_sigchld_child_first, tc) +{ + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(reaper_sigchld_child_first, tc) +{ + struct sigaction act; + sigset_t mask; + siginfo_t info; + pid_t parent, child, grandchild, pid; + int r; + int pip[2]; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + act.sa_sigaction = dummy_sighandler; + act.sa_flags = SA_SIGINFO | SA_RESTART; + r = sigemptyset(&act.sa_mask); + ATF_REQUIRE_EQ(0, r); + r = sigaction(SIGCHLD, &act, NULL); + ATF_REQUIRE_EQ(0, r); + + r = sigemptyset(&mask); + ATF_REQUIRE_EQ(0, r); + r = sigaddset(&mask, SIGCHLD); + ATF_REQUIRE_EQ(0, r); + r = sigprocmask(SIG_BLOCK, &mask, NULL); + ATF_REQUIRE_EQ(0, r); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[1]) != 0) + _exit(100); + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) { + if (read(pip[0], &(uint8_t){ 0 }, 1) != 0) + _exit(102); + if (getppid() != parent) + _exit(103); + _exit(2); + } else + _exit(3); + } + + r = sigwaitinfo(&mask, &info); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(3, info.si_status); + ATF_CHECK_EQ(child, info.si_pid); + + pid = waitpid(child, NULL, 0); + ATF_REQUIRE_EQ(child, pid); + + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + r = sigwaitinfo(&mask, &info); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(2, info.si_status); + grandchild = info.si_pid; + ATF_REQUIRE(grandchild > 0); + ATF_REQUIRE(grandchild != parent); + ATF_REQUIRE(grandchild != child); + + pid = waitpid(-1, NULL, 0); + ATF_REQUIRE_EQ(grandchild, pid); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TC(reaper_sigchld_grandchild_first); +ATF_TC_HEAD(reaper_sigchld_grandchild_first, tc) +{ + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(reaper_sigchld_grandchild_first, tc) +{ + struct sigaction act; + sigset_t mask; + siginfo_t info; + pid_t parent, child, grandchild, pid; + int r; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + act.sa_sigaction = dummy_sighandler; + act.sa_flags = SA_SIGINFO | SA_RESTART; + r = sigemptyset(&act.sa_mask); + ATF_REQUIRE_EQ(0, r); + r = sigaction(SIGCHLD, &act, NULL); + ATF_REQUIRE_EQ(0, r); + + r = sigemptyset(&mask); + ATF_REQUIRE_EQ(0, r); + r = sigaddset(&mask, SIGCHLD); + ATF_REQUIRE_EQ(0, r); + r = sigprocmask(SIG_BLOCK, &mask, NULL); + ATF_REQUIRE_EQ(0, r); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) + _exit(2); + else { + if (waitid(P_PID, grandchild, NULL, + WNOWAIT | WEXITED) != 0) + _exit(102); + _exit(3); + } + } + + pid = waitpid(child, NULL, 0); + ATF_REQUIRE_EQ(child, pid); + + r = sigwaitinfo(&mask, &info); + ATF_REQUIRE_EQ(SIGCHLD, r); + ATF_CHECK_EQ(SIGCHLD, info.si_signo); + ATF_CHECK_EQ(CLD_EXITED, info.si_code); + ATF_CHECK_EQ(2, info.si_status); + grandchild = info.si_pid; + ATF_REQUIRE(grandchild > 0); + ATF_REQUIRE(grandchild != parent); + ATF_REQUIRE(grandchild != child); + + pid = waitpid(-1, NULL, 0); + ATF_REQUIRE_EQ(grandchild, pid); +} + ATF_TC_WITHOUT_HEAD(reaper_status); ATF_TC_BODY(reaper_status, tc) { @@ -484,6 +644,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, reaper_wait_child_first); ATF_TP_ADD_TC(tp, reaper_wait_grandchild_first); + ATF_TP_ADD_TC(tp, reaper_sigchld_child_first); + ATF_TP_ADD_TC(tp, reaper_sigchld_grandchild_first); ATF_TP_ADD_TC(tp, reaper_status); ATF_TP_ADD_TC(tp, reaper_getpids); ATF_TP_ADD_TC(tp, reaper_kill_badsig); From owner-svn-src-all@freebsd.org Mon Dec 26 17:34:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 217B2C92F22; Mon, 26 Dec 2016 17:34:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D908F1E8A; Mon, 26 Dec 2016 17:34:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQHYSGA022121; Mon, 26 Dec 2016 17:34:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQHYS2x022120; Mon, 26 Dec 2016 17:34:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201612261734.uBQHYS2x022120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 26 Dec 2016 17:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310611 - head/usr.sbin/pstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 17:34:29 -0000 Author: delphij Date: Mon Dec 26 17:34:27 2016 New Revision: 310611 URL: https://svnweb.freebsd.org/changeset/base/310611 Log: - pstat(8) does not accept any arguments other than getopt() args, so don't bother to adjust argc/argv after getopt() loop. - Make a string pointer constant. MFC after: 2 weeks Modified: head/usr.sbin/pstat/pstat.c Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Mon Dec 26 17:26:25 2016 (r310610) +++ head/usr.sbin/pstat/pstat.c Mon Dec 26 17:34:27 2016 (r310611) @@ -174,8 +174,6 @@ main(int argc, char *argv[]) default: usage(); } - argc -= optind; - argv += optind; /* * Initialize symbol names list. @@ -339,7 +337,7 @@ static void ttyprt(struct xtty *xt) { int i, j; - char *name; + const char *name; if (xt->xt_size != sizeof *xt) errx(1, "struct xtty size mismatch"); From owner-svn-src-all@freebsd.org Mon Dec 26 17:48:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E6FDC91218; Mon, 26 Dec 2016 17:48:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CBA215BF; Mon, 26 Dec 2016 17:48:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQHmEWP026407; Mon, 26 Dec 2016 17:48:14 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQHmEAx026406; Mon, 26 Dec 2016 17:48:14 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612261748.uBQHmEAx026406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 26 Dec 2016 17:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310612 - head/sys/dev/evdev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 17:48:15 -0000 Author: gonzo Date: Mon Dec 26 17:48:13 2016 New Revision: 310612 URL: https://svnweb.freebsd.org/changeset/base/310612 Log: [evdev] Fix build for older versions of clang There was report of stable/11 build failure on older versions of FreeBSD. The problem was a reference to static variable in inline function. Although fairly recent versions of clang can cope with this situation just fine there is no strict requirement to make functions in question inline, they're not in any time-critical codepath. So to keep HEAD and 11-STABLE buildable on older FreeBSDs some of the util functions were converted from inline to normal. Reported by: hselasky MFC after: 3 days Modified: head/sys/dev/evdev/evdev_utils.c Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Mon Dec 26 17:34:27 2016 (r310611) +++ head/sys/dev/evdev/evdev_utils.c Mon Dec 26 17:48:13 2016 (r310612) @@ -206,13 +206,13 @@ static uint16_t evdev_led_codes[] = { LED_SCROLLL, /* SLKED */ }; -inline uint16_t +uint16_t evdev_hid2key(int scancode) { return evdev_usb_scancodes[scancode]; } -inline void +void evdev_support_all_known_keys(struct evdev_dev *evdev) { size_t i; @@ -222,7 +222,7 @@ evdev_support_all_known_keys(struct evde evdev_support_key(evdev, evdev_at_set1_scancodes[i]); } -inline uint16_t +uint16_t evdev_scancode2key(int *state, int scancode) { uint16_t keycode; From owner-svn-src-all@freebsd.org Mon Dec 26 19:26:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6883C92C45; Mon, 26 Dec 2016 19:26:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A63FF1542; Mon, 26 Dec 2016 19:26:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQJQedH067288; Mon, 26 Dec 2016 19:26:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQJQeSG067287; Mon, 26 Dec 2016 19:26:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261926.uBQJQeSG067287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 19:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310613 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 19:26:41 -0000 Author: kib Date: Mon Dec 26 19:26:40 2016 New Revision: 310613 URL: https://svnweb.freebsd.org/changeset/base/310613 Log: Style. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D8898 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Dec 26 17:48:13 2016 (r310612) +++ head/sys/kern/kern_event.c Mon Dec 26 19:26:40 2016 (r310613) @@ -2123,12 +2123,12 @@ knlist_empty(struct knlist *knl) { KNL_ASSERT_LOCKED(knl); - return SLIST_EMPTY(&knl->kl_list); + return (SLIST_EMPTY(&knl->kl_list)); } -static struct mtx knlist_lock; +static struct mtx knlist_lock; MTX_SYSINIT(knlist_lock, &knlist_lock, "knlist lock for lockless objects", - MTX_DEF); + MTX_DEF); static void knlist_mtx_lock(void *arg); static void knlist_mtx_unlock(void *arg); @@ -2391,17 +2391,15 @@ knote_attach(struct knote *kn, struct kq if (kn->kn_fop->f_isfd) { if (kn->kn_id >= kq->kq_knlistsize) - return ENOMEM; + return (ENOMEM); list = &kq->kq_knlist[kn->kn_id]; } else { if (kq->kq_knhash == NULL) - return ENOMEM; + return (ENOMEM); list = &kq->kq_knhash[KN_HASH(kn->kn_id, kq->kq_knhashmask)]; } - SLIST_INSERT_HEAD(list, kn, kn_link); - - return 0; + return (0); } /* @@ -2511,11 +2509,9 @@ kqfd_register(int fd, struct kevent *kev goto noacquire; error = kqueue_register(kq, kev, td, waitok); - kqueue_release(kq, 0); noacquire: fdrop(fp, td); - - return error; + return (error); } From owner-svn-src-all@freebsd.org Mon Dec 26 19:27:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F6EC92C97; Mon, 26 Dec 2016 19:27:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34AD116C7; Mon, 26 Dec 2016 19:27:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQJRCTw067361; Mon, 26 Dec 2016 19:27:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQJRCr6067360; Mon, 26 Dec 2016 19:27:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201612261927.uBQJRCr6067360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 26 Dec 2016 19:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310614 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 19:27:13 -0000 Author: delphij Date: Mon Dec 26 19:27:12 2016 New Revision: 310614 URL: https://svnweb.freebsd.org/changeset/base/310614 Log: Don't assign rtjp twice. Reported by: clang static analyzer MFC after: 2 weeks Modified: head/usr.sbin/jail/jail.c Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Mon Dec 26 19:26:40 2016 (r310613) +++ head/usr.sbin/jail/jail.c Mon Dec 26 19:27:12 2016 (r310614) @@ -806,8 +806,7 @@ rdtun_params(struct cfjail *j, int dofai if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { rtjp = rtparams + 1; - for (jp = j->jp, rtjp = rtparams + 1; rtjp < rtparams + nrt; - jp++) { + for (jp = j->jp; rtjp < rtparams + nrt; jp++) { if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && jp->jp_valuelen == 0 && From owner-svn-src-all@freebsd.org Mon Dec 26 19:28:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B02BC92CF6; Mon, 26 Dec 2016 19:28:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF0861869; Mon, 26 Dec 2016 19:28:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQJSBhR067450; Mon, 26 Dec 2016 19:28:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQJSBos067449; Mon, 26 Dec 2016 19:28:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261928.uBQJSBos067449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 19:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310615 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 19:28:12 -0000 Author: kib Date: Mon Dec 26 19:28:10 2016 New Revision: 310615 URL: https://svnweb.freebsd.org/changeset/base/310615 Log: Change knlist_destroy() to assert that knlist is empty instead of accepting the wrong state and printing warning. Do not obliterate kl_lock and kl_unlock pointers, they are often useful for post-mortem analysis. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D8898 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Dec 26 19:27:12 2016 (r310614) +++ head/sys/kern/kern_event.c Mon Dec 26 19:28:10 2016 (r310615) @@ -2249,17 +2249,8 @@ void knlist_destroy(struct knlist *knl) { -#ifdef INVARIANTS - /* - * if we run across this error, we need to find the offending - * driver and have it call knlist_clear or knlist_delete. - */ - if (!SLIST_EMPTY(&knl->kl_list)) - printf("WARNING: destroying knlist w/ knotes on it!\n"); -#endif - - knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL; - SLIST_INIT(&knl->kl_list); + KASSERT(KNLIST_EMPTY(knl), + ("destroying knlist %p with knotes on it", knl)); } void From owner-svn-src-all@freebsd.org Mon Dec 26 19:29:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCC3BC92D56; Mon, 26 Dec 2016 19:29:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC7FE19EF; Mon, 26 Dec 2016 19:29:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQJT4s3067527; Mon, 26 Dec 2016 19:29:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQJT4Y8067526; Mon, 26 Dec 2016 19:29:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261929.uBQJT4Y8067526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 19:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310616 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 19:29:06 -0000 Author: kib Date: Mon Dec 26 19:29:04 2016 New Revision: 310616 URL: https://svnweb.freebsd.org/changeset/base/310616 Log: Remove redundancy in vmtotal(). There are two instances of inlined unlocks + continue in vmtotal() switch statements, which are ordinary expressed with break from the switch case and code after the switch. Also, the combination of continue and break statement is redundand. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_meter.c Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Mon Dec 26 19:28:10 2016 (r310615) +++ head/sys/vm/vm_meter.c Mon Dec 26 19:29:04 2016 (r310616) @@ -121,15 +121,10 @@ vmtotal(SYSCTL_HANDLER_ARGS) */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_flag & P_SYSTEM) + if ((p->p_flag & P_SYSTEM) != 0) continue; PROC_LOCK(p); - switch (p->p_state) { - case PRS_NEW: - PROC_UNLOCK(p); - continue; - break; - default: + if (p->p_state != PRS_NEW) { FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); switch (td->td_state) { @@ -146,15 +141,13 @@ vmtotal(SYSCTL_HANDLER_ARGS) total.t_pw++; } break; - case TDS_CAN_RUN: total.t_sw++; break; case TDS_RUNQ: case TDS_RUNNING: total.t_rq++; - thread_unlock(td); - continue; + break; default: break; } From owner-svn-src-all@freebsd.org Mon Dec 26 19:33:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9B86C92F8C; Mon, 26 Dec 2016 19:33:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 823AF1F44; Mon, 26 Dec 2016 19:33:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQJXeYo071335; Mon, 26 Dec 2016 19:33:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQJXe7T071333; Mon, 26 Dec 2016 19:33:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261933.uBQJXe7T071333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 19:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310617 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 19:33:41 -0000 Author: kib Date: Mon Dec 26 19:33:40 2016 New Revision: 310617 URL: https://svnweb.freebsd.org/changeset/base/310617 Log: Make knote KN_INFLUX state counted. This is final fix for the issue closed by r310302 for knote(). If KN_INFLUX | KN_SCAN flags are set for the note passed to knote() or knote_fork(), i.e. the knote is scanned, we might erronously clear INFLUX when finishing notification. For normal knote() it was fixed in r310302 simply by remembering the fact that we do not own KN_INFLUX, since there we own knlist lock and scan thread cannot clear KN_INFLUX until we drop the lock. For knote_fork(), the situation is more complicated, e must drop knlist lock AKA the process lock, since we need to register new knotes. Change KN_INFLUX into counter and allow shared ownership of the in-flux state between scan and knote_fork() or knote(). Both in-flux setters need to ensure that knote is not dropped in parallel. Added assert about kn_influx == 1 in knote_drop() verifies that in-flux state is not shared when knote is destroyed. Since KBI of the struct knote is changed by addition of the int kn_influx field, reorder kn_hook and kn_hookid to fill pad on LP64 arches [1]. This keeps sizeof(struct knote) to same 128 bytes as it was before addition of kn_influx, on amd64. Reviewed by: markj Suggested by: markj [1] Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D8898 Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Dec 26 19:29:04 2016 (r310616) +++ head/sys/kern/kern_event.c Mon Dec 26 19:33:40 2016 (r310617) @@ -193,7 +193,7 @@ static unsigned int kq_calloutmax = 4 * SYSCTL_UINT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW, &kq_calloutmax, 0, "Maximum number of callouts allocated for kqueue"); -/* XXX - ensure not KN_INFLUX?? */ +/* XXX - ensure not influx ? */ #define KNOTE_ACTIVATE(kn, islock) do { \ if ((islock)) \ mtx_assert(&(kn)->kn_kq->kq_lock, MA_OWNED); \ @@ -254,6 +254,32 @@ kn_list_unlock(struct knlist *knl) } } +static bool +kn_in_flux(struct knote *kn) +{ + + return (kn->kn_influx > 0); +} + +static void +kn_enter_flux(struct knote *kn) +{ + + KQ_OWNED(kn->kn_kq); + MPASS(kn->kn_influx < INT_MAX); + kn->kn_influx++; +} + +static bool +kn_leave_flux(struct knote *kn) +{ + + KQ_OWNED(kn->kn_kq); + MPASS(kn->kn_influx > 0); + kn->kn_influx--; + return (kn->kn_influx == 0); +} + #define KNL_ASSERT_LOCK(knl, islocked) do { \ if (islocked) \ KNL_ASSERT_LOCKED(knl); \ @@ -498,7 +524,7 @@ knote_fork(struct knlist *list, int pid) SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { kq = kn->kn_kq; KQ_LOCK(kq); - if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { + if (kn_in_flux(kn) && (kn->kn_status & KN_SCAN) == 0) { KQ_UNLOCK(kq); continue; } @@ -521,7 +547,7 @@ knote_fork(struct knlist *list, int pid) * track the child. Drop the locks in preparation for * the call to kqueue_register(). */ - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); KQ_UNLOCK(kq); list->kl_unlock(list->kl_lockarg); @@ -561,7 +587,7 @@ knote_fork(struct knlist *list, int pid) if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 0); KQ_LOCK(kq); - kn->kn_status &= ~KN_INFLUX; + kn_leave_flux(kn); KQ_UNLOCK_FLUX(kq); list->kl_lock(list->kl_lockarg); } @@ -1262,7 +1288,7 @@ findkn: } /* knote is in the process of changing, wait for it to stabilize. */ - if (kn != NULL && (kn->kn_status & KN_INFLUX) == KN_INFLUX) { + if (kn != NULL && kn_in_flux(kn)) { KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); if (filedesc_unlock) { FILEDESC_XUNLOCK(td->td_proc->p_fd); @@ -1306,7 +1332,8 @@ findkn: kn->kn_kevent = *kev; kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); - kn->kn_status = KN_INFLUX|KN_DETACHED; + kn->kn_status = KN_DETACHED; + kn_enter_flux(kn); error = knote_attach(kn, kq); KQ_UNLOCK(kq); @@ -1330,7 +1357,7 @@ findkn: } if (kev->flags & EV_DELETE) { - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); KQ_UNLOCK(kq); if (!(kn->kn_status & KN_DETACHED)) kn->kn_fop->f_detach(kn); @@ -1348,7 +1375,8 @@ findkn: * but doing so will not reset any filter which has already been * triggered. */ - kn->kn_status |= KN_INFLUX | KN_SCAN; + kn->kn_status |= KN_SCAN; + kn_enter_flux(kn); KQ_UNLOCK(kq); knl = kn_list_lock(kn); kn->kn_kevent.udata = kev->udata; @@ -1383,7 +1411,8 @@ done_ev_add: if ((kn->kn_status & (KN_ACTIVE | KN_DISABLED | KN_QUEUED)) == KN_ACTIVE) knote_enqueue(kn); - kn->kn_status &= ~(KN_INFLUX | KN_SCAN); + kn->kn_status &= ~KN_SCAN; + kn_leave_flux(kn); kn_list_unlock(knl); KQ_UNLOCK_FLUX(kq); @@ -1546,7 +1575,7 @@ kqueue_task(void *arg, int pending) /* * Scan, update kn_data (if not ONESHOT), and copyout triggered events. - * We treat KN_MARKER knotes as if they are INFLUX. + * We treat KN_MARKER knotes as if they are in flux. */ static int kqueue_scan(struct kqueue *kq, int maxevents, struct kevent_copyops *k_ops, @@ -1620,7 +1649,7 @@ retry: kn = TAILQ_FIRST(&kq->kq_head); if ((kn->kn_status == KN_MARKER && kn != marker) || - (kn->kn_status & KN_INFLUX) == KN_INFLUX) { + kn_in_flux(kn)) { if (influx) { influx = 0; KQ_FLUX_WAKEUP(kq); @@ -1643,17 +1672,17 @@ retry: goto retry; goto done; } - KASSERT((kn->kn_status & KN_INFLUX) == 0, - ("KN_INFLUX set when not suppose to be")); + KASSERT(!kn_in_flux(kn), + ("knote %p is unexpectedly in flux", kn)); if ((kn->kn_flags & EV_DROP) == EV_DROP) { kn->kn_status &= ~KN_QUEUED; - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); kq->kq_count--; KQ_UNLOCK(kq); /* - * We don't need to lock the list since we've marked - * it _INFLUX. + * We don't need to lock the list since we've + * marked it as in flux. */ if (!(kn->kn_status & KN_DETACHED)) kn->kn_fop->f_detach(kn); @@ -1662,12 +1691,12 @@ retry: continue; } else if ((kn->kn_flags & EV_ONESHOT) == EV_ONESHOT) { kn->kn_status &= ~KN_QUEUED; - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); kq->kq_count--; KQ_UNLOCK(kq); /* - * We don't need to lock the list since we've marked - * it _INFLUX. + * We don't need to lock the list since we've + * marked the knote as being in flux. */ *kevp = kn->kn_kevent; if (!(kn->kn_status & KN_DETACHED)) @@ -1676,7 +1705,8 @@ retry: KQ_LOCK(kq); kn = NULL; } else { - kn->kn_status |= KN_INFLUX | KN_SCAN; + kn->kn_status |= KN_SCAN; + kn_enter_flux(kn); KQ_UNLOCK(kq); if ((kn->kn_status & KN_KQUEUE) == KN_KQUEUE) KQ_GLOBAL_LOCK(&kq_global, haskqglobal); @@ -1684,9 +1714,9 @@ retry: if (kn->kn_fop->f_event(kn, 0) == 0) { KQ_LOCK(kq); KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); - kn->kn_status &= - ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX | + kn->kn_status &= ~(KN_QUEUED | KN_ACTIVE | KN_SCAN); + kn_leave_flux(kn); kq->kq_count--; kn_list_unlock(knl); influx = 1; @@ -1716,7 +1746,8 @@ retry: } else TAILQ_INSERT_TAIL(&kq->kq_head, kn, kn_tqe); - kn->kn_status &= ~(KN_INFLUX | KN_SCAN); + kn->kn_status &= ~KN_SCAN; + kn_leave_flux(kn); kn_list_unlock(knl); influx = 1; } @@ -1864,12 +1895,12 @@ kqueue_drain(struct kqueue *kq, struct t for (i = 0; i < kq->kq_knlistsize; i++) { while ((kn = SLIST_FIRST(&kq->kq_knlist[i])) != NULL) { - if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) { + if (kn_in_flux(kn)) { kq->kq_state |= KQ_FLUXWAIT; msleep(kq, &kq->kq_lock, PSOCK, "kqclo1", 0); continue; } - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); KQ_UNLOCK(kq); if (!(kn->kn_status & KN_DETACHED)) kn->kn_fop->f_detach(kn); @@ -1880,13 +1911,13 @@ kqueue_drain(struct kqueue *kq, struct t if (kq->kq_knhashmask != 0) { for (i = 0; i <= kq->kq_knhashmask; i++) { while ((kn = SLIST_FIRST(&kq->kq_knhash[i])) != NULL) { - if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) { + if (kn_in_flux(kn)) { kq->kq_state |= KQ_FLUXWAIT; msleep(kq, &kq->kq_lock, PSOCK, "kqclo2", 0); continue; } - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); KQ_UNLOCK(kq); if (!(kn->kn_status & KN_DETACHED)) kn->kn_fop->f_detach(kn); @@ -2010,7 +2041,6 @@ knote(struct knlist *list, long hint, in struct kqueue *kq; struct knote *kn, *tkn; int error; - bool own_influx; if (list == NULL) return; @@ -2021,7 +2051,7 @@ knote(struct knlist *list, long hint, in list->kl_lock(list->kl_lockarg); /* - * If we unlock the list lock (and set KN_INFLUX), we can + * If we unlock the list lock (and enter influx), we can * eliminate the kqueue scheduling, but this will introduce * four lock/unlock's for each knote to test. Also, marker * would be needed to keep iteration position, since filters @@ -2030,7 +2060,7 @@ knote(struct knlist *list, long hint, in SLIST_FOREACH_SAFE(kn, &list->kl_list, kn_selnext, tkn) { kq = kn->kn_kq; KQ_LOCK(kq); - if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { + if (kn_in_flux(kn) && (kn->kn_status & KN_SCAN) == 0) { /* * Do not process the influx notes, except for * the influx coming from the kq unlock in the @@ -2041,14 +2071,11 @@ knote(struct knlist *list, long hint, in */ KQ_UNLOCK(kq); } else if ((lockflags & KNF_NOKQLOCK) != 0) { - own_influx = (kn->kn_status & KN_INFLUX) == 0; - if (own_influx) - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); KQ_UNLOCK(kq); error = kn->kn_fop->f_event(kn, hint); KQ_LOCK(kq); - if (own_influx) - kn->kn_status &= ~KN_INFLUX; + kn_leave_flux(kn); if (error) KNOTE_ACTIVATE(kn, 1); KQ_UNLOCK_FLUX(kq); @@ -2070,10 +2097,12 @@ knote(struct knlist *list, long hint, in void knlist_add(struct knlist *knl, struct knote *kn, int islocked) { + KNL_ASSERT_LOCK(knl, islocked); KQ_NOTOWNED(kn->kn_kq); - KASSERT((kn->kn_status & (KN_INFLUX|KN_DETACHED)) == - (KN_INFLUX|KN_DETACHED), ("knote not KN_INFLUX and KN_DETACHED")); + KASSERT(kn_in_flux(kn), ("knote %p not in flux", kn)); + KASSERT((kn->kn_status & KN_DETACHED) != 0, + ("knote %p was not detached", kn)); if (!islocked) knl->kl_lock(knl->kl_lockarg); SLIST_INSERT_HEAD(&knl->kl_list, kn, kn_selnext); @@ -2089,12 +2118,13 @@ static void knlist_remove_kq(struct knlist *knl, struct knote *kn, int knlislocked, int kqislocked) { - KASSERT(!(!!kqislocked && !knlislocked), ("kq locked w/o knl locked")); + + KASSERT(!kqislocked || knlislocked, ("kq locked w/o knl locked")); KNL_ASSERT_LOCK(knl, knlislocked); mtx_assert(&kn->kn_kq->kq_lock, kqislocked ? MA_OWNED : MA_NOTOWNED); - if (!kqislocked) - KASSERT((kn->kn_status & (KN_INFLUX|KN_DETACHED)) == KN_INFLUX, - ("knlist_remove called w/o knote being KN_INFLUX or already removed")); + KASSERT(kqislocked || kn_in_flux(kn), ("knote %p not in flux", kn)); + KASSERT((kn->kn_status & KN_DETACHED) == 0, + ("knote %p was already detached", kn)); if (!knlislocked) knl->kl_lock(knl->kl_lockarg); SLIST_REMOVE(&knl->kl_list, kn, knote, kn_selnext); @@ -2287,30 +2317,30 @@ again: /* need to reacquire lock since SLIST_FOREACH_SAFE(kn, &knl->kl_list, kn_selnext, kn2) { kq = kn->kn_kq; KQ_LOCK(kq); - if ((kn->kn_status & KN_INFLUX)) { + if (kn_in_flux(kn)) { KQ_UNLOCK(kq); continue; } knlist_remove_kq(knl, kn, 1, 1); if (killkn) { - kn->kn_status |= KN_INFLUX | KN_DETACHED; + kn->kn_status |= KN_DETACHED; + kn_enter_flux(kn); KQ_UNLOCK(kq); knote_drop(kn, td); } else { /* Make sure cleared knotes disappear soon */ - kn->kn_flags |= (EV_EOF | EV_ONESHOT); + kn->kn_flags |= EV_EOF | EV_ONESHOT; KQ_UNLOCK(kq); } kq = NULL; } if (!SLIST_EMPTY(&knl->kl_list)) { - /* there are still KN_INFLUX remaining */ + /* there are still in flux knotes remaining */ kn = SLIST_FIRST(&knl->kl_list); kq = kn->kn_kq; KQ_LOCK(kq); - KASSERT(kn->kn_status & KN_INFLUX, - ("knote removed w/o list lock")); + KASSERT(kn_in_flux(kn), ("knote removed w/o list lock")); knl->kl_unlock(knl->kl_lockarg); kq->kq_state |= KQ_FLUXWAIT; msleep(kq, &kq->kq_lock, PSOCK | PDROP, "kqkclr", 0); @@ -2352,7 +2382,7 @@ again: influx = 0; while (kq->kq_knlistsize > fd && (kn = SLIST_FIRST(&kq->kq_knlist[fd])) != NULL) { - if (kn->kn_status & KN_INFLUX) { + if (kn_in_flux(kn)) { /* someone else might be waiting on our knote */ if (influx) wakeup(kq); @@ -2360,7 +2390,7 @@ again: msleep(kq, &kq->kq_lock, PSOCK, "kqflxwt", 0); goto again; } - kn->kn_status |= KN_INFLUX; + kn_enter_flux(kn); KQ_UNLOCK(kq); if (!(kn->kn_status & KN_DETACHED)) kn->kn_fop->f_detach(kn); @@ -2377,7 +2407,7 @@ knote_attach(struct knote *kn, struct kq { struct klist *list; - KASSERT(kn->kn_status & KN_INFLUX, ("knote not marked INFLUX")); + KASSERT(kn_in_flux(kn), ("knote %p not marked influx", kn)); KQ_OWNED(kq); if (kn->kn_fop->f_isfd) { @@ -2395,7 +2425,7 @@ knote_attach(struct knote *kn, struct kq /* * knote must already have been detached using the f_detach method. - * no lock need to be held, it is assumed that the KN_INFLUX flag is set + * no lock need to be held, it is assumed that the influx state is set * to prevent other removal. */ static void @@ -2407,10 +2437,10 @@ knote_drop(struct knote *kn, struct thre kq = kn->kn_kq; KQ_NOTOWNED(kq); - KASSERT((kn->kn_status & KN_INFLUX) == KN_INFLUX, - ("knote_drop called without KN_INFLUX set in kn_status")); - KQ_LOCK(kq); + KASSERT(kn->kn_influx == 1, + ("knote_drop called on %p with influx %d", kn, kn->kn_influx)); + if (kn->kn_fop->f_isfd) list = &kq->kq_knlist[kn->kn_id]; else Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Mon Dec 26 19:29:04 2016 (r310616) +++ head/sys/sys/event.h Mon Dec 26 19:33:40 2016 (r310617) @@ -202,8 +202,11 @@ struct filterops { }; /* - * Setting the KN_INFLUX flag enables you to unlock the kq that this knote - * is on, and modify kn_status as if you had the KQ lock. + * An in-flux knote cannot be dropped from its kq while the kq is + * unlocked. If the KN_SCAN flag is not set, a thread can only set + * kn_influx when it is exclusive owner of the knote state, and can + * modify kn_status as if it had the KQ lock. KN_SCAN must not be set + * on a knote which is already in flux. * * kn_sfflags, kn_sdata, and kn_kevent are protected by the knlist lock. */ @@ -214,16 +217,18 @@ struct knote { TAILQ_ENTRY(knote) kn_tqe; struct kqueue *kn_kq; /* which queue we are on */ struct kevent kn_kevent; + void *kn_hook; + int kn_hookid; int kn_status; /* protected by kq lock */ #define KN_ACTIVE 0x01 /* event has been triggered */ #define KN_QUEUED 0x02 /* event is on queue */ #define KN_DISABLED 0x04 /* event is disabled */ #define KN_DETACHED 0x08 /* knote is detached */ -#define KN_INFLUX 0x10 /* knote is in flux */ #define KN_MARKER 0x20 /* ignore this knote */ #define KN_KQUEUE 0x40 /* this knote belongs to a kq */ #define KN_HASKQLOCK 0x80 /* for _inevent */ #define KN_SCAN 0x100 /* flux set in kqueue_scan() */ + int kn_influx; int kn_sfflags; /* saved filter flags */ intptr_t kn_sdata; /* saved data field */ union { @@ -234,8 +239,6 @@ struct knote { void *p_v; /* generic other pointer */ } kn_ptr; struct filterops *kn_fop; - void *kn_hook; - int kn_hookid; #define kn_id kn_kevent.ident #define kn_filter kn_kevent.filter From owner-svn-src-all@freebsd.org Mon Dec 26 20:36:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2CBC91F99; Mon, 26 Dec 2016 20:36:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6293417AB; Mon, 26 Dec 2016 20:36:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQKagLq095573; Mon, 26 Dec 2016 20:36:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQKae4U095552; Mon, 26 Dec 2016 20:36:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612262036.uBQKae4U095552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 26 Dec 2016 20:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310618 - in stable/11: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm co... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 20:36:44 -0000 Author: dim Date: Mon Dec 26 20:36:37 2016 New Revision: 310618 URL: https://svnweb.freebsd.org/changeset/base/310618 Log: MFC r309124: Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 release, and add lld 3.9.0. Also completely revamp the build system for clang, llvm, lldb and their related tools. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. Release notes for llvm, clang and lld are available here: Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan Beich for their help. Relnotes: yes MFC r309147: Pull in r282174 from upstream llvm trunk (by Krzysztof Parzyszek): [PPC] Set SP after loading data from stack frame, if no red zone is present Follow-up to r280705: Make sure that the SP is only restored after all data is loaded from the stack frame, if there is no red zone. This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519. Differential Revision: https://reviews.llvm.org/D24466 Reported by: Mark Millard PR: 214433 MFC r309149: Pull in r283060 from upstream llvm trunk (by Hal Finkel): [PowerPC] Refactor soft-float support, and enable PPC64 soft float This change enables soft-float for PowerPC64, and also makes soft-float disable all vector instruction sets for both 32-bit and 64-bit modes. This latter part is necessary because the PPC backend canonicalizes many Altivec vector types to floating-point types, and so soft-float breaks scalarization support for many operations. Both for embedded targets and for operating-system kernels desiring soft-float support, it seems reasonable that disabling hardware floating-point also disables vector instructions (embedded targets without hardware floating point support are unlikely to have Altivec, etc. and operating system kernels desiring not to use floating-point registers to lower syscall cost are unlikely to want to use vector registers either). If someone needs this to work, we'll need to change the fact that we promote many Altivec operations to act on v4f32. To make it possible to disable Altivec when soft-float is enabled, hardware floating-point support needs to be expressed as a positive feature, like the others, and not a negative feature, because target features cannot have dependencies on the disabling of some other feature. So +soft-float has now become -hard-float. Fixes PR26970. Pull in r283061 from upstream clang trunk (by Hal Finkel): [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. Reported by: Mark Millard PR: 214433 MFC r309212: Add a few missed clang 3.9.0 files to OptionalObsoleteFiles. MFC r309262: Fix packaging for clang, lldb and lld 3.9.0 During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE directive in the usr.bin/clang/*.mk files got dropped accidentally. Restore it, with a few minor changes and additions: * Correct license in clang.ucl to NCSA * Add PACKAGE=clang for clang and most of the "ll" tools * Put lldb in its own package * Put lld in its own package Reviewed by: gjb, jmallett Differential Revision: https://reviews.freebsd.org/D8666 MFC r309656: During the bootstrap phase, when building the minimal llvm library on PowerPC, add lib/Support/Atomic.cpp. This is needed because upstream llvm revision r271821 disabled the use of std::call_once, which causes some fallback functions from Atomic.cpp to be used instead. Reported by: Mark Millard PR: 214902 MFC r309835: Tentatively apply https://reviews.llvm.org/D18730 to work around gcc PR 70528 (bogus error: constructor required before non-static data member). This should fix buildworld with the external gcc package. Reported by: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/ MFC r310194: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 3.9.1 release. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. Release notes for llvm, clang and lld will be available here: Relnotes: yes Added: stable/11/contrib/compiler-rt/include/sanitizer/esan_interface.h - copied unchanged from r309124, head/contrib/compiler-rt/include/sanitizer/esan_interface.h stable/11/contrib/compiler-rt/lib/asan/asan_memory_profile.cc - copied unchanged from r309124, head/contrib/compiler-rt/lib/asan/asan_memory_profile.cc stable/11/contrib/compiler-rt/lib/asan/asan_scariness_score.h - copied unchanged from r309124, head/contrib/compiler-rt/lib/asan/asan_scariness_score.h stable/11/contrib/compiler-rt/lib/builtins/cpu_model.c - copied unchanged from r309124, head/contrib/compiler-rt/lib/builtins/cpu_model.c stable/11/contrib/compiler-rt/lib/builtins/unwind-ehabi-helpers.h - copied unchanged from r310194, head/contrib/compiler-rt/lib/builtins/unwind-ehabi-helpers.h stable/11/contrib/compiler-rt/lib/esan/ - copied from r309124, head/contrib/compiler-rt/lib/esan/ stable/11/contrib/compiler-rt/lib/profile/InstrProfilingMerge.c - copied unchanged from r309124, head/contrib/compiler-rt/lib/profile/InstrProfilingMerge.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingMergeFile.c - copied unchanged from r309124, head/contrib/compiler-rt/lib/profile/InstrProfilingMergeFile.c stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cc - copied unchanged from r309124, head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_x86_64.S - copied unchanged from r309124, head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_x86_64.S stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc - copied unchanged from r309124, head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc stable/11/contrib/compiler-rt/lib/scudo/ - copied from r309124, head/contrib/compiler-rt/lib/scudo/ stable/11/contrib/compiler-rt/lib/stats/ - copied from r309124, head/contrib/compiler-rt/lib/stats/ stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_debugging.cc - copied unchanged from r309124, head/contrib/compiler-rt/lib/tsan/rtl/tsan_debugging.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_preinit.cc - copied unchanged from r309124, head/contrib/compiler-rt/lib/tsan/rtl/tsan_preinit.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_proc.cc - copied unchanged from r309124, head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_proc.cc stable/11/contrib/libc++/include/__bsd_locale_defaults.h - copied unchanged from r309124, head/contrib/libc++/include/__bsd_locale_defaults.h stable/11/contrib/libc++/include/__bsd_locale_fallbacks.h - copied unchanged from r309124, head/contrib/libc++/include/__bsd_locale_fallbacks.h stable/11/contrib/libc++/include/__threading_support - copied unchanged from r309124, head/contrib/libc++/include/__threading_support stable/11/contrib/libc++/include/experimental/__memory - copied unchanged from r309124, head/contrib/libc++/include/experimental/__memory stable/11/contrib/libc++/include/experimental/deque - copied unchanged from r309124, head/contrib/libc++/include/experimental/deque stable/11/contrib/libc++/include/experimental/filesystem - copied unchanged from r309124, head/contrib/libc++/include/experimental/filesystem stable/11/contrib/libc++/include/experimental/forward_list - copied unchanged from r309124, head/contrib/libc++/include/experimental/forward_list stable/11/contrib/libc++/include/experimental/iterator - copied unchanged from r309124, head/contrib/libc++/include/experimental/iterator stable/11/contrib/libc++/include/experimental/list - copied unchanged from r309124, head/contrib/libc++/include/experimental/list stable/11/contrib/libc++/include/experimental/map - copied unchanged from r309124, head/contrib/libc++/include/experimental/map stable/11/contrib/libc++/include/experimental/memory_resource - copied unchanged from r309124, head/contrib/libc++/include/experimental/memory_resource stable/11/contrib/libc++/include/experimental/propagate_const - copied unchanged from r309124, head/contrib/libc++/include/experimental/propagate_const stable/11/contrib/libc++/include/experimental/regex - copied unchanged from r309124, head/contrib/libc++/include/experimental/regex stable/11/contrib/libc++/include/experimental/set - copied unchanged from r309124, head/contrib/libc++/include/experimental/set stable/11/contrib/libc++/include/experimental/string - copied unchanged from r309124, head/contrib/libc++/include/experimental/string stable/11/contrib/libc++/include/experimental/unordered_map - copied unchanged from r309124, head/contrib/libc++/include/experimental/unordered_map stable/11/contrib/libc++/include/experimental/unordered_set - copied unchanged from r309124, head/contrib/libc++/include/experimental/unordered_set stable/11/contrib/libc++/include/experimental/vector - copied unchanged from r309124, head/contrib/libc++/include/experimental/vector stable/11/contrib/libc++/include/stdbool.h - copied unchanged from r309124, head/contrib/libc++/include/stdbool.h stable/11/contrib/libc++/include/string.h - copied unchanged from r309124, head/contrib/libc++/include/string.h stable/11/contrib/libc++/src/experimental/ - copied from r309124, head/contrib/libc++/src/experimental/ stable/11/contrib/llvm/include/llvm/ADT/BitmaskEnum.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/ADT/BitmaskEnum.h stable/11/contrib/llvm/include/llvm/ADT/PriorityWorklist.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/ADT/PriorityWorklist.h stable/11/contrib/llvm/include/llvm/ADT/Sequence.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/ADT/Sequence.h stable/11/contrib/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h stable/11/contrib/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h stable/11/contrib/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h stable/11/contrib/llvm/include/llvm/Analysis/LoopPassManager.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/LoopPassManager.h stable/11/contrib/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h stable/11/contrib/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h stable/11/contrib/llvm/include/llvm/Analysis/ProfileSummaryInfo.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/ProfileSummaryInfo.h stable/11/contrib/llvm/include/llvm/Analysis/TypeMetadataUtils.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Analysis/TypeMetadataUtils.h stable/11/contrib/llvm/include/llvm/CodeGen/GlobalISel/ - copied from r309124, head/contrib/llvm/include/llvm/CodeGen/GlobalISel/ stable/11/contrib/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h stable/11/contrib/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h stable/11/contrib/llvm/include/llvm/CodeGen/RegisterUsageInfo.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/RegisterUsageInfo.h stable/11/contrib/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h stable/11/contrib/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h stable/11/contrib/llvm/include/llvm/CodeGen/TailDuplicator.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/TailDuplicator.h stable/11/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h stable/11/contrib/llvm/include/llvm/CodeGen/UnreachableBlockElim.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/CodeGen/UnreachableBlockElim.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/ByteStream.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/ByteStream.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/CVSymbolTypes.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/CVSymbolTypes.def stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstream.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstream.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamArray.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamArray.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamInterface.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamInterface.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamReader.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamReader.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamRef.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamRef.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamWriter.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/StreamWriter.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeDumper.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeDumper.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeRecords.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeRecords.def stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/GenericError.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/DebugInfo/PDB/GenericError.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/Raw/ - copied from r309124, head/contrib/llvm/include/llvm/DebugInfo/PDB/Raw/ stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h stable/11/contrib/llvm/include/llvm/IR/GlobalIFunc.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/IR/GlobalIFunc.h stable/11/contrib/llvm/include/llvm/IR/GlobalIndirectSymbol.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/IR/GlobalIndirectSymbol.h stable/11/contrib/llvm/include/llvm/IR/ModuleSummaryIndex.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/IR/ModuleSummaryIndex.h stable/11/contrib/llvm/include/llvm/IR/OptBisect.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/IR/OptBisect.h stable/11/contrib/llvm/include/llvm/IR/ProfileSummary.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/IR/ProfileSummary.h stable/11/contrib/llvm/include/llvm/LTO/LTO.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/LTO/LTO.h stable/11/contrib/llvm/include/llvm/LTO/legacy/ - copied from r309124, head/contrib/llvm/include/llvm/LTO/legacy/ stable/11/contrib/llvm/include/llvm/MC/MCCodeView.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/MC/MCCodeView.h stable/11/contrib/llvm/include/llvm/MC/MCDisassembler/ - copied from r309124, head/contrib/llvm/include/llvm/MC/MCDisassembler/ stable/11/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h stable/11/contrib/llvm/include/llvm/Object/ModuleSummaryIndexObjectFile.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Object/ModuleSummaryIndexObjectFile.h stable/11/contrib/llvm/include/llvm/ObjectYAML/ - copied from r309124, head/contrib/llvm/include/llvm/ObjectYAML/ stable/11/contrib/llvm/include/llvm/ProfileData/Coverage/ - copied from r309124, head/contrib/llvm/include/llvm/ProfileData/Coverage/ stable/11/contrib/llvm/include/llvm/ProfileData/ProfileCommon.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/ProfileData/ProfileCommon.h stable/11/contrib/llvm/include/llvm/Support/AArch64TargetParser.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/AArch64TargetParser.def stable/11/contrib/llvm/include/llvm/Support/AtomicOrdering.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/AtomicOrdering.h stable/11/contrib/llvm/include/llvm/Support/CachePruning.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/CachePruning.h stable/11/contrib/llvm/include/llvm/Support/CodeGenCWrappers.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/CodeGenCWrappers.h stable/11/contrib/llvm/include/llvm/Support/ELFRelocs/AMDGPU.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/ELFRelocs/AMDGPU.def stable/11/contrib/llvm/include/llvm/Support/ELFRelocs/BPF.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/ELFRelocs/BPF.def stable/11/contrib/llvm/include/llvm/Support/ELFRelocs/Lanai.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/ELFRelocs/Lanai.def stable/11/contrib/llvm/include/llvm/Support/Error.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/Error.h stable/11/contrib/llvm/include/llvm/Support/MachO.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/MachO.def stable/11/contrib/llvm/include/llvm/Support/SHA1.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/SHA1.h stable/11/contrib/llvm/include/llvm/Support/ScopedPrinter.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/ScopedPrinter.h stable/11/contrib/llvm/include/llvm/Support/TypeName.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/TypeName.h stable/11/contrib/llvm/include/llvm/Support/raw_sha1_ostream.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Support/raw_sha1_ostream.h stable/11/contrib/llvm/include/llvm/TableGen/SearchableTable.td - copied unchanged from r309124, head/contrib/llvm/include/llvm/TableGen/SearchableTable.td stable/11/contrib/llvm/include/llvm/Target/GenericOpcodes.td - copied unchanged from r309124, head/contrib/llvm/include/llvm/Target/GenericOpcodes.td stable/11/contrib/llvm/include/llvm/Target/TargetOpcodes.def - copied unchanged from r309124, head/contrib/llvm/include/llvm/Target/TargetOpcodes.def stable/11/contrib/llvm/include/llvm/Transforms/GCOVProfiler.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/GCOVProfiler.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/ConstantMerge.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/ConstantMerge.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/GlobalDCE.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/GlobalDCE.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/GlobalOpt.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/GlobalOpt.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/Internalize.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/Internalize.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/PartialInlining.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/PartialInlining.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/SCCP.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/SCCP.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h stable/11/contrib/llvm/include/llvm/Transforms/InstrProfiling.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/InstrProfiling.h stable/11/contrib/llvm/include/llvm/Transforms/PGOInstrumentation.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/PGOInstrumentation.h stable/11/contrib/llvm/include/llvm/Transforms/SampleProfile.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/SampleProfile.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/BDCE.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/BDCE.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/DCE.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/DCE.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/Float2Int.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/Float2Int.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/GVN.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/GVN.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/GuardWidening.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/GuardWidening.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/JumpThreading.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/JumpThreading.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LICM.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LICM.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LoopRotation.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LoopRotation.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LowerAtomic.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/LowerAtomic.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/Reassociate.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/Reassociate.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/SCCP.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/SCCP.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/Sink.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/Sink.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/Evaluator.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/Evaluator.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/LCSSA.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/LCSSA.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/LoopSimplify.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/LoopSimplify.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/Mem2Reg.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/Mem2Reg.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/MemorySSA.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/MemorySSA.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/SanitizerStats.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/SanitizerStats.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/SimplifyInstructions.h - copied unchanged from r309124, head/contrib/llvm/include/llvm/Transforms/Utils/SimplifyInstructions.h stable/11/contrib/llvm/include/llvm/Transforms/Vectorize/ - copied from r309124, head/contrib/llvm/include/llvm/Transforms/Vectorize/ stable/11/contrib/llvm/lib/Analysis/AliasAnalysisSummary.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/AliasAnalysisSummary.cpp stable/11/contrib/llvm/lib/Analysis/AliasAnalysisSummary.h - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/AliasAnalysisSummary.h stable/11/contrib/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/CFLGraph.h - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/CFLGraph.h stable/11/contrib/llvm/lib/Analysis/CFLSteensAliasAnalysis.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/CFLSteensAliasAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/LazyBlockFrequencyInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/LazyBlockFrequencyInfo.cpp stable/11/contrib/llvm/lib/Analysis/LoopPassManager.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/LoopPassManager.cpp stable/11/contrib/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp stable/11/contrib/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp stable/11/contrib/llvm/lib/Analysis/ProfileSummaryInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/ProfileSummaryInfo.cpp stable/11/contrib/llvm/lib/Analysis/TypeMetadataUtils.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Analysis/TypeMetadataUtils.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h stable/11/contrib/llvm/lib/CodeGen/BuiltinGCs.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/BuiltinGCs.cpp stable/11/contrib/llvm/lib/CodeGen/DetectDeadLanes.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/DetectDeadLanes.cpp stable/11/contrib/llvm/lib/CodeGen/GlobalISel/ - copied from r309124, head/contrib/llvm/lib/CodeGen/GlobalISel/ stable/11/contrib/llvm/lib/CodeGen/LiveRangeUtils.h - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/LiveRangeUtils.h stable/11/contrib/llvm/lib/CodeGen/LowerEmuTLS.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/LowerEmuTLS.cpp stable/11/contrib/llvm/lib/CodeGen/PatchableFunction.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/PatchableFunction.cpp stable/11/contrib/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp stable/11/contrib/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp stable/11/contrib/llvm/lib/CodeGen/RegUsageInfoCollector.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/RegUsageInfoCollector.cpp stable/11/contrib/llvm/lib/CodeGen/RegUsageInfoPropagate.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/RegUsageInfoPropagate.cpp stable/11/contrib/llvm/lib/CodeGen/RegisterUsageInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/RegisterUsageInfo.cpp stable/11/contrib/llvm/lib/CodeGen/RenameIndependentSubregs.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/RenameIndependentSubregs.cpp stable/11/contrib/llvm/lib/CodeGen/SafeStack.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/SafeStack.cpp stable/11/contrib/llvm/lib/CodeGen/SafeStackColoring.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/SafeStackColoring.cpp stable/11/contrib/llvm/lib/CodeGen/SafeStackColoring.h - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/SafeStackColoring.h stable/11/contrib/llvm/lib/CodeGen/SafeStackLayout.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/SafeStackLayout.cpp stable/11/contrib/llvm/lib/CodeGen/SafeStackLayout.h - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/SafeStackLayout.h stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGTargetInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGTargetInfo.cpp stable/11/contrib/llvm/lib/CodeGen/TailDuplicator.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/TailDuplicator.cpp stable/11/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp stable/11/contrib/llvm/lib/CodeGen/XRayInstrumentation.cpp - copied unchanged from r309124, head/contrib/llvm/lib/CodeGen/XRayInstrumentation.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/ByteStream.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/ByteStream.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/CodeViewError.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/CodeViewError.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/EnumTables.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/EnumTables.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/ModuleSubstream.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/ModuleSubstream.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/RecordSerialization.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/RecordSerialization.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/StreamReader.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/StreamReader.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/StreamWriter.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/StreamWriter.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/TypeRecord.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/TypeRecord.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAError.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAError.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/GenericError.cpp - copied unchanged from r309124, head/contrib/llvm/lib/DebugInfo/PDB/GenericError.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/Raw/ - copied from r309124, head/contrib/llvm/lib/DebugInfo/PDB/Raw/ stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp - copied unchanged from r309124, head/contrib/llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h - copied unchanged from r309124, head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h stable/11/contrib/llvm/lib/IR/AttributeSetNode.h - copied unchanged from r309124, head/contrib/llvm/lib/IR/AttributeSetNode.h stable/11/contrib/llvm/lib/IR/ModuleSummaryIndex.cpp - copied unchanged from r309124, head/contrib/llvm/lib/IR/ModuleSummaryIndex.cpp stable/11/contrib/llvm/lib/IR/OptBisect.cpp - copied unchanged from r309124, head/contrib/llvm/lib/IR/OptBisect.cpp stable/11/contrib/llvm/lib/IR/ProfileSummary.cpp - copied unchanged from r309124, head/contrib/llvm/lib/IR/ProfileSummary.cpp stable/11/contrib/llvm/lib/LTO/LTO.cpp - copied unchanged from r309124, head/contrib/llvm/lib/LTO/LTO.cpp stable/11/contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp - copied unchanged from r309124, head/contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp stable/11/contrib/llvm/lib/LTO/UpdateCompilerUsed.cpp - copied unchanged from r309124, head/contrib/llvm/lib/LTO/UpdateCompilerUsed.cpp stable/11/contrib/llvm/lib/MC/MCCodeView.cpp - copied unchanged from r309124, head/contrib/llvm/lib/MC/MCCodeView.cpp stable/11/contrib/llvm/lib/MC/MCDisassembler/MCSymbolizer.cpp - copied unchanged from r309124, head/contrib/llvm/lib/MC/MCDisassembler/MCSymbolizer.cpp stable/11/contrib/llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Object/ModuleSummaryIndexObjectFile.cpp stable/11/contrib/llvm/lib/ObjectYAML/ - copied from r309124, head/contrib/llvm/lib/ObjectYAML/ stable/11/contrib/llvm/lib/ProfileData/Coverage/ - copied from r309124, head/contrib/llvm/lib/ProfileData/Coverage/ stable/11/contrib/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp - copied unchanged from r309124, head/contrib/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp stable/11/contrib/llvm/lib/Support/CachePruning.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Support/CachePruning.cpp stable/11/contrib/llvm/lib/Support/Error.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Support/Error.cpp stable/11/contrib/llvm/lib/Support/SHA1.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Support/SHA1.cpp stable/11/contrib/llvm/lib/Support/ScopedPrinter.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Support/ScopedPrinter.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64CallLowering.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64CallLowering.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64CallLowering.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64CallLowering.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedKryo.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64SchedKryo.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedKryoDetails.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64SchedKryoDetails.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedVulcan.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64SchedVulcan.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h stable/11/contrib/llvm/lib/Target/AMDGPU/Disassembler/ - copied from r309124, head/contrib/llvm/lib/Target/AMDGPU/Disassembler/ stable/11/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600FrameLowering.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/R600FrameLowering.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600FrameLowering.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/R600FrameLowering.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIDebuggerInsertNops.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/SIDebuggerInsertNops.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp - copied, changed from r309124, head/contrib/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.h stable/11/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTInfo.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.h stable/11/contrib/llvm/lib/Target/AVR/AVRFrameLowering.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRFrameLowering.h stable/11/contrib/llvm/lib/Target/AVR/AVRISelLowering.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRISelLowering.h stable/11/contrib/llvm/lib/Target/AVR/AVRInstrFormats.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRInstrFormats.td stable/11/contrib/llvm/lib/Target/AVR/AVRInstrInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRInstrInfo.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRInstrInfo.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRInstrInfo.h stable/11/contrib/llvm/lib/Target/AVR/AVRInstrInfo.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRInstrInfo.td stable/11/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.h stable/11/contrib/llvm/lib/Target/AVR/AVRSubtarget.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRSubtarget.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRSubtarget.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRSubtarget.h stable/11/contrib/llvm/lib/Target/AVR/AVRTargetMachine.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/AVRTargetMachine.h stable/11/contrib/llvm/lib/Target/AVR/MCTargetDesc/ - copied from r309124, head/contrib/llvm/lib/Target/AVR/MCTargetDesc/ stable/11/contrib/llvm/lib/Target/AVR/TODO.md - copied unchanged from r309124, head/contrib/llvm/lib/Target/AVR/TODO.md stable/11/contrib/llvm/lib/Target/Hexagon/HexagonBlockRanges.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/Hexagon/HexagonBlockRanges.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonBlockRanges.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/Hexagon/HexagonBlockRanges.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonBranchRelaxation.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/Hexagon/HexagonBranchRelaxation.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp stable/11/contrib/llvm/lib/Target/Lanai/ - copied from r309124, head/contrib/llvm/lib/Target/Lanai/ stable/11/contrib/llvm/lib/Target/Mips/MipsHazardSchedule.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/Mips/MipsHazardSchedule.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXInferAddressSpaces.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/NVPTX/NVPTXInferAddressSpaces.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVVMIntrRange.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/NVPTX/NVVMIntrRange.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCCCState.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/PowerPC/PPCCCState.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCCCState.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/PowerPC/PPCCCState.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCQPXLoadSplat.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/PowerPC/PPCQPXLoadSplat.cpp stable/11/contrib/llvm/lib/Target/PowerPC/README_P9.txt - copied unchanged from r309124, head/contrib/llvm/lib/Target/PowerPC/README_P9.txt stable/11/contrib/llvm/lib/Target/PowerPC/p9-instrs.txt - copied unchanged from r309124, head/contrib/llvm/lib/Target/PowerPC/p9-instrs.txt stable/11/contrib/llvm/lib/Target/Sparc/LeonFeatures.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/Sparc/LeonFeatures.td stable/11/contrib/llvm/lib/Target/Sparc/LeonPasses.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/Sparc/LeonPasses.cpp stable/11/contrib/llvm/lib/Target/Sparc/LeonPasses.h - copied unchanged from r309124, head/contrib/llvm/lib/Target/Sparc/LeonPasses.h stable/11/contrib/llvm/lib/Target/Sparc/SparcSchedule.td - copied unchanged from r309124, head/contrib/llvm/lib/Target/Sparc/SparcSchedule.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZTDC.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/SystemZ/SystemZTDC.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyOptimizeLiveIntervals.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyOptimizeLiveIntervals.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyPrepareForLiveIntervals.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyPrepareForLiveIntervals.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyReplacePhysRegs.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/WebAssembly/WebAssemblyReplacePhysRegs.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblySetP2AlignOperands.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/WebAssembly/WebAssemblySetP2AlignOperands.cpp stable/11/contrib/llvm/lib/Target/X86/X86FixupBWInsts.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/X86/X86FixupBWInsts.cpp stable/11/contrib/llvm/lib/Target/X86/X86FixupSetCC.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/X86/X86FixupSetCC.cpp stable/11/contrib/llvm/lib/Target/X86/X86WinAllocaExpander.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Target/X86/X86WinAllocaExpander.cpp stable/11/contrib/llvm/lib/Transforms/IPO/LowerTypeTests.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/IPO/LowerTypeTests.cpp stable/11/contrib/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/GuardWidening.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Scalar/GuardWidening.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp stable/11/contrib/llvm/lib/Transforms/Utils/Evaluator.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Utils/Evaluator.cpp stable/11/contrib/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp stable/11/contrib/llvm/lib/Transforms/Utils/MemorySSA.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Utils/MemorySSA.cpp stable/11/contrib/llvm/lib/Transforms/Utils/NameAnonFunctions.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Utils/NameAnonFunctions.cpp stable/11/contrib/llvm/lib/Transforms/Utils/SanitizerStats.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Utils/SanitizerStats.cpp stable/11/contrib/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp - copied unchanged from r309124, head/contrib/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp stable/11/contrib/llvm/tools/clang/include/clang/AST/Availability.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/AST/Availability.h stable/11/contrib/llvm/tools/clang/include/clang/AST/LocInfoType.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/AST/LocInfoType.h stable/11/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.def - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/Cuda.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Basic/Cuda.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/DebugInfoOptions.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Basic/DebugInfoOptions.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/OpenCLImageTypes.def - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Basic/OpenCLImageTypes.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/OpenCLOptions.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Basic/OpenCLOptions.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/PragmaKinds.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Basic/PragmaKinds.h stable/11/contrib/llvm/tools/clang/include/clang/CodeGen/SwiftCallingConv.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/CodeGen/SwiftCallingConv.h stable/11/contrib/llvm/tools/clang/include/clang/Index/CodegenNameGenerator.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Index/CodegenNameGenerator.h stable/11/contrib/llvm/tools/clang/include/clang/Index/IndexDataConsumer.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Index/IndexDataConsumer.h stable/11/contrib/llvm/tools/clang/include/clang/Index/IndexSymbol.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Index/IndexSymbol.h stable/11/contrib/llvm/tools/clang/include/clang/Index/IndexingAction.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Index/IndexingAction.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/HeaderMapTypes.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Lex/HeaderMapTypes.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/CleanupInfo.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Sema/CleanupInfo.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.def - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.def stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Symbols.def - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Symbols.def stable/11/contrib/llvm/tools/clang/include/clang/Tooling/Core/QualTypeNames.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Tooling/Core/QualTypeNames.h stable/11/contrib/llvm/tools/clang/include/clang/Tooling/FixIt.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/include/clang/Tooling/FixIt.h stable/11/contrib/llvm/tools/clang/lib/Basic/Cuda.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Basic/Cuda.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCUDABuiltin.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/CodeGen/CGCUDABuiltin.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/SwiftCallingConv.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/CodeGen/SwiftCallingConv.cpp stable/11/contrib/llvm/tools/clang/lib/Format/AffectedRangeManager.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/AffectedRangeManager.cpp stable/11/contrib/llvm/tools/clang/lib/Format/AffectedRangeManager.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/AffectedRangeManager.h stable/11/contrib/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp stable/11/contrib/llvm/tools/clang/lib/Format/FormatTokenLexer.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/FormatTokenLexer.h stable/11/contrib/llvm/tools/clang/lib/Format/SortJavaScriptImports.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/SortJavaScriptImports.cpp stable/11/contrib/llvm/tools/clang/lib/Format/SortJavaScriptImports.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/SortJavaScriptImports.h stable/11/contrib/llvm/tools/clang/lib/Format/TokenAnalyzer.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/TokenAnalyzer.cpp stable/11/contrib/llvm/tools/clang/lib/Format/TokenAnalyzer.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Format/TokenAnalyzer.h stable/11/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_cmath.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_cmath.h stable/11/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_intrinsics.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_intrinsics.h stable/11/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_math_forward_declares.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_math_forward_declares.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512ifmaintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/avx512ifmaintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512ifmavlintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/avx512ifmavlintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512pfintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/avx512pfintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512vbmiintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/avx512vbmiintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512vbmivlintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/avx512vbmivlintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512vlcdintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/avx512vlcdintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/clflushoptintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/clflushoptintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/intrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/intrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/msa.h - copied unchanged from r310194, head/contrib/llvm/tools/clang/lib/Headers/msa.h stable/11/contrib/llvm/tools/clang/lib/Headers/mwaitxintrin.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/mwaitxintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/opencl-c.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Headers/opencl-c.h stable/11/contrib/llvm/tools/clang/lib/Index/CodegenNameGenerator.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/CodegenNameGenerator.cpp stable/11/contrib/llvm/tools/clang/lib/Index/IndexBody.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/IndexBody.cpp stable/11/contrib/llvm/tools/clang/lib/Index/IndexDecl.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/IndexDecl.cpp stable/11/contrib/llvm/tools/clang/lib/Index/IndexSymbol.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/IndexSymbol.cpp stable/11/contrib/llvm/tools/clang/lib/Index/IndexTypeSourceInfo.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/IndexTypeSourceInfo.cpp stable/11/contrib/llvm/tools/clang/lib/Index/IndexingAction.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/IndexingAction.cpp stable/11/contrib/llvm/tools/clang/lib/Index/IndexingContext.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/IndexingContext.cpp stable/11/contrib/llvm/tools/clang/lib/Index/IndexingContext.h - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Index/IndexingContext.h stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/ - copied from r309124, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/ stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp stable/11/contrib/llvm/tools/clang/lib/Tooling/Core/QualTypeNames.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Tooling/Core/QualTypeNames.cpp stable/11/contrib/llvm/tools/clang/lib/Tooling/FixIt.cpp - copied unchanged from r309124, head/contrib/llvm/tools/clang/lib/Tooling/FixIt.cpp stable/11/contrib/llvm/tools/lld/ - copied from r309124, head/contrib/llvm/tools/lld/ stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBMemoryRegionInfo.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/API/SBMemoryRegionInfo.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBMemoryRegionInfoList.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/API/SBMemoryRegionInfoList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ThreadSafeSTLVector.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/Core/ThreadSafeSTLVector.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/DiagnosticManager.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/Expression/DiagnosticManager.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandAlias.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandAlias.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangUtil.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangUtil.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/JavaASTContext.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/Symbol/JavaASTContext.h stable/11/contrib/llvm/tools/lldb/include/lldb/lldb-private-defines.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/include/lldb/lldb-private-defines.h stable/11/contrib/llvm/tools/lldb/source/API/SBMemoryRegionInfo.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/API/SBMemoryRegionInfo.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBMemoryRegionInfoList.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/API/SBMemoryRegionInfoList.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/DiagnosticManager.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Expression/DiagnosticManager.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/CommandAlias.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Interpreter/CommandAlias.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-s390x/ - copied from r309124, head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-s390x/ stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h stable/11/contrib/llvm/tools/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ - copied from r309124, head/contrib/llvm/tools/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/Java/ - copied from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Language/Java/ stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/Java/ - copied from r309124, head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/Java/ stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_s390x.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_s390x.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.h - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/PDB/ - copied from r309124, head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/PDB/ stable/11/contrib/llvm/tools/lldb/source/Symbol/ClangUtil.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Symbol/ClangUtil.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/JavaASTContext.cpp - copied unchanged from r309124, head/contrib/llvm/tools/lldb/source/Symbol/JavaASTContext.cpp stable/11/contrib/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp - copied unchanged from r309124, head/contrib/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp stable/11/contrib/llvm/tools/llvm-cov/SourceCoverageViewHTML.h - copied unchanged from r309124, head/contrib/llvm/tools/llvm-cov/SourceCoverageViewHTML.h stable/11/contrib/llvm/tools/llvm-cov/SourceCoverageViewText.cpp - copied unchanged from r309124, head/contrib/llvm/tools/llvm-cov/SourceCoverageViewText.cpp stable/11/contrib/llvm/tools/llvm-cov/SourceCoverageViewText.h - copied unchanged from r309124, head/contrib/llvm/tools/llvm-cov/SourceCoverageViewText.h stable/11/contrib/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp - copied unchanged from r309124, head/contrib/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/LLVMOutputStyle.h - copied unchanged from r309124, head/contrib/llvm/tools/llvm-pdbdump/LLVMOutputStyle.h stable/11/contrib/llvm/tools/llvm-pdbdump/OutputStyle.h - copied unchanged from r309124, head/contrib/llvm/tools/llvm-pdbdump/OutputStyle.h stable/11/contrib/llvm/tools/llvm-pdbdump/PdbYaml.cpp - copied unchanged from r309124, head/contrib/llvm/tools/llvm-pdbdump/PdbYaml.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/PdbYaml.h - copied unchanged from r309124, head/contrib/llvm/tools/llvm-pdbdump/PdbYaml.h stable/11/contrib/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp - copied unchanged from r309124, head/contrib/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/YAMLOutputStyle.h - copied unchanged from r309124, head/contrib/llvm/tools/llvm-pdbdump/YAMLOutputStyle.h stable/11/contrib/llvm/tools/llvm-readobj/CodeView.h - copied unchanged from r309124, head/contrib/llvm/tools/llvm-readobj/CodeView.h stable/11/contrib/llvm/utils/TableGen/SearchableTableEmitter.cpp - copied unchanged from r309124, head/contrib/llvm/utils/TableGen/SearchableTableEmitter.cpp stable/11/lib/clang/clang.pre.mk - copied unchanged from r309124, head/lib/clang/clang.pre.mk stable/11/lib/clang/headers/ - copied from r309124, head/lib/clang/headers/ stable/11/lib/clang/include/lld/ - copied from r309124, head/lib/clang/include/lld/ stable/11/lib/clang/libclang/ - copied from r309124, head/lib/clang/libclang/ stable/11/lib/clang/libllvm/ - copied from r309124, head/lib/clang/libllvm/ stable/11/lib/clang/libllvmminimal/ - copied from r309124, head/lib/clang/libllvmminimal/ stable/11/lib/clang/lldb.pre.mk - copied unchanged from r309124, head/lib/clang/lldb.pre.mk stable/11/lib/clang/llvm.build.mk - copied, changed from r309124, head/lib/clang/llvm.build.mk stable/11/lib/clang/llvm.pre.mk - copied unchanged from r309124, head/lib/clang/llvm.pre.mk stable/11/lib/libclang_rt/stats/ - copied from r309124, head/lib/libclang_rt/stats/ stable/11/lib/libclang_rt/stats_client/ - copied from r309124, head/lib/libclang_rt/stats_client/ stable/11/release/packages/lld.ucl - copied unchanged from r309262, head/release/packages/lld.ucl stable/11/release/packages/lldb.ucl - copied unchanged from r309262, head/release/packages/lldb.ucl stable/11/tools/build/options/WITHOUT_LLD - copied unchanged from r309124, head/tools/build/options/WITHOUT_LLD stable/11/tools/build/options/WITH_LLD - copied unchanged from r309124, head/tools/build/options/WITH_LLD stable/11/usr.bin/clang/Makefile.inc - copied unchanged from r309124, head/usr.bin/clang/Makefile.inc stable/11/usr.bin/clang/clang-tblgen/Makefile.depend.host - copied unchanged from r309124, head/usr.bin/clang/clang-tblgen/Makefile.depend.host stable/11/usr.bin/clang/lld/ - copied from r309124, head/usr.bin/clang/lld/ stable/11/usr.bin/clang/llvm-tblgen/Makefile.depend.host - copied unchanged from r309124, head/usr.bin/clang/llvm-tblgen/Makefile.depend.host stable/11/usr.bin/clang/llvm.prog.mk - copied, changed from r309124, head/usr.bin/clang/llvm.prog.mk Replaced: stable/11/lib/clang/liblldb/Makefile.depend - copied unchanged from r309124, head/lib/clang/liblldb/Makefile.depend stable/11/lib/libcompiler_rt/Makefile.inc - copied, changed from r306377, head/lib/libcompiler_rt/Makefile.inc stable/11/usr.bin/clang/bugpoint/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/bugpoint/Makefile.depend stable/11/usr.bin/clang/clang-format/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/clang-format/Makefile.depend stable/11/usr.bin/clang/clang-tblgen/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/clang-tblgen/Makefile.depend stable/11/usr.bin/clang/clang/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/clang/Makefile.depend stable/11/usr.bin/clang/llc/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llc/Makefile.depend stable/11/usr.bin/clang/lldb/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/lldb/Makefile.depend stable/11/usr.bin/clang/lli/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/lli/Makefile.depend stable/11/usr.bin/clang/llvm-ar/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-ar/Makefile.depend stable/11/usr.bin/clang/llvm-as/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-as/Makefile.depend stable/11/usr.bin/clang/llvm-bcanalyzer/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-bcanalyzer/Makefile.depend stable/11/usr.bin/clang/llvm-cov/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-cov/Makefile.depend stable/11/usr.bin/clang/llvm-cxxdump/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-cxxdump/Makefile.depend stable/11/usr.bin/clang/llvm-diff/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-diff/Makefile.depend stable/11/usr.bin/clang/llvm-dis/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-dis/Makefile.depend stable/11/usr.bin/clang/llvm-dwarfdump/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-dwarfdump/Makefile.depend stable/11/usr.bin/clang/llvm-extract/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-extract/Makefile.depend stable/11/usr.bin/clang/llvm-link/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-link/Makefile.depend stable/11/usr.bin/clang/llvm-lto/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-lto/Makefile.depend stable/11/usr.bin/clang/llvm-mc/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-mc/Makefile.depend stable/11/usr.bin/clang/llvm-nm/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-nm/Makefile.depend stable/11/usr.bin/clang/llvm-objdump/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-objdump/Makefile.depend stable/11/usr.bin/clang/llvm-pdbdump/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-pdbdump/Makefile.depend stable/11/usr.bin/clang/llvm-profdata/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-profdata/Makefile.depend stable/11/usr.bin/clang/llvm-rtdyld/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-rtdyld/Makefile.depend stable/11/usr.bin/clang/llvm-symbolizer/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-symbolizer/Makefile.depend stable/11/usr.bin/clang/llvm-tblgen/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/llvm-tblgen/Makefile.depend stable/11/usr.bin/clang/opt/Makefile.depend - copied unchanged from r309124, head/usr.bin/clang/opt/Makefile.depend Deleted: stable/11/contrib/llvm/include/llvm/Analysis/CFLAliasAnalysis.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h stable/11/contrib/llvm/include/llvm/IR/FunctionInfo.h stable/11/contrib/llvm/include/llvm/LTO/LTOCodeGenerator.h stable/11/contrib/llvm/include/llvm/LTO/LTOModule.h stable/11/contrib/llvm/include/llvm/MC/MCCodeGenInfo.h stable/11/contrib/llvm/include/llvm/MC/MCDisassembler.h stable/11/contrib/llvm/include/llvm/MC/MCExternalSymbolizer.h stable/11/contrib/llvm/include/llvm/MC/MCRelocationInfo.h stable/11/contrib/llvm/include/llvm/MC/MCSymbolizer.h stable/11/contrib/llvm/include/llvm/MC/MCTargetAsmParser.h stable/11/contrib/llvm/include/llvm/MC/YAML.h stable/11/contrib/llvm/include/llvm/Object/COFFYAML.h stable/11/contrib/llvm/include/llvm/Object/ELFYAML.h stable/11/contrib/llvm/include/llvm/Object/FunctionIndexObjectFile.h stable/11/contrib/llvm/include/llvm/ProfileData/CoverageMapping.h stable/11/contrib/llvm/include/llvm/ProfileData/CoverageMappingReader.h stable/11/contrib/llvm/include/llvm/ProfileData/CoverageMappingWriter.h stable/11/contrib/llvm/include/llvm/Support/AIXDataTypesFix.h stable/11/contrib/llvm/include/llvm/Support/DataTypes.h.in stable/11/contrib/llvm/include/llvm/Support/RegistryParser.h stable/11/contrib/llvm/include/llvm/Target/TargetSelectionDAGInfo.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/LowerBitSets.h stable/11/contrib/llvm/lib/Analysis/CFLAliasAnalysis.cpp stable/11/contrib/llvm/lib/AsmParser/module.modulemap stable/11/contrib/llvm/lib/Bitcode/module.modulemap stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.h stable/11/contrib/llvm/lib/CodeGen/CoreCLRGC.cpp stable/11/contrib/llvm/lib/CodeGen/ErlangGC.cpp stable/11/contrib/llvm/lib/CodeGen/OcamlGC.cpp stable/11/contrib/llvm/lib/CodeGen/Passes.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/TargetSelectionDAGInfo.cpp stable/11/contrib/llvm/lib/CodeGen/ShadowStackGC.cpp stable/11/contrib/llvm/lib/CodeGen/StatepointExampleGC.cpp stable/11/contrib/llvm/lib/CodeGen/module.modulemap stable/11/contrib/llvm/lib/DebugInfo/DWARF/module.modulemap stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcArchitectureSupport.cpp stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.cpp stable/11/contrib/llvm/lib/IR/FunctionInfo.cpp stable/11/contrib/llvm/lib/IR/module.modulemap stable/11/contrib/llvm/lib/MC/MCCodeGenInfo.cpp stable/11/contrib/llvm/lib/MC/MCSymbolizer.cpp stable/11/contrib/llvm/lib/MC/YAML.cpp stable/11/contrib/llvm/lib/Object/COFFYAML.cpp stable/11/contrib/llvm/lib/Object/ELFYAML.cpp stable/11/contrib/llvm/lib/Object/FunctionIndexObjectFile.cpp stable/11/contrib/llvm/lib/ProfileData/CoverageMapping.cpp stable/11/contrib/llvm/lib/ProfileData/CoverageMappingReader.cpp stable/11/contrib/llvm/lib/ProfileData/CoverageMappingWriter.cpp stable/11/contrib/llvm/lib/TableGen/module.modulemap stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUDiagnosticInfoUnsupported.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUDiagnosticInfoUnsupported.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600TextureIntrinsicsReplacer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRConfig.h stable/11/contrib/llvm/lib/Target/CppBackend/ stable/11/contrib/llvm/lib/Target/Hexagon/HexagonExpandPredSpillCode.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt stable/11/contrib/llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt stable/11/contrib/llvm/lib/Target/WebAssembly/Disassembler/Makefile stable/11/contrib/llvm/lib/Target/WebAssembly/Relooper.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/Relooper.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyPEI.cpp stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.h stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp stable/11/contrib/llvm/lib/Transforms/IPO/LowerBitSets.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/SafeStack.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp stable/11/contrib/llvm/tools/clang/include/clang/Sema/LocInfoType.h stable/11/contrib/llvm/tools/clang/lib/Headers/Intrin.h stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/Platform.cpp stable/11/contrib/llvm/tools/llvm-readobj/StreamWriter.cpp stable/11/contrib/llvm/tools/llvm-readobj/StreamWriter.h stable/11/contrib/llvm/utils/TableGen/module.modulemap stable/11/lib/clang/clang.lib.mk stable/11/lib/clang/include/AArch64GenAsmMatcher.inc stable/11/lib/clang/include/AArch64GenAsmWriter.inc stable/11/lib/clang/include/AArch64GenAsmWriter1.inc stable/11/lib/clang/include/AArch64GenCallingConv.inc stable/11/lib/clang/include/AArch64GenDAGISel.inc stable/11/lib/clang/include/AArch64GenDisassemblerTables.inc stable/11/lib/clang/include/AArch64GenFastISel.inc stable/11/lib/clang/include/AArch64GenInstrInfo.inc stable/11/lib/clang/include/AArch64GenMCCodeEmitter.inc stable/11/lib/clang/include/AArch64GenMCPseudoLowering.inc stable/11/lib/clang/include/AArch64GenRegisterInfo.inc stable/11/lib/clang/include/AArch64GenSubtargetInfo.inc stable/11/lib/clang/include/ARMGenAsmMatcher.inc stable/11/lib/clang/include/ARMGenAsmWriter.inc stable/11/lib/clang/include/ARMGenCallingConv.inc stable/11/lib/clang/include/ARMGenCodeEmitter.inc stable/11/lib/clang/include/ARMGenDAGISel.inc stable/11/lib/clang/include/ARMGenDisassemblerTables.inc stable/11/lib/clang/include/ARMGenFastISel.inc stable/11/lib/clang/include/ARMGenInstrInfo.inc stable/11/lib/clang/include/ARMGenMCCodeEmitter.inc stable/11/lib/clang/include/ARMGenMCPseudoLowering.inc stable/11/lib/clang/include/ARMGenRegisterInfo.inc stable/11/lib/clang/include/ARMGenSubtargetInfo.inc stable/11/lib/clang/include/AttributesCompatFunc.inc stable/11/lib/clang/include/Checkers.inc stable/11/lib/clang/include/Makefile stable/11/lib/clang/include/Makefile.depend stable/11/lib/clang/include/MipsGenAsmMatcher.inc stable/11/lib/clang/include/MipsGenAsmWriter.inc stable/11/lib/clang/include/MipsGenCallingConv.inc stable/11/lib/clang/include/MipsGenCodeEmitter.inc stable/11/lib/clang/include/MipsGenDAGISel.inc stable/11/lib/clang/include/MipsGenDisassemblerTables.inc stable/11/lib/clang/include/MipsGenFastISel.inc stable/11/lib/clang/include/MipsGenInstrInfo.inc stable/11/lib/clang/include/MipsGenMCCodeEmitter.inc stable/11/lib/clang/include/MipsGenMCPseudoLowering.inc stable/11/lib/clang/include/MipsGenRegisterInfo.inc stable/11/lib/clang/include/MipsGenSubtargetInfo.inc stable/11/lib/clang/include/PPCGenAsmMatcher.inc stable/11/lib/clang/include/PPCGenAsmWriter.inc stable/11/lib/clang/include/PPCGenCallingConv.inc stable/11/lib/clang/include/PPCGenCodeEmitter.inc stable/11/lib/clang/include/PPCGenDAGISel.inc stable/11/lib/clang/include/PPCGenDisassemblerTables.inc stable/11/lib/clang/include/PPCGenFastISel.inc stable/11/lib/clang/include/PPCGenInstrInfo.inc stable/11/lib/clang/include/PPCGenMCCodeEmitter.inc stable/11/lib/clang/include/PPCGenRegisterInfo.inc stable/11/lib/clang/include/PPCGenSubtargetInfo.inc stable/11/lib/clang/include/SparcGenAsmMatcher.inc stable/11/lib/clang/include/SparcGenAsmWriter.inc stable/11/lib/clang/include/SparcGenCallingConv.inc stable/11/lib/clang/include/SparcGenCodeEmitter.inc stable/11/lib/clang/include/SparcGenDAGISel.inc stable/11/lib/clang/include/SparcGenDisassemblerTables.inc stable/11/lib/clang/include/SparcGenInstrInfo.inc stable/11/lib/clang/include/SparcGenMCCodeEmitter.inc stable/11/lib/clang/include/SparcGenRegisterInfo.inc stable/11/lib/clang/include/SparcGenSubtargetInfo.inc stable/11/lib/clang/include/X86GenAsmMatcher.inc stable/11/lib/clang/include/X86GenAsmWriter.inc stable/11/lib/clang/include/X86GenAsmWriter1.inc stable/11/lib/clang/include/X86GenCallingConv.inc stable/11/lib/clang/include/X86GenDAGISel.inc stable/11/lib/clang/include/X86GenDisassemblerTables.inc stable/11/lib/clang/include/X86GenFastISel.inc stable/11/lib/clang/include/X86GenInstrInfo.inc stable/11/lib/clang/include/X86GenRegisterInfo.inc stable/11/lib/clang/include/X86GenSubtargetInfo.inc stable/11/lib/clang/include/clang/AST/ stable/11/lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc stable/11/lib/clang/include/clang/Basic/AttrList.inc stable/11/lib/clang/include/clang/Basic/DiagnosticASTKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticAnalysisKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticCommentKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticCommonKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticDriverKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticFrontendKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticGroups.inc stable/11/lib/clang/include/clang/Basic/DiagnosticIndexName.inc stable/11/lib/clang/include/clang/Basic/DiagnosticLexKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticParseKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticSemaKinds.inc stable/11/lib/clang/include/clang/Basic/DiagnosticSerializationKinds.inc stable/11/lib/clang/include/clang/Basic/arm_neon.inc stable/11/lib/clang/include/clang/Driver/ stable/11/lib/clang/include/clang/Parse/ stable/11/lib/clang/include/clang/Sema/ stable/11/lib/clang/include/clang/Serialization/ stable/11/lib/clang/include/llvm/IR/ stable/11/lib/clang/libclanganalysis/ stable/11/lib/clang/libclangarcmigrate/ stable/11/lib/clang/libclangast/ stable/11/lib/clang/libclangbasic/ stable/11/lib/clang/libclangcodegen/ stable/11/lib/clang/libclangdriver/ stable/11/lib/clang/libclangedit/ stable/11/lib/clang/libclangformat/ stable/11/lib/clang/libclangfrontend/ stable/11/lib/clang/libclangfrontendtool/ stable/11/lib/clang/libclanglex/ stable/11/lib/clang/libclangparse/ stable/11/lib/clang/libclangrewrite/ stable/11/lib/clang/libclangrewritefrontend/ stable/11/lib/clang/libclangsema/ stable/11/lib/clang/libclangserialization/ stable/11/lib/clang/libclangstaticanalyzercheckers/ stable/11/lib/clang/libclangstaticanalyzercore/ stable/11/lib/clang/libclangstaticanalyzerfrontend/ stable/11/lib/clang/libclangtoolingcore/ stable/11/lib/clang/liblldbAPI/ stable/11/lib/clang/liblldbBreakpoint/ stable/11/lib/clang/liblldbCommands/ stable/11/lib/clang/liblldbCore/ stable/11/lib/clang/liblldbDataFormatters/ stable/11/lib/clang/liblldbExpression/ stable/11/lib/clang/liblldbHostCommon/ stable/11/lib/clang/liblldbHostFreeBSD/ stable/11/lib/clang/liblldbHostPOSIX/ stable/11/lib/clang/liblldbInitialization/ stable/11/lib/clang/liblldbInterpreter/ stable/11/lib/clang/liblldbPluginABISysV_arm/ stable/11/lib/clang/liblldbPluginABISysV_arm64/ stable/11/lib/clang/liblldbPluginABISysV_i386/ stable/11/lib/clang/liblldbPluginABISysV_mips/ stable/11/lib/clang/liblldbPluginABISysV_mips64/ stable/11/lib/clang/liblldbPluginABISysV_ppc/ stable/11/lib/clang/liblldbPluginABISysV_ppc64/ stable/11/lib/clang/liblldbPluginABISysV_x86_64/ stable/11/lib/clang/liblldbPluginCXXItaniumABI/ stable/11/lib/clang/liblldbPluginDisassemblerLLVM/ stable/11/lib/clang/liblldbPluginDynamicLoaderPosixDYLD/ stable/11/lib/clang/liblldbPluginDynamicLoaderStatic/ stable/11/lib/clang/liblldbPluginExpressionParserClang/ stable/11/lib/clang/liblldbPluginExpressionParserGo/ stable/11/lib/clang/liblldbPluginInstructionARM/ stable/11/lib/clang/liblldbPluginInstructionARM64/ stable/11/lib/clang/liblldbPluginInstructionMIPS/ stable/11/lib/clang/liblldbPluginInstructionMIPS64/ stable/11/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/ stable/11/lib/clang/liblldbPluginJITLoaderGDB/ stable/11/lib/clang/liblldbPluginLanguageCPlusPlus/ stable/11/lib/clang/liblldbPluginLanguageObjC/ stable/11/lib/clang/liblldbPluginMemoryHistoryASan/ stable/11/lib/clang/liblldbPluginObjectContainerBSDArchive/ stable/11/lib/clang/liblldbPluginObjectFileELF/ stable/11/lib/clang/liblldbPluginObjectFileJIT/ stable/11/lib/clang/liblldbPluginPlatformFreeBSD/ stable/11/lib/clang/liblldbPluginPlatformGDB/ stable/11/lib/clang/liblldbPluginProcessElfCore/ stable/11/lib/clang/liblldbPluginProcessFreeBSD/ stable/11/lib/clang/liblldbPluginProcessGDBRemote/ stable/11/lib/clang/liblldbPluginProcessPOSIX/ stable/11/lib/clang/liblldbPluginProcessUtility/ stable/11/lib/clang/liblldbPluginScriptInterpreterNone/ stable/11/lib/clang/liblldbPluginSymbolFileDWARF/ stable/11/lib/clang/liblldbPluginSymbolFileSymtab/ stable/11/lib/clang/liblldbPluginSymbolVendorELF/ stable/11/lib/clang/liblldbPluginUnwindAssemblyInstEmulation/ stable/11/lib/clang/liblldbPluginUnwindAssemblyX86/ stable/11/lib/clang/liblldbSymbol/ stable/11/lib/clang/liblldbTarget/ stable/11/lib/clang/liblldbUtility/ stable/11/lib/clang/libllvmaarch64asmparser/ stable/11/lib/clang/libllvmaarch64asmprinter/ stable/11/lib/clang/libllvmaarch64codegen/ stable/11/lib/clang/libllvmaarch64desc/ stable/11/lib/clang/libllvmaarch64disassembler/ stable/11/lib/clang/libllvmaarch64info/ stable/11/lib/clang/libllvmaarch64utils/ stable/11/lib/clang/libllvmanalysis/ stable/11/lib/clang/libllvmarmasmparser/ stable/11/lib/clang/libllvmarmasmprinter/ stable/11/lib/clang/libllvmarmcodegen/ stable/11/lib/clang/libllvmarmdesc/ stable/11/lib/clang/libllvmarmdisassembler/ stable/11/lib/clang/libllvmarminfo/ stable/11/lib/clang/libllvmasmparser/ stable/11/lib/clang/libllvmasmprinter/ stable/11/lib/clang/libllvmbitreader/ stable/11/lib/clang/libllvmbitwriter/ stable/11/lib/clang/libllvmcodegen/ stable/11/lib/clang/libllvmcore/ stable/11/lib/clang/libllvmdebuginfodwarf/ stable/11/lib/clang/libllvmdebuginfopdb/ stable/11/lib/clang/libllvmexecutionengine/ stable/11/lib/clang/libllvminstcombine/ stable/11/lib/clang/libllvminstrumentation/ stable/11/lib/clang/libllvminterpreter/ stable/11/lib/clang/libllvmipo/ stable/11/lib/clang/libllvmirreader/ stable/11/lib/clang/libllvmlibdriver/ stable/11/lib/clang/libllvmlinker/ stable/11/lib/clang/libllvmlto/ stable/11/lib/clang/libllvmmc/ stable/11/lib/clang/libllvmmcdisassembler/ stable/11/lib/clang/libllvmmcjit/ stable/11/lib/clang/libllvmmcparser/ stable/11/lib/clang/libllvmmipsasmparser/ stable/11/lib/clang/libllvmmipsasmprinter/ stable/11/lib/clang/libllvmmipscodegen/ stable/11/lib/clang/libllvmmipsdesc/ stable/11/lib/clang/libllvmmipsdisassembler/ stable/11/lib/clang/libllvmmipsinfo/ stable/11/lib/clang/libllvmmirparser/ stable/11/lib/clang/libllvmobjcarcopts/ stable/11/lib/clang/libllvmobject/ stable/11/lib/clang/libllvmoption/ stable/11/lib/clang/libllvmorcjit/ stable/11/lib/clang/libllvmpasses/ stable/11/lib/clang/libllvmpowerpcasmparser/ stable/11/lib/clang/libllvmpowerpcasmprinter/ stable/11/lib/clang/libllvmpowerpccodegen/ stable/11/lib/clang/libllvmpowerpcdesc/ stable/11/lib/clang/libllvmpowerpcdisassembler/ stable/11/lib/clang/libllvmpowerpcinfo/ stable/11/lib/clang/libllvmprofiledata/ stable/11/lib/clang/libllvmruntimedyld/ stable/11/lib/clang/libllvmscalaropts/ stable/11/lib/clang/libllvmselectiondag/ stable/11/lib/clang/libllvmsparcasmparser/ stable/11/lib/clang/libllvmsparcasmprinter/ stable/11/lib/clang/libllvmsparccodegen/ stable/11/lib/clang/libllvmsparcdesc/ stable/11/lib/clang/libllvmsparcdisassembler/ stable/11/lib/clang/libllvmsparcinfo/ stable/11/lib/clang/libllvmsupport/ stable/11/lib/clang/libllvmsymbolize/ stable/11/lib/clang/libllvmtablegen/ stable/11/lib/clang/libllvmtarget/ stable/11/lib/clang/libllvmtransformutils/ stable/11/lib/clang/libllvmvectorize/ stable/11/lib/clang/libllvmx86asmparser/ stable/11/lib/clang/libllvmx86asmprinter/ stable/11/lib/clang/libllvmx86codegen/ stable/11/lib/clang/libllvmx86desc/ stable/11/lib/clang/libllvmx86disassembler/ stable/11/lib/clang/libllvmx86info/ stable/11/lib/clang/libllvmx86utils/ stable/11/lib/clang/lldb.lib.mk Modified: stable/11/Makefile.inc1 stable/11/ObsoleteFiles.inc stable/11/UPDATING stable/11/contrib/compiler-rt/LICENSE.TXT stable/11/contrib/compiler-rt/include/sanitizer/allocator_interface.h stable/11/contrib/compiler-rt/include/sanitizer/common_interface_defs.h stable/11/contrib/compiler-rt/include/sanitizer/linux_syscall_hooks.h stable/11/contrib/compiler-rt/lib/asan/asan_activation.cc stable/11/contrib/compiler-rt/lib/asan/asan_allocator.cc stable/11/contrib/compiler-rt/lib/asan/asan_allocator.h stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.cc stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.h stable/11/contrib/compiler-rt/lib/asan/asan_flags.cc stable/11/contrib/compiler-rt/lib/asan/asan_flags.inc stable/11/contrib/compiler-rt/lib/asan/asan_globals.cc stable/11/contrib/compiler-rt/lib/asan/asan_init_version.h stable/11/contrib/compiler-rt/lib/asan/asan_interceptors.cc stable/11/contrib/compiler-rt/lib/asan/asan_interceptors.h stable/11/contrib/compiler-rt/lib/asan/asan_interface_internal.h stable/11/contrib/compiler-rt/lib/asan/asan_internal.h stable/11/contrib/compiler-rt/lib/asan/asan_linux.cc stable/11/contrib/compiler-rt/lib/asan/asan_mac.cc stable/11/contrib/compiler-rt/lib/asan/asan_malloc_linux.cc stable/11/contrib/compiler-rt/lib/asan/asan_malloc_win.cc stable/11/contrib/compiler-rt/lib/asan/asan_mapping.h stable/11/contrib/compiler-rt/lib/asan/asan_new_delete.cc stable/11/contrib/compiler-rt/lib/asan/asan_poisoning.cc stable/11/contrib/compiler-rt/lib/asan/asan_posix.cc stable/11/contrib/compiler-rt/lib/asan/asan_report.cc stable/11/contrib/compiler-rt/lib/asan/asan_report.h stable/11/contrib/compiler-rt/lib/asan/asan_rtl.cc stable/11/contrib/compiler-rt/lib/asan/asan_stack.h stable/11/contrib/compiler-rt/lib/asan/asan_suppressions.cc stable/11/contrib/compiler-rt/lib/asan/asan_thread.cc stable/11/contrib/compiler-rt/lib/asan/asan_thread.h stable/11/contrib/compiler-rt/lib/asan/asan_win.cc stable/11/contrib/compiler-rt/lib/asan/asan_win_dll_thunk.cc stable/11/contrib/compiler-rt/lib/asan/asan_win_dynamic_runtime_thunk.cc stable/11/contrib/compiler-rt/lib/builtins/arm/adddf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/addsf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_dcmp.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_fcmp.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_ldivmod.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_memcmp.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_memcpy.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_memmove.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_memset.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S stable/11/contrib/compiler-rt/lib/builtins/arm/aeabi_uldivmod.S stable/11/contrib/compiler-rt/lib/builtins/arm/bswapdi2.S stable/11/contrib/compiler-rt/lib/builtins/arm/bswapsi2.S stable/11/contrib/compiler-rt/lib/builtins/arm/clzdi2.S stable/11/contrib/compiler-rt/lib/builtins/arm/clzsi2.S stable/11/contrib/compiler-rt/lib/builtins/arm/comparesf2.S stable/11/contrib/compiler-rt/lib/builtins/arm/divdf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/divmodsi4.S stable/11/contrib/compiler-rt/lib/builtins/arm/divsf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/divsi3.S stable/11/contrib/compiler-rt/lib/builtins/arm/eqdf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/eqsf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/extendsfdf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/fixdfsivfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/fixsfsivfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/fixunsdfsivfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/fixunssfsivfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/floatsidfvfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/floatsisfvfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/floatunssidfvfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/floatunssisfvfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/gedf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/gesf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/gtdf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/gtsf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/ledf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/lesf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/ltdf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/ltsf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/modsi3.S stable/11/contrib/compiler-rt/lib/builtins/arm/muldf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/mulsf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/nedf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/negdf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/negsf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/nesf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/restore_vfp_d8_d15_regs.S stable/11/contrib/compiler-rt/lib/builtins/arm/save_vfp_d8_d15_regs.S stable/11/contrib/compiler-rt/lib/builtins/arm/subdf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/subsf3vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/switch16.S stable/11/contrib/compiler-rt/lib/builtins/arm/switch32.S stable/11/contrib/compiler-rt/lib/builtins/arm/switch8.S stable/11/contrib/compiler-rt/lib/builtins/arm/switchu8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_add_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_and_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_and_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_max_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_max_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_min_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_min_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_nand_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_nand_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_or_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_or_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_sub_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_sub_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_umax_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_umax_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_umin_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_umin_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_xor_4.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_fetch_and_xor_8.S stable/11/contrib/compiler-rt/lib/builtins/arm/sync_synchronize.S stable/11/contrib/compiler-rt/lib/builtins/arm/truncdfsf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/udivmodsi4.S stable/11/contrib/compiler-rt/lib/builtins/arm/udivsi3.S stable/11/contrib/compiler-rt/lib/builtins/arm/umodsi3.S stable/11/contrib/compiler-rt/lib/builtins/arm/unorddf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/arm/unordsf2vfp.S stable/11/contrib/compiler-rt/lib/builtins/assembly.h stable/11/contrib/compiler-rt/lib/builtins/clear_cache.c stable/11/contrib/compiler-rt/lib/builtins/emutls.c stable/11/contrib/compiler-rt/lib/builtins/floatdidf.c stable/11/contrib/compiler-rt/lib/builtins/floattidf.c stable/11/contrib/compiler-rt/lib/builtins/floatundidf.c stable/11/contrib/compiler-rt/lib/builtins/floatuntidf.c stable/11/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c stable/11/contrib/compiler-rt/lib/builtins/i386/ashldi3.S stable/11/contrib/compiler-rt/lib/builtins/i386/ashrdi3.S stable/11/contrib/compiler-rt/lib/builtins/i386/divdi3.S stable/11/contrib/compiler-rt/lib/builtins/i386/floatdidf.S stable/11/contrib/compiler-rt/lib/builtins/i386/floatdisf.S stable/11/contrib/compiler-rt/lib/builtins/i386/floatdixf.S stable/11/contrib/compiler-rt/lib/builtins/i386/floatundidf.S stable/11/contrib/compiler-rt/lib/builtins/i386/floatundisf.S stable/11/contrib/compiler-rt/lib/builtins/i386/floatundixf.S stable/11/contrib/compiler-rt/lib/builtins/i386/lshrdi3.S stable/11/contrib/compiler-rt/lib/builtins/i386/moddi3.S stable/11/contrib/compiler-rt/lib/builtins/i386/muldi3.S stable/11/contrib/compiler-rt/lib/builtins/i386/udivdi3.S stable/11/contrib/compiler-rt/lib/builtins/i386/umoddi3.S stable/11/contrib/compiler-rt/lib/builtins/int_lib.h stable/11/contrib/compiler-rt/lib/builtins/ppc/restFP.S stable/11/contrib/compiler-rt/lib/builtins/ppc/saveFP.S stable/11/contrib/compiler-rt/lib/builtins/x86_64/floatundidf.S stable/11/contrib/compiler-rt/lib/builtins/x86_64/floatundisf.S stable/11/contrib/compiler-rt/lib/builtins/x86_64/floatundixf.S stable/11/contrib/compiler-rt/lib/cfi/cfi.cc stable/11/contrib/compiler-rt/lib/dfsan/dfsan.cc stable/11/contrib/compiler-rt/lib/interception/interception_win.cc stable/11/contrib/compiler-rt/lib/interception/interception_win.h stable/11/contrib/compiler-rt/lib/lsan/lsan.cc stable/11/contrib/compiler-rt/lib/lsan/lsan.h stable/11/contrib/compiler-rt/lib/lsan/lsan_allocator.cc stable/11/contrib/compiler-rt/lib/lsan/lsan_common.cc stable/11/contrib/compiler-rt/lib/lsan/lsan_common.h stable/11/contrib/compiler-rt/lib/lsan/lsan_common_linux.cc stable/11/contrib/compiler-rt/lib/lsan/lsan_flags.inc stable/11/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc stable/11/contrib/compiler-rt/lib/lsan/lsan_thread.cc stable/11/contrib/compiler-rt/lib/lsan/lsan_thread.h stable/11/contrib/compiler-rt/lib/msan/msan.cc stable/11/contrib/compiler-rt/lib/msan/msan.h stable/11/contrib/compiler-rt/lib/msan/msan_interceptors.cc stable/11/contrib/compiler-rt/lib/msan/msan_linux.cc stable/11/contrib/compiler-rt/lib/msan/msan_report.cc stable/11/contrib/compiler-rt/lib/profile/GCDAProfiling.c stable/11/contrib/compiler-rt/lib/profile/InstrProfData.inc stable/11/contrib/compiler-rt/lib/profile/InstrProfiling.c stable/11/contrib/compiler-rt/lib/profile/InstrProfiling.h stable/11/contrib/compiler-rt/lib/profile/InstrProfilingBuffer.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingFile.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingInternal.h stable/11/contrib/compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingPlatformOther.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingPort.h stable/11/contrib/compiler-rt/lib/profile/InstrProfilingUtil.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingUtil.h stable/11/contrib/compiler-rt/lib/profile/InstrProfilingValue.c stable/11/contrib/compiler-rt/lib/profile/InstrProfilingWriter.c stable/11/contrib/compiler-rt/lib/profile/WindowsMMap.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_msvc.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_mapping_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector1.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector_interface.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_libc.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_libc.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_list.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_quarantine.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win.cc stable/11/contrib/compiler-rt/lib/tsan/dd/dd_interceptors.cc stable/11/contrib/compiler-rt/lib/tsan/go/test.c stable/11/contrib/compiler-rt/lib/tsan/go/tsan_go.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_defs.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_flags.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_flags.inc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_interface.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_mman.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_mman.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_mutex.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_mutex.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_report.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_report.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_stat.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_stat.h stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.cc stable/11/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.h stable/11/contrib/compiler-rt/lib/ubsan/ubsan_diag.cc stable/11/contrib/compiler-rt/lib/ubsan/ubsan_flags.cc stable/11/contrib/compiler-rt/lib/ubsan/ubsan_handlers.cc stable/11/contrib/compiler-rt/lib/ubsan/ubsan_handlers.h stable/11/contrib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.cc stable/11/contrib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.h stable/11/contrib/compiler-rt/lib/ubsan/ubsan_platform.h stable/11/contrib/compiler-rt/lib/ubsan/ubsan_type_hash.h stable/11/contrib/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc stable/11/contrib/compiler-rt/lib/ubsan/ubsan_value.cc stable/11/contrib/libc++/CREDITS.TXT stable/11/contrib/libc++/LICENSE.TXT stable/11/contrib/libc++/include/__config stable/11/contrib/libc++/include/__functional_base stable/11/contrib/libc++/include/__hash_table stable/11/contrib/libc++/include/__mutex_base stable/11/contrib/libc++/include/__tree stable/11/contrib/libc++/include/__tuple stable/11/contrib/libc++/include/__undef___deallocate stable/11/contrib/libc++/include/__undef_min_max stable/11/contrib/libc++/include/algorithm stable/11/contrib/libc++/include/array stable/11/contrib/libc++/include/atomic stable/11/contrib/libc++/include/bitset stable/11/contrib/libc++/include/cctype stable/11/contrib/libc++/include/cmath stable/11/contrib/libc++/include/complex stable/11/contrib/libc++/include/cstring stable/11/contrib/libc++/include/cwchar stable/11/contrib/libc++/include/deque stable/11/contrib/libc++/include/exception stable/11/contrib/libc++/include/experimental/__config stable/11/contrib/libc++/include/experimental/algorithm stable/11/contrib/libc++/include/experimental/any stable/11/contrib/libc++/include/experimental/dynarray stable/11/contrib/libc++/include/experimental/functional stable/11/contrib/libc++/include/experimental/optional stable/11/contrib/libc++/include/experimental/string_view stable/11/contrib/libc++/include/experimental/tuple stable/11/contrib/libc++/include/ext/hash_map stable/11/contrib/libc++/include/ext/hash_set stable/11/contrib/libc++/include/forward_list stable/11/contrib/libc++/include/fstream stable/11/contrib/libc++/include/functional stable/11/contrib/libc++/include/future stable/11/contrib/libc++/include/iomanip stable/11/contrib/libc++/include/ios stable/11/contrib/libc++/include/iosfwd stable/11/contrib/libc++/include/istream stable/11/contrib/libc++/include/iterator stable/11/contrib/libc++/include/list stable/11/contrib/libc++/include/locale stable/11/contrib/libc++/include/map stable/11/contrib/libc++/include/memory stable/11/contrib/libc++/include/mutex stable/11/contrib/libc++/include/queue stable/11/contrib/libc++/include/shared_mutex stable/11/contrib/libc++/include/stack stable/11/contrib/libc++/include/stdexcept stable/11/contrib/libc++/include/streambuf stable/11/contrib/libc++/include/string stable/11/contrib/libc++/include/thread stable/11/contrib/libc++/include/tuple stable/11/contrib/libc++/include/type_traits stable/11/contrib/libc++/include/unordered_map stable/11/contrib/libc++/include/unordered_set stable/11/contrib/libc++/include/utility stable/11/contrib/libc++/include/vector stable/11/contrib/libc++/include/wchar.h stable/11/contrib/libc++/src/algorithm.cpp stable/11/contrib/libc++/src/bind.cpp stable/11/contrib/libc++/src/condition_variable.cpp stable/11/contrib/libc++/src/locale.cpp stable/11/contrib/libc++/src/memory.cpp stable/11/contrib/libc++/src/mutex.cpp stable/11/contrib/libc++/src/regex.cpp stable/11/contrib/libc++/src/strstream.cpp stable/11/contrib/libc++/src/system_error.cpp stable/11/contrib/libc++/src/thread.cpp stable/11/contrib/llvm/LICENSE.TXT stable/11/contrib/llvm/include/llvm-c/Core.h stable/11/contrib/llvm/include/llvm-c/Disassembler.h stable/11/contrib/llvm/include/llvm-c/ErrorHandling.h stable/11/contrib/llvm/include/llvm-c/Linker.h stable/11/contrib/llvm/include/llvm-c/OrcBindings.h stable/11/contrib/llvm/include/llvm-c/Target.h stable/11/contrib/llvm/include/llvm-c/TargetMachine.h stable/11/contrib/llvm/include/llvm-c/Transforms/Scalar.h stable/11/contrib/llvm/include/llvm-c/Types.h stable/11/contrib/llvm/include/llvm-c/lto.h stable/11/contrib/llvm/include/llvm/ADT/APFloat.h stable/11/contrib/llvm/include/llvm/ADT/APInt.h stable/11/contrib/llvm/include/llvm/ADT/ArrayRef.h stable/11/contrib/llvm/include/llvm/ADT/BitVector.h stable/11/contrib/llvm/include/llvm/ADT/DenseMap.h stable/11/contrib/llvm/include/llvm/ADT/DenseMapInfo.h stable/11/contrib/llvm/include/llvm/ADT/DenseSet.h stable/11/contrib/llvm/include/llvm/ADT/FoldingSet.h stable/11/contrib/llvm/include/llvm/ADT/GraphTraits.h stable/11/contrib/llvm/include/llvm/ADT/Hashing.h stable/11/contrib/llvm/include/llvm/ADT/PointerEmbeddedInt.h stable/11/contrib/llvm/include/llvm/ADT/PostOrderIterator.h stable/11/contrib/llvm/include/llvm/ADT/SCCIterator.h stable/11/contrib/llvm/include/llvm/ADT/STLExtras.h stable/11/contrib/llvm/include/llvm/ADT/SetVector.h stable/11/contrib/llvm/include/llvm/ADT/SmallBitVector.h stable/11/contrib/llvm/include/llvm/ADT/SmallPtrSet.h stable/11/contrib/llvm/include/llvm/ADT/SmallSet.h stable/11/contrib/llvm/include/llvm/ADT/SmallVector.h stable/11/contrib/llvm/include/llvm/ADT/SparseSet.h stable/11/contrib/llvm/include/llvm/ADT/Statistic.h stable/11/contrib/llvm/include/llvm/ADT/StringExtras.h stable/11/contrib/llvm/include/llvm/ADT/StringMap.h stable/11/contrib/llvm/include/llvm/ADT/StringRef.h stable/11/contrib/llvm/include/llvm/ADT/StringSet.h stable/11/contrib/llvm/include/llvm/ADT/TinyPtrVector.h stable/11/contrib/llvm/include/llvm/ADT/Triple.h stable/11/contrib/llvm/include/llvm/ADT/ilist.h stable/11/contrib/llvm/include/llvm/ADT/iterator.h stable/11/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h stable/11/contrib/llvm/include/llvm/Analysis/AssumptionCache.h stable/11/contrib/llvm/include/llvm/Analysis/BasicAliasAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/BlockFrequencyInfo.h stable/11/contrib/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h stable/11/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h stable/11/contrib/llvm/include/llvm/Analysis/CGSCCPassManager.h stable/11/contrib/llvm/include/llvm/Analysis/CallGraph.h stable/11/contrib/llvm/include/llvm/Analysis/CallGraphSCCPass.h stable/11/contrib/llvm/include/llvm/Analysis/CallPrinter.h stable/11/contrib/llvm/include/llvm/Analysis/CodeMetrics.h stable/11/contrib/llvm/include/llvm/Analysis/ConstantFolding.h stable/11/contrib/llvm/include/llvm/Analysis/DemandedBits.h stable/11/contrib/llvm/include/llvm/Analysis/DependenceAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/DominanceFrontier.h stable/11/contrib/llvm/include/llvm/Analysis/EHPersonalities.h stable/11/contrib/llvm/include/llvm/Analysis/GlobalsModRef.h stable/11/contrib/llvm/include/llvm/Analysis/IVUsers.h stable/11/contrib/llvm/include/llvm/Analysis/InlineCost.h stable/11/contrib/llvm/include/llvm/Analysis/InstructionSimplify.h stable/11/contrib/llvm/include/llvm/Analysis/Interval.h stable/11/contrib/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h stable/11/contrib/llvm/include/llvm/Analysis/LazyCallGraph.h stable/11/contrib/llvm/include/llvm/Analysis/LazyValueInfo.h stable/11/contrib/llvm/include/llvm/Analysis/Loads.h stable/11/contrib/llvm/include/llvm/Analysis/LoopAccessAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/LoopInfo.h stable/11/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h stable/11/contrib/llvm/include/llvm/Analysis/LoopPass.h stable/11/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h stable/11/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/MemoryLocation.h stable/11/contrib/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h stable/11/contrib/llvm/include/llvm/Analysis/ObjCARCInstKind.h stable/11/contrib/llvm/include/llvm/Analysis/Passes.h stable/11/contrib/llvm/include/llvm/Analysis/PostDominators.h stable/11/contrib/llvm/include/llvm/Analysis/RegionInfo.h stable/11/contrib/llvm/include/llvm/Analysis/RegionInfoImpl.h stable/11/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h stable/11/contrib/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h stable/11/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h stable/11/contrib/llvm/include/llvm/Analysis/ScopedNoAliasAA.h stable/11/contrib/llvm/include/llvm/Analysis/SparsePropagation.h stable/11/contrib/llvm/include/llvm/Analysis/TargetLibraryInfo.def stable/11/contrib/llvm/include/llvm/Analysis/TargetLibraryInfo.h stable/11/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h stable/11/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h stable/11/contrib/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h stable/11/contrib/llvm/include/llvm/Analysis/ValueTracking.h stable/11/contrib/llvm/include/llvm/Analysis/VectorUtils.h stable/11/contrib/llvm/include/llvm/AsmParser/Parser.h stable/11/contrib/llvm/include/llvm/Bitcode/BitCodes.h stable/11/contrib/llvm/include/llvm/Bitcode/BitcodeWriterPass.h stable/11/contrib/llvm/include/llvm/Bitcode/BitstreamReader.h stable/11/contrib/llvm/include/llvm/Bitcode/BitstreamWriter.h stable/11/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h stable/11/contrib/llvm/include/llvm/Bitcode/ReaderWriter.h stable/11/contrib/llvm/include/llvm/CodeGen/Analysis.h stable/11/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h stable/11/contrib/llvm/include/llvm/CodeGen/BasicTTIImpl.h stable/11/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h stable/11/contrib/llvm/include/llvm/CodeGen/CommandFlags.h stable/11/contrib/llvm/include/llvm/CodeGen/DFAPacketizer.h stable/11/contrib/llvm/include/llvm/CodeGen/DIE.h stable/11/contrib/llvm/include/llvm/CodeGen/DIEValue.def stable/11/contrib/llvm/include/llvm/CodeGen/FastISel.h stable/11/contrib/llvm/include/llvm/CodeGen/FaultMaps.h stable/11/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h stable/11/contrib/llvm/include/llvm/CodeGen/GCMetadata.h stable/11/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h stable/11/contrib/llvm/include/llvm/CodeGen/LiveInterval.h stable/11/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h stable/11/contrib/llvm/include/llvm/CodeGen/LivePhysRegs.h stable/11/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h stable/11/contrib/llvm/include/llvm/CodeGen/LiveVariables.h stable/11/contrib/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h stable/11/contrib/llvm/include/llvm/CodeGen/MIRYamlMapping.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineCombinerPattern.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineDominators.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineFunction.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineFunctionPass.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineInstr.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineInstrBundle.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineMemOperand.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineOperand.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineSSAUpdater.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineTraceMetrics.h stable/11/contrib/llvm/include/llvm/CodeGen/MachineValueType.h stable/11/contrib/llvm/include/llvm/CodeGen/PBQP/Graph.h stable/11/contrib/llvm/include/llvm/CodeGen/ParallelCG.h stable/11/contrib/llvm/include/llvm/CodeGen/Passes.h stable/11/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h stable/11/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h stable/11/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h stable/11/contrib/llvm/include/llvm/CodeGen/RegisterScavenging.h stable/11/contrib/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h stable/11/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.h stable/11/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h stable/11/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h stable/11/contrib/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h stable/11/contrib/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h stable/11/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h stable/11/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h stable/11/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h stable/11/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h stable/11/contrib/llvm/include/llvm/CodeGen/StackMaps.h stable/11/contrib/llvm/include/llvm/CodeGen/StackProtector.h stable/11/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h stable/11/contrib/llvm/include/llvm/CodeGen/ValueTypes.h stable/11/contrib/llvm/include/llvm/CodeGen/ValueTypes.td stable/11/contrib/llvm/include/llvm/CodeGen/WinEHFuncInfo.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeView.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/FieldListRecordBuilder.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/Line.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/ListRecordBuilder.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/MemoryTypeTableBuilder.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeRecordBuilder.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h stable/11/contrib/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h stable/11/contrib/llvm/include/llvm/DebugInfo/DIContext.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h stable/11/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIADataStream.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIASession.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIASourceFile.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/DIA/DIASupport.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDB.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBContext.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h stable/11/contrib/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h stable/11/contrib/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h stable/11/contrib/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h stable/11/contrib/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/GenericValue.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/JITEventListener.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/JITSymbolFlags.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/JITSymbol.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/LambdaResolver.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcError.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/RPCChannel.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/Orc/RPCUtils.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h stable/11/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h stable/11/contrib/llvm/include/llvm/IR/Argument.h stable/11/contrib/llvm/include/llvm/IR/Attributes.h stable/11/contrib/llvm/include/llvm/IR/Attributes.td stable/11/contrib/llvm/include/llvm/IR/AutoUpgrade.h stable/11/contrib/llvm/include/llvm/IR/BasicBlock.h stable/11/contrib/llvm/include/llvm/IR/CFG.h stable/11/contrib/llvm/include/llvm/IR/CallSite.h stable/11/contrib/llvm/include/llvm/IR/CallingConv.h stable/11/contrib/llvm/include/llvm/IR/Comdat.h stable/11/contrib/llvm/include/llvm/IR/Constant.h stable/11/contrib/llvm/include/llvm/IR/ConstantRange.h stable/11/contrib/llvm/include/llvm/IR/Constants.h stable/11/contrib/llvm/include/llvm/IR/DIBuilder.h stable/11/contrib/llvm/include/llvm/IR/DataLayout.h stable/11/contrib/llvm/include/llvm/IR/DebugInfo.h stable/11/contrib/llvm/include/llvm/IR/DebugInfoFlags.def stable/11/contrib/llvm/include/llvm/IR/DebugInfoMetadata.h stable/11/contrib/llvm/include/llvm/IR/DerivedTypes.h stable/11/contrib/llvm/include/llvm/IR/DiagnosticInfo.h stable/11/contrib/llvm/include/llvm/IR/Dominators.h stable/11/contrib/llvm/include/llvm/IR/Function.h stable/11/contrib/llvm/include/llvm/IR/GVMaterializer.h stable/11/contrib/llvm/include/llvm/IR/GetElementPtrTypeIterator.h stable/11/contrib/llvm/include/llvm/IR/GlobalAlias.h stable/11/contrib/llvm/include/llvm/IR/GlobalObject.h stable/11/contrib/llvm/include/llvm/IR/GlobalValue.h stable/11/contrib/llvm/include/llvm/IR/GlobalVariable.h stable/11/contrib/llvm/include/llvm/IR/IRBuilder.h stable/11/contrib/llvm/include/llvm/IR/IRPrintingPasses.h stable/11/contrib/llvm/include/llvm/IR/InlineAsm.h stable/11/contrib/llvm/include/llvm/IR/InstrTypes.h stable/11/contrib/llvm/include/llvm/IR/Instruction.h stable/11/contrib/llvm/include/llvm/IR/Instructions.h stable/11/contrib/llvm/include/llvm/IR/IntrinsicInst.h stable/11/contrib/llvm/include/llvm/IR/Intrinsics.h stable/11/contrib/llvm/include/llvm/IR/Intrinsics.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsAArch64.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsARM.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsHexagon.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsMips.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsNVVM.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsPowerPC.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsSystemZ.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsWebAssembly.td stable/11/contrib/llvm/include/llvm/IR/IntrinsicsX86.td stable/11/contrib/llvm/include/llvm/IR/LLVMContext.h stable/11/contrib/llvm/include/llvm/IR/LegacyPassManagers.h stable/11/contrib/llvm/include/llvm/IR/Mangler.h stable/11/contrib/llvm/include/llvm/IR/Metadata.def stable/11/contrib/llvm/include/llvm/IR/Metadata.h stable/11/contrib/llvm/include/llvm/IR/Module.h stable/11/contrib/llvm/include/llvm/IR/ModuleSlotTracker.h stable/11/contrib/llvm/include/llvm/IR/Operator.h stable/11/contrib/llvm/include/llvm/IR/PassManager.h stable/11/contrib/llvm/include/llvm/IR/PassManagerInternal.h stable/11/contrib/llvm/include/llvm/IR/PatternMatch.h stable/11/contrib/llvm/include/llvm/IR/Statepoint.h stable/11/contrib/llvm/include/llvm/IR/SymbolTableListTraits.h stable/11/contrib/llvm/include/llvm/IR/TrackingMDRef.h stable/11/contrib/llvm/include/llvm/IR/Type.h stable/11/contrib/llvm/include/llvm/IR/TypeFinder.h stable/11/contrib/llvm/include/llvm/IR/Use.h stable/11/contrib/llvm/include/llvm/IR/UseListOrder.h stable/11/contrib/llvm/include/llvm/IR/User.h stable/11/contrib/llvm/include/llvm/IR/Value.def stable/11/contrib/llvm/include/llvm/IR/Value.h stable/11/contrib/llvm/include/llvm/IR/ValueMap.h stable/11/contrib/llvm/include/llvm/IR/ValueSymbolTable.h stable/11/contrib/llvm/include/llvm/IR/Verifier.h stable/11/contrib/llvm/include/llvm/IRReader/IRReader.h stable/11/contrib/llvm/include/llvm/InitializePasses.h stable/11/contrib/llvm/include/llvm/LibDriver/LibDriver.h stable/11/contrib/llvm/include/llvm/LineEditor/LineEditor.h stable/11/contrib/llvm/include/llvm/LinkAllIR.h stable/11/contrib/llvm/include/llvm/LinkAllPasses.h stable/11/contrib/llvm/include/llvm/Linker/IRMover.h stable/11/contrib/llvm/include/llvm/Linker/Linker.h stable/11/contrib/llvm/include/llvm/MC/MCAsmBackend.h stable/11/contrib/llvm/include/llvm/MC/MCAsmInfo.h stable/11/contrib/llvm/include/llvm/MC/MCAsmInfoELF.h stable/11/contrib/llvm/include/llvm/MC/MCAssembler.h stable/11/contrib/llvm/include/llvm/MC/MCContext.h stable/11/contrib/llvm/include/llvm/MC/MCDirectives.h stable/11/contrib/llvm/include/llvm/MC/MCDwarf.h stable/11/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h stable/11/contrib/llvm/include/llvm/MC/MCELFStreamer.h stable/11/contrib/llvm/include/llvm/MC/MCExpr.h stable/11/contrib/llvm/include/llvm/MC/MCFragment.h stable/11/contrib/llvm/include/llvm/MC/MCInstPrinter.h stable/11/contrib/llvm/include/llvm/MC/MCLinkerOptimizationHint.h stable/11/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h stable/11/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h stable/11/contrib/llvm/include/llvm/MC/MCObjectStreamer.h stable/11/contrib/llvm/include/llvm/MC/MCObjectWriter.h stable/11/contrib/llvm/include/llvm/MC/MCParser/AsmLexer.h stable/11/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h stable/11/contrib/llvm/include/llvm/MC/MCRegisterInfo.h stable/11/contrib/llvm/include/llvm/MC/MCSchedule.h stable/11/contrib/llvm/include/llvm/MC/MCSection.h stable/11/contrib/llvm/include/llvm/MC/MCSectionCOFF.h stable/11/contrib/llvm/include/llvm/MC/MCSectionELF.h stable/11/contrib/llvm/include/llvm/MC/MCStreamer.h stable/11/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h stable/11/contrib/llvm/include/llvm/MC/MCSymbol.h stable/11/contrib/llvm/include/llvm/MC/MCSymbolMachO.h stable/11/contrib/llvm/include/llvm/MC/MCTargetOptions.h stable/11/contrib/llvm/include/llvm/MC/MCWin64EH.h stable/11/contrib/llvm/include/llvm/MC/MCWinEH.h stable/11/contrib/llvm/include/llvm/MC/SectionKind.h stable/11/contrib/llvm/include/llvm/MC/StringTableBuilder.h stable/11/contrib/llvm/include/llvm/MC/SubtargetFeature.h stable/11/contrib/llvm/include/llvm/Object/Archive.h stable/11/contrib/llvm/include/llvm/Object/ArchiveWriter.h stable/11/contrib/llvm/include/llvm/Object/Binary.h stable/11/contrib/llvm/include/llvm/Object/COFF.h stable/11/contrib/llvm/include/llvm/Object/ELF.h stable/11/contrib/llvm/include/llvm/Object/ELFObjectFile.h stable/11/contrib/llvm/include/llvm/Object/ELFTypes.h stable/11/contrib/llvm/include/llvm/Object/Error.h stable/11/contrib/llvm/include/llvm/Object/IRObjectFile.h stable/11/contrib/llvm/include/llvm/Object/MachO.h stable/11/contrib/llvm/include/llvm/Object/MachOUniversal.h stable/11/contrib/llvm/include/llvm/Object/ObjectFile.h stable/11/contrib/llvm/include/llvm/Object/RelocVisitor.h stable/11/contrib/llvm/include/llvm/Object/StackMapParser.h stable/11/contrib/llvm/include/llvm/Object/SymbolicFile.h stable/11/contrib/llvm/include/llvm/Option/OptParser.td stable/11/contrib/llvm/include/llvm/Option/Option.h stable/11/contrib/llvm/include/llvm/Pass.h stable/11/contrib/llvm/include/llvm/PassAnalysisSupport.h stable/11/contrib/llvm/include/llvm/PassRegistry.h stable/11/contrib/llvm/include/llvm/PassSupport.h stable/11/contrib/llvm/include/llvm/Passes/PassBuilder.h stable/11/contrib/llvm/include/llvm/ProfileData/InstrProf.h stable/11/contrib/llvm/include/llvm/ProfileData/InstrProfData.inc stable/11/contrib/llvm/include/llvm/ProfileData/InstrProfReader.h stable/11/contrib/llvm/include/llvm/ProfileData/InstrProfWriter.h stable/11/contrib/llvm/include/llvm/ProfileData/SampleProf.h stable/11/contrib/llvm/include/llvm/ProfileData/SampleProfReader.h stable/11/contrib/llvm/include/llvm/ProfileData/SampleProfWriter.h stable/11/contrib/llvm/include/llvm/Support/ARMBuildAttributes.h stable/11/contrib/llvm/include/llvm/Support/ARMTargetParser.def stable/11/contrib/llvm/include/llvm/Support/AlignOf.h stable/11/contrib/llvm/include/llvm/Support/Allocator.h stable/11/contrib/llvm/include/llvm/Support/Atomic.h stable/11/contrib/llvm/include/llvm/Support/BranchProbability.h stable/11/contrib/llvm/include/llvm/Support/COFF.h stable/11/contrib/llvm/include/llvm/Support/CodeGen.h stable/11/contrib/llvm/include/llvm/Support/CommandLine.h stable/11/contrib/llvm/include/llvm/Support/Compiler.h stable/11/contrib/llvm/include/llvm/Support/ConvertUTF.h stable/11/contrib/llvm/include/llvm/Support/CrashRecoveryContext.h stable/11/contrib/llvm/include/llvm/Support/Dwarf.def stable/11/contrib/llvm/include/llvm/Support/Dwarf.h stable/11/contrib/llvm/include/llvm/Support/ELF.h stable/11/contrib/llvm/include/llvm/Support/ELFRelocs/Hexagon.def stable/11/contrib/llvm/include/llvm/Support/ELFRelocs/Mips.def stable/11/contrib/llvm/include/llvm/Support/ELFRelocs/i386.def stable/11/contrib/llvm/include/llvm/Support/ELFRelocs/x86_64.def stable/11/contrib/llvm/include/llvm/Support/Endian.h stable/11/contrib/llvm/include/llvm/Support/EndianStream.h stable/11/contrib/llvm/include/llvm/Support/ErrorHandling.h stable/11/contrib/llvm/include/llvm/Support/ErrorOr.h stable/11/contrib/llvm/include/llvm/Support/FileSystem.h stable/11/contrib/llvm/include/llvm/Support/Format.h stable/11/contrib/llvm/include/llvm/Support/GenericDomTree.h stable/11/contrib/llvm/include/llvm/Support/Host.h stable/11/contrib/llvm/include/llvm/Support/JamCRC.h stable/11/contrib/llvm/include/llvm/Support/Locale.h stable/11/contrib/llvm/include/llvm/Support/LockFileManager.h stable/11/contrib/llvm/include/llvm/Support/MD5.h stable/11/contrib/llvm/include/llvm/Support/MachO.h stable/11/contrib/llvm/include/llvm/Support/ManagedStatic.h stable/11/contrib/llvm/include/llvm/Support/MathExtras.h stable/11/contrib/llvm/include/llvm/Support/OnDiskHashTable.h stable/11/contrib/llvm/include/llvm/Support/Path.h stable/11/contrib/llvm/include/llvm/Support/PointerLikeTypeTraits.h stable/11/contrib/llvm/include/llvm/Support/PrettyStackTrace.h stable/11/contrib/llvm/include/llvm/Support/Printable.h stable/11/contrib/llvm/include/llvm/Support/Process.h stable/11/contrib/llvm/include/llvm/Support/Program.h stable/11/contrib/llvm/include/llvm/Support/RandomNumberGenerator.h stable/11/contrib/llvm/include/llvm/Support/Registry.h stable/11/contrib/llvm/include/llvm/Support/ScaledNumber.h stable/11/contrib/llvm/include/llvm/Support/Signals.h stable/11/contrib/llvm/include/llvm/Support/StreamingMemoryObject.h stable/11/contrib/llvm/include/llvm/Support/SwapByteOrder.h stable/11/contrib/llvm/include/llvm/Support/TargetParser.h stable/11/contrib/llvm/include/llvm/Support/TargetRegistry.h stable/11/contrib/llvm/include/llvm/Support/Threading.h stable/11/contrib/llvm/include/llvm/Support/Timer.h stable/11/contrib/llvm/include/llvm/Support/TrailingObjects.h stable/11/contrib/llvm/include/llvm/Support/Unicode.h stable/11/contrib/llvm/include/llvm/Support/Valgrind.h stable/11/contrib/llvm/include/llvm/Support/YAMLParser.h stable/11/contrib/llvm/include/llvm/Support/YAMLTraits.h stable/11/contrib/llvm/include/llvm/Support/thread.h stable/11/contrib/llvm/include/llvm/Support/type_traits.h stable/11/contrib/llvm/include/llvm/TableGen/Record.h stable/11/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h stable/11/contrib/llvm/include/llvm/Target/Target.td stable/11/contrib/llvm/include/llvm/Target/TargetCallingConv.h stable/11/contrib/llvm/include/llvm/Target/TargetCallingConv.td stable/11/contrib/llvm/include/llvm/Target/TargetFrameLowering.h stable/11/contrib/llvm/include/llvm/Target/TargetInstrInfo.h stable/11/contrib/llvm/include/llvm/Target/TargetLowering.h stable/11/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h stable/11/contrib/llvm/include/llvm/Target/TargetMachine.h stable/11/contrib/llvm/include/llvm/Target/TargetOpcodes.h stable/11/contrib/llvm/include/llvm/Target/TargetOptions.h stable/11/contrib/llvm/include/llvm/Target/TargetRecip.h stable/11/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h stable/11/contrib/llvm/include/llvm/Target/TargetSchedule.td stable/11/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td stable/11/contrib/llvm/include/llvm/Target/TargetSubtargetInfo.h stable/11/contrib/llvm/include/llvm/Transforms/IPO.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/FunctionImport.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/InlinerPass.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h stable/11/contrib/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h stable/11/contrib/llvm/include/llvm/Transforms/InstCombine/InstCombine.h stable/11/contrib/llvm/include/llvm/Transforms/InstCombine/InstCombineWorklist.h stable/11/contrib/llvm/include/llvm/Transforms/Instrumentation.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/ADCE.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/SROA.h stable/11/contrib/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/CodeExtractor.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/Local.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/LoopVersioning.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/ModuleUtils.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/SplitModule.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/UnrollLoop.h stable/11/contrib/llvm/include/llvm/Transforms/Utils/ValueMapper.h stable/11/contrib/llvm/include/llvm/Transforms/Vectorize.h stable/11/contrib/llvm/include/llvm/module.modulemap stable/11/contrib/llvm/lib/Analysis/AliasAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp stable/11/contrib/llvm/lib/Analysis/AliasSetTracker.cpp stable/11/contrib/llvm/lib/Analysis/Analysis.cpp stable/11/contrib/llvm/lib/Analysis/AssumptionCache.cpp stable/11/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/BlockFrequencyInfo.cpp stable/11/contrib/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp stable/11/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp stable/11/contrib/llvm/lib/Analysis/CFG.cpp stable/11/contrib/llvm/lib/Analysis/CGSCCPassManager.cpp stable/11/contrib/llvm/lib/Analysis/CallGraph.cpp stable/11/contrib/llvm/lib/Analysis/CallGraphSCCPass.cpp stable/11/contrib/llvm/lib/Analysis/CallPrinter.cpp stable/11/contrib/llvm/lib/Analysis/CaptureTracking.cpp stable/11/contrib/llvm/lib/Analysis/CodeMetrics.cpp stable/11/contrib/llvm/lib/Analysis/ConstantFolding.cpp stable/11/contrib/llvm/lib/Analysis/CostModel.cpp stable/11/contrib/llvm/lib/Analysis/Delinearization.cpp stable/11/contrib/llvm/lib/Analysis/DemandedBits.cpp stable/11/contrib/llvm/lib/Analysis/DependenceAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/DivergenceAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/DomPrinter.cpp stable/11/contrib/llvm/lib/Analysis/DominanceFrontier.cpp stable/11/contrib/llvm/lib/Analysis/EHPersonalities.cpp stable/11/contrib/llvm/lib/Analysis/GlobalsModRef.cpp stable/11/contrib/llvm/lib/Analysis/IVUsers.cpp stable/11/contrib/llvm/lib/Analysis/InlineCost.cpp stable/11/contrib/llvm/lib/Analysis/InstructionSimplify.cpp stable/11/contrib/llvm/lib/Analysis/Interval.cpp stable/11/contrib/llvm/lib/Analysis/IntervalPartition.cpp stable/11/contrib/llvm/lib/Analysis/IteratedDominanceFrontier.cpp stable/11/contrib/llvm/lib/Analysis/LazyCallGraph.cpp stable/11/contrib/llvm/lib/Analysis/LazyValueInfo.cpp stable/11/contrib/llvm/lib/Analysis/Lint.cpp stable/11/contrib/llvm/lib/Analysis/Loads.cpp stable/11/contrib/llvm/lib/Analysis/LoopAccessAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/LoopInfo.cpp stable/11/contrib/llvm/lib/Analysis/LoopPass.cpp stable/11/contrib/llvm/lib/Analysis/MemDepPrinter.cpp stable/11/contrib/llvm/lib/Analysis/MemDerefPrinter.cpp stable/11/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp stable/11/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/MemoryLocation.cpp stable/11/contrib/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/ObjCARCInstKind.cpp stable/11/contrib/llvm/lib/Analysis/PHITransAddr.cpp stable/11/contrib/llvm/lib/Analysis/PostDominators.cpp stable/11/contrib/llvm/lib/Analysis/RegionInfo.cpp stable/11/contrib/llvm/lib/Analysis/RegionPrinter.cpp stable/11/contrib/llvm/lib/Analysis/ScalarEvolution.cpp stable/11/contrib/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp stable/11/contrib/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp stable/11/contrib/llvm/lib/Analysis/ScopedNoAliasAA.cpp stable/11/contrib/llvm/lib/Analysis/SparsePropagation.cpp stable/11/contrib/llvm/lib/Analysis/StratifiedSets.h stable/11/contrib/llvm/lib/Analysis/TargetLibraryInfo.cpp stable/11/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp stable/11/contrib/llvm/lib/Analysis/Trace.cpp stable/11/contrib/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp stable/11/contrib/llvm/lib/Analysis/ValueTracking.cpp stable/11/contrib/llvm/lib/Analysis/VectorUtils.cpp stable/11/contrib/llvm/lib/AsmParser/LLLexer.cpp stable/11/contrib/llvm/lib/AsmParser/LLParser.cpp stable/11/contrib/llvm/lib/AsmParser/LLParser.h stable/11/contrib/llvm/lib/AsmParser/LLToken.h stable/11/contrib/llvm/lib/AsmParser/Parser.cpp stable/11/contrib/llvm/lib/Bitcode/Reader/BitReader.cpp stable/11/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp stable/11/contrib/llvm/lib/Bitcode/Reader/BitstreamReader.cpp stable/11/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp stable/11/contrib/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp stable/11/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp stable/11/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h stable/11/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp stable/11/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h stable/11/contrib/llvm/lib/CodeGen/Analysis.cpp stable/11/contrib/llvm/lib/CodeGen/AntiDepBreaker.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/AddressPool.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterHandler.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/ByteStreamer.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/EHStreamer.h stable/11/contrib/llvm/lib/CodeGen/AsmPrinter/WinException.cpp stable/11/contrib/llvm/lib/CodeGen/AtomicExpandPass.cpp stable/11/contrib/llvm/lib/CodeGen/BranchFolding.cpp stable/11/contrib/llvm/lib/CodeGen/BranchFolding.h stable/11/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp stable/11/contrib/llvm/lib/CodeGen/CallingConvLower.cpp stable/11/contrib/llvm/lib/CodeGen/CodeGen.cpp stable/11/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp stable/11/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp stable/11/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h stable/11/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp stable/11/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp stable/11/contrib/llvm/lib/CodeGen/EarlyIfConversion.cpp stable/11/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp stable/11/contrib/llvm/lib/CodeGen/ExpandISelPseudos.cpp stable/11/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp stable/11/contrib/llvm/lib/CodeGen/FuncletLayout.cpp stable/11/contrib/llvm/lib/CodeGen/GCRootLowering.cpp stable/11/contrib/llvm/lib/CodeGen/GlobalMerge.cpp stable/11/contrib/llvm/lib/CodeGen/IfConversion.cpp stable/11/contrib/llvm/lib/CodeGen/ImplicitNullChecks.cpp stable/11/contrib/llvm/lib/CodeGen/InlineSpiller.cpp stable/11/contrib/llvm/lib/CodeGen/InterleavedAccessPass.cpp stable/11/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp stable/11/contrib/llvm/lib/CodeGen/LexicalScopes.cpp stable/11/contrib/llvm/lib/CodeGen/LiveDebugValues.cpp stable/11/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp stable/11/contrib/llvm/lib/CodeGen/LiveDebugVariables.h stable/11/contrib/llvm/lib/CodeGen/LiveInterval.cpp stable/11/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp stable/11/contrib/llvm/lib/CodeGen/LivePhysRegs.cpp stable/11/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp stable/11/contrib/llvm/lib/CodeGen/LiveRangeCalc.h stable/11/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp stable/11/contrib/llvm/lib/CodeGen/LiveStackAnalysis.cpp stable/11/contrib/llvm/lib/CodeGen/LiveVariables.cpp stable/11/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp stable/11/contrib/llvm/lib/CodeGen/MIRParser/MILexer.cpp stable/11/contrib/llvm/lib/CodeGen/MIRParser/MILexer.h stable/11/contrib/llvm/lib/CodeGen/MIRParser/MIParser.cpp stable/11/contrib/llvm/lib/CodeGen/MIRParser/MIParser.h stable/11/contrib/llvm/lib/CodeGen/MIRParser/MIRParser.cpp stable/11/contrib/llvm/lib/CodeGen/MIRPrinter.cpp stable/11/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp stable/11/contrib/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp stable/11/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp stable/11/contrib/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp stable/11/contrib/llvm/lib/CodeGen/MachineCSE.cpp stable/11/contrib/llvm/lib/CodeGen/MachineCombiner.cpp stable/11/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp stable/11/contrib/llvm/lib/CodeGen/MachineDominators.cpp stable/11/contrib/llvm/lib/CodeGen/MachineFunction.cpp stable/11/contrib/llvm/lib/CodeGen/MachineFunctionPass.cpp stable/11/contrib/llvm/lib/CodeGen/MachineInstr.cpp stable/11/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp stable/11/contrib/llvm/lib/CodeGen/MachineLICM.cpp stable/11/contrib/llvm/lib/CodeGen/MachineLoopInfo.cpp stable/11/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp stable/11/contrib/llvm/lib/CodeGen/MachineRegionInfo.cpp stable/11/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp stable/11/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp stable/11/contrib/llvm/lib/CodeGen/MachineScheduler.cpp stable/11/contrib/llvm/lib/CodeGen/MachineSink.cpp stable/11/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp stable/11/contrib/llvm/lib/CodeGen/MachineVerifier.cpp stable/11/contrib/llvm/lib/CodeGen/OptimizePHIs.cpp stable/11/contrib/llvm/lib/CodeGen/PHIElimination.cpp stable/11/contrib/llvm/lib/CodeGen/ParallelCG.cpp stable/11/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp stable/11/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp stable/11/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp stable/11/contrib/llvm/lib/CodeGen/PseudoSourceValue.cpp stable/11/contrib/llvm/lib/CodeGen/RegAllocBase.cpp stable/11/contrib/llvm/lib/CodeGen/RegAllocBase.h stable/11/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp stable/11/contrib/llvm/lib/CodeGen/RegAllocFast.cpp stable/11/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp stable/11/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp stable/11/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp stable/11/contrib/llvm/lib/CodeGen/RegisterPressure.cpp stable/11/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp stable/11/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp stable/11/contrib/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp stable/11/contrib/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp stable/11/contrib/llvm/lib/CodeGen/ShadowStackGCLowering.cpp stable/11/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp stable/11/contrib/llvm/lib/CodeGen/SlotIndexes.cpp stable/11/contrib/llvm/lib/CodeGen/SpillPlacement.cpp stable/11/contrib/llvm/lib/CodeGen/SpillPlacement.h stable/11/contrib/llvm/lib/CodeGen/Spiller.h stable/11/contrib/llvm/lib/CodeGen/SplitKit.cpp stable/11/contrib/llvm/lib/CodeGen/SplitKit.h stable/11/contrib/llvm/lib/CodeGen/StackColoring.cpp stable/11/contrib/llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp stable/11/contrib/llvm/lib/CodeGen/StackMaps.cpp stable/11/contrib/llvm/lib/CodeGen/StackProtector.cpp stable/11/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp stable/11/contrib/llvm/lib/CodeGen/TailDuplication.cpp stable/11/contrib/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp stable/11/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp stable/11/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp stable/11/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp stable/11/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp stable/11/contrib/llvm/lib/CodeGen/TargetSchedule.cpp stable/11/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp stable/11/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp stable/11/contrib/llvm/lib/CodeGen/VirtRegMap.cpp stable/11/contrib/llvm/lib/CodeGen/WinEHPrepare.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/FieldListRecordBuilder.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/ListRecordBuilder.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/MemoryTypeTableBuilder.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/MethodListRecordBuilder.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/TypeRecordBuilder.cpp stable/11/contrib/llvm/lib/DebugInfo/CodeView/TypeTableBuilder.cpp stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIADataStream.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAEnumDebugStreams.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAEnumLineNumbers.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAEnumSourceFiles.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIAEnumSymbols.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIALineNumber.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/DIA/DIASourceFile.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/IPDBSourceFile.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDB.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBContext.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBExtras.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBInterfaceAnchors.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymDumper.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolBlock.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolCompilandDetails.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolCustom.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolLabel.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolThunk.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolUnknown.cpp stable/11/contrib/llvm/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp stable/11/contrib/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp stable/11/contrib/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp stable/11/contrib/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp stable/11/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp stable/11/contrib/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp stable/11/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp stable/11/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp stable/11/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h stable/11/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp stable/11/contrib/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcCBindings.cpp stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcError.cpp stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h stable/11/contrib/llvm/lib/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h stable/11/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h stable/11/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp stable/11/contrib/llvm/lib/IR/AsmWriter.cpp stable/11/contrib/llvm/lib/IR/AttributeImpl.h stable/11/contrib/llvm/lib/IR/Attributes.cpp stable/11/contrib/llvm/lib/IR/AutoUpgrade.cpp stable/11/contrib/llvm/lib/IR/BasicBlock.cpp stable/11/contrib/llvm/lib/IR/Comdat.cpp stable/11/contrib/llvm/lib/IR/ConstantFold.cpp stable/11/contrib/llvm/lib/IR/ConstantFold.h stable/11/contrib/llvm/lib/IR/ConstantRange.cpp stable/11/contrib/llvm/lib/IR/Constants.cpp stable/11/contrib/llvm/lib/IR/ConstantsContext.h stable/11/contrib/llvm/lib/IR/Core.cpp stable/11/contrib/llvm/lib/IR/DIBuilder.cpp stable/11/contrib/llvm/lib/IR/DataLayout.cpp stable/11/contrib/llvm/lib/IR/DebugInfo.cpp stable/11/contrib/llvm/lib/IR/DebugInfoMetadata.cpp stable/11/contrib/llvm/lib/IR/DebugLoc.cpp stable/11/contrib/llvm/lib/IR/DiagnosticInfo.cpp stable/11/contrib/llvm/lib/IR/Dominators.cpp stable/11/contrib/llvm/lib/IR/Function.cpp stable/11/contrib/llvm/lib/IR/GCOV.cpp stable/11/contrib/llvm/lib/IR/Globals.cpp stable/11/contrib/llvm/lib/IR/IRBuilder.cpp stable/11/contrib/llvm/lib/IR/IRPrintingPasses.cpp stable/11/contrib/llvm/lib/IR/InlineAsm.cpp stable/11/contrib/llvm/lib/IR/Instruction.cpp stable/11/contrib/llvm/lib/IR/Instructions.cpp stable/11/contrib/llvm/lib/IR/IntrinsicInst.cpp stable/11/contrib/llvm/lib/IR/LLVMContext.cpp stable/11/contrib/llvm/lib/IR/LLVMContextImpl.cpp stable/11/contrib/llvm/lib/IR/LLVMContextImpl.h stable/11/contrib/llvm/lib/IR/LegacyPassManager.cpp stable/11/contrib/llvm/lib/IR/MDBuilder.cpp stable/11/contrib/llvm/lib/IR/Mangler.cpp stable/11/contrib/llvm/lib/IR/Metadata.cpp stable/11/contrib/llvm/lib/IR/Module.cpp stable/11/contrib/llvm/lib/IR/Operator.cpp stable/11/contrib/llvm/lib/IR/Pass.cpp stable/11/contrib/llvm/lib/IR/PassManager.cpp stable/11/contrib/llvm/lib/IR/PassRegistry.cpp stable/11/contrib/llvm/lib/IR/Statepoint.cpp stable/11/contrib/llvm/lib/IR/Type.cpp stable/11/contrib/llvm/lib/IR/TypeFinder.cpp stable/11/contrib/llvm/lib/IR/Value.cpp stable/11/contrib/llvm/lib/IR/ValueSymbolTable.cpp stable/11/contrib/llvm/lib/IR/ValueTypes.cpp stable/11/contrib/llvm/lib/IR/Verifier.cpp stable/11/contrib/llvm/lib/LTO/LTOCodeGenerator.cpp stable/11/contrib/llvm/lib/LTO/LTOModule.cpp stable/11/contrib/llvm/lib/LibDriver/LibDriver.cpp stable/11/contrib/llvm/lib/LineEditor/LineEditor.cpp stable/11/contrib/llvm/lib/Linker/IRMover.cpp stable/11/contrib/llvm/lib/Linker/LinkModules.cpp stable/11/contrib/llvm/lib/MC/ConstantPools.cpp stable/11/contrib/llvm/lib/MC/ELFObjectWriter.cpp stable/11/contrib/llvm/lib/MC/MCAsmBackend.cpp stable/11/contrib/llvm/lib/MC/MCAsmInfo.cpp stable/11/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp stable/11/contrib/llvm/lib/MC/MCAsmInfoELF.cpp stable/11/contrib/llvm/lib/MC/MCAsmStreamer.cpp stable/11/contrib/llvm/lib/MC/MCAssembler.cpp stable/11/contrib/llvm/lib/MC/MCContext.cpp stable/11/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp stable/11/contrib/llvm/lib/MC/MCDisassembler/Disassembler.h stable/11/contrib/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp stable/11/contrib/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp stable/11/contrib/llvm/lib/MC/MCDisassembler/MCRelocationInfo.cpp stable/11/contrib/llvm/lib/MC/MCDwarf.cpp stable/11/contrib/llvm/lib/MC/MCELFStreamer.cpp stable/11/contrib/llvm/lib/MC/MCExpr.cpp stable/11/contrib/llvm/lib/MC/MCFragment.cpp stable/11/contrib/llvm/lib/MC/MCInst.cpp stable/11/contrib/llvm/lib/MC/MCLabel.cpp stable/11/contrib/llvm/lib/MC/MCLinkerOptimizationHint.cpp stable/11/contrib/llvm/lib/MC/MCMachOStreamer.cpp stable/11/contrib/llvm/lib/MC/MCObjectFileInfo.cpp stable/11/contrib/llvm/lib/MC/MCObjectStreamer.cpp stable/11/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp stable/11/contrib/llvm/lib/MC/MCParser/AsmParser.cpp stable/11/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp stable/11/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp stable/11/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp stable/11/contrib/llvm/lib/MC/MCParser/MCAsmLexer.cpp stable/11/contrib/llvm/lib/MC/MCParser/MCAsmParser.cpp stable/11/contrib/llvm/lib/MC/MCParser/MCTargetAsmParser.cpp stable/11/contrib/llvm/lib/MC/MCRegisterInfo.cpp stable/11/contrib/llvm/lib/MC/MCSection.cpp stable/11/contrib/llvm/lib/MC/MCStreamer.cpp stable/11/contrib/llvm/lib/MC/MCSymbol.cpp stable/11/contrib/llvm/lib/MC/MCValue.cpp stable/11/contrib/llvm/lib/MC/MCWin64EH.cpp stable/11/contrib/llvm/lib/MC/MCWinEH.cpp stable/11/contrib/llvm/lib/MC/MachObjectWriter.cpp stable/11/contrib/llvm/lib/MC/StringTableBuilder.cpp stable/11/contrib/llvm/lib/MC/SubtargetFeature.cpp stable/11/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp stable/11/contrib/llvm/lib/MC/WinCOFFStreamer.cpp stable/11/contrib/llvm/lib/Object/Archive.cpp stable/11/contrib/llvm/lib/Object/ArchiveWriter.cpp stable/11/contrib/llvm/lib/Object/Binary.cpp stable/11/contrib/llvm/lib/Object/COFFObjectFile.cpp stable/11/contrib/llvm/lib/Object/ELF.cpp stable/11/contrib/llvm/lib/Object/ELFObjectFile.cpp stable/11/contrib/llvm/lib/Object/Error.cpp stable/11/contrib/llvm/lib/Object/IRObjectFile.cpp stable/11/contrib/llvm/lib/Object/MachOObjectFile.cpp stable/11/contrib/llvm/lib/Object/MachOUniversal.cpp stable/11/contrib/llvm/lib/Object/Object.cpp stable/11/contrib/llvm/lib/Object/ObjectFile.cpp stable/11/contrib/llvm/lib/Object/RecordStreamer.cpp stable/11/contrib/llvm/lib/Object/RecordStreamer.h stable/11/contrib/llvm/lib/Object/SymbolicFile.cpp stable/11/contrib/llvm/lib/Option/OptTable.cpp stable/11/contrib/llvm/lib/Option/Option.cpp stable/11/contrib/llvm/lib/Passes/PassBuilder.cpp stable/11/contrib/llvm/lib/Passes/PassRegistry.def stable/11/contrib/llvm/lib/ProfileData/InstrProf.cpp stable/11/contrib/llvm/lib/ProfileData/InstrProfReader.cpp stable/11/contrib/llvm/lib/ProfileData/InstrProfWriter.cpp stable/11/contrib/llvm/lib/ProfileData/SampleProf.cpp stable/11/contrib/llvm/lib/ProfileData/SampleProfReader.cpp stable/11/contrib/llvm/lib/ProfileData/SampleProfWriter.cpp stable/11/contrib/llvm/lib/Support/APFloat.cpp stable/11/contrib/llvm/lib/Support/APInt.cpp stable/11/contrib/llvm/lib/Support/APSInt.cpp stable/11/contrib/llvm/lib/Support/ARMBuildAttrs.cpp stable/11/contrib/llvm/lib/Support/Atomic.cpp stable/11/contrib/llvm/lib/Support/BranchProbability.cpp stable/11/contrib/llvm/lib/Support/CommandLine.cpp stable/11/contrib/llvm/lib/Support/ConvertUTFWrapper.cpp stable/11/contrib/llvm/lib/Support/CrashRecoveryContext.cpp stable/11/contrib/llvm/lib/Support/Dwarf.cpp stable/11/contrib/llvm/lib/Support/ErrorHandling.cpp stable/11/contrib/llvm/lib/Support/FileUtilities.cpp stable/11/contrib/llvm/lib/Support/FoldingSet.cpp stable/11/contrib/llvm/lib/Support/Host.cpp stable/11/contrib/llvm/lib/Support/IntEqClasses.cpp stable/11/contrib/llvm/lib/Support/JamCRC.cpp stable/11/contrib/llvm/lib/Support/Locale.cpp stable/11/contrib/llvm/lib/Support/LockFileManager.cpp stable/11/contrib/llvm/lib/Support/ManagedStatic.cpp stable/11/contrib/llvm/lib/Support/MemoryBuffer.cpp stable/11/contrib/llvm/lib/Support/Path.cpp stable/11/contrib/llvm/lib/Support/PrettyStackTrace.cpp stable/11/contrib/llvm/lib/Support/Process.cpp stable/11/contrib/llvm/lib/Support/ScaledNumber.cpp stable/11/contrib/llvm/lib/Support/Signals.cpp stable/11/contrib/llvm/lib/Support/SmallPtrSet.cpp stable/11/contrib/llvm/lib/Support/SpecialCaseList.cpp stable/11/contrib/llvm/lib/Support/Statistic.cpp stable/11/contrib/llvm/lib/Support/StreamingMemoryObject.cpp stable/11/contrib/llvm/lib/Support/StringMap.cpp stable/11/contrib/llvm/lib/Support/StringRef.cpp stable/11/contrib/llvm/lib/Support/TargetParser.cpp stable/11/contrib/llvm/lib/Support/TargetRegistry.cpp stable/11/contrib/llvm/lib/Support/ThreadPool.cpp stable/11/contrib/llvm/lib/Support/Threading.cpp stable/11/contrib/llvm/lib/Support/Timer.cpp stable/11/contrib/llvm/lib/Support/Triple.cpp stable/11/contrib/llvm/lib/Support/Twine.cpp stable/11/contrib/llvm/lib/Support/Unix/Memory.inc stable/11/contrib/llvm/lib/Support/Unix/Path.inc stable/11/contrib/llvm/lib/Support/Unix/Process.inc stable/11/contrib/llvm/lib/Support/Unix/Signals.inc stable/11/contrib/llvm/lib/Support/Windows/DynamicLibrary.inc stable/11/contrib/llvm/lib/Support/Windows/Path.inc stable/11/contrib/llvm/lib/Support/Windows/Process.inc stable/11/contrib/llvm/lib/Support/Windows/Signals.inc stable/11/contrib/llvm/lib/Support/Windows/WindowsSupport.h stable/11/contrib/llvm/lib/Support/YAMLParser.cpp stable/11/contrib/llvm/lib/Support/YAMLTraits.cpp stable/11/contrib/llvm/lib/Support/raw_ostream.cpp stable/11/contrib/llvm/lib/TableGen/Record.cpp stable/11/contrib/llvm/lib/TableGen/SetTheory.cpp stable/11/contrib/llvm/lib/TableGen/TGParser.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64A53Fix835769.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64AddressTypePromotion.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64BranchRelaxation.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64CallingConvention.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64FastISel.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64InstrAtomics.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64InstrFormats.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64PromoteConstant.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedA53.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedA57.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedCyclone.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedM1.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64Schedule.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64StorePairSuppress.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64TargetMachine.h stable/11/contrib/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h stable/11/contrib/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp stable/11/contrib/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp stable/11/contrib/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.h stable/11/contrib/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp stable/11/contrib/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.h stable/11/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp stable/11/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.h stable/11/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h stable/11/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp stable/11/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h stable/11/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp stable/11/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPU.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPU.td stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUCallingConv.td stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUIntrinsics.td stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUOpenCLImageTypeLoweringPass.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/AMDKernelCodeT.h stable/11/contrib/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/CIInstructions.td stable/11/contrib/llvm/lib/Target/AMDGPU/CaymanInstructions.td stable/11/contrib/llvm/lib/Target/AMDGPU/EvergreenInstructions.td stable/11/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.h stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUFixupKinds.h stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCCodeEmitter.h stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/Processors.td stable/11/contrib/llvm/lib/Target/AMDGPU/R600ClauseMergePass.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600Defines.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600ExpandSpecialInstrs.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600InstrInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600Instructions.td stable/11/contrib/llvm/lib/Target/AMDGPU/R600Intrinsics.td stable/11/contrib/llvm/lib/Target/AMDGPU/R600MachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600MachineScheduler.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600MachineScheduler.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600Packetizer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600RegisterInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/R600RegisterInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/R600Schedule.td stable/11/contrib/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIDefines.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIFrameLowering.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIInsertWaits.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIInstrFormats.td stable/11/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.td stable/11/contrib/llvm/lib/Target/AMDGPU/SIInstructions.td stable/11/contrib/llvm/lib/Target/AMDGPU/SIIntrinsics.td stable/11/contrib/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SILowerI1Copies.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIMachineScheduler.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.td stable/11/contrib/llvm/lib/Target/AMDGPU/SISchedule.td stable/11/contrib/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/SITypeRewriter.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h stable/11/contrib/llvm/lib/Target/AMDGPU/VIInstrFormats.td stable/11/contrib/llvm/lib/Target/AMDGPU/VIInstructions.td stable/11/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp stable/11/contrib/llvm/lib/Target/ARM/ARM.h stable/11/contrib/llvm/lib/Target/ARM/ARM.td stable/11/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h stable/11/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h stable/11/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h stable/11/contrib/llvm/lib/Target/ARM/ARMCallingConv.h stable/11/contrib/llvm/lib/Target/ARM/ARMCallingConv.td stable/11/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.h stable/11/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h stable/11/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMISelLowering.h stable/11/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td stable/11/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMInstrInfo.h stable/11/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td stable/11/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td stable/11/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td stable/11/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td stable/11/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMMCInstLower.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/ARM/ARMOptimizeBarriersPass.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMSchedule.td stable/11/contrib/llvm/lib/Target/ARM/ARMScheduleA8.td stable/11/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td stable/11/contrib/llvm/lib/Target/ARM/ARMScheduleSwift.td stable/11/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMSubtarget.h stable/11/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMTargetMachine.h stable/11/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.h stable/11/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.h stable/11/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp stable/11/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp stable/11/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp stable/11/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAddressingModes.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendDarwin.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendELF.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendWinCOFF.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp stable/11/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp stable/11/contrib/llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp stable/11/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.h stable/11/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.h stable/11/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp stable/11/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.h stable/11/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp stable/11/contrib/llvm/lib/Target/ARM/ThumbRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/ARM/ThumbRegisterInfo.h stable/11/contrib/llvm/lib/Target/AVR/AVR.h stable/11/contrib/llvm/lib/Target/AVR/AVR.td stable/11/contrib/llvm/lib/Target/AVR/AVRMachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/AVR/AVRSelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/AVR/AVRTargetMachine.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRTargetObjectFile.h stable/11/contrib/llvm/lib/Target/BPF/BPFAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/BPF/BPFFrameLowering.h stable/11/contrib/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp stable/11/contrib/llvm/lib/Target/BPF/BPFISelLowering.h stable/11/contrib/llvm/lib/Target/BPF/BPFInstrInfo.cpp stable/11/contrib/llvm/lib/Target/BPF/BPFInstrInfo.h stable/11/contrib/llvm/lib/Target/BPF/BPFMCInstLower.cpp stable/11/contrib/llvm/lib/Target/BPF/BPFSubtarget.h stable/11/contrib/llvm/lib/Target/BPF/BPFTargetMachine.cpp stable/11/contrib/llvm/lib/Target/BPF/BPFTargetMachine.h stable/11/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp stable/11/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h stable/11/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp stable/11/contrib/llvm/lib/Target/Hexagon/BitTracker.cpp stable/11/contrib/llvm/lib/Target/Hexagon/BitTracker.h stable/11/contrib/llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp stable/11/contrib/llvm/lib/Target/Hexagon/Hexagon.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonBitSimplify.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonBitTracker.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonFixupHwLoops.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonGenExtract.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonGenMux.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonGenPredicate.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrAlias.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV4.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV3.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV60.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoVector.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsics.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsV4.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsV5.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsV60.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonOperands.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonPeephole.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonRDF.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV4.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV55.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV60.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonSelectionDAGInfo.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonSelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonSplitConst32AndConst64.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonSplitDouble.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonStoreWidening.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonSystemInst.td stable/11/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h stable/11/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp stable/11/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.h stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonFixupKinds.h stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.h stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.h stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCDuplexInfo.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCExpr.h stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp stable/11/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/Hexagon/RDFCopy.cpp stable/11/contrib/llvm/lib/Target/Hexagon/RDFCopy.h stable/11/contrib/llvm/lib/Target/Hexagon/RDFDeadCode.cpp stable/11/contrib/llvm/lib/Target/Hexagon/RDFDeadCode.h stable/11/contrib/llvm/lib/Target/Hexagon/RDFGraph.cpp stable/11/contrib/llvm/lib/Target/Hexagon/RDFGraph.h stable/11/contrib/llvm/lib/Target/Hexagon/RDFLiveness.cpp stable/11/contrib/llvm/lib/Target/Hexagon/RDFLiveness.h stable/11/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp stable/11/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.cpp stable/11/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.h stable/11/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp stable/11/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h stable/11/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp stable/11/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h stable/11/contrib/llvm/lib/Target/MSP430/MSP430Subtarget.h stable/11/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp stable/11/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.h stable/11/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp stable/11/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp stable/11/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp stable/11/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsBaseInfo.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp stable/11/contrib/llvm/lib/Target/Mips/MicroMips32r6InstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MicroMips64r6InstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/MicroMips64r6InstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MicroMipsDSPInstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MicroMipsInstrFPU.td stable/11/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/Mips.h stable/11/contrib/llvm/lib/Target/Mips/Mips.td stable/11/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/Mips16HardFloat.cpp stable/11/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h stable/11/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h stable/11/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h stable/11/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/Mips32r6InstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/Mips32r6InstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/Mips64r6InstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.h stable/11/contrib/llvm/lib/Target/Mips/MipsCCState.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsCallingConv.td stable/11/contrib/llvm/lib/Target/Mips/MipsCondMov.td stable/11/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsDSPInstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsEVAInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsFastISel.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h stable/11/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.h stable/11/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsISelLowering.h stable/11/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td stable/11/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td stable/11/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h stable/11/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsMCInstLower.h stable/11/contrib/llvm/lib/Target/Mips/MipsMSAInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h stable/11/contrib/llvm/lib/Target/Mips/MipsOs16.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h stable/11/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.h stable/11/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h stable/11/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.h stable/11/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSchedule.td stable/11/contrib/llvm/lib/Target/Mips/MipsScheduleP5600.td stable/11/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSubtarget.h stable/11/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h stable/11/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.h stable/11/contrib/llvm/lib/Target/Mips/MipsTargetStreamer.h stable/11/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp stable/11/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTX.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTX.td stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXImageOptimizer.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXLowerKernelArgs.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXPeephole.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXSection.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp stable/11/contrib/llvm/lib/Target/NVPTX/NVPTXUtilities.h stable/11/contrib/llvm/lib/Target/NVPTX/NVVMReflect.cpp stable/11/contrib/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp stable/11/contrib/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp stable/11/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp stable/11/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h stable/11/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp stable/11/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPC.h stable/11/contrib/llvm/lib/Target/PowerPC/PPC.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCCallingConv.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCEarlyReturn.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstrVSX.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCSchedule.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCSchedule440.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCScheduleA2.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCScheduleE500mc.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCScheduleE5500.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCScheduleG5.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCScheduleP7.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCScheduleP8.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCTOCRegDeps.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h stable/11/contrib/llvm/lib/Target/PowerPC/PPCVSXCopy.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp stable/11/contrib/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp stable/11/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp stable/11/contrib/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp stable/11/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp stable/11/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp stable/11/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/Sparc/Sparc.h stable/11/contrib/llvm/lib/Target/Sparc/Sparc.td stable/11/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h stable/11/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h stable/11/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td stable/11/contrib/llvm/lib/Target/Sparc/SparcInstrAliases.td stable/11/contrib/llvm/lib/Target/Sparc/SparcInstrFormats.td stable/11/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.h stable/11/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td stable/11/contrib/llvm/lib/Target/Sparc/SparcMCInstLower.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h stable/11/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td stable/11/contrib/llvm/lib/Target/Sparc/SparcSubtarget.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h stable/11/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h stable/11/contrib/llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp stable/11/contrib/llvm/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp stable/11/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp stable/11/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp stable/11/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/SystemZ/README.txt stable/11/contrib/llvm/lib/Target/SystemZ/SystemZ.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZCallingConv.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZCallingConv.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZCallingConv.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZInstrBuilder.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZInstrFP.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZInstrFormats.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZOperands.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZOperators.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZProcessors.td stable/11/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.h stable/11/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp stable/11/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.h stable/11/contrib/llvm/lib/Target/Target.cpp stable/11/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp stable/11/contrib/llvm/lib/Target/TargetMachine.cpp stable/11/contrib/llvm/lib/Target/TargetMachineC.cpp stable/11/contrib/llvm/lib/Target/TargetRecip.cpp stable/11/contrib/llvm/lib/Target/TargetSubtargetInfo.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h stable/11/contrib/llvm/lib/Target/WebAssembly/README.txt stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssembly.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISD.def stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrFloat.td stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrInteger.td stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyPeephole.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h stable/11/contrib/llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt stable/11/contrib/llvm/lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp stable/11/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp stable/11/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParserCommon.h stable/11/contrib/llvm/lib/Target/X86/AsmParser/X86Operand.h stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h stable/11/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp stable/11/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86FixupKinds.h stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp stable/11/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp stable/11/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp stable/11/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h stable/11/contrib/llvm/lib/Target/X86/X86.h stable/11/contrib/llvm/lib/Target/X86/X86.td stable/11/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp stable/11/contrib/llvm/lib/Target/X86/X86AsmPrinter.h stable/11/contrib/llvm/lib/Target/X86/X86CallFrameOptimization.cpp stable/11/contrib/llvm/lib/Target/X86/X86CallingConv.td stable/11/contrib/llvm/lib/Target/X86/X86ExpandPseudo.cpp stable/11/contrib/llvm/lib/Target/X86/X86FastISel.cpp stable/11/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp stable/11/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp stable/11/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp stable/11/contrib/llvm/lib/Target/X86/X86FrameLowering.h stable/11/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.h stable/11/contrib/llvm/lib/Target/X86/X86InstrAVX512.td stable/11/contrib/llvm/lib/Target/X86/X86InstrBuilder.h stable/11/contrib/llvm/lib/Target/X86/X86InstrCompiler.td stable/11/contrib/llvm/lib/Target/X86/X86InstrControl.td stable/11/contrib/llvm/lib/Target/X86/X86InstrFPStack.td stable/11/contrib/llvm/lib/Target/X86/X86InstrFormats.td stable/11/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.h stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.td stable/11/contrib/llvm/lib/Target/X86/X86InstrMMX.td stable/11/contrib/llvm/lib/Target/X86/X86InstrMPX.td stable/11/contrib/llvm/lib/Target/X86/X86InstrSSE.td stable/11/contrib/llvm/lib/Target/X86/X86InstrSystem.td stable/11/contrib/llvm/lib/Target/X86/X86InstrVMX.td stable/11/contrib/llvm/lib/Target/X86/X86InstrXOP.td stable/11/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h stable/11/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp stable/11/contrib/llvm/lib/Target/X86/X86MachineFunctionInfo.h stable/11/contrib/llvm/lib/Target/X86/X86OptimizeLEAs.cpp stable/11/contrib/llvm/lib/Target/X86/X86PadShortFunction.cpp stable/11/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp stable/11/contrib/llvm/lib/Target/X86/X86RegisterInfo.td stable/11/contrib/llvm/lib/Target/X86/X86Schedule.td stable/11/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td stable/11/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp stable/11/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp stable/11/contrib/llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.h stable/11/contrib/llvm/lib/Target/X86/X86Subtarget.cpp stable/11/contrib/llvm/lib/Target/X86/X86Subtarget.h stable/11/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp stable/11/contrib/llvm/lib/Target/X86/X86TargetMachine.h stable/11/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp stable/11/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h stable/11/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp stable/11/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.h stable/11/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp stable/11/contrib/llvm/lib/Target/X86/X86WinEHState.cpp stable/11/contrib/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp stable/11/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.h stable/11/contrib/llvm/lib/Target/XCore/XCoreFrameToArgsOffsetElim.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h stable/11/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.h stable/11/contrib/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreSelectionDAGInfo.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreSelectionDAGInfo.h stable/11/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.h stable/11/contrib/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp stable/11/contrib/llvm/lib/Target/XCore/XCoreTargetObjectFile.h stable/11/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp stable/11/contrib/llvm/lib/Transforms/IPO/ConstantMerge.cpp stable/11/contrib/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp stable/11/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp stable/11/contrib/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp stable/11/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp stable/11/contrib/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp stable/11/contrib/llvm/lib/Transforms/IPO/FunctionAttrs.cpp stable/11/contrib/llvm/lib/Transforms/IPO/FunctionImport.cpp stable/11/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp stable/11/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp stable/11/contrib/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp stable/11/contrib/llvm/lib/Transforms/IPO/IPO.cpp stable/11/contrib/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp stable/11/contrib/llvm/lib/Transforms/IPO/InlineAlways.cpp stable/11/contrib/llvm/lib/Transforms/IPO/InlineSimple.cpp stable/11/contrib/llvm/lib/Transforms/IPO/Inliner.cpp stable/11/contrib/llvm/lib/Transforms/IPO/Internalize.cpp stable/11/contrib/llvm/lib/Transforms/IPO/LoopExtractor.cpp stable/11/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp stable/11/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp stable/11/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp stable/11/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp stable/11/contrib/llvm/lib/Transforms/IPO/SampleProfile.cpp stable/11/contrib/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp stable/11/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineInternal.h stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp stable/11/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/CFGMST.h stable/11/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp stable/11/contrib/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp stable/11/contrib/llvm/lib/Transforms/ObjCARC/BlotMapVector.h stable/11/contrib/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.h stable/11/contrib/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp stable/11/contrib/llvm/lib/Transforms/ObjCARC/ObjCARC.h stable/11/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp stable/11/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp stable/11/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp stable/11/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/BDCE.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/ConstantProp.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/DCE.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/Float2Int.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/GVN.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LICM.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoadCombine.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopDistribute.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopInterchange.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/NaryReassociate.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/Reg2Mem.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/SROA.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/Scalarizer.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/Sink.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp stable/11/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp stable/11/contrib/llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp stable/11/contrib/llvm/lib/Transforms/Utils/AddDiscriminators.cpp stable/11/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp stable/11/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp stable/11/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp stable/11/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp stable/11/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp stable/11/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp stable/11/contrib/llvm/lib/Transforms/Utils/GlobalStatus.cpp stable/11/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp stable/11/contrib/llvm/lib/Transforms/Utils/InstructionNamer.cpp stable/11/contrib/llvm/lib/Transforms/Utils/IntegerDivision.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp stable/11/contrib/llvm/lib/Transforms/Utils/Local.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LoopVersioning.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp stable/11/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp stable/11/contrib/llvm/lib/Transforms/Utils/Mem2Reg.cpp stable/11/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp stable/11/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp stable/11/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp stable/11/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp stable/11/contrib/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp stable/11/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp stable/11/contrib/llvm/lib/Transforms/Utils/SplitModule.cpp stable/11/contrib/llvm/lib/Transforms/Utils/SymbolRewriter.cpp stable/11/contrib/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp stable/11/contrib/llvm/lib/Transforms/Utils/Utils.cpp stable/11/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp stable/11/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp stable/11/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp stable/11/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp stable/11/contrib/llvm/lib/Transforms/Vectorize/Vectorize.cpp stable/11/contrib/llvm/tools/bugpoint/BugDriver.h stable/11/contrib/llvm/tools/bugpoint/CrashDebugger.cpp stable/11/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp stable/11/contrib/llvm/tools/bugpoint/ExtractFunction.cpp stable/11/contrib/llvm/tools/bugpoint/Miscompilation.cpp stable/11/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp stable/11/contrib/llvm/tools/bugpoint/ToolRunner.cpp stable/11/contrib/llvm/tools/bugpoint/bugpoint.cpp stable/11/contrib/llvm/tools/clang/LICENSE.TXT stable/11/contrib/llvm/tools/clang/include/clang-c/Index.h stable/11/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMTActions.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ASTConsumer.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ASTMutationListener.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h stable/11/contrib/llvm/tools/clang/include/clang/AST/Attr.h stable/11/contrib/llvm/tools/clang/include/clang/AST/BaseSubobject.h stable/11/contrib/llvm/tools/clang/include/clang/AST/BuiltinTypes.def stable/11/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h stable/11/contrib/llvm/tools/clang/include/clang/AST/CharUnits.h stable/11/contrib/llvm/tools/clang/include/clang/AST/Decl.h stable/11/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h stable/11/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h stable/11/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h stable/11/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h stable/11/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h stable/11/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h stable/11/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h stable/11/contrib/llvm/tools/clang/include/clang/AST/Expr.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ExprOpenMP.h stable/11/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h stable/11/contrib/llvm/tools/clang/include/clang/AST/GlobalDecl.h stable/11/contrib/llvm/tools/clang/include/clang/AST/LambdaCapture.h stable/11/contrib/llvm/tools/clang/include/clang/AST/Mangle.h stable/11/contrib/llvm/tools/clang/include/clang/AST/OpenMPClause.h stable/11/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h stable/11/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h stable/11/contrib/llvm/tools/clang/include/clang/AST/RecordLayout.h stable/11/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h stable/11/contrib/llvm/tools/clang/include/clang/AST/Stmt.h stable/11/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h stable/11/contrib/llvm/tools/clang/include/clang/AST/StmtGraphTraits.h stable/11/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h stable/11/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h stable/11/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h stable/11/contrib/llvm/tools/clang/include/clang/AST/TemplateName.h stable/11/contrib/llvm/tools/clang/include/clang/AST/Type.h stable/11/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h stable/11/contrib/llvm/tools/clang/include/clang/AST/UnresolvedSet.h stable/11/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchFinder.h stable/11/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h stable/11/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h stable/11/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Dominators.h stable/11/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h stable/11/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h stable/11/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h stable/11/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/AddressSpaces.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/Attr.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAMDGPU.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsHexagon.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsNVPTX.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsPPC.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsSystemZ.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsWebAssembly.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticASTKinds.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/Lambda.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/OpenCLExtensions.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td stable/11/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def stable/11/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/VersionTuple.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/VirtualFileSystem.h stable/11/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td stable/11/contrib/llvm/tools/clang/include/clang/CodeGen/BackendUtil.h stable/11/contrib/llvm/tools/clang/include/clang/CodeGen/CGFunctionInfo.h stable/11/contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenABITypes.h stable/11/contrib/llvm/tools/clang/include/clang/CodeGen/ModuleBuilder.h stable/11/contrib/llvm/tools/clang/include/clang/CodeGen/ObjectFilePCHContainerOperations.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/Action.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td stable/11/contrib/llvm/tools/clang/include/clang/Driver/CLCompatOptions.td stable/11/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/Driver.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/Job.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/Multilib.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/Options.td stable/11/contrib/llvm/tools/clang/include/clang/Driver/SanitizerArgs.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h stable/11/contrib/llvm/tools/clang/include/clang/Driver/Types.def stable/11/contrib/llvm/tools/clang/include/clang/Format/Format.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/ASTConsumers.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.def stable/11/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/DependencyOutputOptions.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def stable/11/contrib/llvm/tools/clang/include/clang/Frontend/MultiplexConsumer.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/PCHContainerOperations.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticPrinter.h stable/11/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h stable/11/contrib/llvm/tools/clang/include/clang/Index/USRGeneration.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/DirectoryLookup.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/HeaderMap.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/MacroArgs.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h stable/11/contrib/llvm/tools/clang/include/clang/Lex/Token.h stable/11/contrib/llvm/tools/clang/include/clang/Parse/Parser.h stable/11/contrib/llvm/tools/clang/include/clang/Rewrite/Frontend/ASTConsumers.h stable/11/contrib/llvm/tools/clang/include/clang/Rewrite/Frontend/FrontendActions.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/MultiplexExternalSemaSource.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/ObjCMethodList.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/Overload.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/Ownership.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/Scope.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/Sema.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/SemaInternal.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/SemaLambda.h stable/11/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h stable/11/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h stable/11/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h stable/11/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h stable/11/contrib/llvm/tools/clang/include/clang/Serialization/Module.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h stable/11/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h stable/11/contrib/llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h stable/11/contrib/llvm/tools/clang/include/clang/Tooling/Core/Replacement.h stable/11/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring.h stable/11/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h stable/11/contrib/llvm/tools/clang/include/clang/module.modulemap stable/11/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp stable/11/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMTActions.cpp stable/11/contrib/llvm/tools/clang/lib/ARCMigrate/ObjCMT.cpp stable/11/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp stable/11/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ASTConsumer.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ASTTypeTraits.cpp stable/11/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp stable/11/contrib/llvm/tools/clang/lib/AST/Comment.cpp stable/11/contrib/llvm/tools/clang/lib/AST/CommentLexer.cpp stable/11/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp stable/11/contrib/llvm/tools/clang/lib/AST/Decl.cpp stable/11/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp stable/11/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp stable/11/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp stable/11/contrib/llvm/tools/clang/lib/AST/DeclOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp stable/11/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp stable/11/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp stable/11/contrib/llvm/tools/clang/lib/AST/Expr.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp stable/11/contrib/llvm/tools/clang/lib/AST/Mangle.cpp stable/11/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp stable/11/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp stable/11/contrib/llvm/tools/clang/lib/AST/NSAPI.cpp stable/11/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp stable/11/contrib/llvm/tools/clang/lib/AST/OpenMPClause.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ParentMap.cpp stable/11/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp stable/11/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp stable/11/contrib/llvm/tools/clang/lib/AST/Stmt.cpp stable/11/contrib/llvm/tools/clang/lib/AST/StmtCXX.cpp stable/11/contrib/llvm/tools/clang/lib/AST/StmtOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp stable/11/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp stable/11/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp stable/11/contrib/llvm/tools/clang/lib/AST/TemplateName.cpp stable/11/contrib/llvm/tools/clang/lib/AST/Type.cpp stable/11/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp stable/11/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp stable/11/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp stable/11/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp stable/11/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchersInternal.cpp stable/11/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/Marshallers.h stable/11/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/Registry.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.h stable/11/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/CallGraph.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/FormatStringParsing.h stable/11/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/PseudoConstantAnalysis.cpp stable/11/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/LangOptions.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Module.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/VirtualFileSystem.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGBuilder.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCUDANV.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCUDARuntime.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGLoopInfo.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGLoopInfo.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGOpenCLRuntime.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenABITypes.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenPGO.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenPGO.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/EHScopeStack.h stable/11/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h stable/11/contrib/llvm/tools/clang/lib/Driver/Action.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/CrossWindowsToolChain.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/Driver.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/Job.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/MSVCToolChain.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains.h stable/11/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/Tools.h stable/11/contrib/llvm/tools/clang/lib/Driver/Types.cpp stable/11/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.cpp stable/11/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.h stable/11/contrib/llvm/tools/clang/lib/Format/Encoding.h stable/11/contrib/llvm/tools/clang/lib/Format/Format.cpp stable/11/contrib/llvm/tools/clang/lib/Format/FormatToken.cpp stable/11/contrib/llvm/tools/clang/lib/Format/FormatToken.h stable/11/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp stable/11/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.h stable/11/contrib/llvm/tools/clang/lib/Format/UnwrappedLineFormatter.cpp stable/11/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp stable/11/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h stable/11/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp stable/11/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h stable/11/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/ChainedIncludesSource.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/LayoutOverrideSource.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/ModuleDependencyCollector.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/MultiplexConsumer.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/PCHContainerOperations.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/Rewrite/FrontendActions.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/Rewrite/HTMLPrint.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/Rewrite/InclusionRewriter.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/Rewrite/RewriteObjC.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/TestModuleFileExtension.cpp stable/11/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp stable/11/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp stable/11/contrib/llvm/tools/clang/lib/Headers/__clang_cuda_runtime_wrapper.h stable/11/contrib/llvm/tools/clang/lib/Headers/__wmmintrin_aes.h stable/11/contrib/llvm/tools/clang/lib/Headers/__wmmintrin_pclmul.h stable/11/contrib/llvm/tools/clang/lib/Headers/altivec.h stable/11/contrib/llvm/tools/clang/lib/Headers/ammintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/arm_acle.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512bwintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512cdintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512dqintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512erintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512vlbwintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512vldqintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avx512vlintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/avxintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/bmiintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/cpuid.h stable/11/contrib/llvm/tools/clang/lib/Headers/cuda_builtin_vars.h stable/11/contrib/llvm/tools/clang/lib/Headers/emmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/f16cintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/float.h stable/11/contrib/llvm/tools/clang/lib/Headers/fma4intrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/fmaintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/htmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/htmxlintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/ia32intrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/immintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/inttypes.h stable/11/contrib/llvm/tools/clang/lib/Headers/mm3dnow.h stable/11/contrib/llvm/tools/clang/lib/Headers/mmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/module.modulemap stable/11/contrib/llvm/tools/clang/lib/Headers/pkuintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/pmmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/popcntintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/smmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/tbmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/tmmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/unwind.h stable/11/contrib/llvm/tools/clang/lib/Headers/x86intrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h stable/11/contrib/llvm/tools/clang/lib/Headers/xopintrin.h stable/11/contrib/llvm/tools/clang/lib/Index/CommentToXML.cpp stable/11/contrib/llvm/tools/clang/lib/Index/USRGeneration.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/HeaderMap.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/ModuleMap.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/PPCaching.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp stable/11/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseInit.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseStmtAsm.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp stable/11/contrib/llvm/tools/clang/lib/Parse/Parser.cpp stable/11/contrib/llvm/tools/clang/lib/Rewrite/HTMLRewrite.cpp stable/11/contrib/llvm/tools/clang/lib/Rewrite/RewriteRope.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/Scope.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/Sema.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaCUDA.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaCoroutine.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaStmtAttr.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h stable/11/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.h stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/GeneratePCH.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/Module.cpp stable/11/contrib/llvm/tools/clang/lib/Serialization/ModuleManager.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ClangCheckers.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ClangSACheckers.h stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerRegistry.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/IssueHash.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SVals.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp stable/11/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp stable/11/contrib/llvm/tools/clang/lib/Tooling/CommonOptionsParser.cpp stable/11/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp stable/11/contrib/llvm/tools/clang/lib/Tooling/Core/Replacement.cpp stable/11/contrib/llvm/tools/clang/lib/Tooling/Refactoring.cpp stable/11/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp stable/11/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp stable/11/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp stable/11/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp stable/11/contrib/llvm/tools/clang/tools/driver/driver.cpp stable/11/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp stable/11/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp stable/11/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp stable/11/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp stable/11/contrib/llvm/tools/llc/llc.cpp stable/11/contrib/llvm/tools/lld/COFF/CMakeLists.txt stable/11/contrib/llvm/tools/lld/ELF/InputFiles.cpp stable/11/contrib/llvm/tools/lldb/include/lldb/API/LLDB.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBCommandReturnObject.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBDefines.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBExpressionOptions.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBFileSpec.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBHostOS.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBInstruction.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBLaunchInfo.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBListener.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBStream.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBStringList.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBThreadCollection.h stable/11/contrib/llvm/tools/lldb/include/lldb/API/SBValue.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolver.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverName.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSite.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSiteList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Breakpoint/WatchpointList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Broadcaster.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Communication.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ConstString.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/DataExtractor.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/EmulateInstruction.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Event.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/History.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/IOHandler.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Listener.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Logging.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/MappedHash.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Module.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ModuleList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ModuleSpec.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/RangeMap.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/RegisterValue.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Scalar.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/SearchFilter.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Section.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/StreamCallback.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/StreamTee.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ThreadSafeSTLMap.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ThreadSafeValue.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Timer.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/UserSettingsController.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/Value.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ValueObject.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectConstResult.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectConstResultCast.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectConstResultChild.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectConstResultImpl.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectDynamicValue.h stable/11/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatCache.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatManager.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormattersContainer.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormattersHelpers.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategory.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategoryMap.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeSynthetic.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h stable/11/contrib/llvm/tools/lldb/include/lldb/DataFormatters/VectorIterator.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/DWARFExpression.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/ExpressionParser.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/ExpressionSourceCode.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/ExpressionVariable.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/FunctionCaller.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/IRDynamicChecks.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/IRInterpreter.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/IRMemoryMap.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/LLVMUserExpression.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/UserExpression.h stable/11/contrib/llvm/tools/lldb/include/lldb/Expression/UtilityFunction.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/Editline.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/File.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/FileSpec.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/FileSystem.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/Host.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/HostInfoBase.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/HostNativeProcessBase.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/HostProcess.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/OptionParser.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/ProcessRunLock.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/common/NativeBreakpointList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/common/NativeProcessProtocol.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/posix/HostInfoPosix.h stable/11/contrib/llvm/tools/lldb/include/lldb/Host/posix/HostProcessPosix.h stable/11/contrib/llvm/tools/lldb/include/lldb/Initialization/SystemLifetimeManager.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/Args.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandHistory.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandInterpreter.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandObject.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandObjectMultiword.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h stable/11/contrib/llvm/tools/lldb/include/lldb/Interpreter/ScriptInterpreter.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/ArmUnwindInfo.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/Block.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangASTContext.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangASTImporter.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/CompactUnwindInfo.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/CompileUnit.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/CompilerDecl.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/CompilerDeclContext.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/CompilerType.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/FuncUnwinders.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/Function.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/GoASTContext.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/LineEntry.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/ObjectFile.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/Symbol.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/SymbolContext.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/SymbolFile.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/SymbolVendor.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/Symtab.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/Type.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/TypeSystem.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/UnwindPlan.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/UnwindTable.h stable/11/contrib/llvm/tools/lldb/include/lldb/Symbol/Variable.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ABI.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/DynamicLoader.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ExecutionContext.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/InstrumentationRuntime.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/JITLoaderList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/Language.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/LanguageRuntime.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/Memory.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/MemoryRegionInfo.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/PathMappingList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/Process.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ProcessLaunchInfo.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/QueueList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/RegisterContext.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/SectionLoadHistory.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/SectionLoadList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/StackFrame.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/StackFrameList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/Target.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/TargetList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/Thread.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ThreadCollection.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ThreadList.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlan.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanPython.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanStepInstruction.h stable/11/contrib/llvm/tools/lldb/include/lldb/Target/Unwind.h stable/11/contrib/llvm/tools/lldb/include/lldb/Utility/Iterable.h stable/11/contrib/llvm/tools/lldb/include/lldb/Utility/ProcessStructReader.h stable/11/contrib/llvm/tools/lldb/include/lldb/Utility/SharedCluster.h stable/11/contrib/llvm/tools/lldb/include/lldb/lldb-enumerations.h stable/11/contrib/llvm/tools/lldb/include/lldb/lldb-forward.h stable/11/contrib/llvm/tools/lldb/include/lldb/lldb-private-enumerations.h stable/11/contrib/llvm/tools/lldb/include/lldb/lldb-private-interfaces.h stable/11/contrib/llvm/tools/lldb/include/lldb/lldb-private-types.h stable/11/contrib/llvm/tools/lldb/include/lldb/lldb-private.h stable/11/contrib/llvm/tools/lldb/source/API/SBAddress.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBBlock.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBBreakpoint.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBBreakpointLocation.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBBroadcaster.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBCommandInterpreter.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBCommandReturnObject.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBExpressionOptions.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBFrame.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBFunction.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBHostOS.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBInstruction.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBInstructionList.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBListener.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBModule.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBProcess.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBStringList.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBSymbol.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBTarget.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBThread.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBValue.cpp stable/11/contrib/llvm/tools/lldb/source/API/SBWatchpoint.cpp stable/11/contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp stable/11/contrib/llvm/tools/lldb/source/API/liblldb.exports stable/11/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationCollection.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolver.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverAddress.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp stable/11/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointList.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandCompletions.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectApropos.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectArgs.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectBugreport.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectCommands.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectDisassemble.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectDisassemble.h stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.h stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectFrame.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectHelp.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectHelp.h stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectLanguage.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectLanguage.h stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectLog.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectMemory.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectMultiword.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlugin.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectQuit.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectRegister.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectSource.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectSyntax.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectThread.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectType.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectVersion.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectWatchpoint.cpp stable/11/contrib/llvm/tools/lldb/source/Commands/CommandObjectWatchpointCommand.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Address.cpp stable/11/contrib/llvm/tools/lldb/source/Core/AddressRange.cpp stable/11/contrib/llvm/tools/lldb/source/Core/AddressResolverName.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Broadcaster.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Communication.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ConnectionSharedMemory.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ConstString.cpp stable/11/contrib/llvm/tools/lldb/source/Core/CxaDemangle.cpp stable/11/contrib/llvm/tools/lldb/source/Core/DataBufferHeap.cpp stable/11/contrib/llvm/tools/lldb/source/Core/DataBufferMemoryMap.cpp stable/11/contrib/llvm/tools/lldb/source/Core/DataEncoder.cpp stable/11/contrib/llvm/tools/lldb/source/Core/DataExtractor.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Debugger.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Disassembler.cpp stable/11/contrib/llvm/tools/lldb/source/Core/DynamicLoader.cpp stable/11/contrib/llvm/tools/lldb/source/Core/EmulateInstruction.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Error.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Event.cpp stable/11/contrib/llvm/tools/lldb/source/Core/FastDemangle.cpp stable/11/contrib/llvm/tools/lldb/source/Core/FileSpecList.cpp stable/11/contrib/llvm/tools/lldb/source/Core/FormatEntity.cpp stable/11/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Listener.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Log.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Logging.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Mangled.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Module.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ModuleList.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Opcode.cpp stable/11/contrib/llvm/tools/lldb/source/Core/PluginManager.cpp stable/11/contrib/llvm/tools/lldb/source/Core/RegisterValue.cpp stable/11/contrib/llvm/tools/lldb/source/Core/RegularExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Scalar.cpp stable/11/contrib/llvm/tools/lldb/source/Core/SearchFilter.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Section.cpp stable/11/contrib/llvm/tools/lldb/source/Core/StreamCallback.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Timer.cpp stable/11/contrib/llvm/tools/lldb/source/Core/UserSettingsController.cpp stable/11/contrib/llvm/tools/lldb/source/Core/Value.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObject.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObjectConstResult.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObjectConstResultCast.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObjectConstResultChild.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObjectConstResultImpl.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObjectDynamicValue.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObjectSyntheticFilter.cpp stable/11/contrib/llvm/tools/lldb/source/Core/ValueObjectVariable.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/DumpValueObjectOptions.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/FormatCache.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/FormatManager.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/FormattersHelpers.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/StringPrinter.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/TypeCategory.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/TypeCategoryMap.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/TypeFormat.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/TypeSummary.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/TypeSynthetic.cpp stable/11/contrib/llvm/tools/lldb/source/DataFormatters/ValueObjectPrinter.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/DWARFExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/ExpressionSourceCode.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/ExpressionVariable.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/FunctionCaller.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/IRDynamicChecks.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/IRInterpreter.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/IRMemoryMap.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/LLVMUserExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/Materializer.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/REPL.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/UserExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Expression/UtilityFunction.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/Editline.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/File.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/Host.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/HostInfoBase.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/HostProcess.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/MonitoringProcessLauncher.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/NativeBreakpointList.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/NativeProcessProtocol.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/OptionParser.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/Socket.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/SocketAddress.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/SoftwareBreakpoint.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/TCPSocket.cpp stable/11/contrib/llvm/tools/lldb/source/Host/common/UDPSocket.cpp stable/11/contrib/llvm/tools/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp stable/11/contrib/llvm/tools/lldb/source/Host/posix/DomainSocket.cpp stable/11/contrib/llvm/tools/lldb/source/Host/posix/FileSystem.cpp stable/11/contrib/llvm/tools/lldb/source/Host/posix/HostInfoPosix.cpp stable/11/contrib/llvm/tools/lldb/source/Host/posix/HostProcessPosix.cpp stable/11/contrib/llvm/tools/lldb/source/Host/posix/HostThreadPosix.cpp stable/11/contrib/llvm/tools/lldb/source/Initialization/SystemInitializerCommon.cpp stable/11/contrib/llvm/tools/lldb/source/Initialization/SystemLifetimeManager.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/Args.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/CommandHistory.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/CommandObjectScript.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/OptionValueArray.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpecLIst.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/OptionValuePathMappings.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/OptionValueProperties.cpp stable/11/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h stable/11/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h stable/11/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h stable/11/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Go/GoAST.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h stable/11/contrib/llvm/tools/lldb/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/CF.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/Cocoa.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/Cocoa.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSArray.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSError.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSException.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/NSSet.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h stable/11/contrib/llvm/tools/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryUnwind.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_arm.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_mips.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_mips64.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_powerpc.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h stable/11/contrib/llvm/tools/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h stable/11/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp stable/11/contrib/llvm/tools/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/ArmUnwindInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/Block.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/ClangASTImporter.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/ClangExternalASTSourceCommon.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/CompactUnwindInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/CompileUnit.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/CompilerDecl.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/CompilerDeclContext.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/CompilerType.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/DWARFCallFrameInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/FuncUnwinders.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/Function.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/GoASTContext.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/LineEntry.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/LineTable.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/ObjectFile.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/Symbol.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/SymbolContext.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/SymbolFile.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/SymbolVendor.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/Symtab.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/Type.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/TypeSystem.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/UnwindTable.cpp stable/11/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ABI.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ExecutionContext.cpp stable/11/contrib/llvm/tools/lldb/source/Target/InstrumentationRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Target/JITLoader.cpp stable/11/contrib/llvm/tools/lldb/source/Target/JITLoaderList.cpp stable/11/contrib/llvm/tools/lldb/source/Target/Language.cpp stable/11/contrib/llvm/tools/lldb/source/Target/LanguageRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Target/Memory.cpp stable/11/contrib/llvm/tools/lldb/source/Target/MemoryHistory.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ObjCLanguageRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Target/OperatingSystem.cpp stable/11/contrib/llvm/tools/lldb/source/Target/PathMappingList.cpp stable/11/contrib/llvm/tools/lldb/source/Target/Platform.cpp stable/11/contrib/llvm/tools/lldb/source/Target/Process.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ProcessInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ProcessLaunchInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Target/Queue.cpp stable/11/contrib/llvm/tools/lldb/source/Target/QueueList.cpp stable/11/contrib/llvm/tools/lldb/source/Target/RegisterContext.cpp stable/11/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp stable/11/contrib/llvm/tools/lldb/source/Target/SectionLoadList.cpp stable/11/contrib/llvm/tools/lldb/source/Target/StackFrame.cpp stable/11/contrib/llvm/tools/lldb/source/Target/StackFrameList.cpp stable/11/contrib/llvm/tools/lldb/source/Target/StackID.cpp stable/11/contrib/llvm/tools/lldb/source/Target/StopInfo.cpp stable/11/contrib/llvm/tools/lldb/source/Target/SystemRuntime.cpp stable/11/contrib/llvm/tools/lldb/source/Target/Target.cpp stable/11/contrib/llvm/tools/lldb/source/Target/TargetList.cpp stable/11/contrib/llvm/tools/lldb/source/Target/Thread.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadCollection.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadList.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadPlan.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallUserExpression.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadPlanShouldStopHere.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInstruction.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepOverRange.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepRange.cpp stable/11/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepThrough.cpp stable/11/contrib/llvm/tools/lldb/source/Target/UnixSignals.cpp stable/11/contrib/llvm/tools/lldb/source/Target/UnwindAssembly.cpp stable/11/contrib/llvm/tools/lldb/source/Utility/ConvertEnum.cpp stable/11/contrib/llvm/tools/lldb/source/Utility/JSON.cpp stable/11/contrib/llvm/tools/lldb/source/Utility/ModuleCache.cpp stable/11/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp stable/11/contrib/llvm/tools/lldb/source/Utility/StringExtractor.cpp stable/11/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.cpp stable/11/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.h stable/11/contrib/llvm/tools/lldb/source/Utility/TaskPool.cpp stable/11/contrib/llvm/tools/lldb/tools/compact-unwind/compact-unwind-dumper.c stable/11/contrib/llvm/tools/lldb/tools/driver/Driver.cpp stable/11/contrib/llvm/tools/lldb/tools/driver/Driver.h stable/11/contrib/llvm/tools/lldb/tools/driver/Platform.cpp stable/11/contrib/llvm/tools/lldb/tools/driver/Platform.h stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdBreak.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdData.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdData.h stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdThread.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdThread.h stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdVar.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/MIUtilFileStd.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-mi/Platform.h stable/11/contrib/llvm/tools/lldb/tools/lldb-server/lldb-gdbserver.cpp stable/11/contrib/llvm/tools/lldb/tools/lldb-server/lldb-server.cpp stable/11/contrib/llvm/tools/lli/ChildTarget/ChildTarget.cpp stable/11/contrib/llvm/tools/lli/OrcLazyJIT.cpp stable/11/contrib/llvm/tools/lli/OrcLazyJIT.h stable/11/contrib/llvm/tools/lli/RemoteJITUtils.h stable/11/contrib/llvm/tools/lli/lli.cpp stable/11/contrib/llvm/tools/llvm-ar/llvm-ar.cpp stable/11/contrib/llvm/tools/llvm-as/llvm-as.cpp stable/11/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp stable/11/contrib/llvm/tools/llvm-cov/CodeCoverage.cpp stable/11/contrib/llvm/tools/llvm-cov/CoverageFilters.h stable/11/contrib/llvm/tools/llvm-cov/CoverageReport.cpp stable/11/contrib/llvm/tools/llvm-cov/CoverageReport.h stable/11/contrib/llvm/tools/llvm-cov/CoverageSummaryInfo.h stable/11/contrib/llvm/tools/llvm-cov/CoverageViewOptions.h stable/11/contrib/llvm/tools/llvm-cov/RenderingSupport.h stable/11/contrib/llvm/tools/llvm-cov/SourceCoverageView.cpp stable/11/contrib/llvm/tools/llvm-cov/SourceCoverageView.h stable/11/contrib/llvm/tools/llvm-cov/TestingSupport.cpp stable/11/contrib/llvm/tools/llvm-cov/gcov.cpp stable/11/contrib/llvm/tools/llvm-cov/llvm-cov.cpp stable/11/contrib/llvm/tools/llvm-cxxdump/Error.cpp stable/11/contrib/llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp stable/11/contrib/llvm/tools/llvm-diff/DiffConsumer.h stable/11/contrib/llvm/tools/llvm-diff/DiffLog.cpp stable/11/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp stable/11/contrib/llvm/tools/llvm-diff/DifferenceEngine.h stable/11/contrib/llvm/tools/llvm-diff/llvm-diff.cpp stable/11/contrib/llvm/tools/llvm-dis/llvm-dis.cpp stable/11/contrib/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp stable/11/contrib/llvm/tools/llvm-extract/llvm-extract.cpp stable/11/contrib/llvm/tools/llvm-link/llvm-link.cpp stable/11/contrib/llvm/tools/llvm-lto/llvm-lto.cpp stable/11/contrib/llvm/tools/llvm-mc/Disassembler.cpp stable/11/contrib/llvm/tools/llvm-mc/llvm-mc.cpp stable/11/contrib/llvm/tools/llvm-nm/llvm-nm.cpp stable/11/contrib/llvm/tools/llvm-objdump/COFFDump.cpp stable/11/contrib/llvm/tools/llvm-objdump/MachODump.cpp stable/11/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp stable/11/contrib/llvm/tools/llvm-objdump/llvm-objdump.h stable/11/contrib/llvm/tools/llvm-pdbdump/BuiltinDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/BuiltinDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/CompilandDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/CompilandDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/EnumDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/EnumDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/ExternalSymbolDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/ExternalSymbolDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/FunctionDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/FunctionDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/LinePrinter.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/LinePrinter.h stable/11/contrib/llvm/tools/llvm-pdbdump/TypeDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/TypeDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/TypedefDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/TypedefDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/VariableDumper.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/VariableDumper.h stable/11/contrib/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp stable/11/contrib/llvm/tools/llvm-pdbdump/llvm-pdbdump.h stable/11/contrib/llvm/tools/llvm-profdata/llvm-profdata.cpp stable/11/contrib/llvm/tools/llvm-readobj/ARMAttributeParser.cpp stable/11/contrib/llvm/tools/llvm-readobj/ARMAttributeParser.h stable/11/contrib/llvm/tools/llvm-readobj/ARMEHABIPrinter.h stable/11/contrib/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp stable/11/contrib/llvm/tools/llvm-readobj/ARMWinEHPrinter.h stable/11/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp stable/11/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp stable/11/contrib/llvm/tools/llvm-readobj/Error.cpp stable/11/contrib/llvm/tools/llvm-readobj/MachODumper.cpp stable/11/contrib/llvm/tools/llvm-readobj/ObjDumper.cpp stable/11/contrib/llvm/tools/llvm-readobj/ObjDumper.h stable/11/contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp stable/11/contrib/llvm/tools/llvm-readobj/Win64EHDumper.h stable/11/contrib/llvm/tools/llvm-readobj/llvm-readobj.cpp stable/11/contrib/llvm/tools/llvm-readobj/llvm-readobj.h stable/11/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp stable/11/contrib/llvm/tools/llvm-stress/llvm-stress.cpp stable/11/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp stable/11/contrib/llvm/tools/opt/AnalysisWrappers.cpp stable/11/contrib/llvm/tools/opt/BreakpointPrinter.cpp stable/11/contrib/llvm/tools/opt/NewPMDriver.cpp stable/11/contrib/llvm/tools/opt/NewPMDriver.h stable/11/contrib/llvm/tools/opt/opt.cpp stable/11/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp stable/11/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp stable/11/contrib/llvm/utils/TableGen/AsmWriterInst.cpp stable/11/contrib/llvm/utils/TableGen/AsmWriterInst.h stable/11/contrib/llvm/utils/TableGen/Attributes.cpp stable/11/contrib/llvm/utils/TableGen/CodeEmitterGen.cpp stable/11/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp stable/11/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.h stable/11/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp stable/11/contrib/llvm/utils/TableGen/CodeGenInstruction.h stable/11/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h stable/11/contrib/llvm/utils/TableGen/CodeGenMapTable.cpp stable/11/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp stable/11/contrib/llvm/utils/TableGen/CodeGenRegisters.h stable/11/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp stable/11/contrib/llvm/utils/TableGen/CodeGenSchedule.h stable/11/contrib/llvm/utils/TableGen/CodeGenTarget.cpp stable/11/contrib/llvm/utils/TableGen/CodeGenTarget.h stable/11/contrib/llvm/utils/TableGen/DAGISelMatcher.cpp stable/11/contrib/llvm/utils/TableGen/DAGISelMatcher.h stable/11/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp stable/11/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp stable/11/contrib/llvm/utils/TableGen/DAGISelMatcherOpt.cpp stable/11/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.cpp stable/11/contrib/llvm/utils/TableGen/DisassemblerEmitter.cpp stable/11/contrib/llvm/utils/TableGen/FastISelEmitter.cpp stable/11/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp stable/11/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp stable/11/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp stable/11/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp stable/11/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h stable/11/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp stable/11/contrib/llvm/utils/TableGen/TableGen.cpp stable/11/contrib/llvm/utils/TableGen/TableGenBackends.h stable/11/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp stable/11/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp stable/11/contrib/llvm/utils/TableGen/X86RecognizableInstr.h stable/11/etc/mtree/BSD.debug.dist stable/11/etc/mtree/BSD.usr.dist stable/11/lib/clang/Makefile stable/11/lib/clang/clang.build.mk stable/11/lib/clang/freebsd_cc_version.h stable/11/lib/clang/headers/Makefile stable/11/lib/clang/include/clang/Basic/Version.inc stable/11/lib/clang/include/clang/Config/config.h stable/11/lib/clang/include/llvm/Config/AsmParsers.def stable/11/lib/clang/include/llvm/Config/AsmPrinters.def stable/11/lib/clang/include/llvm/Config/Disassemblers.def stable/11/lib/clang/include/llvm/Config/Targets.def stable/11/lib/clang/include/llvm/Config/config.h stable/11/lib/clang/include/llvm/Config/llvm-config.h stable/11/lib/clang/include/llvm/Support/DataTypes.h stable/11/lib/clang/liblldb/Makefile stable/11/lib/clang/libllvmminimal/Makefile stable/11/lib/libc++/Makefile stable/11/lib/libclang_rt/Makefile stable/11/lib/libclang_rt/Makefile.inc stable/11/lib/libclang_rt/asan-preinit/Makefile stable/11/lib/libclang_rt/asan/Makefile stable/11/lib/libclang_rt/asan_cxx/Makefile stable/11/lib/libclang_rt/asan_dynamic/Makefile stable/11/lib/libclang_rt/include/Makefile stable/11/lib/libclang_rt/profile/Makefile stable/11/lib/libclang_rt/safestack/Makefile stable/11/lib/libclang_rt/ubsan_standalone/Makefile stable/11/lib/libclang_rt/ubsan_standalone_cxx/Makefile stable/11/lib/libcompiler_rt/Makefile stable/11/release/packages/clang.ucl stable/11/share/mk/local.gendirdeps.mk stable/11/share/mk/src.opts.mk stable/11/sys/sys/param.h stable/11/targets/pseudo/clang/Makefile.depend stable/11/tools/build/mk/OptionalObsoleteFiles.inc stable/11/usr.bin/clang/Makefile stable/11/usr.bin/clang/bugpoint/Makefile stable/11/usr.bin/clang/clang-format/Makefile stable/11/usr.bin/clang/clang-tblgen/Makefile stable/11/usr.bin/clang/clang.prog.mk stable/11/usr.bin/clang/clang/Makefile stable/11/usr.bin/clang/llc/Makefile stable/11/usr.bin/clang/lld/Makefile stable/11/usr.bin/clang/lldb/Makefile stable/11/usr.bin/clang/lli/Makefile stable/11/usr.bin/clang/llvm-ar/Makefile stable/11/usr.bin/clang/llvm-as/Makefile stable/11/usr.bin/clang/llvm-bcanalyzer/Makefile stable/11/usr.bin/clang/llvm-cov/Makefile stable/11/usr.bin/clang/llvm-cxxdump/Makefile stable/11/usr.bin/clang/llvm-diff/Makefile stable/11/usr.bin/clang/llvm-dis/Makefile stable/11/usr.bin/clang/llvm-dwarfdump/Makefile stable/11/usr.bin/clang/llvm-extract/Makefile stable/11/usr.bin/clang/llvm-link/Makefile stable/11/usr.bin/clang/llvm-lto/Makefile stable/11/usr.bin/clang/llvm-mc/Makefile stable/11/usr.bin/clang/llvm-nm/Makefile stable/11/usr.bin/clang/llvm-objdump/Makefile stable/11/usr.bin/clang/llvm-pdbdump/Makefile stable/11/usr.bin/clang/llvm-profdata/Makefile stable/11/usr.bin/clang/llvm-rtdyld/Makefile stable/11/usr.bin/clang/llvm-symbolizer/Makefile stable/11/usr.bin/clang/llvm-tblgen/Makefile stable/11/usr.bin/clang/opt/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/Makefile.inc1 Mon Dec 26 20:36:37 2016 (r310618) @@ -1636,13 +1636,12 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptre # the bootstrap compiler, or as the part of the normal build. .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" _clang_tblgen= \ - lib/clang/libllvmsupport \ - lib/clang/libllvmtablegen \ + lib/clang/libllvmminimal \ usr.bin/clang/llvm-tblgen \ usr.bin/clang/clang-tblgen -${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport -${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport +${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal +${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal .endif # Default to building the GPL DTC, but build the BSDL one if users explicitly Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/ObsoleteFiles.inc Mon Dec 26 20:36:37 2016 (r310618) @@ -38,6 +38,207 @@ # xargs -n1 | sort | uniq -d; # done +# 20161217: new clang import which bumps version from 3.9.0 to 3.9.1. +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/3.9.0/include/sanitizer +OLD_FILES+=usr/lib/clang/3.9.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/3.9.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/3.9.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/3.9.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/3.9.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/3.9.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/3.9.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/3.9.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/altivec.h +OLD_FILES+=usr/lib/clang/3.9.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/3.9.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/3.9.0/include/cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/3.9.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/3.9.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/3.9.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/3.9.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/3.9.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/3.9.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/3.9.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/3.9.0/include +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/3.9.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/3.9.0/lib +OLD_DIRS+=usr/lib/clang/3.9.0 +# 20161124: new clang import which bumps version from 3.8.0 to 3.9.0. +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/3.8.0/include/sanitizer +OLD_FILES+=usr/lib/clang/3.8.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/3.8.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/3.8.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/3.8.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/3.8.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/altivec.h +OLD_FILES+=usr/lib/clang/3.8.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/3.8.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/3.8.0/include/cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/3.8.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/3.8.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/3.8.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/3.8.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/3.8.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/3.8.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/3.8.0/include +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/3.8.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/3.8.0/lib +OLD_DIRS+=usr/lib/clang/3.8.0 # 20161121: Hyper-V manuals only apply to amd64 and i386. .if ${TARGET_ARCH} != "amd64" && ${TARGET_ARCH} != "i386" OLD_FILES+=usr/share/man/man4/hv_kvp.4.gz Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/UPDATING Mon Dec 26 20:36:37 2016 (r310618) @@ -16,6 +16,21 @@ from older versions of FreeBSD, try WITH the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20161217: + Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.1. + Please see the 20141231 entry below for information about prerequisites + and upgrading, if you are not already using clang 3.5.0 or higher. + +20161124: + Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.0. + Please see the 20141231 entry below for information about prerequisites + and upgrading, if you are not already using clang 3.5.0 or higher. + +20161119: + The layout of the pmap structure has changed for powerpc to put the pmap + statistics at the front for all CPU variations. libkvm(3) and all tools + that link against it need to be recompiled. + 20161030: isl(4) and cyapa(4) drivers now require a new driver, chromebook_platform(4), to work properly on Chromebook-class hardware. Modified: stable/11/contrib/compiler-rt/LICENSE.TXT ============================================================================== --- stable/11/contrib/compiler-rt/LICENSE.TXT Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/LICENSE.TXT Mon Dec 26 20:36:37 2016 (r310618) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT All rights reserved. Modified: stable/11/contrib/compiler-rt/include/sanitizer/allocator_interface.h ============================================================================== --- stable/11/contrib/compiler-rt/include/sanitizer/allocator_interface.h Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/include/sanitizer/allocator_interface.h Mon Dec 26 20:36:37 2016 (r310618) @@ -59,6 +59,23 @@ extern "C" { deallocation of "ptr". */ void __sanitizer_malloc_hook(const volatile void *ptr, size_t size); void __sanitizer_free_hook(const volatile void *ptr); + + /* Installs a pair of hooks for malloc/free. + Several (currently, 5) hook pairs may be installed, they are executed + in the order they were installed and after calling + __sanitizer_malloc_hook/__sanitizer_free_hook. + Unlike __sanitizer_malloc_hook/__sanitizer_free_hook these hooks can be + chained and do not rely on weak symbols working on the platform, but + require __sanitizer_install_malloc_and_free_hooks to be called at startup + and thus will not be called on malloc/free very early in the process. + Returns the number of hooks currently installed or 0 on failure. + Not thread-safe, should be called in the main thread before starting + other threads. + */ + int __sanitizer_install_malloc_and_free_hooks( + void (*malloc_hook)(const volatile void *, size_t), + void (*free_hook)(const volatile void *)); + #ifdef __cplusplus } // extern "C" #endif Modified: stable/11/contrib/compiler-rt/include/sanitizer/common_interface_defs.h ============================================================================== --- stable/11/contrib/compiler-rt/include/sanitizer/common_interface_defs.h Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/include/sanitizer/common_interface_defs.h Mon Dec 26 20:36:37 2016 (r310618) @@ -41,6 +41,9 @@ extern "C" { // Tell the tools to write their reports to "path." instead of stderr. void __sanitizer_set_report_path(const char *path); + // Tell the tools to write their reports to the provided file descriptor + // (casted to void *). + void __sanitizer_set_report_fd(void *fd); // Notify the tools that the sandbox is going to be turned on. The reserved // parameter will be used in the future to hold a structure with functions @@ -128,8 +131,45 @@ extern "C" { const void *s2, size_t n, int result); void __sanitizer_weak_hook_strncmp(void *called_pc, const char *s1, const char *s2, size_t n, int result); + void __sanitizer_weak_hook_strncasecmp(void *called_pc, const char *s1, + const char *s2, size_t n, int result); void __sanitizer_weak_hook_strcmp(void *called_pc, const char *s1, const char *s2, int result); + void __sanitizer_weak_hook_strcasecmp(void *called_pc, const char *s1, + const char *s2, int result); + void __sanitizer_weak_hook_strstr(void *called_pc, const char *s1, + const char *s2, char *result); + void __sanitizer_weak_hook_strcasestr(void *called_pc, const char *s1, + const char *s2, char *result); + void __sanitizer_weak_hook_memmem(void *called_pc, + const void *s1, size_t len1, + const void *s2, size_t len2, void *result); + + // Prints stack traces for all live heap allocations ordered by total + // allocation size until `top_percent` of total live heap is shown. + // `top_percent` should be between 1 and 100. + // Experimental feature currently available only with asan on Linux/x86_64. + void __sanitizer_print_memory_profile(size_t top_percent); + + // Fiber annotation interface. + // Before switching to a different stack, one must call + // __sanitizer_start_switch_fiber with a pointer to the bottom of the + // destination stack and its size. When code starts running on the new stack, + // it must call __sanitizer_finish_switch_fiber to finalize the switch. + // The start_switch function takes a void** to store the current fake stack if + // there is one (it is needed when detect_stack_use_after_return is enabled). + // When restoring a stack, this pointer must be given to the finish_switch + // function. In most cases, this void* can be stored on the stack just before + // switching. When leaving a fiber definitely, null must be passed as first + // argument to the start_switch function so that the fake stack is destroyed. + // If you do not want support for stack use-after-return detection, you can + // always pass null to these two functions. + // Note that the fake stack mechanism is disabled during fiber switch, so if a + // signal callback runs during the switch, it will not benefit from the stack + // use-after-return detection. + void __sanitizer_start_switch_fiber(void **fake_stack_save, + const void *bottom, size_t size); + void __sanitizer_finish_switch_fiber(void *fake_stack_save); #ifdef __cplusplus } // extern "C" #endif Copied: stable/11/contrib/compiler-rt/include/sanitizer/esan_interface.h (from r309124, head/contrib/compiler-rt/include/sanitizer/esan_interface.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/compiler-rt/include/sanitizer/esan_interface.h Mon Dec 26 20:36:37 2016 (r310618, copy of r309124, head/contrib/compiler-rt/include/sanitizer/esan_interface.h) @@ -0,0 +1,50 @@ +//===-- sanitizer/esan_interface.h ------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of EfficiencySanitizer, a family of performance tuners. +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_ESAN_INTERFACE_H +#define SANITIZER_ESAN_INTERFACE_H + +#include + +// We declare our interface routines as weak to allow the user to avoid +// ifdefs and instead use this pattern to allow building the same sources +// with and without our runtime library: +// if (__esan_report) +// __esan_report(); +#ifdef _MSC_VER +/* selectany is as close to weak as we'll get. */ +#define COMPILER_RT_WEAK __declspec(selectany) +#elif __GNUC__ +#define COMPILER_RT_WEAK __attribute__((weak)) +#else +#define COMPILER_RT_WEAK +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// This function can be called mid-run (or at the end of a run for +// a server process that doesn't shut down normally) to request that +// data for that point in the run be reported from the tool. +void COMPILER_RT_WEAK __esan_report(); + +// This function returns the number of samples that the esan tool has collected +// to this point. This is useful for testing. +unsigned int COMPILER_RT_WEAK __esan_get_sample_count(); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_ESAN_INTERFACE_H Modified: stable/11/contrib/compiler-rt/include/sanitizer/linux_syscall_hooks.h ============================================================================== --- stable/11/contrib/compiler-rt/include/sanitizer/linux_syscall_hooks.h Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/include/sanitizer/linux_syscall_hooks.h Mon Dec 26 20:36:37 2016 (r310618) @@ -1835,6 +1835,17 @@ __sanitizer_syscall_pre_impl_vfork() #define __sanitizer_syscall_post_vfork(res) \ __sanitizer_syscall_post_impl_vfork(res) +#define __sanitizer_syscall_pre_sigaction(signum, act, oldact) \ + __sanitizer_syscall_pre_impl_sigaction((long)signum, (long)act, (long)oldact) +#define __sanitizer_syscall_post_sigaction(res, signum, act, oldact) \ + __sanitizer_syscall_post_impl_sigaction(res, (long)signum, (long)act, \ + (long)oldact) +#define __sanitizer_syscall_pre_rt_sigaction(signum, act, oldact, sz) \ + __sanitizer_syscall_pre_impl_rt_sigaction((long)signum, (long)act, \ + (long)oldact, (long)sz) +#define __sanitizer_syscall_post_rt_sigaction(res, signum, act, oldact, sz) \ + __sanitizer_syscall_post_impl_rt_sigaction(res, (long)signum, (long)act, \ + (long)oldact, (long)sz) // And now a few syscalls we don't handle yet. #define __sanitizer_syscall_pre_afs_syscall(...) @@ -1889,7 +1900,6 @@ #define __sanitizer_syscall_pre_query_module(...) #define __sanitizer_syscall_pre_readahead(...) #define __sanitizer_syscall_pre_readdir(...) -#define __sanitizer_syscall_pre_rt_sigaction(...) #define __sanitizer_syscall_pre_rt_sigreturn(...) #define __sanitizer_syscall_pre_rt_sigsuspend(...) #define __sanitizer_syscall_pre_security(...) @@ -1903,7 +1913,6 @@ #define __sanitizer_syscall_pre_setreuid32(...) #define __sanitizer_syscall_pre_set_thread_area(...) #define __sanitizer_syscall_pre_setuid32(...) -#define __sanitizer_syscall_pre_sigaction(...) #define __sanitizer_syscall_pre_sigaltstack(...) #define __sanitizer_syscall_pre_sigreturn(...) #define __sanitizer_syscall_pre_sigsuspend(...) @@ -1971,7 +1980,6 @@ #define __sanitizer_syscall_post_query_module(res, ...) #define __sanitizer_syscall_post_readahead(res, ...) #define __sanitizer_syscall_post_readdir(res, ...) -#define __sanitizer_syscall_post_rt_sigaction(res, ...) #define __sanitizer_syscall_post_rt_sigreturn(res, ...) #define __sanitizer_syscall_post_rt_sigsuspend(res, ...) #define __sanitizer_syscall_post_security(res, ...) @@ -1985,7 +1993,6 @@ #define __sanitizer_syscall_post_setreuid32(res, ...) #define __sanitizer_syscall_post_set_thread_area(res, ...) #define __sanitizer_syscall_post_setuid32(res, ...) -#define __sanitizer_syscall_post_sigaction(res, ...) #define __sanitizer_syscall_post_sigaltstack(res, ...) #define __sanitizer_syscall_post_sigreturn(res, ...) #define __sanitizer_syscall_post_sigsuspend(res, ...) @@ -3062,7 +3069,13 @@ void __sanitizer_syscall_pre_impl_fork() void __sanitizer_syscall_post_impl_fork(long res); void __sanitizer_syscall_pre_impl_vfork(); void __sanitizer_syscall_post_impl_vfork(long res); - +void __sanitizer_syscall_pre_impl_sigaction(long signum, long act, long oldact); +void __sanitizer_syscall_post_impl_sigaction(long res, long signum, long act, + long oldact); +void __sanitizer_syscall_pre_impl_rt_sigaction(long signum, long act, + long oldact, long sz); +void __sanitizer_syscall_post_impl_rt_sigaction(long res, long signum, long act, + long oldact, long sz); #ifdef __cplusplus } // extern "C" #endif Modified: stable/11/contrib/compiler-rt/lib/asan/asan_activation.cc ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_activation.cc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_activation.cc Mon Dec 26 20:36:37 2016 (r310618) @@ -47,6 +47,7 @@ static struct AsanDeactivatedFlags { FlagParser parser; RegisterActivationFlags(&parser, &f, &cf); + cf.SetDefaults(); // Copy the current activation flags. allocator_options.CopyTo(&f, &cf); cf.malloc_context_size = malloc_context_size; @@ -61,7 +62,7 @@ static struct AsanDeactivatedFlags { parser.ParseString(env); } - SetVerbosity(cf.verbosity); + InitializeCommonFlags(&cf); if (Verbosity()) ReportUnrecognizedFlags(); Modified: stable/11/contrib/compiler-rt/lib/asan/asan_allocator.cc ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_allocator.cc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_allocator.cc Mon Dec 26 20:36:37 2016 (r310618) @@ -223,7 +223,7 @@ void AllocatorOptions::CopyTo(Flags *f, struct Allocator { static const uptr kMaxAllowedMallocSize = - FIRST_32_SECOND_64(3UL << 30, 1UL << 40); + FIRST_32_SECOND_64(3UL << 30, 1ULL << 40); static const uptr kMaxThreadLocalQuarantine = FIRST_32_SECOND_64(1 << 18, 1 << 20); @@ -457,29 +457,28 @@ struct Allocator { return res; } - void AtomicallySetQuarantineFlag(AsanChunk *m, void *ptr, + // Set quarantine flag if chunk is allocated, issue ASan error report on + // available and quarantined chunks. Return true on success, false otherwise. + bool AtomicallySetQuarantineFlagIfAllocated(AsanChunk *m, void *ptr, BufferedStackTrace *stack) { u8 old_chunk_state = CHUNK_ALLOCATED; // Flip the chunk_state atomically to avoid race on double-free. - if (!atomic_compare_exchange_strong((atomic_uint8_t*)m, &old_chunk_state, - CHUNK_QUARANTINE, memory_order_acquire)) + if (!atomic_compare_exchange_strong((atomic_uint8_t *)m, &old_chunk_state, + CHUNK_QUARANTINE, + memory_order_acquire)) { ReportInvalidFree(ptr, old_chunk_state, stack); + // It's not safe to push a chunk in quarantine on invalid free. + return false; + } CHECK_EQ(CHUNK_ALLOCATED, old_chunk_state); + return true; } // Expects the chunk to already be marked as quarantined by using - // AtomicallySetQuarantineFlag. + // AtomicallySetQuarantineFlagIfAllocated. void QuarantineChunk(AsanChunk *m, void *ptr, BufferedStackTrace *stack, AllocType alloc_type) { CHECK_EQ(m->chunk_state, CHUNK_QUARANTINE); - - if (m->alloc_type != alloc_type) { - if (atomic_load(&alloc_dealloc_mismatch, memory_order_acquire)) { - ReportAllocTypeMismatch((uptr)ptr, stack, (AllocType)m->alloc_type, - (AllocType)alloc_type); - } - } - CHECK_GE(m->alloc_tid, 0); if (SANITIZER_WORDSIZE == 64) // On 32-bits this resides in user area. CHECK_EQ(m->free_tid, kInvalidTid); @@ -516,13 +515,24 @@ struct Allocator { uptr chunk_beg = p - kChunkHeaderSize; AsanChunk *m = reinterpret_cast(chunk_beg); + + ASAN_FREE_HOOK(ptr); + // Must mark the chunk as quarantined before any changes to its metadata. + // Do not quarantine given chunk if we failed to set CHUNK_QUARANTINE flag. + if (!AtomicallySetQuarantineFlagIfAllocated(m, ptr, stack)) return; + + if (m->alloc_type != alloc_type) { + if (atomic_load(&alloc_dealloc_mismatch, memory_order_acquire)) { + ReportAllocTypeMismatch((uptr)ptr, stack, (AllocType)m->alloc_type, + (AllocType)alloc_type); + } + } + if (delete_size && flags()->new_delete_type_mismatch && delete_size != m->UsedSize()) { - ReportNewDeleteSizeMismatch(p, delete_size, stack); + ReportNewDeleteSizeMismatch(p, m->UsedSize(), delete_size, stack); } - ASAN_FREE_HOOK(ptr); - // Must mark the chunk as quarantined before any changes to its metadata. - AtomicallySetQuarantineFlag(m, ptr, stack); + QuarantineChunk(m, ptr, stack, alloc_type); } @@ -655,6 +665,9 @@ static AsanAllocator &get_allocator() { bool AsanChunkView::IsValid() { return chunk_ && chunk_->chunk_state != CHUNK_AVAILABLE; } +bool AsanChunkView::IsAllocated() { + return chunk_ && chunk_->chunk_state == CHUNK_ALLOCATED; +} uptr AsanChunkView::Beg() { return chunk_->Beg(); } uptr AsanChunkView::End() { return Beg() + UsedSize(); } uptr AsanChunkView::UsedSize() { return chunk_->UsedSize(); } @@ -668,12 +681,15 @@ static StackTrace GetStackTraceFromId(u3 return res; } +u32 AsanChunkView::GetAllocStackId() { return chunk_->alloc_context_id; } +u32 AsanChunkView::GetFreeStackId() { return chunk_->free_context_id; } + StackTrace AsanChunkView::GetAllocStack() { - return GetStackTraceFromId(chunk_->alloc_context_id); + return GetStackTraceFromId(GetAllocStackId()); } StackTrace AsanChunkView::GetFreeStack() { - return GetStackTraceFromId(chunk_->free_context_id); + return GetStackTraceFromId(GetFreeStackId()); } void InitializeAllocator(const AllocatorOptions &options) { @@ -754,7 +770,7 @@ int asan_posix_memalign(void **memptr, u return 0; } -uptr asan_malloc_usable_size(void *ptr, uptr pc, uptr bp) { +uptr asan_malloc_usable_size(const void *ptr, uptr pc, uptr bp) { if (!ptr) return 0; uptr usable_size = instance.AllocationSize(reinterpret_cast(ptr)); if (flags()->check_malloc_usable_size && (usable_size == 0)) { Modified: stable/11/contrib/compiler-rt/lib/asan/asan_allocator.h ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_allocator.h Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_allocator.h Mon Dec 26 20:36:37 2016 (r310618) @@ -49,14 +49,17 @@ void GetAllocatorOptions(AllocatorOption class AsanChunkView { public: explicit AsanChunkView(AsanChunk *chunk) : chunk_(chunk) {} - bool IsValid(); // Checks if AsanChunkView points to a valid allocated - // or quarantined chunk. - uptr Beg(); // First byte of user memory. - uptr End(); // Last byte of user memory. - uptr UsedSize(); // Size requested by the user. + bool IsValid(); // Checks if AsanChunkView points to a valid allocated + // or quarantined chunk. + bool IsAllocated(); // Checks if the memory is currently allocated. + uptr Beg(); // First byte of user memory. + uptr End(); // Last byte of user memory. + uptr UsedSize(); // Size requested by the user. uptr AllocTid(); uptr FreeTid(); bool Eq(const AsanChunkView &c) const { return chunk_ == c.chunk_; } + u32 GetAllocStackId(); + u32 GetFreeStackId(); StackTrace GetAllocStack(); StackTrace GetFreeStack(); bool AddrIsInside(uptr addr, uptr access_size, sptr *offset) { @@ -171,7 +174,7 @@ void *asan_pvalloc(uptr size, BufferedSt int asan_posix_memalign(void **memptr, uptr alignment, uptr size, BufferedStackTrace *stack); -uptr asan_malloc_usable_size(void *ptr, uptr pc, uptr bp); +uptr asan_malloc_usable_size(const void *ptr, uptr pc, uptr bp); uptr asan_mz_size(const void *ptr); void asan_mz_force_lock(); Modified: stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.cc ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.cc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.cc Mon Dec 26 20:36:37 2016 (r310618) @@ -31,7 +31,7 @@ ALWAYS_INLINE void SetShadow(uptr ptr, u CHECK_EQ(SHADOW_SCALE, 3); // This code expects SHADOW_SCALE=3. u64 *shadow = reinterpret_cast(MemToShadow(ptr)); if (class_id <= 6) { - for (uptr i = 0; i < (1U << class_id); i++) { + for (uptr i = 0; i < (((uptr)1) << class_id); i++) { shadow[i] = magic; // Make sure this does not become memset. SanitizerBreakOptimization(nullptr); @@ -121,7 +121,7 @@ uptr FakeStack::AddrIsInFakeStack(uptr p uptr class_id = (ptr - beg) >> stack_size_log; uptr base = beg + (class_id << stack_size_log); CHECK_LE(base, ptr); - CHECK_LT(ptr, base + (1UL << stack_size_log)); + CHECK_LT(ptr, base + (((uptr)1) << stack_size_log)); uptr pos = (ptr - base) >> (kMinStackFrameSizeLog + class_id); uptr res = base + pos * BytesInSizeClass(class_id); *frame_end = res + BytesInSizeClass(class_id); Modified: stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.h ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.h Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_fake_stack.h Mon Dec 26 20:36:37 2016 (r310618) @@ -69,12 +69,12 @@ class FakeStack { // stack_size_log is at least 15 (stack_size >= 32K). static uptr SizeRequiredForFlags(uptr stack_size_log) { - return 1UL << (stack_size_log + 1 - kMinStackFrameSizeLog); + return ((uptr)1) << (stack_size_log + 1 - kMinStackFrameSizeLog); } // Each size class occupies stack_size bytes. static uptr SizeRequiredForFrames(uptr stack_size_log) { - return (1ULL << stack_size_log) * kNumberOfSizeClasses; + return (((uptr)1) << stack_size_log) * kNumberOfSizeClasses; } // Number of bytes requires for the whole object. @@ -91,12 +91,12 @@ class FakeStack { // and so on. static uptr FlagsOffset(uptr stack_size_log, uptr class_id) { uptr t = kNumberOfSizeClasses - 1 - class_id; - const uptr all_ones = (1 << (kNumberOfSizeClasses - 1)) - 1; + const uptr all_ones = (((uptr)1) << (kNumberOfSizeClasses - 1)) - 1; return ((all_ones >> t) << t) << (stack_size_log - 15); } static uptr NumberOfFrames(uptr stack_size_log, uptr class_id) { - return 1UL << (stack_size_log - kMinStackFrameSizeLog - class_id); + return ((uptr)1) << (stack_size_log - kMinStackFrameSizeLog - class_id); } // Divide n by the numbe of frames in size class. @@ -114,7 +114,8 @@ class FakeStack { u8 *GetFrame(uptr stack_size_log, uptr class_id, uptr pos) { return reinterpret_cast(this) + kFlagsOffset + SizeRequiredForFlags(stack_size_log) + - (1 << stack_size_log) * class_id + BytesInSizeClass(class_id) * pos; + (((uptr)1) << stack_size_log) * class_id + + BytesInSizeClass(class_id) * pos; } // Allocate the fake frame. @@ -137,7 +138,7 @@ class FakeStack { // Number of bytes in a fake frame of this size class. static uptr BytesInSizeClass(uptr class_id) { - return 1UL << (class_id + kMinStackFrameSizeLog); + return ((uptr)1) << (class_id + kMinStackFrameSizeLog); } // The fake frame is guaranteed to have a right redzone. @@ -159,7 +160,7 @@ class FakeStack { static const uptr kFlagsOffset = 4096; // This is were the flags begin. // Must match the number of uses of DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID COMPILER_CHECK(kNumberOfSizeClasses == 11); - static const uptr kMaxStackMallocSize = 1 << kMaxStackFrameSizeLog; + static const uptr kMaxStackMallocSize = ((uptr)1) << kMaxStackFrameSizeLog; uptr hint_position_[kNumberOfSizeClasses]; uptr stack_size_log_; Modified: stable/11/contrib/compiler-rt/lib/asan/asan_flags.cc ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_flags.cc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_flags.cc Mon Dec 26 20:36:37 2016 (r310618) @@ -116,7 +116,7 @@ void InitializeFlags() { ubsan_parser.ParseString(GetEnv("UBSAN_OPTIONS")); #endif - SetVerbosity(common_flags()->verbosity); + InitializeCommonFlags(); // TODO(eugenis): dump all flags at verbosity>=2? if (Verbosity()) ReportUnrecognizedFlags(); @@ -159,6 +159,14 @@ void InitializeFlags() { (ASAN_LOW_MEMORY) ? 1UL << 6 : 1UL << 8; f->quarantine_size_mb = kDefaultQuarantineSizeMb; } + if (!f->replace_str && common_flags()->intercept_strlen) { + Report("WARNING: strlen interceptor is enabled even though replace_str=0. " + "Use intercept_strlen=0 to disable it."); + } + if (!f->replace_str && common_flags()->intercept_strchr) { + Report("WARNING: strchr* interceptors are enabled even though " + "replace_str=0. Use intercept_strchr=0 to disable them."); + } } } // namespace __asan Modified: stable/11/contrib/compiler-rt/lib/asan/asan_flags.inc ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_flags.inc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_flags.inc Mon Dec 26 20:36:37 2016 (r310618) @@ -43,7 +43,7 @@ ASAN_FLAG( "If set, uses custom wrappers and replacements for libc string functions " "to find more errors.") ASAN_FLAG(bool, replace_intrin, true, - "If set, uses custom wrappers for memset/memcpy/memmove intinsics.") + "If set, uses custom wrappers for memset/memcpy/memmove intrinsics.") ASAN_FLAG(bool, detect_stack_use_after_return, false, "Enables stack-use-after-return checking at run-time.") ASAN_FLAG(int, min_uar_stack_size_log, 16, // We can't do smaller anyway. @@ -77,6 +77,8 @@ ASAN_FLAG(bool, print_stats, false, "Print various statistics after printing an error message or if " "atexit=1.") ASAN_FLAG(bool, print_legend, true, "Print the legend for the shadow bytes.") +ASAN_FLAG(bool, print_scariness, false, + "Print the scariness score. Experimental.") ASAN_FLAG(bool, atexit, false, "If set, prints ASan exit stats even after program terminates " "successfully.") @@ -104,7 +106,7 @@ ASAN_FLAG(bool, alloc_dealloc_mismatch, "Report errors on malloc/delete, new/free, new/delete[], etc.") ASAN_FLAG(bool, new_delete_type_mismatch, true, - "Report errors on mismatch betwen size of new and delete.") + "Report errors on mismatch between size of new and delete.") ASAN_FLAG( bool, strict_init_order, false, "If true, assume that dynamic initializers can never access globals from " @@ -135,3 +137,5 @@ ASAN_FLAG(const char *, suppressions, "" ASAN_FLAG(bool, halt_on_error, true, "Crash the program after printing the first error report " "(WARNING: USE AT YOUR OWN RISK!)") +ASAN_FLAG(bool, use_odr_indicator, false, + "Use special ODR indicator symbol for ODR violation detection") Modified: stable/11/contrib/compiler-rt/lib/asan/asan_globals.cc ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_globals.cc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_globals.cc Mon Dec 26 20:36:37 2016 (r310618) @@ -135,6 +135,70 @@ bool GetInfoForAddressIfGlobal(uptr addr return false; } +enum GlobalSymbolState { + UNREGISTERED = 0, + REGISTERED = 1 +}; + +// Check ODR violation for given global G via special ODR indicator. We use +// this method in case compiler instruments global variables through their +// local aliases. +static void CheckODRViolationViaIndicator(const Global *g) { + u8 *odr_indicator = reinterpret_cast(g->odr_indicator); + if (*odr_indicator == UNREGISTERED) { + *odr_indicator = REGISTERED; + return; + } + // If *odr_indicator is DEFINED, some module have already registered + // externally visible symbol with the same name. This is an ODR violation. + for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) { + if (g->odr_indicator == l->g->odr_indicator && + (flags()->detect_odr_violation >= 2 || g->size != l->g->size) && + !IsODRViolationSuppressed(g->name)) + ReportODRViolation(g, FindRegistrationSite(g), + l->g, FindRegistrationSite(l->g)); + } +} + +// Check ODR violation for given global G by checking if it's already poisoned. +// We use this method in case compiler doesn't use private aliases for global +// variables. +static void CheckODRViolationViaPoisoning(const Global *g) { + if (__asan_region_is_poisoned(g->beg, g->size_with_redzone)) { + // This check may not be enough: if the first global is much larger + // the entire redzone of the second global may be within the first global. + for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) { + if (g->beg == l->g->beg && + (flags()->detect_odr_violation >= 2 || g->size != l->g->size) && + !IsODRViolationSuppressed(g->name)) + ReportODRViolation(g, FindRegistrationSite(g), + l->g, FindRegistrationSite(l->g)); + } + } +} + +// Clang provides two different ways for global variables protection: +// it can poison the global itself or its private alias. In former +// case we may poison same symbol multiple times, that can help us to +// cheaply detect ODR violation: if we try to poison an already poisoned +// global, we have ODR violation error. +// In latter case, we poison each symbol exactly once, so we use special +// indicator symbol to perform similar check. +// In either case, compiler provides a special odr_indicator field to Global +// structure, that can contain two kinds of values: +// 1) Non-zero value. In this case, odr_indicator is an address of +// corresponding indicator variable for given global. +// 2) Zero. This means that we don't use private aliases for global variables +// and can freely check ODR violation with the first method. +// +// This routine chooses between two different methods of ODR violation +// detection. +static inline bool UseODRIndicator(const Global *g) { + // Use ODR indicator method iff use_odr_indicator flag is set and + // indicator symbol address is not 0. + return flags()->use_odr_indicator && g->odr_indicator > 0; +} + // Register a global variable. // This function may be called more than once for every global // so we store the globals in a map. @@ -144,22 +208,24 @@ static void RegisterGlobal(const Global ReportGlobal(*g, "Added"); CHECK(flags()->report_globals); CHECK(AddrIsInMem(g->beg)); - CHECK(AddrIsAlignedByGranularity(g->beg)); + if (!AddrIsAlignedByGranularity(g->beg)) { + Report("The following global variable is not properly aligned.\n"); + Report("This may happen if another global with the same name\n"); + Report("resides in another non-instrumented module.\n"); + Report("Or the global comes from a C file built w/o -fno-common.\n"); + Report("In either case this is likely an ODR violation bug,\n"); + Report("but AddressSanitizer can not provide more details.\n"); + ReportODRViolation(g, FindRegistrationSite(g), g, FindRegistrationSite(g)); + CHECK(AddrIsAlignedByGranularity(g->beg)); + } CHECK(AddrIsAlignedByGranularity(g->size_with_redzone)); if (flags()->detect_odr_violation) { // Try detecting ODR (One Definition Rule) violation, i.e. the situation // where two globals with the same name are defined in different modules. - if (__asan_region_is_poisoned(g->beg, g->size_with_redzone)) { - // This check may not be enough: if the first global is much larger - // the entire redzone of the second global may be within the first global. - for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) { - if (g->beg == l->g->beg && - (flags()->detect_odr_violation >= 2 || g->size != l->g->size) && - !IsODRViolationSuppressed(g->name)) - ReportODRViolation(g, FindRegistrationSite(g), - l->g, FindRegistrationSite(l->g)); - } - } + if (UseODRIndicator(g)) + CheckODRViolationViaIndicator(g); + else + CheckODRViolationViaPoisoning(g); } if (CanPoisonMemory()) PoisonRedZones(*g); @@ -190,6 +256,12 @@ static void UnregisterGlobal(const Globa // We unpoison the shadow memory for the global but we do not remove it from // the list because that would require O(n^2) time with the current list // implementation. It might not be worth doing anyway. + + // Release ODR indicator. + if (UseODRIndicator(g)) { + u8 *odr_indicator = reinterpret_cast(g->odr_indicator); + *odr_indicator = UNREGISTERED; + } } void StopInitOrderChecking() { @@ -212,6 +284,25 @@ void StopInitOrderChecking() { // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT + +// Apply __asan_register_globals to all globals found in the same loaded +// executable or shared library as `flag'. The flag tracks whether globals have +// already been registered or not for this image. +void __asan_register_image_globals(uptr *flag) { + if (*flag) + return; + AsanApplyToGlobals(__asan_register_globals, flag); + *flag = 1; +} + +// This mirrors __asan_register_image_globals. +void __asan_unregister_image_globals(uptr *flag) { + if (!*flag) + return; + AsanApplyToGlobals(__asan_unregister_globals, flag); + *flag = 0; +} + // Register an array of globals. void __asan_register_globals(__asan_global *globals, uptr n) { if (!flags()->report_globals) return; Modified: stable/11/contrib/compiler-rt/lib/asan/asan_init_version.h ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_init_version.h Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_init_version.h Mon Dec 26 20:36:37 2016 (r310618) @@ -19,16 +19,20 @@ extern "C" { // Every time the ASan ABI changes we also change the version number in the // __asan_init function name. Objects built with incompatible ASan ABI // versions will not link with run-time. + // // Changes between ABI versions: // v1=>v2: added 'module_name' to __asan_global // v2=>v3: stack frame description (created by the compiler) - // contains the function PC as the 3-rd field (see - // DescribeAddressIfStack). - // v3=>v4: added '__asan_global_source_location' to __asan_global. + // contains the function PC as the 3rd field (see + // DescribeAddressIfStack) + // v3=>v4: added '__asan_global_source_location' to __asan_global // v4=>v5: changed the semantics and format of __asan_stack_malloc_ and - // __asan_stack_free_ functions. + // __asan_stack_free_ functions // v5=>v6: changed the name of the version check symbol - #define __asan_version_mismatch_check __asan_version_mismatch_check_v6 + // v6=>v7: added 'odr_indicator' to __asan_global + // v7=>v8: added '__asan_(un)register_image_globals' functions for dead + // stripping support on Mach-O platforms + #define __asan_version_mismatch_check __asan_version_mismatch_check_v8 } #endif // ASAN_INIT_VERSION_H Modified: stable/11/contrib/compiler-rt/lib/asan/asan_interceptors.cc ============================================================================== --- stable/11/contrib/compiler-rt/lib/asan/asan_interceptors.cc Mon Dec 26 19:33:40 2016 (r310617) +++ stable/11/contrib/compiler-rt/lib/asan/asan_interceptors.cc Mon Dec 26 20:36:37 2016 (r310618) @@ -21,6 +21,7 @@ #include "asan_stack.h" #include "asan_stats.h" #include "asan_suppressions.h" +#include "lsan/lsan_common.h" #include "sanitizer_common/sanitizer_libc.h" #if SANITIZER_POSIX @@ -110,7 +111,7 @@ static inline bool RangesOverlap(const c } while (0) static inline uptr MaybeRealStrnlen(const char *s, uptr maxlen) { -#if ASAN_INTERCEPT_STRNLEN +#if SANITIZER_INTERCEPT_STRNLEN if (REAL(strnlen)) { return REAL(strnlen)(s, maxlen); } @@ -143,6 +144,8 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free, (void) ctx; \ #define COMMON_INTERCEPT_FUNCTION(name) ASAN_INTERCEPT_FUNC(name) +#define COMMON_INTERCEPT_FUNCTION_VER(name, ver) \ + ASAN_INTERCEPT_FUNC_VER(name, ver) #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \ ASAN_WRITE_RANGE(ctx, ptr, size) #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \ @@ -195,6 +198,10 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free, } else { \ *begin = *end = 0; \ } +// Asan needs custom handling of these: +#undef SANITIZER_INTERCEPT_MEMSET +#undef SANITIZER_INTERCEPT_MEMMOVE +#undef SANITIZER_INTERCEPT_MEMCPY #include "sanitizer_common/sanitizer_common_interceptors.inc" // Syscall interceptors don't have contexts, we don't support suppressions @@ -218,6 +225,7 @@ struct ThreadStartParam { atomic_uintptr_t is_registered; }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 26 22:13:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3729FC9178F; Mon, 26 Dec 2016 22:13:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3F161A54; Mon, 26 Dec 2016 22:13:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQMDiVE036337; Mon, 26 Dec 2016 22:13:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQMDh9c036331; Mon, 26 Dec 2016 22:13:43 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612262213.uBQMDh9c036331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 26 Dec 2016 22:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310621 - in head/sys: conf dev/ichiic modules/i2c/controllers/ichiic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 22:13:45 -0000 Author: gonzo Date: Mon Dec 26 22:13:43 2016 New Revision: 310621 URL: https://svnweb.freebsd.org/changeset/base/310621 Log: [ig4] Add ACPI platform support for ig4 driver Add ACPI part for ig4 driver to make it work on Intel BayTrail SoC where ig4 device is available only through ACPI Reviewed by: avg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8742 Added: head/sys/dev/ichiic/ig4_acpi.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_pci.c head/sys/dev/ichiic/ig4_var.h head/sys/modules/i2c/controllers/ichiic/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Dec 26 21:27:21 2016 (r310620) +++ head/sys/conf/files Mon Dec 26 22:13:43 2016 (r310621) @@ -1730,6 +1730,7 @@ dev/hptiop/hptiop.c optional hptiop scb dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc dev/hwpmc/hwpmc_soft.c optional hwpmc +dev/ichiic/ig4_acpi.c optional ig4 acpi iicbus dev/ichiic/ig4_iic.c optional ig4 iicbus dev/ichiic/ig4_pci.c optional ig4 pci iicbus dev/ichsmb/ichsmb.c optional ichsmb Added: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ichiic/ig4_acpi.c Mon Dec 26 22:13:43 2016 (r310621) @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2016 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static int ig4iic_acpi_probe(device_t dev); +static int ig4iic_acpi_attach(device_t dev); +static int ig4iic_acpi_detach(device_t dev); + +static char *ig4iic_ids[] = { + "INT33C2", + "INT33C3", + "INT3432", + "INT3433", + "80860F41", + "808622C1", + "AMDI0510", + "APMC0D0F", + NULL +}; + +static int +ig4iic_acpi_probe(device_t dev) +{ + + if (acpi_disabled("ig4iic") || + ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids) == NULL) + return (ENXIO); + + device_set_desc(dev, "Designware I2C Controller"); + return (0); +} + +static int +ig4iic_acpi_attach(device_t dev) +{ + ig4iic_softc_t *sc; + int error; + + sc = device_get_softc(dev); + + sc->dev = dev; + sc->regs_rid = 0; + sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->regs_rid, RF_ACTIVE); + if (sc->regs_res == NULL) { + device_printf(dev, "unable to map registers\n"); + ig4iic_acpi_detach(dev); + return (ENXIO); + } + sc->intr_rid = 0; + sc->intr_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->intr_rid, RF_SHAREABLE | RF_ACTIVE); + if (sc->intr_res == NULL) { + device_printf(dev, "unable to map interrupt\n"); + ig4iic_acpi_detach(dev); + return (ENXIO); + } + sc->platform_attached = 1; + + error = ig4iic_attach(sc); + if (error) + ig4iic_acpi_detach(dev); + + return (error); +} + +static int +ig4iic_acpi_detach(device_t dev) +{ + ig4iic_softc_t *sc = device_get_softc(dev); + int error; + + if (sc->platform_attached) { + error = ig4iic_detach(sc); + if (error) + return (error); + sc->platform_attached = 0; + } + + if (sc->intr_res) { + bus_release_resource(dev, SYS_RES_IRQ, + sc->intr_rid, sc->intr_res); + sc->intr_res = NULL; + } + if (sc->regs_res) { + bus_release_resource(dev, SYS_RES_MEMORY, + sc->regs_rid, sc->regs_res); + sc->regs_res = NULL; + } + + return (0); +} + +static device_method_t ig4iic_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ig4iic_acpi_probe), + DEVMETHOD(device_attach, ig4iic_acpi_attach), + DEVMETHOD(device_detach, ig4iic_acpi_detach), + + /* iicbus interface */ + DEVMETHOD(iicbus_transfer, ig4iic_transfer), + DEVMETHOD(iicbus_reset, ig4iic_reset), + DEVMETHOD(iicbus_callback, iicbus_null_callback), + + DEVMETHOD_END +}; + +static driver_t ig4iic_acpi_driver = { + "ig4iic_acpi", + ig4iic_acpi_methods, + sizeof(struct ig4iic_softc), +}; + +static devclass_t ig4iic_acpi_devclass; +DRIVER_MODULE(ig4iic_acpi, acpi, ig4iic_acpi_driver, ig4iic_acpi_devclass, 0, 0); + +MODULE_DEPEND(ig4iic_acpi, acpi, 1, 1, 1); +MODULE_DEPEND(ig4iic_acpi, pci, 1, 1, 1); +MODULE_DEPEND(ig4iic_acpi, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(ig4iic_acpi, 1); Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Mon Dec 26 21:27:21 2016 (r310620) +++ head/sys/dev/ichiic/ig4_iic.c Mon Dec 26 22:13:43 2016 (r310621) @@ -522,6 +522,9 @@ ig4iic_attach(ig4iic_softc_t *sc) int error; uint32_t v; + mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); + sx_init(&sc->call_lock, "IG4 call lock"); + v = reg_read(sc, IG4_REG_COMP_TYPE); v = reg_read(sc, IG4_REG_COMP_PARAM1); v = reg_read(sc, IG4_REG_GENERAL); @@ -664,6 +667,10 @@ ig4iic_detach(ig4iic_softc_t *sc) mtx_unlock(&sc->io_lock); sx_xunlock(&sc->call_lock); + + mtx_destroy(&sc->io_lock); + sx_destroy(&sc->call_lock); + return (0); } @@ -731,4 +738,5 @@ ig4iic_dump(ig4iic_softc_t *sc) } #undef REGDUMP -DRIVER_MODULE(iicbus, ig4iic, iicbus_driver, iicbus_devclass, NULL, NULL); +DRIVER_MODULE(iicbus, ig4iic_acpi, iicbus_driver, iicbus_devclass, NULL, NULL); +DRIVER_MODULE(iicbus, ig4iic_pci, iicbus_driver, iicbus_devclass, NULL, NULL); Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Mon Dec 26 21:27:21 2016 (r310620) +++ head/sys/dev/ichiic/ig4_pci.c Mon Dec 26 22:13:43 2016 (r310621) @@ -115,11 +115,6 @@ ig4iic_pci_attach(device_t dev) ig4iic_softc_t *sc = device_get_softc(dev); int error; - bzero(sc, sizeof(*sc)); - - mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); - sx_init(&sc->call_lock, "IG4 call lock"); - sc->dev = dev; sc->regs_rid = PCIR_BAR(0); sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -140,7 +135,7 @@ ig4iic_pci_attach(device_t dev) ig4iic_pci_detach(dev); return (ENXIO); } - sc->pci_attached = 1; + sc->platform_attached = 1; error = ig4iic_attach(sc); if (error) @@ -155,11 +150,11 @@ ig4iic_pci_detach(device_t dev) ig4iic_softc_t *sc = device_get_softc(dev); int error; - if (sc->pci_attached) { + if (sc->platform_attached) { error = ig4iic_detach(sc); if (error) return (error); - sc->pci_attached = 0; + sc->platform_attached = 0; } if (sc->intr_res) { @@ -174,10 +169,6 @@ ig4iic_pci_detach(device_t dev) sc->regs_rid, sc->regs_res); sc->regs_res = NULL; } - if (mtx_initialized(&sc->io_lock)) { - mtx_destroy(&sc->io_lock); - sx_destroy(&sc->call_lock); - } return (0); } @@ -196,15 +187,15 @@ static device_method_t ig4iic_pci_method }; static driver_t ig4iic_pci_driver = { - "ig4iic", + "ig4iic_pci", ig4iic_pci_methods, sizeof(struct ig4iic_softc) }; static devclass_t ig4iic_pci_devclass; -DRIVER_MODULE_ORDERED(ig4iic, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0, +DRIVER_MODULE_ORDERED(ig4iic_pci, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0, SI_ORDER_ANY); -MODULE_DEPEND(ig4iic, pci, 1, 1, 1); -MODULE_DEPEND(ig4iic, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(ig4iic, 1); +MODULE_DEPEND(ig4iic_pci, pci, 1, 1, 1); +MODULE_DEPEND(ig4iic_pci, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(ig4iic_pci, 1); Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Mon Dec 26 21:27:21 2016 (r310620) +++ head/sys/dev/ichiic/ig4_var.h Mon Dec 26 22:13:43 2016 (r310621) @@ -65,7 +65,7 @@ struct ig4iic_softc { char rbuf[IG4_RBUFSIZE]; int error; uint8_t last_slave; - int pci_attached : 1; + int platform_attached : 1; int use_10bit : 1; int slave_valid : 1; int read_started : 1; Modified: head/sys/modules/i2c/controllers/ichiic/Makefile ============================================================================== --- head/sys/modules/i2c/controllers/ichiic/Makefile Mon Dec 26 21:27:21 2016 (r310620) +++ head/sys/modules/i2c/controllers/ichiic/Makefile Mon Dec 26 22:13:43 2016 (r310621) @@ -2,7 +2,12 @@ .PATH: ${.CURDIR}/../../../../dev/ichiic KMOD = ig4 -SRCS = device_if.h bus_if.h iicbus_if.h pci_if.h smbus_if.h \ - ig4_iic.c ig4_pci.c ig4_reg.h ig4_var.h +SRCS = acpi_if.h device_if.h bus_if.h iicbus_if.h pci_if.h \ + smbus_if.h ${ig4_acpi} ig4_iic.c ig4_pci.c ig4_reg.h \ + ig4_var.h opt_acpi.h + +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +ig4_acpi= ig4_acpi.c +.endif .include From owner-svn-src-all@freebsd.org Tue Dec 27 00:51:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46EC5C90CED; Tue, 27 Dec 2016 00:51:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB31015A1; Tue, 27 Dec 2016 00:51:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBR0puxu099921; Tue, 27 Dec 2016 00:51:56 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBR0psiH099168; Tue, 27 Dec 2016 00:51:54 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612270051.uBR0psiH099168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 27 Dec 2016 00:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310622 - in vendor/libarchive/dist: . cpio/test libarchive libarchive/test tar X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 00:51:57 -0000 Author: mm Date: Tue Dec 27 00:51:53 2016 New Revision: 310622 URL: https://svnweb.freebsd.org/changeset/base/310622 Log: Update vendor/libarchive to git to 42a3408ac7df1e69bea9ea12b72e14f59f7400c0 Vendor bugfixes: PR 844: Coverity bug fixes in tests PR 846: Spelling fixes PR 850: Fix issues with reading certain jar files PR 826: OpenSSL 1.1 support PR 830, 831, 833: Spelling fixes OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free() OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives OSS-Fuzz 286: Bugfix in archive_strncat_l() Added: vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/cpio/test/test_owner_parse.c vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c vendor/libarchive/dist/libarchive/test/test_write_disk_appledouble.c vendor/libarchive/dist/libarchive/test/test_write_format_xar_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_zip_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_zip_empty_zip64.c vendor/libarchive/dist/tar/read.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/Makefile.am Tue Dec 27 00:51:53 2016 (r310622) @@ -483,6 +483,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_zip_encryption_header.c \ libarchive/test/test_read_format_zip_filename.c \ libarchive/test/test_read_format_zip_high_compression.c \ + libarchive/test/test_read_format_zip_jar.c \ libarchive/test/test_read_format_zip_mac_metadata.c \ libarchive/test/test_read_format_zip_malformed.c \ libarchive/test/test_read_format_zip_msdos.c \ @@ -801,6 +802,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu \ libarchive/test/test_read_format_zip_high_compression.zip.uu \ libarchive/test/test_read_format_zip_length_at_end.zip.uu \ + libarchive/test/test_read_format_zip_jar.jar.uu \ libarchive/test/test_read_format_zip_mac_metadata.zip.uu \ libarchive/test/test_read_format_zip_malformed1.zip.uu \ libarchive/test/test_read_format_zip_msdos.zip.uu \ Modified: vendor/libarchive/dist/cpio/test/test_owner_parse.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_owner_parse.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/cpio/test/test_owner_parse.c Tue Dec 27 00:51:53 2016 (r310622) @@ -38,7 +38,7 @@ static const int root_gids[] = { 0, 1 }; * its primary group membership depends on how the user set up * their /etc/passwd. Likely values are 513 (None), 545 (Users), * or 544 (Administrators). Just check for one of those... - * TODO: Handle non-English localizations...e.g. French 'Administrateur' + * TODO: Handle non-English localizations... e.g. French 'Administrateur' * Use CreateWellKnownSID() and LookupAccountName()? */ #define ROOT "Administrator" Modified: vendor/libarchive/dist/libarchive/archive_read.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read.c Tue Dec 27 00:51:53 2016 (r310622) @@ -764,7 +764,7 @@ archive_read_header_position(struct arch * we cannot say whether there are encrypted entries, then * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. * In general, this function will return values below zero when the - * reader is uncertain or totally uncapable of encryption support. + * reader is uncertain or totally incapable of encryption support. * When this function returns 0 you can be sure that the reader * supports encryption detection but no encrypted entries have * been found yet. Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Tue Dec 27 00:51:53 2016 (r310622) @@ -1026,7 +1026,7 @@ next_entry(struct archive_read_disk *a, /* Save the times to be restored. This must be in before * calling archive_read_disk_descend() or any chance of it, - * especially, invokng a callback. */ + * especially, invoking a callback. */ t->restore_time.mtime = archive_entry_mtime(entry); t->restore_time.mtime_nsec = archive_entry_mtime_nsec(entry); t->restore_time.atime = archive_entry_atime(entry); Modified: vendor/libarchive/dist/libarchive/archive_read_disk_windows.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_disk_windows.c Tue Dec 27 00:51:53 2016 (r310622) @@ -862,7 +862,7 @@ next_entry(struct archive_read_disk *a, /* Save the times to be restored. This must be in before * calling archive_read_disk_descend() or any chance of it, - * especially, invokng a callback. */ + * especially, invoking a callback. */ t->restore_time.lastWriteTime = st->ftLastWriteTime; t->restore_time.lastAccessTime = st->ftLastAccessTime; t->restore_time.filetype = archive_entry_filetype(entry); Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c Tue Dec 27 00:51:53 2016 (r310622) @@ -293,7 +293,7 @@ lzma_bidder_bid(struct archive_read_filt /* Second through fifth bytes are dictionary size, stored in * little-endian order. The minimum dictionary size is * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option - * -d12 and the maxinam dictionary size is 1 << 27(128MiB) + * -d12 and the maximum dictionary size is 1 << 27(128MiB) * which the one uses with option -d27. * NOTE: A comment of LZMA SDK source code says this dictionary * range is from 1 << 12 to 1 << 30. */ @@ -584,9 +584,7 @@ lzip_init(struct archive_read_filter *se return (ARCHIVE_FATAL); } ret = lzma_raw_decoder(&(state->stream), filters); -#if LZMA_VERSION < 50010000 free(filters[0].options); -#endif if (ret != LZMA_OK) { set_error(self, ret); return (ARCHIVE_FATAL); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Tue Dec 27 00:51:53 2016 (r310622) @@ -263,22 +263,22 @@ struct _7zip { /* * Decompressor controllers. */ - /* Decording LZMA1 and LZMA2 data. */ + /* Decoding LZMA1 and LZMA2 data. */ #ifdef HAVE_LZMA_H lzma_stream lzstream; int lzstream_valid; #endif - /* Decording bzip2 data. */ + /* Decoding bzip2 data. */ #if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) bz_stream bzstream; int bzstream_valid; #endif - /* Decording deflate data. */ + /* Decoding deflate data. */ #ifdef HAVE_ZLIB_H z_stream stream; int stream_valid; #endif - /* Decording PPMd data. */ + /* Decoding PPMd data. */ int ppmd7_stat; CPpmd7 ppmd7_context; CPpmd7z_RangeDec range_dec; @@ -1056,10 +1056,7 @@ init_decompression(struct archive_read * #endif { lzma_options_delta delta_opt; - lzma_filter filters[LZMA_FILTERS_MAX]; -#if LZMA_VERSION < 50010000 - lzma_filter *ff; -#endif + lzma_filter filters[LZMA_FILTERS_MAX], *ff; int fi = 0; if (zip->lzstream_valid) { @@ -1144,9 +1141,7 @@ init_decompression(struct archive_read * else filters[fi].id = LZMA_FILTER_LZMA1; filters[fi].options = NULL; -#if LZMA_VERSION < 50010000 ff = &filters[fi]; -#endif r = lzma_properties_decode(&filters[fi], NULL, coder1->properties, (size_t)coder1->propertiesSize); if (r != LZMA_OK) { @@ -1158,9 +1153,7 @@ init_decompression(struct archive_read * filters[fi].id = LZMA_VLI_UNKNOWN; filters[fi].options = NULL; r = lzma_raw_decoder(&(zip->lzstream), filters); -#if LZMA_VERSION < 50010000 free(ff->options); -#endif if (r != LZMA_OK) { set_error(a, r); return (ARCHIVE_FAILED); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c Tue Dec 27 00:51:53 2016 (r310622) @@ -326,7 +326,7 @@ archive_read_format_cpio_options(struct cpio = (struct cpio *)(a->format->data); if (strcmp(key, "compat-2x") == 0) { - /* Handle filnames as libarchive 2.x */ + /* Handle filenames as libarchive 2.x */ cpio->init_default_conversion = (val != NULL)?1:0; return (ARCHIVE_OK); } else if (strcmp(key, "hdrcharset") == 0) { Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Tue Dec 27 00:51:53 2016 (r310622) @@ -864,29 +864,33 @@ zip_read_local_file_header(struct archiv zip_entry->mode |= AE_IFREG; } - if ((zip_entry->mode & AE_IFMT) == 0) { - /* Especially in streaming mode, we can end up - here without having seen proper mode information. - Guess from the filename. */ + /* If the mode is totally empty, set some sane default. */ + if (zip_entry->mode == 0) { + zip_entry->mode |= 0664; + } + + /* Make sure that entries with a trailing '/' are marked as directories + * even if the External File Attributes contains bogus values. If this + * is not a directory and there is no type, assume regularfile. */ + if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) { + int has_slash; + wp = archive_entry_pathname_w(entry); if (wp != NULL) { len = wcslen(wp); - if (len > 0 && wp[len - 1] == L'/') - zip_entry->mode |= AE_IFDIR; - else - zip_entry->mode |= AE_IFREG; + has_slash = len > 0 && wp[len - 1] == L'/'; } else { cp = archive_entry_pathname(entry); len = (cp != NULL)?strlen(cp):0; - if (len > 0 && cp[len - 1] == '/') - zip_entry->mode |= AE_IFDIR; - else - zip_entry->mode |= AE_IFREG; - } - if (zip_entry->mode == AE_IFDIR) { - zip_entry->mode |= 0775; - } else if (zip_entry->mode == AE_IFREG) { - zip_entry->mode |= 0664; + has_slash = len > 0 && cp[len - 1] == '/'; + } + /* Correct file type as needed. */ + if (has_slash) { + zip_entry->mode &= ~AE_IFMT; + zip_entry->mode |= AE_IFDIR; + zip_entry->mode |= 0111; + } else if ((zip_entry->mode & AE_IFMT) == 0) { + zip_entry->mode |= AE_IFREG; } } Modified: vendor/libarchive/dist/libarchive/archive_string.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_string.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_string.c Tue Dec 27 00:51:53 2016 (r310622) @@ -1827,7 +1827,7 @@ archive_string_conversion_set_opt(struct * A filename in UTF-8 was made with libarchive 2.x in a wrong * assumption that wchar_t was Unicode. * This option enables simulating the assumption in order to read - * that filname correctly. + * that filename correctly. */ case SCONV_SET_OPT_UTF8_LIBARCHIVE2X: #if (defined(_WIN32) && !defined(__CYGWIN__)) \ @@ -1939,12 +1939,19 @@ archive_strncat_l(struct archive_string struct archive_string_conv *sc) { const void *s; - size_t length; + size_t length = 0; int i, r = 0, r2; + if (_p != NULL && n > 0) { + if (sc != NULL && (sc->flag & SCONV_FROM_UTF16)) + length = utf16nbytes(_p, n); + else + length = mbsnbytes(_p, n); + } + /* We must allocate memory even if there is no data for conversion * or copy. This simulates archive_string_append behavior. */ - if (_p == NULL || n == 0) { + if (length == 0) { int tn = 1; if (sc != NULL && (sc->flag & SCONV_TO_UTF16)) tn = 2; @@ -1960,16 +1967,11 @@ archive_strncat_l(struct archive_string * If sc is NULL, we just make a copy. */ if (sc == NULL) { - length = mbsnbytes(_p, n); if (archive_string_append(as, _p, length) == NULL) return (-1);/* No memory */ return (0); } - if (sc->flag & SCONV_FROM_UTF16) - length = utf16nbytes(_p, n); - else - length = mbsnbytes(_p, n); s = _p; i = 0; if (sc->nconverter > 1) { Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Tue Dec 27 00:51:53 2016 (r310622) @@ -680,7 +680,7 @@ struct iso9660 { /* The creation time of ISO image. */ time_t birth_time; /* A file stream of a temporary file, which file contents - * save to until ISO iamge can be created. */ + * save to until ISO image can be created. */ int temp_fd; struct isofile *cur_file; @@ -1995,7 +1995,7 @@ iso9660_close(struct archive_write *a) * Write an ISO 9660 image. */ - /* Switc to start using wbuff as file buffer. */ + /* Switch to start using wbuff as file buffer. */ iso9660->wbuff_remaining = wb_buffmax(); iso9660->wbuff_type = WB_TO_STREAM; iso9660->wbuff_offset = 0; @@ -4558,7 +4558,7 @@ write_file_descriptors(struct archive_wr file->cur_content = &(file->content); do { blocks += file->cur_content->blocks; - /* Next fragument */ + /* Next fragment */ file->cur_content = file->cur_content->next; } while (file->cur_content != NULL); } @@ -4748,7 +4748,7 @@ isofile_gen_utility_names(struct archive } /* - * Converte a filename to UTF-16BE. + * Convert a filename to UTF-16BE. */ if (0 > archive_entry_pathname_l(file->entry, &u16, &u16len, iso9660->sconv_to_utf16be)) { @@ -5512,7 +5512,7 @@ isoent_setup_file_location(struct iso966 file->cur_content->location = location; location += file->cur_content->blocks; total_block += file->cur_content->blocks; - /* Next fragument */ + /* Next fragment */ file->cur_content = file->cur_content->next; } while (file->cur_content != NULL); } @@ -6164,7 +6164,7 @@ isoent_gen_iso9660_identifier(struct arc np->id_len = l = ext_off + np->ext_len; /* Make an offset of the number which is used to be set - * hexadecimal number to avoid duplicate identififier. */ + * hexadecimal number to avoid duplicate identifier. */ if (iso9660->opt.iso_level == 1) { if (ext_off >= 5) noff = 5; @@ -6742,7 +6742,7 @@ isoent_rr_move(struct archive_write *a) int r; pt = &(iso9660->primary.pathtbl[MAX_DEPTH-1]); - /* Theare aren't level 8 directories reaching a deepr level. */ + /* There aren't level 8 directories reaching a deeper level. */ if (pt->cnt == 0) return (ARCHIVE_OK); @@ -6813,7 +6813,7 @@ _compare_path_table(const void *v1, cons if (cmp != 0) return (cmp); - /* Compare indetifier */ + /* Compare identifier */ s1 = p1->identifier; s2 = p2->identifier; l = p1->ext_off; @@ -6855,7 +6855,7 @@ _compare_path_table_joliet(const void *v if (cmp != 0) return (cmp); - /* Compare indetifier */ + /* Compare identifier */ s1 = (const unsigned char *)p1->identifier; s2 = (const unsigned char *)p2->identifier; l = p1->ext_off; Modified: vendor/libarchive/dist/libarchive/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/test/CMakeLists.txt Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/test/CMakeLists.txt Tue Dec 27 00:51:53 2016 (r310622) @@ -169,6 +169,7 @@ IF(ENABLE_TEST) test_read_format_zip_encryption_partially.c test_read_format_zip_filename.c test_read_format_zip_high_compression.c + test_read_format_zip_jar.c test_read_format_zip_mac_metadata.c test_read_format_zip_malformed.c test_read_format_zip_msdos.c Modified: vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c Mon Dec 26 22:13:43 2016 (r310621) +++ vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c Tue Dec 27 00:51:53 2016 (r310622) @@ -500,8 +500,8 @@ test_basic(void) /* * We should be on the initial directory where we performed - * archive_read_disk_new() after we perfome archive_read_free() - * even if we broke off the directory traversals. + * archive_read_disk_new() after we perform archive_read_free() + * even if we broke off the directory traversals. */ /* Save current working directory. */ @@ -1565,11 +1565,11 @@ DEFINE_TEST(test_read_disk_directory_tra { /* Basic test. */ test_basic(); - /* Test hybird mode; follow symlink initially, then not. */ + /* Test hybrid mode; follow symlink initially, then not. */ test_symlink_hybrid(); - /* Test logcal mode; follow all symlinks. */ + /* Test logical mode; follow all symlinks. */ test_symlink_logical(); - /* Test logcal mode; prevent loop in symlinks. */ + /* Test logical mode; prevent loop in symlinks. */ test_symlink_logical_loop(); /* Test to restore atime. */ test_restore_atime(); Added: vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c Tue Dec 27 00:51:53 2016 (r310622) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2016 Peter Wu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Issue 822: jar files have an empty External File Attributes field which + * is misinterpreted as regular file type due to OS MS-DOS. + */ + +DEFINE_TEST(test_read_format_zip_jar) +{ + const char *refname = "test_read_format_zip_jar.jar"; + char *p; + size_t s; + struct archive *a; + struct archive_entry *ae; + char data[16]; + + extract_reference_file(refname); + p = slurpfile(&s, refname); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip_seekable(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("somedir/", archive_entry_pathname(ae)); + assertEqualInt(AE_IFDIR | 0775, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualIntA(a, 0, archive_read_data(a, data, 16)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); + free(p); +} Added: vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu Tue Dec 27 00:51:53 2016 (r310622) @@ -0,0 +1,6 @@ +begin 640 test_read_format_zip_jar.jar +M4$L#! H @ $AQETD ( 0 Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3930C91267; Tue, 27 Dec 2016 01:10:31 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 921C31CC2; Tue, 27 Dec 2016 01:10:31 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBR1AUk9005241; Tue, 27 Dec 2016 01:10:30 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBR1AS3a005222; Tue, 27 Dec 2016 01:10:28 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612270110.uBR1AS3a005222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 27 Dec 2016 01:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310623 - in head: contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 01:10:32 -0000 Author: mm Date: Tue Dec 27 01:10:28 2016 New Revision: 310623 URL: https://svnweb.freebsd.org/changeset/base/310623 Log: MFV r310622: Sync libarchive with vendor. Vendor bugfixes (relevant to FreeBSD): PR 846: Spelling fixes PR 850: Fix issues with reading certain jar files OSS-Fuzz 286: Bugfix in archive_strncat_l() Added: head/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c - copied unchanged from r310622, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c head/contrib/libarchive/libarchive/test/test_read_format_zip_jar.jar.uu - copied unchanged from r310622, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu Modified: head/contrib/libarchive/cpio/test/test_owner_parse.c head/contrib/libarchive/libarchive/archive_read.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_string.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c head/contrib/libarchive/libarchive/test/test_write_disk_appledouble.c head/contrib/libarchive/libarchive/test/test_write_format_xar_empty.c head/contrib/libarchive/libarchive/test/test_write_format_zip_empty.c head/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c head/contrib/libarchive/tar/read.c head/contrib/libarchive/tar/write.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/cpio/test/test_owner_parse.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_owner_parse.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/cpio/test/test_owner_parse.c Tue Dec 27 01:10:28 2016 (r310623) @@ -38,7 +38,7 @@ static const int root_gids[] = { 0, 1 }; * its primary group membership depends on how the user set up * their /etc/passwd. Likely values are 513 (None), 545 (Users), * or 544 (Administrators). Just check for one of those... - * TODO: Handle non-English localizations...e.g. French 'Administrateur' + * TODO: Handle non-English localizations... e.g. French 'Administrateur' * Use CreateWellKnownSID() and LookupAccountName()? */ #define ROOT "Administrator" Modified: head/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_read.c Tue Dec 27 01:10:28 2016 (r310623) @@ -764,7 +764,7 @@ archive_read_header_position(struct arch * we cannot say whether there are encrypted entries, then * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. * In general, this function will return values below zero when the - * reader is uncertain or totally uncapable of encryption support. + * reader is uncertain or totally incapable of encryption support. * When this function returns 0 you can be sure that the reader * supports encryption detection but no encrypted entries have * been found yet. Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Tue Dec 27 01:10:28 2016 (r310623) @@ -1026,7 +1026,7 @@ next_entry(struct archive_read_disk *a, /* Save the times to be restored. This must be in before * calling archive_read_disk_descend() or any chance of it, - * especially, invokng a callback. */ + * especially, invoking a callback. */ t->restore_time.mtime = archive_entry_mtime(entry); t->restore_time.mtime_nsec = archive_entry_mtime_nsec(entry); t->restore_time.atime = archive_entry_atime(entry); Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Tue Dec 27 01:10:28 2016 (r310623) @@ -293,7 +293,7 @@ lzma_bidder_bid(struct archive_read_filt /* Second through fifth bytes are dictionary size, stored in * little-endian order. The minimum dictionary size is * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option - * -d12 and the maxinam dictionary size is 1 << 27(128MiB) + * -d12 and the maximum dictionary size is 1 << 27(128MiB) * which the one uses with option -d27. * NOTE: A comment of LZMA SDK source code says this dictionary * range is from 1 << 12 to 1 << 30. */ @@ -584,9 +584,7 @@ lzip_init(struct archive_read_filter *se return (ARCHIVE_FATAL); } ret = lzma_raw_decoder(&(state->stream), filters); -#if LZMA_VERSION < 50010000 free(filters[0].options); -#endif if (ret != LZMA_OK) { set_error(self, ret); return (ARCHIVE_FATAL); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Tue Dec 27 01:10:28 2016 (r310623) @@ -263,22 +263,22 @@ struct _7zip { /* * Decompressor controllers. */ - /* Decording LZMA1 and LZMA2 data. */ + /* Decoding LZMA1 and LZMA2 data. */ #ifdef HAVE_LZMA_H lzma_stream lzstream; int lzstream_valid; #endif - /* Decording bzip2 data. */ + /* Decoding bzip2 data. */ #if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) bz_stream bzstream; int bzstream_valid; #endif - /* Decording deflate data. */ + /* Decoding deflate data. */ #ifdef HAVE_ZLIB_H z_stream stream; int stream_valid; #endif - /* Decording PPMd data. */ + /* Decoding PPMd data. */ int ppmd7_stat; CPpmd7 ppmd7_context; CPpmd7z_RangeDec range_dec; @@ -1056,10 +1056,7 @@ init_decompression(struct archive_read * #endif { lzma_options_delta delta_opt; - lzma_filter filters[LZMA_FILTERS_MAX]; -#if LZMA_VERSION < 50010000 - lzma_filter *ff; -#endif + lzma_filter filters[LZMA_FILTERS_MAX], *ff; int fi = 0; if (zip->lzstream_valid) { @@ -1144,9 +1141,7 @@ init_decompression(struct archive_read * else filters[fi].id = LZMA_FILTER_LZMA1; filters[fi].options = NULL; -#if LZMA_VERSION < 50010000 ff = &filters[fi]; -#endif r = lzma_properties_decode(&filters[fi], NULL, coder1->properties, (size_t)coder1->propertiesSize); if (r != LZMA_OK) { @@ -1158,9 +1153,7 @@ init_decompression(struct archive_read * filters[fi].id = LZMA_VLI_UNKNOWN; filters[fi].options = NULL; r = lzma_raw_decoder(&(zip->lzstream), filters); -#if LZMA_VERSION < 50010000 free(ff->options); -#endif if (r != LZMA_OK) { set_error(a, r); return (ARCHIVE_FAILED); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Tue Dec 27 01:10:28 2016 (r310623) @@ -326,7 +326,7 @@ archive_read_format_cpio_options(struct cpio = (struct cpio *)(a->format->data); if (strcmp(key, "compat-2x") == 0) { - /* Handle filnames as libarchive 2.x */ + /* Handle filenames as libarchive 2.x */ cpio->init_default_conversion = (val != NULL)?1:0; return (ARCHIVE_OK); } else if (strcmp(key, "hdrcharset") == 0) { Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Tue Dec 27 01:10:28 2016 (r310623) @@ -864,29 +864,33 @@ zip_read_local_file_header(struct archiv zip_entry->mode |= AE_IFREG; } - if ((zip_entry->mode & AE_IFMT) == 0) { - /* Especially in streaming mode, we can end up - here without having seen proper mode information. - Guess from the filename. */ + /* If the mode is totally empty, set some sane default. */ + if (zip_entry->mode == 0) { + zip_entry->mode |= 0664; + } + + /* Make sure that entries with a trailing '/' are marked as directories + * even if the External File Attributes contains bogus values. If this + * is not a directory and there is no type, assume regularfile. */ + if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) { + int has_slash; + wp = archive_entry_pathname_w(entry); if (wp != NULL) { len = wcslen(wp); - if (len > 0 && wp[len - 1] == L'/') - zip_entry->mode |= AE_IFDIR; - else - zip_entry->mode |= AE_IFREG; + has_slash = len > 0 && wp[len - 1] == L'/'; } else { cp = archive_entry_pathname(entry); len = (cp != NULL)?strlen(cp):0; - if (len > 0 && cp[len - 1] == '/') - zip_entry->mode |= AE_IFDIR; - else - zip_entry->mode |= AE_IFREG; - } - if (zip_entry->mode == AE_IFDIR) { - zip_entry->mode |= 0775; - } else if (zip_entry->mode == AE_IFREG) { - zip_entry->mode |= 0664; + has_slash = len > 0 && cp[len - 1] == '/'; + } + /* Correct file type as needed. */ + if (has_slash) { + zip_entry->mode &= ~AE_IFMT; + zip_entry->mode |= AE_IFDIR; + zip_entry->mode |= 0111; + } else if ((zip_entry->mode & AE_IFMT) == 0) { + zip_entry->mode |= AE_IFREG; } } Modified: head/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_string.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_string.c Tue Dec 27 01:10:28 2016 (r310623) @@ -1827,7 +1827,7 @@ archive_string_conversion_set_opt(struct * A filename in UTF-8 was made with libarchive 2.x in a wrong * assumption that wchar_t was Unicode. * This option enables simulating the assumption in order to read - * that filname correctly. + * that filename correctly. */ case SCONV_SET_OPT_UTF8_LIBARCHIVE2X: #if (defined(_WIN32) && !defined(__CYGWIN__)) \ @@ -1939,12 +1939,19 @@ archive_strncat_l(struct archive_string struct archive_string_conv *sc) { const void *s; - size_t length; + size_t length = 0; int i, r = 0, r2; + if (_p != NULL && n > 0) { + if (sc != NULL && (sc->flag & SCONV_FROM_UTF16)) + length = utf16nbytes(_p, n); + else + length = mbsnbytes(_p, n); + } + /* We must allocate memory even if there is no data for conversion * or copy. This simulates archive_string_append behavior. */ - if (_p == NULL || n == 0) { + if (length == 0) { int tn = 1; if (sc != NULL && (sc->flag & SCONV_TO_UTF16)) tn = 2; @@ -1960,16 +1967,11 @@ archive_strncat_l(struct archive_string * If sc is NULL, we just make a copy. */ if (sc == NULL) { - length = mbsnbytes(_p, n); if (archive_string_append(as, _p, length) == NULL) return (-1);/* No memory */ return (0); } - if (sc->flag & SCONV_FROM_UTF16) - length = utf16nbytes(_p, n); - else - length = mbsnbytes(_p, n); s = _p; i = 0; if (sc->nconverter > 1) { Modified: head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Tue Dec 27 01:10:28 2016 (r310623) @@ -680,7 +680,7 @@ struct iso9660 { /* The creation time of ISO image. */ time_t birth_time; /* A file stream of a temporary file, which file contents - * save to until ISO iamge can be created. */ + * save to until ISO image can be created. */ int temp_fd; struct isofile *cur_file; @@ -1995,7 +1995,7 @@ iso9660_close(struct archive_write *a) * Write an ISO 9660 image. */ - /* Switc to start using wbuff as file buffer. */ + /* Switch to start using wbuff as file buffer. */ iso9660->wbuff_remaining = wb_buffmax(); iso9660->wbuff_type = WB_TO_STREAM; iso9660->wbuff_offset = 0; @@ -4558,7 +4558,7 @@ write_file_descriptors(struct archive_wr file->cur_content = &(file->content); do { blocks += file->cur_content->blocks; - /* Next fragument */ + /* Next fragment */ file->cur_content = file->cur_content->next; } while (file->cur_content != NULL); } @@ -4748,7 +4748,7 @@ isofile_gen_utility_names(struct archive } /* - * Converte a filename to UTF-16BE. + * Convert a filename to UTF-16BE. */ if (0 > archive_entry_pathname_l(file->entry, &u16, &u16len, iso9660->sconv_to_utf16be)) { @@ -5512,7 +5512,7 @@ isoent_setup_file_location(struct iso966 file->cur_content->location = location; location += file->cur_content->blocks; total_block += file->cur_content->blocks; - /* Next fragument */ + /* Next fragment */ file->cur_content = file->cur_content->next; } while (file->cur_content != NULL); } @@ -6164,7 +6164,7 @@ isoent_gen_iso9660_identifier(struct arc np->id_len = l = ext_off + np->ext_len; /* Make an offset of the number which is used to be set - * hexadecimal number to avoid duplicate identififier. */ + * hexadecimal number to avoid duplicate identifier. */ if (iso9660->opt.iso_level == 1) { if (ext_off >= 5) noff = 5; @@ -6742,7 +6742,7 @@ isoent_rr_move(struct archive_write *a) int r; pt = &(iso9660->primary.pathtbl[MAX_DEPTH-1]); - /* Theare aren't level 8 directories reaching a deepr level. */ + /* There aren't level 8 directories reaching a deeper level. */ if (pt->cnt == 0) return (ARCHIVE_OK); @@ -6813,7 +6813,7 @@ _compare_path_table(const void *v1, cons if (cmp != 0) return (cmp); - /* Compare indetifier */ + /* Compare identifier */ s1 = p1->identifier; s2 = p2->identifier; l = p1->ext_off; @@ -6855,7 +6855,7 @@ _compare_path_table_joliet(const void *v if (cmp != 0) return (cmp); - /* Compare indetifier */ + /* Compare identifier */ s1 = (const unsigned char *)p1->identifier; s2 = (const unsigned char *)p2->identifier; l = p1->ext_off; Modified: head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c Tue Dec 27 00:51:53 2016 (r310622) +++ head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c Tue Dec 27 01:10:28 2016 (r310623) @@ -500,8 +500,8 @@ test_basic(void) /* * We should be on the initial directory where we performed - * archive_read_disk_new() after we perfome archive_read_free() - * even if we broke off the directory traversals. + * archive_read_disk_new() after we perform archive_read_free() + * even if we broke off the directory traversals. */ /* Save current working directory. */ @@ -1565,11 +1565,11 @@ DEFINE_TEST(test_read_disk_directory_tra { /* Basic test. */ test_basic(); - /* Test hybird mode; follow symlink initially, then not. */ + /* Test hybrid mode; follow symlink initially, then not. */ test_symlink_hybrid(); - /* Test logcal mode; follow all symlinks. */ + /* Test logical mode; follow all symlinks. */ test_symlink_logical(); - /* Test logcal mode; prevent loop in symlinks. */ + /* Test logical mode; prevent loop in symlinks. */ test_symlink_logical_loop(); /* Test to restore atime. */ test_restore_atime(); Copied: head/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c (from r310622, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c Tue Dec 27 01:10:28 2016 (r310623, copy of r310622, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2016 Peter Wu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Issue 822: jar files have an empty External File Attributes field which + * is misinterpreted as regular file type due to OS MS-DOS. + */ + +DEFINE_TEST(test_read_format_zip_jar) +{ + const char *refname = "test_read_format_zip_jar.jar"; + char *p; + size_t s; + struct archive *a; + struct archive_entry *ae; + char data[16]; + + extract_reference_file(refname); + p = slurpfile(&s, refname); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip_seekable(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("somedir/", archive_entry_pathname(ae)); + assertEqualInt(AE_IFDIR | 0775, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualIntA(a, 0, archive_read_data(a, data, 16)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); + free(p); +} Copied: head/contrib/libarchive/libarchive/test/test_read_format_zip_jar.jar.uu (from r310622, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_jar.jar.uu Tue Dec 27 01:10:28 2016 (r310623, copy of r310622, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu) @@ -0,0 +1,6 @@ +begin 640 test_read_format_zip_jar.jar +M4$L#! H @ $AQETD ( 0 Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D1CC92161; Tue, 27 Dec 2016 06:10:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC5871245; Tue, 27 Dec 2016 06:10:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBR6ATpI025715; Tue, 27 Dec 2016 06:10:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBR6ASrp025710; Tue, 27 Dec 2016 06:10:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612270610.uBR6ASrp025710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 27 Dec 2016 06:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310624 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 06:10:30 -0000 Author: adrian Date: Tue Dec 27 06:10:28 2016 New Revision: 310624 URL: https://svnweb.freebsd.org/changeset/base/310624 Log: [net80211] turn the default TX key configuration (for WEP) into a vap callback. The ath10k firmware supports hardware WEP offload, and in native wifi mode (or 802.3 ethernet mode, for that matter) the WEP key isn't actually included in the TX payload from net80211. Instead, a separate firmware command is issued that sets the default TX key to be the specified key. However, net80211 doesn't at all inform the driver layer that this is occuring - it just "expects" to be inserting WEP header information when doing WEP TX, even with hardware encryption. So, to better support the newer world order, turn the default TX key assignment into a VAP method that can be overridden by the driver and ensure its wrapped in a crypto begin/end set. That way it should be correctly atomic from the point of view of keychanges (as long as the driver does the right thing.) It'd be nice if we passed through to the key_set call a flag that says "also make this the default key" - that's captured here by calling the deftxkey method after the key_set method. Maybe I can do that later. Note: this is a net80211 ABI change, and will require a kernel+modules recompile. Happy Holidays, etc. Tested: * ath10k driver port * rtwn_usb, WEP station Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_crypto.c head/sys/net80211/ieee80211_crypto.h head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Dec 27 01:10:28 2016 (r310623) +++ head/sys/net80211/ieee80211.c Tue Dec 27 06:10:28 2016 (r310624) @@ -433,6 +433,22 @@ default_reset(struct ieee80211vap *vap, } /* + * Default for updating the VAP default TX key index. + * + * Drivers that support TX offload as well as hardware encryption offload + * may need to be informed of key index changes separate from the key + * update. + */ +static void +default_update_deftxkey(struct ieee80211vap *vap, ieee80211_keyix kid) +{ + + /* XXX assert validity */ + /* XXX assert we're in a key update block */ + vap->iv_def_txkey = kid; +} + +/* * Add underlying device errors to vap errors. */ static uint64_t @@ -561,6 +577,12 @@ ieee80211_vap_setup(struct ieee80211com */ vap->iv_reset = default_reset; + /* + * Install a default crypto key update method, the driver + * can override this. + */ + vap->iv_update_deftxkey = default_update_deftxkey; + ieee80211_sysctl_vattach(vap); ieee80211_crypto_vattach(vap); ieee80211_node_vattach(vap); Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Tue Dec 27 01:10:28 2016 (r310623) +++ head/sys/net80211/ieee80211_crypto.c Tue Dec 27 06:10:28 2016 (r310624) @@ -787,3 +787,18 @@ ieee80211_crypto_reload_keys(struct ieee */ ieee80211_iterate_nodes(&ic->ic_sta, load_ucastkey, NULL); } + +/* + * Set the default key index for WEP, or KEYIX_NONE for no default TX key. + * + * This should be done as part of a key update block (iv_key_update_begin / + * iv_key_update_end.) + */ +void +ieee80211_crypto_set_deftxkey(struct ieee80211vap *vap, ieee80211_keyix kid) +{ + + /* XXX TODO: assert we're in a key update block */ + + vap->iv_update_deftxkey(vap, kid); +} Modified: head/sys/net80211/ieee80211_crypto.h ============================================================================== --- head/sys/net80211/ieee80211_crypto.h Tue Dec 27 01:10:28 2016 (r310623) +++ head/sys/net80211/ieee80211_crypto.h Tue Dec 27 06:10:28 2016 (r310624) @@ -171,6 +171,8 @@ int ieee80211_crypto_delkey(struct ieee8 int ieee80211_crypto_setkey(struct ieee80211vap *, struct ieee80211_key *); void ieee80211_crypto_delglobalkeys(struct ieee80211vap *); void ieee80211_crypto_reload_keys(struct ieee80211com *); +void ieee80211_crypto_set_deftxkey(struct ieee80211vap *, + ieee80211_keyix kid); /* * Template for a supported cipher. Ciphers register with the Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Dec 27 01:10:28 2016 (r310623) +++ head/sys/net80211/ieee80211_ioctl.c Tue Dec 27 06:10:28 2016 (r310624) @@ -855,6 +855,8 @@ ieee80211_ioctl_get80211(struct ieee8021 * Tx power limit is the min of max regulatory * power, any user-set limit, and the max the * radio can do. + * + * TODO: methodize this */ ireq->i_val = 2*ic->ic_curchan->ic_maxregpower; if (ireq->i_val > ic->ic_txpowlimit) @@ -1013,6 +1015,7 @@ ieee80211_ioctl_get80211(struct ieee8021 ireq->i_val |= 2; break; case IEEE80211_IOC_AMPDU_LIMIT: + /* XXX TODO: make this a per-node thing; and leave this as global */ if (vap->iv_opmode == IEEE80211_M_HOSTAP) ireq->i_val = vap->iv_ampdu_rxmax; else if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) @@ -1026,6 +1029,7 @@ ieee80211_ioctl_get80211(struct ieee8021 ireq->i_val = vap->iv_ampdu_limit; break; case IEEE80211_IOC_AMPDU_DENSITY: + /* XXX TODO: make this a per-node thing; and leave this as global */ if (vap->iv_opmode == IEEE80211_M_STA && (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) /* @@ -1204,7 +1208,15 @@ ieee80211_ioctl_setkey(struct ieee80211v if (!ieee80211_crypto_setkey(vap, wk)) error = EIO; else if ((ik.ik_flags & IEEE80211_KEY_DEFAULT)) - vap->iv_def_txkey = kid; + /* + * Inform the driver that this is the default + * transmit key. Now, ideally we'd just set + * a flag in the key update that would + * say "yes, we're the default key", but + * that currently isn't the way the ioctl -> + * key interface works. + */ + ieee80211_crypto_set_deftxkey(vap, kid); } else error = ENXIO; ieee80211_key_update_end(vap); @@ -2687,7 +2699,17 @@ ieee80211_ioctl_set80211(struct ieee8021 if (kid >= IEEE80211_WEP_NKID && (uint16_t) kid != IEEE80211_KEYIX_NONE) return EINVAL; - vap->iv_def_txkey = kid; + /* + * Firmware devices may need to be told about an explicit + * key index here, versus just inferring it from the + * key set / change. Since we may also need to pause + * things like transmit before the key is updated, + * give the driver a chance to flush things by tying + * into key update begin/end. + */ + ieee80211_key_update_begin(vap); + ieee80211_crypto_set_deftxkey(vap, kid); + ieee80211_key_update_end(vap); break; case IEEE80211_IOC_AUTHMODE: switch (ireq->i_val) { @@ -3094,6 +3116,7 @@ ieee80211_ioctl_set80211(struct ieee8021 error = ERESTART; break; case IEEE80211_IOC_AMPDU_LIMIT: + /* XXX TODO: figure out ampdu_limit versus ampdu_rxmax */ if (!(IEEE80211_HTCAP_MAXRXAMPDU_8K <= ireq->i_val && ireq->i_val <= IEEE80211_HTCAP_MAXRXAMPDU_64K)) return EINVAL; Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Dec 27 01:10:28 2016 (r310623) +++ head/sys/net80211/ieee80211_var.h Tue Dec 27 06:10:28 2016 (r310624) @@ -470,6 +470,8 @@ struct ieee80211vap { struct ieee80211_appie *iv_appie_wpa; uint8_t *iv_wpa_ie; uint8_t *iv_rsn_ie; + + /* Key management */ uint16_t iv_max_keyix; /* max h/w key index */ ieee80211_keyix iv_def_txkey; /* default/group tx key index */ struct ieee80211_key iv_nw_keys[IEEE80211_WEP_NKID]; @@ -482,6 +484,8 @@ struct ieee80211vap { const struct ieee80211_key *); void (*iv_key_update_begin)(struct ieee80211vap *); void (*iv_key_update_end)(struct ieee80211vap *); + void (*iv_update_deftxkey)(struct ieee80211vap *, + ieee80211_keyix deftxkey); const struct ieee80211_authenticator *iv_auth; /* authenticator glue */ void *iv_ec; /* private auth state */ @@ -536,6 +540,7 @@ struct ieee80211vap { /* 802.3 output method for raw frame xmit */ int (*iv_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); + uint64_t iv_spare[6]; }; MALLOC_DECLARE(M_80211_VAP); From owner-svn-src-all@freebsd.org Tue Dec 27 08:19:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95E58C93A86; Tue, 27 Dec 2016 08:19:46 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 880B91610; Tue, 27 Dec 2016 08:19:46 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 5DEAF17985; Tue, 27 Dec 2016 00:19:40 -0800 (PST) Date: Tue, 27 Dec 2016 00:19:40 -0800 From: hiren panchasara To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310547 - head/sys/netinet Message-ID: <20161227081940.GL82166@strugglingcoder.info> References: <201612251737.uBPHbIhd027939@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DMotDPdpQlD4ewOK" Content-Disposition: inline In-Reply-To: <201612251737.uBPHbIhd027939@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 08:19:46 -0000 --DMotDPdpQlD4ewOK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 12/25/16 at 05:37P, Michael Tuexen wrote: > Author: tuexen > Date: Sun Dec 25 17:37:18 2016 > New Revision: 310547 > URL: https://svnweb.freebsd.org/changeset/base/310547 >=20 > Log: > Remove a KASSERT which is not always true. > =20 > In case of the empty queue tp->snd_holes and tcp_sackhole_insert() > failing due to memory shortage, tp->snd_holes will be empty. > This problem was hit when stress tests where performed by pho. > =20 > PR: 215513 > Reported by: pho > Tested by: pho > Sponsored by: Netflix, Inc. >=20 > Modified: > head/sys/netinet/tcp_sack.c Thanks for the fix, Michael. Can you please MFC this? Cheers, Hiren --DMotDPdpQlD4ewOK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYYiQXXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l23YH/0cjn7o0/yLDsEMdLKyN7MRr sxE4g74dafR9ZnfvQAKClJp145fjN0its4oQUEJGbnOvlV9BMTSy48d4M+gsF/zr pVa9//tQYBvpc+zkyt00wP+r+SXq2w9xd9sq/eTLagFAz8bW54XGacm6xCqkKIcs 0SuijW7eCeRiTSJ2HJxy6BeVQi+r/UgMaNe1onObSqgEn8aOB+1j1AaMisYDbAUP bVQX6ipUaInNgpoh0ktmnzehRdI8MPA6l7Kz8fk/PXl5mWeZxOunP4K0rEDPpNt/ jMMjf3EQx4TdNo29PEkKCXlEIfzpi/2j9k6zg3SzC3KtW7D/dy3mdwNGi5cIUm8= =twQt -----END PGP SIGNATURE----- --DMotDPdpQlD4ewOK-- From owner-svn-src-all@freebsd.org Tue Dec 27 08:31:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4432AC93F67; Tue, 27 Dec 2016 08:31:42 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E71761D54; Tue, 27 Dec 2016 08:31:41 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBR8VfkQ081602; Tue, 27 Dec 2016 08:31:41 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBR8VfdH081599; Tue, 27 Dec 2016 08:31:41 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612270831.uBR8VfdH081599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 27 Dec 2016 08:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310625 - in stable/11: share/man/man4 sys/netgraph X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 08:31:42 -0000 Author: julian Date: Tue Dec 27 08:31:40 2016 New Revision: 310625 URL: https://svnweb.freebsd.org/changeset/base/310625 Log: MFH: r309408 Changes to allow the patching of packets with an offset (and other changes.. see man page) PR: 206185 Submitted by: Dmitry Vagin MFC after: 1 week Relnotes: yes (also ng_checksum node) Modified: stable/11/share/man/man4/ng_patch.4 stable/11/sys/netgraph/ng_patch.c stable/11/sys/netgraph/ng_patch.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ng_patch.4 ============================================================================== --- stable/11/share/man/man4/ng_patch.4 Tue Dec 27 06:10:28 2016 (r310624) +++ stable/11/share/man/man4/ng_patch.4 Tue Dec 27 08:31:40 2016 (r310625) @@ -1,5 +1,6 @@ .\" Copyright (c) 2010 Maxim Ignatenko .\" Copyright (c) 2010 Vadim Goncharov +.\" Copyright (c) 2015 Dmitry Vagin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 17, 2015 .Dt NG_PATCH 4 .Os .Sh NAME @@ -47,33 +48,52 @@ A negation operation is the one exceptio and second operand (the .Va value ) is not used. -There may be several modification operations, they are all applied -to a packet sequentially in order they were specified by user. -Data payload of packet is viewed as array of bytes, with zero offset -corresponding to the very first byte of packet headers, and +If there is more than one modification operation, they are applied +to packets sequentially in the order they were specified by the user. +The data payload of a packet is viewed as an array of bytes, with a zero offset +corresponding to the very first byte of packet headers, and the .Va length bytes beginning from .Va offset -are taken as a single integer in network byte order. +as a single integer in network byte order. An additional offset can be optionally +requested at configuration time to account for packet type. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are modified according to rules specified -in config and then forwarded to +in the configuration and then forwarded to the .Ar out -hook, if it exists and connected. +hook, if it exists. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo +.It Dv NGM_PATCH_SETDLT Pq Ic setdlt +Sets the data link type on the +.Va in +hook (to help calculate relative offset). Currently, supported types are +.Cm DLT_RAW +(raw IP datagrams , no offset applied, the default) and +.Cm DLT_EN10MB +(Ethernet). DLT_ definitions can be found in +.In net/bpf.h . +If you want to work on the link layer header you must use no additional offset by specifying +.Cm DLT_RAW . +If +.Cm EN10MB +is specified, then the optional additional offset will take into account the Ethernet header and a QinQ header if present. +.It Dv NGM_PATCH_GETDLT Pq Ic getdlt +This control message returns the data link type of the +.Va in +hook. .It Dv NGM_PATCH_SETCONFIG Pq Ic setconfig This command sets the sequence of modify operations that will be applied to incoming data on a hook. @@ -82,10 +102,10 @@ The following must be supplied as an argument: .Bd -literal -offset 4n struct ng_patch_op { - uint64_t value; uint32_t offset; uint16_t length; /* 1,2,4 or 8 bytes */ uint16_t mode; + uint64_t value; }; /* Patching modes */ #define NG_PATCH_MODE_SET 1 @@ -103,6 +123,7 @@ struct ng_patch_op { struct ng_patch_config { uint32_t count; uint32_t csum_flags; + uint32_t relative_offset; struct ng_patch_op ops[]; }; .Ed @@ -116,14 +137,14 @@ The .Nm node does not do any checksum correction by itself. .It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig -This control message obtains current set of modify operations, -returned as +This control message returns the current set of modify operations, +in the form of a .Vt "struct ng_patch_config" . .It Dv NGM_PATCH_GET_STATS Pq Ic getstats -Returns node statistics as a +Returns the node's statistics as a .Vt "struct ng_patch_stats" . .It Dv NGM_PATCH_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clears the node's statistics. .It Dv NGM_PATCH_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_PATCH_GET_STATS , @@ -134,19 +155,20 @@ This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when all hooks have been disconnected. .Sh EXAMPLES -The +This .Nm -node allows to modify TTL and TOS/DSCP fields in IP packets. -Suppose you have two adjacent simplex links to remote network +node was designed to modify TTL and TOS/DSCP fields in IP packets. +As an example, +suppose you have two adjacent simplex links to a remote network (e.g.\& satellite), so that the packets expiring in between will generate unwanted ICMP-replies which have to go forth, not back. Thus you need to raise TTL of every packet entering link by 2 to ensure the TTL will not reach zero there. -So you setup +To achieve this you can set an .Xr ipfw 8 -rule with +rule to use the .Cm netgraph -action to inject packets going to other end of simplex link by the +action to inject packets which are going to the simplex link into the patch node, by using the following .Xr ngctl 8 script: @@ -160,11 +182,11 @@ SEQ /sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net .Ed .Pp -Here +Here the .Dq Li ttl_add node of type .Nm -configured to add (mode +is configured to add (mode .Dv NG_PATCH_MODE_ADD ) a .Va value @@ -218,13 +240,15 @@ The node type was implemented in .Fx 8.1 . .Sh AUTHORS -.An Maxim Ignatenko Aq Mt gelraen.ua@gmail.com +.An "Maxim Ignatenko" Aq gelraen.ua@gmail.com . +.Pp +Relative offset code by +.An "DMitry Vagin" .Pp -.An -nosplit This manual page was written by -.An Vadim Goncharov Aq Mt vadimnuclight@tpu.ru . +.An "Vadim Goncharov" Aq vadimnuclight@tpu.ru . .Sh BUGS -Node blindly tries to apply every patching operation to each packet +The node blindly tries to apply every patching operation to each packet (except those which offset if greater than length of the packet), so be sure that you supply only the right packets to it (e.g. changing bytes in the ARP packets meant to be in IP header could corrupt @@ -232,6 +256,6 @@ them and make your machine unreachable f .Pp .Em !!! WARNING !!! .Pp -Output path of the IP stack assumes correct fields and lengths in the -packets - changing them by mistake to incorrect values can cause +The output path of the IP stack assumes correct fields and lengths in the +packets - changing them by to incorrect values can cause unpredictable results including kernel panics. Modified: stable/11/sys/netgraph/ng_patch.c ============================================================================== --- stable/11/sys/netgraph/ng_patch.c Tue Dec 27 06:10:28 2016 (r310624) +++ stable/11/sys/netgraph/ng_patch.c Tue Dec 27 08:31:40 2016 (r310625) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2010 Maxim Ignatenko + * Copyright (c) 2010 Maxim Ignatenko + * Copyright (c) 2015 Dmitry Vagin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,11 +35,28 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include + #include #include -#include #include +#include + +/* private data */ +struct ng_patch_priv { + hook_p in; + hook_p out; + uint8_t dlt; /* DLT_XXX from bpf.h */ + struct ng_patch_stats stats; + struct ng_patch_config *conf; +}; + +typedef struct ng_patch_priv *priv_p; + +/* Netgraph methods */ static ng_constructor_t ng_patch_constructor; static ng_rcvmsg_t ng_patch_rcvmsg; static ng_shutdown_t ng_patch_shutdown; @@ -46,6 +64,8 @@ static ng_newhook_t ng_patch_newhook; static ng_rcvdata_t ng_patch_rcvdata; static ng_disconnect_t ng_patch_disconnect; +#define ERROUT(x) { error = (x); goto done; } + static int ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, const u_char *buf) @@ -59,7 +79,7 @@ ng_patch_config_getlen(const struct ng_p } static const struct ng_parse_struct_field ng_patch_op_type_fields[] - = NG_PATCH_OP_TYPE_INFO; + = NG_PATCH_OP_TYPE; static const struct ng_parse_type ng_patch_op_type = { &ng_parse_struct_type, &ng_patch_op_type_fields @@ -75,14 +95,14 @@ static const struct ng_parse_type ng_pat }; static const struct ng_parse_struct_field ng_patch_config_type_fields[] - = NG_PATCH_CONFIG_TYPE_INFO; + = NG_PATCH_CONFIG_TYPE; static const struct ng_parse_type ng_patch_config_type = { &ng_parse_struct_type, &ng_patch_config_type_fields }; static const struct ng_parse_struct_field ng_patch_stats_fields[] - = NG_PATCH_STATS_TYPE_INFO; + = NG_PATCH_STATS_TYPE; static const struct ng_parse_type ng_patch_stats_type = { &ng_parse_struct_type, &ng_patch_stats_fields @@ -91,6 +111,20 @@ static const struct ng_parse_type ng_pat static const struct ng_cmdlist ng_patch_cmdlist[] = { { NGM_PATCH_COOKIE, + NGM_PATCH_GETDLT, + "getdlt", + NULL, + &ng_parse_uint8_type + }, + { + NGM_PATCH_COOKIE, + NGM_PATCH_SETDLT, + "setdlt", + &ng_parse_uint8_type, + NULL + }, + { + NGM_PATCH_COOKIE, NGM_PATCH_GETCONFIG, "getconfig", NULL, @@ -141,38 +175,16 @@ static struct ng_type typestruct = { NETGRAPH_INIT(patch, &typestruct); -union patch_val { - uint8_t v1; - uint16_t v2; - uint32_t v4; - uint64_t v8; -}; - -/* private data */ -struct ng_patch_priv { - hook_p in; - hook_p out; - struct ng_patch_config *config; - union patch_val *val; - struct ng_patch_stats stats; -}; -typedef struct ng_patch_priv *priv_p; - -#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ - (count) * sizeof(struct ng_patch_op)) - -static void do_patch(priv_p conf, struct mbuf *m); - static int ng_patch_constructor(node_p node) { priv_p privdata; privdata = malloc(sizeof(*privdata), M_NETGRAPH, M_WAITOK | M_ZERO); + privdata->dlt = DLT_RAW; + NG_NODE_SET_PRIVATE(node, privdata); - privdata->in = NULL; - privdata->out = NULL; - privdata->config = NULL; + return (0); } @@ -188,7 +200,8 @@ ng_patch_newhook(node_p node, hook_p hoo privp->out = hook; } else return (EINVAL); - return(0); + + return (0); } static int @@ -196,308 +209,341 @@ ng_patch_rcvmsg(node_p node, item_p item { const priv_p privp = NG_NODE_PRIVATE(node); struct ng_patch_config *conf, *newconf; - union patch_val *newval; struct ng_mesg *msg; - struct ng_mesg *resp; - int i, clear, error; + struct ng_mesg *resp = NULL; + int i, error = 0; - clear = error = 0; - resp = NULL; NGI_GET_MSG(item, msg); - switch (msg->header.typecookie) { - case NGM_PATCH_COOKIE: - switch (msg->header.cmd) { + + if (msg->header.typecookie != NGM_PATCH_COOKIE) + ERROUT(EINVAL); + + switch (msg->header.cmd) + { case NGM_PATCH_GETCONFIG: - if (privp->config == NULL) - break; + if (privp->conf == NULL) + ERROUT(0); + NG_MKRESPONSE(resp, msg, - NG_PATCH_CONF_SIZE(privp->config->count), - M_WAITOK); - bcopy(privp->config, resp->data, - NG_PATCH_CONF_SIZE(privp->config->count)); - break; - case NGM_PATCH_SETCONFIG: - { - if (msg->header.arglen < - sizeof(struct ng_patch_config)) { - error = EINVAL; - break; - } + NG_PATCH_CONF_SIZE(privp->conf->count), M_WAITOK); - conf = (struct ng_patch_config *)msg->data; - if (msg->header.arglen < - NG_PATCH_CONF_SIZE(conf->count)) { - error = EINVAL; - break; - } + if (resp == NULL) + ERROUT(ENOMEM); - for(i = 0; i < conf->count; i++) { - switch(conf->ops[i].length) { - case 1: - case 2: - case 4: - case 8: - break; - default: - error = EINVAL; - break; + bcopy(privp->conf, resp->data, + NG_PATCH_CONF_SIZE(privp->conf->count)); + + conf = (struct ng_patch_config *) resp->data; + + for (i = 0; i < conf->count; i++) { + switch (conf->ops[i].length) + { + case 1: + conf->ops[i].val.v8 = conf->ops[i].val.v1; + break; + case 2: + conf->ops[i].val.v8 = conf->ops[i].val.v2; + break; + case 4: + conf->ops[i].val.v8 = conf->ops[i].val.v4; + break; + case 8: + break; } - if (error != 0) - break; } - conf->csum_flags &= CSUM_IP | CSUM_TCP | CSUM_UDP | - CSUM_SCTP; + break; + + case NGM_PATCH_SETCONFIG: + conf = (struct ng_patch_config *) msg->data; - if (error == 0) { - newconf = malloc( - NG_PATCH_CONF_SIZE(conf->count), - M_NETGRAPH, M_WAITOK); - newval = malloc(conf->count * - sizeof(union patch_val), M_NETGRAPH, - M_WAITOK); - for(i = 0; i < conf->count; i++) { - switch (conf->ops[i].length) { + if (msg->header.arglen < sizeof(struct ng_patch_config) || + msg->header.arglen < NG_PATCH_CONF_SIZE(conf->count)) + ERROUT(EINVAL); + + for (i = 0; i < conf->count; i++) { + switch (conf->ops[i].length) + { case 1: - newval[i].v1 = - conf->ops[i].value; + conf->ops[i].val.v1 = (uint8_t) conf->ops[i].val.v8; break; case 2: - newval[i].v2 = - conf->ops[i].value; + conf->ops[i].val.v2 = (uint16_t) conf->ops[i].val.v8; break; case 4: - newval[i].v4 = - conf->ops[i].value; + conf->ops[i].val.v4 = (uint32_t) conf->ops[i].val.v8; break; case 8: - newval[i].v8 = - conf->ops[i].value; break; - } + default: + ERROUT(EINVAL); } - bcopy(conf, newconf, - NG_PATCH_CONF_SIZE(conf->count)); - if (privp->val != NULL) - free(privp->val, M_NETGRAPH); - privp->val = newval; - if (privp->config != NULL) - free(privp->config, M_NETGRAPH); - privp->config = newconf; } + + conf->csum_flags &= NG_PATCH_CSUM_IPV4|NG_PATCH_CSUM_IPV6; + conf->relative_offset = !!conf->relative_offset; + + newconf = malloc(NG_PATCH_CONF_SIZE(conf->count), M_NETGRAPH, M_WAITOK | M_ZERO); + + bcopy(conf, newconf, NG_PATCH_CONF_SIZE(conf->count)); + + if (privp->conf) + free(privp->conf, M_NETGRAPH); + + privp->conf = newconf; + break; - } - case NGM_PATCH_GETCLR_STATS: - clear = 1; - /* FALLTHROUGH */ + case NGM_PATCH_GET_STATS: - NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats), - M_WAITOK); - bcopy(&(privp->stats), resp->data, - sizeof(struct ng_patch_stats)); - if (clear == 0) - break; - /* else FALLTHROUGH */ case NGM_PATCH_CLR_STATS: - bzero(&(privp->stats), sizeof(struct ng_patch_stats)); + case NGM_PATCH_GETCLR_STATS: + if (msg->header.cmd != NGM_PATCH_CLR_STATS) { + NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + bcopy(&(privp->stats), resp->data, sizeof(struct ng_patch_stats)); + } + + if (msg->header.cmd != NGM_PATCH_GET_STATS) + bzero(&(privp->stats), sizeof(struct ng_patch_stats)); + break; - default: - error = EINVAL; + + case NGM_PATCH_GETDLT: + NG_MKRESPONSE(resp, msg, sizeof(uint8_t), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + *((uint8_t *) resp->data) = privp->dlt; + break; - } - break; - default: - error = EINVAL; - break; + + case NGM_PATCH_SETDLT: + if (msg->header.arglen != sizeof(uint8_t)) + ERROUT(EINVAL); + + switch (*(uint8_t *) msg->data) + { + case DLT_EN10MB: + case DLT_RAW: + privp->dlt = *(uint8_t *) msg->data; + break; + + default: + ERROUT(EINVAL); + } + + break; + + default: + ERROUT(EINVAL); } +done: NG_RESPOND_MSG(error, node, item, resp); NG_FREE_MSG(msg); - return(error); + + return (error); } static void -do_patch(priv_p privp, struct mbuf *m) +do_patch(priv_p privp, struct mbuf *m, int global_offset) { - struct ng_patch_config *conf; - uint64_t buf; - int i, patched; + int i, offset, patched = 0; + union ng_patch_op_val val; + + for (i = 0; i < privp->conf->count; i++) { + offset = global_offset + privp->conf->ops[i].offset; - conf = privp->config; - patched = 0; - for(i = 0; i < conf->count; i++) { - if (conf->ops[i].offset + conf->ops[i].length > - m->m_pkthdr.len) + if (offset + privp->conf->ops[i].length > m->m_pkthdr.len) continue; /* for "=" operation we don't need to copy data from mbuf */ - if (conf->ops[i].mode != NG_PATCH_MODE_SET) { - m_copydata(m, conf->ops[i].offset, - conf->ops[i].length, (caddr_t)&buf); - } + if (privp->conf->ops[i].mode != NG_PATCH_MODE_SET) + m_copydata(m, offset, privp->conf->ops[i].length, (caddr_t) &val); - switch (conf->ops[i].length) { - case 1: - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint8_t *)&buf) = privp->val[i].v1; - break; - case NG_PATCH_MODE_ADD: - *((uint8_t *)&buf) += privp->val[i].v1; - break; - case NG_PATCH_MODE_SUB: - *((uint8_t *)&buf) -= privp->val[i].v1; - break; - case NG_PATCH_MODE_MUL: - *((uint8_t *)&buf) *= privp->val[i].v1; - break; - case NG_PATCH_MODE_DIV: - *((uint8_t *)&buf) /= privp->val[i].v1; - break; - case NG_PATCH_MODE_NEG: - *((int8_t *)&buf) = - *((int8_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint8_t *)&buf) &= privp->val[i].v1; - break; - case NG_PATCH_MODE_OR: - *((uint8_t *)&buf) |= privp->val[i].v1; - break; - case NG_PATCH_MODE_XOR: - *((uint8_t *)&buf) ^= privp->val[i].v1; - break; - case NG_PATCH_MODE_SHL: - *((uint8_t *)&buf) <<= privp->val[i].v1; - break; - case NG_PATCH_MODE_SHR: - *((uint8_t *)&buf) >>= privp->val[i].v1; - break; - } - break; - case 2: - *((int16_t *)&buf) = ntohs(*((int16_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint16_t *)&buf) = privp->val[i].v2; - break; - case NG_PATCH_MODE_ADD: - *((uint16_t *)&buf) += privp->val[i].v2; - break; - case NG_PATCH_MODE_SUB: - *((uint16_t *)&buf) -= privp->val[i].v2; - break; - case NG_PATCH_MODE_MUL: - *((uint16_t *)&buf) *= privp->val[i].v2; - break; - case NG_PATCH_MODE_DIV: - *((uint16_t *)&buf) /= privp->val[i].v2; - break; - case NG_PATCH_MODE_NEG: - *((int16_t *)&buf) = - *((int16_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint16_t *)&buf) &= privp->val[i].v2; - break; - case NG_PATCH_MODE_OR: - *((uint16_t *)&buf) |= privp->val[i].v2; - break; - case NG_PATCH_MODE_XOR: - *((uint16_t *)&buf) ^= privp->val[i].v2; - break; - case NG_PATCH_MODE_SHL: - *((uint16_t *)&buf) <<= privp->val[i].v2; - break; - case NG_PATCH_MODE_SHR: - *((uint16_t *)&buf) >>= privp->val[i].v2; - break; - } - *((int16_t *)&buf) = htons(*((int16_t *)&buf)); - break; - case 4: - *((int32_t *)&buf) = ntohl(*((int32_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint32_t *)&buf) = privp->val[i].v4; - break; - case NG_PATCH_MODE_ADD: - *((uint32_t *)&buf) += privp->val[i].v4; - break; - case NG_PATCH_MODE_SUB: - *((uint32_t *)&buf) -= privp->val[i].v4; - break; - case NG_PATCH_MODE_MUL: - *((uint32_t *)&buf) *= privp->val[i].v4; - break; - case NG_PATCH_MODE_DIV: - *((uint32_t *)&buf) /= privp->val[i].v4; - break; - case NG_PATCH_MODE_NEG: - *((int32_t *)&buf) = - *((int32_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint32_t *)&buf) &= privp->val[i].v4; - break; - case NG_PATCH_MODE_OR: - *((uint32_t *)&buf) |= privp->val[i].v4; - break; - case NG_PATCH_MODE_XOR: - *((uint32_t *)&buf) ^= privp->val[i].v4; - break; - case NG_PATCH_MODE_SHL: - *((uint32_t *)&buf) <<= privp->val[i].v4; - break; - case NG_PATCH_MODE_SHR: - *((uint32_t *)&buf) >>= privp->val[i].v4; - break; - } - *((int32_t *)&buf) = htonl(*((int32_t *)&buf)); - break; - case 8: - *((int64_t *)&buf) = be64toh(*((int64_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint64_t *)&buf) = privp->val[i].v8; - break; - case NG_PATCH_MODE_ADD: - *((uint64_t *)&buf) += privp->val[i].v8; - break; - case NG_PATCH_MODE_SUB: - *((uint64_t *)&buf) -= privp->val[i].v8; - break; - case NG_PATCH_MODE_MUL: - *((uint64_t *)&buf) *= privp->val[i].v8; - break; - case NG_PATCH_MODE_DIV: - *((uint64_t *)&buf) /= privp->val[i].v8; - break; - case NG_PATCH_MODE_NEG: - *((int64_t *)&buf) = - *((int64_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint64_t *)&buf) &= privp->val[i].v8; - break; - case NG_PATCH_MODE_OR: - *((uint64_t *)&buf) |= privp->val[i].v8; + switch (privp->conf->ops[i].length) + { + case 1: + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v1 = privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_ADD: + val.v1 += privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SUB: + val.v1 -= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_MUL: + val.v1 *= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_DIV: + val.v1 /= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_NEG: + *((int8_t *) &val) = - *((int8_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v1 &= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_OR: + val.v1 |= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_XOR: + val.v1 ^= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SHL: + val.v1 <<= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SHR: + val.v1 >>= privp->conf->ops[i].val.v1; + break; + } break; - case NG_PATCH_MODE_XOR: - *((uint64_t *)&buf) ^= privp->val[i].v8; + + case 2: + val.v2 = ntohs(val.v2); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v2 = privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_ADD: + val.v2 += privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SUB: + val.v2 -= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_MUL: + val.v2 *= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_DIV: + val.v2 /= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_NEG: + *((int16_t *) &val) = - *((int16_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v2 &= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_OR: + val.v2 |= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_XOR: + val.v2 ^= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SHL: + val.v2 <<= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SHR: + val.v2 >>= privp->conf->ops[i].val.v2; + break; + } + + val.v2 = htons(val.v2); + break; - case NG_PATCH_MODE_SHL: - *((uint64_t *)&buf) <<= privp->val[i].v8; + + case 4: + val.v4 = ntohl(val.v4); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v4 = privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_ADD: + val.v4 += privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SUB: + val.v4 -= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_MUL: + val.v4 *= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_DIV: + val.v4 /= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_NEG: + *((int32_t *) &val) = - *((int32_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v4 &= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_OR: + val.v4 |= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_XOR: + val.v4 ^= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SHL: + val.v4 <<= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SHR: + val.v4 >>= privp->conf->ops[i].val.v4; + break; + } + + val.v4 = htonl(val.v4); + break; - case NG_PATCH_MODE_SHR: - *((uint64_t *)&buf) >>= privp->val[i].v8; + + case 8: + val.v8 = be64toh(val.v8); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v8 = privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_ADD: + val.v8 += privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SUB: + val.v8 -= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_MUL: + val.v8 *= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_DIV: + val.v8 /= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_NEG: + *((int64_t *) &val) = - *((int64_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v8 &= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_OR: + val.v8 |= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_XOR: + val.v8 ^= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SHL: + val.v8 <<= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SHR: + val.v8 >>= privp->conf->ops[i].val.v8; + break; + } + + val.v8 = htobe64(val.v8); + break; - } - *((int64_t *)&buf) = htobe64(*((int64_t *)&buf)); - break; } - m_copyback(m, conf->ops[i].offset, conf->ops[i].length, - (caddr_t)&buf); + m_copyback(m, offset, privp->conf->ops[i].length, (caddr_t) &val); patched = 1; } - if (patched > 0) + + if (patched) privp->stats.patched++; } @@ -506,41 +552,107 @@ ng_patch_rcvdata(hook_p hook, item_p ite { const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct mbuf *m; - hook_p target; - int error; + hook_p out; + int pullup_len = 0; + int error = 0; priv->stats.received++; + NGI_GET_M(item, m); - if (priv->config != NULL && hook == priv->in && - (m->m_flags & M_PKTHDR) != 0) { - m = m_unshare(m,M_NOWAIT); - if (m == NULL) { - priv->stats.dropped++; - NG_FREE_ITEM(item); - return (ENOMEM); + +#define PULLUP_CHECK(mbuf, length) do { \ + pullup_len += length; \ + if (((mbuf)->m_pkthdr.len < pullup_len) || \ + (pullup_len > MHLEN)) { \ + error = EINVAL; \ + goto bypass; \ + } \ + if ((mbuf)->m_len < pullup_len && \ + (((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \ + error = ENOBUFS; \ + goto drop; \ + } \ +} while (0) + + if (priv->conf && hook == priv->in && + m && (m->m_flags & M_PKTHDR)) { + + m = m_unshare(m, M_NOWAIT); + + if (m == NULL) + ERROUT(ENOMEM); + + if (priv->conf->relative_offset) { + struct ether_header *eh; + struct ng_patch_vlan_header *vh; + uint16_t etype; + + switch (priv->dlt) + { + case DLT_EN10MB: + PULLUP_CHECK(m, sizeof(struct ether_header)); + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + + for (;;) { /* QinQ support */ + switch (etype) + { + case 0x8100: + case 0x88A8: + case 0x9100: + PULLUP_CHECK(m, sizeof(struct ng_patch_vlan_header)); + vh = (struct ng_patch_vlan_header *) mtodo(m, + pullup_len - sizeof(struct ng_patch_vlan_header)); + etype = ntohs(vh->etype); + break; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 27 08:32:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43C1C9106E; Tue, 27 Dec 2016 08:32:55 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95ED11101; Tue, 27 Dec 2016 08:32:55 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBR8WsxE085390; Tue, 27 Dec 2016 08:32:54 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBR8Wskx085389; Tue, 27 Dec 2016 08:32:54 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612270832.uBR8Wskx085389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 27 Dec 2016 08:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310626 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 08:32:55 -0000 Author: julian Date: Tue Dec 27 08:32:54 2016 New Revision: 310626 URL: https://svnweb.freebsd.org/changeset/base/310626 Log: MFH: r309407 A little light wordsmithing only. Sponsored by: FreeBSD Modified: stable/11/share/man/man4/ng_checksum.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ng_checksum.4 ============================================================================== --- stable/11/share/man/man4/ng_checksum.4 Tue Dec 27 08:31:40 2016 (r310625) +++ stable/11/share/man/man4/ng_checksum.4 Tue Dec 27 08:32:54 2016 (r310626) @@ -29,26 +29,26 @@ .Os .Sh NAME .Nm ng_checksum -.Nd IP checksum node type +.Nd reconstructing IP checksums node type .Sh SYNOPSIS .In netgraph/ng_checksum.h .Sh DESCRIPTION The .Nm checksum -node can calculate and prepare for calculation in hardware -IPv4 header, TCP, UDP checksum. +node can calculate, or prepare for calculation in hardware, +IPv4 header, TCP and UDP checksums. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are processed according to settings specified -in config and then forwarded to +in config and then forwarded to the .Ar out -hook, if it exists and connected. Otherwise they are reflected back to the +hook, if it exists and is connected. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El @@ -56,13 +56,13 @@ hook without any changes. This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_CHECKSUM_SETDLT Pq Ic setdlt -Sets data link type on the +Sets the data link type on the .Va in hook. Currently, supported types are .Cm DLT_RAW (raw IP datagrams) and .Cm DLT_EN10MB -(Ethernet). DLT_ definitions can be found in +(Ethernet). DLT_ definitions can be found in the .In net/bpf.h header. Currently used values are .Cm DLT_EN10MB @@ -70,11 +70,11 @@ header. Currently used values are .Cm DLT_RAW = 12. .It Dv NGM_CHECKSUM_GETDLT Pq Ic getdlt -This control message obtains data link type on the +This control message obtains the data link type on the .Va in hook. .It Dv NGM_CHECKSUM_SETCONFIG Pq Ic setconfig -Sets node configuration. The following +Sets the node configuration. The following .Vt "struct ng_checksum_config" must be supplied as an argument: .Bd -literal -offset 4n @@ -87,23 +87,24 @@ struct ng_checksum_config { The .Va csum_flags can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node need calculate the corresponding checksum. +(other values are ignored) for instructing the node to calculate the corresponding checksum. .Pp The .Va csum_offload -can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node what checksum can calculate in hardware. +value can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing the node what checksums should be requested from the hardware. .Pp -Also processed any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 sets before on mbuf. +The node also takes into account any combination of +CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 already +flagged on the mbuf. .It Dv NGM_CHECKSUM_GETCONFIG Pq Ic getconfig -This control message obtains current node configuration, -returned as +This control message obtains the current node configuration returned as a .Vt "struct ng_checksum_config" . .It Dv NGM_CHECKSUM_GET_STATS Pq Ic getstats Returns node statistics as a .Vt "struct ng_checksum_stats" . .It Dv NGM_CHECKSUM_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clear the node statistics. .It Dv NGM_CHECKSUM_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_CHECKSUM_GET_STATS , @@ -118,14 +119,15 @@ control message, or when all hooks have script: .Bd -literal -offset 4n /usr/sbin/ngctl -f- <<-SEQ - msg checksum-1: "setdlt 1" - ngctl msg checksum-1: "setconfig { csum_flags=0 csum_offload=6 }" + msg checksum-1: setdlt 1 + msg checksum-1: setconfig { csum_flags=0 csum_offload=6 } +SEQ .Ed .Pp -Set data link type to +Set the data link type to .Cm DLT_EN10MB -(Ethernet), not set additional checksum flags, set hardware -can calculate CSUM_IP_UDP|CSUM_IP_TCP. +(Ethernet), do not set additional checksum flags +and request that the hardware calculate CSUM_IP_UDP|CSUM_IP_TCP. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_patch 4 , From owner-svn-src-all@freebsd.org Tue Dec 27 08:51:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77997C9189C; Tue, 27 Dec 2016 08:51:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39F3219B0; Tue, 27 Dec 2016 08:51:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBR8pRer089577; Tue, 27 Dec 2016 08:51:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBR8pRIc089574; Tue, 27 Dec 2016 08:51:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612270851.uBR8pRIc089574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Dec 2016 08:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310627 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 08:51:28 -0000 Author: arybchik Date: Tue Dec 27 08:51:26 2016 New Revision: 310627 URL: https://svnweb.freebsd.org/changeset/base/310627 Log: sfxge(4): do not limit driver RSS table to RSS channels max Specification of entire RSS table in the driver allows to spread traffic more equally across CPUs/RSS channels if number of RSS channels is not power of 2. Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8910 Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue Dec 27 08:32:54 2016 (r310626) +++ head/sys/dev/sfxge/sfxge.h Tue Dec 27 08:51:26 2016 (r310627) @@ -301,7 +301,7 @@ struct sfxge_softc { unsigned int max_rss_channels; uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; - unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; + unsigned int rx_indir_table[EFX_RSS_TBL_SIZE]; struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX]; Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Tue Dec 27 08:32:54 2016 (r310626) +++ head/sys/dev/sfxge/sfxge_rx.c Tue Dec 27 08:51:26 2016 (r310627) @@ -1128,7 +1128,7 @@ sfxge_rx_start(struct sfxge_softc *sc) /* * Set up the scale table. Enable all hash types and hash insertion. */ - for (index = 0; index < SFXGE_RX_SCALE_MAX; index++) + for (index = 0; index < nitems(sc->rx_indir_table); index++) #ifdef RSS sc->rx_indir_table[index] = rss_get_indirection_to_bucket(index) % sc->rxq_count; @@ -1136,7 +1136,7 @@ sfxge_rx_start(struct sfxge_softc *sc) sc->rx_indir_table[index] = index % sc->rxq_count; #endif if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, - SFXGE_RX_SCALE_MAX)) != 0) + nitems(sc->rx_indir_table))) != 0) goto fail; (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) | Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Dec 27 08:32:54 2016 (r310626) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Dec 27 08:51:26 2016 (r310627) @@ -838,8 +838,9 @@ sfxge_if_transmit(struct ifnet *ifp, str /* check if flowid is set */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { uint32_t hash = m->m_pkthdr.flowid; + uint32_t idx = hash % nitems(sc->rx_indir_table); - index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX]; + index = sc->rx_indir_table[idx]; } #endif #if SFXGE_TX_PARSE_EARLY From owner-svn-src-all@freebsd.org Tue Dec 27 10:17:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A071C8FEBE; Tue, 27 Dec 2016 10:17:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34A8D1AC1; Tue, 27 Dec 2016 10:17:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRAHvsv026774; Tue, 27 Dec 2016 10:17:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRAHv1N026771; Tue, 27 Dec 2016 10:17:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612271017.uBRAHv1N026771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Dec 2016 10:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310630 - in head: include lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 10:17:58 -0000 Author: avg Date: Tue Dec 27 10:17:56 2016 New Revision: 310630 URL: https://svnweb.freebsd.org/changeset/base/310630 Log: libkvm: support access to vmm guest memory, allow writes to fwmem and vmm This change consists of two parts: - allow libkvm to recognize /dev/vmm/* character devices as devices that provide access to the physical memory of a system (similarly to /dev/fwmem*) - allow libkvm to recognize that /dev/vmm/* and /dev/fwmem* devices provide access to the physical memory of live remote systems and, thus, the memory is writable As a result, it should be possible to run commands like $ kgdb -w /path/to/kernel /dev/fwmem0.0 $ kgdb /path/to/kernel /dev/vmm/guest Reviewed by: kib, jhb MFC after: 2 weeks Relnotes: yes Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D8679 Modified: head/include/paths.h head/lib/libkvm/kvm.c head/lib/libkvm/kvm_private.h Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Tue Dec 27 09:40:07 2016 (r310629) +++ head/include/paths.h Tue Dec 27 10:17:56 2016 (r310630) @@ -99,6 +99,7 @@ #define _PATH_VARDB "/var/db/" #define _PATH_VARRUN "/var/run/" #define _PATH_VARTMP "/var/tmp/" +#define _PATH_DEVVMM "/dev/vmm/" #define _PATH_YP "/var/yp/" #define _PATH_UUCPLOCK "/var/spool/lock/" Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Tue Dec 27 09:40:07 2016 (r310629) +++ head/lib/libkvm/kvm.c Tue Dec 27 10:17:56 2016 (r310630) @@ -167,8 +167,10 @@ _kvm_open(kvm_t *kd, const char *uf, con return (kd); } } + /* - * This is a crash dump. + * This is either a crash dump or a remote live system with its physical + * memory fully accessible via a special device. * Open the namelist fd and determine the architecture. */ if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) { @@ -177,8 +179,11 @@ _kvm_open(kvm_t *kd, const char *uf, con } if (_kvm_read_kernel_ehdr(kd) < 0) goto failed; - if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0) + if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0 || + strncmp(mf, _PATH_DEVVMM, strlen(_PATH_DEVVMM)) == 0) { kd->rawdump = 1; + kd->writable = 1; + } SET_FOREACH(parch, kvm_arch) { if ((*parch)->ka_probe(kd)) { kd->arch = *parch; @@ -405,6 +410,15 @@ ssize_t kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len) { int cc; + ssize_t cw; + off_t pa; + const char *cp; + + if (!ISALIVE(kd) && !kd->writable) { + _kvm_err(kd, kd->program, + "kvm_write not implemented for dead kernels"); + return (-1); + } if (ISALIVE(kd)) { /* @@ -422,12 +436,38 @@ kvm_write(kvm_t *kd, u_long kva, const v } else if ((size_t)cc < len) _kvm_err(kd, kd->program, "short write"); return (cc); - } else { - _kvm_err(kd, kd->program, - "kvm_write not implemented for dead kernels"); - return (-1); } - /* NOTREACHED */ + + cp = buf; + while (len > 0) { + cc = kd->arch->ka_kvatop(kd, kva, &pa); + if (cc == 0) + return (-1); + if (cc > (ssize_t)len) + cc = len; + errno = 0; + if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { + _kvm_syserr(kd, 0, _PATH_MEM); + break; + } + cw = write(kd->pmfd, cp, cc); + if (cw < 0) { + _kvm_syserr(kd, kd->program, "kvm_write"); + break; + } + /* + * If ka_kvatop returns a bogus value or our core file is + * truncated, we might wind up seeking beyond the end of the + * core file in which case the read will return 0 (EOF). + */ + if (cw == 0) + break; + cp += cw; + kva += cw; + len -= cw; + } + + return (cp - (char *)buf); } int Modified: head/lib/libkvm/kvm_private.h ============================================================================== --- head/lib/libkvm/kvm_private.h Tue Dec 27 09:40:07 2016 (r310629) +++ head/lib/libkvm/kvm_private.h Tue Dec 27 10:17:56 2016 (r310630) @@ -78,6 +78,7 @@ struct __kvm { */ struct vmstate *vmst; int rawdump; /* raw dump format */ + int writable; /* physical memory is writable */ int vnet_initialized; /* vnet fields set up */ kvaddr_t vnet_start; /* start of kernel's vnet region */ From owner-svn-src-all@freebsd.org Tue Dec 27 10:26:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FB34C932B2; Tue, 27 Dec 2016 10:26:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46945130B; Tue, 27 Dec 2016 10:26:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRAQwxi031013; Tue, 27 Dec 2016 10:26:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRAQw7F031012; Tue, 27 Dec 2016 10:26:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612271026.uBRAQw7F031012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Dec 2016 10:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310631 - stable/11/usr.sbin/smbmsg X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 10:26:59 -0000 Author: avg Date: Tue Dec 27 10:26:58 2016 New Revision: 310631 URL: https://svnweb.freebsd.org/changeset/base/310631 Log: MFC r308528: smbmsg: use a more convenient way of accessing data read from a slave Modified: stable/11/usr.sbin/smbmsg/smbmsg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/smbmsg/smbmsg.c ============================================================================== --- stable/11/usr.sbin/smbmsg/smbmsg.c Tue Dec 27 10:17:56 2016 (r310630) +++ stable/11/usr.sbin/smbmsg/smbmsg.c Tue Dec 27 10:26:58 2016 (r310631) @@ -61,7 +61,7 @@ static int wflag; /* word IO */ static unsigned char ibuf[SMB_MAXBLOCKSIZE]; static unsigned char obuf[SMB_MAXBLOCKSIZE]; -static unsigned short oword, iword; +static unsigned short oword; /* * The I2C specs say that all addresses below 16 and above or equal @@ -135,6 +135,8 @@ do_io(void) c.slave = slave; c.cmd = cflag; + c.rcount = 0; + c.wcount = 0; if (fmt == NULL && iflag > 0) fmt = wflag? wordfmt: bytefmt; @@ -163,11 +165,9 @@ do_io(void) } if (iflag == 1 && oflag == -1) { /* command + 1 byte input: read byte op. */ - c.rbuf = ibuf; - c.rcount = iflag; if (ioctl(fd, SMB_READB, &c) == -1) return (-1); - printf(fmt, (int)(unsigned char)ibuf[0]); + printf(fmt, (unsigned char)c.rdata.byte); putchar('\n'); return (0); } else if (iflag == -1 && oflag == 1) { @@ -176,11 +176,9 @@ do_io(void) return (ioctl(fd, SMB_WRITEB, &c)); } else if (wflag && iflag == 2 && oflag == -1) { /* command + 2 bytes input: read word op. */ - c.rbuf = (char*) &iword; - c.rcount = iflag; if (ioctl(fd, SMB_READW, &c) == -1) return (-1); - printf(fmt, (int)(unsigned short)iword); + printf(fmt, (unsigned short)c.rdata.word); putchar('\n'); return (0); } else if (wflag && iflag == -1 && oflag == 2) { @@ -193,11 +191,9 @@ do_io(void) * "process call" op. */ c.wdata.word = oword; - c.rbuf = (char*) &iword; - c.rcount = iflag; if (ioctl(fd, SMB_PCALL, &c) == -1) return (-1); - printf(fmt, (int)(unsigned short)iword); + printf(fmt, (unsigned short)c.rdata.word); putchar('\n'); return (0); } else if (iflag > 1 && oflag == -1) { @@ -206,7 +202,7 @@ do_io(void) c.rcount = iflag; if (ioctl(fd, SMB_BREAD, &c) == -1) return (-1); - for (i = 0; i < iflag; i++) { + for (i = 0; i < c.rcount; i++) { if (i != 0) putchar(' '); printf(fmt, ibuf[i]); From owner-svn-src-all@freebsd.org Tue Dec 27 10:56:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4D4C93DD2; Tue, 27 Dec 2016 10:56:18 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89501159F; Tue, 27 Dec 2016 10:56:17 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.121] (p4FE316D7.dip0.t-ipconnect.de [79.227.22.215]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 82F9A721E282E; Tue, 27 Dec 2016 11:56:13 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r310547 - head/sys/netinet From: Michael Tuexen In-Reply-To: <20161227081940.GL82166@strugglingcoder.info> Date: Tue, 27 Dec 2016 11:56:13 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <693D4C85-526B-426C-9685-1D463E3C3903@freebsd.org> References: <201612251737.uBPHbIhd027939@repo.freebsd.org> <20161227081940.GL82166@strugglingcoder.info> To: hiren panchasara X-Mailer: Apple Mail (2.3259) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 10:56:18 -0000 > On 27 Dec 2016, at 09:19, hiren panchasara = wrote: >=20 > On 12/25/16 at 05:37P, Michael Tuexen wrote: >> Author: tuexen >> Date: Sun Dec 25 17:37:18 2016 >> New Revision: 310547 >> URL: https://svnweb.freebsd.org/changeset/base/310547 >>=20 >> Log: >> Remove a KASSERT which is not always true. >>=20 >> In case of the empty queue tp->snd_holes and tcp_sackhole_insert() >> failing due to memory shortage, tp->snd_holes will be empty. >> This problem was hit when stress tests where performed by pho. >>=20 >> PR: 215513 >> Reported by: pho >> Tested by: pho >> Sponsored by: Netflix, Inc. >>=20 >> Modified: >> head/sys/netinet/tcp_sack.c >=20 > Thanks for the fix, Michael. Can you please MFC this? Sure. Will do it after 3 days or so. Missed that. Best regards Michael >=20 > Cheers, > Hiren From owner-svn-src-all@freebsd.org Tue Dec 27 14:08:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33612C8A5DE for ; Tue, 27 Dec 2016 14:08:50 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x232.google.com (mail-qk0-x232.google.com [IPv6:2607:f8b0:400d:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDF091A16 for ; Tue, 27 Dec 2016 14:08:49 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x232.google.com with SMTP id t184so220587892qkd.0 for ; Tue, 27 Dec 2016 06:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=R6UiMYzSMRT9KL6vQAeLB04Inq58HJ+E8cqoRKtE+hQ=; b=e4uHXHpqYLJdnmqGg2SY7WHOay1KzNsaZddYpBJYvBZ6m/lUDKV2p9eY38ZsJNwio+ GI4FoMbXIgYdCVZJNLqvJ1droLWjzkdd7Puyb1KuCUE36YrLWXpUVT2zv0QUnV2xHGs/ 3fSz+i7Ow+x5edcG9wM0WBi0HsWs0mnjt9p9Tso0zyaZ7/CbOPgfuu3Dk/4aXwPIOtGD qYZY/nTRdst1n+mR00+NOtmwEYVctezleTnNlPW60awToIl6JAYdPFbik/sL2lt41nfS m5JfdgDN7OR6wIgxVV46OZlYaeYxeuELmwx0oW1QC44ysn6zw4XlAj+VZ4gOcIJ/UJCw qFSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=R6UiMYzSMRT9KL6vQAeLB04Inq58HJ+E8cqoRKtE+hQ=; b=mri9RfZXcyBp5x2YhhAhoVKMFPxYXu1B16rRdlKengUimbOrPatFEeCgHkxXJKMVqF sQGxazGfseCkfhGaA5/fKgrb92dgNZ9YHKInMkc0LqINxOvDatBecN8PriijKzyQ0vhs Jd3CCvQAAP96PQ8scp3XBCImJdJCzVDsUADj3QHVOba+FFqkMDd6NH1MOn5PCD3fzdHl bI7zaG/kzC+d+CQrOi/xU6v2QEj6ZjoNvr9KnMnIiXD3/2CeDEoiplSPLGCGn5ZIX3+a dkUdhO8kJQMkFLInyNS/xXCdHhyL8PFx7HQ2VkPLTBmUXvzJArC4ueYw8chLvq6TxnNB XfQA== X-Gm-Message-State: AIkVDXJe1YKAyW4F69D1HBwScIJGiqI0FQj+dca3ycFFtzxPISK/LGTTI/hK1btOScQAAtkP X-Received: by 10.55.198.129 with SMTP id s1mr33800972qkl.268.1482847729009; Tue, 27 Dec 2016 06:08:49 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id s65sm28640599qtd.2.2016.12.27.06.08.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Dec 2016 06:08:47 -0800 (PST) Date: Tue, 27 Dec 2016 09:08:46 -0500 From: Shawn Webb To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310624 - head/sys/net80211 Message-ID: <20161227140846.xu4f6lmsgqytuhne@mutt-hardenedbsd> References: <201612270610.uBR6ASrp025710@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dxse5plh6235ywib" Content-Disposition: inline In-Reply-To: <201612270610.uBR6ASrp025710@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 14:08:50 -0000 --dxse5plh6235ywib Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 27, 2016 at 06:10:28AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Tue Dec 27 06:10:28 2016 > New Revision: 310624 > URL: https://svnweb.freebsd.org/changeset/base/310624 >=20 > Log: > [net80211] turn the default TX key configuration (for WEP) into a vap c= allback. > =20 > The ath10k firmware supports hardware WEP offload, and in native wifi m= ode > (or 802.3 ethernet mode, for that matter) the WEP key isn't actually in= cluded > in the TX payload from net80211. Instead, a separate firmware command = is issued > that sets the default TX key to be the specified key. > =20 > However, net80211 doesn't at all inform the driver layer that this is > occuring - it just "expects" to be inserting WEP header information > when doing WEP TX, even with hardware encryption. > =20 > So, to better support the newer world order, turn the default TX key as= signment > into a VAP method that can be overridden by the driver and ensure its w= rapped > in a crypto begin/end set. That way it should be correctly atomic from= the > point of view of keychanges (as long as the driver does the right thing= =2E) > =20 > It'd be nice if we passed through to the key_set call a flag that says > "also make this the default key" - that's captured here by calling the > deftxkey method after the key_set method. Maybe I can do that later. > =20 > Note: this is a net80211 ABI change, and will require a kernel+modules > recompile. Happy Holidays, etc. Hey Adrian, Thank you very much for your hard work on the wireless stack. Since this introduces an ABI change, should __FreeBSD_version be bumped? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --dxse5plh6235ywib Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlhidewACgkQaoRlj1JF bu5t5g//cfiAvi9JeNZ37WoRx80fonwDtUHSN+vKLrzeQBFl1yBlpD5S0CWi0nAD RbFUIWmJ/Rn9aMt9BrPWAK/TTipZVed6XT+xCBodNf8kQatQTD45CdAy+5OAUK8L txpmE8Fyh2FkOvw4p5WtkHyuYzfocZVGqP4NnJXlhQg0N38EigZTVRZkRub5j3FU xRJvz49Qn1U7YUJqoWWFLf9CHFMI2jHi65CUMNAcNA05tTw0Rng6l/vkulWThOyw 7B2cMdixfrGH64EdShgjh0uvbYrr8hAh4mHt1rXpHNejQVctU/gJRdpOEDcD8olN jYae0H2SWWECuYPu2u7fGj/K6lUPfktuIG9okqJLBDjv+m4QgK8HVZjtie7Ehj9v E1gQ+eeHWNfLbV2d8x+ezATZWd2Wl9CmLqgP/4VsvnBfV0iuURlv1c1mE0YEJOhO LodNbRx39r4N5m0kbEBk12Yk2O0dvsHnduMssJYHbU4+0kndHcOPTVhVySwC6U8H p+/vDTaGRwhbgZ6VAfQoMOkvyk60ud5ciEt89JXKMGtZlPxh6xVrG8JgRKvvZwnR 050wAggl2zo9yYceYnvOaEl+94/IdXiMo1Do2ViLj8BtBViRnjZ5tBjrUp8BPtQ+ 2mUQkNAVu/3vljkf5aBzo8PkNJjnoRSgGg5bsiGtxO/O1WOSaMg= =gumU -----END PGP SIGNATURE----- --dxse5plh6235ywib-- From owner-svn-src-all@freebsd.org Tue Dec 27 17:13:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48686C926F9; Tue, 27 Dec 2016 17:13:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F37281DF8; Tue, 27 Dec 2016 17:13:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRHDWPk098800; Tue, 27 Dec 2016 17:13:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRHDWac098798; Tue, 27 Dec 2016 17:13:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612271713.uBRHDWac098798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Dec 2016 17:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310633 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 17:13:33 -0000 Author: mav Date: Tue Dec 27 17:13:31 2016 New Revision: 310633 URL: https://svnweb.freebsd.org/changeset/base/310633 Log: Add MAX_LUNS overflow safety checks. While this MAX_LUNS limitation is too synthetic and should be removed, it is better to enforce it while it is here. MFC after: 2 weeks Modified: head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/uclparse.c Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Tue Dec 27 11:31:17 2016 (r310632) +++ head/usr.sbin/ctld/parse.y Tue Dec 27 17:13:31 2016 (r310633) @@ -821,6 +821,11 @@ lun_number: STR free($1); return (1); } + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($1); + return (1); + } ret = asprintf(&name, "%s,lun,%ju", target->t_name, tmp); if (ret <= 0) @@ -845,6 +850,11 @@ target_lun_ref: LUN STR STR return (1); } free($2); + if (tmp >= MAX_LUNS) { + yyerror("LU number is too big"); + free($3); + return (1); + } lun = lun_find(conf, $3); free($3); Modified: head/usr.sbin/ctld/uclparse.c ============================================================================== --- head/usr.sbin/ctld/uclparse.c Tue Dec 27 11:31:17 2016 (r310632) +++ head/usr.sbin/ctld/uclparse.c Tue Dec 27 17:13:31 2016 (r310633) @@ -183,18 +183,25 @@ static int uclparse_target_lun(struct target *target, const ucl_object_t *obj) { struct lun *lun; + uint64_t tmp; if (obj->type == UCL_INT) { char *name; - asprintf(&name, "%s,lun,%ju", target->t_name, - ucl_object_toint(obj)); + tmp = ucl_object_toint(obj); + if (tmp >= MAX_LUNS) { + log_warnx("LU number %ju in target \"%s\" is too big", + tmp, target->t_name); + return (1); + } + + asprintf(&name, "%s,lun,%ju", target->t_name, tmp); lun = lun_new(conf, name); if (lun == NULL) return (1); lun_set_scsiname(lun, name); - target->t_luns[ucl_object_toint(obj)] = lun; + target->t_luns[tmp] = lun; return (0); } @@ -207,6 +214,12 @@ uclparse_target_lun(struct target *targe "\"number\" integer property", target->t_name); return (1); } + tmp = ucl_object_toint(num); + if (tmp >= MAX_LUNS) { + log_warnx("LU number %ju in target \"%s\" is too big", + tmp, target->t_name); + return (1); + } if (name == NULL || name->type != UCL_STRING) { log_warnx("lun section in target \"%s\" is missing " @@ -218,7 +231,7 @@ uclparse_target_lun(struct target *targe if (lun == NULL) return (1); - target->t_luns[ucl_object_toint(num)] = lun; + target->t_luns[tmp] = lun; } return (0); From owner-svn-src-all@freebsd.org Tue Dec 27 17:31:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0DB8C92B90; Tue, 27 Dec 2016 17:31:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 671C0179E; Tue, 27 Dec 2016 17:31:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRHV7BO004205; Tue, 27 Dec 2016 17:31:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRHV7Ul004204; Tue, 27 Dec 2016 17:31:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612271731.uBRHV7Ul004204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 27 Dec 2016 17:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310634 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 17:31:08 -0000 Author: emaste Date: Tue Dec 27 17:31:07 2016 New Revision: 310634 URL: https://svnweb.freebsd.org/changeset/base/310634 Log: elfcopy: fix PE object section name corruption and crash Fixed a bug that the PE object section names are generated incorrectly using the section name table found in the original input ELF object instead of the intermediate ELF object. Ticket: #541 Do not try to copy section content from a NULL d_buf when creating uninitialized data COFF section for PE object. Ticket: #540 Obtained from: ELF Tool Chain r3507, r3508 MFC after: 1 week Modified: head/contrib/elftoolchain/elfcopy/pe.c Modified: head/contrib/elftoolchain/elfcopy/pe.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/pe.c Tue Dec 27 17:13:31 2016 (r310633) +++ head/contrib/elftoolchain/elfcopy/pe.c Tue Dec 27 17:31:07 2016 (r310634) @@ -70,7 +70,7 @@ create_pe(struct elfcopy *ecp, int ifd, errx(EXIT_FAILURE, "gelf_getehdr() failed: %s", elf_errmsg(-1)); - if (elf_getshstrndx(ecp->ein, &indx) == 0) + if (elf_getshstrndx(e, &indx) == 0) errx(EXIT_FAILURE, "elf_getshstrndx() failed: %s", elf_errmsg(-1)); @@ -124,7 +124,7 @@ create_pe(struct elfcopy *ecp, int ifd, (void) elf_errno(); continue; } - if ((name = elf_strptr(ecp->ein, indx, sh.sh_name)) == + if ((name = elf_strptr(e, indx, sh.sh_name)) == NULL) { warnx("elf_strptr() failed: %s", elf_errmsg(-1)); (void) elf_errno(); @@ -210,12 +210,14 @@ create_pe(struct elfcopy *ecp, int ifd, } pb->pb_align = 1; pb->pb_off = 0; - pb->pb_size = roundup(sh.sh_size, poh.oh_filealign); - if ((pb->pb_buf = calloc(1, pb->pb_size)) == NULL) { - warn("calloc failed"); - continue; + if (sh.sh_type != SHT_NOBITS) { + pb->pb_size = roundup(sh.sh_size, poh.oh_filealign); + if ((pb->pb_buf = calloc(1, pb->pb_size)) == NULL) { + warn("calloc failed"); + continue; + } + memcpy(pb->pb_buf, d->d_buf, sh.sh_size); } - memcpy(pb->pb_buf, d->d_buf, sh.sh_size); } elferr = elf_errno(); if (elferr != 0) From owner-svn-src-all@freebsd.org Tue Dec 27 18:23:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76612C9334C; Tue, 27 Dec 2016 18:23:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3714E1993; Tue, 27 Dec 2016 18:23:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRINHfO028634; Tue, 27 Dec 2016 18:23:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRINHwn028630; Tue, 27 Dec 2016 18:23:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612271823.uBRINHwn028630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Dec 2016 18:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310635 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 18:23:18 -0000 Author: mav Date: Tue Dec 27 18:23:16 2016 New Revision: 310635 URL: https://svnweb.freebsd.org/changeset/base/310635 Log: Decouple limits on number of LUNs per port and LUs per CTL. Those two values are not directly related, so make them independent. This does not change any limits immediately, but makes number of LUNs per port controllable via tunable/sysctl kern.cam.ctl.lun_map_size. After this change increasing CTL_MAX_LUNS should be pretty cheap, and even making it tunable should be easy. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_frontend.h head/sys/cam/ctl/ctl_io.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 27 17:31:07 2016 (r310634) +++ head/sys/cam/ctl/ctl.c Tue Dec 27 18:23:16 2016 (r310635) @@ -407,6 +407,9 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, work static int ctl_debug = CTL_DEBUG_NONE; SYSCTL_INT(_kern_cam_ctl, OID_AUTO, debug, CTLFLAG_RWTUN, &ctl_debug, 0, "Enabled debug flags"); +static int ctl_lun_map_size = 1024; +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, lun_map_size, CTLFLAG_RWTUN, + &ctl_lun_map_size, 0, "Size of per-port LUN map (max LUN + 1)"); /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), @@ -826,7 +829,7 @@ ctl_isc_announce_port(struct ctl_port *p return; i = sizeof(msg->port) + strlen(port->port_name) + 1; if (port->lun_map) - i += sizeof(uint32_t) * CTL_MAX_LUNS; + i += port->lun_map_size * sizeof(uint32_t); if (port->port_devid) i += port->port_devid->len; if (port->target_devid) @@ -846,7 +849,7 @@ ctl_isc_announce_port(struct ctl_port *p "%d:%s", softc->ha_id, port->port_name) + 1; i += msg->port.name_len; if (port->lun_map) { - msg->port.lun_map_len = sizeof(uint32_t) * CTL_MAX_LUNS; + msg->port.lun_map_len = port->lun_map_size * sizeof(uint32_t); memcpy(&msg->port.data[i], port->lun_map, msg->port.lun_map_len); i += msg->port.lun_map_len; @@ -1155,19 +1158,25 @@ ctl_isc_port_sync(struct ctl_softc *soft M_CTL); i += msg->port.name_len; if (msg->port.lun_map_len != 0) { - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || + port->lun_map_size * sizeof(uint32_t) < + msg->port.lun_map_len) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(msg->port.lun_map_len, M_CTL, M_WAITOK); - memcpy(port->lun_map, &msg->port.data[i], - sizeof(uint32_t) * CTL_MAX_LUNS); + } + memcpy(port->lun_map, &msg->port.data[i], msg->port.lun_map_len); + port->lun_map_size = msg->port.lun_map_len / sizeof(uint32_t); i += msg->port.lun_map_len; } else { + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; } if (msg->port.port_devid_len != 0) { if (port->port_devid == NULL || - port->port_devid->len != msg->port.port_devid_len) { + port->port_devid->len < msg->port.port_devid_len) { free(port->port_devid, M_CTL); port->port_devid = malloc(sizeof(struct ctl_devid) + msg->port.port_devid_len, M_CTL, M_WAITOK); @@ -1182,7 +1191,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.target_devid_len != 0) { if (port->target_devid == NULL || - port->target_devid->len != msg->port.target_devid_len) { + port->target_devid->len < msg->port.target_devid_len) { free(port->target_devid, M_CTL); port->target_devid = malloc(sizeof(struct ctl_devid) + msg->port.target_devid_len, M_CTL, M_WAITOK); @@ -1197,7 +1206,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.init_devid_len != 0) { if (port->init_devid == NULL || - port->init_devid->len != msg->port.init_devid_len) { + port->init_devid->len < msg->port.init_devid_len) { free(port->init_devid, M_CTL); port->init_devid = malloc(sizeof(struct ctl_devid) + msg->port.init_devid_len, M_CTL, M_WAITOK); @@ -3295,7 +3304,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (port->lun_map != NULL) { sbuf_printf(sb, "\ton\n"); - for (j = 0; j < CTL_MAX_LUNS; j++) { + for (j = 0; j < port->lun_map_size; j++) { plun = ctl_lun_map_from_port(port, j); if (plun == UINT32_MAX) continue; @@ -3375,7 +3384,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } } mtx_unlock(&softc->ctl_lock); // XXX: port_enable sleeps - if (lm->plun < CTL_MAX_LUNS) { + if (lm->plun != UINT32_MAX) { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_unset(port, lm->plun); else if (lm->lun < CTL_MAX_LUNS && @@ -3383,13 +3392,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = ctl_lun_map_set(port, lm->plun, lm->lun); else return (ENXIO); - } else if (lm->plun == UINT32_MAX) { + } else { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_deinit(port); else retval = ctl_lun_map_init(port); - } else - return (ENXIO); + } if (port->status & CTL_PORT_STATUS_ONLINE) ctl_isc_announce_port(port); break; @@ -3442,15 +3450,20 @@ ctl_lun_map_init(struct ctl_port *port) { struct ctl_softc *softc = port->ctl_softc; struct ctl_lun *lun; + int size = ctl_lun_map_size; uint32_t i; - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || port->lun_map_size < size) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(size * sizeof(uint32_t), M_CTL, M_NOWAIT); + } if (port->lun_map == NULL) return (ENOMEM); - for (i = 0; i < CTL_MAX_LUNS; i++) + for (i = 0; i < size; i++) port->lun_map[i] = UINT32_MAX; + port->lun_map_size = size; if (port->status & CTL_PORT_STATUS_ONLINE) { if (port->lun_disable != NULL) { STAILQ_FOREACH(lun, &softc->lun_list, links) @@ -3469,6 +3482,7 @@ ctl_lun_map_deinit(struct ctl_port *port if (port->lun_map == NULL) return (0); + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; if (port->status & CTL_PORT_STATUS_ONLINE) { @@ -3492,6 +3506,8 @@ ctl_lun_map_set(struct ctl_port *port, u if (status != 0) return (status); } + if (plun >= port->lun_map_size) + return (EINVAL); old = port->lun_map[plun]; port->lun_map[plun] = glun; if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { @@ -3507,7 +3523,7 @@ ctl_lun_map_unset(struct ctl_port *port, { uint32_t old; - if (port->lun_map == NULL) + if (port->lun_map == NULL || plun >= port->lun_map_size) return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; @@ -3525,8 +3541,10 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id == UINT32_MAX) + if (port->lun_map == NULL) return (lun_id); + if (lun_id > port->lun_map_size) + return (UINT32_MAX); return (port->lun_map[lun_id]); } @@ -3539,7 +3557,7 @@ ctl_lun_map_to_port(struct ctl_port *por return (UINT32_MAX); if (port->lun_map == NULL) return (lun_id); - for (i = 0; i < CTL_MAX_LUNS; i++) { + for (i = 0; i < port->lun_map_size; i++) { if (port->lun_map[i] == lun_id) return (i); } @@ -9048,9 +9066,8 @@ ctl_report_luns(struct ctl_scsiio *ctsio struct scsi_report_luns_data *lun_data; struct ctl_lun *lun, *request_lun; struct ctl_port *port; - int num_luns, retval; + int num_filled, num_luns, num_port_luns, retval; uint32_t alloc_len, lun_datalen; - int num_filled; uint32_t initidx, targ_lun_id, lun_id; retval = CTL_RETVAL_COMPLETE; @@ -9060,9 +9077,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_report_luns\n")); - mtx_lock(&softc->ctl_lock); num_luns = 0; - for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { + num_port_luns = port->lun_map ? port->lun_map_size : CTL_MAX_LUNS; + mtx_lock(&softc->ctl_lock); + for (targ_lun_id = 0; targ_lun_id < num_port_luns; targ_lun_id++) { if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } @@ -9121,7 +9139,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); mtx_lock(&softc->ctl_lock); - for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { + for (targ_lun_id = 0, num_filled = 0; + targ_lun_id < num_port_luns && num_filled < num_luns; + targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); if (lun_id == UINT32_MAX) continue; Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Tue Dec 27 17:31:07 2016 (r310634) +++ head/sys/cam/ctl/ctl_frontend.c Tue Dec 27 18:23:16 2016 (r310635) @@ -315,7 +315,7 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; @@ -359,7 +359,7 @@ ctl_port_offline(struct ctl_port *port) port->port_offline(port->onoff_arg); if (port->lun_disable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; Modified: head/sys/cam/ctl/ctl_frontend.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend.h Tue Dec 27 17:31:07 2016 (r310634) +++ head/sys/cam/ctl/ctl_frontend.h Tue Dec 27 18:23:16 2016 (r310635) @@ -225,6 +225,7 @@ struct ctl_port { void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ + int lun_map_size; /* passed to CTL */ uint32_t *lun_map; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Tue Dec 27 17:31:07 2016 (r310634) +++ head/sys/cam/ctl/ctl_io.h Tue Dec 27 18:23:16 2016 (r310635) @@ -365,7 +365,7 @@ struct ctl_taskio { /* * HA link messages. */ -#define CTL_HA_VERSION 1 +#define CTL_HA_VERSION 2 /* * Used for CTL_MSG_LOGIN. From owner-svn-src-all@freebsd.org Tue Dec 27 18:48:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57BDBC938B3; Tue, 27 Dec 2016 18:48:20 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D76DC1499; Tue, 27 Dec 2016 18:48:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id u144so58389530wmu.0; Tue, 27 Dec 2016 10:48:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QUyXkiY0/KZFjcDxEubcDuTUwDblAVofste+4KOtob0=; b=NKMaZLoc/G/qRCqugx1ZSR6aL5+Acyw1gHI94c9BR1G0uDXIkzrOxN+pvx8Mcccde2 svR1qjMU+0xCTRi+qqtrtfhlBK0QksVApLf/9M3Y2SoA3E380+PI8nH4LlHhN+yfBxQj UtcJkcgxl5+Fl2f3Y1o2rv52b67XVoL8dpJMH4rQRUIwAH5avqkhZPDCu+gBd6bbA0I8 p0MfxiJ/3rrjbgJxL2EheTIirgZ+1JHe7cGqpgvtQxxVSwUFLoLj9K3NK+ZvXvQfTT8m EciPs7bQQoVxnXTOJ/fUgydUi77yZyowiXAtIrctWoTSmzQP3NRXF2xjUDBHiL+G152/ m/uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=QUyXkiY0/KZFjcDxEubcDuTUwDblAVofste+4KOtob0=; b=s2yzd5f4NdqC4OC4RHUax4oFGzIllGCJrA4w6oTui2O/qsqS4pExmAdd3DZv/KR6i8 eNRUd+AMIq0Y6CzcqGyxiEk11o6/7CJnMMHv4WjTZuQnCLfi2lmy1QVBHqz6oBCPlhAx pDXYrS5EdTLkwqSS3FVOSHDzBFeq8yyefgjyTQWH3MHjea5iG0XwDUlFLB6Ms8afZI13 YWUlzPqjq5bIUNQsaFQejUmiyl2+DjLHrruQOaIjPwKvswB0HxM0gpB/rK40WDInebNN FeNICRjqmKnlKbrSREGAFBN+ilVuONC0SxAyhWSVx7EXrRVPfUuHu2tYSIs99JMq0KPb Lq4w== X-Gm-Message-State: AIkVDXKs9tr5yj/gWz0m05BqQAopi6eXVDBMWG2V51+kv+oXrCo3cP6wFp3S5RTg1LIhGlYZq6LewtzRbWATqQ== X-Received: by 10.28.165.82 with SMTP id o79mr17941688wme.129.1482864498188; Tue, 27 Dec 2016 10:48:18 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.194.44.1 with HTTP; Tue, 27 Dec 2016 10:48:17 -0800 (PST) In-Reply-To: <20161227140846.xu4f6lmsgqytuhne@mutt-hardenedbsd> References: <201612270610.uBR6ASrp025710@repo.freebsd.org> <20161227140846.xu4f6lmsgqytuhne@mutt-hardenedbsd> From: Adrian Chadd Date: Tue, 27 Dec 2016 10:48:17 -0800 X-Google-Sender-Auth: 6EkElqfV0HDqV_T4p5xhjrefq5A Message-ID: Subject: Re: svn commit: r310624 - head/sys/net80211 To: Shawn Webb Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 18:48:20 -0000 Hi, As it's a kernel change in a frequently changing subsystem in -HEAD, I'm opting not to bump it until I get the 11ac bits "done" enough. Otherwise there'd be a lot of churn. I did bump it for the userland facing ABI though as that did have a pretty big impact. Anyone using binary-only wifi kernel modules on FreeBSD should know better. :) I promise to bump it once 11ac is "done" enough to use, so there is a good reference point. Thanks, -adrian On 27 December 2016 at 06:08, Shawn Webb wrote: > On Tue, Dec 27, 2016 at 06:10:28AM +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Tue Dec 27 06:10:28 2016 >> New Revision: 310624 >> URL: https://svnweb.freebsd.org/changeset/base/310624 >> >> Log: >> [net80211] turn the default TX key configuration (for WEP) into a vap callback. >> >> The ath10k firmware supports hardware WEP offload, and in native wifi mode >> (or 802.3 ethernet mode, for that matter) the WEP key isn't actually included >> in the TX payload from net80211. Instead, a separate firmware command is issued >> that sets the default TX key to be the specified key. >> >> However, net80211 doesn't at all inform the driver layer that this is >> occuring - it just "expects" to be inserting WEP header information >> when doing WEP TX, even with hardware encryption. >> >> So, to better support the newer world order, turn the default TX key assignment >> into a VAP method that can be overridden by the driver and ensure its wrapped >> in a crypto begin/end set. That way it should be correctly atomic from the >> point of view of keychanges (as long as the driver does the right thing.) >> >> It'd be nice if we passed through to the key_set call a flag that says >> "also make this the default key" - that's captured here by calling the >> deftxkey method after the key_set method. Maybe I can do that later. >> >> Note: this is a net80211 ABI change, and will require a kernel+modules >> recompile. Happy Holidays, etc. > > Hey Adrian, > > Thank you very much for your hard work on the wireless stack. Since this > introduces an ABI change, should __FreeBSD_version be bumped? > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE From owner-svn-src-all@freebsd.org Tue Dec 27 18:50:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5CFBC939EC for ; Tue, 27 Dec 2016 18:50:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89FCE17A5 for ; Tue, 27 Dec 2016 18:50:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x22f.google.com with SMTP id u25so216330664qki.2 for ; Tue, 27 Dec 2016 10:50:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UlPp1hdCfOpF7u0wdvwTVYa7saALUaFByXAVw8UKF2o=; b=KBojRPYcgYwbbOR7Z9Jp/3GRJlVipN1cE+O5ZOGuSK/EifvLVpIVB3p5XAoV1XMhLB fZTo6VhNzqmGn/TUZkelSeQx8CL9qVSl6guMmw1ngka4kINpfs3OzpXw3iueygy58nuv PWN/y5EzvBLds60mghfxet5gSYrLTwOMAHKkWp4Nnlu0Tsx4q6z7EbUN0mlDWZFPEeyK o19kN6zTi4mGk2Y2SHowfDdWoTgx4FSssKJd2wAQqyYnEskTr+jxsMP9W7CoyI6hFbGT y0moz3K7/lQgcRU2A92a1C5T8PxYVrfr1NXN/Kh7qrdeTlgNEfWxaX8mhbz6/DTA1Wrf rnGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UlPp1hdCfOpF7u0wdvwTVYa7saALUaFByXAVw8UKF2o=; b=f1M30Y9+hS1CDJGPURHqFEkzSd641lcaDBRfbuI4ni2UKw4MI9Ixg8xV/Y0sZobMRz Gx/qsJ8CWb7MBeWo/3JWMzp6M1Ut+HfcI9WRcjg8GX5ysfXZK5SMuyJlLUdac7ynP3V9 JQsd2M69cTyxe1x1eT1JRQ85WurYVt/NYasB0ia/yZIapM8y2EjAGjIektUMaaWFTBCg PKWApucmpNCeIqxT8gqJLkRm2SFtrr8Y1UWcHHcsUqZAoWIUGS7ETvPk5jGA8k9GnHdv dCTvbhZOGro/Wif9NCWNpRd6qDfyoFcL/RZk9XAj5yAjkkk3Fifpdwq/mVYt0TXy2GnA 2QPw== X-Gm-Message-State: AIkVDXLmq4J4j1GEY6uyQov4xdr2dDo8Ym2ZQAiOIpJ3sigu0B3p9j8O0E+IRfIiuHntr491 X-Received: by 10.55.44.193 with SMTP id s184mr35029490qkh.278.1482864610591; Tue, 27 Dec 2016 10:50:10 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id w34sm29059222qtw.10.2016.12.27.10.50.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Dec 2016 10:50:09 -0800 (PST) Date: Tue, 27 Dec 2016 13:50:08 -0500 From: Shawn Webb To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r310624 - head/sys/net80211 Message-ID: <20161227185008.ugrmmnwfdpin4mcf@mutt-hardenedbsd> References: <201612270610.uBR6ASrp025710@repo.freebsd.org> <20161227140846.xu4f6lmsgqytuhne@mutt-hardenedbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yvkoprcmqyatt6gk" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 18:50:11 -0000 --yvkoprcmqyatt6gk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sounds good. Thanks for the explanation! On Tue, Dec 27, 2016 at 10:48:17AM -0800, Adrian Chadd wrote: > Hi, >=20 > As it's a kernel change in a frequently changing subsystem in -HEAD, > I'm opting not to bump it until I get the 11ac bits "done" enough. > Otherwise there'd be a lot of churn. I did bump it for the userland > facing ABI though as that did have a pretty big impact. >=20 > Anyone using binary-only wifi kernel modules on FreeBSD should know bette= r. :) >=20 > I promise to bump it once 11ac is "done" enough to use, so there is a > good reference point. >=20 > Thanks, >=20 >=20 > -adrian >=20 >=20 > On 27 December 2016 at 06:08, Shawn Webb wro= te: > > On Tue, Dec 27, 2016 at 06:10:28AM +0000, Adrian Chadd wrote: > >> Author: adrian > >> Date: Tue Dec 27 06:10:28 2016 > >> New Revision: 310624 > >> URL: https://svnweb.freebsd.org/changeset/base/310624 > >> > >> Log: > >> [net80211] turn the default TX key configuration (for WEP) into a va= p callback. > >> > >> The ath10k firmware supports hardware WEP offload, and in native wif= i mode > >> (or 802.3 ethernet mode, for that matter) the WEP key isn't actually= included > >> in the TX payload from net80211. Instead, a separate firmware comma= nd is issued > >> that sets the default TX key to be the specified key. > >> > >> However, net80211 doesn't at all inform the driver layer that this is > >> occuring - it just "expects" to be inserting WEP header information > >> when doing WEP TX, even with hardware encryption. > >> > >> So, to better support the newer world order, turn the default TX key= assignment > >> into a VAP method that can be overridden by the driver and ensure it= s wrapped > >> in a crypto begin/end set. That way it should be correctly atomic f= rom the > >> point of view of keychanges (as long as the driver does the right th= ing.) > >> > >> It'd be nice if we passed through to the key_set call a flag that sa= ys > >> "also make this the default key" - that's captured here by calling t= he > >> deftxkey method after the key_set method. Maybe I can do that later. > >> > >> Note: this is a net80211 ABI change, and will require a kernel+modul= es > >> recompile. Happy Holidays, etc. > > > > Hey Adrian, > > > > Thank you very much for your hard work on the wireless stack. Since this > > introduces an ABI change, should __FreeBSD_version be bumped? > > > > Thanks, > > > > -- > > Shawn Webb > > Cofounder and Security Engineer > > HardenedBSD > > > > GPG Key ID: 0x6A84658F52456EEE > > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --yvkoprcmqyatt6gk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlhit94ACgkQaoRlj1JF bu6imQ/6AoeWLdRHHTj07nDHEE33ER+fpZHlyD2EaMCeh4q1rHo5sqgDRFhVJMdA vVXpQrFUZ6DWwqGoN3s7ATXQqrgYv0iKHO03JtpQTe7bSckel/wYf9mJ/evgOG9o ZMeU4cR5t1Dc9Yybff7AwtTaUskcJm5IV0iCL3iUmoS8qE7JJxzexHxYaUwdHY6x 2SNeinDie4P5yJBBMYzjhD52MCHrmS6DspCkXV+aW6u4MHjL299clI5Txs9HxNxS lIFolrBZjjMUx+t2sZ/Ig7XcFFApCbroDpDbM3bHAK8lrCUfDG6u55i1WpYc75UB ZM1SvNk0GhpHnPCzIbUE+96ATVGH7ygerXC9fnvHz8BY1GX6eKSRQZFrix8F8Gvp vXP7La32axyPfsNu8nTpkXOK9jPn7PtU1VvJcI8iHrmYSqNCa+YXrAo/nkRrppvM 1dVMdASbGQLvHuGCU0U1Ra+UsDjiEa3aeo4+7RELdfwwQtq71yHB0jxP0lsLO69v EkGgOzvx4Cz0d3TCxVVn+/TAVw8l2FcgVB6idjBe2RxpKnukTugZ/babfZF76hff s+4OsQmC2u2d2/S9pIyu5gCyYtJBElmcHE/6p6zeMecOZqDFeMHnjCrcvYhchc21 wthqyvMlVXKp332+od45teTDvQGGGjYr6+i+z/PFIJFFIZbuj2Y= =/aNR -----END PGP SIGNATURE----- --yvkoprcmqyatt6gk-- From owner-svn-src-all@freebsd.org Tue Dec 27 19:08:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A141AC93024; Tue, 27 Dec 2016 19:08:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 684AE1454; Tue, 27 Dec 2016 19:08:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRJ88YY046231; Tue, 27 Dec 2016 19:08:08 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRJ88DE046230; Tue, 27 Dec 2016 19:08:08 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612271908.uBRJ88DE046230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 27 Dec 2016 19:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310636 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 19:08:09 -0000 Author: gonzo Date: Tue Dec 27 19:08:08 2016 New Revision: 310636 URL: https://svnweb.freebsd.org/changeset/base/310636 Log: [rpi] Fix bcm2835_audio locking and samples starvation Rework general approach to locking and working with audio worker thread: - Use flags to signal requested worker action - Fix submitted buffer calculations to avoid samples starvation - Protect buffer pointers with locks to fix race condition between callback and audio worker thread - Remove unnecessary vchi_service_use - Do not use lock to serialize VCHI requests since only one thread issues them now - Fix unloading signaling per hselasky@ suggestion - Add output to detect inconsistent callback data caused by possible firmware bug https://github.com/raspberrypi/firmware/issues/696 - Add stats/debug sysctls to troubleshoot possible bugs PR: 213687, 205979, 215194 MFC after: 1 week Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Tue Dec 27 18:23:16 2016 (r310635) +++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Tue Dec 27 19:08:08 2016 (r310636) @@ -40,13 +40,33 @@ SND_DECLARE_FILE("$FreeBSD$"); +/* Audio destination */ #define DEST_AUTO 0 #define DEST_HEADPHONES 1 #define DEST_HDMI 2 +/* Playback state */ +#define PLAYBACK_IDLE 0 +#define PLAYBACK_PLAYING 1 +#define PLAYBACK_STOPPING 2 + +/* Worker thread state */ +#define WORKER_RUNNING 0 +#define WORKER_STOPPING 1 +#define WORKER_STOPPED 2 + +/* + * Worker thread flags, set to 1 in flags_pending + * when driver requests one or another operation + * from worker. Cleared to 0 once worker performs + * the operations. + */ +#define AUDIO_PARAMS (1 << 0) +#define AUDIO_PLAY (1 << 1) +#define AUDIO_STOP (1 << 2) + #define VCHIQ_AUDIO_PACKET_SIZE 4000 -#define VCHIQ_AUDIO_BUFFER_SIZE 128000 -#define VCHIQ_AUDIO_PREBUFFER 10 /* Number of pre-buffered audio messages */ +#define VCHIQ_AUDIO_BUFFER_SIZE 10*VCHIQ_AUDIO_PACKET_SIZE #define VCHIQ_AUDIO_MAX_VOLUME /* volume in terms of 0.01dB */ @@ -77,22 +97,25 @@ static struct pcmchan_caps bcm2835_audio struct bcm2835_audio_info; -#define PLAYBACK_IDLE 0 -#define PLAYBACK_STARTING 1 -#define PLAYBACK_PLAYING 2 -#define PLAYBACK_STOPPING 3 - struct bcm2835_audio_chinfo { struct bcm2835_audio_info *parent; struct pcm_channel *channel; struct snd_dbuf *buffer; uint32_t fmt, spd, blksz; - uint32_t complete_pos; - uint32_t free_buffer; - uint32_t buffered_ptr; + /* Pointer to first unsubmitted sample */ + uint32_t unsubmittedptr; + /* + * Number of bytes in "submitted but not played" + * pseudo-buffer + */ + int available_space; int playback_state; - int prebuffered; + uint64_t callbacks; + uint64_t submitted_samples; + uint64_t retrieved_samples; + uint64_t underruns; + int starved; }; struct bcm2835_audio_info { @@ -100,32 +123,25 @@ struct bcm2835_audio_info { unsigned int bufsz; struct bcm2835_audio_chinfo pch; uint32_t dest, volume; - struct mtx *lock; struct intr_config_hook intr_hook; /* VCHI data */ - struct sx vchi_lock; - VCHI_INSTANCE_T vchi_instance; VCHI_CONNECTION_T *vchi_connection; VCHI_SERVICE_HANDLE_T vchi_handle; - struct sx worker_lock; + struct mtx lock; struct cv worker_cv; - bool parameters_update_pending; - bool controls_update_pending; + uint32_t flags_pending; - /* Unloadign module */ - int unloading; + /* Worker thread state */ + int worker_state; }; -#define bcm2835_audio_lock(_ess) snd_mtxlock((_ess)->lock) -#define bcm2835_audio_unlock(_ess) snd_mtxunlock((_ess)->lock) -#define bcm2835_audio_lock_assert(_ess) snd_mtxassert((_ess)->lock) - -#define VCHIQ_VCHI_LOCK(sc) sx_xlock(&(sc)->vchi_lock) -#define VCHIQ_VCHI_UNLOCK(sc) sx_xunlock(&(sc)->vchi_lock) +#define BCM2835_AUDIO_LOCK(sc) mtx_lock(&(sc)->lock) +#define BCM2835_AUDIO_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED) +#define BCM2835_AUDIO_UNLOCK(sc) mtx_unlock(&(sc)->lock) static const char * dest_description(uint32_t dest) @@ -149,6 +165,36 @@ dest_description(uint32_t dest) } static void +bcm2835_worker_update_params(struct bcm2835_audio_info *sc) +{ + + BCM2835_AUDIO_LOCKED(sc); + + sc->flags_pending |= AUDIO_PARAMS; + cv_signal(&sc->worker_cv); +} + +static void +bcm2835_worker_play_start(struct bcm2835_audio_info *sc) +{ + BCM2835_AUDIO_LOCK(sc); + sc->flags_pending &= ~(AUDIO_STOP); + sc->flags_pending |= AUDIO_PLAY; + cv_signal(&sc->worker_cv); + BCM2835_AUDIO_UNLOCK(sc); +} + +static void +bcm2835_worker_play_stop(struct bcm2835_audio_info *sc) +{ + BCM2835_AUDIO_LOCK(sc); + sc->flags_pending &= ~(AUDIO_PLAY); + sc->flags_pending |= AUDIO_STOP; + cv_signal(&sc->worker_cv); + BCM2835_AUDIO_UNLOCK(sc); +} + +static void bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *msg_handle) { struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)param; @@ -163,7 +209,7 @@ bcm2835_audio_callback(void *param, cons &m, sizeof m, &msg_len, VCHI_FLAGS_NONE); if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { if (m.u.result.success) { - device_printf(sc->dev, + device_printf(sc->dev, "msg type %08x failed\n", m.type); } @@ -172,13 +218,35 @@ bcm2835_audio_callback(void *param, cons int count = m.u.complete.count & 0xffff; int perr = (m.u.complete.count & (1U << 30)) != 0; - - ch->complete_pos = (ch->complete_pos + count) % sndbuf_getsize(ch->buffer); - ch->free_buffer += count; - chn_intr(sc->pch.channel); - - if (perr || ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE) - cv_signal(&sc->worker_cv); + ch->callbacks++; + if (perr) + ch->underruns++; + + BCM2835_AUDIO_LOCK(sc); + if (ch->playback_state != PLAYBACK_IDLE) { + /* Prevent LOR */ + BCM2835_AUDIO_UNLOCK(sc); + chn_intr(sc->pch.channel); + BCM2835_AUDIO_LOCK(sc); + } + /* We should check again, state might have changed */ + if (ch->playback_state != PLAYBACK_IDLE) { + if (!perr) { + if ((ch->available_space + count)> VCHIQ_AUDIO_BUFFER_SIZE) { + device_printf(sc->dev, "inconsistent data in callback:\n"); + device_printf(sc->dev, "available_space == %d, count = %d, perr=%d\n", + ch->available_space, count, perr); + device_printf(sc->dev, + "retrieved_samples = %lld, submitted_samples = %lld\n", + ch->retrieved_samples, ch->submitted_samples); + } + ch->available_space += count; + ch->retrieved_samples += count; + } + if (perr || (ch->available_space >= VCHIQ_AUDIO_PACKET_SIZE)) + cv_signal(&sc->worker_cv); + } + BCM2835_AUDIO_UNLOCK(sc); } else printf("%s: unknown m.type: %d\n", __func__, m.type); } @@ -218,10 +286,7 @@ bcm2835_audio_init(struct bcm2835_audio_ status = vchi_service_open(sc->vchi_instance, ¶ms, &sc->vchi_handle); - if (status == 0) - /* Finished with the service for now */ - vchi_service_release(sc->vchi_handle); - else + if (status != 0) sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; } @@ -231,10 +296,10 @@ bcm2835_audio_release(struct bcm2835_aud int success; if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { - vchi_service_use(sc->vchi_handle); success = vchi_service_close(sc->vchi_handle); if (success != 0) printf("vchi_service_close failed: %d\n", success); + vchi_service_release(sc->vchi_handle); sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; } @@ -244,12 +309,9 @@ bcm2835_audio_release(struct bcm2835_aud static void bcm2835_audio_reset_channel(struct bcm2835_audio_chinfo *ch) { - ch->free_buffer = VCHIQ_AUDIO_BUFFER_SIZE; - ch->playback_state = 0; - ch->buffered_ptr = 0; - ch->complete_pos = 0; - ch->prebuffered = 0; + ch->available_space = VCHIQ_AUDIO_BUFFER_SIZE; + ch->unsubmittedptr = 0; sndbuf_reset(ch->buffer); } @@ -260,21 +322,14 @@ bcm2835_audio_start(struct bcm2835_audio int ret; struct bcm2835_audio_info *sc = ch->parent; - VCHIQ_VCHI_LOCK(sc); if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { - vchi_service_use(sc->vchi_handle); - m.type = VC_AUDIO_MSG_TYPE_START; ret = vchi_msg_queue(sc->vchi_handle, &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - - vchi_service_release(sc->vchi_handle); } - VCHIQ_VCHI_UNLOCK(sc); - } static void @@ -284,10 +339,7 @@ bcm2835_audio_stop(struct bcm2835_audio_ int ret; struct bcm2835_audio_info *sc = ch->parent; - VCHIQ_VCHI_LOCK(sc); if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { - vchi_service_use(sc->vchi_handle); - m.type = VC_AUDIO_MSG_TYPE_STOP; m.u.stop.draining = 0; @@ -296,10 +348,7 @@ bcm2835_audio_stop(struct bcm2835_audio_ if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - - vchi_service_release(sc->vchi_handle); } - VCHIQ_VCHI_UNLOCK(sc); } static void @@ -308,20 +357,14 @@ bcm2835_audio_open(struct bcm2835_audio_ VC_AUDIO_MSG_T m; int ret; - VCHIQ_VCHI_LOCK(sc); if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { - vchi_service_use(sc->vchi_handle); - m.type = VC_AUDIO_MSG_TYPE_OPEN; ret = vchi_msg_queue(sc->vchi_handle, &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - - vchi_service_release(sc->vchi_handle); } - VCHIQ_VCHI_UNLOCK(sc); } static void @@ -330,10 +373,7 @@ bcm2835_audio_update_controls(struct bcm VC_AUDIO_MSG_T m; int ret, db; - VCHIQ_VCHI_LOCK(sc); if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { - vchi_service_use(sc->vchi_handle); - m.type = VC_AUDIO_MSG_TYPE_CONTROL; m.u.control.dest = dest; if (volume > 99) @@ -346,10 +386,7 @@ bcm2835_audio_update_controls(struct bcm if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - - vchi_service_release(sc->vchi_handle); } - VCHIQ_VCHI_UNLOCK(sc); } static void @@ -358,10 +395,7 @@ bcm2835_audio_update_params(struct bcm28 VC_AUDIO_MSG_T m; int ret; - VCHIQ_VCHI_LOCK(sc); if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { - vchi_service_use(sc->vchi_handle); - m.type = VC_AUDIO_MSG_TYPE_CONFIG; m.u.config.channels = AFMT_CHANNEL(fmt); m.u.config.samplerate = speed; @@ -372,76 +406,48 @@ bcm2835_audio_update_params(struct bcm28 if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - - vchi_service_release(sc->vchi_handle); } - VCHIQ_VCHI_UNLOCK(sc); } -static __inline uint32_t -vchiq_unbuffered_bytes(struct bcm2835_audio_chinfo *ch) +static bool +bcm2835_audio_buffer_should_sleep(struct bcm2835_audio_chinfo *ch) { - uint32_t size, ready, readyptr, readyend; - - size = sndbuf_getsize(ch->buffer); - readyptr = sndbuf_getreadyptr(ch->buffer); - ready = sndbuf_getready(ch->buffer); + + if (ch->playback_state != PLAYBACK_PLAYING) + return (true); - readyend = readyptr + ready; - /* Normal case */ - if (ch->buffered_ptr >= readyptr) { - if (readyend > ch->buffered_ptr) - return readyend - ch->buffered_ptr; - else - return 0; + /* Not enough data */ + if (sndbuf_getready(ch->buffer) < VCHIQ_AUDIO_PACKET_SIZE) { + printf("starve\n"); + ch->starved++; + return (true); } - else { /* buffered_ptr overflow */ - if (readyend > ch->buffered_ptr + size) - return readyend - ch->buffered_ptr - size; - else - return 0; + + /* Not enough free space */ + if (ch->available_space < VCHIQ_AUDIO_PACKET_SIZE) { + return (true); } + + return (false); } static void -bcm2835_audio_write_samples(struct bcm2835_audio_chinfo *ch) +bcm2835_audio_write_samples(struct bcm2835_audio_chinfo *ch, void *buf, uint32_t count) { struct bcm2835_audio_info *sc = ch->parent; VC_AUDIO_MSG_T m; - void *buf; - uint32_t count, size; int ret; - VCHIQ_VCHI_LOCK(sc); if (sc->vchi_handle == VCHIQ_SERVICE_HANDLE_INVALID) { - VCHIQ_VCHI_UNLOCK(sc); return; } - vchi_service_use(sc->vchi_handle); - - size = sndbuf_getsize(ch->buffer); - count = vchiq_unbuffered_bytes(ch); - buf = (uint8_t*)sndbuf_getbuf(ch->buffer) + ch->buffered_ptr; - - if (ch->buffered_ptr + count > size) - count = size - ch->buffered_ptr; - - if (count < VCHIQ_AUDIO_PACKET_SIZE) - goto done; - - count = min(count, ch->free_buffer); - count -= count % VCHIQ_AUDIO_PACKET_SIZE; - m.type = VC_AUDIO_MSG_TYPE_WRITE; m.u.write.count = count; m.u.write.max_packet = VCHIQ_AUDIO_PACKET_SIZE; m.u.write.callback = NULL; m.u.write.cookie = ch; - if (buf) - m.u.write.silence = 0; - else - m.u.write.silence = 1; + m.u.write.silence = 0; ret = vchi_msg_queue(sc->vchi_handle, &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); @@ -449,25 +455,16 @@ bcm2835_audio_write_samples(struct bcm28 if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - if (buf) { - while (count > 0) { - int bytes = MIN((int)m.u.write.max_packet, (int)count); - ch->free_buffer -= bytes; - ch->buffered_ptr += bytes; - ch->buffered_ptr = ch->buffered_ptr % size; - ret = vchi_msg_queue(sc->vchi_handle, - buf, bytes, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); - if (ret != 0) - printf("%s: vchi_msg_queue failed: %d\n", - __func__, ret); - buf = (char *)buf + bytes; - count -= bytes; - } + while (count > 0) { + int bytes = MIN((int)m.u.write.max_packet, (int)count); + ret = vchi_msg_queue(sc->vchi_handle, + buf, bytes, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); + if (ret != 0) + printf("%s: vchi_msg_queue failed: %d\n", + __func__, ret); + buf = (char *)buf + bytes; + count -= bytes; } -done: - - vchi_service_release(sc->vchi_handle); - VCHIQ_VCHI_UNLOCK(sc); } static void @@ -477,70 +474,98 @@ bcm2835_audio_worker(void *data) struct bcm2835_audio_chinfo *ch = &sc->pch; uint32_t speed, format; uint32_t volume, dest; - bool parameters_changed, controls_changed; + uint32_t flags; + uint32_t count, size, readyptr; + uint8_t *buf; - sx_slock(&sc->worker_lock); - while(1) { + ch->playback_state = PLAYBACK_IDLE; - if (sc->unloading) + while (1) { + if (sc->worker_state != WORKER_RUNNING) break; - parameters_changed = false; - controls_changed = false; - bcm2835_audio_lock(sc); - if (sc->parameters_update_pending) { - /* TODO: update parameters */ + BCM2835_AUDIO_LOCK(sc); + /* + * wait until there are flags set or buffer is ready + * to consume more samples + */ + while ((sc->flags_pending == 0) && + bcm2835_audio_buffer_should_sleep(ch)) { + cv_wait_sig(&sc->worker_cv, &sc->lock); + } + flags = sc->flags_pending; + /* Clear pending flags */ + sc->flags_pending = 0; + BCM2835_AUDIO_UNLOCK(sc); + + /* Requested to change parameters */ + if (flags & AUDIO_PARAMS) { + BCM2835_AUDIO_LOCK(sc); speed = ch->spd; format = ch->fmt; - sc->parameters_update_pending = false; - parameters_changed = true; - } - - if (sc->controls_update_pending) { volume = sc->volume; dest = sc->dest; - sc->controls_update_pending = false; - controls_changed = true; + BCM2835_AUDIO_UNLOCK(sc); + if (ch->playback_state == PLAYBACK_IDLE) + bcm2835_audio_update_params(sc, format, speed); + bcm2835_audio_update_controls(sc, volume, dest); } - bcm2835_audio_unlock(sc); - - if (parameters_changed) { - bcm2835_audio_update_params(sc, format, speed); + /* Requested to stop playback */ + if ((flags & AUDIO_STOP) && + (ch->playback_state == PLAYBACK_PLAYING)) { + bcm2835_audio_stop(ch); + BCM2835_AUDIO_LOCK(sc); + bcm2835_audio_reset_channel(&sc->pch); + ch->playback_state = PLAYBACK_IDLE; + BCM2835_AUDIO_UNLOCK(sc); + continue; } - if (controls_changed) { - bcm2835_audio_update_controls(sc, volume, dest); + /* Requested to start playback */ + if ((flags & AUDIO_PLAY) && + (ch->playback_state == PLAYBACK_IDLE)) { + BCM2835_AUDIO_LOCK(sc); + ch->playback_state = PLAYBACK_PLAYING; + BCM2835_AUDIO_UNLOCK(sc); + bcm2835_audio_start(ch); } - if (ch->playback_state == PLAYBACK_IDLE) { - cv_wait_sig(&sc->worker_cv, &sc->worker_lock); + if (ch->playback_state == PLAYBACK_IDLE) continue; - } - if (ch->playback_state == PLAYBACK_STOPPING) { - bcm2835_audio_stop(ch); - bcm2835_audio_reset_channel(&sc->pch); - ch->playback_state = PLAYBACK_IDLE; + if (sndbuf_getready(ch->buffer) == 0) continue; - } - if (ch->free_buffer < vchiq_unbuffered_bytes(ch)) { - cv_timedwait_sig(&sc->worker_cv, &sc->worker_lock, 10); + count = sndbuf_getready(ch->buffer); + size = sndbuf_getsize(ch->buffer); + readyptr = sndbuf_getreadyptr(ch->buffer); + + BCM2835_AUDIO_LOCK(sc); + if (readyptr + count > size) + count = size - readyptr; + count = min(count, ch->available_space); + count -= (count % VCHIQ_AUDIO_PACKET_SIZE); + BCM2835_AUDIO_UNLOCK(sc); + + if (count < VCHIQ_AUDIO_PACKET_SIZE) continue; - } - bcm2835_audio_write_samples(ch); + buf = (uint8_t*)sndbuf_getbuf(ch->buffer) + readyptr; - if (ch->playback_state == PLAYBACK_STARTING) { - ch->prebuffered++; - if (ch->prebuffered == VCHIQ_AUDIO_PREBUFFER) { - bcm2835_audio_start(ch); - ch->playback_state = PLAYBACK_PLAYING; - } - } + bcm2835_audio_write_samples(ch, buf, count); + BCM2835_AUDIO_LOCK(sc); + ch->unsubmittedptr = (ch->unsubmittedptr + count) % sndbuf_getsize(ch->buffer); + ch->available_space -= count; + ch->submitted_samples += count; + KASSERT(ch->available_space >= 0, ("ch->available_space == %d\n", ch->available_space)); + BCM2835_AUDIO_UNLOCK(sc); } - sx_sunlock(&sc->worker_lock); + + BCM2835_AUDIO_LOCK(sc); + sc->worker_state = WORKER_STOPPED; + cv_signal(&sc->worker_cv); + BCM2835_AUDIO_UNLOCK(sc); kproc_exit(0); } @@ -550,6 +575,7 @@ bcm2835_audio_create_worker(struct bcm28 { struct proc *newp; + sc->worker_state = WORKER_RUNNING; if (kproc_create(bcm2835_audio_worker, (void*)sc, &newp, 0, 0, "bcm2835_audio_worker") != 0) { printf("failed to create bcm2835_audio_worker\n"); @@ -585,8 +611,9 @@ bcmchan_init(kobj_t obj, void *devinfo, return NULL; } - sc->parameters_update_pending = true; - cv_signal(&sc->worker_cv); + BCM2835_AUDIO_LOCK(sc); + bcm2835_worker_update_params(sc); + BCM2835_AUDIO_UNLOCK(sc); return ch; } @@ -610,12 +637,10 @@ bcmchan_setformat(kobj_t obj, void *data struct bcm2835_audio_chinfo *ch = data; struct bcm2835_audio_info *sc = ch->parent; - bcm2835_audio_lock(sc); + BCM2835_AUDIO_LOCK(sc); ch->fmt = format; - sc->parameters_update_pending = true; - bcm2835_audio_unlock(sc); - - cv_signal(&sc->worker_cv); + bcm2835_worker_update_params(sc); + BCM2835_AUDIO_UNLOCK(sc); return 0; } @@ -626,12 +651,10 @@ bcmchan_setspeed(kobj_t obj, void *data, struct bcm2835_audio_chinfo *ch = data; struct bcm2835_audio_info *sc = ch->parent; - bcm2835_audio_lock(sc); + BCM2835_AUDIO_LOCK(sc); ch->spd = speed; - sc->parameters_update_pending = true; - bcm2835_audio_unlock(sc); - - cv_signal(&sc->worker_cv); + bcm2835_worker_update_params(sc); + BCM2835_AUDIO_UNLOCK(sc); return ch->spd; } @@ -653,25 +676,18 @@ bcmchan_trigger(kobj_t obj, void *data, if (!PCMTRIG_COMMON(go)) return (0); - switch (go) { case PCMTRIG_START: - bcm2835_audio_lock(sc); - bcm2835_audio_reset_channel(ch); - ch->playback_state = PLAYBACK_STARTING; - bcm2835_audio_unlock(sc); /* kickstart data flow */ chn_intr(sc->pch.channel); - /* wakeup worker thread */ - cv_signal(&sc->worker_cv); + ch->submitted_samples = 0; + ch->retrieved_samples = 0; + bcm2835_worker_play_start(sc); break; case PCMTRIG_STOP: case PCMTRIG_ABORT: - bcm2835_audio_lock(sc); - ch->playback_state = PLAYBACK_STOPPING; - bcm2835_audio_unlock(sc); - cv_signal(&sc->worker_cv); + bcm2835_worker_play_stop(sc); break; default: @@ -687,11 +703,9 @@ bcmchan_getptr(kobj_t obj, void *data) struct bcm2835_audio_info *sc = ch->parent; uint32_t ret; - bcm2835_audio_lock(sc); - - ret = ch->complete_pos - (ch->complete_pos % VCHIQ_AUDIO_PACKET_SIZE); - - bcm2835_audio_unlock(sc); + BCM2835_AUDIO_LOCK(sc); + ret = ch->unsubmittedptr; + BCM2835_AUDIO_UNLOCK(sc); return ret; } @@ -734,11 +748,11 @@ bcmmix_set(struct snd_mixer *m, unsigned switch (dev) { case SOUND_MIXER_VOLUME: - bcm2835_audio_lock(sc); + BCM2835_AUDIO_LOCK(sc); sc->volume = left; - sc->controls_update_pending = true; - bcm2835_audio_unlock(sc); - cv_signal(&sc->worker_cv); + bcm2835_worker_update_params(sc); + BCM2835_AUDIO_UNLOCK(sc); + break; default: @@ -771,13 +785,13 @@ sysctl_bcm2835_audio_dest(SYSCTL_HANDLER if ((val < 0) || (val > 2)) return (EINVAL); - bcm2835_audio_lock(sc); + BCM2835_AUDIO_LOCK(sc); sc->dest = val; - sc->controls_update_pending = true; - bcm2835_audio_unlock(sc); + bcm2835_worker_update_params(sc); + BCM2835_AUDIO_UNLOCK(sc); - cv_signal(&sc->worker_cv); - device_printf(sc->dev, "destination set to %s\n", dest_description(val)); + if (bootverbose) + device_printf(sc->dev, "destination set to %s\n", dest_description(val)); return (0); } @@ -799,6 +813,24 @@ vchi_audio_sysctl_init(struct bcm2835_au CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), sysctl_bcm2835_audio_dest, "IU", "audio destination, " "0 - auto, 1 - headphones, 2 - HDMI"); + SYSCTL_ADD_UQUAD(ctx, tree, OID_AUTO, "callbacks", + CTLFLAG_RD, &sc->pch.callbacks, + "callbacks total"); + SYSCTL_ADD_UQUAD(ctx, tree, OID_AUTO, "submitted", + CTLFLAG_RD, &sc->pch.submitted_samples, + "last play submitted samples"); + SYSCTL_ADD_UQUAD(ctx, tree, OID_AUTO, "retrieved", + CTLFLAG_RD, &sc->pch.retrieved_samples, + "last play retrieved samples"); + SYSCTL_ADD_UQUAD(ctx, tree, OID_AUTO, "underruns", + CTLFLAG_RD, &sc->pch.underruns, + "callback underruns"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "freebuffer", + CTLFLAG_RD, &sc->pch.available_space, + sc->pch.available_space, "callbacks total"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "starved", + CTLFLAG_RD, &sc->pch.starved, + sc->pch.starved, "number of starved conditions"); } static void @@ -816,7 +848,6 @@ bcm2835_audio_probe(device_t dev) return (BUS_PROBE_DEFAULT); } - static void bcm2835_audio_delayed_init(void *xsc) { @@ -837,7 +868,7 @@ bcm2835_audio_delayed_init(void *xsc) goto no; } - if (pcm_register(sc->dev, sc, 1, 1)) { + if (pcm_register(sc->dev, sc, 1, 0)) { device_printf(sc->dev, "pcm_register failed\n"); goto no; } @@ -865,14 +896,12 @@ bcm2835_audio_attach(device_t dev) sc->dev = dev; sc->bufsz = VCHIQ_AUDIO_BUFFER_SIZE; - sc->lock = snd_mtxcreate(device_get_nameunit(dev), "bcm2835_audio softc"); - - sx_init(&sc->vchi_lock, device_get_nameunit(dev)); - sx_init(&sc->worker_lock, "bcm_audio_worker_lock"); + mtx_init(&sc->lock, device_get_nameunit(dev), + "bcm_audio_lock", MTX_DEF); cv_init(&sc->worker_cv, "worker_cv"); sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; - /* + /* * We need interrupts enabled for VCHI to work properly, * so delay initialization until it happens. */ @@ -896,26 +925,23 @@ bcm2835_audio_detach(device_t dev) sc = pcm_getdevinfo(dev); /* Stop worker thread */ - sx_xlock(&sc->worker_lock); - sc->unloading = 1; - sx_xunlock(&sc->worker_lock); + BCM2835_AUDIO_LOCK(sc); + sc->worker_state = WORKER_STOPPING; cv_signal(&sc->worker_cv); + /* Wait for thread to exit */ + while (sc->worker_state != WORKER_STOPPED) + cv_wait_sig(&sc->worker_cv, &sc->lock); + BCM2835_AUDIO_UNLOCK(sc); r = pcm_unregister(dev); if (r) return r; - sx_destroy(&sc->vchi_lock); - sx_destroy(&sc->worker_lock); + mtx_destroy(&sc->lock); cv_destroy(&sc->worker_cv); bcm2835_audio_release(sc); - if (sc->lock) { - snd_mtxfree(sc->lock); - sc->lock = NULL; - } - free(sc, M_DEVBUF); return 0; From owner-svn-src-all@freebsd.org Tue Dec 27 20:06:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E2AC9384C; Tue, 27 Dec 2016 20:06:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5FA1854; Tue, 27 Dec 2016 20:06:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRK6Q5Q071263; Tue, 27 Dec 2016 20:06:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRK6Qhw071259; Tue, 27 Dec 2016 20:06:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612272006.uBRK6Qhw071259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Dec 2016 20:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310637 - in stable: 10/share/man/man4 11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 20:06:27 -0000 Author: jhb Date: Tue Dec 27 20:06:26 2016 New Revision: 310637 URL: https://svnweb.freebsd.org/changeset/base/310637 Log: MFC 309581,309582,310424: Document T6 support. 309581: Document support for Terminator 6 adapters in cxgbe(4) and cxgbev(4). 309582: Bump Dd for addition of T6. 310424: Replace passive voice with active voice and other tweaks. - Drop uses of 'will'. - Replace 'to use' with active voice. - Tidy language around interrupt types and clarify that INTx doesn't work on VFs. - Drop leading articles from sysctl/tunable descriptions. - Tweak the wording of several sysctl/tunable descriptions. Modified: stable/11/share/man/man4/Makefile stable/11/share/man/man4/cxgbe.4 stable/11/share/man/man4/cxgbev.4 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/cxgbe.4 stable/10/share/man/man4/cxgbev.4 Directory Properties: stable/10/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Tue Dec 27 19:08:08 2016 (r310636) +++ stable/11/share/man/man4/Makefile Tue Dec 27 20:06:26 2016 (r310637) @@ -608,11 +608,21 @@ MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 MLINKS+=cxgbe.4 if_cxgbe.4 \ + cxgbe.4 vcxgbe.4 \ + cxgbe.4 if_vcxgbe.4 \ cxgbe.4 cxl.4 \ - cxgbe.4 if_cxl.4 + cxgbe.4 if_cxl.4 \ + cxgbe.4 vcxl.4 \ + cxgbe.4 if_vcxl.4 \ + cxgbe.4 cc.4 \ + cxgbe.4 if_cc.4 \ + cxgbe.4 vcc.4 \ + cxgbe.4 if_vcc.4 MLINKS+=cxgbev.4 if_cxgbev.4 \ cxgbev.4 cxlv.4 \ - cxgbev.4 if_cxlv.4 + cxgbev.4 if_cxlv.4 \ + cxgbev.4 ccv.4 \ + cxgbev.4 if_ccv.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 Modified: stable/11/share/man/man4/cxgbe.4 ============================================================================== --- stable/11/share/man/man4/cxgbe.4 Tue Dec 27 19:08:08 2016 (r310636) +++ stable/11/share/man/man4/cxgbe.4 Tue Dec 27 20:06:26 2016 (r310637) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2014, Chelsio Inc +.\" Copyright (c) 2011-2016, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2015 +.Dd December 22, 2016 .Dt CXGBE 4 .Os .Sh NAME .Nm cxgbe -.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" +.Nd "Chelsio T4-, T5-, and T6-based 100Gb, 40Gb, 25Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -51,13 +51,14 @@ module at boot time, place the following .Bd -literal -offset indent t4fw_cfg_load="YES" t5fw_cfg_load="YES" +t6fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on -the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). +the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs (T4, T5, and T6). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -66,17 +67,46 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp -Note that ports of T5 cards are named cxl and attach to a t5nex parent device -(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). -Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. -The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and -dev.cxgbe for T4 cards. +The +.Nm +driver uses different names for devices based on the associated ASIC: +.Bl -column -offset indent "ASIC" "Port Name" "Parent Device" +.It Sy ASIC Ta Sy Port Name Ta Sy Parent Device Ta Sy Virtual Interface +.It T4 Ta cxgbe Ta t4nex Ta vcxgbe +.It T5 Ta cxl Ta t5nex Ta vcxl +.It T6 Ta cc Ta t6nex Ta vcc +.El +.Pp +Loader tunables with the hw.cxgbe prefix apply to all cards. +The driver provides sysctl MIBs for both ports and parent devices using +the names above. +For example, a T5 adapter provides port MIBs under dev.cxl and +adapter-wide MIBs under dev.t5nex. +References to sysctl MIBs in the remainder of this page use +dev. for port MIBs and dev. for adapter-wide MIBs. .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports 100Gb and 25Gb Ethernet adapters based on the T6 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T6225-CR +.It +Chelsio T6225-SO-CR +.It +Chelsio T62100-LP-CR +.It +Chelsio T62100-SO-CR +.It +Chelsio T62100-CR +.El +.Pp +The +.Nm driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC: .Pp .Bl -bullet -compact @@ -139,92 +169,89 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb or 40Gb port. +Number of tx queues used for a 10Gb or higher-speed port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb or 40Gb port. +Number of rx queues used for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g -The number of tx queues to use for a 1Gb port. +Number of tx queues used for a 1Gb port. The default is 4 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq1g -The number of rx queues to use for a 1Gb port. +Number of rx queues used for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq10g -The number of TOE tx queues to use for a 10Gb or 40Gb port. +Number of TOE tx queues used for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq10g -The number of TOE rx queues to use for a 10Gb or 40Gb port. +Number of TOE rx queues used for a 10Gb or higher-speed port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq1g -The number of TOE tx queues to use for a 1Gb port. +Number of TOE tx queues used for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq1g -The number of TOE rx queues to use for a 1Gb port. +Number of TOE rx queues used for a 1Gb port. The default is 1. .It Va hw.cxgbe.num_vis -The number of virtual interfaces (VIs) created for each port. +Number of virtual interfaces (VIs) created for each port. Each virtual interface creates a separate network interface. The first virtual interface on each port is required and represents the primary network interface on the port. -Additional virtual interfaces on a port are named vcxgbe (T4) or -vcxl (T5) and only use a single rx and tx queue. +Additional virtual interfaces on a port are named using the Virtual Interface +name from the table above. Additional virtual interfaces use a single pair of queues for rx and tx as well an additional pair of queues for TOE rx and tx. The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G -The timer index value to use to delay interrupts. +Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. +dev..X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G -The packet-count index value to use to delay interrupts. -The packet-count list has the values 1, 8, 16, and 32 by default +Packet-count index value used to delay interrupts. +The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. +dev..X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq -The size, in number of entries, of the descriptor ring used for a tx -queue. +Number of entries in a transmit queue's descriptor ring. A buf_ring of the same size is also allocated for additional software queuing. See .Xr ifnet 9 . The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. +dev..X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq -The size, in number of entries, of the descriptor ring used for an -rx queue. +Number of entries in a receive queue's descriptor ring. The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. +dev..X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types -The interrupt types that the driver is allowed to use. -Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +Permitted interrupt types. +Bit 0 represents INTx (line interrupts), bit 1 MSI, and bit 2 MSI-X. The default is 7 (all allowed). -The driver will select the best possible type out of the allowed types by -itself. +The driver selects the best possible type out of the allowed types. .It Va hw.cxgbe.fw_install 0 prohibits the driver from installing a firmware on the card. 1 allows the driver to install a new firmware if internal driver @@ -235,7 +262,7 @@ long as it is compatible with the driver the one already on the card. The default is 1. .It Va hw.cxgbe.fl_pktshift -The number of bytes of padding inserted before the beginning of an Ethernet +Number of padding bytes inserted before the beginning of an Ethernet frame in the receive buffer. The default value of 2 ensures that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. @@ -261,7 +288,7 @@ reaches a high threshold, 0 prohibits th The default is 3 (both rx_pause and tx_pause = 1). This tunable establishes the default PAUSE settings for all ports. Settings can be displayed and controlled on a per-port basis via the -dev.cxgbe.X.pause_settings (dev.cxl.X.pause_settings for T5 cards) sysctl. +dev..X.pause_settings sysctl. .It Va hw.cxgbe.buffer_packing Allow the hardware to deliver multiple frames in the same receive buffer opportunistically. @@ -279,8 +306,8 @@ Each of these must be set to one of the (usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater than or equal to safest_rx_cluster. The defaults are 16384 and 4096 respectively. -The driver will never attempt to allocate a receive buffer larger than -largest_rx_cluster and will fall back to allocating buffers of +The driver never attempts to allocate a receive buffer larger than +largest_rx_cluster and falls back to allocating buffers of safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. Note that largest_rx_cluster merely establishes a ceiling -- the driver is allowed to allocate buffers of smaller sizes. @@ -290,8 +317,8 @@ A configuration file contains a recipe f hardware resources on the card. This tunable is for specialized applications only and should not be used in normal operation. -The configuration profile currently in use is available in the dev.t4nex.X.cf -and dev.t4nex.X.cfcsum (dev.t5nex for T5 cards) sysctls. +The configuration profile currently in use is available in the dev..X.cf +and dev..X.cfcsum sysctls. .It Va hw.cxgbe.linkcaps_allowed .It Va hw.cxgbe.niccaps_allowed .It Va hw.cxgbe.toecaps_allowed @@ -305,7 +332,7 @@ capability. This tunable is for specialized applications only and should not be used in normal operation. The capabilities for which hardware resources have been reserved are listed in -dev.t4nex.X.*caps or dev.t5nex.X.*caps sysctls. +dev..X.*caps sysctls. .El .Sh SUPPORT For general information and support, @@ -332,6 +359,10 @@ Support for T5 cards first appeared in .Fx 9.2 and .Fx 10.0 . +Support for T6 cards first appeared in +.Fx 11.1 +and +.Fx 12.0 . .Sh AUTHORS .An -nosplit The Modified: stable/11/share/man/man4/cxgbev.4 ============================================================================== --- stable/11/share/man/man4/cxgbev.4 Tue Dec 27 19:08:08 2016 (r310636) +++ stable/11/share/man/man4/cxgbev.4 Tue Dec 27 20:06:26 2016 (r310637) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2016 +.Dd December 22, 2016 .Dt CXGBEV 4 .Os .Sh NAME .Nm cxgbev -.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet VF driver" +.Nd "Chelsio T4-, T5-, and T6-based 100Gb, 40Gb, 25Gb, 10Gb, and 1Gb Ethernet VF driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,7 +56,8 @@ if_cxgbev_load="YES" The .Nm driver provides support for Virtual Functions on PCI Express Ethernet adapters -based on the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). +based on the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs +(T4, T5, and T6). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -65,18 +66,49 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp -Note that ports of T5 VFs are named cxlv and attach to a t5vf parent device -(in contrast to ports named cxgbev that attach to a t4vf parent for a T4 VF). -Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 VFs. -The Physical Function driver for T4 and T5 adapters shares these tunables. -The sysctl MIBs are at dev.t5vf and dev.cxlv for T5 cards and at dev.t4vf and -dev.cxgbev for T4 cards. +The +.Nm +driver uses different names for devices based on the associated ASIC: +.Bl -column -offset indent "ASIC" "Port Name" +.It Sy ASIC Ta Sy Port Name Ta Sy Parent Device +.It T4 Ta cxgbev Ta t4vf +.It T5 Ta cxlv Ta t5vf +.It T6 Ta ccv Ta t6vf +.El +.Pp +Loader tunables with the hw.cxgbe prefix apply to VFs from all cards. +The Physical Function driver for Chelsio Terminator adapters shares these +tunables. +The driver provides sysctl MIBs for both ports and parent devices using +the names above. +For example, a T5 VF provides port MIBs under dev.cxlv and +parent device MIBs under dev.t5vf. +References to sysctl MIBs in the remainder of this page use +dev. for port MIBs and dev. for parent device MIBs. .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports Virtual Functions on 100Gb and 25Gb Ethernet adapters +based on the T6 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T6225-CR +.It +Chelsio T6225-SO-CR +.It +Chelsio T62100-LP-CR +.It +Chelsio T62100-SO-CR +.It +Chelsio T62100-CR +.El +.Pp +The +.Nm driver supports Virtual Functions on 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC: .Pp @@ -141,69 +173,68 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb or 40Gb port. +Number of tx queues used for a 10Gb or higher-speed port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb or 40Gb port. +Number of rx queues used for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g -The number of tx queues to use for a 1Gb port. +Number of tx queues used for a 1Gb port. The default is 4 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq1g -The number of rx queues to use for a 1Gb port. +Number of rx queues used for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G -The timer index value to use to delay interrupts. +Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev.cxgbev.X.holdoff_tmr_idx or dev.cxlv.X.holdoff_tmr_idx sysctl. +dev..X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G -The packet-count index value to use to delay interrupts. -The packet-count list has the values 1, 8, 16, and 32 by default +Packet-count index value used to delay interrupts. +The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev.cxgbev.X.holdoff_pktc_idx or dev.cxlv.X.holdoff_pktc_idx sysctl. +dev..X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq -The size, in number of entries, of the descriptor ring used for a tx -queue. +Number of entries in a transmit queue's descriptor ring. A buf_ring of the same size is also allocated for additional software queuing. See .Xr ifnet 9 . The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbev.X.qsize_txq sysctl or dev.cxlv.X.qsize_txq sysctl. +dev..X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq -The size, in number of entries, of the descriptor ring used for an -rx queue. +Number of entries in a receive queue's descriptor ring. The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbev.X.qsize_rxq or dev.cxlv.X.qsize_rxq sysctl. +dev..X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types -The interrupt types that the driver is allowed to use. -Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +Permitted interrupt types. +Bit 0 represents INTx (line interrupts), bit 1 MSI, and bit 2 MSI-X. The default is 7 (all allowed). -The driver will select the best possible type out of the allowed types by -itself. +The driver selects the best possible type out of the allowed types. +Note that Virtual Functions do not support INTx interrupts and fail +to attach if neither MSI nor MSI-X are enabled. .It Va hw.cxgbe.fl_pktshift -The number of bytes of padding inserted before the beginning of an Ethernet +Number of padding bytes inserted before the beginning of an Ethernet frame in the receive buffer. The default value of 2 ensures that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. @@ -230,8 +261,8 @@ Each of these must be set to one of the (usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater than or equal to safest_rx_cluster. The defaults are 16384 and 4096 respectively. -The driver will never attempt to allocate a receive buffer larger than -largest_rx_cluster and will fall back to allocating buffers of +The driver never attempts to allocate a receive buffer larger than +largest_rx_cluster and falls back to allocating buffers of safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. Note that largest_rx_cluster merely establishes a ceiling -- the driver is allowed to allocate buffers of smaller sizes. @@ -239,8 +270,8 @@ allowed to allocate buffers of smaller s .Pp Certain settings and resources for Virtual Functions are dictated by the parent Physical Function driver. -For example, the Physical Function driver limits the number of queues a -Virtual Function is permitted to use. +For example, the Physical Function driver limits the number of queues +available to a Virtual Function. Some of these limits can be adjusted in the firmware configuration file used with the Physical Function driver. .Pp @@ -258,7 +289,7 @@ to 1 .Pc . .Pp The VF driver currently depends on the PF driver. -As a result, loading the VF driver will also load the PF driver as a +As a result, loading the VF driver also loads the PF driver as a dependency. .Sh SUPPORT For general information and support, @@ -279,6 +310,8 @@ email all the specific information relat The .Nm device driver first appeared in +.Fx 11.1 +and .Fx 12.0 . .Sh AUTHORS .An -nosplit From owner-svn-src-all@freebsd.org Tue Dec 27 20:06:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80ADCC93844; Tue, 27 Dec 2016 20:06:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 490E51852; Tue, 27 Dec 2016 20:06:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRK6QN5071254; Tue, 27 Dec 2016 20:06:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRK6QKw071251; Tue, 27 Dec 2016 20:06:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612272006.uBRK6QKw071251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Dec 2016 20:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310637 - in stable: 10/share/man/man4 11/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 20:06:27 -0000 Author: jhb Date: Tue Dec 27 20:06:26 2016 New Revision: 310637 URL: https://svnweb.freebsd.org/changeset/base/310637 Log: MFC 309581,309582,310424: Document T6 support. 309581: Document support for Terminator 6 adapters in cxgbe(4) and cxgbev(4). 309582: Bump Dd for addition of T6. 310424: Replace passive voice with active voice and other tweaks. - Drop uses of 'will'. - Replace 'to use' with active voice. - Tidy language around interrupt types and clarify that INTx doesn't work on VFs. - Drop leading articles from sysctl/tunable descriptions. - Tweak the wording of several sysctl/tunable descriptions. Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/cxgbe.4 stable/10/share/man/man4/cxgbev.4 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man4/Makefile stable/11/share/man/man4/cxgbe.4 stable/11/share/man/man4/cxgbev.4 Directory Properties: stable/11/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Tue Dec 27 19:08:08 2016 (r310636) +++ stable/10/share/man/man4/Makefile Tue Dec 27 20:06:26 2016 (r310637) @@ -584,11 +584,21 @@ MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 MLINKS+=cxgbe.4 if_cxgbe.4 \ + cxgbe.4 vcxgbe.4 \ + cxgbe.4 if_vcxgbe.4 \ cxgbe.4 cxl.4 \ - cxgbe.4 if_cxl.4 + cxgbe.4 if_cxl.4 \ + cxgbe.4 vcxl.4 \ + cxgbe.4 if_vcxl.4 \ + cxgbe.4 cc.4 \ + cxgbe.4 if_cc.4 \ + cxgbe.4 vcc.4 \ + cxgbe.4 if_vcc.4 MLINKS+=cxgbev.4 if_cxgbev.4 \ cxgbev.4 cxlv.4 \ - cxgbev.4 if_cxlv.4 + cxgbev.4 if_cxlv.4 \ + cxgbev.4 ccv.4 \ + cxgbev.4 if_ccv.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 Modified: stable/10/share/man/man4/cxgbe.4 ============================================================================== --- stable/10/share/man/man4/cxgbe.4 Tue Dec 27 19:08:08 2016 (r310636) +++ stable/10/share/man/man4/cxgbe.4 Tue Dec 27 20:06:26 2016 (r310637) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2014, Chelsio Inc +.\" Copyright (c) 2011-2016, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2015 +.Dd December 22, 2016 .Dt CXGBE 4 .Os .Sh NAME .Nm cxgbe -.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" +.Nd "Chelsio T4-, T5-, and T6-based 100Gb, 40Gb, 25Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -51,13 +51,14 @@ module at boot time, place the following .Bd -literal -offset indent t4fw_cfg_load="YES" t5fw_cfg_load="YES" +t6fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on -the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). +the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs (T4, T5, and T6). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -66,18 +67,47 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp -Note that ports of T5 cards are named cxl and attach to a t5nex parent device -(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). -Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. -The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and -dev.cxgbe for T4 cards. +The +.Nm +driver uses different names for devices based on the associated ASIC: +.Bl -column -offset indent "ASIC" "Port Name" "Parent Device" +.It Sy ASIC Ta Sy Port Name Ta Sy Parent Device Ta Sy Virtual Interface +.It T4 Ta cxgbe Ta t4nex Ta vcxgbe +.It T5 Ta cxl Ta t5nex Ta vcxl +.It T6 Ta cc Ta t6nex Ta vcc +.El .Pp +Loader tunables with the hw.cxgbe prefix apply to all cards. +The driver provides sysctl MIBs for both ports and parent devices using +the names above. +For example, a T5 adapter provides port MIBs under dev.cxl and +adapter-wide MIBs under dev.t5nex. +References to sysctl MIBs in the remainder of this page use +dev. for port MIBs and dev. for adapter-wide MIBs. +.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports 100Gb and 25Gb Ethernet adapters based on the T6 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T6225-CR +.It +Chelsio T6225-SO-CR +.It +Chelsio T62100-LP-CR +.It +Chelsio T62100-SO-CR +.It +Chelsio T62100-CR +.El +.Pp +The +.Nm driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC: .Pp .Bl -bullet -compact @@ -140,92 +170,89 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb or 40Gb port. +Number of tx queues used for a 10Gb or higher-speed port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb or 40Gb port. +Number of rx queues used for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g -The number of tx queues to use for a 1Gb port. +Number of tx queues used for a 1Gb port. The default is 4 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq1g -The number of rx queues to use for a 1Gb port. +Number of rx queues used for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq10g -The number of TOE tx queues to use for a 10Gb or 40Gb port. +Number of TOE tx queues used for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq10g -The number of TOE rx queues to use for a 10Gb or 40Gb port. +Number of TOE rx queues used for a 10Gb or higher-speed port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq1g -The number of TOE tx queues to use for a 1Gb port. +Number of TOE tx queues used for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq1g -The number of TOE rx queues to use for a 1Gb port. +Number of TOE rx queues used for a 1Gb port. The default is 1. .It Va hw.cxgbe.num_vis -The number of virtual interfaces (VIs) created for each port. +Number of virtual interfaces (VIs) created for each port. Each virtual interface creates a separate network interface. The first virtual interface on each port is required and represents the primary network interface on the port. -Additional virtual interfaces on a port are named vcxgbe (T4) or -vcxl (T5) and only use a single rx and tx queue. +Additional virtual interfaces on a port are named using the Virtual Interface +name from the table above. Additional virtual interfaces use a single pair of queues for rx and tx as well an additional pair of queues for TOE rx and tx. The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G -The timer index value to use to delay interrupts. +Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. +dev..X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G -The packet-count index value to use to delay interrupts. -The packet-count list has the values 1, 8, 16, and 32 by default +Packet-count index value used to delay interrupts. +The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. +dev..X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq -The size, in number of entries, of the descriptor ring used for a tx -queue. +Number of entries in a transmit queue's descriptor ring. A buf_ring of the same size is also allocated for additional software queuing. See .Xr ifnet 9 . The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. +dev..X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq -The size, in number of entries, of the descriptor ring used for an -rx queue. +Number of entries in a receive queue's descriptor ring. The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. +dev..X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types -The interrupt types that the driver is allowed to use. -Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +Permitted interrupt types. +Bit 0 represents INTx (line interrupts), bit 1 MSI, and bit 2 MSI-X. The default is 7 (all allowed). -The driver will select the best possible type out of the allowed types by -itself. +The driver selects the best possible type out of the allowed types. .It Va hw.cxgbe.fw_install 0 prohibits the driver from installing a firmware on the card. 1 allows the driver to install a new firmware if internal driver @@ -236,7 +263,7 @@ long as it is compatible with the driver the one already on the card. The default is 1. .It Va hw.cxgbe.fl_pktshift -The number of bytes of padding inserted before the beginning of an Ethernet +Number of padding bytes inserted before the beginning of an Ethernet frame in the receive buffer. The default value of 2 ensures that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. @@ -262,7 +289,7 @@ reaches a high threshold, 0 prohibits th The default is 3 (both rx_pause and tx_pause = 1). This tunable establishes the default PAUSE settings for all ports. Settings can be displayed and controlled on a per-port basis via the -dev.cxgbe.X.pause_settings (dev.cxl.X.pause_settings for T5 cards) sysctl. +dev..X.pause_settings sysctl. .It Va hw.cxgbe.buffer_packing Allow the hardware to deliver multiple frames in the same receive buffer opportunistically. @@ -278,8 +305,8 @@ Sizes of rx clusters. Each of these mus (usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater than or equal to safest_rx_cluster. The defaults are 16384 and 4096 respectively. -The driver will never attempt to allocate a receive buffer larger than -largest_rx_cluster and will fall back to allocating buffers of +The driver never attempts to allocate a receive buffer larger than +largest_rx_cluster and falls back to allocating buffers of safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. Note that largest_rx_cluster merely establishes a ceiling -- the driver is allowed to allocate buffers of smaller sizes. @@ -289,8 +316,8 @@ A configuration file contains a recipe f hardware resources on the card. This tunable is for specialized applications only and should not be used in normal operation. -The configuration profile currently in use is available in the dev.t4nex.X.cf -and dev.t4nex.X.cfcsum (dev.t5nex for T5 cards) sysctls. +The configuration profile currently in use is available in the dev..X.cf +and dev..X.cfcsum sysctls. .It Va hw.cxgbe.linkcaps_allowed .It Va hw.cxgbe.niccaps_allowed .It Va hw.cxgbe.toecaps_allowed @@ -304,7 +331,7 @@ capability. This tunable is for specialized applications only and should not be used in normal operation. The capabilities for which hardware resources have been reserved are listed in -dev.t4nex.X.*caps or dev.t5nex.X.*caps sysctls. +dev..X.*caps sysctls. .El .Sh SUPPORT For general information and support, @@ -331,6 +358,10 @@ Support for T5 cards first appeared in .Fx 9.2 and .Fx 10.0 . +Support for T6 cards first appeared in +.Fx 11.1 +and +.Fx 12.0 . .Sh AUTHORS .An -nosplit The Modified: stable/10/share/man/man4/cxgbev.4 ============================================================================== --- stable/10/share/man/man4/cxgbev.4 Tue Dec 27 19:08:08 2016 (r310636) +++ stable/10/share/man/man4/cxgbev.4 Tue Dec 27 20:06:26 2016 (r310637) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2016 +.Dd December 22, 2016 .Dt CXGBEV 4 .Os .Sh NAME .Nm cxgbev -.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet VF driver" +.Nd "Chelsio T4-, T5-, and T6-based 100Gb, 40Gb, 25Gb, 10Gb, and 1Gb Ethernet VF driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,7 +56,8 @@ if_cxgbev_load="YES" The .Nm driver provides support for Virtual Functions on PCI Express Ethernet adapters -based on the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). +based on the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs +(T4, T5, and T6). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -65,18 +66,49 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp -Note that ports of T5 VFs are named cxlv and attach to a t5vf parent device -(in contrast to ports named cxgbev that attach to a t4vf parent for a T4 VF). -Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 VFs. -The Physical Function driver for T4 and T5 adapters shares these tunables. -The sysctl MIBs are at dev.t5vf and dev.cxlv for T5 cards and at dev.t4vf and -dev.cxgbev for T4 cards. +The +.Nm +driver uses different names for devices based on the associated ASIC: +.Bl -column -offset indent "ASIC" "Port Name" +.It Sy ASIC Ta Sy Port Name Ta Sy Parent Device +.It T4 Ta cxgbev Ta t4vf +.It T5 Ta cxlv Ta t5vf +.It T6 Ta ccv Ta t6vf +.El +.Pp +Loader tunables with the hw.cxgbe prefix apply to VFs from all cards. +The Physical Function driver for Chelsio Terminator adapters shares these +tunables. +The driver provides sysctl MIBs for both ports and parent devices using +the names above. +For example, a T5 VF provides port MIBs under dev.cxlv and +parent device MIBs under dev.t5vf. +References to sysctl MIBs in the remainder of this page use +dev. for port MIBs and dev. for parent device MIBs. .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports Virtual Functions on 100Gb and 25Gb Ethernet adapters +based on the T6 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T6225-CR +.It +Chelsio T6225-SO-CR +.It +Chelsio T62100-LP-CR +.It +Chelsio T62100-SO-CR +.It +Chelsio T62100-CR +.El +.Pp +The +.Nm driver supports Virtual Functions on 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC: .Pp @@ -141,69 +173,68 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb or 40Gb port. +Number of tx queues used for a 10Gb or higher-speed port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb or 40Gb port. +Number of rx queues used for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g -The number of tx queues to use for a 1Gb port. +Number of tx queues used for a 1Gb port. The default is 4 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq1g -The number of rx queues to use for a 1Gb port. +Number of rx queues used for a 1Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G -The timer index value to use to delay interrupts. +Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev.cxgbev.X.holdoff_tmr_idx or dev.cxlv.X.holdoff_tmr_idx sysctl. +dev..X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G -The packet-count index value to use to delay interrupts. -The packet-count list has the values 1, 8, 16, and 32 by default +Packet-count index value used to delay interrupts. +The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev.cxgbev.X.holdoff_pktc_idx or dev.cxlv.X.holdoff_pktc_idx sysctl. +dev..X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq -The size, in number of entries, of the descriptor ring used for a tx -queue. +Number of entries in a transmit queue's descriptor ring. A buf_ring of the same size is also allocated for additional software queuing. See .Xr ifnet 9 . The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbev.X.qsize_txq sysctl or dev.cxlv.X.qsize_txq sysctl. +dev..X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq -The size, in number of entries, of the descriptor ring used for an -rx queue. +Number of entries in a receive queue's descriptor ring. The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbev.X.qsize_rxq or dev.cxlv.X.qsize_rxq sysctl. +dev..X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types -The interrupt types that the driver is allowed to use. -Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +Permitted interrupt types. +Bit 0 represents INTx (line interrupts), bit 1 MSI, and bit 2 MSI-X. The default is 7 (all allowed). -The driver will select the best possible type out of the allowed types by -itself. +The driver selects the best possible type out of the allowed types. +Note that Virtual Functions do not support INTx interrupts and fail +to attach if neither MSI nor MSI-X are enabled. .It Va hw.cxgbe.fl_pktshift -The number of bytes of padding inserted before the beginning of an Ethernet +Number of padding bytes inserted before the beginning of an Ethernet frame in the receive buffer. The default value of 2 ensures that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. @@ -230,8 +261,8 @@ Each of these must be set to one of the (usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater than or equal to safest_rx_cluster. The defaults are 16384 and 4096 respectively. -The driver will never attempt to allocate a receive buffer larger than -largest_rx_cluster and will fall back to allocating buffers of +The driver never attempts to allocate a receive buffer larger than +largest_rx_cluster and falls back to allocating buffers of safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. Note that largest_rx_cluster merely establishes a ceiling -- the driver is allowed to allocate buffers of smaller sizes. @@ -239,8 +270,8 @@ allowed to allocate buffers of smaller s .Pp Certain settings and resources for Virtual Functions are dictated by the parent Physical Function driver. -For example, the Physical Function driver limits the number of queues a -Virtual Function is permitted to use. +For example, the Physical Function driver limits the number of queues +available to a Virtual Function. Some of these limits can be adjusted in the firmware configuration file used with the Physical Function driver. .Pp @@ -258,7 +289,7 @@ to 1 .Pc . .Pp The VF driver currently depends on the PF driver. -As a result, loading the VF driver will also load the PF driver as a +As a result, loading the VF driver also loads the PF driver as a dependency. .Sh SUPPORT For general information and support, @@ -279,6 +310,8 @@ email all the specific information relat The .Nm device driver first appeared in +.Fx 11.1 +and .Fx 12.0 . .Sh AUTHORS .An -nosplit From owner-svn-src-all@freebsd.org Tue Dec 27 20:21:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3722DC93BB8; Tue, 27 Dec 2016 20:21:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11CE91038; Tue, 27 Dec 2016 20:21:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRKLCoL075449; Tue, 27 Dec 2016 20:21:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRKLBJd075441; Tue, 27 Dec 2016 20:21:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612272021.uBRKLBJd075441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Dec 2016 20:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310638 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 20:21:13 -0000 Author: jhb Date: Tue Dec 27 20:21:11 2016 New Revision: 310638 URL: https://svnweb.freebsd.org/changeset/base/310638 Log: Rename the 'flags' argument to getfsstat() to 'mode' and validate it. This argument is not a bitmask of flags, but only accepts a single value. Fail with EINVAL if an invalid value is passed to 'flag'. Rename the 'flags' argument to getmntinfo(3) to 'mode' as well to match. This is a followup to r308088. Reviewed by: kib MFC after: 1 month Modified: head/lib/libc/gen/getmntinfo.3 head/lib/libc/gen/getmntinfo.c head/lib/libc/sys/getfsstat.2 head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/lib/libc/gen/getmntinfo.3 ============================================================================== --- head/lib/libc/gen/getmntinfo.3 Tue Dec 27 20:06:26 2016 (r310637) +++ head/lib/libc/gen/getmntinfo.3 Tue Dec 27 20:21:11 2016 (r310638) @@ -28,7 +28,7 @@ .\" @(#)getmntinfo.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd December 27, 2016 .Dt GETMNTINFO 3 .Os .Sh NAME @@ -41,7 +41,7 @@ .In sys/ucred.h .In sys/mount.h .Ft int -.Fn getmntinfo "struct statfs **mntbufp" "int flags" +.Fn getmntinfo "struct statfs **mntbufp" "int mode" .Sh DESCRIPTION The .Fn getmntinfo @@ -55,7 +55,7 @@ The .Fn getmntinfo function passes its -.Fa flags +.Fa mode argument transparently to .Xr getfsstat 2 . .Sh RETURN VALUES Modified: head/lib/libc/gen/getmntinfo.c ============================================================================== --- head/lib/libc/gen/getmntinfo.c Tue Dec 27 20:06:26 2016 (r310637) +++ head/lib/libc/gen/getmntinfo.c Tue Dec 27 20:21:11 2016 (r310638) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); * Return information about mounted filesystems. */ int -getmntinfo(struct statfs **mntbufp, int flags) +getmntinfo(struct statfs **mntbufp, int mode) { static struct statfs *mntbuf; static int mntsize; @@ -50,7 +50,7 @@ getmntinfo(struct statfs **mntbufp, int if (mntsize <= 0 && (mntsize = getfsstat(0, 0, MNT_NOWAIT)) < 0) return (0); - if (bufsize > 0 && (mntsize = getfsstat(mntbuf, bufsize, flags)) < 0) + if (bufsize > 0 && (mntsize = getfsstat(mntbuf, bufsize, mode)) < 0) return (0); while (bufsize <= mntsize * sizeof(struct statfs)) { if (mntbuf) @@ -58,7 +58,7 @@ getmntinfo(struct statfs **mntbufp, int bufsize = (mntsize + 1) * sizeof(struct statfs); if ((mntbuf = malloc(bufsize)) == NULL) return (0); - if ((mntsize = getfsstat(mntbuf, bufsize, flags)) < 0) + if ((mntsize = getfsstat(mntbuf, bufsize, mode)) < 0) return (0); } *mntbufp = mntbuf; Modified: head/lib/libc/sys/getfsstat.2 ============================================================================== --- head/lib/libc/sys/getfsstat.2 Tue Dec 27 20:06:26 2016 (r310637) +++ head/lib/libc/sys/getfsstat.2 Tue Dec 27 20:21:11 2016 (r310638) @@ -28,7 +28,7 @@ .\" @(#)getfsstat.2 8.3 (Berkeley) 5/25/95 .\" $FreeBSD$ .\" -.Dd November 6, 2016 +.Dd December 27, 2016 .Dt GETFSSTAT 2 .Os .Sh NAME @@ -41,7 +41,7 @@ .In sys/ucred.h .In sys/mount.h .Ft int -.Fn getfsstat "struct statfs *buf" "long bufsize" "int flags" +.Fn getfsstat "struct statfs *buf" "long bufsize" "int mode" .Sh DESCRIPTION The .Fn getfsstat @@ -74,11 +74,11 @@ is given as NULL, returns just the number of mounted file systems. .Pp Normally -.Fa flags +.Fa mode should be specified as .Dv MNT_WAIT . If -.Fa flags +.Fa mode is set to .Dv MNT_NOWAIT , .Fn getfsstat @@ -108,6 +108,12 @@ The .Fa buf argument points to an invalid address. +.It Bq Er EINVAL +.Fa mode +is set to a value other than +.Dv MNT_WAIT +or +.Dv MNT_NOWAIT . .It Bq Er EIO An .Tn I/O Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Dec 27 20:06:26 2016 (r310637) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Dec 27 20:21:11 2016 (r310638) @@ -253,7 +253,7 @@ freebsd4_freebsd32_getfsstat(struct thre count = uap->bufsize / sizeof(struct statfs32); size = count * sizeof(struct statfs); - error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->flags); + error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->mode); if (size > 0) { sp = buf; copycount = count; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Tue Dec 27 20:06:26 2016 (r310637) +++ head/sys/compat/freebsd32/syscalls.master Tue Dec 27 20:21:11 2016 (r310638) @@ -89,7 +89,7 @@ obreak_args int 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ struct statfs32 *buf, long bufsize, \ - int flags); } + int mode); } 19 AUE_LSEEK COMPAT { int freebsd32_lseek(int fd, int offset, \ int whence); } 20 AUE_GETPID NOPROTO { pid_t getpid(void); } @@ -711,7 +711,7 @@ off_t *sbytes, int flags); } 394 AUE_NULL UNIMPL mac_syscall 395 AUE_GETFSSTAT NOPROTO { int getfsstat(struct statfs *buf, \ - long bufsize, int flags); } + long bufsize, int mode); } 396 AUE_STATFS NOPROTO { int statfs(char *path, \ struct statfs *buf); } 397 AUE_FSTATFS NOPROTO { int fstatfs(int fd, struct statfs *buf); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue Dec 27 20:06:26 2016 (r310637) +++ head/sys/kern/syscalls.master Tue Dec 27 20:21:11 2016 (r310638) @@ -85,7 +85,7 @@ 17 AUE_NULL STD { int obreak(char *nsize); } break \ obreak_args int 18 AUE_GETFSSTAT COMPAT4 { int getfsstat(struct ostatfs *buf, \ - long bufsize, int flags); } + long bufsize, int mode); } 19 AUE_LSEEK COMPAT { long lseek(int fd, long offset, \ int whence); } 20 AUE_GETPID STD { pid_t getpid(void); } @@ -706,7 +706,7 @@ 394 AUE_NULL STD { int mac_syscall(const char *policy, \ int call, void *arg); } 395 AUE_GETFSSTAT STD { int getfsstat(struct statfs *buf, \ - long bufsize, int flags); } + long bufsize, int mode); } 396 AUE_STATFS STD { int statfs(char *path, \ struct statfs *buf); } 397 AUE_FSTATFS STD { int fstatfs(int fd, struct statfs *buf); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Dec 27 20:06:26 2016 (r310637) +++ head/sys/kern/vfs_syscalls.c Tue Dec 27 20:21:11 2016 (r310638) @@ -412,7 +412,7 @@ out: struct getfsstat_args { struct statfs *buf; long bufsize; - int flags; + int mode; }; #endif int @@ -421,7 +421,7 @@ sys_getfsstat(td, uap) register struct getfsstat_args /* { struct statfs *buf; long bufsize; - int flags; + int mode; } */ *uap; { size_t count; @@ -430,7 +430,7 @@ sys_getfsstat(td, uap) if (uap->bufsize < 0 || uap->bufsize > SIZE_MAX) return (EINVAL); error = kern_getfsstat(td, &uap->buf, uap->bufsize, &count, - UIO_USERSPACE, uap->flags); + UIO_USERSPACE, uap->mode); if (error == 0) td->td_retval[0] = count; return (error); @@ -443,13 +443,20 @@ sys_getfsstat(td, uap) */ int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, - size_t *countp, enum uio_seg bufseg, int flags) + size_t *countp, enum uio_seg bufseg, int mode) { struct mount *mp, *nmp; struct statfs *sfsp, *sp, sb, *tofree; size_t count, maxcount; int error; + switch (mode) { + case MNT_WAIT: + case MNT_NOWAIT: + break; + default: + return (EINVAL); + } restart: maxcount = bufsize / sizeof(struct statfs); if (bufsize == 0) { @@ -483,7 +490,7 @@ restart: continue; } #endif - if (flags == MNT_WAIT) { + if (mode == MNT_WAIT) { if (vfs_busy(mp, MBF_MNTLSTLOCK) != 0) { /* * If vfs_busy() failed, and MBF_NOWAIT @@ -512,10 +519,10 @@ restart: sp->f_namemax = NAME_MAX; sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; /* - * If MNT_NOWAIT or MNT_LAZY is specified, do not - * refresh the fsstat cache. + * If MNT_NOWAIT is specified, do not refresh + * the fsstat cache. */ - if (flags != MNT_LAZY && flags != MNT_NOWAIT) { + if (mode != MNT_NOWAIT) { error = VFS_STATFS(mp, sp); if (error != 0) { mtx_lock(&mountlist_mtx); @@ -620,7 +627,7 @@ freebsd4_fstatfs(td, uap) struct freebsd4_getfsstat_args { struct ostatfs *buf; long bufsize; - int flags; + int mode; }; #endif int @@ -629,7 +636,7 @@ freebsd4_getfsstat(td, uap) register struct freebsd4_getfsstat_args /* { struct ostatfs *buf; long bufsize; - int flags; + int mode; } */ *uap; { struct statfs *buf, *sp; @@ -644,7 +651,7 @@ freebsd4_getfsstat(td, uap) return (EINVAL); size = count * sizeof(struct statfs); error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, - uap->flags); + uap->mode); td->td_retval[0] = count; if (size != 0) { sp = buf; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Dec 27 20:06:26 2016 (r310637) +++ head/sys/sys/syscallsubr.h Tue Dec 27 20:21:11 2016 (r310638) @@ -109,7 +109,7 @@ int kern_futimens(struct thread *td, int int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, long *basep, ssize_t *residp, enum uio_seg bufseg); int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, - size_t *countp, enum uio_seg bufseg, int flags); + size_t *countp, enum uio_seg bufseg, int mode); int kern_getitimer(struct thread *, u_int, struct itimerval *); int kern_getppid(struct thread *); int kern_getpeername(struct thread *td, int fd, struct sockaddr **sa, From owner-svn-src-all@freebsd.org Tue Dec 27 20:22:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10582C93D67; Tue, 27 Dec 2016 20:22:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C567E12BA; Tue, 27 Dec 2016 20:22:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRKMIdd079142; Tue, 27 Dec 2016 20:22:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRKMH4s079131; Tue, 27 Dec 2016 20:22:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612272022.uBRKMH4s079131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Dec 2016 20:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310639 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 20:22:20 -0000 Author: jhb Date: Tue Dec 27 20:22:17 2016 New Revision: 310639 URL: https://svnweb.freebsd.org/changeset/base/310639 Log: Regen after r310638. Differential Revision: https://reviews.freebsd.org/D8854 Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/compat/freebsd32/freebsd32_proto.h Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 305954 2016-09-18 22:03:07Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -917,7 +917,7 @@ int ofreebsd32_getdirentries(struct thre struct freebsd4_freebsd32_getfsstat_args { char buf_l_[PADL_(struct statfs32 *)]; struct statfs32 * buf; char buf_r_[PADR_(struct statfs32 *)]; char bufsize_l_[PADL_(long)]; long bufsize; char bufsize_r_[PADR_(long)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct freebsd4_freebsd32_statfs_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 305954 2016-09-18 22:03:07Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ #define FREEBSD32_SYS_syscall 0 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 305954 2016-09-18 22:03:07Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ const char *freebsd32_syscallnames[] = { Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 305954 2016-09-18 22:03:07Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ #include "opt_compat.h" Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Dec 27 20:22:17 2016 (r310639) @@ -1960,7 +1960,7 @@ systrace_args(int sysnum, void *params, struct getfsstat_args *p = params; uarg[0] = (intptr_t) p->buf; /* struct statfs * */ iarg[1] = p->bufsize; /* long */ - iarg[2] = p->flags; /* int */ + iarg[2] = p->mode; /* int */ *n_args = 3; break; } Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/kern/init_sysent.c Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ #include "opt_compat.h" Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/kern/syscalls.c Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ const char *syscallnames[] = { Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/kern/systrace_args.c Tue Dec 27 20:22:17 2016 (r310639) @@ -2072,7 +2072,7 @@ systrace_args(int sysnum, void *params, struct getfsstat_args *p = params; uarg[0] = (intptr_t) p->buf; /* struct statfs * */ iarg[1] = p->bufsize; /* long */ - iarg[2] = p->flags; /* int */ + iarg[2] = p->mode; /* int */ *n_args = 3; break; } Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/sys/syscall.h Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/sys/syscall.mk Tue Dec 27 20:22:17 2016 (r310639) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson +# created from FreeBSD: head/sys/kern/syscalls.master 310638 2016-12-27 20:21:11Z jhb MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Tue Dec 27 20:21:11 2016 (r310638) +++ head/sys/sys/sysproto.h Tue Dec 27 20:22:17 2016 (r310639) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 310638 2016-12-27 20:21:11Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -1102,7 +1102,7 @@ struct mac_syscall_args { struct getfsstat_args { char buf_l_[PADL_(struct statfs *)]; struct statfs * buf; char buf_r_[PADR_(struct statfs *)]; char bufsize_l_[PADL_(long)]; long bufsize; char bufsize_r_[PADR_(long)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct statfs_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -2350,7 +2350,7 @@ int ogetdirentries(struct thread *, stru struct freebsd4_getfsstat_args { char buf_l_[PADL_(struct ostatfs *)]; struct ostatfs * buf; char buf_r_[PADR_(struct ostatfs *)]; char bufsize_l_[PADL_(long)]; long bufsize; char bufsize_r_[PADR_(long)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct freebsd4_statfs_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; From owner-svn-src-all@freebsd.org Tue Dec 27 20:22:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0E9DC93DFF; Tue, 27 Dec 2016 20:22:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDC414C2; Tue, 27 Dec 2016 20:22:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 771EB10AA64; Tue, 27 Dec 2016 15:22:44 -0500 (EST) From: John Baldwin To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r308371 - in stable/10: share/man/man4 sys/conf sys/dev/jedec_ts sys/modules/i2c sys/modules/i2c/jedec_ts Date: Tue, 27 Dec 2016 11:51:50 -0800 Message-ID: <1756673.351QfCkGNL@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <9c234848-2d27-b417-b78d-18bde988bc07@FreeBSD.org> References: <201611061356.uA6DuYcO079294@repo.freebsd.org> <2547422.gn4y6NaJ31@ralph.baldwin.cx> <9c234848-2d27-b417-b78d-18bde988bc07@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 27 Dec 2016 15:22:44 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 20:22:45 -0000 On Saturday, December 24, 2016 03:35:37 PM Andriy Gapon wrote: > On 19/12/2016 18:55, John Baldwin wrote: > > Yes. Well, it fixes linking of kernels at least. Now make tinderbox > > on 10 fails for the following kernels: > > > > _.ia64.GENERIC: Maxmem is not available on ia64. It is spelled > > paddr_max instead. The firewire code is trying to use Maxmem. > > _.ia64.LINT: Same. > > _.arm.LINT: Many link errors and warnings, though lack of 'kbd_*' symbols > > seems to be the only actual errors. > > > > I suspect you recently MFC'd changes to fwohci.c that are using Maxmem. > > However, I'm not sure it is worth fixing fwohci on ia64. > > The ia64 problem should be fixed now. > I added Maxmem as we discussed. Thanks! -- John Baldwin From owner-svn-src-all@freebsd.org Tue Dec 27 21:11:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 065CDC9352C; Tue, 27 Dec 2016 21:11:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4E3A14BD; Tue, 27 Dec 2016 21:11:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRLBtga001229; Tue, 27 Dec 2016 21:11:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRLBsBf001226; Tue, 27 Dec 2016 21:11:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612272111.uBRLBsBf001226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Dec 2016 21:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310640 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 21:11:56 -0000 Author: mav Date: Tue Dec 27 21:11:54 2016 New Revision: 310640 URL: https://svnweb.freebsd.org/changeset/base/310640 Log: Add support for revert to defaults (RTD) bit in MODE SELECT. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_cmd_table.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 27 20:22:17 2016 (r310639) +++ head/sys/cam/ctl/ctl.c Tue Dec 27 21:11:54 2016 (r310640) @@ -6158,10 +6158,13 @@ bailout_no_done: int ctl_mode_select(struct ctl_scsiio *ctsio) { - int param_len, pf, sp; - int header_size, bd_len; + struct ctl_lun *lun; union ctl_modepage_info *modepage_info; + int bd_len, i, header_size, param_len, pf, rtd, sp; + uint32_t initidx; + lun = ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); switch (ctsio->cdb[0]) { case MODE_SELECT_6: { struct scsi_mode_select_6 *cdb; @@ -6169,6 +6172,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_6 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = cdb->length; header_size = sizeof(struct scsi_mode_header_6); @@ -6180,6 +6184,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_10 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = scsi_2btoul(cdb->length); header_size = sizeof(struct scsi_mode_header_10); @@ -6191,6 +6196,30 @@ ctl_mode_select(struct ctl_scsiio *ctsio return (CTL_RETVAL_COMPLETE); } + if (rtd) { + if (param_len != 0) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, + /*command*/ 1, /*field*/ 0, + /*bit_valid*/ 0, /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* Revert to defaults. */ + ctl_init_page_index(lun); + mtx_lock(&lun->lun_lock); + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); + mtx_unlock(&lun->lun_lock); + for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { + ctl_isc_announce_mode(lun, -1, + lun->mode_pages.index[i].page_code & SMPH_PC_MASK, + lun->mode_pages.index[i].subpage); + } + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + /* * From SPC-3: * "A parameter list length of zero indicates that the Data-Out Buffer @@ -9563,6 +9592,11 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * eid_ptr->flags4 = SVPD_EID_LUICLR; /* + * We support revert to defaults (RTD) bit in MODE SELECT. + */ + eid_ptr->flags5 = SVPD_EID_RTD_SUP; + + /* * XXX KDM in order to correctly answer this, we would need * information from the SIM to determine how much sense data it * can send. So this would really be a path inquiry field, most Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Tue Dec 27 20:22:17 2016 (r310639) +++ head/sys/cam/ctl/ctl.h Tue Dec 27 21:11:54 2016 (r310640) @@ -78,14 +78,8 @@ struct ctl_modepage_header { int32_t len_left; }; -struct ctl_modepage_aps { - struct ctl_modepage_header header; - uint8_t lock_active; -}; - union ctl_modepage_info { struct ctl_modepage_header header; - struct ctl_modepage_aps aps; }; /* Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Tue Dec 27 20:22:17 2016 (r310639) +++ head/sys/cam/ctl/ctl_cmd_table.c Tue Dec 27 21:11:54 2016 (r310640) @@ -990,7 +990,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 6, {0x11, 0, 0, 0xff, 0x07}}, + CTL_LUN_PAT_NONE, 6, {0x13, 0, 0, 0xff, 0x07}}, /* 16 RESERVE(6) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | @@ -1260,7 +1260,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 10, {0x11, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, + CTL_LUN_PAT_NONE, 10, {0x13, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 56 RESERVE(10) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | From owner-svn-src-all@freebsd.org Tue Dec 27 22:14:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D440FC9480C; Tue, 27 Dec 2016 22:14:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87B111A2D; Tue, 27 Dec 2016 22:14:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRMEfHw028306; Tue, 27 Dec 2016 22:14:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRMEf2c028305; Tue, 27 Dec 2016 22:14:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612272214.uBRMEf2c028305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 27 Dec 2016 22:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310642 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 22:14:42 -0000 Author: tuexen Date: Tue Dec 27 22:14:41 2016 New Revision: 310642 URL: https://svnweb.freebsd.org/changeset/base/310642 Log: Consistent handling of errors reported from the lower layer. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Dec 27 21:16:08 2016 (r310641) +++ head/sys/netinet/sctp_output.c Tue Dec 27 22:14:41 2016 (r310642) @@ -4678,7 +4678,7 @@ sctp_send_initiate(struct sctp_inpcb *in struct sctp_supported_chunk_types_param *pr_supported; struct sctp_paramhdr *ph; int cnt_inits_to = 0; - int ret; + int error; uint16_t num_ext, chunk_len, padding_len, parameter_len; /* INIT's always go to the primary (and usually ONLY address) */ @@ -4927,14 +4927,21 @@ sctp_send_initiate(struct sctp_inpcb *in } } SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - calls lowlevel_output\n"); - ret = sctp_lowlevel_chunk_output(inp, stcb, net, + if ((error = sctp_lowlevel_chunk_output(inp, stcb, net, (struct sockaddr *)&net->ro._l_addr, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, stcb->rport, htonl(0), net->port, NULL, 0, 0, - so_locked); - SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret); + so_locked))) { + SCTPDBG(SCTP_DEBUG_OUTPUT4, "Gak send error %d\n", error); + if (error == ENOBUFS) { + stcb->asoc.ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + stcb->asoc.ifp_had_enobuf = 0; + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); } @@ -5502,6 +5509,7 @@ sctp_send_initiate_ack(struct sctp_inpcb uint16_t his_limit, i_want; int abort_flag; int nat_friendly = 0; + int error; struct socket *so; uint16_t num_ext, chunk_len, padding_len, parameter_len; @@ -6116,12 +6124,24 @@ do_a_abort: over_addr = NULL; } - (void)sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, + if ((error = sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, sh->src_port, init_chk->init.initiate_tag, port, over_addr, mflowtype, mflowid, - SCTP_SO_NOT_LOCKED); + SCTP_SO_NOT_LOCKED))) { + SCTPDBG(SCTP_DEBUG_OUTPUT4, "Gak send error %d\n", error); + if (error == ENOBUFS) { + if (asoc != NULL) { + asoc->ifp_had_enobuf = 1; + } + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + if (asoc != NULL) { + asoc->ifp_had_enobuf = 0; + } + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -8821,8 +8841,8 @@ no_data_fill: SCTP_STAT_INCR(sctps_lowlevelerrusr); } if (error == ENOBUFS) { - SCTP_STAT_INCR(sctps_lowlevelerr); asoc->ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); } if (error == EHOSTUNREACH) { /* @@ -9509,8 +9529,14 @@ sctp_chunk_retransmission(struct sctp_in chk->whoTo->port, NULL, 0, 0, so_locked))) { - SCTP_STAT_INCR(sctps_lowlevelerr); + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + asoc->ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } return (error); + } else { + asoc->ifp_had_enobuf = 0; } endofchain = NULL; auth = NULL; @@ -9781,8 +9807,14 @@ one_chunk_around: 0, 0, so_locked))) { /* error, we could not output */ - SCTP_STAT_INCR(sctps_lowlevelerr); + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + asoc->ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } return (error); + } else { + asoc->ifp_had_enobuf = 0; } endofchain = NULL; auth = NULL; @@ -10872,6 +10904,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc struct sctp_nets *net; uint32_t vtag; uint32_t auth_offset = 0; + int error; uint16_t cause_len, chunk_len, padding_len; SCTP_TCB_LOCK_ASSERT(stcb); @@ -10943,13 +10976,21 @@ sctp_send_abort_tcb(struct sctp_tcb *stc return; } } - (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, + if ((error = sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), stcb->asoc.primary_destination->port, NULL, 0, 0, - so_locked); + so_locked))) { + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + stcb->asoc.ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + stcb->asoc.ifp_had_enobuf = 0; + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -10962,6 +11003,7 @@ sctp_send_shutdown_complete(struct sctp_ struct mbuf *m_shutdown_comp; struct sctp_shutdown_complete_chunk *shutdown_complete; uint32_t vtag; + int error; uint8_t flags; m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); @@ -10981,14 +11023,22 @@ sctp_send_shutdown_complete(struct sctp_ shutdown_complete->ch.chunk_flags = flags; shutdown_complete->ch.chunk_length = htons(sizeof(struct sctp_shutdown_complete_chunk)); SCTP_BUF_LEN(m_shutdown_comp) = sizeof(struct sctp_shutdown_complete_chunk); - (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, + if ((error = sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_shutdown_comp, 0, NULL, 0, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), net->port, NULL, 0, 0, - SCTP_SO_NOT_LOCKED); + SCTP_SO_NOT_LOCKED))) { + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + stcb->asoc.ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + stcb->asoc.ifp_had_enobuf = 0; + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; } From owner-svn-src-all@freebsd.org Tue Dec 27 22:28:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ADB1C94B5C; Tue, 27 Dec 2016 22:28:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8321023; Tue, 27 Dec 2016 22:28:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRMSEuV032474; Tue, 27 Dec 2016 22:28:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRMSEOK032473; Tue, 27 Dec 2016 22:28:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612272228.uBRMSEOK032473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Dec 2016 22:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310643 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 22:28:15 -0000 Author: mav Date: Tue Dec 27 22:28:14 2016 New Revision: 310643 URL: https://svnweb.freebsd.org/changeset/base/310643 Log: Missed piece of r310640. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Tue Dec 27 22:14:41 2016 (r310642) +++ head/sys/cam/scsi/scsi_all.h Tue Dec 27 22:28:14 2016 (r310643) @@ -228,6 +228,7 @@ struct scsi_mode_select_6 u_int8_t opcode; u_int8_t byte2; #define SMS_SP 0x01 +#define SMS_RTD 0x02 #define SMS_PF 0x10 u_int8_t unused[2]; u_int8_t length; From owner-svn-src-all@freebsd.org Tue Dec 27 22:31:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EE41C94BE0; Tue, 27 Dec 2016 22:31:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EBFF1247; Tue, 27 Dec 2016 22:31:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRMV66W034750; Tue, 27 Dec 2016 22:31:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRMV6dO034748; Tue, 27 Dec 2016 22:31:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612272231.uBRMV6dO034748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Dec 2016 22:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310644 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 22:31:07 -0000 Author: mav Date: Tue Dec 27 22:31:06 2016 New Revision: 310644 URL: https://svnweb.freebsd.org/changeset/base/310644 Log: Fix/synchronize field types in struct ctl_modepage_header. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 27 22:28:14 2016 (r310643) +++ head/sys/cam/ctl/ctl.c Tue Dec 27 22:31:06 2016 (r310644) @@ -5939,7 +5939,7 @@ ctl_do_mode_select(union ctl_io *io) int page_len, page_len_offset, page_len_size; union ctl_modepage_info *modepage_info; struct ctl_lun *lun; - int *len_left, *len_used; + uint16_t *len_left, *len_used; int retval, i; ctsio = &io->scsiio; Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Tue Dec 27 22:28:14 2016 (r310643) +++ head/sys/cam/ctl/ctl.h Tue Dec 27 22:31:06 2016 (r310644) @@ -74,8 +74,8 @@ struct ctl_port_entry { struct ctl_modepage_header { uint8_t page_code; uint8_t subpage; - int32_t len_used; - int32_t len_left; + uint16_t len_used; + uint16_t len_left; }; union ctl_modepage_info { From owner-svn-src-all@freebsd.org Tue Dec 27 22:37:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 354A3C94E7A; Tue, 27 Dec 2016 22:37:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03E9E194C; Tue, 27 Dec 2016 22:37:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRMbPx6036727; Tue, 27 Dec 2016 22:37:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRMbO6S036722; Tue, 27 Dec 2016 22:37:24 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612272237.uBRMbO6S036722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 27 Dec 2016 22:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310645 - in head/sys: conf dev/intel modules modules/intelspi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 22:37:26 -0000 Author: gonzo Date: Tue Dec 27 22:37:24 2016 New Revision: 310645 URL: https://svnweb.freebsd.org/changeset/base/310645 Log: [intelspi] Add SPI driver for Intel BayTrail SoC Add SPI mode (PIO-only) support for Intel Synchronous Serial Port that can be found in several Intel's products starting from PXA family. Most of implementations have slight differences in behavior and in addresses for registers subset. This driver covers only BayTrail SoC implementation for it's the only hardware I have to test it on. Driver attaches to ACPI bus only and does not have PCI or FDT support for now due to lack of hardware to test it on. "intelspi" is the best name I've managed to come up with. Linux driver name (spi-pxa2xx) does not make sense because current implementation does not support actual PXA2xx SoCs. And as far as I know there is no codename assigned to Intel SSP chip. Reviewed by: br, manu MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8896 Added: head/sys/dev/intel/ head/sys/dev/intel/spi.c (contents, props changed) head/sys/modules/intelspi/ head/sys/modules/intelspi/Makefile (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Dec 27 22:31:06 2016 (r310644) +++ head/sys/conf/files.amd64 Tue Dec 27 22:37:24 2016 (r310645) @@ -228,6 +228,7 @@ dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb +dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/ioat/ioat.c optional ioat pci dev/ioat/ioat_test.c optional ioat pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Dec 27 22:31:06 2016 (r310644) +++ head/sys/conf/files.i386 Tue Dec 27 22:37:24 2016 (r310645) @@ -275,6 +275,7 @@ dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb +dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi Added: head/sys/dev/intel/spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/intel/spi.c Tue Dec 27 22:37:24 2016 (r310645) @@ -0,0 +1,533 @@ +/*- + * Copyright (c) 2016 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +#include "spibus_if.h" + +/** + * Macros for driver mutex locking + */ +#define INTELSPI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define INTELSPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define INTELSPI_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ + "intelspi", MTX_DEF) +#define INTELSPI_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) +#define INTELSPI_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) +#define INTELSPI_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) + +#define INTELSPI_WRITE(_sc, _off, _val) \ + bus_write_4((_sc)->sc_mem_res, (_off), (_val)) +#define INTELSPI_READ(_sc, _off) \ + bus_read_4((_sc)->sc_mem_res, (_off)) + +#define INTELSPI_BUSY 0x1 +#define TX_FIFO_THRESHOLD 2 +#define RX_FIFO_THRESHOLD 2 +#define CLOCK_DIV_10MHZ 5 +#define DATA_SIZE_8BITS 8 + +#define CS_LOW 0 +#define CS_HIGH 1 + +#define INTELSPI_SSPREG_SSCR0 0x0 +#define SSCR0_SCR(n) (((n) - 1) << 8) +#define SSCR0_SSE (1 << 7) +#define SSCR0_FRF_SPI (0 << 4) +#define SSCR0_DSS(n) (((n) - 1) << 0) +#define INTELSPI_SSPREG_SSCR1 0x4 +#define SSCR1_TINTE (1 << 19) +#define SSCR1_RFT(n) (((n) - 1) << 10) +#define SSCR1_RFT_MASK (0xf << 10) +#define SSCR1_TFT(n) (((n) - 1) << 6) +#define SSCR1_SPI_SPH (1 << 4) +#define SSCR1_SPI_SPO (1 << 3) +#define SSCR1_MODE_MASK (SSCR1_SPI_SPO | SSCR1_SPI_SPH) +#define SSCR1_MODE_0 (0) +#define SSCR1_MODE_1 (SSCR1_SPI_SPH) +#define SSCR1_MODE_2 (SSCR1_SPI_SPO) +#define SSCR1_MODE_3 (SSCR1_SPI_SPO | SSCR1_SPI_SPH) +#define SSCR1_TIE (1 << 1) +#define SSCR1_RIE (1 << 0) +#define INTELSPI_SSPREG_SSSR 0x8 +#define SSSR_RFL_MASK (0xf << 12) +#define SSSR_TFL_MASK (0xf << 8) +#define SSSR_RNE (1 << 3) +#define SSSR_TNF (1 << 2) +#define INTELSPI_SSPREG_SSITR 0xC +#define INTELSPI_SSPREG_SSDR 0x10 +#define INTELSPI_SSPREG_SSTO 0x28 +#define INTELSPI_SSPREG_SSPSP 0x2C +#define INTELSPI_SSPREG_SSTSA 0x30 +#define INTELSPI_SSPREG_SSRSA 0x34 +#define INTELSPI_SSPREG_SSTSS 0x38 +#define INTELSPI_SSPREG_SSACD 0x3C +#define INTELSPI_SSPREG_ITF 0x40 +#define INTELSPI_SSPREG_SITF 0x44 +#define INTELSPI_SSPREG_SIRF 0x48 +#define INTELSPI_SSPREG_PRV_CLOCK_PARAMS 0x400 +#define INTELSPI_SSPREG_RESETS 0x404 +#define INTELSPI_SSPREG_GENERAL 0x408 +#define INTELSPI_SSPREG_SSP_REG 0x40C +#define INTELSPI_SSPREG_SPI_CS_CTRL 0x418 +#define SPI_CS_CTRL_CS_MASK (3) +#define SPI_CS_CTRL_SW_MODE (1 << 0) +#define SPI_CS_CTRL_HW_MODE (1 << 0) +#define SPI_CS_CTRL_CS_HIGH (1 << 1) +#define SPI_CS_CTRL_CS_LOW (0 << 1) + +struct intelspi_softc { + ACPI_HANDLE sc_handle; + device_t sc_dev; + struct mtx sc_mtx; + int sc_mem_rid; + struct resource *sc_mem_res; + int sc_irq_rid; + struct resource *sc_irq_res; + void *sc_irq_ih; + struct spi_command *sc_cmd; + uint32_t sc_len; + uint32_t sc_read; + uint32_t sc_flags; + uint32_t sc_written; +}; + +static int intelspi_probe(device_t dev); +static int intelspi_attach(device_t dev); +static int intelspi_detach(device_t dev); +static void intelspi_intr(void *); + +static int +intelspi_txfifo_full(struct intelspi_softc *sc) +{ + uint32_t sssr; + + INTELSPI_ASSERT_LOCKED(sc); + + sssr = INTELSPI_READ(sc, INTELSPI_SSPREG_SSSR); + if (sssr & SSSR_TNF) + return (0); + + return (1); +} + +static int +intelspi_rxfifo_empty(struct intelspi_softc *sc) +{ + uint32_t sssr; + + INTELSPI_ASSERT_LOCKED(sc); + + sssr = INTELSPI_READ(sc, INTELSPI_SSPREG_SSSR); + if (sssr & SSSR_RNE) + return (0); + else + return (1); +} + +static void +intelspi_fill_tx_fifo(struct intelspi_softc *sc) +{ + struct spi_command *cmd; + uint32_t written; + uint8_t *data; + + INTELSPI_ASSERT_LOCKED(sc); + + cmd = sc->sc_cmd; + while (sc->sc_written < sc->sc_len && + !intelspi_txfifo_full(sc)) { + data = (uint8_t *)cmd->tx_cmd; + written = sc->sc_written++; + + if (written >= cmd->tx_cmd_sz) { + data = (uint8_t *)cmd->tx_data; + written -= cmd->tx_cmd_sz; + } + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SSDR, data[written]); + } +} + +static void +intelspi_drain_rx_fifo(struct intelspi_softc *sc) +{ + struct spi_command *cmd; + uint32_t read; + uint8_t *data; + + INTELSPI_ASSERT_LOCKED(sc); + + cmd = sc->sc_cmd; + while (sc->sc_read < sc->sc_len && + !intelspi_rxfifo_empty(sc)) { + data = (uint8_t *)cmd->rx_cmd; + read = sc->sc_read++; + if (read >= cmd->rx_cmd_sz) { + data = (uint8_t *)cmd->rx_data; + read -= cmd->rx_cmd_sz; + } + data[read] = INTELSPI_READ(sc, INTELSPI_SSPREG_SSDR) & 0xff; + } +} + +static int +intelspi_transaction_done(struct intelspi_softc *sc) +{ + int txfifo_empty; + uint32_t sssr; + + INTELSPI_ASSERT_LOCKED(sc); + + if (sc->sc_written != sc->sc_len || + sc->sc_read != sc->sc_len) + return (0); + + sssr = INTELSPI_READ(sc, INTELSPI_SSPREG_SSSR); + txfifo_empty = ((sssr & SSSR_TFL_MASK) == 0) && + (sssr & SSSR_TNF); + + if (txfifo_empty && !(sssr & SSSR_RNE)) + return (1); + + return (0); +} + +static int +intelspi_transact(struct intelspi_softc *sc) +{ + + INTELSPI_ASSERT_LOCKED(sc); + + /* TX - Fill up the FIFO. */ + intelspi_fill_tx_fifo(sc); + + /* RX - Drain the FIFO. */ + intelspi_drain_rx_fifo(sc); + + /* Check for end of transfer. */ + return intelspi_transaction_done(sc); +} + +static void +intelspi_intr(void *arg) +{ + struct intelspi_softc *sc; + uint32_t reg; + + sc = (struct intelspi_softc *)arg; + + INTELSPI_LOCK(sc); + if ((sc->sc_flags & INTELSPI_BUSY) == 0) { + INTELSPI_UNLOCK(sc); + return; + } + + /* Check if SSP if off */ + reg = INTELSPI_READ(sc, INTELSPI_SSPREG_SSSR); + if (reg == 0xffffffffU) { + INTELSPI_UNLOCK(sc); + return; + } + + /* Check for end of transfer. */ + if (intelspi_transact(sc)) { + /* Disable interrupts */ + reg = INTELSPI_READ(sc, INTELSPI_SSPREG_SSCR1); + reg &= ~(SSCR1_TIE | SSCR1_RIE | SSCR1_TINTE); + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SSCR1, reg); + wakeup(sc->sc_dev); + } + + INTELSPI_UNLOCK(sc); +} + +static void +intelspi_init(struct intelspi_softc *sc) +{ + uint32_t reg; + + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SSCR0, 0); + + /* Manual CS control */ + reg = INTELSPI_READ(sc, INTELSPI_SSPREG_SPI_CS_CTRL); + reg &= ~(SPI_CS_CTRL_CS_MASK); + reg |= (SPI_CS_CTRL_SW_MODE | SPI_CS_CTRL_CS_HIGH); + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SPI_CS_CTRL, reg); + + /* Set TX/RX FIFO IRQ threshold levels */ + reg = SSCR1_TFT(TX_FIFO_THRESHOLD) | SSCR1_RFT(RX_FIFO_THRESHOLD); + /* + * Set SPI mode. This should be part of transaction or sysctl + */ + reg |= SSCR1_MODE_0; + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SSCR1, reg); + + /* + * Parent clock on Minowboard Turbot is 50MHz + * divide it by 5 to set to more or less reasonable + * value. But this should be part of transaction config + * or sysctl + */ + reg = SSCR0_SCR(CLOCK_DIV_10MHZ); + /* Put SSP in SPI mode */ + reg |= SSCR0_FRF_SPI; + /* Data size */ + reg |= SSCR0_DSS(DATA_SIZE_8BITS); + /* Enable SSP */ + reg |= SSCR0_SSE; + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SSCR0, reg); +} + +static void +intelspi_set_cs(struct intelspi_softc *sc, int level) +{ + uint32_t reg; + + reg = INTELSPI_READ(sc, INTELSPI_SSPREG_SPI_CS_CTRL); + reg &= ~(SPI_CS_CTRL_CS_MASK); + reg |= SPI_CS_CTRL_SW_MODE; + + if (level == CS_HIGH) + reg |= SPI_CS_CTRL_CS_HIGH; + else + reg |= SPI_CS_CTRL_CS_LOW; + + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SPI_CS_CTRL, reg); +} + +static int +intelspi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct intelspi_softc *sc; + int err; + uint32_t sscr1; + + sc = device_get_softc(dev); + err = 0; + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + INTELSPI_LOCK(sc); + + /* If the controller is in use wait until it is available. */ + while (sc->sc_flags & INTELSPI_BUSY) { + err = mtx_sleep(dev, &sc->sc_mtx, 0, "intelspi", 0); + if (err == EINTR) { + INTELSPI_UNLOCK(sc); + return (err); + } + } + + /* Now we have control over SPI controller. */ + sc->sc_flags = INTELSPI_BUSY; + + /* Save a pointer to the SPI command. */ + sc->sc_cmd = cmd; + sc->sc_read = 0; + sc->sc_written = 0; + sc->sc_len = cmd->tx_cmd_sz + cmd->tx_data_sz; + + /* Enable CS */ + intelspi_set_cs(sc, CS_LOW); + /* Transfer as much as possible to FIFOs */ + if (!intelspi_transact(sc)) { + /* If FIFO is not large enough - enable interrupts */ + sscr1 = INTELSPI_READ(sc, INTELSPI_SSPREG_SSCR1); + sscr1 |= (SSCR1_TIE | SSCR1_RIE | SSCR1_TINTE); + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SSCR1, sscr1); + + /* and wait for transaction to complete */ + err = mtx_sleep(dev, &sc->sc_mtx, 0, "intelspi", hz * 2); + } + + /* de-asser CS */ + intelspi_set_cs(sc, CS_HIGH); + + /* Clear transaction details */ + sc->sc_cmd = NULL; + sc->sc_read = 0; + sc->sc_written = 0; + sc->sc_len = 0; + + /* Make sure the SPI engine and interrupts are disabled. */ + sscr1 = INTELSPI_READ(sc, INTELSPI_SSPREG_SSCR1); + sscr1 &= ~(SSCR1_TIE | SSCR1_RIE | SSCR1_TINTE); + INTELSPI_WRITE(sc, INTELSPI_SSPREG_SSCR1, sscr1); + + /* Release the controller and wakeup the next thread waiting for it. */ + sc->sc_flags = 0; + wakeup_one(dev); + INTELSPI_UNLOCK(sc); + + /* + * Check for transfer timeout. The SPI controller doesn't + * return errors. + */ + if (err == EWOULDBLOCK) { + device_printf(sc->sc_dev, "transfer timeout\n"); + err = EIO; + } + + return (err); +} + +static int +intelspi_probe(device_t dev) +{ + static char *gpio_ids[] = { "80860F0E", NULL }; + + if (acpi_disabled("spi") || + ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids) == NULL) + return (ENXIO); + + device_set_desc(dev, "Intel SPI Controller"); + return (0); +} + +static int +intelspi_attach(device_t dev) +{ + struct intelspi_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_handle = acpi_get_handle(dev); + + INTELSPI_LOCK_INIT(sc); + + sc->sc_mem_rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_MEMORY, &sc->sc_mem_rid, RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + device_printf(dev, "can't allocate memory resource\n"); + goto error; + } + + sc->sc_irq_rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &sc->sc_irq_rid, RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(dev, "can't allocate IRQ resource\n"); + goto error; + } + + /* Hook up our interrupt handler. */ + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, intelspi_intr, sc, &sc->sc_irq_ih)) { + device_printf(dev, "cannot setup the interrupt handler\n"); + goto error; + } + + intelspi_init(sc); + + device_add_child(dev, "spibus", -1); + + return (bus_generic_attach(dev)); + +error: + INTELSPI_LOCK_DESTROY(sc); + + if (sc->sc_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + + if (sc->sc_irq_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->sc_irq_rid, sc->sc_irq_res); + + return (ENXIO); +} + +static int +intelspi_detach(device_t dev) +{ + struct intelspi_softc *sc; + + sc = device_get_softc(dev); + + INTELSPI_LOCK_DESTROY(sc); + + if (sc->sc_irq_ih) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_ih); + + if (sc->sc_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + + if (sc->sc_irq_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->sc_irq_rid, sc->sc_irq_res); + + return (0); +} + +static device_method_t intelspi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, intelspi_probe), + DEVMETHOD(device_attach, intelspi_attach), + DEVMETHOD(device_detach, intelspi_detach), + + /* SPI interface */ + DEVMETHOD(spibus_transfer, intelspi_transfer), + + DEVMETHOD_END +}; + +static driver_t intelspi_driver = { + "spi", + intelspi_methods, + sizeof(struct intelspi_softc), +}; + +static devclass_t intelspi_devclass; +DRIVER_MODULE(intelspi, acpi, intelspi_driver, intelspi_devclass, 0, 0); +MODULE_DEPEND(intelspi, acpi, 1, 1, 1); +MODULE_DEPEND(intelspi, spibus, 1, 1, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Dec 27 22:31:06 2016 (r310644) +++ head/sys/modules/Makefile Tue Dec 27 22:37:24 2016 (r310645) @@ -166,6 +166,7 @@ SUBDIR= \ ${_igb} \ ${_iir} \ imgact_binmisc \ + ${_intelspi} \ ${_io} \ ${_ioat} \ ${_ipoib} \ @@ -627,6 +628,7 @@ _hyperv= hyperv _ichwd= ichwd _ida= ida _iir= iir +_intelspi= intelspi _ipmi= ipmi _ips= ips _isci= isci Added: head/sys/modules/intelspi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/intelspi/Makefile Tue Dec 27 22:37:24 2016 (r310645) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/intel +KMOD= intelspi +SRCS= spi.c +SRCS+= acpi_if.h device_if.h bus_if.h spibus_if.h + +.include From owner-svn-src-all@freebsd.org Tue Dec 27 22:38:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28265C94EEB; Tue, 27 Dec 2016 22:38:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC0A51AE6; Tue, 27 Dec 2016 22:38:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRMcjiH036831; Tue, 27 Dec 2016 22:38:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRMcjxJ036830; Tue, 27 Dec 2016 22:38:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612272238.uBRMcjxJ036830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Dec 2016 22:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310646 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 22:38:46 -0000 Author: mav Date: Tue Dec 27 22:38:44 2016 New Revision: 310646 URL: https://svnweb.freebsd.org/changeset/base/310646 Log: Do not update "saved" mode page on every MODE SELECT. We do not have non-volatile memory to really save those values, so we neither report nor support this capability. Also saved mode pages are not replicated between HA peers now. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 27 22:37:24 2016 (r310645) +++ head/sys/cam/ctl/ctl.c Tue Dec 27 22:38:44 2016 (r310646) @@ -5833,7 +5833,7 @@ ctl_default_page_handler(struct ctl_scsi struct ctl_page_index *page_index, uint8_t *page_ptr) { struct ctl_lun *lun; - uint8_t *current_cp, *saved_cp; + uint8_t *current_cp; int set_ua; uint32_t initidx; @@ -5843,13 +5843,10 @@ ctl_default_page_handler(struct ctl_scsi current_cp = (page_index->page_data + (page_index->page_len * CTL_PAGE_CURRENT)); - saved_cp = (page_index->page_data + (page_index->page_len * - CTL_PAGE_SAVED)); mtx_lock(&lun->lun_lock); if (memcmp(current_cp, page_ptr, page_index->page_len)) { memcpy(current_cp, page_ptr, page_index->page_len); - memcpy(saved_cp, page_ptr, page_index->page_len); set_ua = 1; } if (set_ua != 0) From owner-svn-src-all@freebsd.org Tue Dec 27 23:31:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52723C93DF2; Tue, 27 Dec 2016 23:31:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21EAD1F7D; Tue, 27 Dec 2016 23:31:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRNVWb7060821; Tue, 27 Dec 2016 23:31:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRNVWhW060820; Tue, 27 Dec 2016 23:31:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612272331.uBRNVWhW060820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Dec 2016 23:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310647 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 23:31:33 -0000 Author: markj Date: Tue Dec 27 23:31:32 2016 New Revision: 310647 URL: https://svnweb.freebsd.org/changeset/base/310647 Log: Remove an obsolete pragma from dtrace.h. It triggers a compiler warning and has been removed upstream. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Dec 27 22:38:44 2016 (r310646) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Dec 27 23:31:32 2016 (r310647) @@ -32,8 +32,6 @@ #ifndef _SYS_DTRACE_H #define _SYS_DTRACE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif From owner-svn-src-all@freebsd.org Tue Dec 27 23:33:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F641C93FB3; Tue, 27 Dec 2016 23:33:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7C6412D5; Tue, 27 Dec 2016 23:32:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRNWwKj061715; Tue, 27 Dec 2016 23:32:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRNWtca061677; Tue, 27 Dec 2016 23:32:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612272332.uBRNWtca061677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 27 Dec 2016 23:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310648 - in head: contrib/bsnmp/gensnmpdef contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmp_mibII contrib/bsnmp/snmp_ntp contrib/bsnmp/snmp_target contrib/bsnmp/snmp_usm ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 23:33:00 -0000 Author: ngie Date: Tue Dec 27 23:32:54 2016 New Revision: 310648 URL: https://svnweb.freebsd.org/changeset/base/310648 Log: style(9): clean up trailing whitespace MFC after: 3 weeks Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 head/contrib/bsnmp/gensnmpdef/gensnmpdef.c head/contrib/bsnmp/gensnmptree/gensnmptree.1 head/contrib/bsnmp/gensnmptree/gensnmptree.c head/contrib/bsnmp/lib/asn1.3 head/contrib/bsnmp/lib/asn1.c head/contrib/bsnmp/lib/asn1.h head/contrib/bsnmp/lib/bsnmpagent.3 head/contrib/bsnmp/lib/bsnmpclient.3 head/contrib/bsnmp/lib/bsnmplib.3 head/contrib/bsnmp/lib/snmp.c head/contrib/bsnmp/lib/snmp.h head/contrib/bsnmp/lib/snmpagent.c head/contrib/bsnmp/lib/snmpagent.h head/contrib/bsnmp/lib/snmpclient.c head/contrib/bsnmp/lib/snmpclient.h head/contrib/bsnmp/lib/snmpcrypto.c head/contrib/bsnmp/lib/snmppriv.h head/contrib/bsnmp/lib/support.c head/contrib/bsnmp/lib/support.h head/contrib/bsnmp/snmp_mibII/mibII.c head/contrib/bsnmp/snmp_mibII/mibII.h head/contrib/bsnmp/snmp_mibII/mibII_begemot.c head/contrib/bsnmp/snmp_mibII/mibII_ifmib.c head/contrib/bsnmp/snmp_mibII/mibII_ifstack.c head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c head/contrib/bsnmp/snmp_mibII/mibII_ip.c head/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c head/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c head/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c head/contrib/bsnmp/snmp_mibII/mibII_route.c head/contrib/bsnmp/snmp_mibII/mibII_tcp.c head/contrib/bsnmp/snmp_mibII/mibII_tree.def head/contrib/bsnmp/snmp_mibII/mibII_udp.c head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 head/contrib/bsnmp/snmp_mibII/snmp_mibII.h head/contrib/bsnmp/snmp_ntp/NTP-MIB.txt head/contrib/bsnmp/snmp_ntp/NTP-PROXY-MIB.txt head/contrib/bsnmp/snmp_target/snmp_target.3 head/contrib/bsnmp/snmp_usm/snmp_usm.3 head/contrib/bsnmp/snmp_usm/usm_snmp.c head/contrib/bsnmp/snmp_vacm/snmp_vacm.3 head/contrib/bsnmp/snmp_vacm/vacm_snmp.c head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt head/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt head/contrib/bsnmp/snmpd/FOKUS-MIB.txt head/contrib/bsnmp/snmpd/action.c head/contrib/bsnmp/snmpd/config.c head/contrib/bsnmp/snmpd/export.c head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/snmpd.config head/contrib/bsnmp/snmpd/snmpd.h head/contrib/bsnmp/snmpd/snmpd.sh head/contrib/bsnmp/snmpd/snmpmod.3 head/contrib/bsnmp/snmpd/snmpmod.h head/contrib/bsnmp/snmpd/trans_lsock.c head/contrib/bsnmp/snmpd/trans_lsock.h head/contrib/bsnmp/snmpd/trans_udp.c head/contrib/bsnmp/snmpd/trans_udp.h head/contrib/bsnmp/snmpd/trap.c head/contrib/bsnmp/snmpd/tree.def head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt head/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c head/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 head/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c head/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt head/usr.sbin/bsnmpd/modules/snmp_pf/Makefile head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c head/usr.sbin/bsnmpd/modules/snmp_target/Makefile head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h head/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 ============================================================================== --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -13,7 +13,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Tue Dec 27 23:32:54 2016 (r310648) @@ -1,10 +1,10 @@ -/* +/* * Copyright (C) 2004-2006 * Hartmut Brandt. * All rights reserved. - * + * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -233,7 +233,7 @@ print_scalar(SmiNode *n, u_int level) printf(" op_%s", p->name); print_access(n->access); - + printf(")\n"); } @@ -422,7 +422,7 @@ static void print_enum_typedef(SmiType *t) { SmiNamedNumber *nnum; - + for (nnum = smiGetFirstNamedNumber(t); nnum != NULL; nnum = smiGetNextNamedNumber(nnum)) { printf("\t%ld %s\n" , nnum->value.value.integer32, nnum->name); @@ -434,10 +434,10 @@ print_stype(SmiNode *n) { SmiType *type; struct tdef *t = NULL; - + type = smiGetNodeType(n); assert(type != NULL); - + if (type->basetype == SMI_BASETYPE_ENUM) { if (do_typedef == 'e' && type->name != NULL) { SLIST_FOREACH(t, &tdefs, link) { @@ -450,7 +450,7 @@ print_stype(SmiNode *n) printf("typedef %sType ENUM (\n", n->name); else return; - + print_enum_typedef(type); printf(")\n\n"); @@ -476,7 +476,7 @@ static void print_typdefs(SmiNode *n) { SmiNode *p; - + p = n; n = smiGetFirstChildNode(n); while (n != NULL) { Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.1 Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.1 Tue Dec 27 23:32:54 2016 (r310648) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.c Tue Dec 27 23:32:54 2016 (r310648) @@ -8,7 +8,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,7 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -738,7 +738,7 @@ parse_type(enum tok *tok, struct type *t e->value = -(long)val; } else e->value = val; - + if (*tok != TOK_NUM) report("need value for ENUM/BITS"); if (gettoken() != TOK_STR) Modified: head/contrib/bsnmp/lib/asn1.3 ============================================================================== --- head/contrib/bsnmp/lib/asn1.3 Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/asn1.3 Tue Dec 27 23:32:54 2016 (r310648) @@ -5,9 +5,9 @@ .\" Copyright (c) 2001-2003 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. -.\" +.\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/asn1.c ============================================================================== --- head/contrib/bsnmp/lib/asn1.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/asn1.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -285,7 +285,7 @@ asn_put_real_integer(struct asn_buf *b, enum asn_err ret; if (ival < 0) { - /* this may fail if |INT64_MIN| > |INT64_MAX| and + /* this may fail if |INT64_MIN| > |INT64_MAX| and * the value is between * INT64_MIN <= ival < -(INT64_MAX+1) */ val = (uint64_t)-(ival + 1); neg = 1; @@ -890,7 +890,7 @@ asn_slice_oid(struct asn_oid *dest, cons memcpy(dest->subs, &src->subs[from], dest->len * sizeof(dest->subs[0])); } -/* +/* * Append from to to */ void Modified: head/contrib/bsnmp/lib/asn1.h ============================================================================== --- head/contrib/bsnmp/lib/asn1.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/asn1.h Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/bsnmpagent.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmpagent.3 Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/bsnmpagent.3 Tue Dec 27 23:32:54 2016 (r310648) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/bsnmpclient.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmpclient.3 Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/bsnmpclient.3 Tue Dec 27 23:32:54 2016 (r310648) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- head/contrib/bsnmp/lib/bsnmplib.3 Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/bsnmplib.3 Tue Dec 27 23:32:54 2016 (r310648) @@ -13,7 +13,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -22,7 +22,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/snmp.c ============================================================================== --- head/contrib/bsnmp/lib/snmp.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmp.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -19,7 +19,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -684,7 +684,7 @@ snmp_pdu_snoop(const struct asn_buf *b0) struct asn_buf b = *b0; /* <0x10|0x20> */ - + if (b.asn_len == 0) return (0); if (b.asn_cptr[0] != (ASN_TYPE_SEQUENCE | ASN_TYPE_CONSTRUCTED)) { @@ -759,7 +759,7 @@ snmp_pdu_encode_header(struct asn_buf *b if (asn_put_temp_header(b, (ASN_TYPE_SEQUENCE | ASN_TYPE_CONSTRUCTED), &v3_hdr_ptr) != ASN_ERR_OK) return (SNMP_CODE_FAILED); - + if (asn_put_integer(b, pdu->identifier) != ASN_ERR_OK) return (SNMP_CODE_FAILED); Modified: head/contrib/bsnmp/lib/snmp.h ============================================================================== --- head/contrib/bsnmp/lib/snmp.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmp.h Tue Dec 27 23:32:54 2016 (r310648) @@ -4,14 +4,14 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Shteryana Sotirova Shopova * under sponsorship from the FreeBSD Foundation. * - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -20,7 +20,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- head/contrib/bsnmp/lib/snmpagent.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmpagent.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -518,7 +518,7 @@ snmp_getbulk(struct snmp_pdu *pdu, struc /* PDU is full */ goto done; - if (cnt == 0) + if (cnt == 0) result = do_getnext(&context, &pdu->bindings[i], &resp->bindings[resp->nbindings], pdu); else @@ -692,7 +692,7 @@ snmp_set(struct snmp_pdu *pdu, struct as if (snmp_pdu_encode_header(resp_b, resp)) return (SNMP_RET_IGN); - /* + /* * 1. Find all nodes, check that they are writeable and * that the syntax is ok, copy over the binding to the response. */ @@ -970,7 +970,7 @@ snmp_dep_lookup(struct snmp_context *ctx /* * Make an error response from a PDU. We do this without decoding the * variable bindings. This means we can sent the junk back to a caller - * that has sent us junk in the first place. + * that has sent us junk in the first place. */ enum snmp_ret snmp_make_errresp(const struct snmp_pdu *pdu, struct asn_buf *pdu_b, Modified: head/contrib/bsnmp/lib/snmpagent.h ============================================================================== --- head/contrib/bsnmp/lib/snmpagent.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmpagent.h Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- head/contrib/bsnmp/lib/snmpclient.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmpclient.c Tue Dec 27 23:32:54 2016 (r310648) @@ -68,7 +68,7 @@ struct snmp_client snmp_client; /* List of all outstanding requests */ -struct sent_pdu { +struct sent_pdu { int reqid; struct snmp_pdu *pdu; struct timeval time; @@ -510,7 +510,7 @@ table_check_response(struct tabwork *wor table_free(work, 1); return (-2); } - + continue; } if (!asn_is_suboid(&work->descr->table, &b->var) || @@ -754,7 +754,7 @@ snmp_oid_append(struct asn_oid *oid, con ret = 0; while (*fmt != '\0') { switch (*fmt++) { - case 'i': + case 'i': /* just an integer more */ if (oid->len + 1 > ASN_MAXOIDLEN) { warnx("%s: OID too long for integer", __func__); @@ -804,7 +804,7 @@ snmp_oid_append(struct asn_oid *oid, con break; case 'b': - /* append `size` characters */ + /* append `size` characters */ str = (const u_char *)va_arg(va, const char *); if (oid->len + size > ASN_MAXOIDLEN) { warnx("%s: OID too long for string", __func__); @@ -852,7 +852,7 @@ snmp_client_init(struct snmp_client *c) strcpy(c->read_community, "public"); strcpy(c->write_community, "private"); - + c->security_model = SNMP_SECMODEL_USM; strcpy(c->cname, ""); @@ -863,7 +863,7 @@ snmp_client_init(struct snmp_client *c) c->txbuflen = c->rxbuflen = 10000; c->fd = -1; - + c->max_reqid = INT32_MAX; c->min_reqid = 0; c->next_reqid = 0; Modified: head/contrib/bsnmp/lib/snmpclient.h ============================================================================== --- head/contrib/bsnmp/lib/snmpclient.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmpclient.h Tue Dec 27 23:32:54 2016 (r310648) @@ -5,7 +5,7 @@ * * Author: Harti Brandt * Kendy Kutzner - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -14,7 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -59,7 +59,7 @@ typedef void (*snmp_send_cb_f)(struct sn typedef void (*snmp_timeout_cb_f)(void * ); /* timeout start function */ -typedef void *(*snmp_timeout_start_f)(struct timeval *timeout, +typedef void *(*snmp_timeout_start_f)(struct timeval *timeout, snmp_timeout_cb_f callback, void *); /* timeout stop function */ Modified: head/contrib/bsnmp/lib/snmpcrypto.c ============================================================================== --- head/contrib/bsnmp/lib/snmpcrypto.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmpcrypto.c Tue Dec 27 23:32:54 2016 (r310648) @@ -322,7 +322,7 @@ snmp_calc_keychange(struct snmp_user *us for (i = 0; i < keylen / 4; i++) rvalue[i] = random(); - + memcpy(keychange, user->auth_key, keylen); memcpy(keychange + keylen, rvalue, keylen); Modified: head/contrib/bsnmp/lib/snmppriv.h ============================================================================== --- head/contrib/bsnmp/lib/snmppriv.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/snmppriv.h Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/support.c ============================================================================== --- head/contrib/bsnmp/lib/support.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/support.c Tue Dec 27 23:32:54 2016 (r310648) @@ -1,10 +1,10 @@ -/* +/* * Copyright (C) 2004 * Hartmut Brandt. * All rights reserved. - * + * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/lib/support.h ============================================================================== --- head/contrib/bsnmp/lib/support.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/lib/support.h Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -1228,7 +1228,7 @@ mib_fetch_rtab(int af, int info, int arg return (NULL); } buf = newbuf; - + if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) break; @@ -1329,7 +1329,7 @@ mib_arp_update(void) in_update_arp = 0; return; } - + next = buf; while (next < buf + needed) { rtm = (struct rt_msghdr *)(void *)next; @@ -1521,7 +1521,7 @@ mib_unmodify_ifa(struct mibifa *ifa) } /* - * Modify an IFA. + * Modify an IFA. */ int mib_modify_ifa(struct mibifa *ifa) Modified: head/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII.h Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_begemot.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_begemot.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_ifmib.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_ifmib.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_ifmib.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_ifstack.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_ifstack.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_ifstack.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_ip.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_ip.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_ip.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_route.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_route.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_route.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -257,7 +257,7 @@ mib_fetch_route(void) continue; mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); - + mib_sroute_process(rtm, addrs[RTAX_GATEWAY], addrs[RTAX_DST], addrs[RTAX_NETMASK]); } Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_tree.def ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_tree.def Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_tree.def Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ # All rights reserved. # # Author: Harti Brandt -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -13,7 +13,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/mibII_udp.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_udp.c Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/mibII_udp.c Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Tue Dec 27 23:32:54 2016 (r310648) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_mibII/snmp_mibII.h ============================================================================== --- head/contrib/bsnmp/snmp_mibII/snmp_mibII.h Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_mibII/snmp_mibII.h Tue Dec 27 23:32:54 2016 (r310648) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/contrib/bsnmp/snmp_ntp/NTP-MIB.txt ============================================================================== --- head/contrib/bsnmp/snmp_ntp/NTP-MIB.txt Tue Dec 27 23:31:32 2016 (r310647) +++ head/contrib/bsnmp/snmp_ntp/NTP-MIB.txt Tue Dec 27 23:32:54 2016 (r310648) @@ -5,7 +5,7 @@ NTP-MIB DEFINITIONS ::= BEGIN IMPORTS - Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, + Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, enterprises FROM SNMPv2-SMI @@ -14,9 +14,9 @@ IMPORTS ntpMIB MODULE-IDENTITY LAST-UPDATED "199707251530Z" - ORGANIZATION + ORGANIZATION "University of Delaware" - CONTACT-INFO + CONTACT-INFO "Adarsh Sethi Department of Computer & Information Sciences University of Delaware @@ -30,7 +30,7 @@ ntpMIB MODULE-IDENTITY Newark, DE 19716 Tel: +1 302 831 ???? E-mail: mills@ee.udel.edu" - DESCRIPTION + DESCRIPTION "This MIB module defines a MIB which provides mechanisms to monitor and control an NTP server." ::= { udel 3 } @@ -60,18 +60,18 @@ ntpFilter OBJECT IDENTIFIER NTPTimeStamp ::= TEXTUAL-CONVENTION DISPLAY-HINT "4x.4x" STATUS current - DESCRIPTION + DESCRIPTION "" SYNTAX OCTET STRING (SIZE(8)) NTPLeapIndicator ::= TEXTUAL-CONVENTION STATUS current - DESCRIPTION + DESCRIPTION "" SYNTAX INTEGER { noWarning(0), addSecond(1), - subtractSecond(2), + subtractSecond(2), alarm(3) } -- @@ -82,7 +82,7 @@ ntpSysLeap OBJECT-TYPE SYNTAX NTPLeapIndicator MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION " two-bit code warning of an impending leap second to be inserted in the NTP timescale." ::= { ntpSystem 1 } @@ -91,7 +91,7 @@ ntpSysStratum OBJECT-TYPE SYNTAX Integer32 (0..255) MAX-ACCESS read-only *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 27 23:56:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A21BC944F8; Tue, 27 Dec 2016 23:56:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0901CB0; Tue, 27 Dec 2016 23:56:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBRNuk5p069991; Tue, 27 Dec 2016 23:56:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBRNukwC069989; Tue, 27 Dec 2016 23:56:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612272356.uBRNukwC069989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Dec 2016 23:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310649 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 23:56:47 -0000 Author: mav Date: Tue Dec 27 23:56:46 2016 New Revision: 310649 URL: https://svnweb.freebsd.org/changeset/base/310649 Log: Allow more efficient use of private area. There are 16 bytes of space, so we may store two pointers in one. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Tue Dec 27 23:32:54 2016 (r310648) +++ head/sys/cam/ctl/ctl_io.h Tue Dec 27 23:56:46 2016 (r310649) @@ -145,7 +145,9 @@ struct ctl_ptr_len_flags { union ctl_priv { uint8_t bytes[sizeof(uint64_t) * 2]; uint64_t integer; + uint64_t integers[2]; void *ptr; + void *ptrs[2]; }; /* Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Tue Dec 27 23:32:54 2016 (r310648) +++ head/sys/cam/ctl/scsi_ctl.c Tue Dec 27 23:56:46 2016 (r310649) @@ -185,6 +185,9 @@ MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CA /* This is only used in the CTIO */ #define ccb_atio ppriv_ptr1 +#define PRIV_CCB(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[0]) +#define PRIV_INFO(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[1]) + int ctlfeinitialize(void); void ctlfeshutdown(void); static periph_init_t ctlfeperiphinit; @@ -554,7 +557,7 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } - new_io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_INFO(new_io) = cmd_info; softc->atios_alloced++; new_ccb->ccb_h.io_ptr = new_io; @@ -702,7 +705,7 @@ ctlfedata(struct ctlfe_lun_softc *softc, size_t off; int i, idx; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); bus_softc = softc->parent_softc; /* @@ -806,7 +809,7 @@ ctlfestart(struct cam_periph *periph, un flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); cmd_info->cur_transfer_index = 0; cmd_info->cur_transfer_off = 0; cmd_info->flags = 0; @@ -987,7 +990,7 @@ ctlfe_free_ccb(struct cam_periph *periph switch (ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: softc->atios_freed++; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); free(cmd_info, M_CTLFE); break; case XPT_IMMEDIATE_NOTIFY: @@ -1154,12 +1157,12 @@ ctlfedone(struct cam_periph *periph, uni */ mtx_unlock(mtx); io = done_ccb->ccb_h.io_ptr; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); ctl_zero_io(io); /* Save pointers on both sides */ - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = done_ccb; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_CCB(io) = done_ccb; + PRIV_INFO(io) = cmd_info; done_ccb->ccb_h.io_ptr = io; /* @@ -1315,7 +1318,7 @@ ctlfedone(struct cam_periph *periph, uni struct ccb_scsiio *csio; csio = &done_ccb->csio; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; @@ -1444,7 +1447,7 @@ ctlfedone(struct cam_periph *periph, uni send_ctl_io = 1; io->io_hdr.io_type = CTL_IO_TASK; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr =done_ccb; + PRIV_CCB(io) = done_ccb; inot->ccb_h.io_ptr = io; io->io_hdr.nexus.initid = inot->initiator_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; @@ -2002,7 +2005,7 @@ ctlfe_datamove(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Unexpected io_type (%d) in ctlfe_datamove", io->io_hdr.io_type)); - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; @@ -2022,7 +2025,7 @@ ctlfe_done(union ctl_io *io) struct cam_periph *periph; struct ctlfe_lun_softc *softc; - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; From owner-svn-src-all@freebsd.org Wed Dec 28 02:55:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C9B1C93625; Wed, 28 Dec 2016 02:55:28 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D3171DEF; Wed, 28 Dec 2016 02:55:28 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS2tRaj045517; Wed, 28 Dec 2016 02:55:27 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS2tQeR045512; Wed, 28 Dec 2016 02:55:26 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612280255.uBS2tQeR045512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 28 Dec 2016 02:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310650 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 02:55:28 -0000 Author: kan Date: Wed Dec 28 02:55:26 2016 New Revision: 310650 URL: https://svnweb.freebsd.org/changeset/base/310650 Log: Implement pmap_change_attr and related APIs on MIPS On platforms that have uncached-accelerate cache attribute, map it to VM_MEMATTR_WRITE_COMBINING. Otherwise, leave write comining undefined. Reviewed by: adrian, jhb (glance) Differential Revision: https://reviews.freebsd.org/D8894 Modified: head/sys/mips/include/cpuregs.h head/sys/mips/include/pmap.h head/sys/mips/include/pte.h head/sys/mips/include/vm.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Tue Dec 27 23:56:46 2016 (r310649) +++ head/sys/mips/include/cpuregs.h Wed Dec 28 02:55:26 2016 (r310650) @@ -171,6 +171,10 @@ #define MIPS_CCA_CACHED MIPS_CCA_CCS #endif +#if defined(CPU_XBURST) +#define MIPS_CCA_UA 0x01 +#endif + #ifndef MIPS_CCA_UNCACHED #define MIPS_CCA_UNCACHED MIPS_CCA_UC #endif @@ -188,6 +192,16 @@ #endif #endif +/* + * Use uncached-accelerated mode for write-combining maps, if one is defined, + * otherwise fall back to uncached + */ +#ifndef MIPS_CCA_WC +#ifdef MIPS_CCA_UA +#define MIPS_CCA_WC MIPS_CCA_UA +#endif +#endif + #define MIPS_PHYS_TO_XKPHYS(cca,x) \ ((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x)) #define MIPS_PHYS_TO_XKPHYS_CACHED(x) \ Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Tue Dec 27 23:56:46 2016 (r310649) +++ head/sys/mips/include/pmap.h Wed Dec 28 02:55:26 2016 (r310650) @@ -74,7 +74,8 @@ struct md_page { }; #define PV_TABLE_REF 0x02 /* referenced */ -#define PV_MEMATTR_UNCACHEABLE 0x04 +#define PV_MEMATTR_MASK 0xf0 /* store vm_memattr_t here */ +#define PV_MEMATTR_SHIFT 0x04 #define ASID_BITS 8 #define ASIDGEN_BITS (32 - ASID_BITS) @@ -163,22 +164,24 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dump_avail[PHYS_AVAIL_ENTRIES + 2]; -#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT +#define pmap_page_get_memattr(m) (((m)->md.pv_flags & PV_MEMATTR_MASK) >> PV_MEMATTR_SHIFT) #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) void pmap_bootstrap(void); void *pmap_mapdev(vm_paddr_t, vm_size_t); +void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); void pmap_unmapdev(vm_offset_t, vm_size_t); vm_offset_t pmap_steal_memory(vm_size_t size); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); -void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr); +void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t attr); void pmap_kremove(vm_offset_t va); void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_temporary_free(vm_paddr_t pa); void pmap_flush_pvcache(vm_page_t m); int pmap_emulate_modified(pmap_t pmap, vm_offset_t va); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); +int pmap_change_attr(vm_offset_t, vm_size_t, vm_memattr_t); #endif /* _KERNEL */ Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Tue Dec 27 23:56:46 2016 (r310649) +++ head/sys/mips/include/pte.h Wed Dec 28 02:55:26 2016 (r310650) @@ -132,8 +132,10 @@ typedef pt_entry_t *pd_entry_t; * it is matched. */ #define PTE_C(attr) ((attr & 0x07) << 3) +#define PTE_C_MASK (PTE_C(0x07)) #define PTE_C_UNCACHED (PTE_C(MIPS_CCA_UNCACHED)) #define PTE_C_CACHE (PTE_C(MIPS_CCA_CACHED)) +#define PTE_C_WC (PTE_C(MIPS_CCA_WC)) #define PTE_D 0x04 #define PTE_V 0x02 #define PTE_G 0x01 @@ -158,6 +160,7 @@ typedef pt_entry_t *pd_entry_t; #define pte_clear(pte, bit) (*(pte) &= ~(bit)) #define pte_set(pte, bit) (*(pte) |= (bit)) #define pte_test(pte, bit) ((*(pte) & (bit)) == (bit)) +#define pte_cache_bits(pte) ((*(pte) >> 3) & 0x07) /* Assembly support for PTE access*/ #ifdef LOCORE Modified: head/sys/mips/include/vm.h ============================================================================== --- head/sys/mips/include/vm.h Tue Dec 27 23:56:46 2016 (r310649) +++ head/sys/mips/include/vm.h Wed Dec 28 02:55:26 2016 (r310650) @@ -32,7 +32,11 @@ #include /* Memory attributes. */ -#define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)PTE_C_UNCACHED) -#define VM_MEMATTR_DEFAULT ((vm_memattr_t)PTE_C_CACHE) +#define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)MIPS_CCA_UNCACHED) +#define VM_MEMATTR_WRITE_BACK ((vm_memattr_t)MIPS_CCA_CACHED) +#define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK +#ifdef MIPS_CCA_WC +#define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)MIPS_CCA_WC) +#endif #endif /* !_MACHINE_VM_H_ */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue Dec 27 23:56:46 2016 (r310649) +++ head/sys/mips/mips/pmap.c Wed Dec 28 02:55:26 2016 (r310650) @@ -189,10 +189,10 @@ static void pmap_update_page_action(void * The highmem area does not have a KSEG0 mapping, and we need a mechanism to * do temporary per-CPU mappings for pmap_zero_page, pmap_copy_page etc. * - * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pages. To + * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pages. To * access a highmem physical address on a CPU, we map the physical address to - * the reserved virtual address for the CPU in the kernel pagetable. This is - * done with interrupts disabled(although a spinlock and sched_pin would be + * the reserved virtual address for the CPU in the kernel pagetable. This is + * done with interrupts disabled(although a spinlock and sched_pin would be * sufficient). */ struct local_sysmaps { @@ -303,7 +303,7 @@ pmap_lmem_map2(vm_paddr_t phys1, vm_padd return (0); } -static __inline vm_offset_t +static __inline vm_offset_t pmap_lmem_unmap(void) { @@ -312,12 +312,18 @@ pmap_lmem_unmap(void) #endif /* !__mips_n64 */ static __inline int -is_cacheable_page(vm_paddr_t pa, vm_page_t m) +pmap_pte_cache_bits(vm_paddr_t pa, vm_page_t m) { + vm_memattr_t ma; - return ((m->md.pv_flags & PV_MEMATTR_UNCACHEABLE) == 0 && - is_cacheable_mem(pa)); - + ma = pmap_page_get_memattr(m); + if (ma == VM_MEMATTR_WRITE_BACK && !is_cacheable_mem(pa)) + ma = VM_MEMATTR_UNCACHEABLE; + return PTE_C(ma); +} +#define PMAP_PTE_SET_CACHE_BITS(pte, ps, m) { \ + pte &= ~PTE_C_MASK; \ + pte |= pmap_pte_cache_bits(pa, m); \ } /* @@ -359,7 +365,7 @@ pmap_pdpe_to_pde(pd_entry_t *pdpe, vm_of return (pdpe); } -static __inline +static __inline pd_entry_t *pmap_pde(pmap_t pmap, vm_offset_t va) { @@ -423,7 +429,7 @@ pmap_steal_memory(vm_size_t size) * Bootstrap the system enough to run with virtual memory. This * assumes that the phys_avail array has been initialized. */ -static void +static void pmap_create_kernel_pagetable(void) { int i, j; @@ -486,7 +492,7 @@ void pmap_bootstrap(void) { int i; - int need_local_mappings = 0; + int need_local_mappings = 0; /* Sort. */ again: @@ -600,7 +606,7 @@ pmap_page_init(vm_page_t m) { TAILQ_INIT(&m->md.pv_list); - m->md.pv_flags = 0; + m->md.pv_flags = VM_MEMATTR_DEFAULT << PV_MEMATTR_SHIFT; } /* @@ -635,8 +641,8 @@ pmap_call_on_active_cpus(pmap_t pmap, vo pmap->pm_asid[cpu].gen = 0; } cpuid = PCPU_GET(cpuid); - /* - * XXX: barrier/locking for active? + /* + * XXX: barrier/locking for active? * * Take a snapshot of active here, any further changes are ignored. * tlb update/invalidate should be harmless on inactive CPUs @@ -819,7 +825,7 @@ retry: * add a wired page to the kva */ void -pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) +pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t ma) { pt_entry_t *pte; pt_entry_t opte, npte; @@ -830,7 +836,7 @@ pmap_kenter_attr(vm_offset_t va, vm_padd pte = pmap_pte(kernel_pmap, va); opte = *pte; - npte = TLBLO_PA_TO_PFN(pa) | attr | PTE_D | PTE_V | PTE_G; + npte = TLBLO_PA_TO_PFN(pa) | PTE_C(ma) | PTE_D | PTE_V | PTE_G; *pte = npte; if (pte_test(&opte, PTE_V) && opte != npte) pmap_update_page(kernel_pmap, va, npte); @@ -843,7 +849,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p KASSERT(is_cacheable_mem(pa), ("pmap_kenter: memory at 0x%lx is not cacheable", (u_long)pa)); - pmap_kenter_attr(va, pa, PTE_C_CACHE); + pmap_kenter_attr(va, pa, VM_MEMATTR_DEFAULT); } /* @@ -1144,11 +1150,11 @@ _pmap_allocpte(pmap_t pmap, unsigned pte int segindex = ptepindex >> (SEGSHIFT - PDRSHIFT); int pdeindex = ptepindex & (NPDEPG - 1); vm_page_t pg; - + pdep = &pmap->pm_segtab[segindex]; - if (*pdep == NULL) { + if (*pdep == NULL) { /* recurse for allocating page dir */ - if (_pmap_allocpte(pmap, NUPDE + segindex, + if (_pmap_allocpte(pmap, NUPDE + segindex, flags) == NULL) { /* alloc failed, release current */ --m->wire_count; @@ -1680,7 +1686,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm * pmap_remove_pte: do the things to unmap a page in a process */ static int -pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va, +pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va, pd_entry_t pde) { pt_entry_t oldpte; @@ -1864,7 +1870,7 @@ pmap_remove_all(vm_page_t m) PMAP_LOCK(pmap); /* - * If it's last mapping writeback all caches from + * If it's last mapping writeback all caches from * the page being destroyed */ if (TAILQ_NEXT(pv, pv_list) == NULL) @@ -2030,10 +2036,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, newpte |= PTE_W; if (is_kernel_pmap(pmap)) newpte |= PTE_G; - if (is_cacheable_page(pa, m)) - newpte |= PTE_C_CACHE; - else - newpte |= PTE_C_UNCACHED; + PMAP_PTE_SET_CACHE_BITS(newpte, pa, m); mpte = NULL; @@ -2218,7 +2221,7 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte) { - pt_entry_t *pte; + pt_entry_t *pte, npte; vm_paddr_t pa; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || @@ -2297,18 +2300,16 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Now validate mapping with RO protection */ - *pte = PTE_RO | TLBLO_PA_TO_PFN(pa) | PTE_V; + npte = PTE_RO | TLBLO_PA_TO_PFN(pa) | PTE_V; if ((m->oflags & VPO_UNMANAGED) == 0) - *pte |= PTE_MANAGED; + npte |= PTE_MANAGED; - if (is_cacheable_page(pa, m)) - *pte |= PTE_C_CACHE; - else - *pte |= PTE_C_UNCACHED; + PMAP_PTE_SET_CACHE_BITS(npte, pa, m); if (is_kernel_pmap(pmap)) - *pte |= PTE_G; + *pte = npte | PTE_G; else { + *pte = npte; /* * Sync I & D caches. Do this only if the target pmap * belongs to the current process. Otherwise, an @@ -2649,12 +2650,12 @@ pmap_quick_enter_page(vm_page_t m) #else vm_paddr_t pa; struct local_sysmaps *sysm; - pt_entry_t *pte; + pt_entry_t *pte, npte; pa = VM_PAGE_TO_PHYS(m); if (MIPS_DIRECT_MAPPABLE(pa)) { - if (m->md.pv_flags & PV_MEMATTR_UNCACHEABLE) + if (pmap_page_get_memattr(m) != VM_MEMATTR_WRITE_BACK) return (MIPS_PHYS_TO_DIRECT_UNCACHED(pa)); else return (MIPS_PHYS_TO_DIRECT(pa)); @@ -2665,8 +2666,9 @@ pmap_quick_enter_page(vm_page_t m) KASSERT(sysm->valid1 == 0, ("pmap_quick_enter_page: PTE busy")); pte = pmap_pte(kernel_pmap, sysm->base); - *pte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | - (is_cacheable_page(pa, m) ? PTE_C_CACHE : PTE_C_UNCACHED); + npte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G; + PMAP_PTE_SET_CACHE_BITS(npte, pa, m); + *pte = npte; sysm->valid1 = 1; return (sysm->base); @@ -3146,26 +3148,26 @@ pmap_is_referenced(vm_page_t m) * Use XKPHYS uncached for 64 bit, and KSEG1 where possible for 32 bit. */ void * -pmap_mapdev(vm_paddr_t pa, vm_size_t size) +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) { vm_offset_t va, tmpva, offset; - /* - * KSEG1 maps only first 512M of phys address space. For + /* + * KSEG1 maps only first 512M of phys address space. For * pa > 0x20000000 we should make proper mapping * using pmap_kenter. */ - if (MIPS_DIRECT_MAPPABLE(pa + size - 1)) + if (MIPS_DIRECT_MAPPABLE(pa + size - 1) && ma == VM_MEMATTR_UNCACHEABLE) return ((void *)MIPS_PHYS_TO_DIRECT_UNCACHED(pa)); else { offset = pa & PAGE_MASK; size = roundup(size + offset, PAGE_SIZE); - + va = kva_alloc(size); if (!va) panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); pa = trunc_page(pa); for (tmpva = va; size > 0;) { - pmap_kenter_attr(tmpva, pa, PTE_C_UNCACHED); + pmap_kenter_attr(tmpva, pa, ma); size -= PAGE_SIZE; tmpva += PAGE_SIZE; pa += PAGE_SIZE; @@ -3175,6 +3177,12 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t siz return ((void *)(va + offset)); } +void * +pmap_mapdev(vm_paddr_t pa, vm_size_t size) +{ + return pmap_mapdev_attr(pa, size, VM_MEMATTR_UNCACHEABLE); +} + void pmap_unmapdev(vm_offset_t va, vm_size_t size) { @@ -3220,7 +3228,7 @@ retry: * This may falsely report the given address as * MINCORE_REFERENCED. Unfortunately, due to the lack of * per-PTE reference information, it is impossible to - * determine if the address is MINCORE_REFERENCED. + * determine if the address is MINCORE_REFERENCED. */ m = PHYS_TO_VM_PAGE(pa); if ((m->aflags & PGA_REFERENCED) != 0) @@ -3500,7 +3508,7 @@ pmap_kextract(vm_offset_t va) mapped = (va >= MIPS_KSEG2_START || va < MIPS_KSEG2_END); #if defined(__mips_n64) mapped = mapped || (va >= MIPS_XKSEG_START || va < MIPS_XKSEG_END); -#endif +#endif /* * Kernel virtual. */ @@ -3524,7 +3532,7 @@ pmap_kextract(vm_offset_t va) } -void +void pmap_flush_pvcache(vm_page_t m) { pv_entry_t pv; @@ -3551,12 +3559,85 @@ pmap_page_set_memattr(vm_page_t m, vm_me if (TAILQ_FIRST(&m->md.pv_list) != NULL) panic("Can't change memattr on page with existing mappings"); - /* - * The only memattr we support is UNCACHEABLE, translate the (semi-)MI - * representation of that into our internal flag in the page MD struct. - */ - if (ma == VM_MEMATTR_UNCACHEABLE) - m->md.pv_flags |= PV_MEMATTR_UNCACHEABLE; - else - m->md.pv_flags &= ~PV_MEMATTR_UNCACHEABLE; + /* Clean memattr portion of pv_flags */ + m->md.pv_flags &= ~PV_MEMATTR_MASK; + m->md.pv_flags |= (ma << PV_MEMATTR_SHIFT) & PV_MEMATTR_MASK; +} + +static __inline void +pmap_pte_attr(pt_entry_t *pte, vm_memattr_t ma) +{ + u_int npte; + + npte = *(u_int *)pte; + npte &= ~PTE_C_MASK; + npte |= PTE_C(ma); + *pte = npte; +} + +int +pmap_change_attr(vm_offset_t sva, vm_size_t size, vm_memattr_t ma) +{ + pd_entry_t *pde, *pdpe; + pt_entry_t *pte; + vm_offset_t ova, eva, va, va_next; + pmap_t pmap; + + ova = sva; + eva = sva + size; + if (eva < sva) + return (EINVAL); + + pmap = kernel_pmap; + PMAP_LOCK(pmap); + + for (; sva < eva; sva = va_next) { + pdpe = pmap_segmap(pmap, sva); +#ifdef __mips_n64 + if (*pdpe == 0) { + va_next = (sva + NBSEG) & ~SEGMASK; + if (va_next < sva) + va_next = eva; + continue; + } +#endif + va_next = (sva + NBPDR) & ~PDRMASK; + if (va_next < sva) + va_next = eva; + + pde = pmap_pdpe_to_pde(pdpe, sva); + if (*pde == NULL) + continue; + + /* + * Limit our scan to either the end of the va represented + * by the current page table page, or to the end of the + * range being removed. + */ + if (va_next > eva) + va_next = eva; + + va = va_next; + for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, + sva += PAGE_SIZE) { + if (!pte_test(pte, PTE_V) || pte_cache_bits(pte) == ma) { + if (va != va_next) { + pmap_invalidate_range(pmap, va, sva); + va = va_next; + } + continue; + } + if (va == va_next) + va = sva; + + pmap_pte_attr(pte, ma); + } + if (va != va_next) + pmap_invalidate_range(pmap, va, sva); + } + PMAP_UNLOCK(pmap); + + /* Flush caches to be in the safe side */ + mips_dcache_wbinv_range(ova, size); + return 0; } From owner-svn-src-all@freebsd.org Wed Dec 28 03:08:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00D6BC94126; Wed, 28 Dec 2016 03:08:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFA681EA4; Wed, 28 Dec 2016 03:07:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS37x8d051160; Wed, 28 Dec 2016 03:07:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS37wRP051157; Wed, 28 Dec 2016 03:07:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612280307.uBS37wRP051157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 28 Dec 2016 03:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310651 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 03:08:00 -0000 Author: sephe Date: Wed Dec 28 03:07:58 2016 New Revision: 310651 URL: https://svnweb.freebsd.org/changeset/base/310651 Log: hyperv/vmbus: Nuke unnecessary critical sections. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8906 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Wed Dec 28 02:55:26 2016 (r310650) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Dec 28 03:07:58 2016 (r310651) @@ -1393,7 +1393,7 @@ cleanup: vmbus_xact_ctx_destroy(sc->vmbus_xc); sc->vmbus_xc = NULL; } - free(sc->vmbus_chmap, M_DEVBUF); + free(__DEVOLATILE(void *, sc->vmbus_chmap), M_DEVBUF); mtx_destroy(&sc->vmbus_prichan_lock); mtx_destroy(&sc->vmbus_chan_lock); @@ -1480,7 +1480,7 @@ vmbus_detach(device_t dev) sc->vmbus_xc = NULL; } - free(sc->vmbus_chmap, M_DEVBUF); + free(__DEVOLATILE(void *, sc->vmbus_chmap), M_DEVBUF); mtx_destroy(&sc->vmbus_prichan_lock); mtx_destroy(&sc->vmbus_chan_lock); Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Dec 28 02:55:26 2016 (r310650) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Dec 28 03:07:58 2016 (r310651) @@ -775,9 +775,7 @@ vmbus_chan_clrchmap_task(void *xchan, in { struct vmbus_channel *chan = xchan; - critical_enter(); chan->ch_vmbus->vmbus_chmap[chan->ch_id] = NULL; - critical_exit(); } static void @@ -1308,15 +1306,17 @@ vmbus_chan_pollcfg_task(void *xarg, int chan->ch_poll_flags = poll_flags; /* - * Disable interrupt from the RX bufring (TX bufring does not - * generate interrupt to VM), and disconnect this channel from - * the channel map to make sure that ISR can not enqueue this - * channel task anymore. + * Disconnect this channel from the channel map to make sure that + * the RX bufring interrupt enabling bit can not be touched, and + * ISR can not enqueue this channel task anymore. THEN, disable + * interrupt from the RX bufring (TX bufring does not generate + * interrupt to VM). + * + * NOTE: order is critical. */ - critical_enter(); - vmbus_rxbr_intr_mask(&chan->ch_rxbr); chan->ch_vmbus->vmbus_chmap[chan->ch_id] = NULL; - critical_exit(); + __compiler_membar(); + vmbus_rxbr_intr_mask(&chan->ch_rxbr); /* * NOTE: @@ -1380,11 +1380,9 @@ vmbus_chan_polldis_task(void *xchan, int * Plug this channel back to the channel map and unmask * the RX bufring interrupt. */ - critical_enter(); chan->ch_vmbus->vmbus_chmap[chan->ch_id] = chan; __compiler_membar(); vmbus_rxbr_intr_unmask(&chan->ch_rxbr); - critical_exit(); /* * Kick start the interrupt task, just in case unmasking Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Dec 28 02:55:26 2016 (r310650) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Dec 28 03:07:58 2016 (r310651) @@ -93,7 +93,7 @@ struct vmbus_softc { u_long *vmbus_rx_evtflags; /* compat evtflgs from host */ - struct vmbus_channel **vmbus_chmap; + struct vmbus_channel *volatile *vmbus_chmap; struct vmbus_xact_ctx *vmbus_xc; struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; From owner-svn-src-all@freebsd.org Wed Dec 28 03:20:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BC37C944D2; Wed, 28 Dec 2016 03:20:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF5AA18D6; Wed, 28 Dec 2016 03:20:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS3K0mk055782; Wed, 28 Dec 2016 03:20:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS3K00r055781; Wed, 28 Dec 2016 03:20:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612280320.uBS3K00r055781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 28 Dec 2016 03:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310652 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 03:20:01 -0000 Author: sephe Date: Wed Dec 28 03:19:59 2016 New Revision: 310652 URL: https://svnweb.freebsd.org/changeset/base/310652 Log: hyperv/hn: Consolidate hn_{suspend,resume} MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8907 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Dec 28 03:07:58 2016 (r310651) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Dec 28 03:19:59 2016 (r310652) @@ -2367,9 +2367,6 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, break; } - /* Disable polling. */ - hn_polling(sc, 0); - /* * Suspend this interface before the synthetic parts * are ripped. @@ -2415,13 +2412,6 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, */ hn_resume(sc); - /* - * Re-enable polling if this interface is running and - * the polling is requested. - */ - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && sc->hn_pollhz > 0) - hn_polling(sc, sc->hn_pollhz); - HN_UNLOCK(sc); break; @@ -4900,6 +4890,9 @@ static void hn_suspend(struct hn_softc *sc) { + /* Disable polling. */ + hn_polling(sc, 0); + if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_suspend_data(sc); hn_suspend_mgmt(sc); @@ -4992,6 +4985,13 @@ hn_resume(struct hn_softc *sc) if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_resume_data(sc); hn_resume_mgmt(sc); + + /* + * Re-enable polling if this interface is running and + * the polling is requested. + */ + if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) && sc->hn_pollhz > 0) + hn_polling(sc, sc->hn_pollhz); } static void From owner-svn-src-all@freebsd.org Wed Dec 28 03:40:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 058A4C94B91; Wed, 28 Dec 2016 03:40:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0E62179A; Wed, 28 Dec 2016 03:40:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS3esA4064784; Wed, 28 Dec 2016 03:40:54 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS3esDp064783; Wed, 28 Dec 2016 03:40:54 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201612280340.uBS3esDp064783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 28 Dec 2016 03:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310653 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 03:40:56 -0000 Author: jhibbits Date: Wed Dec 28 03:40:54 2016 New Revision: 310653 URL: https://svnweb.freebsd.org/changeset/base/310653 Log: Restrict SLB handler to powerpc64 and AIM Only Book-S has SLBs. Book-E does not, so restrict it to only Book-S (which we call AIM). Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Wed Dec 28 03:19:59 2016 (r310652) +++ head/sys/powerpc/powerpc/trap.c Wed Dec 28 03:40:54 2016 (r310653) @@ -88,7 +88,7 @@ static int fix_unaligned(struct thread * static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); -#ifdef __powerpc64__ +#if defined(__powerpc64__) && defined(AIM) void handle_kernel_slb_spill(int, register_t, register_t); static int handle_user_slb_spill(pmap_t pm, vm_offset_t addr); extern int n_slbs; @@ -208,7 +208,7 @@ trap(struct trapframe *frame) ucode = TRAP_TRACE; break; -#ifdef __powerpc64__ +#if defined(__powerpc64__) && defined(AIM) case EXC_ISE: case EXC_DSE: if (handle_user_slb_spill(&p->p_vmspace->vm_pmap, @@ -347,7 +347,7 @@ trap(struct trapframe *frame) } break; #endif -#ifdef __powerpc64__ +#if defined(__powerpc64__) && defined(AIM) case EXC_DSE: if ((frame->dar & SEGMENT_MASK) == USER_ADDR) { __asm __volatile ("slbmte %0, %1" :: @@ -578,7 +578,7 @@ syscall(struct trapframe *frame) td = curthread; td->td_frame = frame; -#ifdef __powerpc64__ +#if defined(__powerpc64__) && defined(AIM) /* * Speculatively restore last user SLB segment, which we know is * invalid already, since we are likely to do copyin()/copyout(). @@ -591,7 +591,7 @@ syscall(struct trapframe *frame) syscallret(td, error, &sa); } -#ifdef __powerpc64__ +#if defined(__powerpc64__) && defined(AIM) /* Handle kernel SLB faults -- runs in real mode, all seat belts off */ void handle_kernel_slb_spill(int type, register_t dar, register_t srr0) From owner-svn-src-all@freebsd.org Wed Dec 28 03:56:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AA44C94F8F; Wed, 28 Dec 2016 03:56:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1E81E7A; Wed, 28 Dec 2016 03:56:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS3uPvR072683; Wed, 28 Dec 2016 03:56:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS3uP9R072681; Wed, 28 Dec 2016 03:56:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280356.uBS3uP9R072681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 03:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310654 - in head: tools/build/mk usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 03:56:26 -0000 Author: ngie Date: Wed Dec 28 03:56:25 2016 New Revision: 310654 URL: https://svnweb.freebsd.org/changeset/base/310654 Log: Install snmpmod.3 as all of the bsnmpd APIs it documents MFC after: 3 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 03:40:54 2016 (r310653) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 03:56:25 2016 (r310654) @@ -782,22 +782,119 @@ OLD_FILES+=usr/share/man/man1/bsnmpget.1 OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz OLD_FILES+=usr/share/man/man1/bsnmpwalk.1.gz OLD_FILES+=usr/share/man/man1/gensnmptree.1.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK_INDEX.3.gz OLD_FILES+=usr/share/man/man3/asn1.3.gz OLD_FILES+=usr/share/man/man3/bsnmpagent.3.gz OLD_FILES+=usr/share/man/man3/bsnmpclient.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_get_target_stats.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_get_usm_stats.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_reset_usm_stats.3.gz OLD_FILES+=usr/share/man/man3/bsnmplib.3.gz +OLD_FILES+=usr/share/man/man3/buf_alloc.3.gz +OLD_FILES+=usr/share/man/man3/buf_size.3.gz +OLD_FILES+=usr/share/man/man3/comm_define.3.gz +OLD_FILES+=usr/share/man/man3/community.3.gz +OLD_FILES+=usr/share/man/man3/fd_deselect.3.gz +OLD_FILES+=usr/share/man/man3/fd_resume.3.gz +OLD_FILES+=usr/share/man/man3/fd_select.3.gz +OLD_FILES+=usr/share/man/man3/fd_suspend.3.gz +OLD_FILES+=usr/share/man/man3/get_ticks.3.gz +OLD_FILES+=usr/share/man/man3/index_append.3.gz +OLD_FILES+=usr/share/man/man3/index_append_off.3.gz +OLD_FILES+=usr/share/man/man3/index_compare.3.gz +OLD_FILES+=usr/share/man/man3/index_compare_off.3.gz +OLD_FILES+=usr/share/man/man3/index_decode.3.gz +OLD_FILES+=usr/share/man/man3/ip_commit.3.gz +OLD_FILES+=usr/share/man/man3/ip_get.3.gz +OLD_FILES+=usr/share/man/man3/ip_rollback.3.gz +OLD_FILES+=usr/share/man/man3/ip_save.3.gz +OLD_FILES+=usr/share/man/man3/or_register.3.gz +OLD_FILES+=usr/share/man/man3/or_unregister.3.gz +OLD_FILES+=usr/share/man/man3/oid_commit.3.gz +OLD_FILES+=usr/share/man/man3/oid_get.3.gz +OLD_FILES+=usr/share/man/man3/oid_rollback.3.gz +OLD_FILES+=usr/share/man/man3/oid_save.3.gz +OLD_FILES+=usr/share/man/man3/oid_usmNotInTimeWindows.3.gz +OLD_FILES+=usr/share/man/man3/oid_usmUnknownEngineIDs.3.gz +OLD_FILES+=usr/share/man/man3/oid_zeroDotZero.3.gz +OLD_FILES+=usr/share/man/man3/reqid_allocate.3.gz +OLD_FILES+=usr/share/man/man3/reqid_base.3.gz +OLD_FILES+=usr/share/man/man3/reqid_istype.3.gz +OLD_FILES+=usr/share/man/man3/reqid_next.3.gz +OLD_FILES+=usr/share/man/man3/reqid_type.3.gz OLD_FILES+=usr/share/man/man3/snmp_atm.3.gz OLD_FILES+=usr/share/man/man3/snmp_bridge.3.gz OLD_FILES+=usr/share/man/man3/snmp_hast.3.gz OLD_FILES+=usr/share/man/man3/snmp_hostres.3.gz +OLD_FILES+=usr/share/man/man3/snmp_input_finish.3.gz +OLD_FILES+=usr/share/man/man3/snmp_input_start.3.gz OLD_FILES+=usr/share/man/man3/snmp_lm75.3.gz OLD_FILES+=usr/share/man/man3/snmp_mibII.3.gz OLD_FILES+=usr/share/man/man3/snmp_netgraph.3.gz +OLD_FILES+=usr/share/man/man3/snmp_output.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_auth_access.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_port.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_trap.3.gz OLD_FILES+=usr/share/man/man3/snmp_target.3.gz OLD_FILES+=usr/share/man/man3/snmp_usm.3.gz OLD_FILES+=usr/share/man/man3/snmp_vacm.3.gz OLD_FILES+=usr/share/man/man3/snmp_wlan.3.gz +OLD_FILES+=usr/share/man/man3/snmpd_target_stat.3.gz +OLD_FILES+=usr/share/man/man3/snmpd_usmstats.3.gz OLD_FILES+=usr/share/man/man3/snmpmod.3.gz +OLD_FILES+=usr/share/man/man3/start_tick.3.gz +OLD_FILES+=usr/share/man/man3/string_commit.3.gz +OLD_FILES+=usr/share/man/man3/string_free.3.gz +OLD_FILES+=usr/share/man/man3/string_get.3.gz +OLD_FILES+=usr/share/man/man3/string_get_max.3.gz +OLD_FILES+=usr/share/man/man3/string_rollback.3.gz +OLD_FILES+=usr/share/man/man3/string_save.3.gz +OLD_FILES+=usr/share/man/man3/systemg.3.gz +OLD_FILES+=usr/share/man/man3/this_tick.3.gz +OLD_FILES+=usr/share/man/man3/timer_start.3.gz +OLD_FILES+=usr/share/man/man3/timer_start_repeat.3.gz +OLD_FILES+=usr/share/man/man3/timer_stop.3.gz +OLD_FILES+=usr/share/man/man3/target_activate_address.3.gz +OLD_FILES+=usr/share/man/man3/target_address.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_address.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_param.3.gz +OLD_FILES+=usr/share/man/man3/target_first_address.3.gz +OLD_FILES+=usr/share/man/man3/target_first_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_first_param.3.gz +OLD_FILES+=usr/share/man/man3/target_flush_all.3.gz +OLD_FILES+=usr/share/man/man3/target_next_address.3.gz +OLD_FILES+=usr/share/man/man3/target_next_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_next_param.3.gz +OLD_FILES+=usr/share/man/man3/target_new_address.3.gz +OLD_FILES+=usr/share/man/man3/target_new_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_new_param.3.gz +OLD_FILES+=usr/share/man/man3/target_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_param.3.gz +OLD_FILES+=usr/share/man/man3/usm_delete_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_find_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_first_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_flush_users.3.gz +OLD_FILES+=usr/share/man/man3/usm_next_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_new_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_user.3.gz OLD_FILES+=usr/share/snmp/defs/atm_freebsd.def OLD_FILES+=usr/share/snmp/defs/atm_tree.def OLD_FILES+=usr/share/snmp/defs/bridge_tree.def Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Wed Dec 28 03:40:54 2016 (r310653) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Wed Dec 28 03:56:25 2016 (r310654) @@ -15,8 +15,107 @@ XSYM= snmpMIB begemotSnmpdModuleTable be begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable \ freeBSD freeBSDVersion CLEANFILES= oid.h tree.c tree.h + MAN= bsnmpd.1 snmpmod.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 bsnmpd_get_target_stats.3 +MLINKS+= snmpmod.3 bsnmpd_get_usm_stats.3 +MLINKS+= snmpmod.3 bsnmpd_reset_usm_stats.3 +MLINKS+= snmpmod.3 buf_alloc.3 +MLINKS+= snmpmod.3 buf_size.3 +MLINKS+= snmpmod.3 comm_define.3 +MLINKS+= snmpmod.3 community.3 +MLINKS+= snmpmod.3 fd_deselect.3 +MLINKS+= snmpmod.3 fd_resume.3 +MLINKS+= snmpmod.3 fd_select.3 +MLINKS+= snmpmod.3 fd_suspend.3 +MLINKS+= snmpmod.3 get_ticks.3 +MLINKS+= snmpmod.3 index_append.3 +MLINKS+= snmpmod.3 index_append_off.3 +MLINKS+= snmpmod.3 index_compare.3 +MLINKS+= snmpmod.3 index_compare_off.3 +MLINKS+= snmpmod.3 index_decode.3 +MLINKS+= snmpmod.3 ip_commit.3 +MLINKS+= snmpmod.3 ip_get.3 +MLINKS+= snmpmod.3 ip_rollback.3 +MLINKS+= snmpmod.3 ip_save.3 +MLINKS+= snmpmod.3 or_register.3 +MLINKS+= snmpmod.3 or_unregister.3 +MLINKS+= snmpmod.3 oid_commit.3 +MLINKS+= snmpmod.3 oid_get.3 +MLINKS+= snmpmod.3 oid_rollback.3 +MLINKS+= snmpmod.3 oid_save.3 +MLINKS+= snmpmod.3 oid_usmNotInTimeWindows.3 +MLINKS+= snmpmod.3 oid_usmUnknownEngineIDs.3 +MLINKS+= snmpmod.3 oid_zeroDotZero.3 +MLINKS+= snmpmod.3 reqid_allocate.3 +MLINKS+= snmpmod.3 reqid_base.3 +MLINKS+= snmpmod.3 reqid_istype.3 +MLINKS+= snmpmod.3 reqid_next.3 +MLINKS+= snmpmod.3 reqid_type.3 +MLINKS+= snmpmod.3 snmp_input_finish.3 +MLINKS+= snmpmod.3 snmp_input_start.3 +MLINKS+= snmpmod.3 snmp_output.3 +MLINKS+= snmpmod.3 snmp_pdu_auth_access.3 +MLINKS+= snmpmod.3 snmp_send_port.3 +MLINKS+= snmpmod.3 snmp_send_trap.3 +MLINKS+= snmpmod.3 snmpd_target_stat.3 +MLINKS+= snmpmod.3 snmpd_usmstats.3 +MLINKS+= snmpmod.3 start_tick.3 +MLINKS+= snmpmod.3 string_commit.3 +MLINKS+= snmpmod.3 string_free.3 +MLINKS+= snmpmod.3 string_get.3 +MLINKS+= snmpmod.3 string_get_max.3 +MLINKS+= snmpmod.3 string_rollback.3 +MLINKS+= snmpmod.3 string_save.3 +MLINKS+= snmpmod.3 systemg.3 +MLINKS+= snmpmod.3 this_tick.3 +MLINKS+= snmpmod.3 timer_start.3 +MLINKS+= snmpmod.3 timer_start_repeat.3 +MLINKS+= snmpmod.3 timer_stop.3 +MLINKS+= snmpmod.3 target_activate_address.3 +MLINKS+= snmpmod.3 target_address.3 +MLINKS+= snmpmod.3 target_delete_address.3 +MLINKS+= snmpmod.3 target_delete_notify.3 +MLINKS+= snmpmod.3 target_delete_param.3 +MLINKS+= snmpmod.3 target_first_address.3 +MLINKS+= snmpmod.3 target_first_notify.3 +MLINKS+= snmpmod.3 target_first_param.3 +MLINKS+= snmpmod.3 target_flush_all.3 +MLINKS+= snmpmod.3 target_next_address.3 +MLINKS+= snmpmod.3 target_next_notify.3 +MLINKS+= snmpmod.3 target_next_param.3 +MLINKS+= snmpmod.3 target_new_address.3 +MLINKS+= snmpmod.3 target_new_notify.3 +MLINKS+= snmpmod.3 target_new_param.3 +MLINKS+= snmpmod.3 target_notify.3 +MLINKS+= snmpmod.3 target_param.3 +MLINKS+= snmpmod.3 usm_delete_user.3 +MLINKS+= snmpmod.3 usm_find_user.3 +MLINKS+= snmpmod.3 usm_first_user.3 +MLINKS+= snmpmod.3 usm_flush_users.3 +MLINKS+= snmpmod.3 usm_next_user.3 +MLINKS+= snmpmod.3 usm_new_user.3 +MLINKS+= snmpmod.3 usm_user.3 + FILESGROUPS= BMIBS DEFS BMIBS= FOKUS-MIB.txt BEGEMOT-MIB.txt BEGEMOT-SNMPD.txt From owner-svn-src-all@freebsd.org Wed Dec 28 04:29:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 806EDC90E44; Wed, 28 Dec 2016 04:29:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF551022; Wed, 28 Dec 2016 04:29:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4TANU085326; Wed, 28 Dec 2016 04:29:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4TA1W085321; Wed, 28 Dec 2016 04:29:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280429.uBS4TA1W085321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 04:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310655 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:29:11 -0000 Author: ngie Date: Wed Dec 28 04:29:09 2016 New Revision: 310655 URL: https://svnweb.freebsd.org/changeset/base/310655 Log: Fix bsnmpd sending/receiving with multi-homed configurations or INADDR_ANY used as the listening address in snmpd_input(..) Stash the IPv4 address of the receiver via the recv(..) callback and use it in the send(..) callback for the transport by specifying IP_SENDSRCADDR for the control message type. Add sendmsg logic to the UDP transport's send(..) callback and use the respective send(..) callback for the transport instead of calling sendto in snmpd_input(..). MFC after: 3 weeks Obtained from: Isilon OneFS (^/onefs/branches/BR_8_0_0_DEV@r507595) Submitted by: Thor Steingrimsson Sponsored by: Dell EMC Isilon Modified: head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/snmpd.h head/contrib/bsnmp/snmpd/trans_lsock.c head/contrib/bsnmp/snmpd/trans_udp.c head/contrib/bsnmp/snmpd/trans_udp.h Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Wed Dec 28 03:56:25 2016 (r310654) +++ head/contrib/bsnmp/snmpd/main.c Wed Dec 28 04:29:09 2016 (r310655) @@ -1040,10 +1040,8 @@ snmpd_input(struct port_input *pi, struc #ifdef USE_TCPWRAPPERS char client[16]; #endif - struct msghdr msg; - struct iovec iov[1]; - ret = tport->transport->vtab->recv(pi); + ret = tport->transport->vtab->recv(tport, pi); if (ret == -1) return (-1); @@ -1186,21 +1184,15 @@ snmpd_input(struct port_input *pi, struc sndbuf, &sndlen, "SNMP", ierr, vi, NULL); if (ferr == SNMPD_INPUT_OK) { - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_flags = 0; - iov[0].iov_base = sndbuf; - iov[0].iov_len = sndlen; - - slen = sendmsg(pi->fd, &msg, 0); + slen = tport->transport->vtab->send(tport, sndbuf, sndlen, + pi->peer, pi->peerlen); if (slen == -1) - syslog(LOG_ERR, "sendmsg: %m"); + syslog(LOG_ERR, "send*: %m"); else if ((size_t)slen != sndlen) - syslog(LOG_ERR, "sendmsg: short write %zu/%zu", - sndlen, (size_t)slen); + syslog(LOG_ERR, "send*: short write %zu/%zu", sndlen, + (size_t)slen); } + snmp_pdu_free(&pdu); free(sndbuf); snmp_input_consume(pi); Modified: head/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- head/contrib/bsnmp/snmpd/snmpd.h Wed Dec 28 03:56:25 2016 (r310654) +++ head/contrib/bsnmp/snmpd/snmpd.h Wed Dec 28 04:29:09 2016 (r310655) @@ -193,7 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); - ssize_t (*recv)(struct port_input *); + ssize_t (*recv)(struct tport *, struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: head/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_lsock.c Wed Dec 28 03:56:25 2016 (r310654) +++ head/contrib/bsnmp/snmpd/trans_lsock.c Wed Dec 28 04:29:09 2016 (r310655) @@ -59,7 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t lsock_recv(struct port_input *); +static ssize_t lsock_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -444,7 +444,7 @@ check_priv_stream(struct port_input *pi) * Receive something */ static ssize_t -lsock_recv(struct port_input *pi) +lsock_recv(struct tport *tp __unused, struct port_input *pi) { struct msghdr msg; struct iovec iov[1]; Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Wed Dec 28 03:56:25 2016 (r310654) +++ head/contrib/bsnmp/snmpd/trans_udp.c Wed Dec 28 04:29:09 2016 (r310655) @@ -55,7 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t udp_recv(struct port_input *); +static ssize_t udp_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -217,8 +217,30 @@ udp_send(struct tport *tp, const u_char const struct sockaddr *addr, size_t addrlen) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsg; + struct in_addr *src_addr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct iovec iov; - return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); + iov.iov_base = __DECONST(void*, buf); + iov.iov_len = len; + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_name = __DECONST(void *, addr); + msg.msg_namelen = addrlen; + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); + memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + + return (sendmsg(p->input.fd, &msg, 0)); } static void @@ -309,8 +331,9 @@ recv_dgram(struct port_input *pi, struct * Receive something */ static ssize_t -udp_recv(struct port_input *pi) +udp_recv(struct tport *tp, struct port_input *pi) { + struct udp_port *p = (struct udp_port *)tp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; @@ -330,6 +353,8 @@ udp_recv(struct port_input *pi) ret = recv_dgram(pi, laddr); + memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); + if (laddr->s_addr == INADDR_ANY) { msg.msg_control = NULL; msg.msg_controllen = 0; Modified: head/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.h Wed Dec 28 03:56:25 2016 (r310654) +++ head/contrib/bsnmp/snmpd/trans_udp.h Wed Dec 28 04:29:09 2016 (r310655) @@ -39,6 +39,7 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ + struct in_addr recv_addr; /* the address the request was sent to */ }; /* argument for open call */ From owner-svn-src-all@freebsd.org Wed Dec 28 04:31:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E546C90F0B; Wed, 28 Dec 2016 04:31:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E21DA1239; Wed, 28 Dec 2016 04:31:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4V8PD088303; Wed, 28 Dec 2016 04:31:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4V8hA088302; Wed, 28 Dec 2016 04:31:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280431.uBS4V8hA088302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 04:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310656 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:31:09 -0000 Author: ngie Date: Wed Dec 28 04:31:07 2016 New Revision: 310656 URL: https://svnweb.freebsd.org/changeset/base/310656 Log: style(9): sort alignment in udp_recv(..) MFC after: 3 weeks Modified: head/contrib/bsnmp/snmpd/trans_udp.c Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Wed Dec 28 04:29:09 2016 (r310655) +++ head/contrib/bsnmp/snmpd/trans_udp.c Wed Dec 28 04:31:07 2016 (r310656) @@ -334,10 +334,10 @@ static ssize_t udp_recv(struct tport *tp, struct port_input *pi) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsgp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; ssize_t ret; memset(cbuf, 0, sizeof(cbuf)); From owner-svn-src-all@freebsd.org Wed Dec 28 04:35:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DC6FC910E0; Wed, 28 Dec 2016 04:35:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9EE9164F; Wed, 28 Dec 2016 04:35:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4Zqhk089214; Wed, 28 Dec 2016 04:35:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4Zqk3089213; Wed, 28 Dec 2016 04:35:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612280435.uBS4Zqk3089213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 28 Dec 2016 04:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310657 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:35:54 -0000 Author: sephe Date: Wed Dec 28 04:35:52 2016 New Revision: 310657 URL: https://svnweb.freebsd.org/changeset/base/310657 Log: hyperv/hn: Function renaming; no functional changes. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8908 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Dec 28 04:31:07 2016 (r310656) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Dec 28 04:35:52 2016 (r310657) @@ -333,7 +333,7 @@ static void hn_link_status(struct hn_s static int hn_create_rx_data(struct hn_softc *, int); static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); -static int hn_set_rxfilter(struct hn_softc *); +static int hn_rxfilter_config(struct hn_softc *); #ifndef RSS static int hn_rss_reconfig(struct hn_softc *); #endif @@ -684,7 +684,7 @@ do { \ #endif /* INET6 || INET */ static int -hn_set_rxfilter(struct hn_softc *sc) +hn_rxfilter_config(struct hn_softc *sc) { struct ifnet *ifp = sc->hn_ifp; uint32_t filter; @@ -2431,7 +2431,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, * reply. */ HN_NO_SLEEPING(sc); - hn_set_rxfilter(sc); + hn_rxfilter_config(sc); HN_SLEEPING_OK(sc); } else { hn_init_locked(sc); @@ -2508,7 +2508,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, * the RNDIS reply. */ HN_NO_SLEEPING(sc); - hn_set_rxfilter(sc); + hn_rxfilter_config(sc); HN_SLEEPING_OK(sc); } @@ -2566,7 +2566,7 @@ hn_init_locked(struct hn_softc *sc) return; /* Configure RX filter */ - hn_set_rxfilter(sc); + hn_rxfilter_config(sc); /* Clear OACTIVE bit. */ atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); @@ -4925,7 +4925,7 @@ hn_resume_data(struct hn_softc *sc) /* * Re-enable RX. */ - hn_set_rxfilter(sc); + hn_rxfilter_config(sc); /* * Make sure to clear suspend status on "all" TX rings, From owner-svn-src-all@freebsd.org Wed Dec 28 04:47:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F95C9136A; Wed, 28 Dec 2016 04:47:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 147FD1BCB; Wed, 28 Dec 2016 04:47:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4lHqQ093641; Wed, 28 Dec 2016 04:47:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4lHok093639; Wed, 28 Dec 2016 04:47:17 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612280447.uBS4lHok093639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 28 Dec 2016 04:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310658 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:47:18 -0000 Author: sephe Date: Wed Dec 28 04:47:17 2016 New Revision: 310658 URL: https://svnweb.freebsd.org/changeset/base/310658 Log: hyperv/hn: Factor out function to set rxfilter. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8928 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Dec 28 04:35:52 2016 (r310657) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Dec 28 04:47:17 2016 (r310658) @@ -333,6 +333,7 @@ static void hn_link_status(struct hn_s static int hn_create_rx_data(struct hn_softc *, int); static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); +static int hn_set_rxfilter(struct hn_softc *, uint32_t); static int hn_rxfilter_config(struct hn_softc *); #ifndef RSS static int hn_rss_reconfig(struct hn_softc *); @@ -684,11 +685,25 @@ do { \ #endif /* INET6 || INET */ static int +hn_set_rxfilter(struct hn_softc *sc, uint32_t filter) +{ + int error = 0; + + HN_LOCK_ASSERT(sc); + + if (sc->hn_rx_filter != filter) { + error = hn_rndis_set_rxfilter(sc, filter); + if (!error) + sc->hn_rx_filter = filter; + } + return (error); +} + +static int hn_rxfilter_config(struct hn_softc *sc) { struct ifnet *ifp = sc->hn_ifp; uint32_t filter; - int error = 0; HN_LOCK_ASSERT(sc); @@ -703,13 +718,7 @@ hn_rxfilter_config(struct hn_softc *sc) !TAILQ_EMPTY(&ifp->if_multiaddrs)) filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; } - - if (sc->hn_rx_filter != filter) { - error = hn_rndis_set_rxfilter(sc, filter); - if (!error) - sc->hn_rx_filter = filter; - } - return (error); + return (hn_set_rxfilter(sc, filter)); } static void @@ -4817,8 +4826,7 @@ hn_suspend_data(struct hn_softc *sc) /* * Disable RX by clearing RX filter. */ - sc->hn_rx_filter = NDIS_PACKET_TYPE_NONE; - hn_rndis_set_rxfilter(sc, sc->hn_rx_filter); + hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); /* * Give RNDIS enough time to flush all pending data packets. From owner-svn-src-all@freebsd.org Wed Dec 28 04:48:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77DACC9141B; Wed, 28 Dec 2016 04:48:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38A051D58; Wed, 28 Dec 2016 04:48:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4mUp8093736; Wed, 28 Dec 2016 04:48:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4mUqI093734; Wed, 28 Dec 2016 04:48:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612280448.uBS4mUqI093734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 28 Dec 2016 04:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310659 - in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:48:31 -0000 Author: kib Date: Wed Dec 28 04:48:30 2016 New Revision: 310659 URL: https://svnweb.freebsd.org/changeset/base/310659 Log: MFC r304957, r304958, r306310 (by bde): Fix vm86 initialization. MFC r310050: Improve very early trap handling on amd64. Modified: stable/11/sys/amd64/amd64/machdep.c stable/11/sys/i386/i386/machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Wed Dec 28 04:47:17 2016 (r310658) +++ stable/11/sys/amd64/amd64/machdep.c Wed Dec 28 04:48:30 2016 (r310659) @@ -1506,6 +1506,16 @@ native_parse_preload_data(u_int64_t modu return (kmdp); } +static void +amd64_kdb_init(void) +{ + kdb_init(); +#ifdef KDB + if (boothowto & RB_KDB) + kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); +#endif +} + u_int64_t hammer_time(u_int64_t modulep, u_int64_t physfree) { @@ -1517,6 +1527,7 @@ hammer_time(u_int64_t modulep, u_int64_t u_int64_t msr; char *env; size_t kstack0_sz; + int late_console; /* * This may be done better later if it gets more high level @@ -1561,6 +1572,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree += DPCPU_SIZE; PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); + /* Non-late cninit() and printf() can be moved up to here. */ PCPU_SET(tssp, &common_tss[0]); PCPU_SET(commontssp, &common_tss[0]); PCPU_SET(tss, (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); @@ -1660,12 +1672,36 @@ hammer_time(u_int64_t modulep, u_int64_t wrmsr(MSR_STAR, msr); wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D); + /* + * Temporary forge some valid pointer to PCB, for exception + * handlers. It is reinitialized properly below after FPU is + * set up. Also set up td_critnest to short-cut the page + * fault handler. + */ + cpu_max_ext_state_size = sizeof(struct savefpu); + thread0.td_pcb = get_pcb_td(&thread0); + thread0.td_critnest = 1; + + /* + * The console and kdb should be initialized even earlier than here, + * but some console drivers don't work until after getmemsize(). + * Default to late console initialization to support these drivers. + * This loses mainly printf()s in getmemsize() and early debugging. + */ + late_console = 1; + TUNABLE_INT_FETCH("debug.late_console", &late_console); + if (!late_console) { + cninit(); + amd64_kdb_init(); + } + getmemsize(kmdp, physfree); init_param2(physmem); /* now running on new page tables, configured,and u/iom is accessible */ - cninit(); + if (late_console) + cninit(); #ifdef DEV_ISA #ifdef DEV_ATPIC @@ -1686,13 +1722,8 @@ hammer_time(u_int64_t modulep, u_int64_t #error "have you forgotten the isa device?"; #endif - kdb_init(); - -#ifdef KDB - if (boothowto & RB_KDB) - kdb_enter(KDB_WHY_BOOTFLAGS, - "Boot flags requested debugger"); -#endif + if (late_console) + amd64_kdb_init(); msgbufinit(msgbufp, msgbufsize); fpuinit(); @@ -1741,6 +1772,7 @@ hammer_time(u_int64_t modulep, u_int64_t #ifdef FDT x86_init_fdt(); #endif + thread0.td_critnest = 0; /* Location of kernel stack for locore */ return ((u_int64_t)thread0.td_pcb); Modified: stable/11/sys/i386/i386/machdep.c ============================================================================== --- stable/11/sys/i386/i386/machdep.c Wed Dec 28 04:47:17 2016 (r310658) +++ stable/11/sys/i386/i386/machdep.c Wed Dec 28 04:48:30 2016 (r310659) @@ -2089,7 +2089,6 @@ getmemsize(int first) * use that and do not make any VM86 calls. */ physmap_idx = 0; - smapbase = NULL; kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf32 kernel"); @@ -2223,6 +2222,9 @@ physmap_done: * highest page of the physical address space. It should be * called something like "Maxphyspage". We may adjust this * based on ``hw.physmem'' and the results of the memory test. + * + * This is especially confusing when it is much larger than the + * memory size and is displayed as "realmem". */ Maxmem = atop(physmap[physmap_idx + 1]); @@ -2428,6 +2430,19 @@ do_next: } #endif /* PC98 */ +static void +i386_kdb_init(void) +{ +#ifdef DDB + db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab); +#endif + kdb_init(); +#ifdef KDB + if (boothowto & RB_KDB) + kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); +#endif +} + register_t init386(first) int first; @@ -2438,6 +2453,7 @@ init386(first) #ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; #endif + int late_console; thread0.td_kstack = proc0kstack; thread0.td_kstack_pages = TD0_KSTACK_PAGES; @@ -2502,6 +2518,7 @@ init386(first) first += DPCPU_SIZE; PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); + /* Non-late cninit() and printf() can be moved up to here. */ /* * Initialize mutexes. @@ -2636,20 +2653,17 @@ init386(first) dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); dblfault_tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL); - vm86_initialize(); - getmemsize(first); - init_param2(physmem); - - /* now running on new page tables, configured,and u/iom is accessible */ - - /* - * Initialize the console before we print anything out. - */ - cninit(); - - if (metadata_missing) - printf("WARNING: loader(8) metadata is missing!\n"); + /* Initialize the tss (except for the final esp0) early for vm86. */ + PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE - 16); + PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); + gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); + PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); + PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); + PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); + ltr(gsel_tss); + /* Initialize the PIC early for vm86 calls. */ #ifdef DEV_ISA #ifdef DEV_ATPIC #ifndef PC98 @@ -2671,16 +2685,33 @@ init386(first) #endif #endif -#ifdef DDB - db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab); -#endif + /* + * The console and kdb should be initialized even earlier than here, + * but some console drivers don't work until after getmemsize(). + * Default to late console initialization to support these drivers. + * This loses mainly printf()s in getmemsize() and early debugging. + */ + late_console = 1; + TUNABLE_INT_FETCH("debug.late_console", &late_console); + if (!late_console) { + cninit(); + i386_kdb_init(); + } - kdb_init(); + vm86_initialize(); + getmemsize(first); + init_param2(physmem); -#ifdef KDB - if (boothowto & RB_KDB) - kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); -#endif + /* now running on new page tables, configured,and u/iom is accessible */ + + if (late_console) + cninit(); + + if (metadata_missing) + printf("WARNING: loader(8) metadata is missing!\n"); + + if (late_console) + i386_kdb_init(); msgbufinit(msgbufp, msgbufsize); #ifdef DEV_NPX @@ -2701,14 +2732,10 @@ init386(first) } #endif PCPU_SET(curpcb, thread0.td_pcb); - /* make an initial tss so cpu can get interrupt stack on syscall! */ + /* Move esp0 in the tss to its final place. */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ PCPU_SET(common_tss.tss_esp0, (vm_offset_t)thread0.td_pcb - 16); - PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); - gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); - PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); - PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); + gdt[GPROC0_SEL].sd.sd_type = SDT_SYS386TSS; /* clear busy bit */ ltr(gsel_tss); /* make a call gate to reenter kernel with */ From owner-svn-src-all@freebsd.org Wed Dec 28 04:53:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8BC0C915F4; Wed, 28 Dec 2016 04:53:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B84321164; Wed, 28 Dec 2016 04:53:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4rqZQ097694; Wed, 28 Dec 2016 04:53:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4rqen097693; Wed, 28 Dec 2016 04:53:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280453.uBS4rqen097693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 04:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310660 - head/contrib/bsnmp/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:53:54 -0000 Author: ngie Date: Wed Dec 28 04:53:52 2016 New Revision: 310660 URL: https://svnweb.freebsd.org/changeset/base/310660 Log: style(9): fix whitespace in pdu_encode_secparams(..) MFC after: 3 days Modified: head/contrib/bsnmp/lib/snmp.c Modified: head/contrib/bsnmp/lib/snmp.c ============================================================================== --- head/contrib/bsnmp/lib/snmp.c Wed Dec 28 04:48:30 2016 (r310659) +++ head/contrib/bsnmp/lib/snmp.c Wed Dec 28 04:53:52 2016 (r310660) @@ -357,8 +357,8 @@ static enum snmp_code pdu_encode_secparams(struct asn_buf *b, struct snmp_pdu *pdu) { u_char buf[256], *sptr; - struct asn_buf tb; - size_t auth_off, moved = 0; + struct asn_buf tb; + size_t auth_off, moved = 0; auth_off = 0; memset(buf, 0, 256); From owner-svn-src-all@freebsd.org Wed Dec 28 04:55:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C30FC916D0; Wed, 28 Dec 2016 04:55:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD75130D; Wed, 28 Dec 2016 04:55:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4thbe097846; Wed, 28 Dec 2016 04:55:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4thlR097845; Wed, 28 Dec 2016 04:55:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612280455.uBS4thlR097845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Dec 2016 04:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310661 - head/sys/boot/i386/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:55:44 -0000 Author: emaste Date: Wed Dec 28 04:55:43 2016 New Revision: 310661 URL: https://svnweb.freebsd.org/changeset/base/310661 Log: loader: use strip -o instead of cp and strip in place It is simpler and cleaner to have strip produce the stripped output directly than copying the input to the output first. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/i386/loader/Makefile Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Wed Dec 28 04:53:52 2016 (r310660) +++ head/sys/boot/i386/loader/Makefile Wed Dec 28 04:55:43 2016 (r310661) @@ -99,8 +99,7 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTX -b ${BTXKERN} ${LOADER}.bin ${LOADER}.bin: ${LOADER}.sym - cp ${.ALLSRC} ${.TARGET} - strip -R .comment -R .note ${.TARGET} + strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} loader.help: help.common help.i386 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} From owner-svn-src-all@freebsd.org Wed Dec 28 04:56:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D03FC91786; Wed, 28 Dec 2016 04:56:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CBD214D2; Wed, 28 Dec 2016 04:56:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS4uFJV097921; Wed, 28 Dec 2016 04:56:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS4uFHs097920; Wed, 28 Dec 2016 04:56:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280456.uBS4uFHs097920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 04:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310662 - head/contrib/bsnmp/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 04:56:16 -0000 Author: ngie Date: Wed Dec 28 04:56:15 2016 New Revision: 310662 URL: https://svnweb.freebsd.org/changeset/base/310662 Log: style(9): snmp_send_packet(..): fix whitespace MFC after: 3 days Modified: head/contrib/bsnmp/lib/snmpclient.c Modified: head/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- head/contrib/bsnmp/lib/snmpclient.c Wed Dec 28 04:55:43 2016 (r310661) +++ head/contrib/bsnmp/lib/snmpclient.c Wed Dec 28 04:56:15 2016 (r310662) @@ -1227,9 +1227,9 @@ snmp_next_reqid(struct snmp_client * c) static int32_t snmp_send_packet(struct snmp_pdu * pdu) { - u_char *buf; - struct asn_buf b; - ssize_t ret; + u_char *buf; + struct asn_buf b; + ssize_t ret; if ((buf = malloc(snmp_client.txbuflen)) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); From owner-svn-src-all@freebsd.org Wed Dec 28 05:05:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32F04C919AB; Wed, 28 Dec 2016 05:05:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 029E51949; Wed, 28 Dec 2016 05:05:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS559Nb002081; Wed, 28 Dec 2016 05:05:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS559rZ002080; Wed, 28 Dec 2016 05:05:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280505.uBS559rZ002080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 05:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310663 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 05:05:10 -0000 Author: ngie Date: Wed Dec 28 05:05:08 2016 New Revision: 310663 URL: https://svnweb.freebsd.org/changeset/base/310663 Log: style(9): ip_get(..): clean up whitespace MFC after: 3 days Modified: head/contrib/bsnmp/snmpd/export.c Modified: head/contrib/bsnmp/snmpd/export.c ============================================================================== --- head/contrib/bsnmp/snmpd/export.c Wed Dec 28 04:56:15 2016 (r310662) +++ head/contrib/bsnmp/snmpd/export.c Wed Dec 28 05:05:08 2016 (r310663) @@ -194,6 +194,7 @@ ip_get(struct snmp_value *value, u_char value->v.ipaddress[1] = valp[1]; value->v.ipaddress[2] = valp[2]; value->v.ipaddress[3] = valp[3]; + return (SNMP_ERR_NOERROR); } From owner-svn-src-all@freebsd.org Wed Dec 28 05:16:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C753FC91CE6; Wed, 28 Dec 2016 05:16:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8930E1049; Wed, 28 Dec 2016 05:16:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS5Gfnx006672; Wed, 28 Dec 2016 05:16:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS5Gfxl006670; Wed, 28 Dec 2016 05:16:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280516.uBS5Gfxl006670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 05:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310664 - in head: tools/build/mk usr.sbin/bsnmpd/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 05:16:42 -0000 Author: ngie Date: Wed Dec 28 05:16:41 2016 New Revision: 310664 URL: https://svnweb.freebsd.org/changeset/base/310664 Log: Only build/install usr.sbin/bsnmpd/modules/snmp_wlan if MK_WIRELESS != no MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/bsnmpd/modules/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 05:05:08 2016 (r310663) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 05:16:41 2016 (r310664) @@ -9021,6 +9021,12 @@ OLD_FILES+=usr/share/man/man8/wlandebug. OLD_FILES+=usr/share/man/man8/wpa_cli.8.gz OLD_FILES+=usr/share/man/man8/wpa_passphrase.8.gz OLD_FILES+=usr/share/man/man8/wpa_supplicant.8.gz +OLD_FILES+=usr/lib/snmp_wlan.so +OLD_LIBS+=usr/lib/snmp_wlan.so.6 +# bsnmp module +OLD_FILES+=usr/share/man/man3/snmp_wlan.3.gz +OLD_FILES+=usr/share/snmp/defs/wlan_tree.def +OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-WIRELESS-MIB.txt .endif .if ${MK_SVNLITE} == no || ${MK_SVN} == yes Modified: head/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile Wed Dec 28 05:05:08 2016 (r310663) +++ head/usr.sbin/bsnmpd/modules/Makefile Wed Dec 28 05:16:41 2016 (r310664) @@ -17,7 +17,6 @@ SUBDIR= ${_snmp_atm} \ snmp_target \ snmp_usm \ snmp_vacm \ - snmp_wlan .if ${MK_PF} != "no" SUBDIR+=snmp_pf @@ -27,6 +26,10 @@ SUBDIR+=snmp_pf SUBDIR+=snmp_netgraph .endif +.if ${MK_WIRELESS} != "no" +SUBDIR+=snmp_wlan +.endif + INCS= snmpmod.h INCSDIR= ${INCLUDEDIR}/bsnmp From owner-svn-src-all@freebsd.org Wed Dec 28 05:21:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D024C92078; Wed, 28 Dec 2016 05:21:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 458151322; Wed, 28 Dec 2016 05:21:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS5LMvW007576; Wed, 28 Dec 2016 05:21:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS5LMrT007574; Wed, 28 Dec 2016 05:21:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280521.uBS5LMrT007574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 05:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310665 - in head: tools/build/mk usr.sbin/bsnmpd/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 05:21:23 -0000 Author: ngie Date: Wed Dec 28 05:21:22 2016 New Revision: 310665 URL: https://svnweb.freebsd.org/changeset/base/310665 Log: Only build/install usr.sbin/bsnmpd/modules/snmp_hast if MK_HAST != no MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/bsnmpd/modules/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 05:16:41 2016 (r310664) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 05:21:22 2016 (r310665) @@ -3004,6 +3004,12 @@ OLD_FILES+=usr/share/man/man5/hast.conf. OLD_FILES+=usr/share/man/man8/hastctl.8.gz OLD_FILES+=usr/share/man/man8/hastd.8.gz OLD_DIRS+=usr/share/examples/hast +# bsnmp +OLD_FILES+=usr/lib/snmp_hast.so +OLD_LIBS+=usr/lib/snmp_hast.so.6 +OLD_FILES+=usr/share/man/man3/snmp_hast.3.gz +OLD_FILES+=usr/share/snmp/defs/hast_tree.def +OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-HAST-MIB.txt .endif .if ${MK_HESIOD} == no Modified: head/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile Wed Dec 28 05:16:41 2016 (r310664) +++ head/usr.sbin/bsnmpd/modules/Makefile Wed Dec 28 05:21:22 2016 (r310665) @@ -10,7 +10,6 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ - snmp_hast \ snmp_hostres \ snmp_lm75 \ snmp_mibII \ @@ -18,6 +17,10 @@ SUBDIR= ${_snmp_atm} \ snmp_usm \ snmp_vacm \ +.if ${MK_HAST} != "no" +SUBDIR+=snmp_hast +.endif + .if ${MK_PF} != "no" SUBDIR+=snmp_pf .endif From owner-svn-src-all@freebsd.org Wed Dec 28 05:41:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25CA0C9240F; Wed, 28 Dec 2016 05:41:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA47F1E6E; Wed, 28 Dec 2016 05:41:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS5fsot018290; Wed, 28 Dec 2016 05:41:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS5frw9018284; Wed, 28 Dec 2016 05:41:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280541.uBS5frw9018284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 05:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310666 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 05:41:55 -0000 Author: ngie Date: Wed Dec 28 05:41:53 2016 New Revision: 310666 URL: https://svnweb.freebsd.org/changeset/base/310666 Log: style(9) fixes - Clean up trailing whitespace - Fix variable type alignment in storage_OS_get_swap(..) MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Wed Dec 28 05:21:22 2016 (r310665) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Wed Dec 28 05:41:53 2016 (r310666) @@ -123,7 +123,7 @@ device_entry_create(const char *name, co if (map == NULL) { /* new object - get a new index */ if (next_device_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrDeviceTable index wrap", __func__); /* There isn't much we can do here. * If the next_swins_index is consumed Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Wed Dec 28 05:21:22 2016 (r310665) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Wed Dec 28 05:41:53 2016 (r310666) @@ -131,7 +131,7 @@ static const struct { const struct asn_oid *oid; /* the OID to return */ } fs_type_map[] = { { "ufs", &OIDX_hrFSBerkeleyFFS_c }, - { "zfs", &OIDX_hrFSOther_c }, + { "zfs", &OIDX_hrFSOther_c }, { "cd9660", &OIDX_hrFSiso9660_c }, { "nfs", &OIDX_hrFSNFS_c }, { "ext2fs", &OIDX_hrFSLinuxExt2_c }, @@ -167,7 +167,7 @@ fs_entry_create(const char *name) /* new object - get a new index */ if (next_fs_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); + syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); errx(EX_SOFTWARE, "hrFSTable index wrap"); } Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Wed Dec 28 05:21:22 2016 (r310665) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Wed Dec 28 05:41:53 2016 (r310666) @@ -177,7 +177,7 @@ partition_entry_create(int32_t ds_index, if (next_partition_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrPartitionTable index wrap", + syslog(LOG_ERR, "%s: hrPartitionTable index wrap", __func__); errx(EX_SOFTWARE, "hrPartitionTable index wrap"); } Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Dec 28 05:21:22 2016 (r310665) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Dec 28 05:41:53 2016 (r310666) @@ -193,7 +193,7 @@ OS_getSystemInitialLoadParameters(u_char syslog(LOG_ERR, "malloc failed"); return (SNMP_ERR_GENERR); } - if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { + if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { syslog(LOG_ERR, "sysctl({CTL_KERN,KERN_BOOTFILE}) failed: %m"); free(buf); @@ -296,7 +296,7 @@ OS_getMemorySize(uint32_t *ms) *ms = UINT32_MAX; else *ms = phys_mem_size; - return (SNMP_ERR_NOERROR); + return (SNMP_ERR_NOERROR); } /* @@ -360,7 +360,7 @@ OS_setSystemDate(const struct timeval *t if (settimeofday(timeval_to_set, NULL) == -1) { syslog(LOG_ERR, "settimeofday failed: %m"); return (SNMP_ERR_GENERR); - } + } return (SNMP_ERR_NOERROR); } @@ -378,7 +378,7 @@ op_hrSystem(struct snmp_context *ctx, st switch (curr_op) { - case SNMP_OP_GET: + case SNMP_OP_GET: switch (value->var.subs[sub - 1]) { case LEAF_hrSystemUptime: Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Wed Dec 28 05:21:22 2016 (r310665) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Wed Dec 28 05:41:53 2016 (r310666) @@ -163,7 +163,7 @@ hostres_start(void) start_processor_tbl(hostres_module); start_network_tbl(); - HRDBG("done."); + HRDBG("done."); } /* this identifies the HOST RESOURCES mib module */ @@ -175,8 +175,8 @@ const struct snmp_module config = { NULL, NULL, hostres_start, - NULL, /* proxy a PDU */ - hostres_ctree, /* see the generated hostres_tree.h */ + NULL, /* proxy a PDU */ + hostres_ctree, /* see the generated hostres_tree.h */ hostres_CTREE_SIZE, /* see the generated hostres_tree.h */ NULL }; Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Wed Dec 28 05:21:22 2016 (r310665) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Wed Dec 28 05:41:53 2016 (r310666) @@ -153,7 +153,7 @@ storage_entry_create(const char *name) if (map == NULL) { /* new object - get a new index */ if (next_storage_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrStorageTable index wrap", __func__); errx(EX_SOFTWARE, "hrStorageTable index wrap"); } @@ -188,7 +188,7 @@ storage_entry_create(const char *name) syslog(LOG_WARNING, "%s: %m", __func__); return (NULL); } - memset(entry, 0, sizeof(*entry)); + memset(entry, 0, sizeof(*entry)); entry->index = map->hrIndex; @@ -374,10 +374,10 @@ storage_OS_get_memstat(void) static void storage_OS_get_swap(void) { - int nswapdev = 0; - size_t len = sizeof(nswapdev); struct storage_entry *entry; char swap_w_prefix[SE_DESC_MLEN]; + size_t len = sizeof(nswapdev); + int nswapdev = 0; if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) { syslog(LOG_ERR, Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Wed Dec 28 05:21:22 2016 (r310665) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Wed Dec 28 05:41:53 2016 (r310666) @@ -50,7 +50,7 @@ #include "hostres_oid.h" #include "hostres_tree.h" -#define CONTENTS_FNAME "+CONTENTS" +#define CONTENTS_FNAME "+CONTENTS" enum SWInstalledType { SWI_UNKNOWN = 1, @@ -136,7 +136,7 @@ swins_entry_create(const char *name) size_t name_len; /* new object - get a new index */ if (next_swins_index > INT_MAX) { - syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", + syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", __func__ ); /* There isn't much we can do here. * If the next_swins_index is consumed @@ -292,7 +292,7 @@ swins_get_packages(void) struct stat sb; DIR *p_dir; struct dirent *ent; - struct tm k_ts; + struct tm k_ts; char *pkg_file; struct swins_entry *entry; int ret = 0; @@ -327,7 +327,7 @@ swins_get_packages(void) return (-1); } - while (errno = 0, (ent = readdir(p_dir)) != NULL) { + while (errno = 0, (ent = readdir(p_dir)) != NULL) { HRDBG(" pkg file: %s", ent->d_name); /* check that the contents file is a regular file */ @@ -371,7 +371,7 @@ swins_get_packages(void) entry->type = (int32_t)SWI_APPLICATION; entry->date_len = make_date_time(entry->date, &k_ts, 0); - } + } if (errno != 0) { syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:" From owner-svn-src-all@freebsd.org Wed Dec 28 05:42:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FDBEC925ED; Wed, 28 Dec 2016 05:42:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F559105C; Wed, 28 Dec 2016 05:42:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS5gfnO019220; Wed, 28 Dec 2016 05:42:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS5gfj8019219; Wed, 28 Dec 2016 05:42:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280542.uBS5gfj8019219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 05:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310667 - head/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 05:42:42 -0000 Author: ngie Date: Wed Dec 28 05:42:41 2016 New Revision: 310667 URL: https://svnweb.freebsd.org/changeset/base/310667 Log: style(9) fixes: clean up leading whitespace MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Wed Dec 28 05:41:53 2016 (r310666) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Wed Dec 28 05:42:41 2016 (r310667) @@ -1472,7 +1472,7 @@ bridge_do_pfctl(int32_t bridge_ctl, enum } else s_len = 0; - len = sizeof(i); + len = sizeof(i); strcpy(mib_name, bridge_sysctl); From owner-svn-src-all@freebsd.org Wed Dec 28 05:43:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 345AFC9265B; Wed, 28 Dec 2016 05:43:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 041B011D7; Wed, 28 Dec 2016 05:43:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS5hFMc019285; Wed, 28 Dec 2016 05:43:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS5hFQj019284; Wed, 28 Dec 2016 05:43:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280543.uBS5hFQj019284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 05:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310668 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 05:43:16 -0000 Author: ngie Date: Wed Dec 28 05:43:14 2016 New Revision: 310668 URL: https://svnweb.freebsd.org/changeset/base/310668 Log: style(9) fixes: clean up leading whitespace MFC after: 3 days Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Dec 28 05:42:41 2016 (r310667) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Dec 28 05:43:14 2016 (r310668) @@ -1090,6 +1090,7 @@ snmp_ip2asn_oid(char *str, struct asn_oi char *endptr, *ptr; ptr = str; + for (i = 0; i < 4; i++) { v = strtoul(ptr, &endptr, 10); if (v > 0xff) From owner-svn-src-all@freebsd.org Wed Dec 28 05:50:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33FC5C927EC; Wed, 28 Dec 2016 05:50:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wj0-x241.google.com (mail-wj0-x241.google.com [IPv6:2a00:1450:400c:c01::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD5B2142F; Wed, 28 Dec 2016 05:50:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wj0-x241.google.com with SMTP id hb5so20146502wjc.2; Tue, 27 Dec 2016 21:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tTBsUyC/ATHDANXIUrVm0CJxWmQ2yX7avsB/X5sP6K0=; b=TA6DWbV3Hvca6ag4Yj0T2oLN9RjF+UGG/LH3xva3/AuBqfqS3lE6oCaCGB5FCpNDcm RAcmgChjPE8n5NltDIqcp+P6gkXAq6mzZqG9e241BSda6+P4VAQFhtG9ZGfvm6eyjYsi srRHnWwa6BMVvGoX4mZ1CZNcPJZvhAdGi14+ZDxk1cWsiDeHxmfsfcAVwbBhkqgdC0XC pEUUB2vFa4KSJW9jCTbWPmovWksnlC8xaU2vpvG3cXSZ9cI3Bh+vCEzGAbuU/u1Ugoo8 M3T2co5nle4L9hli0cdijPhhrWNOYOLab46awf2v+gQWCcScw2xKYHxu3JO5DuBJ9RLM jsXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tTBsUyC/ATHDANXIUrVm0CJxWmQ2yX7avsB/X5sP6K0=; b=YykA1diOHN9Qcx76MPt9VrRhvf8q11E6gPJSVzjfXcZs+EX+VhBuUTrs//ctjJc+vM KWpYxDNxfjZddgvvL9NvcKthrneLeVWjxW6tQ1Lz33UMukmRoTMPh6TwuXlm+RrmkZpP 9fW3V2ttAJ60A6kfWLxQ/Ks4MwbpyhWQFmFiB89xrB8zgzx2Q/v7l/0GhtXIcNwHFl/7 tjaYuMzYlWdZST6lAJTi6tukdknUMWDMY7MaT7fnFf/AQt0KUuhtvlmf54JBCi6bqYRq wxunOb2mDIfvBRbVzSMfYMQIgD+PUYukKczJnyTVXm2uuCj2Ct8v2gwVC6Mvu+YL8Uin Ealg== X-Gm-Message-State: AIkVDXK+iTHAwiNmK/MTp12g+iPn324pBgpVcHumfd1sslFfLN3F4pnKSzSrWyqg8eOAFiK2+EKYAwREGKh8Rg== X-Received: by 10.194.67.67 with SMTP id l3mr33322622wjt.151.1482904233541; Tue, 27 Dec 2016 21:50:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.44.1 with HTTP; Tue, 27 Dec 2016 21:50:32 -0800 (PST) In-Reply-To: <201612280255.uBS2tQeR045512@repo.freebsd.org> References: <201612280255.uBS2tQeR045512@repo.freebsd.org> From: Adrian Chadd Date: Tue, 27 Dec 2016 21:50:32 -0800 Message-ID: Subject: Re: svn commit: r310650 - in head/sys/mips: include mips To: Alexander Kabaev Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 05:50:36 -0000 hiya, so I dug into the mips24k definition of this. It says this: " 3.4.3 Uncached accelerated writes The 24K core permits memory regions to be marked as =E2=80=9Cuncached accelerated=E2=80=9D. This type of region is useful to hard- ware which is =E2=80=9Cwrite only=E2=80=9D - perhaps video frame buffers, o= r some other hardware stream. Sequential word stores in such regions are gathered into cache-line-sized chunks, before being written with a single burst cycle on the CPU interface. Such regions are uncached for read, and partial-word or out-of-sequence writes have =E2=80=9Cunpredictable=E2=80=9D effects - don= =E2=80=99t do them. The burst write is normally performed when software writes to the last location in the memory block or does an uncached-accelerated write to some other block; but it can also be triggered by a sync instruction, a pref nudge, a matching load or any exception. If the block is not completely written by the time it=E2=80=99s pushed out, it will be written using a series of doubleword or smaller write cycles over the 24K core=E2=80=99s 64-bit memory interface. " So, question is - is our write combining page attribute in the VM suitable for this? Is it defined as "only do full sequential word writes"? Or do we risk having some other platform use it in a less "don't do this" way and then MIPS is the one at fault again? :) -adrian On 27 December 2016 at 18:55, Alexander Kabaev wrote: > Author: kan > Date: Wed Dec 28 02:55:26 2016 > New Revision: 310650 > URL: https://svnweb.freebsd.org/changeset/base/310650 > > Log: > Implement pmap_change_attr and related APIs on MIPS > > On platforms that have uncached-accelerate cache attribute, map it > to VM_MEMATTR_WRITE_COMBINING. Otherwise, leave write comining > undefined. > > Reviewed by: adrian, jhb (glance) > Differential Revision: https://reviews.freebsd.org/D8894 > > Modified: > head/sys/mips/include/cpuregs.h > head/sys/mips/include/pmap.h > head/sys/mips/include/pte.h > head/sys/mips/include/vm.h > head/sys/mips/mips/pmap.c > > Modified: head/sys/mips/include/cpuregs.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/include/cpuregs.h Tue Dec 27 23:56:46 2016 (= r310649) > +++ head/sys/mips/include/cpuregs.h Wed Dec 28 02:55:26 2016 (= r310650) > @@ -171,6 +171,10 @@ > #define MIPS_CCA_CACHED MIPS_CCA_CCS > #endif > > +#if defined(CPU_XBURST) > +#define MIPS_CCA_UA 0x01 > +#endif > + > #ifndef MIPS_CCA_UNCACHED > #define MIPS_CCA_UNCACHED MIPS_CCA_UC > #endif > @@ -188,6 +192,16 @@ > #endif > #endif > > +/* > + * Use uncached-accelerated mode for write-combining maps, if one is def= ined, > + * otherwise fall back to uncached > + */ > +#ifndef MIPS_CCA_WC > +#ifdef MIPS_CCA_UA > +#define MIPS_CCA_WC MIPS_CCA_UA > +#endif > +#endif > + > #define MIPS_PHYS_TO_XKPHYS(cca,x) \ > ((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x)) > #define MIPS_PHYS_TO_XKPHYS_CACHED(x) \ > > Modified: head/sys/mips/include/pmap.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/include/pmap.h Tue Dec 27 23:56:46 2016 (= r310649) > +++ head/sys/mips/include/pmap.h Wed Dec 28 02:55:26 2016 (= r310650) > @@ -74,7 +74,8 @@ struct md_page { > }; > > #define PV_TABLE_REF 0x02 /* referenced */ > -#define PV_MEMATTR_UNCACHEABLE 0x04 > +#define PV_MEMATTR_MASK 0xf0 /* store vm_memattr_t her= e */ > +#define PV_MEMATTR_SHIFT 0x04 > > #define ASID_BITS 8 > #define ASIDGEN_BITS (32 - ASID_BITS) > @@ -163,22 +164,24 @@ extern vm_offset_t virtual_end; > > extern vm_paddr_t dump_avail[PHYS_AVAIL_ENTRIES + 2]; > > -#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT > +#define pmap_page_get_memattr(m) (((m)->md.pv_flags & PV_MEMATTR_= MASK) >> PV_MEMATTR_SHIFT) > #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) > #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITE= ABLE) !=3D 0) > > void pmap_bootstrap(void); > void *pmap_mapdev(vm_paddr_t, vm_size_t); > +void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); > void pmap_unmapdev(vm_offset_t, vm_size_t); > vm_offset_t pmap_steal_memory(vm_size_t size); > void pmap_kenter(vm_offset_t va, vm_paddr_t pa); > -void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr); > +void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t attr); > void pmap_kremove(vm_offset_t va); > void *pmap_kenter_temporary(vm_paddr_t pa, int i); > void pmap_kenter_temporary_free(vm_paddr_t pa); > void pmap_flush_pvcache(vm_page_t m); > int pmap_emulate_modified(pmap_t pmap, vm_offset_t va); > void pmap_page_set_memattr(vm_page_t, vm_memattr_t); > +int pmap_change_attr(vm_offset_t, vm_size_t, vm_memattr_t); > > #endif /* _KERNEL */ > > > Modified: head/sys/mips/include/pte.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/include/pte.h Tue Dec 27 23:56:46 2016 (r310649) > +++ head/sys/mips/include/pte.h Wed Dec 28 02:55:26 2016 (r310650) > @@ -132,8 +132,10 @@ typedef pt_entry_t *pd_entry_t; > * it is matched. > */ > #define PTE_C(attr) ((attr & 0x07) << 3) > +#define PTE_C_MASK (PTE_C(0x07)) > #define PTE_C_UNCACHED (PTE_C(MIPS_CCA_UNCACHED)) > #define PTE_C_CACHE (PTE_C(MIPS_CCA_CACHED)) > +#define PTE_C_WC (PTE_C(MIPS_CCA_WC)) > #define PTE_D 0x04 > #define PTE_V 0x02 > #define PTE_G 0x01 > @@ -158,6 +160,7 @@ typedef pt_entry_t *pd_entry_t; > #define pte_clear(pte, bit) (*(pte) &=3D ~(bit)) > #define pte_set(pte, bit) (*(pte) |=3D (bit)) > #define pte_test(pte, bit) ((*(pte) & (bit)) =3D=3D (bit)) > +#define pte_cache_bits(pte) ((*(pte) >> 3) & 0x07) > > /* Assembly support for PTE access*/ > #ifdef LOCORE > > Modified: head/sys/mips/include/vm.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/include/vm.h Tue Dec 27 23:56:46 2016 (r310649) > +++ head/sys/mips/include/vm.h Wed Dec 28 02:55:26 2016 (r310650) > @@ -32,7 +32,11 @@ > #include > > /* Memory attributes. */ > -#define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)PTE_C_UNCACHED) > -#define VM_MEMATTR_DEFAULT ((vm_memattr_t)PTE_C_CACHE) > +#define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)MIPS_CCA_U= NCACHED) > +#define VM_MEMATTR_WRITE_BACK ((vm_memattr_t)MIPS_CCA_C= ACHED) > +#define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK > +#ifdef MIPS_CCA_WC > +#define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)MIPS_CCA_W= C) > +#endif > > #endif /* !_MACHINE_VM_H_ */ > > Modified: head/sys/mips/mips/pmap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/mips/pmap.c Tue Dec 27 23:56:46 2016 (r310649) > +++ head/sys/mips/mips/pmap.c Wed Dec 28 02:55:26 2016 (r310650) > @@ -189,10 +189,10 @@ static void pmap_update_page_action(void > * The highmem area does not have a KSEG0 mapping, and we need a mechani= sm to > * do temporary per-CPU mappings for pmap_zero_page, pmap_copy_page etc. > * > - * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pag= es. To > + * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pag= es. To > * access a highmem physical address on a CPU, we map the physical addre= ss to > - * the reserved virtual address for the CPU in the kernel pagetable. Th= is is > - * done with interrupts disabled(although a spinlock and sched_pin would= be > + * the reserved virtual address for the CPU in the kernel pagetable. Th= is is > + * done with interrupts disabled(although a spinlock and sched_pin would= be > * sufficient). > */ > struct local_sysmaps { > @@ -303,7 +303,7 @@ pmap_lmem_map2(vm_paddr_t phys1, vm_padd > return (0); > } > > -static __inline vm_offset_t > +static __inline vm_offset_t > pmap_lmem_unmap(void) > { > > @@ -312,12 +312,18 @@ pmap_lmem_unmap(void) > #endif /* !__mips_n64 */ > > static __inline int > -is_cacheable_page(vm_paddr_t pa, vm_page_t m) > +pmap_pte_cache_bits(vm_paddr_t pa, vm_page_t m) > { > + vm_memattr_t ma; > > - return ((m->md.pv_flags & PV_MEMATTR_UNCACHEABLE) =3D=3D 0 && > - is_cacheable_mem(pa)); > - > + ma =3D pmap_page_get_memattr(m); > + if (ma =3D=3D VM_MEMATTR_WRITE_BACK && !is_cacheable_mem(pa)) > + ma =3D VM_MEMATTR_UNCACHEABLE; > + return PTE_C(ma); > +} > +#define PMAP_PTE_SET_CACHE_BITS(pte, ps, m) { \ > + pte &=3D ~PTE_C_MASK; \ > + pte |=3D pmap_pte_cache_bits(pa, m); \ > } > > /* > @@ -359,7 +365,7 @@ pmap_pdpe_to_pde(pd_entry_t *pdpe, vm_of > return (pdpe); > } > > -static __inline > +static __inline > pd_entry_t *pmap_pde(pmap_t pmap, vm_offset_t va) > { > > @@ -423,7 +429,7 @@ pmap_steal_memory(vm_size_t size) > * Bootstrap the system enough to run with virtual memory. This > * assumes that the phys_avail array has been initialized. > */ > -static void > +static void > pmap_create_kernel_pagetable(void) > { > int i, j; > @@ -486,7 +492,7 @@ void > pmap_bootstrap(void) > { > int i; > - int need_local_mappings =3D 0; > + int need_local_mappings =3D 0; > > /* Sort. */ > again: > @@ -600,7 +606,7 @@ pmap_page_init(vm_page_t m) > { > > TAILQ_INIT(&m->md.pv_list); > - m->md.pv_flags =3D 0; > + m->md.pv_flags =3D VM_MEMATTR_DEFAULT << PV_MEMATTR_SHIFT; > } > > /* > @@ -635,8 +641,8 @@ pmap_call_on_active_cpus(pmap_t pmap, vo > pmap->pm_asid[cpu].gen =3D 0; > } > cpuid =3D PCPU_GET(cpuid); > - /* > - * XXX: barrier/locking for active? > + /* > + * XXX: barrier/locking for active? > * > * Take a snapshot of active here, any further changes are ignore= d. > * tlb update/invalidate should be harmless on inactive CPUs > @@ -819,7 +825,7 @@ retry: > * add a wired page to the kva > */ > void > -pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) > +pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t ma) > { > pt_entry_t *pte; > pt_entry_t opte, npte; > @@ -830,7 +836,7 @@ pmap_kenter_attr(vm_offset_t va, vm_padd > > pte =3D pmap_pte(kernel_pmap, va); > opte =3D *pte; > - npte =3D TLBLO_PA_TO_PFN(pa) | attr | PTE_D | PTE_V | PTE_G; > + npte =3D TLBLO_PA_TO_PFN(pa) | PTE_C(ma) | PTE_D | PTE_V | PTE_G; > *pte =3D npte; > if (pte_test(&opte, PTE_V) && opte !=3D npte) > pmap_update_page(kernel_pmap, va, npte); > @@ -843,7 +849,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p > KASSERT(is_cacheable_mem(pa), > ("pmap_kenter: memory at 0x%lx is not cacheable", (u_long= )pa)); > > - pmap_kenter_attr(va, pa, PTE_C_CACHE); > + pmap_kenter_attr(va, pa, VM_MEMATTR_DEFAULT); > } > > /* > @@ -1144,11 +1150,11 @@ _pmap_allocpte(pmap_t pmap, unsigned pte > int segindex =3D ptepindex >> (SEGSHIFT - PDRSHIFT); > int pdeindex =3D ptepindex & (NPDEPG - 1); > vm_page_t pg; > - > + > pdep =3D &pmap->pm_segtab[segindex]; > - if (*pdep =3D=3D NULL) { > + if (*pdep =3D=3D NULL) { > /* recurse for allocating page dir */ > - if (_pmap_allocpte(pmap, NUPDE + segindex, > + if (_pmap_allocpte(pmap, NUPDE + segindex, > flags) =3D=3D NULL) { > /* alloc failed, release current */ > --m->wire_count; > @@ -1680,7 +1686,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm > * pmap_remove_pte: do the things to unmap a page in a process > */ > static int > -pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va, > +pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va, > pd_entry_t pde) > { > pt_entry_t oldpte; > @@ -1864,7 +1870,7 @@ pmap_remove_all(vm_page_t m) > PMAP_LOCK(pmap); > > /* > - * If it's last mapping writeback all caches from > + * If it's last mapping writeback all caches from > * the page being destroyed > */ > if (TAILQ_NEXT(pv, pv_list) =3D=3D NULL) > @@ -2030,10 +2036,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, > newpte |=3D PTE_W; > if (is_kernel_pmap(pmap)) > newpte |=3D PTE_G; > - if (is_cacheable_page(pa, m)) > - newpte |=3D PTE_C_CACHE; > - else > - newpte |=3D PTE_C_UNCACHED; > + PMAP_PTE_SET_CACHE_BITS(newpte, pa, m); > > mpte =3D NULL; > > @@ -2218,7 +2221,7 @@ static vm_page_t > pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, > vm_prot_t prot, vm_page_t mpte) > { > - pt_entry_t *pte; > + pt_entry_t *pte, npte; > vm_paddr_t pa; > > KASSERT(va < kmi.clean_sva || va >=3D kmi.clean_eva || > @@ -2297,18 +2300,16 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ > /* > * Now validate mapping with RO protection > */ > - *pte =3D PTE_RO | TLBLO_PA_TO_PFN(pa) | PTE_V; > + npte =3D PTE_RO | TLBLO_PA_TO_PFN(pa) | PTE_V; > if ((m->oflags & VPO_UNMANAGED) =3D=3D 0) > - *pte |=3D PTE_MANAGED; > + npte |=3D PTE_MANAGED; > > - if (is_cacheable_page(pa, m)) > - *pte |=3D PTE_C_CACHE; > - else > - *pte |=3D PTE_C_UNCACHED; > + PMAP_PTE_SET_CACHE_BITS(npte, pa, m); > > if (is_kernel_pmap(pmap)) > - *pte |=3D PTE_G; > + *pte =3D npte | PTE_G; > else { > + *pte =3D npte; > /* > * Sync I & D caches. Do this only if the target pmap > * belongs to the current process. Otherwise, an > @@ -2649,12 +2650,12 @@ pmap_quick_enter_page(vm_page_t m) > #else > vm_paddr_t pa; > struct local_sysmaps *sysm; > - pt_entry_t *pte; > + pt_entry_t *pte, npte; > > pa =3D VM_PAGE_TO_PHYS(m); > > if (MIPS_DIRECT_MAPPABLE(pa)) { > - if (m->md.pv_flags & PV_MEMATTR_UNCACHEABLE) > + if (pmap_page_get_memattr(m) !=3D VM_MEMATTR_WRITE_BACK) > return (MIPS_PHYS_TO_DIRECT_UNCACHED(pa)); > else > return (MIPS_PHYS_TO_DIRECT(pa)); > @@ -2665,8 +2666,9 @@ pmap_quick_enter_page(vm_page_t m) > KASSERT(sysm->valid1 =3D=3D 0, ("pmap_quick_enter_page: PTE busy"= )); > > pte =3D pmap_pte(kernel_pmap, sysm->base); > - *pte =3D TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | > - (is_cacheable_page(pa, m) ? PTE_C_CACHE : PTE_C_UNCACHED); > + npte =3D TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G; > + PMAP_PTE_SET_CACHE_BITS(npte, pa, m); > + *pte =3D npte; > sysm->valid1 =3D 1; > > return (sysm->base); > @@ -3146,26 +3148,26 @@ pmap_is_referenced(vm_page_t m) > * Use XKPHYS uncached for 64 bit, and KSEG1 where possible for 32 bit. > */ > void * > -pmap_mapdev(vm_paddr_t pa, vm_size_t size) > +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) > { > vm_offset_t va, tmpva, offset; > > - /* > - * KSEG1 maps only first 512M of phys address space. For > + /* > + * KSEG1 maps only first 512M of phys address space. For > * pa > 0x20000000 we should make proper mapping * using pmap_ken= ter. > */ > - if (MIPS_DIRECT_MAPPABLE(pa + size - 1)) > + if (MIPS_DIRECT_MAPPABLE(pa + size - 1) && ma =3D=3D VM_MEMATTR_U= NCACHEABLE) > return ((void *)MIPS_PHYS_TO_DIRECT_UNCACHED(pa)); > else { > offset =3D pa & PAGE_MASK; > size =3D roundup(size + offset, PAGE_SIZE); > - > + > va =3D kva_alloc(size); > if (!va) > panic("pmap_mapdev: Couldn't alloc kernel virtual= memory"); > pa =3D trunc_page(pa); > for (tmpva =3D va; size > 0;) { > - pmap_kenter_attr(tmpva, pa, PTE_C_UNCACHED); > + pmap_kenter_attr(tmpva, pa, ma); > size -=3D PAGE_SIZE; > tmpva +=3D PAGE_SIZE; > pa +=3D PAGE_SIZE; > @@ -3175,6 +3177,12 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t siz > return ((void *)(va + offset)); > } > > +void * > +pmap_mapdev(vm_paddr_t pa, vm_size_t size) > +{ > + return pmap_mapdev_attr(pa, size, VM_MEMATTR_UNCACHEABLE); > +} > + > void > pmap_unmapdev(vm_offset_t va, vm_size_t size) > { > @@ -3220,7 +3228,7 @@ retry: > * This may falsely report the given address as > * MINCORE_REFERENCED. Unfortunately, due to the lack of > * per-PTE reference information, it is impossible to > - * determine if the address is MINCORE_REFERENCED. > + * determine if the address is MINCORE_REFERENCED. > */ > m =3D PHYS_TO_VM_PAGE(pa); > if ((m->aflags & PGA_REFERENCED) !=3D 0) > @@ -3500,7 +3508,7 @@ pmap_kextract(vm_offset_t va) > mapped =3D (va >=3D MIPS_KSEG2_START || va < MIPS_KSEG2_END); > #if defined(__mips_n64) > mapped =3D mapped || (va >=3D MIPS_XKSEG_START || va < MIPS_XKSEG= _END); > -#endif > +#endif > /* > * Kernel virtual. > */ > @@ -3524,7 +3532,7 @@ pmap_kextract(vm_offset_t va) > } > > > -void > +void > pmap_flush_pvcache(vm_page_t m) > { > pv_entry_t pv; > @@ -3551,12 +3559,85 @@ pmap_page_set_memattr(vm_page_t m, vm_me > if (TAILQ_FIRST(&m->md.pv_list) !=3D NULL) > panic("Can't change memattr on page with existing mapping= s"); > > - /* > - * The only memattr we support is UNCACHEABLE, translate the (sem= i-)MI > - * representation of that into our internal flag in the page MD s= truct. > - */ > - if (ma =3D=3D VM_MEMATTR_UNCACHEABLE) > - m->md.pv_flags |=3D PV_MEMATTR_UNCACHEABLE; > - else > - m->md.pv_flags &=3D ~PV_MEMATTR_UNCACHEABLE; > + /* Clean memattr portion of pv_flags */ > + m->md.pv_flags &=3D ~PV_MEMATTR_MASK; > + m->md.pv_flags |=3D (ma << PV_MEMATTR_SHIFT) & PV_MEMATTR_MASK; > +} > + > +static __inline void > +pmap_pte_attr(pt_entry_t *pte, vm_memattr_t ma) > +{ > + u_int npte; > + > + npte =3D *(u_int *)pte; > + npte &=3D ~PTE_C_MASK; > + npte |=3D PTE_C(ma); > + *pte =3D npte; > +} > + > +int > +pmap_change_attr(vm_offset_t sva, vm_size_t size, vm_memattr_t ma) > +{ > + pd_entry_t *pde, *pdpe; > + pt_entry_t *pte; > + vm_offset_t ova, eva, va, va_next; > + pmap_t pmap; > + > + ova =3D sva; > + eva =3D sva + size; > + if (eva < sva) > + return (EINVAL); > + > + pmap =3D kernel_pmap; > + PMAP_LOCK(pmap); > + > + for (; sva < eva; sva =3D va_next) { > + pdpe =3D pmap_segmap(pmap, sva); > +#ifdef __mips_n64 > + if (*pdpe =3D=3D 0) { > + va_next =3D (sva + NBSEG) & ~SEGMASK; > + if (va_next < sva) > + va_next =3D eva; > + continue; > + } > +#endif > + va_next =3D (sva + NBPDR) & ~PDRMASK; > + if (va_next < sva) > + va_next =3D eva; > + > + pde =3D pmap_pdpe_to_pde(pdpe, sva); > + if (*pde =3D=3D NULL) > + continue; > + > + /* > + * Limit our scan to either the end of the va represented > + * by the current page table page, or to the end of the > + * range being removed. > + */ > + if (va_next > eva) > + va_next =3D eva; > + > + va =3D va_next; > + for (pte =3D pmap_pde_to_pte(pde, sva); sva !=3D va_next;= pte++, > + sva +=3D PAGE_SIZE) { > + if (!pte_test(pte, PTE_V) || pte_cache_bits(pte) = =3D=3D ma) { > + if (va !=3D va_next) { > + pmap_invalidate_range(pmap, va, s= va); > + va =3D va_next; > + } > + continue; > + } > + if (va =3D=3D va_next) > + va =3D sva; > + > + pmap_pte_attr(pte, ma); > + } > + if (va !=3D va_next) > + pmap_invalidate_range(pmap, va, sva); > + } > + PMAP_UNLOCK(pmap); > + > + /* Flush caches to be in the safe side */ > + mips_dcache_wbinv_range(ova, size); > + return 0; > } > From owner-svn-src-all@freebsd.org Wed Dec 28 06:10:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FFB7C92CD2; Wed, 28 Dec 2016 06:10:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F8671CE4; Wed, 28 Dec 2016 06:10:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS6Aw1r027880; Wed, 28 Dec 2016 06:10:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS6AwlU027879; Wed, 28 Dec 2016 06:10:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280610.uBS6AwlU027879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 06:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310669 - head/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 06:10:59 -0000 Author: ngie Date: Wed Dec 28 06:10:58 2016 New Revision: 310669 URL: https://svnweb.freebsd.org/changeset/base/310669 Log: style(9): clean up whitespace MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Wed Dec 28 05:43:14 2016 (r310668) +++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Wed Dec 28 06:10:58 2016 (r310669) @@ -1640,20 +1640,20 @@ err: static int altq_is_enabled(int pfdev) { - struct pfioc_altq pa; + struct pfioc_altq pa; errno = 0; - if (ioctl(pfdev, DIOCGETALTQS, &pa)) { - if (errno == ENODEV) { + if (ioctl(pfdev, DIOCGETALTQS, &pa)) { + if (errno == ENODEV) { syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); - return (0); - } else - syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", + return (0); + } else + syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); - } - return (1); + } + return (1); } /* From owner-svn-src-all@freebsd.org Wed Dec 28 06:14:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F4BC92EFC; Wed, 28 Dec 2016 06:14:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B530910B2; Wed, 28 Dec 2016 06:14:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS6EoJe031620; Wed, 28 Dec 2016 06:14:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS6EoRt031619; Wed, 28 Dec 2016 06:14:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280614.uBS6EoRt031619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 06:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310670 - stable/11/contrib/bsnmp/snmp_target X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 06:14:52 -0000 Author: ngie Date: Wed Dec 28 06:14:50 2016 New Revision: 310670 URL: https://svnweb.freebsd.org/changeset/base/310670 Log: MFC r310503: style(9): delete stray trailing whitespace after break statement Modified: stable/11/contrib/bsnmp/snmp_target/target_snmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_target/target_snmp.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_target/target_snmp.c Wed Dec 28 06:10:58 2016 (r310669) +++ stable/11/contrib/bsnmp/snmp_target/target_snmp.c Wed Dec 28 06:14:50 2016 (r310670) @@ -299,7 +299,7 @@ op_snmp_target_addrs(struct snmp_context return (target_delete_address(addrs)); break; default: - break; + break; } return (SNMP_ERR_NOERROR); From owner-svn-src-all@freebsd.org Wed Dec 28 06:15:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB0EAC92F72; Wed, 28 Dec 2016 06:15:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89CFA1228; Wed, 28 Dec 2016 06:15:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS6FdCw031736; Wed, 28 Dec 2016 06:15:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS6FdTk031735; Wed, 28 Dec 2016 06:15:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280615.uBS6FdTk031735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 06:15: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: r310671 - stable/10/contrib/bsnmp/snmp_target X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 06:15:40 -0000 Author: ngie Date: Wed Dec 28 06:15:39 2016 New Revision: 310671 URL: https://svnweb.freebsd.org/changeset/base/310671 Log: MFstable/11 r310670: MFC r310503: style(9): delete stray trailing whitespace after break statement Modified: stable/10/contrib/bsnmp/snmp_target/target_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_target/target_snmp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_target/target_snmp.c Wed Dec 28 06:14:50 2016 (r310670) +++ stable/10/contrib/bsnmp/snmp_target/target_snmp.c Wed Dec 28 06:15:39 2016 (r310671) @@ -299,7 +299,7 @@ op_snmp_target_addrs(struct snmp_context return (target_delete_address(addrs)); break; default: - break; + break; } return (SNMP_ERR_NOERROR); From owner-svn-src-all@freebsd.org Wed Dec 28 06:16:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71A69C92FE4; Wed, 28 Dec 2016 06:16:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40DBA138D; Wed, 28 Dec 2016 06:16:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS6GJAr031816; Wed, 28 Dec 2016 06:16:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS6GJh4031815; Wed, 28 Dec 2016 06:16:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280616.uBS6GJh4031815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 06:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310672 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 06:16:20 -0000 Author: ngie Date: Wed Dec 28 06:16:19 2016 New Revision: 310672 URL: https://svnweb.freebsd.org/changeset/base/310672 Log: MFC r310499: Sort #includes No functional change Modified: stable/11/contrib/bsnmp/lib/snmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmp.c Wed Dec 28 06:15:39 2016 (r310671) +++ stable/11/contrib/bsnmp/lib/snmp.c Wed Dec 28 06:16:19 2016 (r310672) @@ -38,19 +38,19 @@ */ #include #include +#include +#include +#include #include #include #include #include +#include #ifdef HAVE_STDINT_H #include #elif defined(HAVE_INTTYPES_H) #include #endif -#include -#include -#include -#include #include "asn1.h" #include "snmp.h" From owner-svn-src-all@freebsd.org Wed Dec 28 06:16:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8D1EC94082; Wed, 28 Dec 2016 06:16:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A803B1579; Wed, 28 Dec 2016 06:16:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS6Gtch031902; Wed, 28 Dec 2016 06:16:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS6Gt5o031901; Wed, 28 Dec 2016 06:16:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280616.uBS6Gt5o031901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 06:16: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: r310673 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 06:16:57 -0000 Author: ngie Date: Wed Dec 28 06:16:55 2016 New Revision: 310673 URL: https://svnweb.freebsd.org/changeset/base/310673 Log: MFstable/11 r310672: MFC r310499: Sort #includes No functional change Modified: stable/10/contrib/bsnmp/lib/snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.c Wed Dec 28 06:16:19 2016 (r310672) +++ stable/10/contrib/bsnmp/lib/snmp.c Wed Dec 28 06:16:55 2016 (r310673) @@ -38,19 +38,19 @@ */ #include #include +#include +#include +#include #include #include #include #include +#include #ifdef HAVE_STDINT_H #include #elif defined(HAVE_INTTYPES_H) #include #endif -#include -#include -#include -#include #include "asn1.h" #include "snmp.h" From owner-svn-src-all@freebsd.org Wed Dec 28 07:37:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D1BC90214; Wed, 28 Dec 2016 07:37:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF09E179E; Wed, 28 Dec 2016 07:37:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS7bR6I065394; Wed, 28 Dec 2016 07:37:27 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS7bQQJ065391; Wed, 28 Dec 2016 07:37:26 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612280737.uBS7bQQJ065391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 28 Dec 2016 07:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310674 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 07:37:28 -0000 Author: mmel Date: Wed Dec 28 07:37:26 2016 New Revision: 310674 URL: https://svnweb.freebsd.org/changeset/base/310674 Log: Limit number of stripes supported by HDA codec to maximum number announced by HDA controller. Incorrectly implermented HDA codec may report support for more stripes that HDA controller already have. Due to this, always limit number of enabled stripes by global controller maximum. Reviewed by: mav MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8922 Modified: head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Wed Dec 28 06:16:55 2016 (r310673) +++ head/sys/dev/sound/pci/hda/hdaa.c Wed Dec 28 07:37:26 2016 (r310674) @@ -2130,7 +2130,8 @@ hdaa_channel_start(struct hdaa_chan *ch) uint32_t fmt; fmt = hdaa_stream_format(ch); - ch->stripectl = fls(ch->stripecap & hdaa_allowed_stripes(fmt)) - 1; + ch->stripectl = fls(ch->stripecap & hdaa_allowed_stripes(fmt) & + hda_get_stripes_mask(devinfo->dev)) - 1; ch->sid = HDAC_STREAM_ALLOC(device_get_parent(devinfo->dev), devinfo->dev, ch->dir == PCMDIR_PLAY ? 1 : 0, fmt, ch->stripectl, &ch->dmapos); if (ch->sid <= 0) Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Dec 28 06:16:55 2016 (r310673) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Dec 28 07:37:26 2016 (r310674) @@ -1767,6 +1767,9 @@ hdac_read_ivar(device_t dev, device_t ch case HDA_IVAR_DMA_NOCACHE: *result = (sc->flags & HDAC_F_DMA_NOCACHE) != 0; break; + case HDA_IVAR_STRIPES_MASK: + *result = (1 << (1 << sc->num_sdo)) - 1; + break; default: return (ENOENT); } Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Dec 28 06:16:55 2016 (r310673) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Dec 28 07:37:26 2016 (r310674) @@ -707,6 +707,7 @@ enum hdac_device_ivars { HDA_IVAR_SUBSYSTEM_ID, HDA_IVAR_NODE_TYPE, HDA_IVAR_DMA_NOCACHE, + HDA_IVAR_STRIPES_MASK, }; #define HDA_ACCESSOR(var, ivar, type) \ @@ -723,6 +724,7 @@ HDA_ACCESSOR(subdevice_id, SUBDEVICE_ID, HDA_ACCESSOR(subsystem_id, SUBSYSTEM_ID, uint32_t); HDA_ACCESSOR(node_type, NODE_TYPE, uint8_t); HDA_ACCESSOR(dma_nocache, DMA_NOCACHE, uint8_t); +HDA_ACCESSOR(stripes_mask, STRIPES_MASK, uint8_t); #define PCIS_MULTIMEDIA_HDA 0x03 From owner-svn-src-all@freebsd.org Wed Dec 28 08:11:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F502C90F6B; Wed, 28 Dec 2016 08:11:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 567AE1D0B; Wed, 28 Dec 2016 08:11:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS8BfBp080250; Wed, 28 Dec 2016 08:11:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS8BfN9080249; Wed, 28 Dec 2016 08:11:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612280811.uBS8BfN9080249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 08:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310675 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 08:11:42 -0000 Author: ngie Date: Wed Dec 28 08:11:41 2016 New Revision: 310675 URL: https://svnweb.freebsd.org/changeset/base/310675 Log: Fix the build by moving the initializers for len/nswapdev down below the declarations MFC after: 3 days Pointyhat to: ngie Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Wed Dec 28 07:37:26 2016 (r310674) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Wed Dec 28 08:11:41 2016 (r310675) @@ -376,8 +376,11 @@ storage_OS_get_swap(void) { struct storage_entry *entry; char swap_w_prefix[SE_DESC_MLEN]; - size_t len = sizeof(nswapdev); - int nswapdev = 0; + size_t len; + int nswapdev; + + len = sizeof(nswapdev); + nswapdev = 0; if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) { syslog(LOG_ERR, From owner-svn-src-all@freebsd.org Wed Dec 28 09:32:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85898C94D1E; Wed, 28 Dec 2016 09:32:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6018017C2; Wed, 28 Dec 2016 09:32:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBS9W2ML015894; Wed, 28 Dec 2016 09:32:02 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBS9W20h015892; Wed, 28 Dec 2016 09:32:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612280932.uBS9W20h015892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 28 Dec 2016 09:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310676 - in head: share/man/man4 tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 09:32:03 -0000 Author: avos Date: Wed Dec 28 09:32:02 2016 New Revision: 310676 URL: https://svnweb.freebsd.org/changeset/base/310676 Log: rum.4, run.4, runfw.4, zyd.4: do not install when MK_USB == no. While here, add missing if_rtwn_usb.4.gz symlink into OptionalObsoleteFiles.inc Modified: head/share/man/man4/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Dec 28 08:11:41 2016 (r310675) +++ head/share/man/man4/Makefile Wed Dec 28 09:32:02 2016 (r310676) @@ -438,9 +438,6 @@ MAN= aac.4 \ rtwnfw.4 \ rtwn_pci.4 \ rue.4 \ - rum.4 \ - run.4 \ - runfw.4 \ sa.4 \ safe.4 \ sbp.4 \ @@ -574,8 +571,7 @@ MAN= aac.4 \ xl.4 \ ${_xnb.4} \ xpt.4 \ - zero.4 \ - zyd.4 + zero.4 MLINKS= ae.4 if_ae.4 MLINKS+=age.4 if_age.4 @@ -710,8 +706,6 @@ MLINKS+=rl.4 if_rl.4 MLINKS+=rtwn.4 if_rtwn.4 MLINKS+=rtwn_pci.4 if_rtwn_pci.4 MLINKS+=rue.4 if_rue.4 -MLINKS+=rum.4 if_rum.4 -MLINKS+=run.4 if_run.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ scsi.4 scbus.4 \ @@ -756,7 +750,6 @@ MLINKS+=wi.4 if_wi.4 MLINKS+=${_wpi.4} ${_if_wpi.4} MLINKS+=xe.4 if_xe.4 MLINKS+=xl.4 if_xl.4 -MLINKS+=zyd.4 if_zyd.4 .if ${MACHINE_CPUARCH} == "aarch64" _armv8crypto.4= armv8crypto.4 @@ -915,6 +908,9 @@ MAN+= \ rsu.4 \ rsufw.4 \ rtwn_usb.4 \ + rum.4 \ + run.4 \ + runfw.4 \ u3g.4 \ uark.4 \ uart.4 \ @@ -965,10 +961,13 @@ MAN+= \ utopia.4 \ uvisor.4 \ uvscom.4 \ + zyd.4 MLINKS+=otus.4 if_otus.4 MLINKS+=rsu.4 if_rsu.4 MLINKS+=rtwn_usb.4 if_rtwn_usb.4 +MLINKS+=rum.4 if_rum.4 +MLINKS+=run.4 if_run.4 MLINKS+=u3g.4 u3gstub.4 MLINKS+=uath.4 if_uath.4 MLINKS+=udav.4 if_udav.4 @@ -976,6 +975,7 @@ MLINKS+=upgt.4 if_upgt.4 MLINKS+=ural.4 if_ural.4 MLINKS+=urndis.4 if_urndis.4 MLINKS+=${_urtw.4} ${_if_urtw.4} +MLINKS+=zyd.4 if_zyd.4 .endif .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 08:11:41 2016 (r310675) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 09:32:02 2016 (r310676) @@ -8870,11 +8870,18 @@ OLD_FILES+=usr/share/man/man3/usb_strerr OLD_FILES+=usr/share/man/man3/usbhid.3.gz OLD_FILES+=usr/share/man/man4/if_otus.4.gz OLD_FILES+=usr/share/man/man4/if_rsu.4.gz +OLD_FILES+=usr/share/man/man4/if_rtwn_usb.4.gz +OLD_FILES+=usr/share/man/man4/if_rum.4.gz +OLD_FILES+=usr/share/man/man4/if_run.4.gz +OLD_FILES+=usr/share/man/man4/if_zyd.4.gz OLD_FILES+=usr/share/man/man4/otus.4.gz OLD_FILES+=usr/share/man/man4/otusfw.4.gz OLD_FILES+=usr/share/man/man4/rsu.4.gz OLD_FILES+=usr/share/man/man4/rsufw.4.gz OLD_FILES+=usr/share/man/man4/rtwn_usb.4.gz +OLD_FILES+=usr/share/man/man4/rum.4.gz +OLD_FILES+=usr/share/man/man4/run.4.gz +OLD_FILES+=usr/share/man/man4/runfw.4.gz OLD_FILES+=usr/share/man/man4/u3g.4.gz OLD_FILES+=usr/share/man/man4/u3gstub.4.gz OLD_FILES+=usr/share/man/man4/uark.4.gz @@ -8924,6 +8931,7 @@ OLD_FILES+=usr/share/man/man4/uslcom.4.g OLD_FILES+=usr/share/man/man4/utopia.4.gz OLD_FILES+=usr/share/man/man4/uvisor.4.gz OLD_FILES+=usr/share/man/man4/uvscom.4.gz +OLD_FILES+=usr/share/man/man4/zyd.4.gz OLD_FILES+=usr/share/man/man8/uathload.8.gz OLD_FILES+=usr/share/man/man8/usbconfig.8.gz OLD_FILES+=usr/share/man/man8/usbdump.8.gz From owner-svn-src-all@freebsd.org Wed Dec 28 10:39:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8156CC93EFD; Wed, 28 Dec 2016 10:39:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50F721038; Wed, 28 Dec 2016 10:39:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAdBbA040464; Wed, 28 Dec 2016 10:39:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAdB1T040463; Wed, 28 Dec 2016 10:39:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281039.uBSAdB1T040463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310677 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:39:12 -0000 Author: arybchik Date: Wed Dec 28 10:39:11 2016 New Revision: 310677 URL: https://svnweb.freebsd.org/changeset/base/310677 Log: sfxge(4): cleanup: fix typo in siena_mac_loopback_set() instrumentation Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/siena_mac.c Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Wed Dec 28 09:32:02 2016 (r310676) +++ head/sys/dev/sfxge/common/siena_mac.c Wed Dec 28 10:39:11 2016 (r310677) @@ -223,7 +223,7 @@ siena_mac_loopback_set( return (0); fail1: - EFSYS_PROBE(fail2); + EFSYS_PROBE1(fail1, efx_rc_t, rc); epp->ep_loopback_type = old_loopback_type; epp->ep_loopback_link_mode = old_loopback_link_mode; From owner-svn-src-all@freebsd.org Wed Dec 28 10:40:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06852C940B3; Wed, 28 Dec 2016 10:40:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA0931337; Wed, 28 Dec 2016 10:40:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAeLFS040567; Wed, 28 Dec 2016 10:40:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAeLrL040566; Wed, 28 Dec 2016 10:40:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281040.uBSAeLrL040566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310678 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:40:23 -0000 Author: arybchik Date: Wed Dec 28 10:40:21 2016 New Revision: 310678 URL: https://svnweb.freebsd.org/changeset/base/310678 Log: sfxge(4): cleanup: remove trailing whitespace Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_types.h Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 10:39:11 2016 (r310677) +++ head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 10:40:21 2016 (r310678) @@ -1310,7 +1310,7 @@ extern int fix_lint; /* * Set or clear a numbered bit within an octword. */ - + #define EFX_SHIFT64(_bit, _base) \ (((_bit) >= (_base) && (_bit) < (_base) + 64) ? \ ((uint64_t)1 << ((_bit) - (_base))) : \ From owner-svn-src-all@freebsd.org Wed Dec 28 10:43:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E19C94251; Wed, 28 Dec 2016 10:43:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3655179D; Wed, 28 Dec 2016 10:43:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAh4n1044487; Wed, 28 Dec 2016 10:43:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAh4vC044486; Wed, 28 Dec 2016 10:43:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281043.uBSAh4vC044486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310679 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:43:06 -0000 Author: arybchik Date: Wed Dec 28 10:43:04 2016 New Revision: 310679 URL: https://svnweb.freebsd.org/changeset/base/310679 Log: sfxge(4): cleanup: fix wrong indent Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Wed Dec 28 10:40:21 2016 (r310678) +++ head/sys/dev/sfxge/common/efx_tx.c Wed Dec 28 10:43:04 2016 (r310679) @@ -329,7 +329,7 @@ efx_tx_qcreate( if ((rc = etxop->etxo_qcreate(enp, index, label, esmp, n, id, flags, eep, etp, addedp)) != 0) - goto fail2; + goto fail2; enp->en_tx_qcount++; *etpp = etp; From owner-svn-src-all@freebsd.org Wed Dec 28 10:44:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3602C942D5; Wed, 28 Dec 2016 10:44:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2C8F1945; Wed, 28 Dec 2016 10:44:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAi39g044582; Wed, 28 Dec 2016 10:44:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAi3ki044581; Wed, 28 Dec 2016 10:44:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281044.uBSAi3ki044581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310680 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:44:05 -0000 Author: arybchik Date: Wed Dec 28 10:44:03 2016 New Revision: 310680 URL: https://svnweb.freebsd.org/changeset/base/310680 Log: sfxge(4): cleanup: use spaces around binary arithmetic operations Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:43:04 2016 (r310679) +++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:44:03 2016 (r310680) @@ -456,7 +456,7 @@ fail1: * Value (V): L bytes - payload */ #define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) -#define EFX_LICENSE_V1V2_HEADER_LENGTH (2*sizeof(uint16_t)) +#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof(uint16_t)) __checkReturn efx_rc_t efx_lic_v1v2_find_start( @@ -1082,9 +1082,10 @@ efx_mcdi_licensing_v3_get_id( } else { /* Shift ID down to start of buffer */ memmove(bufferp, - bufferp+MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, - *lengthp); - memset(bufferp+(*lengthp), 0, MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); + bufferp + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, + *lengthp); + memset(bufferp + (*lengthp), 0, + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); } return (0); From owner-svn-src-all@freebsd.org Wed Dec 28 10:45:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C0DC9435B; Wed, 28 Dec 2016 10:45:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D75C01AD5; Wed, 28 Dec 2016 10:45:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAjFYU044673; Wed, 28 Dec 2016 10:45:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAjEi3044671; Wed, 28 Dec 2016 10:45:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281045.uBSAjEi3044671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310681 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:45:16 -0000 Author: arybchik Date: Wed Dec 28 10:45:14 2016 New Revision: 310681 URL: https://svnweb.freebsd.org/changeset/base/310681 Log: sfxge(4): cleanup: remove unnecessary spaces Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 10:44:03 2016 (r310680) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 10:45:14 2016 (r310681) @@ -564,7 +564,7 @@ typedef struct efx_lic_ops_s { efx_rc_t (*elo_find_start) (efx_nic_t *, caddr_t, size_t, uint32_t *); efx_rc_t (*elo_find_end)(efx_nic_t *, caddr_t, size_t, - uint32_t , uint32_t *); + uint32_t, uint32_t *); boolean_t (*elo_find_key)(efx_nic_t *, caddr_t, size_t, uint32_t, uint32_t *, uint32_t *); boolean_t (*elo_validate_key)(efx_nic_t *, Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:44:03 2016 (r310680) +++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:45:14 2016 (r310681) @@ -627,7 +627,7 @@ efx_lic_v1v2_write_key( // Ensure space for terminator remains if ((offset + length) > - (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) { + (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH)) { rc = ENOSPC; goto fail1; } From owner-svn-src-all@freebsd.org Wed Dec 28 10:47:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEF01C943E7; Wed, 28 Dec 2016 10:47:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8EB81C89; Wed, 28 Dec 2016 10:47:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAl4BK044777; Wed, 28 Dec 2016 10:47:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAl48D044774; Wed, 28 Dec 2016 10:47:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281047.uBSAl48D044774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310682 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:47:06 -0000 Author: arybchik Date: Wed Dec 28 10:47:04 2016 New Revision: 310682 URL: https://svnweb.freebsd.org/changeset/base/310682 Log: sfxge(4): cleanup: avoid C99 // comments Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 10:45:14 2016 (r310681) +++ head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 10:47:04 2016 (r310682) @@ -800,7 +800,7 @@ ef10_ev_rx( * or headers that are too long for the parser. * Headers and checksums must be validated by the host. */ - // TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE); + /* TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE); */ goto deliver; } Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 28 10:45:14 2016 (r310681) +++ head/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 28 10:47:04 2016 (r310682) @@ -852,7 +852,7 @@ ef10_nvram_buffer_find_item_start( __in size_t buffer_size, __out uint32_t *startp) { - // Read past partition header to find start address of the first key + /* Read past partition header to find start address of the first key */ tlv_cursor_t cursor; efx_rc_t rc; @@ -898,7 +898,7 @@ ef10_nvram_buffer_find_end( __in uint32_t offset, __out uint32_t *endp) { - // Read to end of partition + /* Read to end of partition */ tlv_cursor_t cursor; efx_rc_t rc; uint32_t *segment_used; @@ -956,7 +956,7 @@ ef10_nvram_buffer_find_item( __out uint32_t *startp, __out uint32_t *lengthp) { - // Find TLV at offset and return key start and length + /* Find TLV at offset and return key start and length */ tlv_cursor_t cursor; uint8_t *key; uint32_t tag; Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:45:14 2016 (r310681) +++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:47:04 2016 (r310682) @@ -625,7 +625,7 @@ efx_lic_v1v2_write_key( EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX + EFX_LICENSE_V1V2_HEADER_LENGTH)); - // Ensure space for terminator remains + /* Ensure space for terminator remains */ if ((offset + length) > (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH)) { rc = ENOSPC; @@ -662,7 +662,7 @@ efx_lic_v1v2_delete_key( _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(end <= buffer_size); - // Shift everything after the key down + /* Shift everything after the key down */ memmove(bufferp + offset, bufferp + move_start, move_length); *deltap = length; @@ -681,7 +681,7 @@ efx_lic_v1v2_create_partition( _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); - // Write terminator + /* Write terminator */ memset(bufferp, '\0', EFX_LICENSE_V1V2_HEADER_LENGTH); return (0); } @@ -1155,7 +1155,7 @@ efx_lic_v3_validate_key( __in uint32_t length ) { - // Check key is a valid V3 key + /* Check key is a valid V3 key */ uint8_t key_type; uint8_t key_length; @@ -1272,7 +1272,7 @@ efx_lic_v3_create_partition( { efx_rc_t rc; - // Construct empty partition + /* Construct empty partition */ if ((rc = ef10_nvram_buffer_create(enp, NVRAM_PARTITION_TYPE_LICENSE, bufferp, buffer_size)) != 0) { @@ -1303,7 +1303,7 @@ efx_lic_v3_finish_partition( goto fail1; } - // Validate completed partition + /* Validate completed partition */ if ((rc = ef10_nvram_buffer_validate(enp, NVRAM_PARTITION_TYPE_LICENSE, bufferp, buffer_size)) != 0) { goto fail2; From owner-svn-src-all@freebsd.org Wed Dec 28 10:48:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9819BC94458; Wed, 28 Dec 2016 10:48:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 679941DF9; Wed, 28 Dec 2016 10:48:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAmFbP044859; Wed, 28 Dec 2016 10:48:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAmFfv044858; Wed, 28 Dec 2016 10:48:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281048.uBSAmFfv044858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310683 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:48:16 -0000 Author: arybchik Date: Wed Dec 28 10:48:15 2016 New Revision: 310683 URL: https://svnweb.freebsd.org/changeset/base/310683 Log: sfxge(4): cleanup: pointer symbol should go together with struct member name Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_impl.h Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 10:47:04 2016 (r310682) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 10:48:15 2016 (r310683) @@ -950,7 +950,7 @@ typedef struct ef10_filter_entry_s { typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; - efx_rxq_t * eft_default_rxq; + efx_rxq_t *eft_default_rxq; boolean_t eft_using_rss; uint32_t eft_unicst_filter_indexes[ EFX_EF10_FILTER_UNICAST_FILTERS_MAX]; From owner-svn-src-all@freebsd.org Wed Dec 28 10:49:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DD5EC94511; Wed, 28 Dec 2016 10:49:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D5F41FF8; Wed, 28 Dec 2016 10:49:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAnfDY044951; Wed, 28 Dec 2016 10:49:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAnf9o044950; Wed, 28 Dec 2016 10:49:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281049.uBSAnf9o044950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310684 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:49:42 -0000 Author: arybchik Date: Wed Dec 28 10:49:41 2016 New Revision: 310684 URL: https://svnweb.freebsd.org/changeset/base/310684 Log: sfxge(4): cleanup: remove trailing whitespaces Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_types.h Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 10:48:15 2016 (r310683) +++ head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 10:49:41 2016 (r310684) @@ -238,7 +238,7 @@ typedef union efx_oword_u { #endif #if EFSYS_HAS_UINT64 uint64_t eo_u64[2]; -#endif +#endif uint32_t eo_u32[4]; uint16_t eo_u16[8]; uint8_t eo_u8[16]; From owner-svn-src-all@freebsd.org Wed Dec 28 10:52:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52899C94742; Wed, 28 Dec 2016 10:52:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21C1614E1; Wed, 28 Dec 2016 10:52:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSAq53V047498; Wed, 28 Dec 2016 10:52:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSAq5Ua047255; Wed, 28 Dec 2016 10:52:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281052.uBSAq5Ua047255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310685 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:52:06 -0000 Author: arybchik Date: Wed Dec 28 10:52:04 2016 New Revision: 310685 URL: https://svnweb.freebsd.org/changeset/base/310685 Log: sfxge(4): cleanup: open brace should be on a type name line Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:49:41 2016 (r310684) +++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:52:04 2016 (r310685) @@ -212,8 +212,7 @@ typedef enum efx_mcdi_exception_e { } efx_mcdi_exception_t; #if EFSYS_OPT_MCDI_LOGGING -typedef enum efx_log_msg_e -{ +typedef enum efx_log_msg_e { EFX_LOG_INVALID, EFX_LOG_MCDI_REQUEST, EFX_LOG_MCDI_RESPONSE, @@ -1172,8 +1171,7 @@ efx_nic_cfg_get( __in efx_nic_t *enp); /* Driver resource limits (minimum required/maximum usable). */ -typedef struct efx_drv_limits_s -{ +typedef struct efx_drv_limits_s { uint32_t edl_min_evq_count; uint32_t edl_max_evq_count; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 28 10:49:41 2016 (r310684) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 28 10:52:04 2016 (r310685) @@ -1728,8 +1728,7 @@ fail1: #if EFSYS_OPT_MAC_STATS -typedef enum efx_stats_action_e -{ +typedef enum efx_stats_action_e { EFX_STATS_CLEAR, EFX_STATS_UPLOAD, EFX_STATS_ENABLE_NOEVENTS, From owner-svn-src-all@freebsd.org Wed Dec 28 10:53:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11421C948C0; Wed, 28 Dec 2016 10:53:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAF0016C4; Wed, 28 Dec 2016 10:53:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSArrmx048857; Wed, 28 Dec 2016 10:53:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSArrb9048855; Wed, 28 Dec 2016 10:53:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281053.uBSArrb9048855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 10:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310686 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 10:53:55 -0000 Author: arybchik Date: Wed Dec 28 10:53:53 2016 New Revision: 310686 URL: https://svnweb.freebsd.org/changeset/base/310686 Log: sfxge(4): cleanup: add missing space between type and pointer symbol Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:52:04 2016 (r310685) +++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:53:53 2016 (r310686) @@ -435,7 +435,7 @@ typedef enum efx_link_mode_e { #define EFX_MAC_ADDR_LEN 6 -#define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t*)_address)[0] & 0x01) +#define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t *)_address)[0] & 0x01) #define EFX_MAC_MULTICAST_LIST_MAX 256 Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:52:04 2016 (r310685) +++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:53:53 2016 (r310686) @@ -509,8 +509,8 @@ efx_lic_v1v2_find_key( if ((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH) goto fail1; - tlv_type = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[0]); - tlv_length = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[1]); + tlv_type = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[0]); + tlv_length = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[1]); if ((tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) || (tlv_type == 0 && tlv_length == 0)) { found = B_FALSE; @@ -543,8 +543,8 @@ efx_lic_v1v2_validate_key( goto fail1; } - tlv_type = __LE_TO_CPU_16(((uint16_t*)keyp)[0]); - tlv_length = __LE_TO_CPU_16(((uint16_t*)keyp)[1]); + tlv_type = __LE_TO_CPU_16(((uint16_t *)keyp)[0]); + tlv_length = __LE_TO_CPU_16(((uint16_t *)keyp)[1]); if (tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) { goto fail2; @@ -1169,8 +1169,8 @@ efx_lic_v3_validate_key( goto fail2; } - key_type = ((uint8_t*)keyp)[0]; - key_length = ((uint8_t*)keyp)[1]; + key_type = ((uint8_t *)keyp)[0]; + key_length = ((uint8_t *)keyp)[1]; if (key_type < 3) { goto fail3; From owner-svn-src-all@freebsd.org Wed Dec 28 11:01:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E0E3C94AEB; Wed, 28 Dec 2016 11:01:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F09D19B1; Wed, 28 Dec 2016 11:01:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSB12Yx050598; Wed, 28 Dec 2016 11:01:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSB11o9050590; Wed, 28 Dec 2016 11:01:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281101.uBSB11o9050590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310687 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:01:03 -0000 Author: arybchik Date: Wed Dec 28 11:01:01 2016 New Revision: 310687 URL: https://svnweb.freebsd.org/changeset/base/310687 Log: sfxge(4): cleanup: use TAB to indent Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/mcdi_mon.c head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_flash.h head/sys/dev/sfxge/common/siena_impl.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 11:01:01 2016 (r310687) @@ -847,7 +847,7 @@ typedef enum efx_phy_cap_type_e { extern void efx_phy_adv_cap_get( __in efx_nic_t *enp, - __in uint32_t flag, + __in uint32_t flag, __out uint32_t *maskp); extern __checkReturn efx_rc_t @@ -1132,20 +1132,20 @@ typedef struct efx_nic_cfg_s { boolean_t enc_rx_batching_enabled; /* Maximum number of descriptors completed in an rx event. */ uint32_t enc_rx_batch_max; - /* Number of rx descriptors the hardware requires for a push. */ - uint32_t enc_rx_push_align; + /* Number of rx descriptors the hardware requires for a push. */ + uint32_t enc_rx_push_align; /* * Maximum number of bytes into the packet the TCP header can start for * the hardware to apply TSO packet edits. */ - uint32_t enc_tx_tso_tcp_header_offset_limit; - boolean_t enc_fw_assisted_tso_enabled; - boolean_t enc_fw_assisted_tso_v2_enabled; - boolean_t enc_hw_tx_insert_vlan_enabled; + uint32_t enc_tx_tso_tcp_header_offset_limit; + boolean_t enc_fw_assisted_tso_enabled; + boolean_t enc_fw_assisted_tso_v2_enabled; + boolean_t enc_hw_tx_insert_vlan_enabled; /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; - boolean_t enc_rx_disable_scatter_supported; - boolean_t enc_allow_set_mac_with_installed_filters; + boolean_t enc_rx_disable_scatter_supported; + boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; boolean_t enc_init_evq_v2_supported; /* External port identifier */ @@ -1846,8 +1846,8 @@ typedef enum efx_rx_hash_support_e { } efx_rx_hash_support_t; #define EFX_RSS_TBL_SIZE 128 /* Rows in RX indirection table */ -#define EFX_MAXRSS 64 /* RX indirection entry range */ -#define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ +#define EFX_MAXRSS 64 /* RX indirection entry range */ +#define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ typedef enum efx_rx_scale_support_e { EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */ @@ -2059,7 +2059,7 @@ efx_tx_qpio_write( __in efx_txq_t *etp, __in_ecount(buf_length) uint8_t *buffer, __in size_t buf_length, - __in size_t pio_buf_offset); + __in size_t pio_buf_offset); extern __checkReturn efx_rc_t efx_tx_qpio_post( Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 11:01:01 2016 (r310687) @@ -252,7 +252,7 @@ efx_filter_reconfigure( typedef struct efx_port_s { efx_mac_type_t ep_mac_type; - uint32_t ep_phy_type; + uint32_t ep_phy_type; uint8_t ep_port; uint32_t ep_mac_pdu; uint8_t ep_mac_addr[6]; @@ -600,7 +600,7 @@ struct efx_nic_s { uint32_t en_features; efsys_identifier_t *en_esip; efsys_lock_t *en_eslp; - efsys_bar_t *en_esbp; + efsys_bar_t *en_esbp; unsigned int en_mod_flags; unsigned int en_reset_flags; efx_nic_cfg_t en_nic_cfg; Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 11:01:01 2016 (r310687) @@ -47,7 +47,7 @@ static const efx_phy_ops_t __efx_phy_sie #endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_BIST NULL, /* epo_bist_enable_offline */ - siena_phy_bist_start, /* epo_bist_start */ + siena_phy_bist_start, /* epo_bist_start */ siena_phy_bist_poll, /* epo_bist_poll */ siena_phy_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Dec 28 11:01:01 2016 (r310687) @@ -83,7 +83,7 @@ hunt_nic_get_required_pcie_bandwidth( if ((rc = ef10_nic_get_port_mode_bandwidth(max_port_mode, &bandwidth)) != 0) - goto fail2; + goto fail2; } out: @@ -295,7 +295,7 @@ hunt_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail12; + goto fail12; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/mcdi_mon.c Wed Dec 28 11:01:01 2016 (r310687) @@ -155,8 +155,8 @@ static const struct mcdi_sensor_map_s { STAT(Px, PHY0_VCC), /* 0x4c PHY0_VCC */ STAT(Px, PHY1_VCC), /* 0x4d PHY1_VCC */ STAT(Px, CONTROLLER_TDIODE_TEMP), /* 0x4e CONTROLLER_TDIODE_TEMP */ - STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ - STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ + STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ + STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ }; #define MCDI_STATIC_SENSOR_ASSERT(_field) \ Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 11:01:01 2016 (r310687) @@ -283,7 +283,7 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail10; + goto fail10; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; Modified: head/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- head/sys/dev/sfxge/common/siena_flash.h Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/siena_flash.h Wed Dec 28 11:01:01 2016 (r310687) @@ -127,7 +127,7 @@ typedef struct siena_mc_boot_hdr_s { /* } siena_mc_boot_hdr_t; #define SIENA_MC_BOOT_HDR_PADDING \ - (SIENA_MC_BOOT_HDR_LEN - sizeof(siena_mc_boot_hdr_t)) + (SIENA_MC_BOOT_HDR_LEN - sizeof(siena_mc_boot_hdr_t)) #define SIENA_MC_STATIC_CONFIG_MAGIC (0xBDCF5555) #define SIENA_MC_STATIC_CONFIG_VERSION (0) Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Wed Dec 28 10:53:53 2016 (r310686) +++ head/sys/dev/sfxge/common/siena_impl.h Wed Dec 28 11:01:01 2016 (r310687) @@ -294,7 +294,7 @@ siena_vpd_fini( typedef struct siena_link_state_s { uint32_t sls_adv_cap_mask; uint32_t sls_lp_cap_mask; - unsigned int sls_fcntl; + unsigned int sls_fcntl; efx_link_mode_t sls_link_mode; #if EFSYS_OPT_LOOPBACK efx_loopback_type_t sls_loopback; @@ -362,7 +362,7 @@ siena_phy_bist_poll( __in efx_bist_type_t type, __out efx_bist_result_t *resultp, __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, + uint32_t *value_maskp, __out_ecount_opt(count) __drv_when(count > 0, __notnull) unsigned long *valuesp, __in size_t count); From owner-svn-src-all@freebsd.org Wed Dec 28 11:03:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1421DC94B77; Wed, 28 Dec 2016 11:03:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D73D31D66; Wed, 28 Dec 2016 11:03:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSB37x6052782; Wed, 28 Dec 2016 11:03:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSB37Ik052781; Wed, 28 Dec 2016 11:03:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281103.uBSB37Ik052781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310688 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:03:08 -0000 Author: arybchik Date: Wed Dec 28 11:03:06 2016 New Revision: 310688 URL: https://svnweb.freebsd.org/changeset/base/310688 Log: sfxge(4): cleanup: avoid space just before TAB in efx_types.h Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_types.h Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 11:01:01 2016 (r310687) +++ head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 11:03:06 2016 (r310688) @@ -688,21 +688,21 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] = EFX_INSERT_FIELDS64(0, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[1] = EFX_INSERT_FIELDS64(64, 127, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_OWORD32(_oword, \ @@ -711,35 +711,35 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] = EFX_INSERT_FIELDS32(0, 31, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[1] = EFX_INSERT_FIELDS32(32, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[2] = EFX_INSERT_FIELDS32(64, 95, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[3] = EFX_INSERT_FIELDS32(96, 127, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_QWORD64(_qword, \ @@ -748,14 +748,14 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] = EFX_INSERT_FIELDS64(0, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_QWORD32(_qword, \ @@ -764,21 +764,21 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] = EFX_INSERT_FIELDS32(0, 31, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[1] = EFX_INSERT_FIELDS32(32, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_DWORD(_dword, \ @@ -787,7 +787,7 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_dword).ed_u32[0] = EFX_INSERT_FIELDS32(0, 31, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ @@ -803,7 +803,7 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_word).ew_u16[0] = EFX_INSERT_FIELDS16(0, 15, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ @@ -819,7 +819,7 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_byte).eb_u8[0] = EFX_INSERT_FIELDS8(0, 7, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ @@ -1226,85 +1226,85 @@ extern int fix_lint; #define EFX_SET_OWORD_FIELD64(_oword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] = (((_oword).eo_u64[0] & \ ~EFX_INPLACE_MASK64(0, 63, _field)) | \ EFX_INSERT_FIELD64(0, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[1] = (((_oword).eo_u64[1] & \ ~EFX_INPLACE_MASK64(64, 127, _field)) | \ EFX_INSERT_FIELD64(64, 127, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_OWORD_FIELD32(_oword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] = (((_oword).eo_u32[0] & \ ~EFX_INPLACE_MASK32(0, 31, _field)) | \ EFX_INSERT_FIELD32(0, 31, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[1] = (((_oword).eo_u32[1] & \ ~EFX_INPLACE_MASK32(32, 63, _field)) | \ EFX_INSERT_FIELD32(32, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[2] = (((_oword).eo_u32[2] & \ ~EFX_INPLACE_MASK32(64, 95, _field)) | \ EFX_INSERT_FIELD32(64, 95, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[3] = (((_oword).eo_u32[3] & \ ~EFX_INPLACE_MASK32(96, 127, _field)) | \ EFX_INSERT_FIELD32(96, 127, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_QWORD_FIELD64(_qword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] = (((_qword).eq_u64[0] & \ ~EFX_INPLACE_MASK64(0, 63, _field)) | \ EFX_INSERT_FIELD64(0, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_QWORD_FIELD32(_qword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] = (((_qword).eq_u32[0] & \ ~EFX_INPLACE_MASK32(0, 31, _field)) | \ EFX_INSERT_FIELD32(0, 31, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[1] = (((_qword).eq_u32[1] & \ ~EFX_INPLACE_MASK32(32, 63, _field)) | \ EFX_INSERT_FIELD32(32, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_DWORD_FIELD(_dword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_dword).ed_u32[0] = (((_dword).ed_u32[0] & \ ~EFX_INPLACE_MASK32(0, 31, _field)) | \ EFX_INSERT_FIELD32(0, 31, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_WORD_FIELD(_word, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_word).ew_u16[0] = (((_word).ew_u16[0] & \ ~EFX_INPLACE_MASK16(0, 15, _field)) | \ EFX_INSERT_FIELD16(0, 15, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_BYTE_FIELD(_byte, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_byte).eb_u8[0] = (((_byte).eb_u8[0] & \ ~EFX_INPLACE_MASK8(0, 7, _field)) | \ EFX_INSERT_FIELD8(0, 7, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) /* @@ -1333,17 +1333,17 @@ extern int fix_lint; #define EFX_SET_OWORD_BIT64(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] |= \ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(0))); \ (_oword).eo_u64[1] |= \ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(64))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_OWORD_BIT32(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_oword).eo_u32[1] |= \ @@ -1352,22 +1352,22 @@ extern int fix_lint; __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(64))); \ (_oword).eo_u32[3] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(96))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_OWORD_BIT64(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] &= \ __CPU_TO_LE_64(~EFX_SHIFT64(_bit, FIX_LINT(0))); \ (_oword).eo_u64[1] &= \ __CPU_TO_LE_64(~EFX_SHIFT64(_bit, FIX_LINT(64))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_OWORD_BIT32(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_oword).eo_u32[1] &= \ @@ -1376,7 +1376,7 @@ extern int fix_lint; __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(64))); \ (_oword).eo_u32[3] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(96))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_OWORD_BIT64(_oword, _bit) \ @@ -1398,38 +1398,38 @@ extern int fix_lint; #define EFX_SET_QWORD_BIT64(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] |= \ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_QWORD_BIT32(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_qword).eq_u32[1] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(32))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_QWORD_BIT64(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] &= \ __CPU_TO_LE_64(~EFX_SHIFT64(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_QWORD_BIT32(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_qword).eq_u32[1] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(32))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_QWORD_BIT64(_qword, _bit) \ @@ -1447,14 +1447,14 @@ extern int fix_lint; do { \ (_dword).ed_u32[0] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_DWORD_BIT(_dword, _bit) \ do { \ (_dword).ed_u32[0] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_DWORD_BIT(_dword, _bit) \ @@ -1466,14 +1466,14 @@ extern int fix_lint; do { \ (_word).ew_u16[0] |= \ __CPU_TO_LE_16(EFX_SHIFT16(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_WORD_BIT(_word, _bit) \ do { \ (_word).ew_u32[0] &= \ __CPU_TO_LE_16(~EFX_SHIFT16(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_WORD_BIT(_word, _bit) \ @@ -1485,14 +1485,14 @@ extern int fix_lint; do { \ (_byte).eb_u8[0] |= \ __NATIVE_8(EFX_SHIFT8(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_BYTE_BIT(_byte, _bit) \ do { \ (_byte).eb_u8[0] &= \ __NATIVE_8(~EFX_SHIFT8(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_BYTE_BIT(_byte, _bit) \ @@ -1504,7 +1504,7 @@ extern int fix_lint; do { \ (_oword1).eo_u64[0] |= (_oword2).eo_u64[0]; \ (_oword1).eo_u64[1] |= (_oword2).eo_u64[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_OWORD32(_oword1, _oword2) \ @@ -1513,14 +1513,14 @@ extern int fix_lint; (_oword1).eo_u32[1] |= (_oword2).eo_u32[1]; \ (_oword1).eo_u32[2] |= (_oword2).eo_u32[2]; \ (_oword1).eo_u32[3] |= (_oword2).eo_u32[3]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_OWORD64(_oword1, _oword2) \ do { \ (_oword1).eo_u64[0] &= (_oword2).eo_u64[0]; \ (_oword1).eo_u64[1] &= (_oword2).eo_u64[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_OWORD32(_oword1, _oword2) \ @@ -1529,69 +1529,69 @@ extern int fix_lint; (_oword1).eo_u32[1] &= (_oword2).eo_u32[1]; \ (_oword1).eo_u32[2] &= (_oword2).eo_u32[2]; \ (_oword1).eo_u32[3] &= (_oword2).eo_u32[3]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_QWORD64(_qword1, _qword2) \ do { \ (_qword1).eq_u64[0] |= (_qword2).eq_u64[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_QWORD32(_qword1, _qword2) \ do { \ (_qword1).eq_u32[0] |= (_qword2).eq_u32[0]; \ (_qword1).eq_u32[1] |= (_qword2).eq_u32[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_QWORD64(_qword1, _qword2) \ do { \ (_qword1).eq_u64[0] &= (_qword2).eq_u64[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_QWORD32(_qword1, _qword2) \ do { \ (_qword1).eq_u32[0] &= (_qword2).eq_u32[0]; \ (_qword1).eq_u32[1] &= (_qword2).eq_u32[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_DWORD(_dword1, _dword2) \ do { \ (_dword1).ed_u32[0] |= (_dword2).ed_u32[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_DWORD(_dword1, _dword2) \ do { \ (_dword1).ed_u32[0] &= (_dword2).ed_u32[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_WORD(_word1, _word2) \ do { \ (_word1).ew_u16[0] |= (_word2).ew_u16[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_WORD(_word1, _word2) \ do { \ (_word1).ew_u16[0] &= (_word2).ew_u16[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_BYTE(_byte1, _byte2) \ do { \ (_byte1).eb_u8[0] |= (_byte2).eb_u8[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_BYTE(_byte1, _byte2) \ do { \ (_byte1).eb_u8[0] &= (_byte2).eb_u8[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #if EFSYS_USE_UINT64 From owner-svn-src-all@freebsd.org Wed Dec 28 11:04:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D58C94BED; Wed, 28 Dec 2016 11:04:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CABC91EEA; Wed, 28 Dec 2016 11:04:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSB4b9K052872; Wed, 28 Dec 2016 11:04:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSB4aik052868; Wed, 28 Dec 2016 11:04:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281104.uBSB4aik052868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310689 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:04:38 -0000 Author: arybchik Date: Wed Dec 28 11:04:36 2016 New Revision: 310689 URL: https://svnweb.freebsd.org/changeset/base/310689 Log: sfxge(4): cleanup: avoid spaces before TAB Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_types.h head/sys/dev/sfxge/common/siena_phy.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Dec 28 11:03:06 2016 (r310688) +++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 11:04:36 2016 (r310689) @@ -169,7 +169,7 @@ extern void efx_nic_unprobe( __in efx_nic_t *enp); -extern void +extern void efx_nic_destroy( __in efx_nic_t *enp); @@ -286,21 +286,21 @@ efx_intr_init( __in efx_intr_type_t type, __in efsys_mem_t *esmp); -extern void +extern void efx_intr_enable( __in efx_nic_t *enp); -extern void +extern void efx_intr_disable( __in efx_nic_t *enp); -extern void +extern void efx_intr_disable_unlocked( __in efx_nic_t *enp); #define EFX_INTR_NEVQS 32 -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_intr_trigger( __in efx_nic_t *enp, __in unsigned int level); @@ -819,7 +819,7 @@ efx_port_poll( __in efx_nic_t *enp, __out_opt efx_link_mode_t *link_modep); -extern void +extern void efx_port_fini( __in efx_nic_t *enp); @@ -1253,7 +1253,7 @@ efx_vpd_verify( __in_bcount(size) caddr_t data, __in size_t size); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_vpd_reinit( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, @@ -1281,7 +1281,7 @@ efx_vpd_next( __out efx_vpd_value_t *evvp, __inout unsigned int *contp); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_vpd_write( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, @@ -1499,7 +1499,7 @@ typedef enum efx_pattern_type_t { EFX_PATTERN_NTYPES } efx_pattern_type_t; -typedef void +typedef void (*efx_sram_pattern_fn_t)( __in size_t row, __in boolean_t negate, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 11:03:06 2016 (r310688) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 11:04:36 2016 (r310689) @@ -913,7 +913,7 @@ struct efx_txq_s { uint32_t, (_edp)->ed_u32[0]); \ EFSYS_BAR_WRITED((_enp)->en_esbp, \ (_reg ## _OFST + \ - (2 * sizeof (efx_dword_t)) + \ + (2 * sizeof (efx_dword_t)) + \ ((_index) * _reg ## _STEP)), \ (_edp), (_lock)); \ _NOTE(CONSTANTCONDITION) \ @@ -928,7 +928,7 @@ struct efx_txq_s { uint32_t, (_edp)->ed_u32[0]); \ EFSYS_BAR_WRITED((_enp)->en_esbp, \ (_reg ## _OFST + \ - (3 * sizeof (efx_dword_t)) + \ + (3 * sizeof (efx_dword_t)) + \ ((_index) * _reg ## _STEP)), \ (_edp), (_lock)); \ _NOTE(CONSTANTCONDITION) \ Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 11:03:06 2016 (r310688) +++ head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 11:04:36 2016 (r310689) @@ -246,7 +246,7 @@ typedef union efx_oword_u { #pragma pack() -#define __SWAP16(_x) \ +#define __SWAP16(_x) \ ((((_x) & 0xff) << 8) | \ (((_x) >> 8) & 0xff)) @@ -1212,16 +1212,16 @@ extern int fix_lint; #define EFX_INSERT_FIELD8(_min, _max, _field, _value) \ __NATIVE_8(EFX_INSERT_FIELD_NATIVE8(_min, _max, _field, _value)) -#define EFX_INPLACE_MASK64(_min, _max, _field) \ +#define EFX_INPLACE_MASK64(_min, _max, _field) \ EFX_INSERT_FIELD64(_min, _max, _field, EFX_MASK64(_field)) -#define EFX_INPLACE_MASK32(_min, _max, _field) \ +#define EFX_INPLACE_MASK32(_min, _max, _field) \ EFX_INSERT_FIELD32(_min, _max, _field, EFX_MASK32(_field)) -#define EFX_INPLACE_MASK16(_min, _max, _field) \ +#define EFX_INPLACE_MASK16(_min, _max, _field) \ EFX_INSERT_FIELD16(_min, _max, _field, EFX_MASK16(_field)) -#define EFX_INPLACE_MASK8(_min, _max, _field) \ +#define EFX_INPLACE_MASK8(_min, _max, _field) \ EFX_INSERT_FIELD8(_min, _max, _field, EFX_MASK8(_field)) #define EFX_SET_OWORD_FIELD64(_oword, _field, _value) \ Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Wed Dec 28 11:03:06 2016 (r310688) +++ head/sys/dev/sfxge/common/siena_phy.c Wed Dec 28 11:04:36 2016 (r310689) @@ -455,7 +455,7 @@ siena_phy_oui_get( } #define SIENA_SIMPLE_STAT_SET2(_vmask, _esmp, _smask, _stat, _record) \ - SIENA_SIMPLE_STAT_SET(_vmask, _esmp, _smask, _stat, \ + SIENA_SIMPLE_STAT_SET(_vmask, _esmp, _smask, _stat, \ MC_CMD_ ## _record, \ EFX_PHY_STAT_ ## _record) From owner-svn-src-all@freebsd.org Wed Dec 28 11:07:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A04DC94C66; Wed, 28 Dec 2016 11:07:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14C221099; Wed, 28 Dec 2016 11:07:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSB7Zb5053112; Wed, 28 Dec 2016 11:07:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSB7Yab053021; Wed, 28 Dec 2016 11:07:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281107.uBSB7Yab053021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310690 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:07:36 -0000 Author: arybchik Date: Wed Dec 28 11:07:34 2016 New Revision: 310690 URL: https://svnweb.freebsd.org/changeset/base/310690 Log: sfxge(4): cleanup: add const qualifier to const array pointer Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Dec 28 11:04:36 2016 (r310689) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Dec 28 11:07:34 2016 (r310690) @@ -1357,8 +1357,8 @@ fail1: #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock b693ddf85aee1bfd */ -static const char *__efx_ev_qstat_name[] = { +/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock c0f3bc5083b40532 */ +static const char * const __efx_ev_qstat_name[] = { "all", "rx", "rx_ok", Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Wed Dec 28 11:04:36 2016 (r310689) +++ head/sys/dev/sfxge/common/efx_mac.c Wed Dec 28 11:07:34 2016 (r310690) @@ -515,8 +515,8 @@ efx_mac_filter_default_rxq_clear( #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxMacStatNamesBlock 054d43a31d2d7a45 */ -static const char *__efx_mac_stat_name[] = { +/* START MKCONFIG GENERATED EfxMacStatNamesBlock c11b91b42f922516 */ +static const char * const __efx_mac_stat_name[] = { "rx_octets", "rx_pkts", "rx_unicst_pkts", Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:04:36 2016 (r310689) +++ head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:07:34 2016 (r310690) @@ -126,8 +126,8 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 31f437eafb0b0437 */ -static const char *__mon_stat_name[] = { +/* START MKCONFIG GENERATED MonitorStatNamesBlock 5daa2a5725ba734b */ +static const char * const __mon_stat_name[] = { "value_2_5v", "value_vccp1", "value_vcc", Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 11:04:36 2016 (r310689) +++ head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 11:07:34 2016 (r310690) @@ -336,8 +336,8 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED PhyStatNamesBlock d5f79b4bc2c050fe */ -static const char *__efx_phy_stat_name[] = { +/* START MKCONFIG GENERATED PhyStatNamesBlock af9ffa24da3bc100 */ +static const char * const __efx_phy_stat_name[] = { "oui", "pma_pmd_link_up", "pma_pmd_rx_fault", Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Wed Dec 28 11:04:36 2016 (r310689) +++ head/sys/dev/sfxge/common/efx_tx.c Wed Dec 28 11:07:34 2016 (r310690) @@ -1029,8 +1029,8 @@ siena_tx_qdesc_dma_create( #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 9d8d26a0a5e2c453 */ -static const char *__efx_tx_qstat_name[] = { +/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 2866874ecd7a363b */ +static const char * const __efx_tx_qstat_name[] = { "post", "post_pio", }; From owner-svn-src-all@freebsd.org Wed Dec 28 11:09:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23A6AC94D9E; Wed, 28 Dec 2016 11:09:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E63221359; Wed, 28 Dec 2016 11:09:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSB9kqO053326; Wed, 28 Dec 2016 11:09:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSB9kYU053324; Wed, 28 Dec 2016 11:09:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281109.uBSB9kYU053324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310691 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:09:47 -0000 Author: arybchik Date: Wed Dec 28 11:09:45 2016 New Revision: 310691 URL: https://svnweb.freebsd.org/changeset/base/310691 Log: sfxge(4): make strings array pointer itself immutable Found by DPDK checkpatches.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/efx_port.c Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:07:34 2016 (r310690) +++ head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:09:45 2016 (r310691) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_NAMES -static const char *__efx_mon_name[] = { +static const char * const __efx_mon_name[] = { "", "sfx90x0", "sfx91x0", Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Wed Dec 28 11:07:34 2016 (r310690) +++ head/sys/dev/sfxge/common/efx_port.c Wed Dec 28 11:09:45 2016 (r310691) @@ -172,7 +172,7 @@ fail1: #if EFSYS_OPT_NAMES -static const char *__efx_loopback_type_name[] = { +static const char * const __efx_loopback_type_name[] = { "OFF", "DATA", "GMAC", From owner-svn-src-all@freebsd.org Wed Dec 28 11:11:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEE68C94F09; Wed, 28 Dec 2016 11:11:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B95081815; Wed, 28 Dec 2016 11:11:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSBBFYM054442; Wed, 28 Dec 2016 11:11:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSBBFD4054439; Wed, 28 Dec 2016 11:11:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281111.uBSBBFD4054439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310692 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:11:17 -0000 Author: arybchik Date: Wed Dec 28 11:11:15 2016 New Revision: 310692 URL: https://svnweb.freebsd.org/changeset/base/310692 Log: sfxge(4): enclose macro complex value in parenthesis Found by DPDK checkpatches.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_bootcfg.c head/sys/dev/sfxge/common/efx_types.h head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 11:09:45 2016 (r310691) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 11:11:15 2016 (r310692) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); */ #define BOOTCFG_MAX_SIZE 0x1000 -#define DHCP_END (uint8_t)0xff -#define DHCP_PAD (uint8_t)0 +#define DHCP_END ((uint8_t)0xff) +#define DHCP_PAD ((uint8_t)0) static __checkReturn uint8_t efx_bootcfg_csum( Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 11:09:45 2016 (r310691) +++ head/sys/dev/sfxge/common/efx_types.h Wed Dec 28 11:11:15 2016 (r310692) @@ -264,37 +264,37 @@ typedef union efx_oword_u { #if EFSYS_IS_BIG_ENDIAN -#define __CPU_TO_LE_16(_x) (uint16_t)__SWAP16(_x) -#define __LE_TO_CPU_16(_x) (uint16_t)__SWAP16(_x) -#define __CPU_TO_BE_16(_x) (uint16_t)__NOSWAP16(_x) -#define __BE_TO_CPU_16(_x) (uint16_t)__NOSWAP16(_x) - -#define __CPU_TO_LE_32(_x) (uint32_t)__SWAP32(_x) -#define __LE_TO_CPU_32(_x) (uint32_t)__SWAP32(_x) -#define __CPU_TO_BE_32(_x) (uint32_t)__NOSWAP32(_x) -#define __BE_TO_CPU_32(_x) (uint32_t)__NOSWAP32(_x) - -#define __CPU_TO_LE_64(_x) (uint64_t)__SWAP64(_x) -#define __LE_TO_CPU_64(_x) (uint64_t)__SWAP64(_x) -#define __CPU_TO_BE_64(_x) (uint64_t)__NOSWAP64(_x) -#define __BE_TO_CPU_64(_x) (uint64_t)__NOSWAP64(_x) +#define __CPU_TO_LE_16(_x) ((uint16_t)__SWAP16(_x)) +#define __LE_TO_CPU_16(_x) ((uint16_t)__SWAP16(_x)) +#define __CPU_TO_BE_16(_x) ((uint16_t)__NOSWAP16(_x)) +#define __BE_TO_CPU_16(_x) ((uint16_t)__NOSWAP16(_x)) + +#define __CPU_TO_LE_32(_x) ((uint32_t)__SWAP32(_x)) +#define __LE_TO_CPU_32(_x) ((uint32_t)__SWAP32(_x)) +#define __CPU_TO_BE_32(_x) ((uint32_t)__NOSWAP32(_x)) +#define __BE_TO_CPU_32(_x) ((uint32_t)__NOSWAP32(_x)) + +#define __CPU_TO_LE_64(_x) ((uint64_t)__SWAP64(_x)) +#define __LE_TO_CPU_64(_x) ((uint64_t)__SWAP64(_x)) +#define __CPU_TO_BE_64(_x) ((uint64_t)__NOSWAP64(_x)) +#define __BE_TO_CPU_64(_x) ((uint64_t)__NOSWAP64(_x)) #elif EFSYS_IS_LITTLE_ENDIAN -#define __CPU_TO_LE_16(_x) (uint16_t)__NOSWAP16(_x) -#define __LE_TO_CPU_16(_x) (uint16_t)__NOSWAP16(_x) -#define __CPU_TO_BE_16(_x) (uint16_t)__SWAP16(_x) -#define __BE_TO_CPU_16(_x) (uint16_t)__SWAP16(_x) - -#define __CPU_TO_LE_32(_x) (uint32_t)__NOSWAP32(_x) -#define __LE_TO_CPU_32(_x) (uint32_t)__NOSWAP32(_x) -#define __CPU_TO_BE_32(_x) (uint32_t)__SWAP32(_x) -#define __BE_TO_CPU_32(_x) (uint32_t)__SWAP32(_x) - -#define __CPU_TO_LE_64(_x) (uint64_t)__NOSWAP64(_x) -#define __LE_TO_CPU_64(_x) (uint64_t)__NOSWAP64(_x) -#define __CPU_TO_BE_64(_x) (uint64_t)__SWAP64(_x) -#define __BE_TO_CPU_64(_x) (uint64_t)__SWAP64(_x) +#define __CPU_TO_LE_16(_x) ((uint16_t)__NOSWAP16(_x)) +#define __LE_TO_CPU_16(_x) ((uint16_t)__NOSWAP16(_x)) +#define __CPU_TO_BE_16(_x) ((uint16_t)__SWAP16(_x)) +#define __BE_TO_CPU_16(_x) ((uint16_t)__SWAP16(_x)) + +#define __CPU_TO_LE_32(_x) ((uint32_t)__NOSWAP32(_x)) +#define __LE_TO_CPU_32(_x) ((uint32_t)__NOSWAP32(_x)) +#define __CPU_TO_BE_32(_x) ((uint32_t)__SWAP32(_x)) +#define __BE_TO_CPU_32(_x) ((uint32_t)__SWAP32(_x)) + +#define __CPU_TO_LE_64(_x) ((uint64_t)__NOSWAP64(_x)) +#define __LE_TO_CPU_64(_x) ((uint64_t)__NOSWAP64(_x)) +#define __CPU_TO_BE_64(_x) ((uint64_t)__SWAP64(_x)) +#define __BE_TO_CPU_64(_x) ((uint64_t)__SWAP64(_x)) #else Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Wed Dec 28 11:09:45 2016 (r310691) +++ head/sys/dev/sfxge/common/mcdi_mon.c Wed Dec 28 11:11:15 2016 (r310692) @@ -38,8 +38,8 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MON_STATS -#define MCDI_MON_NEXT_PAGE (uint16_t)0xfffe -#define MCDI_MON_INVALID_SENSOR (uint16_t)0xfffd +#define MCDI_MON_NEXT_PAGE ((uint16_t)0xfffe) +#define MCDI_MON_INVALID_SENSOR ((uint16_t)0xfffd) #define MCDI_MON_PAGE_SIZE 0x20 /* Bitmasks of valid port(s) for each sensor */ From owner-svn-src-all@freebsd.org Wed Dec 28 11:19:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26A03C94161; Wed, 28 Dec 2016 11:19:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA3CF1AE6; Wed, 28 Dec 2016 11:19:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSBJtlE057552; Wed, 28 Dec 2016 11:19:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSBJsDp057546; Wed, 28 Dec 2016 11:19:54 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281119.uBSBJsDp057546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310693 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:19:56 -0000 Author: arybchik Date: Wed Dec 28 11:19:54 2016 New Revision: 310693 URL: https://svnweb.freebsd.org/changeset/base/310693 Log: sfxge(4): cleanup: avoid unspecified unsigned Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 11:11:15 2016 (r310692) +++ head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 11:19:54 2016 (r310693) @@ -990,7 +990,7 @@ ef10_ev_mcdi( __in_opt void *arg) { efx_nic_t *enp = eep->ee_enp; - unsigned code; + unsigned int code; boolean_t should_abort = B_FALSE; EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE); Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Wed Dec 28 11:11:15 2016 (r310692) +++ head/sys/dev/sfxge/common/ef10_filter.c Wed Dec 28 11:19:54 2016 (r310693) @@ -1246,7 +1246,7 @@ ef10_filter_reconfigure( efx_nic_cfg_t *encp = &enp->en_nic_cfg; ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_flag_t filter_flags; - unsigned i; + unsigned int i; efx_rc_t all_unicst_rc = 0; efx_rc_t all_mulcst_rc = 0; efx_rc_t rc; Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 28 11:11:15 2016 (r310692) +++ head/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 28 11:19:54 2016 (r310693) @@ -772,7 +772,7 @@ ef10_nvram_buffer_create( struct tlv_partition_header header; struct tlv_partition_trailer trailer; - unsigned min_buf_size = sizeof (struct tlv_partition_header) + + unsigned int min_buf_size = sizeof (struct tlv_partition_header) + sizeof (struct tlv_partition_trailer); if (partn_size < min_buf_size) { rc = EINVAL; Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Dec 28 11:11:15 2016 (r310692) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Dec 28 11:19:54 2016 (r310693) @@ -953,7 +953,7 @@ siena_ev_mcdi( __in_opt void *arg) { efx_nic_t *enp = eep->ee_enp; - unsigned code; + unsigned int code; boolean_t should_abort = B_FALSE; EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Wed Dec 28 11:11:15 2016 (r310692) +++ head/sys/dev/sfxge/common/efx_filter.c Wed Dec 28 11:19:54 2016 (r310693) @@ -970,7 +970,7 @@ siena_filter_search( __out int *filter_index, __out unsigned int *depth_required) { - unsigned hash, incr, filter_idx, depth; + unsigned int hash, incr, filter_idx, depth; hash = siena_filter_tbl_hash(key); incr = siena_filter_tbl_increment(key); Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Wed Dec 28 11:11:15 2016 (r310692) +++ head/sys/dev/sfxge/common/siena_vpd.c Wed Dec 28 11:19:54 2016 (r310693) @@ -160,7 +160,7 @@ siena_vpd_init( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); caddr_t svpd = NULL; - unsigned partn; + unsigned int partn; size_t size = 0; efx_rc_t rc; From owner-svn-src-all@freebsd.org Wed Dec 28 11:25:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36FAAC94398; Wed, 28 Dec 2016 11:25:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E238D101F; Wed, 28 Dec 2016 11:25:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSBPIC4061553; Wed, 28 Dec 2016 11:25:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSBPHYt061550; Wed, 28 Dec 2016 11:25:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281125.uBSBPHYt061550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310694 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:25:19 -0000 Author: arybchik Date: Wed Dec 28 11:25:17 2016 New Revision: 310694 URL: https://svnweb.freebsd.org/changeset/base/310694 Log: sfxge(4): cleanup: add missing spaces Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 11:19:54 2016 (r310693) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 11:25:17 2016 (r310694) @@ -124,7 +124,7 @@ typedef struct efx_tx_ops_s { void (*etxo_qenable)(efx_txq_t *); efx_rc_t (*etxo_qpio_enable)(efx_txq_t *); void (*etxo_qpio_disable)(efx_txq_t *); - efx_rc_t (*etxo_qpio_write)(efx_txq_t *,uint8_t *, size_t, + efx_rc_t (*etxo_qpio_write)(efx_txq_t *, uint8_t *, size_t, size_t); efx_rc_t (*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int, unsigned int *); @@ -801,7 +801,7 @@ struct efx_txq_s { #else #define EFX_CHECK_REG(_enp, _reg) do { \ _NOTE(CONSTANTCONDITION) \ - } while(B_FALSE) + } while (B_FALSE) #endif #define EFX_BAR_READD(_enp, _reg, _edp, _lock) \ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 28 11:19:54 2016 (r310693) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 28 11:25:17 2016 (r310694) @@ -1765,7 +1765,7 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable, MAC_STATS_IN_PERIODIC_ENABLE, enable | events, MAC_STATS_IN_PERIODIC_NOEVENT, !events, - MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000: 0); + MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0); if (esmp != NULL) { int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 11:19:54 2016 (r310693) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 11:25:17 2016 (r310694) @@ -66,7 +66,7 @@ efx_mcdi_get_rxdp_config( /* RX DMA end padding is disabled */ end_padding = 0; } else { - switch(MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: end_padding = 64; From owner-svn-src-all@freebsd.org Wed Dec 28 11:28:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02DBBC94461; Wed, 28 Dec 2016 11:28:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C690911E7; Wed, 28 Dec 2016 11:28:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSBSGAj061685; Wed, 28 Dec 2016 11:28:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSBSG2o061684; Wed, 28 Dec 2016 11:28:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281128.uBSBSG2o061684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310695 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:28:18 -0000 Author: arybchik Date: Wed Dec 28 11:28:16 2016 New Revision: 310695 URL: https://svnweb.freebsd.org/changeset/base/310695 Log: sfxge(4): fix defined-but-not-used warning if neither VPD nor NVRAM opt enabled Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Wed Dec 28 11:25:17 2016 (r310694) +++ head/sys/dev/sfxge/common/siena_nic.c Wed Dec 28 11:28:16 2016 (r310695) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA +#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM + static __checkReturn efx_rc_t siena_nic_get_partn_mask( __in efx_nic_t *enp, @@ -78,6 +80,8 @@ fail1: return (rc); } +#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */ + static __checkReturn efx_rc_t siena_board_cfg( __in efx_nic_t *enp) From owner-svn-src-all@freebsd.org Wed Dec 28 11:43:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1E09C948FF; Wed, 28 Dec 2016 11:43:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 823121B49; Wed, 28 Dec 2016 11:43:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSBhBrW069638; Wed, 28 Dec 2016 11:43:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSBhBPo069634; Wed, 28 Dec 2016 11:43:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281143.uBSBhBPo069634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 11:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310696 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 11:43:12 -0000 Author: arybchik Date: Wed Dec 28 11:43:11 2016 New Revision: 310696 URL: https://svnweb.freebsd.org/changeset/base/310696 Log: sfxge(4): cleanup: improve prefast annotations Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 11:28:16 2016 (r310695) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 11:43:11 2016 (r310696) @@ -296,11 +296,11 @@ ef10_mcdi_fini( extern void ef10_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len); + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t ef10_mcdi_poll_response( Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Wed Dec 28 11:28:16 2016 (r310695) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Wed Dec 28 11:43:11 2016 (r310696) @@ -110,11 +110,11 @@ ef10_mcdi_fini( void ef10_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len) + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len) { const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efsys_mem_t *esmp = emtp->emt_dma_mem; Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Wed Dec 28 11:28:16 2016 (r310695) +++ head/sys/dev/sfxge/common/siena_impl.h Wed Dec 28 11:43:11 2016 (r310696) @@ -96,11 +96,11 @@ siena_mcdi_init( extern void siena_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len); + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t siena_mcdi_poll_response( Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Wed Dec 28 11:28:16 2016 (r310695) +++ head/sys/dev/sfxge/common/siena_mcdi.c Wed Dec 28 11:43:11 2016 (r310696) @@ -54,11 +54,11 @@ __FBSDID("$FreeBSD$"); void siena_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len) + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_dword_t dword; From owner-svn-src-all@freebsd.org Wed Dec 28 13:11:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3E20C947E2; Wed, 28 Dec 2016 13:11:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D5BD123E; Wed, 28 Dec 2016 13:11:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSDBMnH003557; Wed, 28 Dec 2016 13:11:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSDBMIa003556; Wed, 28 Dec 2016 13:11:22 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201612281311.uBSDBMIa003556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 28 Dec 2016 13:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310698 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 13:11:23 -0000 Author: araujo Date: Wed Dec 28 13:11:22 2016 New Revision: 310698 URL: https://svnweb.freebsd.org/changeset/base/310698 Log: Print hostcache usage counts with TCP statistics. PR: 196252 Submitted by: Anton Yuzhaninov MFC after: 3 weeks. Modified: head/usr.bin/netstat/inet.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Wed Dec 28 12:23:16 2016 (r310697) +++ head/usr.bin/netstat/inet.c Wed Dec 28 13:11:22 2016 (r310698) @@ -751,6 +751,12 @@ tcp_stats(u_long off, const char *name, "{N:/ignored RSTs in the window%s}\n"); p(tcps_connects, "\t{:connections-established/%ju} " "{N:/connection%s established (including accepts)}\n"); + p(tcps_usedrtt, "\t\t{:connections-hostcache-rtt/%ju} " + "{N:/time%s used RTT from hostcache}\n"); + p(tcps_usedrttvar, "\t\t{:connections-hostcache-rttvar/%ju} " + "{N:/time%s used RTT variance from hostcache}\n"); + p(tcps_usedssthresh, "\t\t{:connections-hostcache-ssthresh/%ju} " + "{N:/time%s used slow-start threshold from hostcache}\n"); p2(tcps_closed, tcps_drops, "\t{:connections-closed/%ju} " "{N:/connection%s closed (including} " "{:connection-drops/%ju} {N:/drop%s})\n"); From owner-svn-src-all@freebsd.org Wed Dec 28 13:28:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69DCCC94D43; Wed, 28 Dec 2016 13:28:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 449B41F0C; Wed, 28 Dec 2016 13:28:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSDSivl011645; Wed, 28 Dec 2016 13:28:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSDSiZr011642; Wed, 28 Dec 2016 13:28:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281328.uBSDSiZr011642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 13:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310699 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 13:28:45 -0000 Author: arybchik Date: Wed Dec 28 13:28:44 2016 New Revision: 310699 URL: https://svnweb.freebsd.org/changeset/base/310699 Log: sfxge(4): rename hunt_bist_* methods to ef10_bist_* Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_phy.c Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 13:11:22 2016 (r310698) +++ head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 13:28:44 2016 (r310699) @@ -65,11 +65,10 @@ static const efx_phy_ops_t __efx_phy_ef1 ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_BIST - /* FIXME: Are these BIST methods appropriate for Medford? */ - hunt_bist_enable_offline, /* epo_bist_enable_offline */ - hunt_bist_start, /* epo_bist_start */ - hunt_bist_poll, /* epo_bist_poll */ - hunt_bist_stop, /* epo_bist_stop */ + ef10_bist_enable_offline, /* epo_bist_enable_offline */ + ef10_bist_start, /* epo_bist_start */ + ef10_bist_poll, /* epo_bist_poll */ + ef10_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Dec 28 13:11:22 2016 (r310698) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Dec 28 13:28:44 2016 (r310699) @@ -75,16 +75,16 @@ hunt_board_cfg( #if EFSYS_OPT_BIST extern __checkReturn efx_rc_t -hunt_bist_enable_offline( +ef10_bist_enable_offline( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_bist_start( +ef10_bist_start( __in efx_nic_t *enp, __in efx_bist_type_t type); extern __checkReturn efx_rc_t -hunt_bist_poll( +ef10_bist_poll( __in efx_nic_t *enp, __in efx_bist_type_t type, __out efx_bist_result_t *resultp, @@ -95,7 +95,7 @@ hunt_bist_poll( __in size_t count); extern void -hunt_bist_stop( +ef10_bist_stop( __in efx_nic_t *enp, __in efx_bist_type_t type); Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Wed Dec 28 13:11:22 2016 (r310698) +++ head/sys/dev/sfxge/common/hunt_phy.c Wed Dec 28 13:28:44 2016 (r310699) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_BIST __checkReturn efx_rc_t -hunt_bist_enable_offline( +ef10_bist_enable_offline( __in efx_nic_t *enp) { efx_rc_t rc; @@ -56,7 +56,7 @@ fail1: } __checkReturn efx_rc_t -hunt_bist_start( +ef10_bist_start( __in efx_nic_t *enp, __in efx_bist_type_t type) { @@ -74,7 +74,7 @@ fail1: } __checkReturn efx_rc_t -hunt_bist_poll( +ef10_bist_poll( __in efx_nic_t *enp, __in efx_bist_type_t type, __out efx_bist_result_t *resultp, @@ -179,11 +179,11 @@ fail1: } void -hunt_bist_stop( +ef10_bist_stop( __in efx_nic_t *enp, __in efx_bist_type_t type) { - /* There is no way to stop BIST on Huntinton. */ + /* There is no way to stop BIST on EF10. */ _NOTE(ARGUNUSED(enp, type)) } From owner-svn-src-all@freebsd.org Wed Dec 28 13:47:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E646AC4F53D; Wed, 28 Dec 2016 13:47:03 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D8DA1D74; Wed, 28 Dec 2016 13:47:03 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qk0-x242.google.com with SMTP id t184so32182583qkd.1; Wed, 28 Dec 2016 05:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=zQZDIPvTWblW6andBDHU5gLMBM8ZL1HkY5OdVOPUHOg=; b=ID2D8osL2JPLGnZ7U+tUck2BvS8PyWCBylQRe5innN2wiR0Ce4YXz+fOP57PW2vN47 atb/Zmep2l25cLUFMiDBxoCIISVe+Xz1ZfAmMLWtLny1UvnJBwqL3XpJef3BisG5E26D 2vUUm8Eh5edXGJldUtWGmg8YmBZGJHdstMY88wQPdxP3Wp8feo0UoS0JEk7r2n7+Yuno vX6tsDaKs8IIfcpHGfzZsJB2dqDGz7nbbhB2JDC9+DNLQXa0yF7HoQqGJmTVBEE8+J5b CcGT8vlPoYhTZaaIP6vu399wgqRbpjEzrQFKdND2DcsZE0UKZ/e+gScZe1hExNKxcABQ 3eLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=zQZDIPvTWblW6andBDHU5gLMBM8ZL1HkY5OdVOPUHOg=; b=dksosO451doLRz0bQ0nbNYqBN7492ErJTWCp/MM1RXewp0iPdkAAdbXWcctj/EWBxh Q7MQIX0Lpw3jj9Ydc1RGNixi7P2B88WiAiOpIXRFAGnc7J2hVfYAQGe87ht6sNfsXSxB Eeo4JqYoK3PBi9RuVrw6BNUNLxnt/cscBtScUklxHDQrM0xMOTJfk+ZFoe5p2sa1d6i7 THv6zkV6bvWa8bVcoPS7mHPb4QcA7FM4A/P27wsKwyAdblRtg/O9h6cbaAhciTqOiV1T jM9Bg24bRBSY48mBcN0jdxddU6U3zlTVFUl9OAECwlSrdt9GDR6Ti+RSvXVJY/e6ZvsC UhnQ== X-Gm-Message-State: AIkVDXIEzjjSrrYyB4tHYYiEFhXtdL5N++MzGfu3mX1Sl5Rpgptb/dcQGcW/726TA4RYaQ== X-Received: by 10.55.95.1 with SMTP id t1mr34991611qkb.277.1482932822847; Wed, 28 Dec 2016 05:47:02 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id p19sm30820689qtp.4.2016.12.28.05.47.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Dec 2016 05:47:02 -0800 (PST) Date: Wed, 28 Dec 2016 08:46:53 -0500 From: Alexander Kabaev To: Adrian Chadd Cc: Alexander Kabaev , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r310650 - in head/sys/mips: include mips Message-ID: <20161228084653.0326caa4@kan> In-Reply-To: References: <201612280255.uBS2tQeR045512@repo.freebsd.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/y/NNRm+pci6OV9c.3sVTdHg"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 13:47:04 -0000 --Sig_/y/NNRm+pci6OV9c.3sVTdHg Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Tue, 27 Dec 2016 21:50:32 -0800 Adrian Chadd wrote: > hiya, >=20 > so I dug into the mips24k definition of this. It says this: >=20 > " > 3.4.3 Uncached accelerated writes > The 24K core permits memory regions to be marked as "uncached > accelerated". This type of region is useful to hard- > ware which is "write only" - perhaps video frame buffers, or some > other hardware stream. Sequential word stores in > such regions are gathered into cache-line-sized chunks, before being > written with a single burst cycle on the CPU > interface. > Such regions are uncached for read, and partial-word or > out-of-sequence writes have "unpredictable" effects - don't > do them. The burst write is normally performed when software writes to > the last location in the memory block or does > an uncached-accelerated write to some other block; but it can also be > triggered by a > sync instruction, a pref nudge, a matching load or any exception. If > the block is not completely written by the time it's pushed out, it > will be written using a series of doubleword or smaller write cycles > over the 24K core's 64-bit memory interface. > " >=20 > So, question is - is our write combining page attribute in the VM > suitable for this? Is it defined as "only do full sequential word > writes"? Or do we risk having some other platform use it in a less > "don't do this" way and then MIPS is the one at fault again? :) >=20 >=20 > -adrian >=20 >=20 FWIW, this is more or less standard verbiage for memory mapped devices and devices is where one would expect framebuffer to reside, so I would not read too much into it. I committed change that does not map UA to WC unconditionally and will let people who need write combining to enable it on a case by case basis. For now, only Ingenic XBursts are doing so as these are ones I have tested. --=20 Alexander Kabaev --Sig_/y/NNRm+pci6OV9c.3sVTdHg Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEExffZlZm2QeE8UVaRBxMimZJ5Ln4FAlhjwk1fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM1 RjdEOTk1OTlCNjQxRTEzQzUxNTY5MTA3MTMyMjk5OTI3OTJFN0UACgkQBxMimZJ5 Ln4O9A/+Ll0BXYm9sUys0R9sxrnrMOTouq+vOB5VCkkx7ztmTuRVX9WaXe51q7T+ e0gRcvr61jViiF+aFJFWEjCWKjkO1jcnSKB3X1Mtz5gy/hiLRnxhdIRlh4DMsQAn Az+KtM1ozixIHaohU2ARQvL+rt/vHkaDng6wwtZ9xnbajNcMeXArXlRBCnzl6mCN igDQo3/i7v7ZcsoufYegsQo87lV/iLPOo4PpStBJxL2IDl9lSXJxY80twRGGRHFt V6rRVRdQbeHYYvg5eNBpXZL209CgChvatSOyqqU97sIsA39ozFV9j1AG4GVrD5+p CGBUvOYE76a8VL7xXAHpipOlNn9dS+bT9MmzB4czYgcUDtySOuYksOKSWilkjNSn ARYVY2AIJpId14mN94qjs3o08QpHzMb53tteRgLTRapgoCct5Je/gAeq0FPaFcBk TnjVAXzLQ5SxBQkLZklJ/VHV8h2NUGWms5jhDF0DHZojPpk/FmBHXRhY41GVNRas P99gZX0LOKH+i4y3njDzbw3FANL53lJUyZxCTvAYV5mq3HbLQDZYeL+OrPWSIO+H DE+gqawrLvJA4JLlwWV/Wx93jTM95I+qbMZaUk9Dn3BbAeeHP31W9fWRtW/qCKaj 5QIV4IzWZULG858cP/Aty7201kA53LJPPDzUCPpLB6y5Q6+VYeo= =PSbE -----END PGP SIGNATURE----- --Sig_/y/NNRm+pci6OV9c.3sVTdHg-- From owner-svn-src-all@freebsd.org Wed Dec 28 13:48:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 891D1C4F654; Wed, 28 Dec 2016 13:48:01 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 590451FBB; Wed, 28 Dec 2016 13:48:01 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSDm0Zf020263; Wed, 28 Dec 2016 13:48:00 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSDm0RL020262; Wed, 28 Dec 2016 13:48:00 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612281348.uBSDm0RL020262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 28 Dec 2016 13:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310700 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 13:48:01 -0000 Author: kan Date: Wed Dec 28 13:48:00 2016 New Revision: 310700 URL: https://svnweb.freebsd.org/changeset/base/310700 Log: Be more conservative when enabling write-combining on MIPS Some MIPS revisions do implement uncached-accelerate caching attribute, but place extra requirement on access, such as partial-word or out-of-sequence writes potentially having an “unpredictable” effects. Modified: head/sys/mips/include/cpuregs.h Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Wed Dec 28 13:28:44 2016 (r310699) +++ head/sys/mips/include/cpuregs.h Wed Dec 28 13:48:00 2016 (r310700) @@ -173,6 +173,7 @@ #if defined(CPU_XBURST) #define MIPS_CCA_UA 0x01 +#define MIPS_CCA_WC MIPS_CCA_UA #endif #ifndef MIPS_CCA_UNCACHED @@ -192,16 +193,6 @@ #endif #endif -/* - * Use uncached-accelerated mode for write-combining maps, if one is defined, - * otherwise fall back to uncached - */ -#ifndef MIPS_CCA_WC -#ifdef MIPS_CCA_UA -#define MIPS_CCA_WC MIPS_CCA_UA -#endif -#endif - #define MIPS_PHYS_TO_XKPHYS(cca,x) \ ((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x)) #define MIPS_PHYS_TO_XKPHYS_CACHED(x) \ From owner-svn-src-all@freebsd.org Wed Dec 28 14:10:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E53C4FE84; Wed, 28 Dec 2016 14:10:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46AA910C6; Wed, 28 Dec 2016 14:10:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSEAXWX029373; Wed, 28 Dec 2016 14:10:33 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSEAXif029372; Wed, 28 Dec 2016 14:10:33 GMT (envelope-from br@FreeBSD.org) Message-Id: <201612281410.uBSEAXif029372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 28 Dec 2016 14:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310701 - head/sys/dev/altera/atse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 14:10:34 -0000 Author: br Date: Wed Dec 28 14:10:33 2016 New Revision: 310701 URL: https://svnweb.freebsd.org/changeset/base/310701 Log: o Fix style. o Remove set but not used variable. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/atse/if_atse.c Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Wed Dec 28 13:48:00 2016 (r310700) +++ head/sys/dev/altera/atse/if_atse.c Wed Dec 28 14:10:33 2016 (r310701) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012,2013 Bjoern A. Zeeb + * Copyright (c) 2012, 2013 Bjoern A. Zeeb * Copyright (c) 2014 Robert N. M. Watson * All rights reserved. * @@ -135,6 +135,7 @@ a_onchip_fifo_mem_core_write(struct reso DPRINTF("[%s:%d] FIFOW %s 0x%08x = 0x%08x\n", f, l, desc, off, val4); bus_write_4(res, off, val4); } + static inline uint32_t a_onchip_fifo_mem_core_read(struct resource *res, uint32_t off, const char *desc, const char *f, const int l) @@ -143,6 +144,7 @@ a_onchip_fifo_mem_core_read(struct resou val4 = le32toh(bus_read_4(res, off)); DPRINTF("[%s:%d] FIFOR %s 0x%08x = 0x%08x\n", f, l, desc, off, val4); + return (val4); } @@ -285,6 +287,7 @@ csr_read_4(struct atse_softc *sc, uint32 val4 = le32toh(bus_read_4(sc->atse_mem_res, reg * 4)); DPRINTF("[%s:%d] CSR R %s 0x%08x (0x%08x) = 0x%08x\n", f, l, "atse_mem_res", reg, reg * 4, val4); + return (val4); } @@ -315,6 +318,7 @@ pxx_read_2(struct atse_softc *sc, bus_ad val = le32toh(val4) & 0x0000ffff; DPRINTF("[%s:%d] %s R %s 0x%08x (0x%08jx) = 0x%04x\n", f, l, s, "atse_mem_res", reg, (bmcr + reg) * 4, val); + return (val); } @@ -343,6 +347,7 @@ atse_tx_locked(struct atse_softc *sc, in { struct mbuf *m; uint32_t val4, fill_level; + int leftm; int c; ATSE_LOCK_ASSERT(sc); @@ -393,15 +398,13 @@ atse_tx_locked(struct atse_softc *sc, in /* Set EOP *before* writing the last symbol. */ if (sc->atse_tx_m_offset >= (sc->atse_tx_buf_len - 4) && fill_level < AVALON_FIFO_TX_BASIC_OPTS_DEPTH) { - int leftm; - uint32_t x; /* Set EndOfPacket. */ val4 = A_ONCHIP_FIFO_MEM_CORE_EOP; + /* Set EMPTY. */ leftm = sc->atse_tx_buf_len - sc->atse_tx_m_offset; val4 |= ((4 - leftm) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); - x = val4; ATSE_TX_META_WRITE(sc, val4); /* Write last symbol. */ @@ -440,7 +443,7 @@ atse_start_locked(struct ifnet *ifp) return; #if 1 - /* + /* * Disable the watchdog while sending, we are batching packets. * Though we should never reach 5 seconds, and are holding the lock, * but who knows. @@ -485,8 +488,8 @@ atse_start(struct ifnet *ifp) static int atse_stop_locked(struct atse_softc *sc) { - struct ifnet *ifp; uint32_t mask, val4; + struct ifnet *ifp; int i; ATSE_LOCK_ASSERT(sc); @@ -527,8 +530,8 @@ atse_stop_locked(struct atse_softc *sc) static uint8_t atse_mchash(struct atse_softc *sc __unused, const uint8_t *addr) { - int i, j; uint8_t x, y; + int i, j; x = 0; for (i = 0; i < ETHER_ADDR_LEN; i++) { @@ -537,14 +540,15 @@ atse_mchash(struct atse_softc *sc __unus y ^= (addr[i] >> j) & 0x01; x |= (y << i); } + return (x); } static int atse_rxfilter_locked(struct atse_softc *sc) { - struct ifnet *ifp; struct ifmultiaddr *ifma; + struct ifnet *ifp; uint32_t val4; int i; @@ -567,7 +571,7 @@ atse_rxfilter_locked(struct atse_softc * for (i = 0; i <= MHASH_LEN; i++) CSR_WRITE_4(sc, MHASH_START + i, 0x1); } else { - /* + /* * Can hold MHASH_LEN entries. * XXX-BZ bitstring.h would be more general. */ @@ -634,8 +638,9 @@ atse_ethernet_option_bits_read(device_t error = atse_ethernet_option_bits_read_fdt(dev); if (error == 0) return (0); - + device_printf(dev, "Cannot read Ethernet addresses from flash.\n"); + return (error); } @@ -789,9 +794,9 @@ atse_set_eth_address(struct atse_softc * static int atse_reset(struct atse_softc *sc) { - int i; uint32_t val4, mask; uint16_t val; + int i; /* 1. External PHY Initialization using MDIO. */ /* @@ -820,6 +825,7 @@ atse_reset(struct atse_softc *sc) val = PCS_READ_2(sc, PCS_CONTROL); val |= PCS_CONTROL_RESET; PCS_WRITE_2(sc, PCS_CONTROL, val); + /* Wait for reset bit to clear; i=100 is excessive. */ for (i = 0; i < 100; i++) { val = PCS_READ_2(sc, PCS_CONTROL); @@ -827,6 +833,7 @@ atse_reset(struct atse_softc *sc) break; DELAY(10); } + if ((val & PCS_CONTROL_RESET) != 0) { device_printf(sc->atse_dev, "PCS reset timed out.\n"); return (ENXIO); @@ -877,7 +884,7 @@ atse_reset(struct atse_softc *sc) CSR_WRITE_4(sc, BASE_CFG_PAUSE_QUANT, 0xFFFF); val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); - /* + /* * If 1000BASE-X/SGMII PCS is initialized, set the ETH_SPEED (bit 3) * and ENA_10 (bit 25) in command_config register to 0. If half duplex * is reported in the PHY/PCS status register, set the HD_ENA (bit 10) @@ -936,7 +943,7 @@ atse_reset(struct atse_softc *sc) device_printf(sc->atse_dev, "MAC reset timed out.\n"); return (ENXIO); } - + /* f. Enable MAC transmit and receive datapath. */ mask = BASE_CFG_COMMAND_CONFIG_TX_ENA|BASE_CFG_COMMAND_CONFIG_RX_ENA; val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); @@ -992,7 +999,7 @@ atse_init_locked(struct atse_softc *sc) sc->atse_flags &= ATSE_FLAGS_LINK; /* Preserve. */ #ifdef DEVICE_POLLING - /* Only enable interrupts if we are not polling. */ + /* Only enable interrupts if we are not polling. */ if (ifp->if_capenable & IFCAP_POLLING) { ATSE_RX_INTR_DISABLE(sc); ATSE_TX_INTR_DISABLE(sc); @@ -1039,7 +1046,6 @@ atse_ioctl(struct ifnet *ifp, u_long com struct ifreq *ifr; int error, mask; - error = 0; sc = ifp->if_softc; ifr = (struct ifreq *)data; @@ -1056,7 +1062,7 @@ atse_ioctl(struct ifnet *ifp, u_long com atse_init_locked(sc); } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) atse_stop_locked(sc); - sc->atse_if_flags = ifp->if_flags; + sc->atse_if_flags = ifp->if_flags; ATSE_UNLOCK(sc); break; case SIOCSIFCAP: @@ -1193,7 +1199,7 @@ atse_tick(void *xsc) /* * Set media options. */ -static int +static int atse_ifmedia_upd(struct ifnet *ifp) { struct atse_softc *sc; @@ -1227,15 +1233,16 @@ atse_update_rx_err(struct atse_softc *sc static int atse_rx_locked(struct atse_softc *sc) { - struct ifnet *ifp; - struct mbuf *m; uint32_t fill, i, j; uint32_t data, meta; - int rx_npkts = 0; + struct ifnet *ifp; + struct mbuf *m; + int rx_npkts; ATSE_LOCK_ASSERT(sc); ifp = sc->atse_ifp; + rx_npkts = 0; j = 0; meta = 0; do { @@ -1294,7 +1301,7 @@ outer: /* XXX-BZ any better counter? */ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } - + if ((sc->atse_flags & ATSE_FLAGS_SOP_SEEN) == 0) { sc->atse_flags |= ATSE_FLAGS_SOP_SEEN; @@ -1403,7 +1410,7 @@ atse_rx_intr(void *arg) if (ifp->if_capenable & IFCAP_POLLING) { ATSE_UNLOCK(sc); return; - } + } #endif atse_intr_debug(sc, "rx"); @@ -1460,7 +1467,7 @@ atse_tx_intr(void *arg) if (ifp->if_capenable & IFCAP_POLLING) { ATSE_UNLOCK(sc); return; - } + } #endif /* XXX-BZ build histogram. */ @@ -1508,7 +1515,7 @@ atse_poll(struct ifnet *ifp, enum poll_c ATSE_LOCK(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ATSE_UNLOCK(sc); - return (rx_npkts); + return (rx_npkts); } sc->atse_rx_cycles = count; @@ -1658,9 +1665,9 @@ static int sysctl_atse_mac_stats_proc(SYSCTL_HANDLER_ARGS) { struct atse_softc *sc; - int error, offset, s; + int error, offset, s; - sc = arg1; + sc = arg1; offset = arg2; s = CSR_READ_4(sc, offset); @@ -1668,7 +1675,7 @@ sysctl_atse_mac_stats_proc(SYSCTL_HANDLE if (error || !req->newptr) return (error); - return (0); + return (0); } static struct atse_rx_err_stats_regs { @@ -1676,12 +1683,12 @@ static struct atse_rx_err_stats_regs { const char *descr; } atse_rx_err_stats_regs[] = { -#define ATSE_RX_ERR_FIFO_THRES_EOP 0 /* FIFO threshold reached, on EOP. */ -#define ATSE_RX_ERR_ELEN 1 /* Frame/payload length not valid. */ -#define ATSE_RX_ERR_CRC32 2 /* CRC-32 error. */ -#define ATSE_RX_ERR_FIFO_THRES_TRUNC 3 /* FIFO thresh., truncated frame. */ -#define ATSE_RX_ERR_4 4 /* ? */ -#define ATSE_RX_ERR_5 5 /* / */ +#define ATSE_RX_ERR_FIFO_THRES_EOP 0 /* FIFO threshold reached, on EOP. */ +#define ATSE_RX_ERR_ELEN 1 /* Frame/payload length not valid. */ +#define ATSE_RX_ERR_CRC32 2 /* CRC-32 error. */ +#define ATSE_RX_ERR_FIFO_THRES_TRUNC 3 /* FIFO thresh., truncated frame. */ +#define ATSE_RX_ERR_4 4 /* ? */ +#define ATSE_RX_ERR_5 5 /* / */ { "rx_err_fifo_thres_eop", "FIFO threshold reached, reported on EOP." }, @@ -1701,9 +1708,9 @@ static int sysctl_atse_rx_err_stats_proc(SYSCTL_HANDLER_ARGS) { struct atse_softc *sc; - int error, offset, s; + int error, offset, s; - sc = arg1; + sc = arg1; offset = arg2; s = sc->atse_rx_err[offset]; @@ -1711,7 +1718,7 @@ sysctl_atse_rx_err_stats_proc(SYSCTL_HAN if (error || !req->newptr) return (error); - return (0); + return (0); } static void @@ -1723,8 +1730,8 @@ atse_sysctl_stats_attach(device_t dev) int i; sc = device_get_softc(dev); - sctx = device_get_sysctl_ctx(dev); - soid = device_get_sysctl_tree(dev); + sctx = device_get_sysctl_ctx(dev); + soid = device_get_sysctl_tree(dev); /* MAC statistics. */ for (i = 0; i < nitems(atse_mac_stats_regs); i++) { @@ -2034,11 +2041,11 @@ atse_miibus_statchg(device_t dev) sc = device_get_softc(dev); ATSE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->atse_miibus); - ifp = sc->atse_ifp; - if (mii == NULL || ifp == NULL || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - return; + mii = device_get_softc(sc->atse_miibus); + ifp = sc->atse_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); @@ -2069,14 +2076,14 @@ atse_miibus_statchg(device_t dev) } } - if ((sc->atse_flags & ATSE_FLAGS_LINK) == 0) { + if ((sc->atse_flags & ATSE_FLAGS_LINK) == 0) { /* XXX-BZ need to stop the MAC? */ - return; - } + return; + } if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) val4 &= ~BASE_CFG_COMMAND_CONFIG_HD_ENA; - else + else val4 |= BASE_CFG_COMMAND_CONFIG_HD_ENA; /* XXX-BZ flow control? */ From owner-svn-src-all@freebsd.org Wed Dec 28 14:25:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4003C94295; Wed, 28 Dec 2016 14:25:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 549191935; Wed, 28 Dec 2016 14:25:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSEP467037215; Wed, 28 Dec 2016 14:25:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSEP4qO037214; Wed, 28 Dec 2016 14:25:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612281425.uBSEP4qO037214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Dec 2016 14:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310702 - head/sys/boot/i386/btx/btxldr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 14:25:05 -0000 Author: emaste Date: Wed Dec 28 14:25:04 2016 New Revision: 310702 URL: https://svnweb.freebsd.org/changeset/base/310702 Log: btxldr: process all PT_LOAD segments, not just the first two With default settings GNU ld generates two PT_LOADs for loader.sym while LLD generates three, because it creates a rodata segment. Previously btxldr terminated phdr processing after two PT_LOADs. Remove the early termination to process all PT_LOADs. Reviewed by: kib, tsoome MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8929 Modified: head/sys/boot/i386/btx/btxldr/btxldr.S Modified: head/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- head/sys/boot/i386/btx/btxldr/btxldr.S Wed Dec 28 14:10:33 2016 (r310701) +++ head/sys/boot/i386/btx/btxldr/btxldr.S Wed Dec 28 14:25:04 2016 (r310702) @@ -198,7 +198,6 @@ start.3: call putstr # message movl $m_segs,%esi # Format string #endif - movl $0x2,%edi # Segment count movl 0x1c(%ebx),%edx # Get e_phoff addl %ebx,%edx # To pointer movzwl 0x2c(%ebx),%ecx # Get e_phnum @@ -216,8 +215,7 @@ start.4: cmpl $0x1,(%edx) # Is p_type P call putstr # End message #endif pushl %esi # Save - pushl %edi # working - pushl %ecx # registers + pushl %ecx # working registers movl 0x4(%edx),%esi # Get p_offset addl %ebx,%esi # as pointer movl 0x8(%edx),%edi # Get p_vaddr @@ -232,13 +230,9 @@ start.4: cmpl $0x1,(%edx) # Is p_type P rep # zero stosb # them start.5: popl %ecx # Restore - popl %edi # working popl %esi # registers - decl %edi # Segments to do - je start.7 # If none start.6: addl $0x20,%edx # To next entry loop start.4 # Till done -start.7: #ifdef BTXLDR_VERBOSE movl $m_done,%esi # Display done call putstr # message From owner-svn-src-all@freebsd.org Wed Dec 28 14:50:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65791C94B39; Wed, 28 Dec 2016 14:50:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3551017DD; Wed, 28 Dec 2016 14:50:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSEod0c046492; Wed, 28 Dec 2016 14:50:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSEodYv046491; Wed, 28 Dec 2016 14:50:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612281450.uBSEodYv046491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 28 Dec 2016 14:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310703 - head/sys/dev/isci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 14:50:40 -0000 Author: mav Date: Wed Dec 28 14:50:39 2016 New Revision: 310703 URL: https://svnweb.freebsd.org/changeset/base/310703 Log: Pass proper arguments (handles, not directly structure pointers) to scif_cb_domain_device_removed(). This should fix NULL dereference on task management function timeout. Reviewed by: jimharris MFC after: 2 weeks Modified: head/sys/dev/isci/isci_task_request.c Modified: head/sys/dev/isci/isci_task_request.c ============================================================================== --- head/sys/dev/isci/isci_task_request.c Wed Dec 28 14:25:04 2016 (r310702) +++ head/sys/dev/isci/isci_task_request.c Wed Dec 28 14:50:39 2016 (r310703) @@ -210,8 +210,9 @@ isci_task_request_complete(SCI_CONTROLLE retry_task = FALSE; isci_log_message(0, "ISCI", "task timeout - not retrying\n"); - scif_cb_domain_device_removed(isci_controller, - isci_remote_device->domain, isci_remote_device); + scif_cb_domain_device_removed(scif_controller, + isci_remote_device->domain->sci_object, + remote_device); } else { retry_task = TRUE; isci_log_message(0, "ISCI", From owner-svn-src-all@freebsd.org Wed Dec 28 15:24:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7D4C947A5; Wed, 28 Dec 2016 15:24:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9F2212C2; Wed, 28 Dec 2016 15:24:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSFOi05061868; Wed, 28 Dec 2016 15:24:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSFOi3K061867; Wed, 28 Dec 2016 15:24:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281524.uBSFOi3K061867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 15:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310704 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 15:24:46 -0000 Author: arybchik Date: Wed Dec 28 15:24:44 2016 New Revision: 310704 URL: https://svnweb.freebsd.org/changeset/base/310704 Log: sfxge(4): translate MC_CMD_ERR_ERANGE to host errno value This is needed because MCDI command MC_CMD_REKEY can return MC_CMD_ERR_ERANGE. Submitted by: Tom Millington Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 28 14:50:39 2016 (r310703) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 28 15:24:44 2016 (r310704) @@ -646,6 +646,8 @@ efx_mcdi_request_errcode( case MC_CMD_ERR_ENOSPC: return (ENOSPC); #endif + case MC_CMD_ERR_ERANGE: + return (ERANGE); case MC_CMD_ERR_ALLOC_FAIL: return (ENOMEM); From owner-svn-src-all@freebsd.org Wed Dec 28 15:43:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94182C94CD1; Wed, 28 Dec 2016 15:43:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30C401F4F; Wed, 28 Dec 2016 15:43:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSFhIa7069996; Wed, 28 Dec 2016 15:43:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSFhHS0069984; Wed, 28 Dec 2016 15:43:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612281543.uBSFhHS0069984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Dec 2016 15:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310705 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 15:43:19 -0000 Author: pfg Date: Wed Dec 28 15:43:17 2016 New Revision: 310705 URL: https://svnweb.freebsd.org/changeset/base/310705 Log: style(9) cleanups. Just to reduce some of the issues found with indent(1). MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_hash.c head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_mount.h head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/htree.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 15:43:17 2016 (r310705) @@ -81,12 +81,13 @@ static daddr_t ext2_mapsearch(struct m_ */ int ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size, - struct ucred *cred, e4fs_daddr_t *bnp) + struct ucred *cred, e4fs_daddr_t *bnp) { struct m_ext2fs *fs; struct ext2mount *ump; int32_t bno; - int cg; + int cg; + *bnp = 0; fs = ip->i_e2fs; ump = ip->i_ump; @@ -99,11 +100,11 @@ ext2_alloc(struct inode *ip, daddr_t lbn } if (cred == NOCRED) panic("ext2_alloc: missing credential"); -#endif /* INVARIANTS */ +#endif /* INVARIANTS */ if (size == fs->e2fs_bsize && fs->e2fs->e2fs_fbcount == 0) goto nospace; - if (cred->cr_uid != 0 && - fs->e2fs->e2fs_fbcount < fs->e2fs->e2fs_rbcount) + if (cred->cr_uid != 0 && + fs->e2fs->e2fs_fbcount < fs->e2fs->e2fs_rbcount) goto nospace; if (bpref >= fs->e2fs->e2fs_bcount) bpref = 0; @@ -112,7 +113,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn else cg = dtog(fs, bpref); bno = (daddr_t)ext2_hashalloc(ip, cg, bpref, fs->e2fs_bsize, - ext2_alloccg); + ext2_alloccg); if (bno > 0) { /* set next_alloc fields as done in block_getblk */ ip->i_next_alloc_block = lbn; @@ -148,10 +149,12 @@ nospace: static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW, 0, "EXT2FS filesystem"); static int doasyncfree = 1; + SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, "Use asychronous writes to update block pointers when freeing blocks"); static int doreallocblks = 1; + SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, ""); int @@ -171,7 +174,7 @@ ext2_reallocblks(struct vop_reallocblks_ int i, len, start_lvl, end_lvl, pref, ssize; if (doreallocblks == 0) - return (ENOSPC); + return (ENOSPC); vp = ap->a_vp; ip = VTOI(vp); @@ -236,7 +239,7 @@ ext2_reallocblks(struct vop_reallocblks_ ssize = len; } else { #ifdef INVARIANTS - if (start_ap[start_lvl-1].in_lbn == idp->in_lbn) + if (start_ap[start_lvl - 1].in_lbn == idp->in_lbn) panic("ext2_reallocblks: start == end"); #endif ssize = len - (idp->in_off + 1); @@ -253,10 +256,10 @@ ext2_reallocblks(struct vop_reallocblks_ * Search the block map looking for an allocation of the desired size. */ if ((newblk = (e2fs_daddr_t)ext2_hashalloc(ip, dtog(fs, pref), pref, - len, ext2_clusteralloc)) == 0){ + len, ext2_clusteralloc)) == 0) { EXT2_UNLOCK(ump); goto fail; - } + } /* * We have found a new contiguous block. * @@ -267,7 +270,7 @@ ext2_reallocblks(struct vop_reallocblks_ #ifdef DEBUG printf("realloc: ino %ju, lbns %jd-%jd\n\told:", (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); -#endif /* DEBUG */ +#endif /* DEBUG */ blkno = newblk; for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) { if (i == ssize) { @@ -279,15 +282,15 @@ ext2_reallocblks(struct vop_reallocblks_ panic("ext2_reallocblks: alloc mismatch"); #endif #ifdef DEBUG - printf(" %d,", *bap); -#endif /* DEBUG */ + printf(" %d,", *bap); +#endif /* DEBUG */ *bap++ = blkno; } /* * Next we must write out the modified inode and indirect blocks. * For strict correctness, the writes should be synchronous since * the old block values may have been written to disk. In practise - * they are almost never written, but if we are concerned about + * they are almost never written, but if we are concerned about * strict correctness, the `doasyncfree' flag should be set to zero. * * The test on `doasyncfree' should be changed to test a flag @@ -318,18 +321,18 @@ ext2_reallocblks(struct vop_reallocblks_ */ #ifdef DEBUG printf("\n\tnew:"); -#endif /* DEBUG */ +#endif /* DEBUG */ for (blkno = newblk, i = 0; i < len; i++, blkno += fs->e2fs_fpb) { ext2_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->e2fs_bsize); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); #ifdef DEBUG printf(" %d,", blkno); -#endif /* DEBUG */ +#endif /* DEBUG */ } #ifdef DEBUG printf("\n"); -#endif /* DEBUG */ +#endif /* DEBUG */ return (0); fail: @@ -342,7 +345,7 @@ fail: /* * Allocate an inode in the filesystem. - * + * */ int ext2_valloc(struct vnode *pvp, int mode, struct ucred *cred, struct vnode **vpp) @@ -354,7 +357,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ext2mount *ump; ino_t ino, ipref; int i, error, cg; - + *vpp = NULL; pip = VTOI(pvp); fs = pip->i_e2fs; @@ -380,7 +383,7 @@ ext2_valloc(struct vnode *pvp, int mode, ipref = cg * fs->e2fs->e2fs_ipg + 1; ino = (ino_t)ext2_hashalloc(pip, cg, (long)ipref, mode, ext2_nodealloccg); - if (ino == 0) + if (ino == 0) goto noinodes; error = VFS_VGET(pvp->v_mount, ino, LK_EXCLUSIVE, vpp); if (error) { @@ -411,7 +414,7 @@ ext2_valloc(struct vnode *pvp, int mode, */ do { ip->i_gen = arc4random(); - } while ( ip->i_gen == 0); + } while (ip->i_gen == 0); vfs_timestamp(&ts); ip->i_birthtime = ts.tv_sec; @@ -457,7 +460,7 @@ ext2_dirpref(struct inode *pip) avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; avgbfree = fs->e2fs->e2fs_fbcount / fs->e2fs_gcount; - avgndir = fs->e2fs_total_dir / fs->e2fs_gcount; + avgndir = fs->e2fs_total_dir / fs->e2fs_gcount; /* * Force allocation in another cg if creating a first level dir. @@ -481,10 +484,8 @@ ext2_dirpref(struct inode *pip) mincg = cg; minndir = fs->e2fs_gd[cg].ext2bgd_ndirs; } - return (mincg); } - /* * Count various limits which used for * optimal allocation of a directory inode. @@ -507,7 +508,7 @@ ext2_dirpref(struct inode *pip) maxcontigdirs = 1; /* - * Limit number of dirs in one cg and reserve space for + * Limit number of dirs in one cg and reserve space for * regular files, but only if we have no deficit in * inodes or space. */ @@ -539,7 +540,7 @@ ext2_dirpref(struct inode *pip) } /* - * Select the desired position for the next block in a file. + * Select the desired position for the next block in a file. * * we try to mimic what Remy does in inode_getblk/block_getblk * @@ -555,30 +556,34 @@ e4fs_daddr_t ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int indx, e2fs_daddr_t *bap, e2fs_daddr_t blocknr) { - int tmp; + int tmp; + mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED); - /* if the next block is actually what we thought it is, - then set the goal to what we thought it should be - */ + /* + * If the next block is actually what we thought it is, then set the + * goal to what we thought it should be. + */ if (ip->i_next_alloc_block == lbn && ip->i_next_alloc_goal != 0) return ip->i_next_alloc_goal; - /* now check whether we were provided with an array that basically - tells us previous blocks to which we want to stay closeby - */ + /* + * Now check whether we were provided with an array that basically + * tells us previous blocks to which we want to stay close. + */ if (bap) - for (tmp = indx - 1; tmp >= 0; tmp--) - if (bap[tmp]) + for (tmp = indx - 1; tmp >= 0; tmp--) + if (bap[tmp]) return bap[tmp]; - /* else let's fall back to the blocknr, or, if there is none, - follow the rule that a block should be allocated near its inode - */ + /* + * Else lets fall back to the blocknr or, if there is none, follow + * the rule that a block should be allocated near its inode. + */ return blocknr ? blocknr : - (e2fs_daddr_t)(ip->i_block_group * - EXT2_BLOCKS_PER_GROUP(ip->i_e2fs)) + - ip->i_e2fs->e2fs->e2fs_first_dblock; + (e2fs_daddr_t)(ip->i_block_group * + EXT2_BLOCKS_PER_GROUP(ip->i_e2fs)) + + ip->i_e2fs->e2fs->e2fs_first_dblock; } /* @@ -591,7 +596,7 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_ */ static u_long ext2_hashalloc(struct inode *ip, int cg, long pref, int size, - daddr_t (*allocator)(struct inode *, int, daddr_t, int)) + daddr_t (*allocator) (struct inode *, int, daddr_t, int)) { struct m_ext2fs *fs; ino_t result; @@ -655,8 +660,8 @@ ext2_alloccg(struct inode *ip, int cg, d return (0); EXT2_UNLOCK(ump); error = bread(ip->i_devvp, fsbtodb(fs, - fs->e2fs_gd[cg].ext2bgd_b_bitmap), - (int)fs->e2fs_bsize, NOCRED, &bp); + fs->e2fs_gd[cg].ext2bgd_b_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); EXT2_LOCK(ump); @@ -742,9 +747,8 @@ retry: start = 0; goto retry; } - bno = ext2_mapsearch(fs, bbp, bpref); - if (bno < 0){ + if (bno < 0) { brelse(bp); EXT2_LOCK(ump); return (0); @@ -753,7 +757,7 @@ gotit: #ifdef INVARIANTS if (isset(bbp, bno)) { printf("ext2fs_alloccgblk: cg=%d bno=%jd fs=%s\n", - cg, (intmax_t)bno, fs->e2fs_fsmnt); + cg, (intmax_t)bno, fs->e2fs_fsmnt); panic("ext2fs_alloccg: dup alloc"); } #endif @@ -813,9 +817,9 @@ ext2_clusteralloc(struct inode *ip, int * to find no cluster. */ lp = &fs->e2fs_clustersum[cg].cs_sum[len - 1]; - for (i = len - 1; i > 0; i--) - if (*lp-- > 0) - break; + for (i = len - 1; i > 0; i--) + if (*lp-- > 0) + break; fs->e2fs_maxcluster[cg] = i; goto fail; } @@ -890,17 +894,18 @@ ext2_nodealloccg(struct inode *ip, int c struct ext2mount *ump; int error, start, len; char *ibp, *loc; - ipref--; /* to avoid a lot of (ipref -1) */ + + ipref--; /* to avoid a lot of (ipref -1) */ if (ipref == -1) ipref = 0; fs = ip->i_e2fs; ump = ip->i_ump; if (fs->e2fs_gd[cg].ext2bgd_nifree == 0) return (0); - EXT2_UNLOCK(ump); + EXT2_UNLOCK(ump); error = bread(ip->i_devvp, fsbtodb(fs, - fs->e2fs_gd[cg].ext2bgd_i_bitmap), - (int)fs->e2fs_bsize, NOCRED, &bp); + fs->e2fs_gd[cg].ext2bgd_i_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); EXT2_LOCK(ump); @@ -930,7 +935,7 @@ ext2_nodealloccg(struct inode *ip, int c loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { printf("cg = %d, ipref = %lld, fs = %s\n", - cg, (long long)ipref, fs->e2fs_fsmnt); + cg, (long long)ipref, fs->e2fs_fsmnt); panic("ext2fs_nodealloccg: map corrupted"); /* NOTREACHED */ } @@ -948,7 +953,7 @@ gotit: } EXT2_UNLOCK(ump); bdwrite(bp); - return (cg * fs->e2fs->e2fs_ipg + ipref +1); + return (cg * fs->e2fs->e2fs_ipg + ipref + 1); } /* @@ -974,8 +979,8 @@ ext2_blkfree(struct inode *ip, e4fs_dadd return; } error = bread(ip->i_devvp, - fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), - (int)fs->e2fs_bsize, NOCRED, &bp); + fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return; @@ -984,7 +989,7 @@ ext2_blkfree(struct inode *ip, e4fs_dadd bno = dtogd(fs, bno); if (isclr(bbp, bno)) { printf("block = %lld, fs = %s\n", - (long long)bno, fs->e2fs_fsmnt); + (long long)bno, fs->e2fs_fsmnt); panic("ext2_blkfree: freeing free block"); } clrbit(bbp, bno); @@ -1009,7 +1014,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, struct buf *bp; struct ext2mount *ump; int error, cg; - char * ibp; + char *ibp; pip = VTOI(pvp); fs = pip->i_e2fs; @@ -1020,8 +1025,8 @@ ext2_vfree(struct vnode *pvp, ino_t ino, cg = ino_to_cg(fs, ino); error = bread(pip->i_devvp, - fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_i_bitmap), - (int)fs->e2fs_bsize, NOCRED, &bp); + fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_i_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return (0); @@ -1030,7 +1035,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, ino = (ino - 1) % fs->e2fs->e2fs_ipg; if (isclr(ibp, ino)) { printf("ino = %llu, fs = %s\n", - (unsigned long long)ino, fs->e2fs_fsmnt); + (unsigned long long)ino, fs->e2fs_fsmnt); if (fs->e2fs_ronly == 0) panic("ext2_vfree: freeing free inode"); } @@ -1076,7 +1081,7 @@ ext2_mapsearch(struct m_ext2fs *fs, char loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { printf("start = %d, len = %d, fs = %s\n", - start, len, fs->e2fs_fsmnt); + start, len, fs->e2fs_fsmnt); panic("ext2_mapsearch: map corrupted"); /* NOTREACHED */ } @@ -1086,7 +1091,7 @@ ext2_mapsearch(struct m_ext2fs *fs, char /* * Fserr prints the name of a filesystem with an error diagnostic. - * + * * The form of the error message is: * fs: error message */ Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_balloc.c Wed Dec 28 15:43:17 2016 (r310705) @@ -76,22 +76,23 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t ump = ip->i_ump; /* - * check if this is a sequential block allocation. - * If so, increment next_alloc fields to allow ext2_blkpref + * check if this is a sequential block allocation. + * If so, increment next_alloc fields to allow ext2_blkpref * to make a good guess */ if (lbn == ip->i_next_alloc_block + 1) { ip->i_next_alloc_block++; ip->i_next_alloc_goal++; } - /* * The first NDADDR blocks are direct blocks */ if (lbn < NDADDR) { nb = ip->i_db[lbn]; - /* no new block is to be allocated, and no need to expand - the file */ + /* + * no new block is to be allocated, and no need to expand + * the file + */ if (nb != 0 && ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); if (error) { @@ -116,10 +117,13 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t } bp->b_blkno = fsbtodb(fs, nb); } else { - /* Godmar thinks: this shouldn't happen w/o fragments */ - printf("nsize %d(%d) > osize %d(%d) nb %d\n", - (int)nsize, (int)size, (int)osize, - (int)ip->i_size, (int)nb); + /* + * Godmar thinks: this shouldn't happen w/o + * fragments + */ + printf("nsize %d(%d) > osize %d(%d) nb %d\n", + (int)nsize, (int)size, (int)osize, + (int)ip->i_size, (int)nb); panic( "ext2_balloc: Something is terribly wrong"); /* @@ -156,7 +160,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t return (error); #ifdef INVARIANTS if (num < 1) - panic ("ext2_balloc: ext2_getlbns returned indirect block"); + panic("ext2_balloc: ext2_getlbns returned indirect block"); #endif /* * Fetch the first indirect block allocating if necessary. @@ -165,10 +169,10 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t nb = ip->i_ib[indirs[0].in_off]; if (nb == 0) { EXT2_LOCK(ump); - pref = ext2_blkpref(ip, lbn, indirs[0].in_off + - EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); + pref = ext2_blkpref(ip, lbn, indirs[0].in_off + + EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); if ((error = ext2_alloc(ip, lbn, pref, fs->e2fs_bsize, cred, - &newb))) + &newb))) return (error); nb = newb; bp = getblk(vp, indirs[1].in_lbn, fs->e2fs_bsize, 0, 0, 0); @@ -207,8 +211,8 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t EXT2_LOCK(ump); if (pref == 0) pref = ext2_blkpref(ip, lbn, indirs[i].in_off, bap, - bp->b_lblkno); - error = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newb); + bp->b_lblkno); + error = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newb); if (error) { brelse(bp); return (error); @@ -245,8 +249,8 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t */ if (nb == 0) { EXT2_LOCK(ump); - pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0], - bp->b_lblkno); + pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0], + bp->b_lblkno); if ((error = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newb)) != 0) { brelse(bp); @@ -265,7 +269,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t if (flags & IO_SYNC) { bwrite(bp); } else { - if (bp->b_bufsize == fs->e2fs_bsize) + if (bp->b_bufsize == fs->e2fs_bsize) bp->b_flags |= B_CLUSTEROK; bdwrite(bp); } @@ -275,6 +279,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t brelse(bp); if (flags & BA_CLRBUF) { int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT; + if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { error = cluster_read(vp, ip->i_size, lbn, (int)fs->e2fs_bsize, NOCRED, @@ -293,4 +298,3 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t *bpp = nbp; return (0); } - Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_bmap.c Wed Dec 28 15:43:17 2016 (r310705) @@ -95,7 +95,7 @@ ext4_bmapext(struct vnode *vp, int32_t b struct inode *ip; struct m_ext2fs *fs; struct ext4_extent *ep; - struct ext4_extent_path path = { .ep_bp = NULL }; + struct ext4_extent_path path = {.ep_bp = NULL}; daddr_t lbn; int error; @@ -163,7 +163,7 @@ ext2_bmaparray(struct vnode *vp, daddr_t struct buf *bp; struct ext2mount *ump; struct mount *mp; - struct indir a[NIADDR+1], *ap; + struct indir a[NIADDR + 1], *ap; daddr_t daddr; e2fs_lbn_t metalbn; int error, num, maxrun = 0, bsize; @@ -180,10 +180,8 @@ ext2_bmaparray(struct vnode *vp, daddr_t maxrun = mp->mnt_iosize_max / bsize - 1; *runp = 0; } - - if (runb) { + if (runb) *runb = 0; - } ap = a; @@ -199,6 +197,7 @@ ext2_bmaparray(struct vnode *vp, daddr_t *bnp = -1; } else if (runp) { daddr_t bnb = bn; + for (++bn; bn < NDADDR && *runp < maxrun && is_sequential(ump, ip->i_db[bn - 1], ip->i_db[bn]); ++bn, ++*runp); @@ -213,7 +212,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t return (0); } - /* Get disk address out of indirect block array */ daddr = ip->i_ib[ap->in_off]; @@ -290,7 +288,7 @@ ext2_bmaparray(struct vnode *vp, daddr_t * return a request for a zeroed out buffer if attempts are made * to read a BLK_NOCOPY or BLK_SNAP block. */ - if ((ip->i_flags & SF_SNAPSHOT) && daddr > 0 && daddr < ump->um_seqinc){ + if ((ip->i_flags & SF_SNAPSHOT) && daddr > 0 && daddr < ump->um_seqinc) { *bnp = -1; return (0); } Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_dir.h Wed Dec 28 15:43:17 2016 (r310705) @@ -34,7 +34,7 @@ */ #define EXT2FS_MAXNAMLEN 255 -struct ext2fs_direct { +struct ext2fs_direct { uint32_t e2d_ino; /* inode number of entry */ uint16_t e2d_reclen; /* length of this record */ uint16_t e2d_namlen; /* length of string in e2d_name */ @@ -49,10 +49,10 @@ enum slotstatus { struct ext2fs_searchslot { enum slotstatus slotstatus; - doff_t slotoffset; /* offset of area with free space */ - int slotsize; /* size of area at slotoffset */ - int slotfreespace; /* amount of space free in slot */ - int slotneeded; /* sizeof the entry we are seeking */ + doff_t slotoffset; /* offset of area with free space */ + int slotsize; /* size of area at slotoffset */ + int slotfreespace; /* amount of space free in slot */ + int slotneeded; /* sizeof the entry we are seeking */ }; /* @@ -61,12 +61,13 @@ struct ext2fs_searchslot { * bigger than 255 chars, it's safe to reclaim the extra byte for the * file_type field. */ -struct ext2fs_direct_2 { +struct ext2fs_direct_2 { uint32_t e2d_ino; /* inode number of entry */ uint16_t e2d_reclen; /* length of this record */ - uint8_t e2d_namlen; /* length of string in e2d_name */ - uint8_t e2d_type; /* file type */ - char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */ + uint8_t e2d_namlen; /* length of string in e2d_name */ + uint8_t e2d_type; /* file type */ + char e2d_name[EXT2FS_MAXNAMLEN]; /* name with + * length<=EXT2FS_MAXNAMLEN */ }; /* @@ -97,5 +98,4 @@ struct ext2fs_direct_2 { #define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) #define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ ~EXT2_DIR_ROUND) -#endif /* !_FS_EXT2FS_EXT2_DIR_H_ */ - +#endif /* !_FS_EXT2FS_EXT2_DIR_H_ */ Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_extents.c Wed Dec 28 15:43:17 2016 (r310705) @@ -45,8 +45,7 @@ static bool ext4_ext_binsearch_index(struct inode *ip, struct ext4_extent_path *path, - daddr_t lbn, daddr_t *first_lbn, daddr_t *last_lbn) -{ + daddr_t lbn, daddr_t *first_lbn, daddr_t *last_lbn){ struct ext4_extent_header *ehp = path->ep_header; struct ext4_extent_index *first, *last, *l, *r, *m; @@ -79,7 +78,7 @@ ext4_ext_binsearch_index(struct inode *i static void ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn, - daddr_t first_lbn, daddr_t last_lbn) + daddr_t first_lbn, daddr_t last_lbn) { struct ext4_extent_header *ehp = path->ep_header; struct ext4_extent *first, *l, *r, *m; @@ -167,7 +166,7 @@ ext4_ext_put_cache(struct inode *ip, str */ struct ext4_extent_path * ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *ip, - daddr_t lbn, struct ext4_extent_path *path) + daddr_t lbn, struct ext4_extent_path *path) { struct ext4_extent_header *ehp; uint16_t i; @@ -200,7 +199,7 @@ ext4_ext_find_extent(struct m_ext2fs *fs path->ep_bp = NULL; } error = bread(ip->i_devvp, fsbtodb(fs, nblk), size, NOCRED, - &path->ep_bp); + &path->ep_bp); if (error) { brelse(path->ep_bp); path->ep_bp = NULL; Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_extents.h Wed Dec 28 15:43:17 2016 (r310705) @@ -40,10 +40,10 @@ * Ext4 file system extent on disk. */ struct ext4_extent { - uint32_t e_blk; /* first logical block */ - uint16_t e_len; /* number of blocks */ - uint16_t e_start_hi; /* high 16 bits of physical block */ - uint32_t e_start_lo; /* low 32 bits of physical block */ + uint32_t e_blk; /* first logical block */ + uint16_t e_len; /* number of blocks */ + uint16_t e_start_hi; /* high 16 bits of physical block */ + uint32_t e_start_lo; /* low 32 bits of physical block */ }; /* @@ -61,19 +61,19 @@ struct ext4_extent_index { * Extent tree header. */ struct ext4_extent_header { - uint16_t eh_magic; /* magic number: 0xf30a */ - uint16_t eh_ecount; /* number of valid entries */ - uint16_t eh_max; /* capacity of store in entries */ - uint16_t eh_depth; /* the depth of extent tree */ - uint32_t eh_gen; /* generation of extent tree */ + uint16_t eh_magic; /* magic number: 0xf30a */ + uint16_t eh_ecount; /* number of valid entries */ + uint16_t eh_max; /* capacity of store in entries */ + uint16_t eh_depth; /* the depth of extent tree */ + uint32_t eh_gen; /* generation of extent tree */ }; /* * Save cached extent. */ struct ext4_extent_cache { - daddr_t ec_start; /* extent start */ - uint32_t ec_blk; /* logical block */ + daddr_t ec_start; /* extent start */ + uint32_t ec_blk; /* logical block */ uint32_t ec_len; uint32_t ec_type; }; @@ -84,7 +84,7 @@ struct ext4_extent_cache { struct ext4_extent_path { uint16_t ep_depth; struct buf *ep_bp; - bool ep_is_sparse; + bool ep_is_sparse; union { struct ext4_extent ep_sparse_ext; struct ext4_extent *ep_ext; @@ -97,7 +97,8 @@ struct inode; struct m_ext2fs; int ext4_ext_in_cache(struct inode *, daddr_t, struct ext4_extent *); void ext4_ext_put_cache(struct inode *, struct ext4_extent *, int); -struct ext4_extent_path *ext4_ext_find_extent(struct m_ext2fs *fs, +struct ext4_extent_path * +ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *, daddr_t, struct ext4_extent_path *); -#endif /* !_FS_EXT2FS_EXT2_EXTENTS_H_ */ +#endif /* !_FS_EXT2FS_EXT2_EXTENTS_H_ */ Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_extern.h Wed Dec 28 15:43:17 2016 (r310705) @@ -110,4 +110,4 @@ int ext2_search_dirblock(struct inode *, extern struct vop_vector ext2_vnodeops; extern struct vop_vector ext2_fifoops; -#endif /* !_FS_EXT2FS_EXT2_EXTERN_H_ */ +#endif /* !_FS_EXT2FS_EXT2_EXTERN_H_ */ Modified: head/sys/fs/ext2fs/ext2_hash.c ============================================================================== --- head/sys/fs/ext2fs/ext2_hash.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_hash.c Wed Dec 28 15:43:17 2016 (r310705) @@ -192,7 +192,7 @@ ext2_legacy_hash(const char *name, int l static void ext2_prep_hashbuf(const char *src, int slen, uint32_t *dst, int dlen, - int unsigned_char) + int unsigned_char) { uint32_t padding = slen | (slen << 8) | (slen << 16) | (slen << 24); uint32_t buf_val; @@ -240,8 +240,8 @@ ext2_prep_hashbuf(const char *src, int s int ext2_htree_hash(const char *name, int len, - uint32_t *hash_seed, int hash_version, - uint32_t *hash_major, uint32_t *hash_minor) + uint32_t *hash_seed, int hash_version, + uint32_t *hash_major, uint32_t *hash_minor) { uint32_t hash[4]; uint32_t data[8]; Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_htree.c Wed Dec 28 15:43:17 2016 (r310705) @@ -98,7 +98,7 @@ ext2_htree_has_idx(struct inode *ip) static int ext2_htree_check_next(struct inode *ip, uint32_t hash, const char *name, - struct ext2fs_htree_lookup_info *info) + struct ext2fs_htree_lookup_info *info) { struct vnode *vp = ITOV(ip); struct ext2fs_htree_lookup_level *level; @@ -195,6 +195,7 @@ ext2_htree_release(struct ext2fs_htree_l for (i = 0; i < info->h_levels_num; i++) { struct buf *bp = info->h_levels[i].h_bp; + if (bp != NULL) brelse(bp); } @@ -224,8 +225,8 @@ ext2_htree_node_limit(struct inode *ip) static int ext2_htree_find_leaf(struct inode *ip, const char *name, int namelen, - uint32_t *hash, uint8_t *hash_ver, - struct ext2fs_htree_lookup_info *info) + uint32_t *hash, uint8_t *hash_ver, + struct ext2fs_htree_lookup_info *info) { struct vnode *vp; struct ext2fs *fs; @@ -317,9 +318,9 @@ error: */ int ext2_htree_lookup(struct inode *ip, const char *name, int namelen, - struct buf **bpp, int *entryoffp, doff_t *offp, - doff_t *prevoffp, doff_t *endusefulp, - struct ext2fs_searchslot *ss) + struct buf **bpp, int *entryoffp, doff_t *offp, + doff_t *prevoffp, doff_t *endusefulp, + struct ext2fs_searchslot *ss) { struct vnode *vp; struct ext2fs_htree_lookup_info info; @@ -386,7 +387,7 @@ ext2_htree_lookup(struct inode *ip, cons static int ext2_htree_append_block(struct vnode *vp, char *data, - struct componentname *cnp, uint32_t blksize) + struct componentname *cnp, uint32_t blksize) { struct iovec aiov; struct uio auio; @@ -419,6 +420,7 @@ ext2_htree_writebuf(struct ext2fs_htree_ for (i = 0; i < info->h_levels_num; i++) { struct buf *bp = info->h_levels[i].h_bp; + error = bwrite(bp); if (error) return (error); @@ -429,7 +431,7 @@ ext2_htree_writebuf(struct ext2fs_htree_ static void ext2_htree_insert_entry_to_level(struct ext2fs_htree_lookup_level *level, - uint32_t hash, uint32_t blk) + uint32_t hash, uint32_t blk) { struct ext2fs_htree_entry *target; int entries_num; @@ -449,7 +451,7 @@ ext2_htree_insert_entry_to_level(struct */ static void ext2_htree_insert_entry(struct ext2fs_htree_lookup_info *info, - uint32_t hash, uint32_t blk) + uint32_t hash, uint32_t blk) { struct ext2fs_htree_lookup_level *level; @@ -481,8 +483,8 @@ ext2_htree_cmp_sort_entry(const void *e1 */ static void ext2_append_entry(char *block, uint32_t blksize, - struct ext2fs_direct_2 *last_entry, - struct ext2fs_direct_2 *new_entry) + struct ext2fs_direct_2 *last_entry, + struct ext2fs_direct_2 *new_entry) { uint16_t entry_len; @@ -498,8 +500,8 @@ ext2_append_entry(char *block, uint32_t */ static int ext2_htree_split_dirblock(char *block1, char *block2, uint32_t blksize, - uint32_t *hash_seed, uint8_t hash_version, - uint32_t *split_hash, struct ext2fs_direct_2 *entry) + uint32_t *hash_seed, uint8_t hash_version, + uint32_t *split_hash, struct ext2fs_direct_2 *entry) { int entry_cnt = 0; int size = 0; @@ -585,7 +587,7 @@ ext2_htree_split_dirblock(char *block1, offset += ep->e2d_reclen; if (ep->e2d_ino) { last = (struct ext2fs_direct_2 *) - ((char *)last + entry_len); + ((char *)last + entry_len); entry_len = EXT2_DIR_REC_LEN(ep->e2d_namlen); memcpy((void *)last, (void *)ep, entry_len); last->e2d_reclen = entry_len; @@ -616,7 +618,7 @@ ext2_htree_split_dirblock(char *block1, */ int ext2_htree_create_index(struct vnode *vp, struct componentname *cnp, - struct ext2fs_direct_2 *new_entry) + struct ext2fs_direct_2 *new_entry) { struct buf *bp = NULL; struct inode *dp; @@ -721,7 +723,7 @@ out1: */ int ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_direct_2 *entry, - struct componentname *cnp) + struct componentname *cnp) { struct ext2fs_htree_entry *entries, *leaf_node; struct ext2fs_htree_lookup_info info; @@ -747,7 +749,7 @@ ext2_htree_add_entry(struct vnode *dvp, fs = m_fs->e2fs; blksize = m_fs->e2fs_bsize; - if (ip->i_count != 0) + if (ip->i_count != 0) return ext2_add_entry(dvp, entry); /* Target directory block is full, split it */ @@ -807,6 +809,7 @@ ext2_htree_add_entry(struct vnode *dvp, if (info.h_levels[1].h_entry >= entries + src_ent_num) { struct buf *tmp = info.h_levels[1].h_bp; + info.h_levels[1].h_bp = dst_bp; dst_bp = tmp; Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_inode.c Wed Dec 28 15:43:17 2016 (r310705) @@ -81,11 +81,11 @@ ext2_update(struct vnode *vp, int waitfo return (0); ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED); fs = ip->i_e2fs; - if(fs->e2fs_ronly) + if (fs->e2fs_ronly) return (0); if ((error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->e2fs_bsize, NOCRED, &bp)) != 0) { + (int)fs->e2fs_bsize, NOCRED, &bp)) != 0) { brelse(bp); return (error); } @@ -130,10 +130,10 @@ ext2_truncate(struct vnode *vp, off_t le bo = &ovp->v_bufobj; #endif - ASSERT_VOP_LOCKED(vp, "ext2_truncate"); + ASSERT_VOP_LOCKED(vp, "ext2_truncate"); if (length < 0) - return (EINVAL); + return (EINVAL); if (ovp->v_type == VLNK && oip->i_size < ovp->v_mount->mnt_maxsymlinklen) { @@ -345,7 +345,7 @@ done: bo->bo_clean.bv_cnt != 0)) panic("itrunc3"); BO_UNLOCK(bo); -#endif /* INVARIANTS */ +#endif /* INVARIANTS */ /* * Put back the real size. */ @@ -418,12 +418,11 @@ ext2_indirtrunc(struct inode *ip, daddr_ *countp = 0; return (error); } - bap = (e2fs_daddr_t *)bp->b_data; copy = malloc(fs->e2fs_bsize, M_TEMP, M_WAITOK); bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->e2fs_bsize); bzero((caddr_t)&bap[last + 1], - (NINDIR(fs) - (last + 1)) * sizeof(e2fs_daddr_t)); + (NINDIR(fs) - (last + 1)) * sizeof(e2fs_daddr_t)); if (last == -1) bp->b_flags |= B_INVAL; if (DOINGASYNC(vp)) { Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Wed Dec 28 15:24:44 2016 (r310704) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Wed Dec 28 15:43:17 2016 (r310705) @@ -49,17 +49,17 @@ ext2_print_inode(struct inode *in) struct ext4_extent_header *ehp; struct ext4_extent *ep; - printf( "Inode: %5ju", (uintmax_t)in->i_number); - printf( /* "Inode: %5d" */ - " Type: %10s Mode: 0x%o Flags: 0x%x Version: %d\n", - "n/a", in->i_mode, in->i_flags, in->i_gen); + printf("Inode: %5ju", (uintmax_t)in->i_number); + printf( /* "Inode: %5d" */ + " Type: %10s Mode: 0x%o Flags: 0x%x Version: %d\n", + "n/a", in->i_mode, in->i_flags, in->i_gen); printf("User: %5u Group: %5u Size: %ju\n", in->i_uid, in->i_gid, (uintmax_t)in->i_size); printf("Links: %3d Blockcount: %ju\n", in->i_nlink, (uintmax_t)in->i_blocks); - printf( "ctime: 0x%x", in->i_ctime); - printf( "atime: 0x%x", in->i_atime); - printf( "mtime: 0x%x", in->i_mtime); + printf("ctime: 0x%x", in->i_ctime); + printf("atime: 0x%x", in->i_atime); + printf("mtime: 0x%x", in->i_mtime); if (E2DI_HAS_XTIME(in)) printf("crtime %#x ", in->i_birthtime); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 28 15:57:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C7B2C942D8; Wed, 28 Dec 2016 15:57:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99FEF1B60; Wed, 28 Dec 2016 15:57:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBSFvcr2008544 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 28 Dec 2016 17:57:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBSFvcr2008544 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBSFvc5j008543; Wed, 28 Dec 2016 17:57:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 28 Dec 2016 17:57:38 +0200 From: Konstantin Belousov To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310705 - head/sys/fs/ext2fs Message-ID: <20161228155738.GB1923@kib.kiev.ua> References: <201612281543.uBSFhHS0069984@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612281543.uBSFhHS0069984@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 15:57:44 -0000 On Wed, Dec 28, 2016 at 03:43:17PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Wed Dec 28 15:43:17 2016 > New Revision: 310705 > URL: https://svnweb.freebsd.org/changeset/base/310705 > > Log: > style(9) cleanups. > > Just to reduce some of the issues found with indent(1). > > @@ -81,12 +81,13 @@ static daddr_t ext2_mapsearch(struct m_ > */ > int > ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size, > - struct ucred *cred, e4fs_daddr_t *bnp) > + struct ucred *cred, e4fs_daddr_t *bnp) This is wrong. Indent of the continuation line should be 4 spaces. > { > struct m_ext2fs *fs; From owner-svn-src-all@freebsd.org Wed Dec 28 16:03:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2F00C946DD for ; Wed, 28 Dec 2016 16:03:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm29-vm4.bullet.mail.ne1.yahoo.com (nm29-vm4.bullet.mail.ne1.yahoo.com [98.138.91.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF2C91262 for ; Wed, 28 Dec 2016 16:03:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1482941024; bh=bnz72vtWal7RSZeEhD0s7K/gFjjpXYXmraLJP+PuhW0=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=AxFVbstzQzDqGMW2xoLGVb9OQ1v7NeLeDTroU5bkI2VISvCynEppHhmxAiHDMToyLA8hAifWJrsaVvfy406sFLh5GYa/70GIEicEfi4DFxjM9kywrxoQ7riugitg2efyXjpQn8XHNwhNgqk3JaZMGFMrSs/mZnrUIUt/X3EmSbYxwMtaHrYLNbLXft/GSAaDwcVM7Ui3JdKRdHiWSoy1fzAmQLmHfDtntheA+iVkD0fr2m/fjzViPi03D+itp8Tv72zeHK8YK/TWUsPe4UBqQ7ozU3K/NhR9fRhHLvrZKRE0zySf8kn6nAIbfq8WwHjdgAlDmysau85HUtCiqfFNgA== Received: from [98.138.100.114] by nm29.bullet.mail.ne1.yahoo.com with NNFMP; 28 Dec 2016 16:03:44 -0000 Received: from [98.138.84.44] by tm105.bullet.mail.ne1.yahoo.com with NNFMP; 28 Dec 2016 16:03:44 -0000 Received: from [127.0.0.1] by smtp112.mail.ne1.yahoo.com with NNFMP; 28 Dec 2016 16:03:29 -0000 X-Yahoo-Newman-Id: 941556.47865.bm@smtp112.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6CRUzT8VM1luNzE7PhAAhkNVtC4bTGJuciHOvhBhDzTqM2Q 8wAzFbbcgNI4dKzr1kRXVWO2PthjzTpc8JJIic8.Ai4JvILU98CIcvdfQ43w f0K0Ou9xkIEPcr2nMx4h3VspQiOHjWVcPoNJNHK89sSMg2L_4Mr6br7xQWqC 9ix5J5pzxkzOrDcJMhYhoFIzZntcoWKHk4XcT0FkTkyszvIIDI9TJMgoCAnp GeZ3bTkiC3tOC1Xl33Ls_nRAFqBqkJNSMJGxqDJiQq4XcxDEJDq64e0kohM_ 4e7tHOfvjuwwaLVCvgAW3Lpb_fS2ZtX5IblDNohFd7Zwno12_RZ3xvFSJslz UaUR52_4vHzJZ.VEJ1PgZNtaq5fHE4lxqDiXRoI.KfzxUOMjLQ8G5LQth2ok 2DFVcPb4ditOp.FrDbswAsFhObggjpNmTjIXQkuOg47SAKdjjXfpyQBNIIG8 bEz1czqaIKAxd37I23PHzKFtyEaUDt11.jFovXobF4mFHQhqYkJZ30omAOlt Q6aWsh_nUT36bJyvko..OFUAiTsto4isGW9j8JsXRtLvnsPA- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r310705 - head/sys/fs/ext2fs To: Konstantin Belousov References: <201612281543.uBSFhHS0069984@repo.freebsd.org> <20161228155738.GB1923@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <7e837097-c3f5-fd6c-5059-c982b6e3f533@FreeBSD.org> Date: Wed, 28 Dec 2016 11:05:01 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161228155738.GB1923@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 16:03:51 -0000 On 12/28/16 10:57, Konstantin Belousov wrote: > On Wed, Dec 28, 2016 at 03:43:17PM +0000, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Wed Dec 28 15:43:17 2016 >> New Revision: 310705 >> URL: https://svnweb.freebsd.org/changeset/base/310705 >> >> Log: >> style(9) cleanups. >> >> Just to reduce some of the issues found with indent(1). >> >> @@ -81,12 +81,13 @@ static daddr_t ext2_mapsearch(struct m_ >> */ >> int >> ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size, >> - struct ucred *cred, e4fs_daddr_t *bnp) >> + struct ucred *cred, e4fs_daddr_t *bnp) > This is wrong. Indent of the continuation line should be 4 spaces. > >> { >> struct m_ext2fs *fs; > Thanks, it's easy to miss such cases :(. Pedro. From owner-svn-src-all@freebsd.org Wed Dec 28 16:16:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 105EFC94B91; Wed, 28 Dec 2016 16:16:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D432A1C41; Wed, 28 Dec 2016 16:16:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSGGbu0083281; Wed, 28 Dec 2016 16:16:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSGGbSR083280; Wed, 28 Dec 2016 16:16:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612281616.uBSGGbSR083280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Dec 2016 16:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310706 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 16:16:38 -0000 Author: pfg Date: Wed Dec 28 16:16:36 2016 New Revision: 310706 URL: https://svnweb.freebsd.org/changeset/base/310706 Log: Undo small wrong style change. Reported by: kib Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 15:43:17 2016 (r310705) +++ head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 16:16:36 2016 (r310706) @@ -81,7 +81,7 @@ static daddr_t ext2_mapsearch(struct m_ */ int ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size, - struct ucred *cred, e4fs_daddr_t *bnp) + struct ucred *cred, e4fs_daddr_t *bnp) { struct m_ext2fs *fs; struct ext2mount *ump; From owner-svn-src-all@freebsd.org Wed Dec 28 16:16:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E991CC94BC9; Wed, 28 Dec 2016 16:16:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4B2C1CFF; Wed, 28 Dec 2016 16:16:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSGGm7U083329; Wed, 28 Dec 2016 16:16:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSGGmpZ083328; Wed, 28 Dec 2016 16:16:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612281616.uBSGGmpZ083328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 28 Dec 2016 16:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310707 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 16:16:50 -0000 Author: loos Date: Wed Dec 28 16:16:48 2016 New Revision: 310707 URL: https://svnweb.freebsd.org/changeset/base/310707 Log: Fix the parsing of NPt binat rules. In this specific case the src address can be set to any, which was not accepted prior to this commit. pfSense bug report: https://redmine.pfsense.org/issues/6985 Reviewed by: kp Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sbin/pfctl/parse.y Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Wed Dec 28 16:16:36 2016 (r310706) +++ head/sbin/pfctl/parse.y Wed Dec 28 16:16:48 2016 (r310707) @@ -4195,7 +4195,7 @@ natrule : nataction interface af proto } ; -binatrule : no BINAT natpasslog interface af proto FROM host toipspec tag +binatrule : no BINAT natpasslog interface af proto FROM ipspec toipspec tag tagged rtable redirection { struct pf_rule binat; From owner-svn-src-all@freebsd.org Wed Dec 28 16:21:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70BBEC94F12; Wed, 28 Dec 2016 16:21:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 403AC1191; Wed, 28 Dec 2016 16:21:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSGLkdi085615; Wed, 28 Dec 2016 16:21:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSGLkmh085614; Wed, 28 Dec 2016 16:21:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281621.uBSGLkmh085614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 16:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310708 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 16:21:47 -0000 Author: arybchik Date: Wed Dec 28 16:21:46 2016 New Revision: 310708 URL: https://svnweb.freebsd.org/changeset/base/310708 Log: sfxge(4): do not initialize enumerated type variable to another type Fix build warning generated by ICC. Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Wed Dec 28 16:16:48 2016 (r310707) +++ head/sys/dev/sfxge/common/efx_nic.c Wed Dec 28 16:21:46 2016 (r310708) @@ -556,7 +556,7 @@ efx_nic_destroy( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0); - enp->en_family = 0; + enp->en_family = EFX_FAMILY_INVALID; enp->en_esip = NULL; enp->en_esbp = NULL; enp->en_eslp = NULL; From owner-svn-src-all@freebsd.org Wed Dec 28 16:28:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB264C94FEF; Wed, 28 Dec 2016 16:28:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A7DC1574; Wed, 28 Dec 2016 16:28:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSGS9M6087270; Wed, 28 Dec 2016 16:28:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSGS9Yw087269; Wed, 28 Dec 2016 16:28:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281628.uBSGS9Yw087269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 16:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310709 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 16:28:10 -0000 Author: arybchik Date: Wed Dec 28 16:28:09 2016 New Revision: 310709 URL: https://svnweb.freebsd.org/changeset/base/310709 Log: sfxge(4): fix invalid type of eft_unicst_filter_count Found by clang when boolean_t is defined as bool for DPDK PMD. Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_impl.h Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 16:21:46 2016 (r310708) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 16:28:09 2016 (r310709) @@ -954,7 +954,7 @@ typedef struct ef10_filter_table_s { boolean_t eft_using_rss; uint32_t eft_unicst_filter_indexes[ EFX_EF10_FILTER_UNICAST_FILTERS_MAX]; - boolean_t eft_unicst_filter_count; + uint32_t eft_unicst_filter_count; uint32_t eft_mulcst_filter_indexes[ EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; uint32_t eft_mulcst_filter_count; From owner-svn-src-all@freebsd.org Wed Dec 28 16:34:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AABCC94391; Wed, 28 Dec 2016 16:34:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A3791D46; Wed, 28 Dec 2016 16:34:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSGYnsQ091299; Wed, 28 Dec 2016 16:34:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSGYnGb091298; Wed, 28 Dec 2016 16:34:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612281634.uBSGYnGb091298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 16:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310711 - head/usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 16:34:50 -0000 Author: ngie Date: Wed Dec 28 16:34:49 2016 New Revision: 310711 URL: https://svnweb.freebsd.org/changeset/base/310711 Log: Don't explicitly build tcp wrappers support into bsnmpd; make it conditional on MK_TCP_WRAPPERS != "no" This likely fixes an issue seen where some of the USE_TCPWRAPPERS code didn't work as advertised MFC after: 1 week Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Wed Dec 28 16:30:08 2016 (r310710) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Wed Dec 28 16:34:49 2016 (r310711) @@ -125,9 +125,8 @@ DEFSDIR= ${SHAREDIR}/snmp/defs CFLAGS+= -DSNMPTREE_TYPES CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I. -DUSE_LIBBEGEMOT -CFLAGS+= -DUSE_TCPWRAPPERS CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR_H -DHAVE_STRLCPY -LIBADD= begemot bsnmp wrap +LIBADD= begemot bsnmp LDFLAGS= -Wl,-export-dynamic @@ -135,6 +134,11 @@ LDFLAGS= -Wl,-export-dynamic CFLAGS+= -DHAVE_LIBCRYPTO .endif +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DUSE_TCPWRAPPERS +LIBADD+= wrap +.endif + oid.h: tree.def Makefile gensnmptree -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET} From owner-svn-src-all@freebsd.org Wed Dec 28 17:13:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 449BFC94793; Wed, 28 Dec 2016 17:13:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F2C61D3E; Wed, 28 Dec 2016 17:13:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSHD4It008292; Wed, 28 Dec 2016 17:13:04 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSHD4uJ008289; Wed, 28 Dec 2016 17:13:04 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201612281713.uBSHD4uJ008289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 28 Dec 2016 17:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310712 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:13:05 -0000 Author: marius Date: Wed Dec 28 17:13:03 2016 New Revision: 310712 URL: https://svnweb.freebsd.org/changeset/base/310712 Log: - Use correct offsets into the keys set array. As the elements of this zero-length array are dynamically sized at run-time based on the use of hints, compilers can't be expected to figure out these offsets on their own. [1] - Fix incorrect comparison in cmp_nans(). [2] PR: 204571 [1], 202301 [2] Submitted by: David Binderman [2] MFC after: 3 days Modified: head/usr.bin/sort/coll.c head/usr.bin/sort/coll.h head/usr.bin/sort/radixsort.c Modified: head/usr.bin/sort/coll.c ============================================================================== --- head/usr.bin/sort/coll.c Wed Dec 28 16:34:49 2016 (r310711) +++ head/usr.bin/sort/coll.c Wed Dec 28 17:13:03 2016 (r310712) @@ -105,14 +105,29 @@ clean_keys_array(const struct bwstring * { if (ka) { - for (size_t i = 0; i < keys_num; ++i) - if (ka->key[i].k && ka->key[i].k != s) - bwsfree(ka->key[i].k); + for (size_t i = 0; i < keys_num; ++i) { + const struct key_value *kv; + + kv = get_key_from_keys_array(ka, i); + if (kv->k && kv->k != s) + bwsfree(kv->k); + } memset(ka, 0, keys_array_size()); } } /* + * Get pointer to a key value in the keys set + */ +struct key_value * +get_key_from_keys_array(struct keys_array *ka, size_t ind) +{ + + return ((struct key_value *)((caddr_t)ka->key + + ind * (sizeof(struct key_value) + key_hint_size()))); +} + +/* * Set value of a key in the keys set */ void @@ -122,7 +137,7 @@ set_key_on_keys_array(struct keys_array if (ka && keys_num > ind) { struct key_value *kv; - kv = &(ka->key[ind]); + kv = get_key_from_keys_array(ka, ind); if (kv->k && kv->k != s) bwsfree(kv->k); @@ -156,9 +171,9 @@ sort_list_item_size(struct sort_list_ite if (si->str) ret += bws_memsize(si->str); for (size_t i = 0; i < keys_num; ++i) { - struct key_value *kv; + const struct key_value *kv; - kv = &(si->ka.key[i]); + kv = get_key_from_keys_array(&si->ka, i); if (kv->k != si->str) ret += bws_memsize(kv->k); @@ -475,16 +490,19 @@ get_sort_func(struct sort_mods *sm) int key_coll(struct keys_array *ps1, struct keys_array *ps2, size_t offset) { + struct key_value *kv1, *kv2; struct sort_mods *sm; int res = 0; for (size_t i = 0; i < keys_num; ++i) { + kv1 = get_key_from_keys_array(ps1, i); + kv2 = get_key_from_keys_array(ps2, i); sm = &(keys[i].sm); if (sm->rflag) - res = sm->func(&(ps2->key[i]), &(ps1->key[i]), offset); + res = sm->func(kv2, kv1, offset); else - res = sm->func(&(ps1->key[i]), &(ps2->key[i]), offset); + res = sm->func(kv1, kv2, offset); if (res) break; @@ -1087,7 +1105,7 @@ cmp_nans(double d1, double d2) if (d1 < d2) return (-1); - if (d2 > d2) + if (d1 > d2) return (+1); return (0); } Modified: head/usr.bin/sort/coll.h ============================================================================== --- head/usr.bin/sort/coll.h Wed Dec 28 16:34:49 2016 (r310711) +++ head/usr.bin/sort/coll.h Wed Dec 28 17:13:03 2016 (r310712) @@ -91,7 +91,7 @@ struct key_value { struct bwstring *k; /* key string */ struct key_hint hint[0]; /* key sort hint */ -}; +} __packed; /* * Set of keys container object. @@ -146,6 +146,7 @@ cmpcoll_t get_sort_func(struct sort_mods struct keys_array *keys_array_alloc(void); size_t keys_array_size(void); +struct key_value *get_key_from_keys_array(struct keys_array *ka, size_t ind); void set_key_on_keys_array(struct keys_array *ka, struct bwstring *s, size_t ind); void clean_keys_array(const struct bwstring *s, struct keys_array *ka); Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Wed Dec 28 16:34:49 2016 (r310711) +++ head/usr.bin/sort/radixsort.c Wed Dec 28 17:13:03 2016 (r310712) @@ -243,9 +243,11 @@ add_leaf(struct sort_level *sl, struct s static inline int get_wc_index(struct sort_list_item *sli, size_t level) { + const struct key_value *kv; const struct bwstring *bws; - bws = sli->ka.key[0].k; + kv = get_key_from_keys_array(&sli->ka, 0); + bws = kv->k; if ((BWSLEN(bws) > level)) return (unsigned char) BWS_GET(bws,level); From owner-svn-src-all@freebsd.org Wed Dec 28 17:37:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20C0DC94D33; Wed, 28 Dec 2016 17:37:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1A581904; Wed, 28 Dec 2016 17:37:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0177410A74C; Wed, 28 Dec 2016 12:37:46 -0500 (EST) From: John Baldwin To: Adrian Chadd Cc: Alexander Kabaev , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r310650 - in head/sys/mips: include mips Date: Wed, 28 Dec 2016 09:30:17 -0800 Message-ID: <8608352.T4YV5SIEDd@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201612280255.uBS2tQeR045512@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 28 Dec 2016 12:37:46 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:37:47 -0000 On Tuesday, December 27, 2016 09:50:32 PM Adrian Chadd wrote: > hiya, >=20 > so I dug into the mips24k definition of this. It says this: >=20 > " > 3.4.3 Uncached accelerated writes > The 24K core permits memory regions to be marked as =E2=80=9Cuncached= > accelerated=E2=80=9D. This type of region is useful to hard- > ware which is =E2=80=9Cwrite only=E2=80=9D - perhaps video frame buff= ers, or some > other hardware stream. Sequential word stores in > such regions are gathered into cache-line-sized chunks, before being > written with a single burst cycle on the CPU > interface. > Such regions are uncached for read, and partial-word or > out-of-sequence writes have =E2=80=9Cunpredictable=E2=80=9D effects -= don=E2=80=99t > do them. The burst write is normally performed when software writes t= o > the last location in the memory block or does > an uncached-accelerated write to some other block; but it can also be= > triggered by a > sync instruction, a pref nudge, a matching load or any exception. If > the block is not completely written by the time it=E2=80=99s pushed o= ut, it > will be written using a series of doubleword or smaller write cycles > over the 24K core=E2=80=99s 64-bit memory interface. > " >=20 > So, question is - is our write combining page attribute in the VM > suitable for this? Is it defined as "only do full sequential word > writes"? Or do we risk having some other platform use it in a less > "don't do this" way and then MIPS is the one at fault again? :) The description of WC in the Intel SDM appears to be more forgiving. If you do out-of-sequence writes it won't "lose" the data, but there isn't a strong ordering of when the different regions of a cache line are finally written. Also, different WC store buffers may be written out-of-order (e.g. if you partially fill one line, then fully fill a second line, the second line may be written out, but the first one will= be held for a bit to see if it will be fully filled). However, you never lose the data, and the last thing written will eventually end up being written to the bus. --=20 John Baldwin From owner-svn-src-all@freebsd.org Wed Dec 28 17:45:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 365AAC9502D; Wed, 28 Dec 2016 17:45:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E59151DED; Wed, 28 Dec 2016 17:45:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSHjrZY020475; Wed, 28 Dec 2016 17:45:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSHjquP020469; Wed, 28 Dec 2016 17:45:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281745.uBSHjquP020469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 17:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310713 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:45:54 -0000 Author: arybchik Date: Wed Dec 28 17:45:52 2016 New Revision: 310713 URL: https://svnweb.freebsd.org/changeset/base/310713 Log: sfxge(4): add possibility to control event queue performance profile It is ignored on SFN5xxx/6xxx (aka Siena). Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8931 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/sfxge_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 17:13:03 2016 (r310712) +++ head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 17:45:52 2016 (r310713) @@ -140,6 +140,7 @@ efx_mcdi_init_evq( __in size_t nevs, __in uint32_t irq, __in uint32_t us, + __in uint32_t flags, __in boolean_t low_latency) { efx_mcdi_req_t req; @@ -178,7 +179,20 @@ efx_mcdi_init_evq( * So always enable RX and TX event batching, and enable event cut * through if we want low latency operation. */ - ev_cut_through = low_latency ? 1 : 0; + switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) { + case EFX_EVQ_FLAGS_TYPE_AUTO: + ev_cut_through = low_latency ? 1 : 0; + break; + case EFX_EVQ_FLAGS_TYPE_THROUGHPUT: + ev_cut_through = 0; + break; + case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY: + ev_cut_through = 1; + break; + default: + rc = EINVAL; + goto fail2; + } MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS, INIT_EVQ_IN_FLAG_INTERRUPTING, 1, INIT_EVQ_IN_FLAG_RPTR_DOS, 0, @@ -197,7 +211,7 @@ efx_mcdi_init_evq( unsigned int ticks; if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) - goto fail2; + goto fail3; MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF); @@ -225,18 +239,20 @@ efx_mcdi_init_evq( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail3; + goto fail4; } if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) { rc = EMSGSIZE; - goto fail4; + goto fail5; } /* NOTE: ignore the returned IRQ param as firmware does not set it. */ return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: @@ -257,12 +273,14 @@ efx_mcdi_init_evq_v2( __in efsys_mem_t *esmp, __in size_t nevs, __in uint32_t irq, - __in uint32_t us) + __in uint32_t us, + __in uint32_t flags) { efx_mcdi_req_t req; uint8_t payload[ MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), MC_CMD_INIT_EVQ_V2_OUT_LEN)]; + unsigned int evq_type; efx_qword_t *dma_addr; uint64_t addr; int npages; @@ -286,11 +304,25 @@ efx_mcdi_init_evq_v2( MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance); MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq); + switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) { + case EFX_EVQ_FLAGS_TYPE_AUTO: + evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO; + break; + case EFX_EVQ_FLAGS_TYPE_THROUGHPUT: + evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT; + break; + case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY: + evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY; + break; + default: + rc = EINVAL; + goto fail2; + } MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS, INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1, INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0, INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0, - INIT_EVQ_V2_IN_FLAG_TYPE, MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO); + INIT_EVQ_V2_IN_FLAG_TYPE, evq_type); /* If the value is zero then disable the timer */ if (us == 0) { @@ -302,7 +334,7 @@ efx_mcdi_init_evq_v2( unsigned int ticks; if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) - goto fail2; + goto fail3; MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE, MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF); @@ -330,12 +362,12 @@ efx_mcdi_init_evq_v2( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail3; + goto fail4; } if (req.emr_out_length_used < MC_CMD_INIT_EVQ_V2_OUT_LEN) { rc = EMSGSIZE; - goto fail4; + goto fail5; } /* NOTE: ignore the returned IRQ param as firmware does not set it. */ @@ -345,6 +377,8 @@ efx_mcdi_init_evq_v2( return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: @@ -416,6 +450,7 @@ ef10_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -459,29 +494,30 @@ ef10_ev_qcreate( if (encp->enc_init_evq_v2_supported) { /* * On Medford the low latency license is required to enable RX - * and event cut through and to disable RX batching. We let the - * firmware decide the settings to use. If the adapter has a low - * latency license, it will choose the best settings for low - * latency, otherwise it choose the best settings for - * throughput. + * and event cut through and to disable RX batching. If event + * queue type in flags is auto, we let the firmware decide the + * settings to use. If the adapter has a low latency license, + * it will choose the best settings for low latency, otherwise + * it will choose the best settings for throughput. */ - rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us); + rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us, flags); if (rc != 0) goto fail4; } else { /* - * On Huntington we need to specify the settings to use. We - * favour latency if the adapter is running low-latency firmware - * and throughput otherwise, and assume not support RX batching - * implies the adapter is running low-latency firmware. (This - * is how it's been done since Huntington GA. It doesn't make - * much sense with hindsight as the 'low-latency' firmware - * variant is also best for throughput, and does now support RX - * batching). + * On Huntington we need to specify the settings to use. + * If event queue type in flags is auto, we favour throughput + * if the adapter is running virtualization supporting firmware + * (i.e. the full featured firmware variant) + * and latency otherwise. The Ethernet Virtual Bridging + * capability is used to make this decision. (Note though that + * the low latency firmware variant is also best for + * throughput and corresponding type should be specified + * to choose it.) */ - boolean_t low_latency = encp->enc_rx_batching_enabled ? 0 : 1; - rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, - low_latency); + boolean_t low_latency = encp->enc_datapath_cap_evb ? 0 : 1; + rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, flags, + low_latency); if (rc != 0) goto fail5; } Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 17:13:03 2016 (r310712) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 17:45:52 2016 (r310713) @@ -85,6 +85,7 @@ ef10_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep); void Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Dec 28 17:13:03 2016 (r310712) +++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 17:45:52 2016 (r310713) @@ -1595,6 +1595,11 @@ efx_ev_fini( #define EFX_EVQ_SIZE(_nevs) ((_nevs) * sizeof (efx_qword_t)) #define EFX_EVQ_NBUFS(_nevs) (EFX_EVQ_SIZE(_nevs) / EFX_BUF_SIZE) +#define EFX_EVQ_FLAGS_TYPE_MASK (0x3) +#define EFX_EVQ_FLAGS_TYPE_AUTO (0x0) +#define EFX_EVQ_FLAGS_TYPE_THROUGHPUT (0x1) +#define EFX_EVQ_FLAGS_TYPE_LOW_LATENCY (0x2) + extern __checkReturn efx_rc_t efx_ev_qcreate( __in efx_nic_t *enp, @@ -1603,6 +1608,7 @@ efx_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __deref_out efx_evq_t **eepp); extern void Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Dec 28 17:13:03 2016 (r310712) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Dec 28 17:45:52 2016 (r310713) @@ -71,6 +71,7 @@ siena_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep); static void @@ -228,6 +229,7 @@ efx_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __deref_out efx_evq_t **eepp) { const efx_ev_ops_t *eevop = enp->en_eevop; @@ -264,7 +266,8 @@ efx_ev_qcreate( enp->en_ev_qcount++; *eepp = eep; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, eep)) != 0) + if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, flags, + eep)) != 0) goto fail2; return (0); @@ -1279,6 +1282,7 @@ siena_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 17:13:03 2016 (r310712) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Dec 28 17:45:52 2016 (r310713) @@ -95,7 +95,7 @@ typedef struct efx_ev_ops_s { void (*eevo_fini)(efx_nic_t *); efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int, efsys_mem_t *, size_t, uint32_t, - uint32_t, efx_evq_t *); + uint32_t, uint32_t, efx_evq_t *); void (*eevo_qdestroy)(efx_evq_t *); efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int); void (*eevo_qpost)(efx_evq_t *, uint16_t); Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Wed Dec 28 17:13:03 2016 (r310712) +++ head/sys/dev/sfxge/sfxge_ev.c Wed Dec 28 17:45:52 2016 (r310713) @@ -703,7 +703,8 @@ sfxge_ev_qstart(struct sfxge_softc *sc, /* Create the common code event queue. */ if ((rc = efx_ev_qcreate(sc->enp, index, esmp, evq->entries, - evq->buf_base_id, sc->ev_moderation, &evq->common)) != 0) + evq->buf_base_id, sc->ev_moderation, EFX_EVQ_FLAGS_TYPE_AUTO, + &evq->common)) != 0) goto fail; SFXGE_EVQ_LOCK(evq); From owner-svn-src-all@freebsd.org Wed Dec 28 17:49:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A766C9517C; Wed, 28 Dec 2016 17:49:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D92B31FFF; Wed, 28 Dec 2016 17:49:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSHnYnr020626; Wed, 28 Dec 2016 17:49:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSHnY4m020625; Wed, 28 Dec 2016 17:49:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281749.uBSHnY4m020625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 17:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310714 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:49:35 -0000 Author: arybchik Date: Wed Dec 28 17:49:33 2016 New Revision: 310714 URL: https://svnweb.freebsd.org/changeset/base/310714 Log: sfxge(4): support Medford bootcfg partition layout in common code For Siena and Huntington, the per-port bootcfg (aka expcfg) is stored in a dedicated 4Kbyte partition for each port. For Medford, the per-PF bootcfg is stored in a 2Kbyte sector within a single shared partition. Update the common code to support the new bootcfg layout. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8932 Modified: head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 17:45:52 2016 (r310713) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 17:49:33 2016 (r310714) @@ -38,14 +38,69 @@ __FBSDID("$FreeBSD$"); /* * Maximum size of BOOTCFG block across all nics as understood by SFCgPXE. - * A multiple of 0x100 so trailing 0xff characters don't contrinbute to the - * checksum. + * NOTE: This is larger than the Medford per-PF bootcfg sector. */ #define BOOTCFG_MAX_SIZE 0x1000 #define DHCP_END ((uint8_t)0xff) #define DHCP_PAD ((uint8_t)0) + +/* Report size and offset of bootcfg sector in NVRAM partition. */ +static __checkReturn efx_rc_t +efx_bootcfg_sector( + __in efx_nic_t *enp, + __out size_t *offsetp, + __out size_t *max_sizep) +{ + size_t max_size; + size_t offset; + int rc; + + switch (enp->en_family) { +#if EFSYS_OPT_SIENA + case EFX_FAMILY_SIENA: + max_size = BOOTCFG_MAX_SIZE; + offset = 0; + break; +#endif /* EFSYS_OPT_SIENA */ + +#if EFSYS_OPT_HUNTINGTON + case EFX_FAMILY_HUNTINGTON: + max_size = BOOTCFG_MAX_SIZE; + offset = 0; + break; +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: { + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + + /* Shared partition (array indexed by PF) */ + max_size = 0x0800; + offset = max_size * encp->enc_pf; + break; + } +#endif /* EFSYS_OPT_MEDFORD */ + + default: + EFSYS_ASSERT(0); + rc = ENOTSUP; + goto fail1; + } + EFSYS_ASSERT3U(max_size, <=, BOOTCFG_MAX_SIZE); + + *offsetp = offset; + *max_sizep = max_size; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} + + static __checkReturn uint8_t efx_bootcfg_csum( __in efx_nic_t *enp, @@ -136,40 +191,54 @@ efx_bootcfg_read( { uint8_t *payload = NULL; size_t used_bytes; + size_t partn_length; size_t sector_length; + size_t sector_offset; efx_rc_t rc; - rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, §or_length); + rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length); if (rc != 0) goto fail1; + /* The bootcfg sector may be stored in a (larger) shared partition */ + rc = efx_bootcfg_sector(enp, §or_offset, §or_length); + if (rc != 0) + goto fail2; + + if (sector_length > BOOTCFG_MAX_SIZE) + sector_length = BOOTCFG_MAX_SIZE; + + if (sector_offset + sector_length > partn_length) { + /* Partition is too small */ + rc = EFBIG; + goto fail3; + } + /* - * We need to read the entire BOOTCFG area to ensure we read all the + * We need to read the entire BOOTCFG sector to ensure we read all the * tags, because legacy bootcfg sectors are not guaranteed to end with * a DHCP_END character. If the user hasn't supplied a sufficiently * large buffer then use our own buffer. */ - if (sector_length > BOOTCFG_MAX_SIZE) - sector_length = BOOTCFG_MAX_SIZE; if (sector_length > size) { EFSYS_KMEM_ALLOC(enp->en_esip, sector_length, payload); if (payload == NULL) { rc = ENOMEM; - goto fail2; + goto fail4; } } else payload = (uint8_t *)data; if ((rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) - goto fail3; + goto fail5; - rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, 0, + rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset, (caddr_t)payload, sector_length); efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); if (rc != 0) - goto fail4; + goto fail6; /* Verify that the area is correctly formatted and checksummed */ rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, @@ -205,7 +274,7 @@ efx_bootcfg_read( */ if (used_bytes > size) { rc = ENOSPC; - goto fail5; + goto fail7; } if (sector_length > size) { memcpy(data, payload, used_bytes); @@ -224,15 +293,18 @@ efx_bootcfg_read( return (0); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); + if (sector_length > size) + EFSYS_KMEM_FREE(enp->en_esip, sector_length, payload); fail4: EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); - - if (sector_length > size) - EFSYS_KMEM_FREE(enp->en_esip, sector_length, payload); fail2: EFSYS_PROBE(fail2); fail1: @@ -247,90 +319,109 @@ efx_bootcfg_write( __in_bcount(size) caddr_t data, __in size_t size) { - uint8_t *chunk; + uint8_t *partn_data; uint8_t checksum; + size_t partn_length; size_t sector_length; - size_t chunk_length; + size_t sector_offset; size_t used_bytes; - size_t offset; - size_t remaining; efx_rc_t rc; - rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, §or_length); + rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length); if (rc != 0) goto fail1; + /* The bootcfg sector may be stored in a (larger) shared partition */ + rc = efx_bootcfg_sector(enp, §or_offset, §or_length); + if (rc != 0) + goto fail2; + if (sector_length > BOOTCFG_MAX_SIZE) sector_length = BOOTCFG_MAX_SIZE; + if (sector_offset + sector_length > partn_length) { + /* Partition is too small */ + rc = EFBIG; + goto fail3; + } + if ((rc = efx_bootcfg_verify(enp, data, size, &used_bytes)) != 0) - goto fail2; + goto fail4; /* The caller *must* terminate their block with a DHCP_END character */ - EFSYS_ASSERT(used_bytes >= 2); /* checksum and DHCP_END */ - if ((uint8_t)data[used_bytes - 1] != DHCP_END) { + if ((used_bytes < 2) || ((uint8_t)data[used_bytes - 1] != DHCP_END)) { + /* Block too short or DHCP_END missing */ rc = ENOENT; - goto fail3; + goto fail5; } /* Check that the hardware has support for this much data */ if (used_bytes > MIN(sector_length, BOOTCFG_MAX_SIZE)) { rc = ENOSPC; - goto fail4; + goto fail6; } - rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, &chunk_length); - if (rc != 0) - goto fail5; - - EFSYS_KMEM_ALLOC(enp->en_esip, chunk_length, chunk); - if (chunk == NULL) { + /* + * If the BOOTCFG sector is stored in a shared partition, then we must + * read the whole partition and insert the updated bootcfg sector at the + * correct offset. + */ + EFSYS_KMEM_ALLOC(enp->en_esip, partn_length, partn_data); + if (partn_data == NULL) { rc = ENOMEM; - goto fail6; + goto fail7; } - if ((rc = efx_nvram_erase(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) - goto fail7; + rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL); + if (rc != 0) + goto fail8; + + /* Read the entire partition */ + rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, 0, + (caddr_t)partn_data, partn_length); + if (rc != 0) + goto fail9; /* - * Write the entire sector_length bytes of data in chunks. Zero out - * all data following the DHCP_END, and adjust the checksum + * Insert the BOOTCFG sector into the partition, Zero out all data after + * the DHCP_END tag, and adjust the checksum. */ + (void) memset(partn_data + sector_offset, 0x0, sector_length); + (void) memcpy(partn_data + sector_offset, data, used_bytes); + checksum = efx_bootcfg_csum(enp, data, used_bytes); - for (offset = 0; offset < sector_length; offset += remaining) { - remaining = MIN(chunk_length, sector_length - offset); + partn_data[sector_offset] -= checksum; - /* Fill chunk */ - (void) memset(chunk, 0x0, chunk_length); - if (offset < used_bytes) - memcpy(chunk, data + offset, - MIN(remaining, used_bytes - offset)); - - /* Adjust checksum */ - if (offset == 0) - chunk[0] -= checksum; - - if ((rc = efx_nvram_write_chunk(enp, EFX_NVRAM_BOOTROM_CFG, - offset, (caddr_t)chunk, remaining)) != 0) - goto fail8; + if ((rc = efx_nvram_erase(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + goto fail10; + + if ((rc = efx_nvram_write_chunk(enp, EFX_NVRAM_BOOTROM_CFG, + 0, partn_data, partn_length)) != 0) { + goto fail11; } efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); - EFSYS_KMEM_FREE(enp->en_esip, chunk_length, chunk); + EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); return (0); +fail11: + EFSYS_PROBE(fail11); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); + + efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); fail8: EFSYS_PROBE(fail8); + + EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); fail7: EFSYS_PROBE(fail7); - - EFSYS_KMEM_FREE(enp->en_esip, chunk_length, chunk); fail6: EFSYS_PROBE(fail6); - - efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); fail5: EFSYS_PROBE(fail5); fail4: From owner-svn-src-all@freebsd.org Wed Dec 28 17:50:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37CD3C9522A; Wed, 28 Dec 2016 17:50:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0736813A3; Wed, 28 Dec 2016 17:50:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSHomgj020835; Wed, 28 Dec 2016 17:50:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSHomXd020834; Wed, 28 Dec 2016 17:50:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281750.uBSHomXd020834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 17:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310715 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:50:49 -0000 Author: arybchik Date: Wed Dec 28 17:50:48 2016 New Revision: 310715 URL: https://svnweb.freebsd.org/changeset/base/310715 Log: sfxge(4): fix GET_RXDP_CONFIG usage for multi-PF on Medford On Medford, using MC_CMD_GET_RXDP_CONFIG to query the RX end padding setting is in the ADMIN group, and so fails for unprivileged functions. In that case, assume the largest size supported by Medford hardware (256bytes) to prevent overrun. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8933 Modified: head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 17:49:33 2016 (r310714) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 17:50:48 2016 (r310715) @@ -289,8 +289,13 @@ medford_board_cfg( encp->enc_rx_buf_align_start = 1; /* Get the RX DMA end padding alignment configuration */ - if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) - goto fail11; + if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { + if (rc != EACCES) + goto fail11; + + /* Assume largest tail padding size supported by hardware */ + end_padding = 256; + } encp->enc_rx_buf_align_end = end_padding; /* Alignment for WPTR updates */ From owner-svn-src-all@freebsd.org Wed Dec 28 17:52:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C4DBC953B0; Wed, 28 Dec 2016 17:52:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFC2B17BD; Wed, 28 Dec 2016 17:52:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSHqPbB024142; Wed, 28 Dec 2016 17:52:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSHqORE024140; Wed, 28 Dec 2016 17:52:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281752.uBSHqORE024140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 17:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310716 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:52:26 -0000 Author: arybchik Date: Wed Dec 28 17:52:24 2016 New Revision: 310716 URL: https://svnweb.freebsd.org/changeset/base/310716 Log: sfxge(4): add UEFI ROM support to the common code Submitted by: Andrew Lee Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8934 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 28 17:50:48 2016 (r310715) +++ head/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 28 17:52:24 2016 (r310716) @@ -2175,7 +2175,11 @@ static ef10_parttbl_entry_t medford_part {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} + {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 1, EFX_NVRAM_UEFIROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 2, EFX_NVRAM_UEFIROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 3, EFX_NVRAM_UEFIROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 4, EFX_NVRAM_UEFIROM} }; static __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Dec 28 17:50:48 2016 (r310715) +++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 17:52:24 2016 (r310716) @@ -1311,6 +1311,7 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_FPGA_BACKUP, EFX_NVRAM_DYNAMIC_CFG, EFX_NVRAM_LICENSE, + EFX_NVRAM_UEFIROM, EFX_NVRAM_NTYPES, } efx_nvram_type_t; From owner-svn-src-all@freebsd.org Wed Dec 28 17:56:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBEBFC9551D; Wed, 28 Dec 2016 17:56:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D46E1C14; Wed, 28 Dec 2016 17:56:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSHu32F025484; Wed, 28 Dec 2016 17:56:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSHu3kG025480; Wed, 28 Dec 2016 17:56:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281756.uBSHu3kG025480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 17:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310717 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:56:04 -0000 Author: arybchik Date: Wed Dec 28 17:56:03 2016 New Revision: 310717 URL: https://svnweb.freebsd.org/changeset/base/310717 Log: sfxge(4): move BIST methods from hunt_phy.c to ef10_phy.c Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8935 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_phy.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 17:52:24 2016 (r310716) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Dec 28 17:56:03 2016 (r310717) @@ -602,6 +602,34 @@ ef10_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ +#if EFSYS_OPT_BIST + +extern __checkReturn efx_rc_t +ef10_bist_enable_offline( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_bist_start( + __in efx_nic_t *enp, + __in efx_bist_type_t type); + +extern __checkReturn efx_rc_t +ef10_bist_poll( + __in efx_nic_t *enp, + __in efx_bist_type_t type, + __out efx_bist_result_t *resultp, + __out_opt __drv_when(count > 0, __notnull) + uint32_t *value_maskp, + __out_ecount_opt(count) __drv_when(count > 0, __notnull) + unsigned long *valuesp, + __in size_t count); + +extern void +ef10_bist_stop( + __in efx_nic_t *enp, + __in efx_bist_type_t type); + +#endif /* EFSYS_OPT_BIST */ /* TX */ Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Wed Dec 28 17:52:24 2016 (r310716) +++ head/sys/dev/sfxge/common/ef10_phy.c Wed Dec 28 17:56:03 2016 (r310717) @@ -474,4 +474,157 @@ ef10_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ +#if EFSYS_OPT_BIST + + __checkReturn efx_rc_t +ef10_bist_enable_offline( + __in efx_nic_t *enp) +{ + efx_rc_t rc; + + if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_bist_start( + __in efx_nic_t *enp, + __in efx_bist_type_t type) +{ + efx_rc_t rc; + + if ((rc = efx_mcdi_bist_start(enp, type)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_bist_poll( + __in efx_nic_t *enp, + __in efx_bist_type_t type, + __out efx_bist_result_t *resultp, + __out_opt __drv_when(count > 0, __notnull) + uint32_t *value_maskp, + __out_ecount_opt(count) __drv_when(count > 0, __notnull) + unsigned long *valuesp, + __in size_t count) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, + MCDI_CTL_SDU_LEN_MAX)]; + uint32_t value_mask = 0; + uint32_t result; + efx_rc_t rc; + + _NOTE(ARGUNUSED(type)) + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_POLL_BIST; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) { + rc = EMSGSIZE; + goto fail2; + } + + if (count > 0) + (void) memset(valuesp, '\0', count * sizeof (unsigned long)); + + result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT); + + if (result == MC_CMD_POLL_BIST_FAILED && + req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN && + count > EFX_BIST_MEM_ECC_FATAL) { + if (valuesp != NULL) { + valuesp[EFX_BIST_MEM_TEST] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST); + valuesp[EFX_BIST_MEM_ADDR] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR); + valuesp[EFX_BIST_MEM_BUS] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_BUS); + valuesp[EFX_BIST_MEM_EXPECT] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_EXPECT); + valuesp[EFX_BIST_MEM_ACTUAL] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ACTUAL); + valuesp[EFX_BIST_MEM_ECC] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC); + valuesp[EFX_BIST_MEM_ECC_PARITY] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_PARITY); + valuesp[EFX_BIST_MEM_ECC_FATAL] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_FATAL); + } + value_mask |= (1 << EFX_BIST_MEM_TEST) | + (1 << EFX_BIST_MEM_ADDR) | + (1 << EFX_BIST_MEM_BUS) | + (1 << EFX_BIST_MEM_EXPECT) | + (1 << EFX_BIST_MEM_ACTUAL) | + (1 << EFX_BIST_MEM_ECC) | + (1 << EFX_BIST_MEM_ECC_PARITY) | + (1 << EFX_BIST_MEM_ECC_FATAL); + } else if (result == MC_CMD_POLL_BIST_FAILED && + encp->enc_phy_type == EFX_PHY_XFI_FARMI && + req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MRSFP_LEN && + count > EFX_BIST_FAULT_CODE) { + if (valuesp != NULL) + valuesp[EFX_BIST_FAULT_CODE] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MRSFP_TEST); + value_mask |= 1 << EFX_BIST_FAULT_CODE; + } + + if (value_maskp != NULL) + *value_maskp = value_mask; + + EFSYS_ASSERT(resultp != NULL); + if (result == MC_CMD_POLL_BIST_RUNNING) + *resultp = EFX_BIST_RESULT_RUNNING; + else if (result == MC_CMD_POLL_BIST_PASSED) + *resultp = EFX_BIST_RESULT_PASSED; + else + *resultp = EFX_BIST_RESULT_FAILED; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + void +ef10_bist_stop( + __in efx_nic_t *enp, + __in efx_bist_type_t type) +{ + /* There is no way to stop BIST on EF10. */ + _NOTE(ARGUNUSED(enp, type)) +} + +#endif /* EFSYS_OPT_BIST */ + #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Dec 28 17:52:24 2016 (r310716) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Dec 28 17:56:03 2016 (r310717) @@ -69,39 +69,6 @@ extern __checkReturn efx_rc_t hunt_board_cfg( __in efx_nic_t *enp); - -/* PHY */ - -#if EFSYS_OPT_BIST - -extern __checkReturn efx_rc_t -ef10_bist_enable_offline( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t -ef10_bist_start( - __in efx_nic_t *enp, - __in efx_bist_type_t type); - -extern __checkReturn efx_rc_t -ef10_bist_poll( - __in efx_nic_t *enp, - __in efx_bist_type_t type, - __out efx_bist_result_t *resultp, - __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, - __out_ecount_opt(count) __drv_when(count > 0, __notnull) - unsigned long *valuesp, - __in size_t count); - -extern void -ef10_bist_stop( - __in efx_nic_t *enp, - __in efx_bist_type_t type); - -#endif /* EFSYS_OPT_BIST */ - - #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Wed Dec 28 17:52:24 2016 (r310716) +++ head/sys/dev/sfxge/common/hunt_phy.c Wed Dec 28 17:56:03 2016 (r310717) @@ -36,157 +36,4 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON -#if EFSYS_OPT_BIST - - __checkReturn efx_rc_t -ef10_bist_enable_offline( - __in efx_nic_t *enp) -{ - efx_rc_t rc; - - if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_bist_start( - __in efx_nic_t *enp, - __in efx_bist_type_t type) -{ - efx_rc_t rc; - - if ((rc = efx_mcdi_bist_start(enp, type)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_bist_poll( - __in efx_nic_t *enp, - __in efx_bist_type_t type, - __out efx_bist_result_t *resultp, - __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, - __out_ecount_opt(count) __drv_when(count > 0, __notnull) - unsigned long *valuesp, - __in size_t count) -{ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, - MCDI_CTL_SDU_LEN_MAX)]; - uint32_t value_mask = 0; - uint32_t result; - efx_rc_t rc; - - _NOTE(ARGUNUSED(type)) - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_POLL_BIST; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) { - rc = EMSGSIZE; - goto fail2; - } - - if (count > 0) - (void) memset(valuesp, '\0', count * sizeof (unsigned long)); - - result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT); - - if (result == MC_CMD_POLL_BIST_FAILED && - req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN && - count > EFX_BIST_MEM_ECC_FATAL) { - if (valuesp != NULL) { - valuesp[EFX_BIST_MEM_TEST] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST); - valuesp[EFX_BIST_MEM_ADDR] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR); - valuesp[EFX_BIST_MEM_BUS] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_BUS); - valuesp[EFX_BIST_MEM_EXPECT] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_EXPECT); - valuesp[EFX_BIST_MEM_ACTUAL] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ACTUAL); - valuesp[EFX_BIST_MEM_ECC] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC); - valuesp[EFX_BIST_MEM_ECC_PARITY] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_PARITY); - valuesp[EFX_BIST_MEM_ECC_FATAL] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_FATAL); - } - value_mask |= (1 << EFX_BIST_MEM_TEST) | - (1 << EFX_BIST_MEM_ADDR) | - (1 << EFX_BIST_MEM_BUS) | - (1 << EFX_BIST_MEM_EXPECT) | - (1 << EFX_BIST_MEM_ACTUAL) | - (1 << EFX_BIST_MEM_ECC) | - (1 << EFX_BIST_MEM_ECC_PARITY) | - (1 << EFX_BIST_MEM_ECC_FATAL); - } else if (result == MC_CMD_POLL_BIST_FAILED && - encp->enc_phy_type == EFX_PHY_XFI_FARMI && - req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MRSFP_LEN && - count > EFX_BIST_FAULT_CODE) { - if (valuesp != NULL) - valuesp[EFX_BIST_FAULT_CODE] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MRSFP_TEST); - value_mask |= 1 << EFX_BIST_FAULT_CODE; - } - - if (value_maskp != NULL) - *value_maskp = value_mask; - - EFSYS_ASSERT(resultp != NULL); - if (result == MC_CMD_POLL_BIST_RUNNING) - *resultp = EFX_BIST_RESULT_RUNNING; - else if (result == MC_CMD_POLL_BIST_PASSED) - *resultp = EFX_BIST_RESULT_PASSED; - else - *resultp = EFX_BIST_RESULT_FAILED; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - void -ef10_bist_stop( - __in efx_nic_t *enp, - __in efx_bist_type_t type) -{ - /* There is no way to stop BIST on EF10. */ - _NOTE(ARGUNUSED(enp, type)) -} - -#endif /* EFSYS_OPT_BIST */ - #endif /* EFSYS_OPT_HUNTINGTON */ From owner-svn-src-all@freebsd.org Wed Dec 28 18:04:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3CEFC9590E; Wed, 28 Dec 2016 18:04:19 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B1F6143A; Wed, 28 Dec 2016 18:04:19 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSI4Ib4029398; Wed, 28 Dec 2016 18:04:18 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSI4IDF029397; Wed, 28 Dec 2016 18:04:18 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201612281804.uBSI4IDF029397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Wed, 28 Dec 2016 18:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310718 - head/contrib/bzip2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 18:04:19 -0000 Author: amdmi3 (ports committer) Date: Wed Dec 28 18:04:18 2016 New Revision: 310718 URL: https://svnweb.freebsd.org/changeset/base/310718 Log: bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt MFC after: 2 weeks Differential Revision: D8924 Modified: head/contrib/bzip2/bzip2.c Modified: head/contrib/bzip2/bzip2.c ============================================================================== --- head/contrib/bzip2/bzip2.c Wed Dec 28 17:56:03 2016 (r310717) +++ head/contrib/bzip2/bzip2.c Wed Dec 28 18:04:18 2016 (r310718) @@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *a case '8': blockSize100k = 8; break; case '9': blockSize100k = 9; break; case 'V': - case 'L': license(); break; + case 'L': license(); + exit ( 0 ); + break; case 'v': verbosity++; break; case 'h': usage ( progName ); exit ( 0 ); @@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *a if (ISFLAG("--keep")) keepInputFiles = True; else if (ISFLAG("--small")) smallMode = True; else if (ISFLAG("--quiet")) noisy = False; else - if (ISFLAG("--version")) license(); else - if (ISFLAG("--license")) license(); else + if (ISFLAG("--version")) { license(); exit ( 0 ); } else + if (ISFLAG("--license")) { license(); exit ( 0 ); } else if (ISFLAG("--exponential")) workFactor = 1; else if (ISFLAG("--repetitive-best")) redundant(aa->name); else if (ISFLAG("--repetitive-fast")) redundant(aa->name); else From owner-svn-src-all@freebsd.org Wed Dec 28 18:07:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76715C95AD2; Wed, 28 Dec 2016 18:07:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45E8518B8; Wed, 28 Dec 2016 18:07:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSI7H0I029551; Wed, 28 Dec 2016 18:07:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSI7HEO029550; Wed, 28 Dec 2016 18:07:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281807.uBSI7HEO029550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 18:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310719 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 18:07:18 -0000 Author: arybchik Date: Wed Dec 28 18:07:17 2016 New Revision: 310719 URL: https://svnweb.freebsd.org/changeset/base/310719 Log: sfxge(4): cleanup: remove last use of deprecated function flags with privilege check The function flags were changed to mirror the privileges, but the privileges are preferred. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8936 Modified: head/sys/dev/sfxge/common/ef10_phy.c Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Wed Dec 28 18:04:18 2016 (r310718) +++ head/sys/dev/sfxge/common/ef10_phy.c Wed Dec 28 18:07:17 2016 (r310719) @@ -278,7 +278,6 @@ fail1: ef10_phy_reconfigure( __in efx_nic_t *enp) { - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, @@ -286,9 +285,12 @@ ef10_phy_reconfigure( uint32_t cap_mask; unsigned int led_mode; unsigned int speed; + boolean_t supported; efx_rc_t rc; - if (~encp->enc_func_flags & EFX_NIC_FUNC_LINKCTRL) + if ((rc = efx_mcdi_link_control_supported(enp, &supported)) != 0) + goto fail1; + if (supported == B_FALSE) goto out; (void) memset(payload, 0, sizeof (payload)); @@ -349,7 +351,7 @@ ef10_phy_reconfigure( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail2; } /* And set the blink mode */ @@ -385,11 +387,13 @@ ef10_phy_reconfigure( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } out: return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-all@freebsd.org Wed Dec 28 18:32:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E1BC946C1; Wed, 28 Dec 2016 18:32:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D89FC1C56; Wed, 28 Dec 2016 18:32:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSIWEsZ041096; Wed, 28 Dec 2016 18:32:14 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSIWDIb041093; Wed, 28 Dec 2016 18:32:13 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201612281832.uBSIWDIb041093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 28 Dec 2016 18:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310720 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 18:32:15 -0000 Author: alc Date: Wed Dec 28 18:32:13 2016 New Revision: 310720 URL: https://svnweb.freebsd.org/changeset/base/310720 Log: Relax the object type restrictions on vm_page_alloc_contig(). Specifically, add support for object types that were previously prohibited because they could contain PG_CACHED pages. Roughly halve the number of radix trie operations performed by vm_page_alloc_contig() using the same approach that is employed by vm_page_alloc(). Also, eliminate the radix trie lookup performed with the free page queues lock held. Tidy up the handling of radix trie insert failures in vm_page_alloc() and vm_page_alloc_contig(). Reviewed by: kib, markj Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8878 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_reserv.c head/sys/vm/vm_reserv.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Dec 28 18:07:17 2016 (r310719) +++ head/sys/vm/vm_page.c Wed Dec 28 18:32:13 2016 (r310720) @@ -1486,13 +1486,12 @@ vm_page_alloc(vm_object_t object, vm_pin vm_page_t m, mpred; int flags, req_class; - mpred = 0; /* XXX: pacify gcc */ + mpred = NULL; /* XXX: pacify gcc */ KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), - ("vm_page_alloc: inconsistent object(%p)/req(%x)", (void *)object, - req)); + ("vm_page_alloc: inconsistent object(%p)/req(%x)", object, req)); if (object != NULL) VM_OBJECT_ASSERT_WLOCKED(object); @@ -1596,10 +1595,11 @@ vm_page_alloc(vm_object_t object, vm_pin atomic_subtract_int(&vm_cnt.v_wire_count, 1); m->wire_count = 0; } - m->object = NULL; + KASSERT(m->object == NULL, ("page %p has object", m)); m->oflags = VPO_UNMANAGED; m->busy_lock = VPB_UNBUSIED; - vm_page_free(m); + /* Don't change PG_ZERO. */ + vm_page_free_toq(m); return (NULL); } @@ -1641,6 +1641,8 @@ vm_page_alloc(vm_object_t object, vm_pin * memory attribute setting for the physical pages cannot be configured * to VM_MEMATTR_DEFAULT. * + * The specified object may not contain fictitious pages. + * * The caller must always specify an allocation class. * * allocation classes: @@ -1664,20 +1666,21 @@ vm_page_alloc_contig(vm_object_t object, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { - vm_page_t m, m_tmp, m_ret; - u_int flags; + vm_page_t m, m_ret, mpred; + u_int busy_lock, flags, oflags; int req_class; + mpred = NULL; /* XXX: pacify gcc */ KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), - ("vm_page_alloc: inconsistent object(%p)/req(%x)", (void *)object, + ("vm_page_alloc_contig: inconsistent object(%p)/req(%x)", object, req)); if (object != NULL) { VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(object->type == OBJT_PHYS, - ("vm_page_alloc_contig: object %p isn't OBJT_PHYS", + KASSERT((object->flags & OBJ_FICTITIOUS) == 0, + ("vm_page_alloc_contig: object %p has fictitious pages", object)); } KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); @@ -1689,18 +1692,34 @@ vm_page_alloc_contig(vm_object_t object, if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) req_class = VM_ALLOC_SYSTEM; + if (object != NULL) { + mpred = vm_radix_lookup_le(&object->rtree, pindex); + KASSERT(mpred == NULL || mpred->pindex != pindex, + ("vm_page_alloc_contig: pindex already allocated")); + } + + /* + * Can we allocate the pages without the number of free pages falling + * below the lower bound for the allocation class? + */ mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count >= npages + vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && vm_cnt.v_free_count >= npages + vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && vm_cnt.v_free_count >= npages)) { + /* + * Can we allocate the pages from a reservation? + */ #if VM_NRESERVLEVEL > 0 retry: if (object == NULL || (object->flags & OBJ_COLORED) == 0 || (m_ret = vm_reserv_alloc_contig(object, pindex, npages, - low, high, alignment, boundary)) == NULL) + low, high, alignment, boundary, mpred)) == NULL) #endif + /* + * If not, allocate them from the free page queues. + */ m_ret = vm_phys_alloc_contig(npages, low, high, alignment, boundary); } else { @@ -1732,6 +1751,13 @@ retry: flags = PG_ZERO; if ((req & VM_ALLOC_NODUMP) != 0) flags |= PG_NODUMP; + oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? + VPO_UNMANAGED : 0; + busy_lock = VPB_UNBUSIED; + if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ | VM_ALLOC_SBUSY)) == 0) + busy_lock = VPB_SINGLE_EXCLUSIVER; + if ((req & VM_ALLOC_SBUSY) != 0) + busy_lock = VPB_SHARERS_WORD(1); if ((req & VM_ALLOC_WIRED) != 0) atomic_add_int(&vm_cnt.v_wire_count, npages); if (object != NULL) { @@ -1742,37 +1768,32 @@ retry: for (m = m_ret; m < &m_ret[npages]; m++) { m->aflags = 0; m->flags = (m->flags | PG_NODUMP) & flags; - m->busy_lock = VPB_UNBUSIED; - if (object != NULL) { - if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) == 0) - m->busy_lock = VPB_SINGLE_EXCLUSIVER; - if ((req & VM_ALLOC_SBUSY) != 0) - m->busy_lock = VPB_SHARERS_WORD(1); - } + m->busy_lock = busy_lock; if ((req & VM_ALLOC_WIRED) != 0) m->wire_count = 1; - /* Unmanaged pages don't use "act_count". */ - m->oflags = VPO_UNMANAGED; + m->act_count = 0; + m->oflags = oflags; if (object != NULL) { - if (vm_page_insert(m, object, pindex)) { - if (vm_paging_needed()) - pagedaemon_wakeup(); + if (vm_page_insert_after(m, object, pindex, mpred)) { + pagedaemon_wakeup(); if ((req & VM_ALLOC_WIRED) != 0) - atomic_subtract_int(&vm_cnt.v_wire_count, - npages); - for (m_tmp = m, m = m_ret; - m < &m_ret[npages]; m++) { - if ((req & VM_ALLOC_WIRED) != 0) + atomic_subtract_int( + &vm_cnt.v_wire_count, npages); + KASSERT(m->object == NULL, + ("page %p has object", m)); + mpred = m; + for (m = m_ret; m < &m_ret[npages]; m++) { + if (m <= mpred && + (req & VM_ALLOC_WIRED) != 0) m->wire_count = 0; - if (m >= m_tmp) { - m->object = NULL; - m->oflags |= VPO_UNMANAGED; - } + m->oflags = VPO_UNMANAGED; m->busy_lock = VPB_UNBUSIED; - vm_page_free(m); + /* Don't change PG_ZERO. */ + vm_page_free_toq(m); } return (NULL); } + mpred = m; } else m->pindex = pindex; if (memattr != VM_MEMATTR_DEFAULT) @@ -1791,6 +1812,7 @@ static void vm_page_alloc_check(vm_page_t m) { + KASSERT(m->object == NULL, ("page %p has object", m)); KASSERT(m->queue == PQ_NONE, ("page %p has unexpected queue %d", m, m->queue)); KASSERT(m->wire_count == 0, ("page %p is wired", m)); Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Wed Dec 28 18:07:17 2016 (r310719) +++ head/sys/vm/vm_reserv.c Wed Dec 28 18:32:13 2016 (r310720) @@ -404,14 +404,18 @@ vm_reserv_populate(vm_reserv_t rv, int i * physical address boundary that is a multiple of that value. Both * "alignment" and "boundary" must be a power of two. * + * The page "mpred" must immediately precede the offset "pindex" within the + * specified object. + * * The object and free page queue must be locked. */ vm_page_t vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex, u_long npages, - vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary) + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_page_t mpred) { vm_paddr_t pa, size; - vm_page_t m, m_ret, mpred, msucc; + vm_page_t m, m_ret, msucc; vm_pindex_t first, leftcap, rightcap; vm_reserv_t rv; u_long allocpages, maxpages, minpages; @@ -448,10 +452,11 @@ vm_reserv_alloc_contig(vm_object_t objec /* * Look for an existing reservation. */ - mpred = vm_radix_lookup_le(&object->rtree, pindex); if (mpred != NULL) { + KASSERT(mpred->object == object, + ("vm_reserv_alloc_contig: object doesn't contain mpred")); KASSERT(mpred->pindex < pindex, - ("vm_reserv_alloc_contig: pindex already allocated")); + ("vm_reserv_alloc_contig: mpred doesn't precede pindex")); rv = vm_reserv_from_page(mpred); if (rv->object == object && vm_reserv_has_pindex(rv, pindex)) goto found; @@ -460,7 +465,7 @@ vm_reserv_alloc_contig(vm_object_t objec msucc = TAILQ_FIRST(&object->memq); if (msucc != NULL) { KASSERT(msucc->pindex > pindex, - ("vm_reserv_alloc_contig: pindex already allocated")); + ("vm_reserv_alloc_contig: msucc doesn't succeed pindex")); rv = vm_reserv_from_page(msucc); if (rv->object == object && vm_reserv_has_pindex(rv, pindex)) goto found; Modified: head/sys/vm/vm_reserv.h ============================================================================== --- head/sys/vm/vm_reserv.h Wed Dec 28 18:07:17 2016 (r310719) +++ head/sys/vm/vm_reserv.h Wed Dec 28 18:32:13 2016 (r310720) @@ -47,7 +47,7 @@ */ vm_page_t vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex, u_long npages, vm_paddr_t low, vm_paddr_t high, - u_long alignment, vm_paddr_t boundary); + u_long alignment, vm_paddr_t boundary, vm_page_t mpred); vm_page_t vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); void vm_reserv_break_all(vm_object_t object); From owner-svn-src-all@freebsd.org Wed Dec 28 18:42:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B12D2C94A65; Wed, 28 Dec 2016 18:42:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80E5E12CC; Wed, 28 Dec 2016 18:42:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSIgh8i045936; Wed, 28 Dec 2016 18:42:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSIghfC045935; Wed, 28 Dec 2016 18:42:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612281842.uBSIghfC045935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Dec 2016 18:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310721 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 18:42:44 -0000 Author: jhb Date: Wed Dec 28 18:42:43 2016 New Revision: 310721 URL: https://svnweb.freebsd.org/changeset/base/310721 Log: Mention T6 and 100GbE in description of cxgbe. MFC after: 3 days Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Dec 28 18:32:13 2016 (r310720) +++ head/sys/conf/NOTES Wed Dec 28 18:42:43 2016 (r310721) @@ -1956,8 +1956,9 @@ device xmphy # XaQti XMAC II # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters. -# cxgbe:Chelsio T4 and T5 based 1GbE/10GbE/40GbE PCIe Ethernet adapters. -# cxgbev: Chelsio T4 and T5 based PCIe Virtual Functions. +# cxgbe:Chelsio T4, T5, and T6-based 1GbE/10GbE/40GbE/100GbE PCIe Ethernet +# adapters. +# cxgbev: Chelsio T4, T5, and T6-based PCIe Virtual Functions. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics @@ -2140,8 +2141,8 @@ device xl # 3Com 3c90x (``Boomerang'', # PCI Ethernet NICs. device cxgb # Chelsio T3 10 Gigabit Ethernet device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware -device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE -device cxgbev # Chelsio T4 and T5 1GbE/10GbE/40GbE VF +device cxgbe # Chelsio T4, T5, and T6 1GbE/10GbE/40GbE/100GbE +device cxgbev # Chelsio T4, T5, and T6 VF device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet From owner-svn-src-all@freebsd.org Wed Dec 28 19:41:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8507C9599A; Wed, 28 Dec 2016 19:41:00 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 775D51E98; Wed, 28 Dec 2016 19:41:00 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSJexkQ066492; Wed, 28 Dec 2016 19:40:59 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSJexhN066491; Wed, 28 Dec 2016 19:40:59 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612281940.uBSJexhN066491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 28 Dec 2016 19:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310722 - head/sys/mips/ingenic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 19:41:00 -0000 Author: kan Date: Wed Dec 28 19:40:59 2016 New Revision: 310722 URL: https://svnweb.freebsd.org/changeset/base/310722 Log: Do not use read-modify-write on MSC control register. The register is write-only, so just write only bits we want. Submitted by: jmcneill Modified: head/sys/mips/ingenic/jz4780_mmc.c Modified: head/sys/mips/ingenic/jz4780_mmc.c ============================================================================== --- head/sys/mips/ingenic/jz4780_mmc.c Wed Dec 28 18:42:43 2016 (r310721) +++ head/sys/mips/ingenic/jz4780_mmc.c Wed Dec 28 19:40:59 2016 (r310722) @@ -412,13 +412,9 @@ static int jz4780_mmc_reset(struct jz4780_mmc_softc *sc) { int timeout; - int reg; /* Stop the clock */ - reg = JZ_MMC_READ_4(sc, JZ_MSC_CTRL); - reg &= ~(JZ_CLOCK_CTRL_M); - reg |= JZ_CLOCK_STOP; - JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, reg); + JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_CLOCK_STOP); timeout = 1000; while (--timeout > 0) { @@ -432,9 +428,7 @@ jz4780_mmc_reset(struct jz4780_mmc_softc } /* Reset */ - reg = JZ_MMC_READ_4(sc, JZ_MSC_CTRL); - reg |= JZ_RESET; - JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, reg); + JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_RESET); timeout = 10; while (--timeout > 0) { @@ -647,7 +641,7 @@ jz4780_mmc_request(device_t bus, device_ { struct jz4780_mmc_softc *sc; struct mmc_command *cmd; - uint32_t cmdat, ctrl, iwait; + uint32_t cmdat, iwait; int blksz; sc = device_get_softc(bus); @@ -731,9 +725,7 @@ jz4780_mmc_request(device_t bus, device_ JZ_MMC_WRITE_4(sc, JZ_MSC_CMD, cmd->opcode); JZ_MMC_WRITE_4(sc, JZ_MSC_CMDAT, cmdat); - ctrl = JZ_MMC_READ_4(sc, JZ_MSC_CTRL); - ctrl |= JZ_START_OP | JZ_CLOCK_START; - JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, ctrl); + JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_START_OP | JZ_CLOCK_START); callout_reset(&sc->sc_timeoutc, sc->sc_timeout * hz, jz4780_mmc_timeout, sc); @@ -853,8 +845,7 @@ jz4780_mmc_disable_clock(struct jz4780_m { int timeout; - JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, - JZ_MMC_READ_4(sc, JZ_MSC_CTRL) | JZ_CLOCK_STOP); + JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_CLOCK_STOP); for (timeout = 1000; timeout > 0; timeout--) if ((JZ_MMC_READ_4(sc, JZ_MSC_STAT) & JZ_CLK_EN) == 0) From owner-svn-src-all@freebsd.org Wed Dec 28 21:45:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6D07C95D7E; Wed, 28 Dec 2016 21:45:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A41481D2F; Wed, 28 Dec 2016 21:45:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSLjfTO019641; Wed, 28 Dec 2016 21:45:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSLjfoL019640; Wed, 28 Dec 2016 21:45:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612282145.uBSLjfoL019640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Dec 2016 21:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310723 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 21:45:43 -0000 Author: emaste Date: Wed Dec 28 21:45:41 2016 New Revision: 310723 URL: https://svnweb.freebsd.org/changeset/base/310723 Log: MFC r310274: Add ld.debug to ObsoleteFiles.inc After r293285 GNU ld is installed as /usr/bin/ld.bfd, and linked as /usr/bin/ld. The debug file is /usr/lib/debug/usr/bin/ld.bfd.debug. Sponsored by: The FreeBSD Foundation Modified: stable/11/ObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Wed Dec 28 19:40:59 2016 (r310722) +++ stable/11/ObsoleteFiles.inc Wed Dec 28 21:45:41 2016 (r310723) @@ -574,6 +574,8 @@ OLD_FILES+=usr/sbin/unbound-control-setu OLD_FILES+=usr/share/mdocml/example.style.css OLD_FILES+=usr/share/mdocml/style.css OLD_DIRS+=usr/share/mdocml +# 20160107: GNU ld installed as ld.bfd and linked as ld +OLD_FILES+=usr/lib/debug/usr/bin/ld.debug # 20151225: new clang import which bumps version from 3.7.0 to 3.7.1. OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/asan_interface.h From owner-svn-src-all@freebsd.org Wed Dec 28 21:54:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 434FFC9503E; Wed, 28 Dec 2016 21:54:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DD0B129B; Wed, 28 Dec 2016 21:54:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSLsYWN023464; Wed, 28 Dec 2016 21:54:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSLsYBl023462; Wed, 28 Dec 2016 21:54:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612282154.uBSLsYBl023462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Dec 2016 21:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310724 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 21:54:35 -0000 Author: markj Date: Wed Dec 28 21:54:33 2016 New Revision: 310724 URL: https://svnweb.freebsd.org/changeset/base/310724 Log: Follow DW_AT_specification when looking up DW_AT_type attributes. dwarf_attrval_*() will search the parent DIE referenced by a DW_AT_abstract_origin attribute for the value of the DW_AT_type attribute. Do the same thing for the DW_AT_specification attributes in variable definitions emitted by GCC 6.2, and ensure that we return an error rather than crashing if neither DW_AT_abstract_origin or DW_AT_specification is found when looking for the value of the DW_AT_type attribute. PR: 215350, 215395 Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D8920 Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval.c head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_attrval.c Wed Dec 28 21:45:41 2016 (r310723) +++ head/contrib/elftoolchain/libdwarf/dwarf_attrval.c Wed Dec 28 21:54:33 2016 (r310724) @@ -145,6 +145,7 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw Dwarf_Die die1; Dwarf_Unsigned val; Dwarf_Debug dbg; + int first; dbg = die != NULL ? die->die_dbg : NULL; @@ -155,14 +156,16 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw *valp = 0; - if ((at = _dwarf_attr_find(die, attr)) == NULL && attr != DW_AT_type) { - DWARF_SET_ERROR(dbg, err, DW_DLE_NO_ENTRY); - return (DW_DLV_NO_ENTRY); - } - die1 = NULL; - if (at == NULL && - (at = _dwarf_attr_find(die, DW_AT_abstract_origin)) != NULL) { + for (;;) { + if ((at = _dwarf_attr_find(die, attr)) != NULL || + attr != DW_AT_type) + break; + if ((at = _dwarf_attr_find(die, DW_AT_abstract_origin)) == + NULL && + (at = _dwarf_attr_find(die, DW_AT_specification)) == NULL) + break; + switch (at->at_form) { case DW_FORM_ref1: case DW_FORM_ref2: @@ -170,13 +173,15 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw case DW_FORM_ref8: case DW_FORM_ref_udata: val = at->u[0].u64; - if ((die1 = _dwarf_die_find(die, val)) == NULL || - (at = _dwarf_attr_find(die1, attr)) == NULL) { - if (die1 != NULL) - dwarf_dealloc(dbg, die1, DW_DLA_DIE); + first = (die1 == NULL); + die1 = _dwarf_die_find(die, val); + if (!first) + dwarf_dealloc(dbg, die, DW_DLA_DIE); + if (die1 == NULL) { DWARF_SET_ERROR(dbg, err, DW_DLE_NO_ENTRY); return (DW_DLV_NO_ENTRY); } + die = die1; break; default: DWARF_SET_ERROR(dbg, err, DW_DLE_ATTR_FORM_BAD); @@ -184,6 +189,11 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw } } + if (at == NULL) { + DWARF_SET_ERROR(dbg, err, DW_DLE_NO_ENTRY); + return (DW_DLV_NO_ENTRY); + } + switch (at->at_form) { case DW_FORM_addr: case DW_FORM_data1: Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Wed Dec 28 21:45:41 2016 (r310723) +++ head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Wed Dec 28 21:54:33 2016 (r310724) @@ -24,7 +24,7 @@ .\" .\" $Id: dwarf_attrval_signed.3 2980 2014-01-21 20:15:54Z kaiwang27 $ .\" -.Dd January 18, 2014 +.Dd December 26, 2016 .Os .Dt DWARF_ATTRVAL_SIGNED 3 .Sh NAME @@ -168,17 +168,22 @@ or .Pp If the attribute named by argument .Ar attr -is not present in the debugging information entry referenced by -argument +is +.Dv DW_AT_type +and is not present in the debugging information entry referenced by argument .Ar die , and if a .Dv DW_AT_abstract_origin +or +.Dv DW_AT_specification attribute is present in the debugging information entry, function .Fn dwarf_attrval_unsigned will search for the named attribute in the debugging information entry referenced by the .Dv DW_AT_abstract_origin +or +.Dv DW_AT_specification attribute. .Sh RETURN VALUES On success, these functions returns From owner-svn-src-all@freebsd.org Wed Dec 28 21:58:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47B39C950D0; Wed, 28 Dec 2016 21:58:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF1D61483; Wed, 28 Dec 2016 21:58:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSLwLIn023678; Wed, 28 Dec 2016 21:58:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSLwL39023677; Wed, 28 Dec 2016 21:58:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612282158.uBSLwL39023677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Dec 2016 21:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310725 - stable/11/sys/boot/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 21:58:22 -0000 Author: emaste Date: Wed Dec 28 21:58:20 2016 New Revision: 310725 URL: https://svnweb.freebsd.org/changeset/base/310725 Log: Fix EFI self relocation code for rela architectures MFC r306812 (andrew): The bootloader self relocation code was slightly wrong for the R_AARCH64_RELATIVE relocation found on arm64. It would try to add the contents of the memory location being relocated to the base address and the relocation addend. This worked when the contents was zero, however this now seems to be set to the value of the addend so we add this twice. Fix this by just setting the memory to the computed value. MFC r309360: EFI loaders: parse rela relocations on amd64 Prior to this change the loader self relocation code interpreted amd64's rela relocations as if they were rel relocations, discarding the addend. This "works" because GNU ld 2.17.50 stores the addend value in both the r_addend field of the relocation (as expected) and at the target of the relocation. Other linkers, and possibly other versions of GNU ld, won't have this behaviour, so interpret the relocations correctly. Modified: stable/11/sys/boot/common/self_reloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/self_reloc.c ============================================================================== --- stable/11/sys/boot/common/self_reloc.c Wed Dec 28 21:54:33 2016 (r310724) +++ stable/11/sys/boot/common/self_reloc.c Wed Dec 28 21:58:20 2016 (r310725) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__amd64__) #define ElfW_Rel Elf64_Rela #define ElfW_Dyn Elf64_Dyn #define ELFW_R_TYPE ELF64_R_TYPE @@ -40,10 +40,6 @@ __FBSDID("$FreeBSD$"); #define ElfW_Rel Elf32_Rel #define ElfW_Dyn Elf32_Dyn #define ELFW_R_TYPE ELF32_R_TYPE -#elif defined(__amd64__) -#define ElfW_Rel Elf64_Rel -#define ElfW_Dyn Elf64_Dyn -#define ELFW_R_TYPE ELF64_R_TYPE #else #error architecture not supported #endif @@ -99,7 +95,9 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * } /* - * Perform the actual relocation. + * Perform the actual relocation. We rely on the object having been + * linked at 0, so that the difference between the load and link + * address is the same as the load address. */ for (; relsz > 0; relsz -= relent) { switch (ELFW_R_TYPE(rel->r_info)) { @@ -108,12 +106,13 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * break; case RELOC_TYPE_RELATIVE: - /* Address relative to the base address. */ newaddr = (Elf_Addr *)(rel->r_offset + baseaddr); - *newaddr += baseaddr; - /* Add the addend when the ABI uses them */ #ifdef ELF_RELA - *newaddr += rel->r_addend; + /* Addend relative to the base address. */ + *newaddr = baseaddr + rel->r_addend; +#else + /* Address relative to the base address. */ + *newaddr += baseaddr; #endif break; default: From owner-svn-src-all@freebsd.org Wed Dec 28 23:02:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39AF7C95D79; Wed, 28 Dec 2016 23:02:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09353136D; Wed, 28 Dec 2016 23:02:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSN21Fs051592; Wed, 28 Dec 2016 23:02:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSN21hx051591; Wed, 28 Dec 2016 23:02:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612282302.uBSN21hx051591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Dec 2016 23:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310726 - head/sys/boot/i386/cdboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 23:02:02 -0000 Author: emaste Date: Wed Dec 28 23:02:01 2016 New Revision: 310726 URL: https://svnweb.freebsd.org/changeset/base/310726 Log: cdboot: add explict suffix to ambiguous or instruction Clang disallows ambiguous instructions (GNU as has a default based on chosen .code setting). We only need 'orb' here because KARGS_FLAGS_PXE fits in a byte; this is the same as done in bxeboot. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8959 Modified: head/sys/boot/i386/cdboot/cdboot.S Modified: head/sys/boot/i386/cdboot/cdboot.S ============================================================================== --- head/sys/boot/i386/cdboot/cdboot.S Wed Dec 28 21:58:20 2016 (r310725) +++ head/sys/boot/i386/cdboot/cdboot.S Wed Dec 28 23:02:01 2016 (r310726) @@ -127,7 +127,7 @@ start: cld # string ops inc stosl # to zero mov drive,%dl # Store BIOS boot device mov %dl,0x4(%bx) # in kargs->bootdev - or $KARGS_FLAGS_CD,0x8(%bx) # kargs->bootflags |= + orb $KARGS_FLAGS_CD,0x8(%bx) # kargs->bootflags |= # KARGS_FLAGS_CD # # Load Volume Descriptor From owner-svn-src-all@freebsd.org Wed Dec 28 23:34:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2824C95522; Wed, 28 Dec 2016 23:34:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8A391539; Wed, 28 Dec 2016 23:34:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSNYSu5065414; Wed, 28 Dec 2016 23:34:28 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSNYS3n065412; Wed, 28 Dec 2016 23:34:28 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201612282334.uBSNYS3n065412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 28 Dec 2016 23:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310727 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 23:34:30 -0000 Author: marius Date: Wed Dec 28 23:34:28 2016 New Revision: 310727 URL: https://svnweb.freebsd.org/changeset/base/310727 Log: Fix a bug in r272840; given that the optlen parameter of setsockopt(2) is a 32-bit socklen_t, do_get3() passes the kernel to access the wrong 32-bit half on big-endian LP64 machines when simply casting the 64-bit size_t optlen to a socklen_t pointer. While at it and given that the intention of do_get3() apparently is to hide/wrap the fact that socket options are used for communication with ipfw(4), change the optlen parameter of do_set3() to be of type size_t and as such more appropriate than uintptr_t, too. MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Wed Dec 28 23:02:01 2016 (r310726) +++ head/sbin/ipfw/ipfw2.c Wed Dec 28 23:34:28 2016 (r310727) @@ -591,7 +591,7 @@ do_cmd(int optname, void *optval, uintpt * Returns 0 on success or errno otherwise. */ int -do_set3(int optname, ip_fw3_opheader *op3, uintptr_t optlen) +do_set3(int optname, ip_fw3_opheader *op3, size_t optlen) { if (co.test_only) @@ -621,6 +621,7 @@ int do_get3(int optname, ip_fw3_opheader *op3, size_t *optlen) { int error; + socklen_t len; if (co.test_only) return (0); @@ -632,8 +633,9 @@ do_get3(int optname, ip_fw3_opheader *op op3->opcode = optname; - error = getsockopt(ipfw_socket, IPPROTO_IP, IP_FW3, op3, - (socklen_t *)optlen); + len = *optlen; + error = getsockopt(ipfw_socket, IPPROTO_IP, IP_FW3, op3, &len); + *optlen = len; return (error); } Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Wed Dec 28 23:02:01 2016 (r310726) +++ head/sbin/ipfw/ipfw2.h Wed Dec 28 23:34:28 2016 (r310727) @@ -329,7 +329,7 @@ void print_flags_buffer(char *buf, size_ struct _ip_fw3_opheader; int do_cmd(int optname, void *optval, uintptr_t optlen); -int do_set3(int optname, struct _ip_fw3_opheader *op3, uintptr_t optlen); +int do_set3(int optname, struct _ip_fw3_opheader *op3, size_t optlen); int do_get3(int optname, struct _ip_fw3_opheader *op3, size_t *optlen); struct in6_addr; From owner-svn-src-all@freebsd.org Wed Dec 28 23:55:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71262C95932; Wed, 28 Dec 2016 23:55:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E1DC1EB8; Wed, 28 Dec 2016 23:55:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSNtIYm073719; Wed, 28 Dec 2016 23:55:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSNtIXQ073717; Wed, 28 Dec 2016 23:55:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612282355.uBSNtIXQ073717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 28 Dec 2016 23:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310728 - in head: lib/libbsnmp/libbsnmp tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 23:55:19 -0000 Author: ngie Date: Wed Dec 28 23:55:18 2016 New Revision: 310728 URL: https://svnweb.freebsd.org/changeset/base/310728 Log: Install {asn1,bsnmpagent,bsnmpclient,bsnmplib}.3 as all of the APIs they document Also, alphabetically sort MAN MFC after: 3 days Modified: head/lib/libbsnmp/libbsnmp/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 28 23:34:28 2016 (r310727) +++ head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 28 23:55:18 2016 (r310728) @@ -20,7 +20,97 @@ LIBADD= crypto .endif SRCS= asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c -INCS= asn1.h snmp.h snmpagent.h snmpclient.h -MAN= asn1.3 bsnmplib.3 bsnmpclient.3 bsnmpagent.3 +INCS= asn1.h snmp.h snmpagent.h snmpclient.h +MAN= asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3 + +MLINKS+= asn1.3 asn_append_oid.3 +MLINKS+= asn1.3 asn_commit_header.3 +MLINKS+= asn1.3 asn_compare_oid.3 +MLINKS+= asn1.3 asn_get_counter64_raw.3 +MLINKS+= asn1.3 asn_get_header.3 +MLINKS+= asn1.3 asn_get_integer.3 +MLINKS+= asn1.3 asn_get_integer_raw.3 +MLINKS+= asn1.3 asn_get_ipaddress.3 +MLINKS+= asn1.3 asn_get_ipaddress_raw.3 +MLINKS+= asn1.3 asn_get_null.3 +MLINKS+= asn1.3 asn_get_null_raw.3 +MLINKS+= asn1.3 asn_get_objid.3 +MLINKS+= asn1.3 asn_get_objid_raw.3 +MLINKS+= asn1.3 asn_get_octetstring.3 +MLINKS+= asn1.3 asn_get_octetstring_raw.3 +MLINKS+= asn1.3 asn_get_sequence.3 +MLINKS+= asn1.3 asn_get_timeticks.3 +MLINKS+= asn1.3 asn_get_uint32_raw.3 +MLINKS+= asn1.3 asn_is_suboid.3 +MLINKS+= asn1.3 asn_oid2str.3 +MLINKS+= asn1.3 asn_oid2str_r.3 +MLINKS+= asn1.3 asn_put_counter64.3 +MLINKS+= asn1.3 asn_put_exception.3 +MLINKS+= asn1.3 asn_put_header.3 +MLINKS+= asn1.3 asn_put_integer.3 +MLINKS+= asn1.3 asn_put_ipaddress.3 +MLINKS+= asn1.3 asn_put_null.3 +MLINKS+= asn1.3 asn_put_objid.3 +MLINKS+= asn1.3 asn_put_octetstring.3 +MLINKS+= asn1.3 asn_put_temp_header.3 +MLINKS+= asn1.3 asn_put_timeticks.3 +MLINKS+= asn1.3 asn_put_uint32.3 +MLINKS+= asn1.3 asn_skip.3 +MLINKS+= asn1.3 asn_slice_oid.3 + +MLINKS+= bsnmpagent.3 snmp_debug.3 +MLINKS+= bsnmpagent.3 snmp_dep_commit.3 +MLINKS+= bsnmpagent.3 snmp_dep_finish.3 +MLINKS+= bsnmpagent.3 snmp_dep_lookup.3 +MLINKS+= bsnmpagent.3 snmp_dep_rollback.3 +MLINKS+= bsnmpagent.3 snmp_depop_t.3 +MLINKS+= bsnmpagent.3 snmp_get.3 +MLINKS+= bsnmpagent.3 snmp_getbulk.3 +MLINKS+= bsnmpagent.3 snmp_getnext.3 +MLINKS+= bsnmpagent.3 snmp_init_context.3 +MLINKS+= bsnmpagent.3 snmp_make_errresp.3 +MLINKS+= bsnmpagent.3 snmp_op_t.3 +MLINKS+= bsnmpagent.3 snmp_set.3 +MLINKS+= bsnmpagent.3 snmp_trace.3 +MLINKS+= bsnmpagent.3 tree.3 +MLINKS+= bsnmpagent.3 tree_size.3 + +MLINKS+= bsnmpclient.3 snmp_add_binding.3 +MLINKS+= bsnmpclient.3 snmp_client.3 +MLINKS+= bsnmpclient.3 snmp_close.3 +MLINKS+= bsnmpclient.3 snmp_dialog.3 +MLINKS+= bsnmpclient.3 snmp_discover_engine.3 +MLINKS+= bsnmpclient.3 snmp_oid_append.3 +MLINKS+= bsnmpclient.3 snmp_open.3 +MLINKS+= bsnmpclient.3 snmp_parse_server.3 +MLINKS+= bsnmpclient.3 snmp_pdu_check.3 +MLINKS+= bsnmpclient.3 snmp_pdu_create.3 +MLINKS+= bsnmpclient.3 snmp_pdu_send.3 +MLINKS+= bsnmpclient.3 snmp_receive.3 +MLINKS+= bsnmpclient.3 snmp_send_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_table_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_table_fetch.3 +MLINKS+= bsnmpclient.3 snmp_table_fetch_async.3 +MLINKS+= bsnmpclient.3 snmp_timeout_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_timeout_start_f.3 +MLINKS+= bsnmpclient.3 snmp_timeout_stop_f.3 + +MLINKS+= bsnmplib.3 TRUTH_GET.3 +MLINKS+= bsnmplib.3 TRUTH_MK.3 +MLINKS+= bsnmplib.3 TRUTH_OK.3 +MLINKS+= bsnmplib.3 snmp_calc_keychange.3 +MLINKS+= bsnmplib.3 snmp_get_local_keys.3 +MLINKS+= bsnmplib.3 snmp_passwd_to_keys.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_header.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_scoped.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_secmode.3 +MLINKS+= bsnmplib.3 snmp_pdu_dump.3 +MLINKS+= bsnmplib.3 snmp_pdu_encode.3 +MLINKS+= bsnmplib.3 snmp_pdu_free.3 +MLINKS+= bsnmplib.3 snmp_pdu_init_secparams.3 +MLINKS+= bsnmplib.3 snmp_value_copy.3 +MLINKS+= bsnmplib.3 snmp_value_free.3 +MLINKS+= bsnmplib.3 snmp_value_parse.3 .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 23:34:28 2016 (r310727) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 28 23:55:18 2016 (r310728) @@ -782,6 +782,95 @@ OLD_FILES+=usr/share/man/man1/bsnmpget.1 OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz OLD_FILES+=usr/share/man/man1/bsnmpwalk.1.gz OLD_FILES+=usr/share/man/man1/gensnmptree.1.gz +# lib/libbsnmp/libbsnmp +OLD_FILES+=usr/share/man/man3/TRUTH_GET.3.gz +OLD_FILES+=usr/share/man/man3/TRUTH_MK.3.gz +OLD_FILES+=usr/share/man/man3/TRUTH_OK.3.gz +OLD_FILES+=usr/share/man/man3/asn1.3.gz +OLD_FILES+=usr/share/man/man3/asn_append_oid.3.gz +OLD_FILES+=usr/share/man/man3/asn_commit_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_compare_oid.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_counter64_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_integer.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_integer_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_ipaddress.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_ipaddress_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_null.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_null_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_objid.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_objid_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_octetstring.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_octetstring_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_sequence.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_timeticks.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_uint32_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_is_suboid.3.gz +OLD_FILES+=usr/share/man/man3/asn_oid2str.3.gz +OLD_FILES+=usr/share/man/man3/asn_oid2str_r.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_counter64.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_exception.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_integer.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_ipaddress.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_null.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_objid.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_octetstring.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_temp_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_timeticks.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_uint32.3.gz +OLD_FILES+=usr/share/man/man3/asn_skip.3.gz +OLD_FILES+=usr/share/man/man3/asn_slice_oid.3.gz +OLD_FILES+=usr/share/man/man3/snmp_add_binding.3.gz +OLD_FILES+=usr/share/man/man3/snmp_calc_keychange.3.gz +OLD_FILES+=usr/share/man/man3/snmp_client.3.gz +OLD_FILES+=usr/share/man/man3/snmp_close.3.gz +OLD_FILES+=usr/share/man/man3/snmp_debug.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_commit.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_finish.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_lookup.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_rollback.3.gz +OLD_FILES+=usr/share/man/man3/snmp_depop_t.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dialog.3.gz +OLD_FILES+=usr/share/man/man3/snmp_discover_engine.3.gz +OLD_FILES+=usr/share/man/man3/snmp_get.3.gz +OLD_FILES+=usr/share/man/man3/snmp_get_local_keys.3.gz +OLD_FILES+=usr/share/man/man3/snmp_getbulk.3.gz +OLD_FILES+=usr/share/man/man3/snmp_getnext.3.gz +OLD_FILES+=usr/share/man/man3/snmp_init_context.3.gz +OLD_FILES+=usr/share/man/man3/snmp_make_errresp.3.gz +OLD_FILES+=usr/share/man/man3/snmp_oid_append.3.gz +OLD_FILES+=usr/share/man/man3/snmp_op_t.3.gz +OLD_FILES+=usr/share/man/man3/snmp_open.3.gz +OLD_FILES+=usr/share/man/man3/snmp_parse_server.3.gz +OLD_FILES+=usr/share/man/man3/snmp_passwd_to_keys.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_check.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_create.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_header.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_scoped.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_secmode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_dump.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_encode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_free.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_init_secparams.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_send.3.gz +OLD_FILES+=usr/share/man/man3/snmp_receive.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_set.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_fetch.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_fetch_async.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_start_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_stop_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_trace.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_copy.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_free.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_parse.3.gz +OLD_FILES+=usr/share/man/man3/tree.3.gz +OLD_FILES+=usr/share/man/man3/tree_size.3.gz +# usr.sbin/bsnmpd/bsnmpd OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT.3.gz OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK.3.gz OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK_INDEX.3.gz From owner-svn-src-all@freebsd.org Thu Dec 29 00:20:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844EDC940F2; Thu, 29 Dec 2016 00:20:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53DB01973; Thu, 29 Dec 2016 00:20:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT0K3nO082222; Thu, 29 Dec 2016 00:20:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT0K31s082221; Thu, 29 Dec 2016 00:20:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612290020.uBT0K31s082221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 29 Dec 2016 00:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310729 - head/contrib/bsnmp/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 00:20:04 -0000 Author: ngie Date: Thu Dec 29 00:20:03 2016 New Revision: 310729 URL: https://svnweb.freebsd.org/changeset/base/310729 Log: Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that could happen if a pdu was reused after calling the function, and as both stack and heap allocation types are used in contrib/bsnmp and usr.sbin/bsnmpd. snmp_value_free: NULL out value->v.octetstring.octets after calling free on it to prevent a double-free from occurring. MFC after: 2 weeks Modified: head/contrib/bsnmp/lib/snmp.c Modified: head/contrib/bsnmp/lib/snmp.c ============================================================================== --- head/contrib/bsnmp/lib/snmp.c Wed Dec 28 23:55:18 2016 (r310728) +++ head/contrib/bsnmp/lib/snmp.c Thu Dec 29 00:20:03 2016 (r310729) @@ -1154,8 +1154,11 @@ snmp_pdu_dump(const struct snmp_pdu *pdu void snmp_value_free(struct snmp_value *value) { - if (value->syntax == SNMP_SYNTAX_OCTETSTRING) + + if (value->syntax == SNMP_SYNTAX_OCTETSTRING) { free(value->v.octetstring.octets); + value->v.octetstring.octets = NULL; + } value->syntax = SNMP_SYNTAX_NULL; } @@ -1216,6 +1219,7 @@ snmp_pdu_free(struct snmp_pdu *pdu) for (i = 0; i < pdu->nbindings; i++) snmp_value_free(&pdu->bindings[i]); + pdu->nbindings = 0; } /* From owner-svn-src-all@freebsd.org Thu Dec 29 00:24:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD9F7C94392; Thu, 29 Dec 2016 00:24:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE1A1DD6; Thu, 29 Dec 2016 00:24:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT0OGtZ085940; Thu, 29 Dec 2016 00:24:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT0OGQk085939; Thu, 29 Dec 2016 00:24:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612290024.uBT0OGQk085939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 29 Dec 2016 00:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310730 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 00:24:17 -0000 Author: ngie Date: Thu Dec 29 00:24:16 2016 New Revision: 310730 URL: https://svnweb.freebsd.org/changeset/base/310730 Log: MFC r310592: style(9): fix trailing whitespace Modified: stable/11/contrib/bsnmp/snmpd/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trap.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trap.c Thu Dec 29 00:20:03 2016 (r310729) +++ stable/11/contrib/bsnmp/snmpd/trap.c Thu Dec 29 00:24:16 2016 (r310730) @@ -214,7 +214,7 @@ trapsink_unmodify(struct trapsink *t, st t->version = tdep->rb_version; if (tdep->set & TDEP_COMM) strcpy(t->comm, tdep->rb_comm); - + return (SNMP_ERR_NOERROR); } @@ -546,7 +546,7 @@ snmp_send_trap(const struct asn_oid *tra TAILQ_FOREACH(t, &trapsink_list, link) { if (t->status != TRAPSINK_ACTIVE) continue; - + if (t->version == TRAPSINK_V1) snmp_create_v1_trap(&pdu, t->comm, trap_oid); else From owner-svn-src-all@freebsd.org Thu Dec 29 00:24:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 690E9C94449; Thu, 29 Dec 2016 00:24:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37E131F53; Thu, 29 Dec 2016 00:24:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT0OwFn086052; Thu, 29 Dec 2016 00:24:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT0Owmk086051; Thu, 29 Dec 2016 00:24:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612290024.uBT0Owmk086051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 29 Dec 2016 00:24: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: r310731 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 00:24:59 -0000 Author: ngie Date: Thu Dec 29 00:24:58 2016 New Revision: 310731 URL: https://svnweb.freebsd.org/changeset/base/310731 Log: MFstable/11 r310730: MFC r310592: style(9): fix trailing whitespace Modified: stable/10/contrib/bsnmp/snmpd/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/trap.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trap.c Thu Dec 29 00:24:16 2016 (r310730) +++ stable/10/contrib/bsnmp/snmpd/trap.c Thu Dec 29 00:24:58 2016 (r310731) @@ -214,7 +214,7 @@ trapsink_unmodify(struct trapsink *t, st t->version = tdep->rb_version; if (tdep->set & TDEP_COMM) strcpy(t->comm, tdep->rb_comm); - + return (SNMP_ERR_NOERROR); } @@ -546,7 +546,7 @@ snmp_send_trap(const struct asn_oid *tra TAILQ_FOREACH(t, &trapsink_list, link) { if (t->status != TRAPSINK_ACTIVE) continue; - + if (t->version == TRAPSINK_V1) snmp_create_v1_trap(&pdu, t->comm, trap_oid); else From owner-svn-src-all@freebsd.org Thu Dec 29 00:25:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6359C944C3; Thu, 29 Dec 2016 00:25:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93B7B10CE; Thu, 29 Dec 2016 00:25:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT0Pc2H086128; Thu, 29 Dec 2016 00:25:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT0Pcwr086127; Thu, 29 Dec 2016 00:25:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612290025.uBT0Pcwr086127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 29 Dec 2016 00:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310732 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 00:25:39 -0000 Author: ngie Date: Thu Dec 29 00:25:38 2016 New Revision: 310732 URL: https://svnweb.freebsd.org/changeset/base/310732 Log: MFC r310574: Fix style(9) - Sort #includes - Delete trailing whitespace No functional change Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_lsock.c Thu Dec 29 00:24:58 2016 (r310731) +++ stable/11/contrib/bsnmp/snmpd/trans_lsock.c Thu Dec 29 00:25:38 2016 (r310732) @@ -32,15 +32,15 @@ */ #include #include -#include #include +#include +#include +#include #include #include -#include -#include #include -#include +#include #include #include "snmpmod.h" @@ -417,7 +417,7 @@ lsock_send(struct tport *tp, const u_cha return (-1); } } - + return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); } From owner-svn-src-all@freebsd.org Thu Dec 29 00:26:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B305C94541; Thu, 29 Dec 2016 00:26:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38DC8124D; Thu, 29 Dec 2016 00:26:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT0QRdt086231; Thu, 29 Dec 2016 00:26:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT0QRCk086229; Thu, 29 Dec 2016 00:26:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612290026.uBT0QRCk086229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 29 Dec 2016 00:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310733 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 00:26:28 -0000 Author: ngie Date: Thu Dec 29 00:26:27 2016 New Revision: 310733 URL: https://svnweb.freebsd.org/changeset/base/310733 Log: MFstable/11 r310732: MFC r310574: Fix style(9) - Sort #includes - Delete trailing whitespace No functional change Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_lsock.c Thu Dec 29 00:25:38 2016 (r310732) +++ stable/10/contrib/bsnmp/snmpd/trans_lsock.c Thu Dec 29 00:26:27 2016 (r310733) @@ -32,15 +32,15 @@ */ #include #include -#include #include +#include +#include +#include #include #include -#include -#include #include -#include +#include #include #include "snmpmod.h" @@ -417,7 +417,7 @@ lsock_send(struct tport *tp, const u_cha return (-1); } } - + return (sendto(peer->input.fd, buf, len, 0, addr, addrlen)); } From owner-svn-src-all@freebsd.org Thu Dec 29 01:11:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9EDC9429A; Thu, 29 Dec 2016 01:11:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EA531ABF; Thu, 29 Dec 2016 01:11:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT1BvB3004174; Thu, 29 Dec 2016 01:11:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT1Bv5A004173; Thu, 29 Dec 2016 01:11:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612290111.uBT1Bv5A004173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Dec 2016 01:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310734 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 01:11:58 -0000 Author: jhb Date: Thu Dec 29 01:11:57 2016 New Revision: 310734 URL: https://svnweb.freebsd.org/changeset/base/310734 Log: Note that the Chelsio T6 also supports 25Gbps. To avoid overflowing 80 columns, condense the cxgbe description a bit. Reviewed by: np Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Dec 29 00:26:27 2016 (r310733) +++ head/sys/conf/NOTES Thu Dec 29 01:11:57 2016 (r310734) @@ -1956,7 +1956,7 @@ device xmphy # XaQti XMAC II # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters. -# cxgbe:Chelsio T4, T5, and T6-based 1GbE/10GbE/40GbE/100GbE PCIe Ethernet +# cxgbe:Chelsio T4, T5, and T6-based 1/10/25/40/100GbE PCIe Ethernet # adapters. # cxgbev: Chelsio T4, T5, and T6-based PCIe Virtual Functions. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 @@ -2141,8 +2141,8 @@ device xl # 3Com 3c90x (``Boomerang'', # PCI Ethernet NICs. device cxgb # Chelsio T3 10 Gigabit Ethernet device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware -device cxgbe # Chelsio T4, T5, and T6 1GbE/10GbE/40GbE/100GbE -device cxgbev # Chelsio T4, T5, and T6 VF +device cxgbe # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet +device cxgbev # Chelsio T4-T6 Virtual Functions device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet From owner-svn-src-all@freebsd.org Thu Dec 29 03:03:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B50C95D22; Thu, 29 Dec 2016 03:03:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5CD19B4; Thu, 29 Dec 2016 03:03:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id u144so64499037wmu.0; Wed, 28 Dec 2016 19:03:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nL2KhsHkudqs6EyniD5I2TXaec8PZoclf2/I711zZRU=; b=j9wwgD27yB3cCK0xfOjrqwVEg9Yml75RaIYF1j6OmNP+Og/g8eJ1/vRPO0Lyc137FV LQcxR9KkEpRL7AgIb/7dThXQD2038p7mvFhTRKXAPVKDUtZdmTAfonv51Ml+CX0QOtO6 wOlWNduMax4ny+B9AJk2082PrlfC15vFj3JCUEJOBCI7dRxwcuZ3VS4iVeHqYCUUEfZv dyRz8JrV7E2rNO9xfzpQHZjmp3SyJjjdra6Fcq8nGsCqIiQOaAN3Mreb/jy+HBfS3AZO tsCqJuJnTxHMHY3R3pju30d/VmOb+XU5Bs4S5vsN8lfkooHzvEPC5WtMGdS10CJNFRAN 3RVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nL2KhsHkudqs6EyniD5I2TXaec8PZoclf2/I711zZRU=; b=IX4qCml6AeZJWXdTejw5pJJw62WkjUqRoWOTL6S/W56NLRSYh1yDNb1D6beuRamEU8 9ggOXKq2FQx/EUugwpSlBpfJl8a79r3U3kGhApV/cdb7Lc/7yiUpaedE1KS7SAYwlP3L YmnlOqv7xz0hWDOFAK+HL6GXs/glQ5IedO7c6lVcTBsnMjIEPLEBrWeMl5VKiTTSwkZX k9gcLgeKrbvn+zCtss4BzySr+TGindXHmG8R6kOk5UqRsZMl6fJQy/nvb2tdub0Uan8o jQZ/Kj5AWCD2V6TF5uXJfwmh5EaKsYu/8Wr0L8qT9FzN8vL5d03/psaT5R/D4ec4Bl5k bXRQ== X-Gm-Message-State: AIkVDXJbaTMH9FIZR7KgrZU8vpOV96ZiYrUjnJrfdN9vf84gUM0ouqoP09gDEZdIVmPvIRInyXNFERUbZrYe8g== X-Received: by 10.28.185.78 with SMTP id j75mr35625190wmf.14.1482980632929; Wed, 28 Dec 2016 19:03:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.44.1 with HTTP; Wed, 28 Dec 2016 19:03:52 -0800 (PST) In-Reply-To: <201612182056.uBIKuElT070792@repo.freebsd.org> References: <201612182056.uBIKuElT070792@repo.freebsd.org> From: Adrian Chadd Date: Wed, 28 Dec 2016 19:03:52 -0800 Message-ID: Subject: Re: svn commit: r310234 - head/sys/vm To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 03:03:55 -0000 hi, I've bisected a boot failure on mips24k (carambola2) to this commit. Nothing useful is printed - it hangs at startup time. Any ideas? -adrian On 18 December 2016 at 12:56, Konstantin Belousov wrote: > Author: kib > Date: Sun Dec 18 20:56:14 2016 > New Revision: 310234 > URL: https://svnweb.freebsd.org/changeset/base/310234 > > Log: > Improve vm_object_scan_all_shadowed() to also check swap backing objects. > > As noted in the removed comment, it is possible and not prohibitively > costly to look up the swap blocks for the given page index. Implement > a swap_pager_find_least() function to do that, and use it to iterate > simultaneously over both backing object page queue and swap > allocations when looking for shadowed pages. > > Testing shows that number of new succesful scans, enabled by this > addition, is small but non-zero. When worked out, the change both > further reduces the depth of the shadow object chain, and frees unused > but allocated swap and memory. > > Suggested and reviewed by: alc > Tested by: pho (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Modified: > head/sys/vm/swap_pager.c > head/sys/vm/swap_pager.h > head/sys/vm/vm_object.c > > Modified: head/sys/vm/swap_pager.c > ============================================================================== > --- head/sys/vm/swap_pager.c Sun Dec 18 20:40:22 2016 (r310233) > +++ head/sys/vm/swap_pager.c Sun Dec 18 20:56:14 2016 (r310234) > @@ -2013,6 +2013,44 @@ swp_pager_meta_ctl(vm_object_t object, v > } > > /* > + * Returns the least page index which is greater than or equal to the > + * parameter pindex and for which there is a swap block allocated. > + * Returns object's size if the object's type is not swap or if there > + * are no allocated swap blocks for the object after the requested > + * pindex. > + */ > +vm_pindex_t > +swap_pager_find_least(vm_object_t object, vm_pindex_t pindex) > +{ > + struct swblock **pswap, *swap; > + vm_pindex_t i, j, lim; > + int idx; > + > + VM_OBJECT_ASSERT_LOCKED(object); > + if (object->type != OBJT_SWAP || object->un_pager.swp.swp_bcount == 0) > + return (object->size); > + > + mtx_lock(&swhash_mtx); > + for (j = pindex; j < object->size; j = lim) { > + pswap = swp_pager_hash(object, j); > + lim = rounddown2(j + SWAP_META_PAGES, SWAP_META_PAGES); > + if (lim > object->size) > + lim = object->size; > + if ((swap = *pswap) != NULL) { > + for (idx = j & SWAP_META_MASK, i = j; i < lim; > + i++, idx++) { > + if (swap->swb_pages[idx] != SWAPBLK_NONE) > + goto found; > + } > + } > + } > + i = object->size; > +found: > + mtx_unlock(&swhash_mtx); > + return (i); > +} > + > +/* > * System call swapon(name) enables swapping on device name, > * which must be in the swdevsw. Return EBUSY > * if already swapping on this device. > > Modified: head/sys/vm/swap_pager.h > ============================================================================== > --- head/sys/vm/swap_pager.h Sun Dec 18 20:40:22 2016 (r310233) > +++ head/sys/vm/swap_pager.h Sun Dec 18 20:56:14 2016 (r310234) > @@ -79,6 +79,7 @@ extern int swap_pager_avail; > struct xswdev; > int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len); > void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int); > +vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex); > void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t); > void swap_pager_swap_init(void); > int swap_pager_isswapped(vm_object_t, struct swdevt *); > > Modified: head/sys/vm/vm_object.c > ============================================================================== > --- head/sys/vm/vm_object.c Sun Dec 18 20:40:22 2016 (r310233) > +++ head/sys/vm/vm_object.c Sun Dec 18 20:56:14 2016 (r310234) > @@ -1436,36 +1436,40 @@ vm_object_scan_all_shadowed(vm_object_t > { > vm_object_t backing_object; > vm_page_t p, pp; > - vm_pindex_t backing_offset_index, new_pindex; > + vm_pindex_t backing_offset_index, new_pindex, pi, ps; > > VM_OBJECT_ASSERT_WLOCKED(object); > VM_OBJECT_ASSERT_WLOCKED(object->backing_object); > > backing_object = object->backing_object; > > - /* > - * Initial conditions: > - * > - * We do not want to have to test for the existence of swap > - * pages in the backing object. XXX but with the new swapper this > - * would be pretty easy to do. > - */ > - if (backing_object->type != OBJT_DEFAULT) > + if (backing_object->type != OBJT_DEFAULT && > + backing_object->type != OBJT_SWAP) > return (false); > > - backing_offset_index = OFF_TO_IDX(object->backing_object_offset); > + pi = backing_offset_index = OFF_TO_IDX(object->backing_object_offset); > + p = vm_page_find_least(backing_object, pi); > + ps = swap_pager_find_least(backing_object, pi); > > - for (p = TAILQ_FIRST(&backing_object->memq); p != NULL; > - p = TAILQ_NEXT(p, listq)) { > - new_pindex = p->pindex - backing_offset_index; > + /* > + * Only check pages inside the parent object's range and > + * inside the parent object's mapping of the backing object. > + */ > + for (;; pi++) { > + if (p != NULL && p->pindex < pi) > + p = TAILQ_NEXT(p, listq); > + if (ps < pi) > + ps = swap_pager_find_least(backing_object, pi); > + if (p == NULL && ps >= backing_object->size) > + break; > + else if (p == NULL) > + pi = ps; > + else > + pi = MIN(p->pindex, ps); > > - /* > - * Ignore pages outside the parent object's range and outside > - * the parent object's mapping of the backing object. > - */ > - if (p->pindex < backing_offset_index || > - new_pindex >= object->size) > - continue; > + new_pindex = pi - backing_offset_index; > + if (new_pindex >= object->size) > + break; > > /* > * See if the parent has the page or if the parent's object > From owner-svn-src-all@freebsd.org Thu Dec 29 05:32:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C408FC9510E; Thu, 29 Dec 2016 05:32:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 607A71043; Thu, 29 Dec 2016 05:32:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT5WZXv016428; Thu, 29 Dec 2016 05:32:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT5WYtG016418; Thu, 29 Dec 2016 05:32:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290532.uBT5WYtG016418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 05:32:34 +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: r310735 - in stable/10: contrib/hyperv/tools etc/devd etc/mtree include share/man/man4 sys/conf sys/dev/hyperv/utilities sys/modules/hyperv/utilities usr.sbin/hyperv usr.sbin/hyperv/too... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 05:32:36 -0000 Author: sephe Date: Thu Dec 29 05:32:34 2016 New Revision: 310735 URL: https://svnweb.freebsd.org/changeset/base/310735 Log: MFC 308664,308742,308743 308664 hyperv/vss: Add driver and tools for VSS VSS stands for "Volume Shadow Copy Service". Unlike virtual machine snapshot, it only takes snapshot for the virtual disks, so both filesystem and applications have to aware of it, and cooperate the whole VSS process. This driver exposes two device files to the userland: /dev/hv_fsvss_dev Normally userland programs should _not_ mess with this device file. It is currently used by the hv_vss_daemon(8), which freezes and thaws the filesystem. NOTE: currently only UFS is supported, if the system mounts _any_ other filesystems, the hv_vss_daemon(8) will veto the VSS process. If hv_vss_daemon(8) was disabled, then this device file must be opened, and proper ioctls must be issued to keep the VSS working. /dev/hv_appvss_dev Userland application can opened this device file to receive the VSS freeze notification, hold the VSS for a while (mainly to flush application data to filesystem), release the VSS process, and receive the VSS thaw notification i.e. applications can run again. The VSS will still work, even if this device file is not opened. However, only filesystem consistency is promised, if this device file is not opened or is not operated properly. hv_vss_daemon(8) is started by devd(8) by default. It can be disabled by editting /etc/devd/hyperv.conf. Submitted by: Hongjiang Zhang Reviewed by: kib, mckusick Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8224 308742 hyperv/vss: Nuke unused variables. Submitted by: markj Reported by: markj Sponsored by: Microsoft 308743 hyperv/vss: Install the userland daemon to /usr/sbin instead of / Submitted by: markj Reported by: markj Sponsored by: Microsoft Added: stable/10/contrib/hyperv/tools/hv_vss_daemon.8 - copied unchanged from r308664, head/contrib/hyperv/tools/hv_vss_daemon.8 stable/10/contrib/hyperv/tools/hv_vss_daemon.c - copied, changed from r308664, head/contrib/hyperv/tools/hv_vss_daemon.c stable/10/share/man/man4/hv_vss.4 - copied unchanged from r308664, head/share/man/man4/hv_vss.4 stable/10/sys/dev/hyperv/utilities/hv_snapshot.c - copied unchanged from r308664, head/sys/dev/hyperv/utilities/hv_snapshot.c stable/10/sys/dev/hyperv/utilities/hv_snapshot.h - copied unchanged from r308664, head/sys/dev/hyperv/utilities/hv_snapshot.h stable/10/usr.sbin/hyperv/tools/Makefile.inc - copied unchanged from r308743, head/usr.sbin/hyperv/tools/Makefile.inc stable/10/usr.sbin/hyperv/tools/kvp/ - copied from r308664, head/usr.sbin/hyperv/tools/kvp/ stable/10/usr.sbin/hyperv/tools/vss/ - copied from r308664, head/usr.sbin/hyperv/tools/vss/ Deleted: stable/10/usr.sbin/hyperv/tools/Makefile Modified: stable/10/etc/devd/hyperv.conf stable/10/etc/mtree/BSD.include.dist stable/10/include/Makefile stable/10/share/man/man4/Makefile stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/modules/hyperv/utilities/Makefile stable/10/usr.sbin/hyperv/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/hyperv/tools/hv_vss_daemon.8 (from r308664, head/contrib/hyperv/tools/hv_vss_daemon.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/hyperv/tools/hv_vss_daemon.8 Thu Dec 29 05:32:34 2016 (r310735, copy of r308664, head/contrib/hyperv/tools/hv_vss_daemon.8) @@ -0,0 +1,88 @@ +.\" Copyright (c) 2016 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.Dd October 12, 2016 +.Dt HV_VSS_DAEMON 8 +.Os +.Sh NAME +.Nm hv_vss_daemon +.Nd Hyper-V Volume Shadow Copy Service Daemon +.Sh SYNOPSIS +.Nm +.Op Fl dn +.Sh DESCRIPTION +The +.Nm +daemon provides the ability to freeze and thaw the file system for +.Fx +guest partitions running on Hyper-V. +.Pp +Hyper-V allows administrators to backup or restore the +.Fx +guest partition. +Administrators can +use Windows Powershell scripts to backup or restore the +.Fx +VM. +.Pp +The +.Nm +accepts file system freeze and thaw requests from the +.Xr hv_utils 4 +driver and performs the actual file-system operation. +.Pp +The file system freeze and thaw functionality is +useful when the Hyper-V host wants to do live backup of +.Fx +guest. Hyper-V host sends file system freezing request to +.Nm +which conducts the real operation. After successfully freezing file +system, Hyper-V host takes a snapshot of the VM. In the future, +Hyper-V host can restore the +.Fx +VM through that snapshot. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl d +Run as regular process instead of a daemon for debugging purpose. +.It Fl n +Generate debugging output. +.El +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_kvp 4 +.Sh HISTORY +The daemon was introduced in October 2016 and developed by Microsoft Corp. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq Mt bsdic@microsoft.com . Copied and modified: stable/10/contrib/hyperv/tools/hv_vss_daemon.c (from r308664, head/contrib/hyperv/tools/hv_vss_daemon.c) ============================================================================== --- head/contrib/hyperv/tools/hv_vss_daemon.c Tue Nov 15 02:36:12 2016 (r308664, copy source) +++ stable/10/contrib/hyperv/tools/hv_vss_daemon.c Thu Dec 29 05:32:34 2016 (r310735) @@ -158,10 +158,9 @@ main(int argc, char* argv[]) struct pollfd hv_vss_poll_fd[1]; uint32_t op; - int ch, r, len, error; + int ch, r, error; int hv_vss_dev_fd; - int freeze_thaw = UNDEF_FREEZE_THAW; while ((ch = getopt(argc, argv, "dnh")) != -1) { switch (ch) { case 'n': Modified: stable/10/etc/devd/hyperv.conf ============================================================================== --- stable/10/etc/devd/hyperv.conf Thu Dec 29 01:11:57 2016 (r310734) +++ stable/10/etc/devd/hyperv.conf Thu Dec 29 05:32:34 2016 (r310735) @@ -17,3 +17,19 @@ notify 10 { match "cdev" "hv_kvp_dev"; action "pkill -x hv_kvp_daemon"; }; + +notify 11 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "hv_fsvss_dev"; + action "/usr/sbin/hv_vss_daemon"; +}; + +notify 11 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "DESTROY"; + match "cdev" "hv_fsvss_dev"; + action "pkill -x hv_vss_daemon"; +}; Modified: stable/10/etc/mtree/BSD.include.dist ============================================================================== --- stable/10/etc/mtree/BSD.include.dist Thu Dec 29 01:11:57 2016 (r310734) +++ stable/10/etc/mtree/BSD.include.dist Thu Dec 29 05:32:34 2016 (r310735) @@ -118,6 +118,8 @@ .. hwpmc .. + hyperv + .. ic .. ieee488 Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Thu Dec 29 01:11:57 2016 (r310734) +++ stable/10/include/Makefile Thu Dec 29 05:32:34 2016 (r310735) @@ -44,7 +44,7 @@ LDIRS= bsm cam geom net net80211 netatal LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ - dev/hwpmc \ + dev/hwpmc dev/hyperv \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/utopia dev/vkbd dev/wi \ @@ -161,7 +161,7 @@ copies: done .endif .endfor -.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/hyperv:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} cd ${.CURDIR}/../sys; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${DESTDIR}${INCLUDEDIR}/$i @@ -184,6 +184,9 @@ copies: ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \ ${DESTDIR}${INCLUDEDIR}/dev/nand .endif + cd ${.CURDIR}/../sys/dev/hyperv/utilities; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hv_snapshot.h \ + ${DESTDIR}${INCLUDEDIR}/dev/hyperv cd ${.CURDIR}/../sys/dev/pci; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \ ${DESTDIR}${INCLUDEDIR}/dev/pci @@ -256,7 +259,7 @@ symlinks: ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor -.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/hyperv:Ndev/nand:Ndev/pci} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ @@ -284,6 +287,11 @@ symlinks: ${DESTDIR}${INCLUDEDIR}/dev/nand; \ done .endif + cd ${.CURDIR}/../sys/dev/hyperv/utilities; \ + for h in hv_snapshot.h; do \ + ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/utilities/$$h \ + ${DESTDIR}${INCLUDEDIR}/dev/hyperv; \ + done cd ${.CURDIR}/../sys/dev/pci; \ for h in pcireg.h; do \ ln -fs ../../../../sys/dev/pci/$$h \ Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Dec 29 01:11:57 2016 (r310734) +++ stable/10/share/man/man4/Makefile Thu Dec 29 05:32:34 2016 (r310735) @@ -180,6 +180,7 @@ MAN= aac.4 \ ${_hv_storvsc.4} \ ${_hv_utils.4} \ ${_hv_vmbus.4} \ + hv_vss.4 \ hwpmc.4 \ ichsmb.4 \ ${_ichwd.4} \ Copied: stable/10/share/man/man4/hv_vss.4 (from r308664, head/share/man/man4/hv_vss.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/hv_vss.4 Thu Dec 29 05:32:34 2016 (r310735, copy of r308664, head/share/man/man4/hv_vss.4) @@ -0,0 +1,366 @@ +.\" Copyright (c) 2016 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.Dd October 12, 2016 +.Dt HV_VSS 4 +.Os +.Sh NAME +.Nm hv_vss +.Nd Hyper-V Volume Shadow Copy Service API +.Sh SYNOPSIS +.In dev/hyperv/hv_snapshot.h +.Bd -literal +#define VSS_SUCCESS 0x00000000 +#define VSS_FAIL 0x00000001 + +enum hv_vss_op_t { + HV_VSS_NONE = 0, + HV_VSS_CHECK, + HV_VSS_FREEZE, + HV_VSS_THAW, + HV_VSS_COUNT +}; + +struct hv_vss_opt_msg { + uint32_t opt; /* operation */ + uint32_t status; /* 0 for success, 1 for error */ + uint64_t msgid; /* an ID used to identify the transaction */ + uint8_t reserved[48]; /* reserved values are all zeroes */ +}; +.Ed +.Sh DESCRIPTION +The freeze or thaw functionality of application is important to guarantee +the application consistent backup. On windows platform, VSS is defined to do +live backup. But for VM guest running on Hyper-V, the corresponding VSS is +not defined yet. For example, a running database server instance, it knows when the +applications' freeze/thaw should start or finish. But it is not aware of +the freeze/thaw notification from Hyper-V host. The +.Nm +is designed to notify application freeze/thaw request. +Thus, it plays a role of broker to forward the freeze/thaw command from Hyper-V host +to userland application if it registered VSS service on +.Fx +VM, and sends the result back to Hyper-V host. +.Pp +Generally, +.Xr hv_vss_daemon 8 +takes the responsiblity to freeze/thaw UFS file system, +and it is automatically launched after system boots. When Hyper-V host wants to +take a snapshot of the +.Fx +VM, it will first send VSS capability check to +.Fx +VM. The +.Nm +received the request and forward the request to userland application if it is +registered. Only after +.Nm +received the VSS_SUCCESS response from application, the +.Xr hv_vss_daemon 8 +will be informed to check whether file system freeze/thaw is supported. Any error +occurs during this period, +.Nm +will inform Hyper-V host that VSS is not supported. In addition, there is a default +timeout limit before sending response to Hyper-V host. +If the total response time from application and +.Xr hv_vss_daemon 8 +exceeds this value, timeout +will occurs and VSS unsupported is responsed to Hyper-V host. +.Pp +After Hyper-V host confirmed the +.Fx +VM supports VSS, it will send freeze request to VM, and +.Nm +will first forward it to application. After application finished freezing, it should +inform +.Nm +and file system level freezing will be triggered by +.Xr hv_vss_daemon 8 . After all freezing +on both application and +.Xr hv_vss_daemon 8 +were finished, the +.Nm +will inform Hyper-V host that freezing is done. Of course, there is a timeout limit as +same as VSS capability is set to make sure freezing on +.Fx +VM is not hang. If there is any error occurs or timeout happened, the freezing is failed +on Hyper-V side. +.Pp +Hyper-V host will send thaw request after taking the snapshot, typically, this period is +very short in order not to block the running application. +.Nm +firstly thaw the file system by notifying +.Xr hv_vss_daemon 8 , +then notifies user registered +application. There is also a timeout check before sending response to Hyper-V host. +.Pp +All the default timeout limit used in VSS capability check, freeze or thaw is the same. +It is 15 seconds currently. +.Sh NOTES +.Nm +only support UFS currently. If any of file system partition is non UFS, the VSS capability +check will fail. If application does not register VSS, +.Nm +only support backup for file system level consistent. The device should be closed before it +was opened again. If you want to simultaneously open "/dev/hv_appvss_dev" two or more times, +an error (-1) will be returned, and errno was set. +.Pp +If +.Xr hv_vss_daemon 8 +was killed after system boots, the VSS functionality will not work. +.Sh EXAMPLES +The following is a complete example which does nothing except for waiting 2 seconds when +receiving those notifications from +.Nm +.Bd -literal +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define UNDEF_FREEZE_THAW (0) +#define FREEZE (1) +#define THAW (2) +#define CHECK (3) + +#define VSS_LOG(priority, format, args...) do { \\ + if (is_debugging == 1) { \\ + if (is_daemon == 1) \\ + syslog(priority, format, ## args); \\ + else \\ + printf(format, ## args); \\ + } else { \\ + if (priority < LOG_DEBUG) { \\ + if (is_daemon == 1) \\ + syslog(priority, format, ## args); \\ + else \\ + printf(format, ## args); \\ + } \\ + } \\ + } while(0) + +#define CHECK_TIMEOUT 1 +#define CHECK_FAIL 2 +#define FREEZE_TIMEOUT 1 +#define FREEZE_FAIL 2 +#define THAW_TIMEOUT 1 +#define THAW_FAIL 2 + +static int is_daemon = 1; +static int is_debugging = 0; +static int simu_opt_waiting = 2; // seconds + +#define GENERIC_OPT(TIMEOUT, FAIL) \\ + do { \\ + sleep(simu_opt_waiting); \\ + if (opt == CHECK_TIMEOUT) { \\ + sleep(simu_opt_waiting * 10); \\ + VSS_LOG(LOG_INFO, "%s timeout simulation\\n", \\ + __func__); \\ + return (0); \\ + } else if (opt == CHECK_FAIL) { \\ + VSS_LOG(LOG_INFO, "%s failure simulation\\n", \\ + __func__); \\ + return (CHECK_FAIL); \\ + } else { \\ + VSS_LOG(LOG_INFO, "%s success simulation\\n", \\ + __func__); \\ + return (0); \\ + } \\ + } while (0) + +static int +check(int opt) +{ + GENERIC_OPT(CHECK_TIMEOUT, CHECK_FAIL); +} + +static int +freeze(int opt) +{ + GENERIC_OPT(FREEZE_TIMEOUT, FREEZE_FAIL); +} + +static int +thaw(int opt) +{ + GENERIC_OPT(THAW_TIMEOUT, THAW_FAIL); +} + +static void usage(const char* cmd) { + fprintf(stderr, + "%s -f <0|1|2>: simulate app freeze." + " 0: successful, 1: freeze timeout, 2: freeze failed\\n" + " -c <0|1|2>: simulate vss feature check" + " -t <0|1|2>: simulate app thaw." + " 0: successful, 1: freeze timeout, 2: freeze failed\\n" + " -d : enable debug mode\\n" + " -n : run this tool under non-daemon mode\\n", cmd); +} + +int +main(int argc, char* argv[]) { + int ch, freezesimuop = 0, thawsimuop = 0, checksimuop = 0, fd, r, error; + uint32_t op; + struct pollfd app_vss_fd[1]; + struct hv_vss_opt_msg userdata; + + while ((ch = getopt(argc, argv, "f:c:t:dnh")) != -1) { + switch (ch) { + case 'f': + /* Run as regular process for debugging purpose. */ + freezesimuop = (int)strtol(optarg, NULL, 10); + break; + case 't': + thawsimuop = (int)strtol(optarg, NULL, 10); + break; + case 'c': + checksimuop = (int)strtol(optarg, NULL, 10); + break; + case 'd': + is_debugging = 1; + break; + case 'n': + is_daemon = 0; + break; + case 'h': + default: + usage(argv[0]); + exit(0); + } + } + + openlog("APPVSS", 0, LOG_USER); + /* Become daemon first. */ + if (is_daemon == 1) + daemon(1, 0); + else + VSS_LOG(LOG_DEBUG, "Run as regular process.\\n"); + + VSS_LOG(LOG_INFO, "HV_VSS starting; pid is: %d\\n", getpid()); + + fd = open(VSS_DEV(APP_VSS_DEV_NAME), O_RDWR); + if (fd < 0) { + VSS_LOG(LOG_ERR, "Fail to open %s, error: %d %s\\n", + VSS_DEV(APP_VSS_DEV_NAME), errno, strerror(errno)); + exit(EXIT_FAILURE); + } + app_vss_fd[0].fd = fd; + app_vss_fd[0].events = POLLIN | POLLRDNORM; + + while (1) { + r = poll(app_vss_fd, 1, INFTIM); + + VSS_LOG(LOG_DEBUG, "poll returned r = %d, revent = 0x%x\\n", + r, app_vss_fd[0].revents); + + if (r == 0 || (r < 0 && errno == EAGAIN) || + (r < 0 && errno == EINTR)) { + /* Nothing to read */ + continue; + } + + if (r < 0) { + /* + * For poll return failure other than EAGAIN, + * we want to exit. + */ + VSS_LOG(LOG_ERR, "Poll failed.\\n"); + perror("poll"); + exit(EIO); + } + + /* Read from character device */ + error = ioctl(fd, IOCHVVSSREAD, &userdata); + if (error < 0) { + VSS_LOG(LOG_ERR, "Read failed.\\n"); + perror("pread"); + exit(EIO); + } + + if (userdata.status != 0) { + VSS_LOG(LOG_ERR, "data read error\\n"); + continue; + } + + op = userdata.opt; + + switch (op) { + case HV_VSS_CHECK: + error = check(checksimuop); + break; + case HV_VSS_FREEZE: + error = freeze(freezesimuop); + break; + case HV_VSS_THAW: + error = thaw(thawsimuop); + break; + default: + VSS_LOG(LOG_ERR, "Illegal operation: %d\\n", op); + error = VSS_FAIL; + } + if (error) + userdata.status = VSS_FAIL; + else + userdata.status = VSS_SUCCESS; + error = ioctl(fd, IOCHVVSSWRITE, &userdata); + if (error != 0) { + VSS_LOG(LOG_ERR, "Fail to write to device\\n"); + exit(EXIT_FAILURE); + } else { + VSS_LOG(LOG_INFO, "Send response %d for %s to kernel\\n", + userdata.status, op == HV_VSS_FREEZE ? "Freeze" : + (op == HV_VSS_THAW ? "Thaw" : "Check")); + } + } + return 0; +} +.Sh SEE ALSO +.Xr hv_vss_daemon 8 , +.Xr hv_utils 4 +.Sh HISTORY +The daemon was introduced in October 2016 and developed by Microsoft Corp. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq Mt bsdic@microsoft.com . Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Thu Dec 29 01:11:57 2016 (r310734) +++ stable/10/sys/conf/files.amd64 Thu Dec 29 05:32:34 2016 (r310735) @@ -268,6 +268,7 @@ dev/hyperv/netvsc/if_hn.c optional hy dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv dev/hyperv/utilities/hv_heartbeat.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv +dev/hyperv/utilities/hv_snapshot.c optional hyperv dev/hyperv/utilities/hv_shutdown.c optional hyperv dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Thu Dec 29 01:11:57 2016 (r310734) +++ stable/10/sys/conf/files.i386 Thu Dec 29 05:32:34 2016 (r310735) @@ -245,6 +245,7 @@ dev/hyperv/netvsc/if_hn.c optional hy dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv dev/hyperv/utilities/hv_heartbeat.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv +dev/hyperv/utilities/hv_snapshot.c optional hyperv dev/hyperv/utilities/hv_shutdown.c optional hyperv dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv Copied: stable/10/sys/dev/hyperv/utilities/hv_snapshot.c (from r308664, head/sys/dev/hyperv/utilities/hv_snapshot.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/hyperv/utilities/hv_snapshot.c Thu Dec 29 05:32:34 2016 (r310735, copy of r308664, head/sys/dev/hyperv/utilities/hv_snapshot.c) @@ -0,0 +1,1061 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "hv_util.h" +#include "hv_snapshot.h" +#include "vmbus_if.h" + +#define VSS_MAJOR 5 +#define VSS_MINOR 0 +#define VSS_MSGVER VMBUS_IC_VERSION(VSS_MAJOR, VSS_MINOR) + +#define VSS_FWVER_MAJOR 3 +#define VSS_FWVER VMBUS_IC_VERSION(VSS_FWVER_MAJOR, 0) + +#define TIMEOUT_LIMIT (15) // seconds +enum hv_vss_op { + VSS_OP_CREATE = 0, + VSS_OP_DELETE, + VSS_OP_HOT_BACKUP, + VSS_OP_GET_DM_INFO, + VSS_OP_BU_COMPLETE, + /* + * Following operations are only supported with IC version >= 5.0 + */ + VSS_OP_FREEZE, /* Freeze the file systems in the VM */ + VSS_OP_THAW, /* Unfreeze the file systems */ + VSS_OP_AUTO_RECOVER, + VSS_OP_COUNT /* Number of operations, must be last */ +}; + +/* + * Header for all VSS messages. + */ +struct hv_vss_hdr { + struct vmbus_icmsg_hdr ic_hdr; + uint8_t operation; + uint8_t reserved[7]; +} __packed; + + +/* + * Flag values for the hv_vss_check_feature. Here supports only + * one value. + */ +#define VSS_HBU_NO_AUTO_RECOVERY 0x00000005 + +struct hv_vss_check_feature { + uint32_t flags; +} __packed; + +struct hv_vss_check_dm_info { + uint32_t flags; +} __packed; + +struct hv_vss_msg { + union { + struct hv_vss_hdr vss_hdr; + } hdr; + union { + struct hv_vss_check_feature vss_cf; + struct hv_vss_check_dm_info dm_info; + } body; +} __packed; + +struct hv_vss_req { + struct hv_vss_opt_msg opt_msg; /* used to communicate with daemon */ + struct hv_vss_msg msg; /* used to communicate with host */ +} __packed; + +/* hv_vss debug control */ +static int hv_vss_log = 0; + +#define hv_vss_log_error(...) do { \ + if (hv_vss_log > 0) \ + log(LOG_ERR, "hv_vss: " __VA_ARGS__); \ +} while (0) + +#define hv_vss_log_info(...) do { \ + if (hv_vss_log > 1) \ + log(LOG_INFO, "hv_vss: " __VA_ARGS__); \ +} while (0) + +static const struct vmbus_ic_desc vmbus_vss_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x29, 0x2e, 0xfa, 0x35, 0x23, 0xea, 0x36, 0x42, + 0x96, 0xae, 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40} }, + .ic_desc = "Hyper-V VSS" + }, + VMBUS_IC_DESC_END +}; + +static const char * vss_opt_name[] = {"None", "VSSCheck", "Freeze", "Thaw"}; + +/* character device prototypes */ +static d_open_t hv_vss_dev_open; +static d_close_t hv_vss_dev_close; +static d_poll_t hv_vss_dev_daemon_poll; +static d_ioctl_t hv_vss_dev_daemon_ioctl; + +static d_open_t hv_appvss_dev_open; +static d_close_t hv_appvss_dev_close; +static d_poll_t hv_appvss_dev_poll; +static d_ioctl_t hv_appvss_dev_ioctl; + +/* hv_vss character device structure */ +static struct cdevsw hv_vss_cdevsw = +{ + .d_version = D_VERSION, + .d_open = hv_vss_dev_open, + .d_close = hv_vss_dev_close, + .d_poll = hv_vss_dev_daemon_poll, + .d_ioctl = hv_vss_dev_daemon_ioctl, + .d_name = FS_VSS_DEV_NAME, +}; + +static struct cdevsw hv_appvss_cdevsw = +{ + .d_version = D_VERSION, + .d_open = hv_appvss_dev_open, + .d_close = hv_appvss_dev_close, + .d_poll = hv_appvss_dev_poll, + .d_ioctl = hv_appvss_dev_ioctl, + .d_name = APP_VSS_DEV_NAME, +}; + +struct hv_vss_sc; +/* + * Global state to track cdev + */ +struct hv_vss_dev_sc { + /* + * msg was transferred from host to notify queue, and + * ack queue. Finally, it was recyled to free list. + */ + STAILQ_HEAD(, hv_vss_req_internal) to_notify_queue; + STAILQ_HEAD(, hv_vss_req_internal) to_ack_queue; + struct hv_vss_sc *sc; + struct proc *proc_task; + struct selinfo hv_vss_selinfo; +}; +/* + * Global state to track and synchronize the transaction requests from the host. + * The VSS allows user to register their function to do freeze/thaw for application. + * VSS kernel will notify both vss daemon and user application if it is registered. + * The implementation state transition is illustrated by: + * https://clovertrail.github.io/assets/vssdot.png + */ +typedef struct hv_vss_sc { + struct hv_util_sc util_sc; + device_t dev; + + struct task task; + + /* + * mutex is used to protect access of list/queue, + * callout in request is also used this mutex. + */ + struct mtx pending_mutex; + /* + * req_free_list contains all free items + */ + LIST_HEAD(, hv_vss_req_internal) req_free_list; + + /* Indicates if daemon registered with driver */ + boolean_t register_done; + + boolean_t app_register_done; + + /* cdev for file system freeze/thaw */ + struct cdev *hv_vss_dev; + /* cdev for application freeze/thaw */ + struct cdev *hv_appvss_dev; + + /* sc for app */ + struct hv_vss_dev_sc app_sc; + /* sc for deamon */ + struct hv_vss_dev_sc daemon_sc; +} hv_vss_sc; + +typedef struct hv_vss_req_internal { + LIST_ENTRY(hv_vss_req_internal) link; + STAILQ_ENTRY(hv_vss_req_internal) slink; + struct hv_vss_req vss_req; + + /* Rcv buffer for communicating with the host*/ + uint8_t *rcv_buf; + /* Length of host message */ + uint32_t host_msg_len; + /* Host message id */ + uint64_t host_msg_id; + + hv_vss_sc *sc; + + struct callout callout; +} hv_vss_req_internal; + +#define SEARCH_REMOVE_REQ_LOCKED(reqp, queue, link, tmp, id) \ + do { \ + STAILQ_FOREACH_SAFE(reqp, queue, link, tmp) { \ + if (reqp->vss_req.opt_msg.msgid == id) { \ + STAILQ_REMOVE(queue, \ + reqp, hv_vss_req_internal, link); \ + break; \ + } \ + } \ + } while (0) + +static bool +hv_vss_is_daemon_killed_after_launch(hv_vss_sc *sc) +{ + return (!sc->register_done && sc->daemon_sc.proc_task); +} + +/* + * Callback routine that gets called whenever there is a message from host + */ +static void +hv_vss_callback(struct vmbus_channel *chan __unused, void *context) +{ + hv_vss_sc *sc = (hv_vss_sc*)context; + if (hv_vss_is_daemon_killed_after_launch(sc)) + hv_vss_log_info("%s: daemon was killed!\n", __func__); + if (sc->register_done || sc->daemon_sc.proc_task) { + hv_vss_log_info("%s: Queuing work item\n", __func__); + if (hv_vss_is_daemon_killed_after_launch(sc)) + hv_vss_log_info("%s: daemon was killed!\n", __func__); + taskqueue_enqueue(taskqueue_thread, &sc->task); + } else { + hv_vss_log_info("%s: daemon has never been registered\n", __func__); + } + hv_vss_log_info("%s: received msg from host\n", __func__); +} +/* + * Send the response back to the host. + */ +static void +hv_vss_respond_host(uint8_t *rcv_buf, struct vmbus_channel *ch, + uint32_t recvlen, uint64_t requestid, uint32_t error) +{ + struct vmbus_icmsg_hdr *hv_icmsg_hdrp; + + hv_icmsg_hdrp = (struct vmbus_icmsg_hdr *)rcv_buf; + + hv_icmsg_hdrp->ic_status = error; + hv_icmsg_hdrp->ic_flags = HV_ICMSGHDRFLAG_TRANSACTION | HV_ICMSGHDRFLAG_RESPONSE; + + error = vmbus_chan_send(ch, VMBUS_CHANPKT_TYPE_INBAND, 0, + rcv_buf, recvlen, requestid); + if (error) + hv_vss_log_info("%s: hv_vss_respond_host: sendpacket error:%d\n", + __func__, error); +} + +static void +hv_vss_notify_host_result_locked(struct hv_vss_req_internal *reqp, uint32_t status) +{ + struct hv_vss_msg* msg = (struct hv_vss_msg *)reqp->rcv_buf; + hv_vss_sc *sc = reqp->sc; + if (reqp->vss_req.opt_msg.opt == HV_VSS_CHECK) { + msg->body.vss_cf.flags = VSS_HBU_NO_AUTO_RECOVERY; + } + hv_vss_log_info("%s, %s response %s to host\n", __func__, + vss_opt_name[reqp->vss_req.opt_msg.opt], + status == HV_S_OK ? "Success" : "Fail"); + hv_vss_respond_host(reqp->rcv_buf, vmbus_get_channel(reqp->sc->dev), + reqp->host_msg_len, reqp->host_msg_id, status); + /* recycle the request */ + LIST_INSERT_HEAD(&sc->req_free_list, reqp, link); +} + +static void +hv_vss_notify_host_result(struct hv_vss_req_internal *reqp, uint32_t status) +{ + mtx_lock(&reqp->sc->pending_mutex); + hv_vss_notify_host_result_locked(reqp, status); + mtx_unlock(&reqp->sc->pending_mutex); +} + +static void +hv_vss_cp_vssreq_to_user(struct hv_vss_req_internal *reqp, + struct hv_vss_opt_msg *userdata) +{ + struct hv_vss_req *hv_vss_dev_buf; + hv_vss_dev_buf = &reqp->vss_req; + hv_vss_dev_buf->opt_msg.opt = HV_VSS_NONE; + switch (reqp->vss_req.msg.hdr.vss_hdr.operation) { + case VSS_OP_FREEZE: + hv_vss_dev_buf->opt_msg.opt = HV_VSS_FREEZE; + break; + case VSS_OP_THAW: + hv_vss_dev_buf->opt_msg.opt = HV_VSS_THAW; + break; + case VSS_OP_HOT_BACKUP: + hv_vss_dev_buf->opt_msg.opt = HV_VSS_CHECK; + break; + } + *userdata = hv_vss_dev_buf->opt_msg; + hv_vss_log_info("%s, read data from user for " + "%s (%ju) \n", __func__, vss_opt_name[userdata->opt], + (uintmax_t)userdata->msgid); +} + +/** + * Remove the request id from app notifiy or ack queue, + * and recyle the request by inserting it to free list. + * + * When app was notified but not yet sending ack, the request + * should locate in either notify queue or ack queue. + */ +static struct hv_vss_req_internal* +hv_vss_drain_req_queue_locked(hv_vss_sc *sc, uint64_t req_id) +{ + struct hv_vss_req_internal *reqp, *tmp; + SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->daemon_sc.to_notify_queue, + slink, tmp, req_id); + if (reqp == NULL) + SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->daemon_sc.to_ack_queue, + slink, tmp, req_id); + if (reqp == NULL) + SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->app_sc.to_notify_queue, + slink, tmp, req_id); + if (reqp == NULL) + SEARCH_REMOVE_REQ_LOCKED(reqp, &sc->app_sc.to_ack_queue, slink, + tmp, req_id); + return (reqp); +} +/** + * Actions for daemon who has been notified. + */ +static void +hv_vss_notified(struct hv_vss_dev_sc *dev_sc, struct hv_vss_opt_msg *userdata) +{ + struct hv_vss_req_internal *reqp; + mtx_lock(&dev_sc->sc->pending_mutex); + if (!STAILQ_EMPTY(&dev_sc->to_notify_queue)) { + reqp = STAILQ_FIRST(&dev_sc->to_notify_queue); + hv_vss_cp_vssreq_to_user(reqp, userdata); + STAILQ_REMOVE_HEAD(&dev_sc->to_notify_queue, slink); + /* insert the msg to queue for write */ + STAILQ_INSERT_TAIL(&dev_sc->to_ack_queue, reqp, slink); + userdata->status = VSS_SUCCESS; + } else { + /* Timeout occur, thus request was removed from queue. */ + hv_vss_log_info("%s: notify queue is empty!\n", __func__); + userdata->status = VSS_FAIL; + } + mtx_unlock(&dev_sc->sc->pending_mutex); +} + +static void +hv_vss_notify(struct hv_vss_dev_sc *dev_sc, struct hv_vss_req_internal *reqp) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 29 06:06:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A2C7C9586B; Thu, 29 Dec 2016 06:06:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17D021BA0; Thu, 29 Dec 2016 06:06:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6667D029135; Thu, 29 Dec 2016 06:06:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT666hx029131; Thu, 29 Dec 2016 06:06:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290606.uBT666hx029131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 06:06: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: r310736 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:06:07 -0000 Author: sephe Date: Thu Dec 29 06:06:05 2016 New Revision: 310736 URL: https://svnweb.freebsd.org/changeset/base/310736 Log: MFC 308905 hyperv/hn: Implement RNDIS multi-packet message support. Currently, it is only applied to packet sent through chimney sending buffers. Not enabled by default yet. This one gives 20%~30% performance boost for non-TSO usage in both bit/packet rate tests and nginx performance test. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8560 Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 05:32:34 2016 (r310735) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 06:06:05 2016 (r310736) @@ -839,11 +839,15 @@ hn_rndis_init(struct hn_softc *sc) error = EIO; goto done; } + sc->hn_rndis_agg_size = comp->rm_pktmaxsz; + sc->hn_rndis_agg_pkts = comp->rm_pktmaxcnt; + sc->hn_rndis_agg_align = 1U << comp->rm_align; + if (bootverbose) { if_printf(sc->hn_ifp, "RNDIS ver %u.%u, pktsz %u, pktcnt %u, " "align %u\n", comp->rm_ver_major, comp->rm_ver_minor, - comp->rm_pktmaxsz, comp->rm_pktmaxcnt, - 1U << comp->rm_align); + sc->hn_rndis_agg_size, sc->hn_rndis_agg_pkts, + sc->hn_rndis_agg_align); } error = 0; done: Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 05:32:34 2016 (r310735) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 06:06:05 2016 (r310736) @@ -162,10 +162,22 @@ __FBSDID("$FreeBSD$"); #define HN_CSUM_IP6_HWASSIST(sc) \ ((sc)->hn_tx_ring[0].hn_csum_assist & HN_CSUM_IP6_MASK) +#define HN_PKTSIZE_MIN(align) \ + roundup2(ETHER_MIN_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_CRC_LEN + \ + HN_RNDIS_PKT_LEN, (align)) +#define HN_PKTSIZE(m, align) \ + roundup2((m)->m_pkthdr.len + HN_RNDIS_PKT_LEN, (align)) + struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; #endif + STAILQ_ENTRY(hn_txdesc) agg_link; + + /* Aggregated txdescs, in sending order. */ + STAILQ_HEAD(, hn_txdesc) agg_list; + + /* The oldest packet, if transmission aggregation happens. */ struct mbuf *m; struct hn_tx_ring *txr; int refs; @@ -183,6 +195,7 @@ struct hn_txdesc { #define HN_TXD_FLAG_ONLIST 0x0001 #define HN_TXD_FLAG_DMAMAP 0x0002 +#define HN_TXD_FLAG_ONAGG 0x0004 struct hn_rxinfo { uint32_t vlan_info; @@ -262,6 +275,10 @@ static int hn_rxfilter_sysctl(SYSCTL_H static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_txagg_size_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *); static void hn_init_locked(struct hn_softc *); @@ -309,7 +326,7 @@ static int hn_create_tx_data(struct hn static void hn_fixup_tx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); static void hn_txdesc_dmamap_destroy(struct hn_txdesc *); -static int hn_encap(struct hn_tx_ring *, +static int hn_encap(struct ifnet *, struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_txpkt(struct ifnet *, struct hn_tx_ring *, struct hn_txdesc *); @@ -318,6 +335,10 @@ static void hn_set_tso_maxsize(struct static bool hn_tx_ring_pending(struct hn_tx_ring *); static void hn_tx_ring_qflush(struct hn_tx_ring *); static void hn_resume_tx(struct hn_softc *, int); +static void hn_set_txagg(struct hn_softc *); +static void *hn_try_txagg(struct ifnet *, + struct hn_tx_ring *, struct hn_txdesc *, + int); static int hn_get_txswq_depth(const struct hn_tx_ring *); static void hn_txpkt_done(struct hn_nvs_sendctx *, struct hn_softc *, struct vmbus_channel *, @@ -433,6 +454,16 @@ SYSCTL_UINT(_hw_hn, OID_AUTO, lro_mbufq_ &hn_lro_mbufq_depth, 0, "Depth of LRO mbuf queue"); #endif +/* Packet transmission aggregation size limit */ +static int hn_tx_agg_size = -1; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_size, CTLFLAG_RDTUN, + &hn_tx_agg_size, 0, "Packet transmission aggregation size limit"); + +/* Packet transmission aggregation count limit */ +static int hn_tx_agg_pkts = 0; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, + &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); + static u_int hn_cpu_index; /* next CPU for channel */ static struct taskqueue *hn_tx_taskq; /* shared TX taskqueue */ @@ -661,6 +692,84 @@ hn_set_rxfilter(struct hn_softc *sc) return (error); } +static void +hn_set_txagg(struct hn_softc *sc) +{ + uint32_t size, pkts; + int i; + + /* + * Setup aggregation size. + */ + if (sc->hn_agg_size < 0) + size = UINT32_MAX; + else + size = sc->hn_agg_size; + + if (sc->hn_rndis_agg_size < size) + size = sc->hn_rndis_agg_size; + + if (size <= 2 * HN_PKTSIZE_MIN(sc->hn_rndis_agg_align)) { + /* Disable */ + size = 0; + pkts = 0; + goto done; + } + + /* NOTE: Type of the per TX ring setting is 'int'. */ + if (size > INT_MAX) + size = INT_MAX; + + /* NOTE: We only aggregate packets using chimney sending buffers. */ + if (size > (uint32_t)sc->hn_chim_szmax) + size = sc->hn_chim_szmax; + + /* + * Setup aggregation packet count. + */ + if (sc->hn_agg_pkts < 0) + pkts = UINT32_MAX; + else + pkts = sc->hn_agg_pkts; + + if (sc->hn_rndis_agg_pkts < pkts) + pkts = sc->hn_rndis_agg_pkts; + + if (pkts <= 1) { + /* Disable */ + size = 0; + pkts = 0; + goto done; + } + + /* NOTE: Type of the per TX ring setting is 'short'. */ + if (pkts > SHRT_MAX) + pkts = SHRT_MAX; + +done: + /* NOTE: Type of the per TX ring setting is 'short'. */ + if (sc->hn_rndis_agg_align > SHRT_MAX) { + /* Disable */ + size = 0; + pkts = 0; + } + + if (bootverbose) { + if_printf(sc->hn_ifp, "TX agg size %u, pkts %u, align %u\n", + size, pkts, sc->hn_rndis_agg_align); + } + + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; + + mtx_lock(&txr->hn_tx_lock); + txr->hn_agg_szmax = size; + txr->hn_agg_pktmax = pkts; + txr->hn_agg_align = sc->hn_rndis_agg_align; + mtx_unlock(&txr->hn_tx_lock); + } +} + static int hn_get_txswq_depth(const struct hn_tx_ring *txr) { @@ -801,6 +910,12 @@ hn_attach(device_t dev) HN_LOCK_INIT(sc); /* + * Initialize these tunables once. + */ + sc->hn_agg_size = hn_tx_agg_size; + sc->hn_agg_pkts = hn_tx_agg_pkts; + + /* * Setup taskqueue for transmission. */ if (hn_tx_taskq == NULL) { @@ -956,6 +1071,24 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_ind", CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, hn_rss_ind_sysctl, "IU", "RSS indirect table"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rndis_agg_size", + CTLFLAG_RD, &sc->hn_rndis_agg_size, 0, + "RNDIS offered packet transmission aggregation size limit"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rndis_agg_pkts", + CTLFLAG_RD, &sc->hn_rndis_agg_pkts, 0, + "RNDIS offered packet transmission aggregation count limit"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rndis_agg_align", + CTLFLAG_RD, &sc->hn_rndis_agg_align, 0, + "RNDIS packet transmission aggregation alignment"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "agg_size", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + hn_txagg_size_sysctl, "I", + "Packet transmission aggregation size, 0 -- disable, -1 -- auto"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "agg_pkts", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + hn_txagg_pkts_sysctl, "I", + "Packet transmission aggregation packets, " + "0 -- disable, -1 -- auto"); /* * Setup the ifmedia, which has been initialized earlier. @@ -1211,16 +1344,45 @@ hn_txdesc_put(struct hn_tx_ring *txr, st KASSERT((txd->flags & HN_TXD_FLAG_ONLIST) == 0, ("put an onlist txd %#x", txd->flags)); + KASSERT((txd->flags & HN_TXD_FLAG_ONAGG) == 0, + ("put an onagg txd %#x", txd->flags)); KASSERT(txd->refs > 0, ("invalid txd refs %d", txd->refs)); if (atomic_fetchadd_int(&txd->refs, -1) != 1) return 0; + if (!STAILQ_EMPTY(&txd->agg_list)) { + struct hn_txdesc *tmp_txd; + + while ((tmp_txd = STAILQ_FIRST(&txd->agg_list)) != NULL) { + int freed; + + KASSERT(STAILQ_EMPTY(&tmp_txd->agg_list), + ("resursive aggregation on aggregated txdesc")); + KASSERT((tmp_txd->flags & HN_TXD_FLAG_ONAGG), + ("not aggregated txdesc")); + KASSERT((tmp_txd->flags & HN_TXD_FLAG_DMAMAP) == 0, + ("aggregated txdesc uses dmamap")); + KASSERT(tmp_txd->chim_index == HN_NVS_CHIM_IDX_INVALID, + ("aggregated txdesc consumes " + "chimney sending buffer")); + KASSERT(tmp_txd->chim_size == 0, + ("aggregated txdesc has non-zero " + "chimney sending size")); + + STAILQ_REMOVE_HEAD(&txd->agg_list, agg_link); + tmp_txd->flags &= ~HN_TXD_FLAG_ONAGG; + freed = hn_txdesc_put(txr, tmp_txd); + KASSERT(freed, ("failed to free aggregated txdesc")); + } + } + if (txd->chim_index != HN_NVS_CHIM_IDX_INVALID) { KASSERT((txd->flags & HN_TXD_FLAG_DMAMAP) == 0, ("chim txd uses dmamap")); hn_chim_free(txr->hn_sc, txd->chim_index); txd->chim_index = HN_NVS_CHIM_IDX_INVALID; + txd->chim_size = 0; } else if (txd->flags & HN_TXD_FLAG_DMAMAP) { bus_dmamap_sync(txr->hn_tx_data_dtag, txd->data_dmap, BUS_DMASYNC_POSTWRITE); @@ -1275,8 +1437,11 @@ hn_txdesc_get(struct hn_tx_ring *txr) atomic_subtract_int(&txr->hn_txdesc_avail, 1); #endif KASSERT(txd->m == NULL && txd->refs == 0 && + STAILQ_EMPTY(&txd->agg_list) && txd->chim_index == HN_NVS_CHIM_IDX_INVALID && + txd->chim_size == 0 && (txd->flags & HN_TXD_FLAG_ONLIST) && + (txd->flags & HN_TXD_FLAG_ONAGG) == 0 && (txd->flags & HN_TXD_FLAG_DMAMAP) == 0, ("invalid txd")); txd->flags &= ~HN_TXD_FLAG_ONLIST; txd->refs = 1; @@ -1293,6 +1458,22 @@ hn_txdesc_hold(struct hn_txdesc *txd) atomic_add_int(&txd->refs, 1); } +static __inline void +hn_txdesc_agg(struct hn_txdesc *agg_txd, struct hn_txdesc *txd) +{ + + KASSERT((agg_txd->flags & HN_TXD_FLAG_ONAGG) == 0, + ("recursive aggregation on aggregating txdesc")); + + KASSERT((txd->flags & HN_TXD_FLAG_ONAGG) == 0, + ("already aggregated")); + KASSERT(STAILQ_EMPTY(&txd->agg_list), + ("recursive aggregation on to-be-aggregated txdesc")); + + txd->flags |= HN_TXD_FLAG_ONAGG; + STAILQ_INSERT_TAIL(&agg_txd->agg_list, txd, agg_link); +} + static bool hn_tx_ring_pending(struct hn_tx_ring *txr) { @@ -1410,12 +1591,123 @@ hn_rndis_pktinfo_append(struct rndis_pac return (pi->rm_data); } +static __inline int +hn_flush_txagg(struct ifnet *ifp, struct hn_tx_ring *txr) +{ + struct hn_txdesc *txd; + struct mbuf *m; + int error, pkts; + + txd = txr->hn_agg_txd; + KASSERT(txd != NULL, ("no aggregate txdesc")); + + /* + * Since hn_txpkt() will reset this temporary stat, save + * it now, so that oerrors can be updated properly, if + * hn_txpkt() ever fails. + */ + pkts = txr->hn_stat_pkts; + + /* + * Since txd's mbuf will _not_ be freed upon hn_txpkt() + * failure, save it for later freeing, if hn_txpkt() ever + * fails. + */ + m = txd->m; + error = hn_txpkt(ifp, txr, txd); + if (__predict_false(error)) { + /* txd is freed, but m is not. */ + m_freem(m); + + txr->hn_flush_failed++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, pkts); + } + + /* Reset all aggregation states. */ + txr->hn_agg_txd = NULL; + txr->hn_agg_szleft = 0; + txr->hn_agg_pktleft = 0; + txr->hn_agg_prevpkt = NULL; + + return (error); +} + +static void * +hn_try_txagg(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd, + int pktsize) +{ + void *chim; + + if (txr->hn_agg_txd != NULL) { + if (txr->hn_agg_pktleft >= 1 && txr->hn_agg_szleft > pktsize) { + struct hn_txdesc *agg_txd = txr->hn_agg_txd; + struct rndis_packet_msg *pkt = txr->hn_agg_prevpkt; + int olen; + + /* + * Update the previous RNDIS packet's total length, + * it can be increased due to the mandatory alignment + * padding for this RNDIS packet. And update the + * aggregating txdesc's chimney sending buffer size + * accordingly. + * + * XXX + * Zero-out the padding, as required by the RNDIS spec. + */ + olen = pkt->rm_len; + pkt->rm_len = roundup2(olen, txr->hn_agg_align); + agg_txd->chim_size += pkt->rm_len - olen; + + /* Link this txdesc to the parent. */ + hn_txdesc_agg(agg_txd, txd); + + chim = (uint8_t *)pkt + pkt->rm_len; + /* Save the current packet for later fixup. */ + txr->hn_agg_prevpkt = chim; + + txr->hn_agg_pktleft--; + txr->hn_agg_szleft -= pktsize; + if (txr->hn_agg_szleft <= + HN_PKTSIZE_MIN(txr->hn_agg_align)) { + /* + * Probably can't aggregate more packets, + * flush this aggregating txdesc proactively. + */ + txr->hn_agg_pktleft = 0; + } + /* Done! */ + return (chim); + } + hn_flush_txagg(ifp, txr); + } + KASSERT(txr->hn_agg_txd == NULL, ("lingering aggregating txdesc")); + + txr->hn_tx_chimney_tried++; + txd->chim_index = hn_chim_alloc(txr->hn_sc); + if (txd->chim_index == HN_NVS_CHIM_IDX_INVALID) + return (NULL); + txr->hn_tx_chimney++; + + chim = txr->hn_sc->hn_chim + + (txd->chim_index * txr->hn_sc->hn_chim_szmax); + + if (txr->hn_agg_pktmax > 1 && + txr->hn_agg_szmax > pktsize + HN_PKTSIZE_MIN(txr->hn_agg_align)) { + txr->hn_agg_txd = txd; + txr->hn_agg_pktleft = txr->hn_agg_pktmax - 1; + txr->hn_agg_szleft = txr->hn_agg_szmax - pktsize; + txr->hn_agg_prevpkt = chim; + } + return (chim); +} + /* * NOTE: * If this function fails, then both txd and m_head0 will be freed. */ static int -hn_encap(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head0) +hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd, + struct mbuf **m_head0) { bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i; @@ -1423,33 +1715,30 @@ hn_encap(struct hn_tx_ring *txr, struct struct rndis_packet_msg *pkt; uint32_t *pi_data; void *chim = NULL; - int pktlen; + int pkt_hlen, pkt_size; pkt = txd->rndis_pkt; - if (m_head->m_pkthdr.len + HN_RNDIS_PKT_LEN < txr->hn_chim_size) { - /* - * This packet is small enough to fit into a chimney sending - * buffer. Try allocating one chimney sending buffer now. - */ - txr->hn_tx_chimney_tried++; - txd->chim_index = hn_chim_alloc(txr->hn_sc); - if (txd->chim_index != HN_NVS_CHIM_IDX_INVALID) { - chim = txr->hn_sc->hn_chim + - (txd->chim_index * txr->hn_sc->hn_chim_szmax); - /* - * Directly fill the chimney sending buffer w/ the - * RNDIS packet message. - */ + pkt_size = HN_PKTSIZE(m_head, txr->hn_agg_align); + if (pkt_size < txr->hn_chim_size) { + chim = hn_try_txagg(ifp, txr, txd, pkt_size); + if (chim != NULL) pkt = chim; - } + } else { + if (txr->hn_agg_txd != NULL) + hn_flush_txagg(ifp, txr); } pkt->rm_type = REMOTE_NDIS_PACKET_MSG; pkt->rm_len = sizeof(*pkt) + m_head->m_pkthdr.len; pkt->rm_dataoffset = sizeof(*pkt); pkt->rm_datalen = m_head->m_pkthdr.len; + pkt->rm_oobdataoffset = 0; + pkt->rm_oobdatalen = 0; + pkt->rm_oobdataelements = 0; pkt->rm_pktinfooffset = sizeof(*pkt); pkt->rm_pktinfolen = 0; + pkt->rm_vchandle = 0; + pkt->rm_reserved = 0; if (txr->hn_tx_flags & HN_TX_FLAG_HASHVAL) { /* @@ -1510,7 +1799,7 @@ hn_encap(struct hn_tx_ring *txr, struct *pi_data |= NDIS_TXCSUM_INFO_UDPCS; } - pktlen = pkt->rm_pktinfooffset + pkt->rm_pktinfolen; + pkt_hlen = pkt->rm_pktinfooffset + pkt->rm_pktinfolen; /* Convert RNDIS packet message offsets */ pkt->rm_dataoffset = hn_rndis_pktmsg_offset(pkt->rm_dataoffset); pkt->rm_pktinfooffset = hn_rndis_pktmsg_offset(pkt->rm_pktinfooffset); @@ -1519,25 +1808,36 @@ hn_encap(struct hn_tx_ring *txr, struct * Fast path: Chimney sending. */ if (chim != NULL) { - KASSERT(txd->chim_index != HN_NVS_CHIM_IDX_INVALID, - ("chimney buffer is not used")); - KASSERT(pkt == chim, ("RNDIS pkt not in chimney buffer")); + struct hn_txdesc *tgt_txd = txd; + + if (txr->hn_agg_txd != NULL) { + tgt_txd = txr->hn_agg_txd; +#ifdef INVARIANTS + *m_head0 = NULL; +#endif + } + + KASSERT(pkt == chim, + ("RNDIS pkt not in chimney sending buffer")); + KASSERT(tgt_txd->chim_index != HN_NVS_CHIM_IDX_INVALID, + ("chimney sending buffer is not used")); + tgt_txd->chim_size += pkt->rm_len; m_copydata(m_head, 0, m_head->m_pkthdr.len, - ((uint8_t *)chim) + pktlen); + ((uint8_t *)chim) + pkt_hlen); - txd->chim_size = pkt->rm_len; txr->hn_gpa_cnt = 0; - txr->hn_tx_chimney++; txr->hn_sendpkt = hn_txpkt_chim; goto done; } + + KASSERT(txr->hn_agg_txd == NULL, ("aggregating sglist txdesc")); KASSERT(txd->chim_index == HN_NVS_CHIM_IDX_INVALID, ("chimney buffer is used")); KASSERT(pkt == txd->rndis_pkt, ("RNDIS pkt not in txdesc")); error = hn_txdesc_dmamap_load(txr, txd, &m_head, segs, &nsegs); - if (error) { + if (__predict_false(error)) { int freed; /* @@ -1551,7 +1851,7 @@ hn_encap(struct hn_tx_ring *txr, struct ("fail to free txd upon txdma error")); txr->hn_txdma_failed++; - if_inc_counter(txr->hn_sc->hn_ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return error; } *m_head0 = m_head; @@ -1562,7 +1862,7 @@ hn_encap(struct hn_tx_ring *txr, struct /* send packet with page buffer */ txr->hn_gpa[0].gpa_page = atop(txd->rndis_pkt_paddr); txr->hn_gpa[0].gpa_ofs = txd->rndis_pkt_paddr & PAGE_MASK; - txr->hn_gpa[0].gpa_len = pktlen; + txr->hn_gpa[0].gpa_len = pkt_hlen; /* * Fill the page buffers with mbuf info after the page @@ -1585,6 +1885,12 @@ done: /* Set the completion routine */ hn_nvs_sendctx_init(&txd->send_ctx, hn_txpkt_done, txd); + /* Update temporary stats for later use. */ + txr->hn_stat_pkts++; + txr->hn_stat_size += m_head->m_pkthdr.len; + if (m_head->m_flags & M_MCAST) + txr->hn_stat_mcasts++; + return 0; } @@ -1600,23 +1906,34 @@ hn_txpkt(struct ifnet *ifp, struct hn_tx again: /* - * Make sure that txd is not freed before ETHER_BPF_MTAP. + * Make sure that this txd and any aggregated txds are not freed + * before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); error = txr->hn_sendpkt(txr, txd); if (!error) { - ETHER_BPF_MTAP(ifp, txd->m); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if (bpf_peers_present(ifp->if_bpf)) { + const struct hn_txdesc *tmp_txd; + + ETHER_BPF_MTAP(ifp, txd->m); + STAILQ_FOREACH(tmp_txd, &txd->agg_list, agg_link) + ETHER_BPF_MTAP(ifp, tmp_txd->m); + } + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, txr->hn_stat_pkts); #ifdef HN_IFSTART_SUPPORT if (!hn_use_if_start) #endif { if_inc_counter(ifp, IFCOUNTER_OBYTES, - txd->m->m_pkthdr.len); - if (txd->m->m_flags & M_MCAST) - if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + txr->hn_stat_size); + if (txr->hn_stat_mcasts != 0) { + if_inc_counter(ifp, IFCOUNTER_OMCASTS, + txr->hn_stat_mcasts); + } } - txr->hn_pkts++; + txr->hn_pkts += txr->hn_stat_pkts; + txr->hn_sends++; } hn_txdesc_put(txr, txd); @@ -1656,7 +1973,13 @@ again: txr->hn_send_failed++; } - return error; + + /* Reset temporary stats, after this sending is done. */ + txr->hn_stat_size = 0; + txr->hn_stat_pkts = 0; + txr->hn_stat_mcasts = 0; + + return (error); } /* @@ -2438,6 +2761,64 @@ hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARG } static int +hn_txagg_size_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int error, size; + + size = sc->hn_agg_size; + error = sysctl_handle_int(oidp, &size, 0, req); + if (error || req->newptr == NULL) + return (error); + + HN_LOCK(sc); + sc->hn_agg_size = size; + hn_set_txagg(sc); + HN_UNLOCK(sc); + + return (0); +} + +static int +hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int error, pkts; + + pkts = sc->hn_agg_pkts; + error = sysctl_handle_int(oidp, &pkts, 0, req); + if (error || req->newptr == NULL) + return (error); + + HN_LOCK(sc); + sc->hn_agg_pkts = pkts; + hn_set_txagg(sc); + HN_UNLOCK(sc); + + return (0); +} + +static int +hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int pkts; + + pkts = sc->hn_tx_ring[0].hn_agg_pktmax; + return (sysctl_handle_int(oidp, &pkts, 0, req)); +} + +static int +hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int align; + + align = sc->hn_tx_ring[0].hn_agg_align; + return (sysctl_handle_int(oidp, &align, 0, req)); +} + +static int hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; @@ -2980,6 +3361,7 @@ hn_tx_ring_create(struct hn_softc *sc, i txd->txr = txr; txd->chim_index = HN_NVS_CHIM_IDX_INVALID; + STAILQ_INIT(&txd->agg_list); /* * Allocate and load RNDIS packet message. @@ -3063,6 +3445,8 @@ hn_tx_ring_create(struct hn_softc *sc, i SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "packets", CTLFLAG_RW, &txr->hn_pkts, "# of packets transmitted"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "sends", + CTLFLAG_RW, &txr->hn_sends, "# of sends"); } } @@ -3177,6 +3561,11 @@ hn_create_tx_data(struct hn_softc *sc, i CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_txdma_failed), hn_tx_stat_ulong_sysctl, "LU", "# of TX DMA failure"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "agg_flush_failed", + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + __offsetof(struct hn_tx_ring, hn_flush_failed), + hn_tx_stat_ulong_sysctl, "LU", + "# of packet transmission aggregation flush failure"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_collapsed", CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_tx_collapsed), @@ -3213,6 +3602,17 @@ hn_create_tx_data(struct hn_softc *sc, i CTLFLAG_RD, &sc->hn_tx_ring_cnt, 0, "# created TX rings"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_ring_inuse", CTLFLAG_RD, &sc->hn_tx_ring_inuse, 0, "# used TX rings"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "agg_szmax", + CTLFLAG_RD, &sc->hn_tx_ring[0].hn_agg_szmax, 0, + "Applied packet transmission aggregation size"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "agg_pktmax", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_txagg_pktmax_sysctl, "I", + "Applied packet transmission aggregation packets"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "agg_align", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_txagg_align_sysctl, "I", + "Applied packet transmission aggregation alignment"); return 0; } @@ -3332,18 +3732,20 @@ hn_start_locked(struct hn_tx_ring *txr, { struct hn_softc *sc = txr->hn_sc; struct ifnet *ifp = sc->hn_ifp; + int sched = 0; KASSERT(hn_use_if_start, ("hn_start_locked is called, when if_start is disabled")); KASSERT(txr == &sc->hn_tx_ring[0], ("not the first TX ring")); mtx_assert(&txr->hn_tx_lock, MA_OWNED); + KASSERT(txr->hn_agg_txd == NULL, ("lingering aggregating txdesc")); if (__predict_false(txr->hn_suspended)) - return 0; + return (0); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) - return 0; + return (0); while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { struct hn_txdesc *txd; @@ -3361,7 +3763,8 @@ hn_start_locked(struct hn_tx_ring *txr, * following up packets) to tx taskqueue. */ IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - return 1; + sched = 1; + break; } #if defined(INET6) || defined(INET) @@ -3382,21 +3785,50 @@ hn_start_locked(struct hn_tx_ring *txr, break; } - error = hn_encap(txr, txd, &m_head); + error = hn_encap(ifp, txr, txd, &m_head); if (error) { /* Both txd and m_head are freed */ + KASSERT(txr->hn_agg_txd == NULL, + ("encap failed w/ pending aggregating txdesc")); continue; } - error = hn_txpkt(ifp, txr, txd); - if (__predict_false(error)) { - /* txd is freed, but m_head is not */ - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); - break; + if (txr->hn_agg_pktleft == 0) { + if (txr->hn_agg_txd != NULL) { + KASSERT(m_head == NULL, + ("pending mbuf for aggregating txdesc")); + error = hn_flush_txagg(ifp, txr); + if (__predict_false(error)) { + atomic_set_int(&ifp->if_drv_flags, + IFF_DRV_OACTIVE); + break; + } + } else { + KASSERT(m_head != NULL, ("mbuf was freed")); + error = hn_txpkt(ifp, txr, txd); + if (__predict_false(error)) { + /* txd is freed, but m_head is not */ + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + atomic_set_int(&ifp->if_drv_flags, + IFF_DRV_OACTIVE); + break; + } + } + } +#ifdef INVARIANTS + else { + KASSERT(txr->hn_agg_txd != NULL, + ("no aggregating txdesc")); + KASSERT(m_head == NULL, + ("pending mbuf for aggregating txdesc")); } +#endif } - return 0; + + /* Flush pending aggerated transmission. */ + if (txr->hn_agg_txd != NULL) + hn_flush_txagg(ifp, txr); + return (sched); } static void @@ -3473,18 +3905,20 @@ hn_xmit(struct hn_tx_ring *txr, int len) struct hn_softc *sc = txr->hn_sc; struct ifnet *ifp = sc->hn_ifp; struct mbuf *m_head; + int sched = 0; mtx_assert(&txr->hn_tx_lock, MA_OWNED); #ifdef HN_IFSTART_SUPPORT KASSERT(hn_use_if_start == 0, ("hn_xmit is called, when if_start is enabled")); #endif + KASSERT(txr->hn_agg_txd == NULL, ("lingering aggregating txdesc")); if (__predict_false(txr->hn_suspended)) - return 0; + return (0); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || txr->hn_oactive) - return 0; + return (0); while ((m_head = drbr_peek(ifp, txr->hn_mbuf_br)) != NULL) { struct hn_txdesc *txd; @@ -3497,7 +3931,8 @@ hn_xmit(struct hn_tx_ring *txr, int len) * following up packets) to tx taskqueue. */ drbr_putback(ifp, txr->hn_mbuf_br, m_head); - return 1; + sched = 1; + break; } txd = hn_txdesc_get(txr); @@ -3508,25 +3943,53 @@ hn_xmit(struct hn_tx_ring *txr, int len) break; } - error = hn_encap(txr, txd, &m_head); + error = hn_encap(ifp, txr, txd, &m_head); if (error) { /* Both txd and m_head are freed; discard */ + KASSERT(txr->hn_agg_txd == NULL, + ("encap failed w/ pending aggregating txdesc")); drbr_advance(ifp, txr->hn_mbuf_br); continue; } - error = hn_txpkt(ifp, txr, txd); - if (__predict_false(error)) { - /* txd is freed, but m_head is not */ - drbr_putback(ifp, txr->hn_mbuf_br, m_head); - txr->hn_oactive = 1; - break; + if (txr->hn_agg_pktleft == 0) { + if (txr->hn_agg_txd != NULL) { + KASSERT(m_head == NULL, + ("pending mbuf for aggregating txdesc")); + error = hn_flush_txagg(ifp, txr); + if (__predict_false(error)) { + txr->hn_oactive = 1; + break; + } + } else { + KASSERT(m_head != NULL, ("mbuf was freed")); + error = hn_txpkt(ifp, txr, txd); + if (__predict_false(error)) { + /* txd is freed, but m_head is not */ + drbr_putback(ifp, txr->hn_mbuf_br, + m_head); + txr->hn_oactive = 1; + break; + } + } } +#ifdef INVARIANTS + else { + KASSERT(txr->hn_agg_txd != NULL, + ("no aggregating txdesc")); + KASSERT(m_head == NULL, + ("pending mbuf for aggregating txdesc")); + } +#endif /* Sent */ drbr_advance(ifp, txr->hn_mbuf_br); } - return 0; + + /* Flush pending aggerated transmission. */ + if (txr->hn_agg_txd != NULL) + hn_flush_txagg(ifp, txr); + return (sched); } static int @@ -4004,6 +4467,11 @@ back: if (error) return (error); + /* + * Fixup transmission aggregation setup. + */ + hn_set_txagg(sc); + sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED; return (0); } Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 05:32:34 2016 (r310735) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 06:06:05 2016 (r310736) @@ -125,6 +125,22 @@ struct hn_tx_ring { bus_dma_tag_t hn_tx_data_dtag; uint64_t hn_csum_assist; + /* Applied packet transmission aggregation limits. */ + int hn_agg_szmax; + short hn_agg_pktmax; + short hn_agg_align; + + /* Packet transmission aggregation states. */ + struct hn_txdesc *hn_agg_txd; + int hn_agg_szleft; + short hn_agg_pktleft; + struct rndis_packet_msg *hn_agg_prevpkt; + + /* Temporary stats for each sends. */ + int hn_stat_size; + short hn_stat_pkts; + short hn_stat_mcasts; + int (*hn_sendpkt)(struct hn_tx_ring *, struct hn_txdesc *); int hn_suspended; int hn_gpa_cnt; @@ -137,6 +153,8 @@ struct hn_tx_ring { u_long hn_tx_chimney_tried; u_long hn_tx_chimney; u_long hn_pkts; + u_long hn_sends; + u_long hn_flush_failed; /* Rarely used stuffs */ struct hn_txdesc *hn_txdesc; @@ -181,6 +199,10 @@ struct hn_softc { uint32_t hn_nvs_ver; uint32_t hn_rx_filter; + /* Packet transmission aggregation user settings. */ + int hn_agg_size; + int hn_agg_pkts; + struct taskqueue *hn_mgmt_taskq; struct taskqueue *hn_mgmt_taskq0; struct task hn_link_task; @@ -201,6 +223,9 @@ struct hn_softc { uint32_t hn_ndis_ver; int hn_ndis_tso_szmax; int hn_ndis_tso_sgmin; + uint32_t hn_rndis_agg_size; + uint32_t hn_rndis_agg_pkts; + uint32_t hn_rndis_agg_align; int hn_rss_ind_size; uint32_t hn_rss_hash; /* NDIS_HASH_ */ From owner-svn-src-all@freebsd.org Thu Dec 29 06:10:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A18A0C95985; Thu, 29 Dec 2016 06:10:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5671D59; Thu, 29 Dec 2016 06:10:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6AcGD029385; Thu, 29 Dec 2016 06:10:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6AcC5029383; Thu, 29 Dec 2016 06:10:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290610.uBT6AcC5029383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 06:10:38 +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: r310737 - in stable/10/sys/dev/hyperv: include vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:10:39 -0000 Author: sephe Date: Thu Dec 29 06:10:38 2016 New Revision: 310737 URL: https://svnweb.freebsd.org/changeset/base/310737 Log: MFC 308906 hyperv/vmbus: Support transction result busy-wait. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8488 Modified: stable/10/sys/dev/hyperv/include/vmbus_xact.h stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus_xact.h ============================================================================== --- stable/10/sys/dev/hyperv/include/vmbus_xact.h Thu Dec 29 06:06:05 2016 (r310736) +++ stable/10/sys/dev/hyperv/include/vmbus_xact.h Thu Dec 29 06:10:38 2016 (r310737) @@ -52,6 +52,8 @@ void vmbus_xact_activate(struct vmbus_ void vmbus_xact_deactivate(struct vmbus_xact *xact); const void *vmbus_xact_wait(struct vmbus_xact *xact, size_t *resp_len); +const void *vmbus_xact_busywait(struct vmbus_xact *xact, + size_t *resp_len); void vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen); void vmbus_xact_ctx_wakeup(struct vmbus_xact_ctx *ctx, Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Dec 29 06:06:05 2016 (r310736) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Dec 29 06:10:38 2016 (r310737) @@ -69,6 +69,8 @@ static struct vmbus_xact *vmbus_xact_all static void vmbus_xact_free(struct vmbus_xact *); static struct vmbus_xact *vmbus_xact_get1(struct vmbus_xact_ctx *, uint32_t); +const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, + bool); static struct vmbus_xact * vmbus_xact_alloc(struct vmbus_xact_ctx *ctx, bus_dma_tag_t parent_dtag) @@ -249,7 +251,8 @@ vmbus_xact_deactivate(struct vmbus_xact } const void * -vmbus_xact_wait(struct vmbus_xact *xact, size_t *resp_len) +vmbus_xact_wait1(struct vmbus_xact *xact, size_t *resp_len, + bool can_sleep) { struct vmbus_xact_ctx *ctx = xact->x_ctx; const void *resp; @@ -258,8 +261,14 @@ vmbus_xact_wait(struct vmbus_xact *xact, KASSERT(ctx->xc_active == xact, ("xact mismatch")); while (xact->x_resp == NULL) { - mtx_sleep(&ctx->xc_active, &ctx->xc_active_lock, 0, - "wxact", 0); + if (can_sleep) { + mtx_sleep(&ctx->xc_active, &ctx->xc_active_lock, 0, + "wxact", 0); + } else { + mtx_unlock(&ctx->xc_active_lock); + DELAY(1000); + mtx_lock(&ctx->xc_active_lock); + } } ctx->xc_active = NULL; @@ -271,6 +280,20 @@ vmbus_xact_wait(struct vmbus_xact *xact, return (resp); } +const void * +vmbus_xact_wait(struct vmbus_xact *xact, size_t *resp_len) +{ + + return (vmbus_xact_wait1(xact, resp_len, true /* can sleep */)); +} + +const void * +vmbus_xact_busywait(struct vmbus_xact *xact, size_t *resp_len) +{ + + return (vmbus_xact_wait1(xact, resp_len, false /* can't sleep */)); +} + static void vmbus_xact_save_resp(struct vmbus_xact *xact, const void *data, size_t dlen) { From owner-svn-src-all@freebsd.org Thu Dec 29 06:13:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFB53C95BE1; Thu, 29 Dec 2016 06:13:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99E07111E; Thu, 29 Dec 2016 06:13:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6D0QH033031; Thu, 29 Dec 2016 06:13:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6D0SK033027; Thu, 29 Dec 2016 06:13:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290613.uBT6D0SK033027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 06:13: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: r310738 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:13:02 -0000 Author: sephe Date: Thu Dec 29 06:13:00 2016 New Revision: 310738 URL: https://svnweb.freebsd.org/changeset/base/310738 Log: MFC 308907 hyperv/hn: Fix WITNESS warnings And re-enable SIOCADDMULTI/SIOCDELMULTI, after WITNESS warning is fixed. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8489 Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Dec 29 06:10:38 2016 (r310737) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Dec 29 06:13:00 2016 (r310738) @@ -109,7 +109,10 @@ hn_nvs_xact_execute(struct hn_softc *sc, vmbus_xact_deactivate(xact); return (NULL); } - hdr = vmbus_xact_wait(xact, &resplen); + if (HN_CAN_SLEEP(sc)) + hdr = vmbus_xact_wait(xact, &resplen); + else + hdr = vmbus_xact_busywait(xact, &resplen); /* * Check this NVS response message. Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 06:10:38 2016 (r310737) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 06:13:00 2016 (r310738) @@ -233,7 +233,10 @@ hn_rndis_xact_exec1(struct hn_softc *sc, if_printf(sc->hn_ifp, "RNDIS ctrl send failed: %d\n", error); return (NULL); } - return (vmbus_xact_wait(xact, comp_len)); + if (HN_CAN_SLEEP(sc)) + return (vmbus_xact_wait(xact, comp_len)); + else + return (vmbus_xact_busywait(xact, comp_len)); } static const void * Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 06:10:38 2016 (r310737) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 06:13:00 2016 (r310738) @@ -152,7 +152,11 @@ __FBSDID("$FreeBSD$"); sx_init(&(sc)->hn_lock, device_get_nameunit((sc)->hn_dev)) #define HN_LOCK_DESTROY(sc) sx_destroy(&(sc)->hn_lock) #define HN_LOCK_ASSERT(sc) sx_assert(&(sc)->hn_lock, SA_XLOCKED) -#define HN_LOCK(sc) sx_xlock(&(sc)->hn_lock) +#define HN_LOCK(sc) \ +do { \ + while (sx_try_xlock(&(sc)->hn_lock) == 0) \ + DELAY(1000); \ +} while (0) #define HN_UNLOCK(sc) sx_xunlock(&(sc)->hn_lock) #define HN_CSUM_IP_MASK (CSUM_IP | CSUM_IP_TCP | CSUM_IP_UDP) @@ -670,18 +674,10 @@ hn_set_rxfilter(struct hn_softc *sc) filter = NDIS_PACKET_TYPE_DIRECTED; if (ifp->if_flags & IFF_BROADCAST) filter |= NDIS_PACKET_TYPE_BROADCAST; -#ifdef notyet - /* - * See the comment in SIOCADDMULTI/SIOCDELMULTI. - */ /* TODO: support multicast list */ if ((ifp->if_flags & IFF_ALLMULTI) || !TAILQ_EMPTY(&ifp->if_multiaddrs)) filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; -#else - /* Always enable ALLMULTI */ - filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; -#endif } if (sc->hn_rx_filter != filter) { @@ -2364,10 +2360,18 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* + * Caller meight hold mutex, e.g. + * bpf; use busy-wait for the RNDIS + * reply. + */ + HN_NO_SLEEPING(sc); hn_set_rxfilter(sc); - else + HN_SLEEPING_OK(sc); + } else { hn_init_locked(sc); + } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) hn_stop(sc); @@ -2428,27 +2432,23 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, case SIOCADDMULTI: case SIOCDELMULTI: -#ifdef notyet - /* - * XXX - * Multicast uses mutex, while RNDIS RX filter setting - * sleeps. We workaround this by always enabling - * ALLMULTI. ALLMULTI would actually always be on, even - * if we supported the SIOCADDMULTI/SIOCDELMULTI, since - * we don't support multicast address list configuration - * for this driver. - */ HN_LOCK(sc); if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0) { HN_UNLOCK(sc); break; } - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* + * Multicast uses mutex; use busy-wait for + * the RNDIS reply. + */ + HN_NO_SLEEPING(sc); hn_set_rxfilter(sc); + HN_SLEEPING_OK(sc); + } HN_UNLOCK(sc); -#endif break; case SIOCSIFMEDIA: Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 06:10:38 2016 (r310737) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 06:13:00 2016 (r310738) @@ -237,6 +237,20 @@ struct hn_softc { #define HN_FLAG_HAS_RSSKEY 0x0004 #define HN_FLAG_HAS_RSSIND 0x0008 #define HN_FLAG_SYNTH_ATTACHED 0x0010 +#define HN_FLAG_NO_SLEEPING 0x0020 + +#define HN_NO_SLEEPING(sc) \ +do { \ + (sc)->hn_flags |= HN_FLAG_NO_SLEEPING; \ +} while (0) + +#define HN_SLEEPING_OK(sc) \ +do { \ + (sc)->hn_flags &= ~HN_FLAG_NO_SLEEPING; \ +} while (0) + +#define HN_CAN_SLEEP(sc) \ + (((sc)->hn_flags & HN_FLAG_NO_SLEEPING) == 0) #define HN_CAP_VLAN 0x0001 #define HN_CAP_MTU 0x0002 From owner-svn-src-all@freebsd.org Thu Dec 29 06:34:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8749AC9512E; Thu, 29 Dec 2016 06:34:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47D6019BE; Thu, 29 Dec 2016 06:34:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6YJfv041516; Thu, 29 Dec 2016 06:34:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6YJ0l041513; Thu, 29 Dec 2016 06:34:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290634.uBT6YJ0l041513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 06:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310739 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:34:20 -0000 Author: sephe Date: Thu Dec 29 06:34:19 2016 New Revision: 310739 URL: https://svnweb.freebsd.org/changeset/base/310739 Log: MFC 308908,308909 308908 hyperv/hn: Allow enabling IPv6 TX checksum offloading and IPv6 TSO. They are still disabled by default. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8490 308909 hyperv/hn: Don't abuse hn_{tx,rx}_ring_inuse. Just in case, the # of TX/RX rings is changed upon synthetic parts re-attach. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8520 Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 06:13:00 2016 (r310738) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 06:34:19 2016 (r310739) @@ -603,7 +603,6 @@ hn_rndis_conf_offload(struct hn_softc *s if ((hwcaps.ndis_lsov2.ndis_ip6_encap & NDIS_OFFLOAD_ENCAP_8023) && (hwcaps.ndis_lsov2.ndis_ip6_opts & HN_NDIS_LSOV2_CAP_IP6) == HN_NDIS_LSOV2_CAP_IP6) { -#ifdef notyet caps |= HN_CAP_TSO6; params.ndis_lsov2_ip6 = NDIS_OFFLOAD_LSOV2_ON; @@ -611,7 +610,6 @@ hn_rndis_conf_offload(struct hn_softc *s tso_maxsz = hwcaps.ndis_lsov2.ndis_ip6_maxsz; if (hwcaps.ndis_lsov2.ndis_ip6_minsg > tso_minsg) tso_minsg = hwcaps.ndis_lsov2.ndis_ip6_minsg; -#endif } sc->hn_ndis_tso_szmax = 0; sc->hn_ndis_tso_sgmin = 0; Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 06:13:00 2016 (r310738) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 06:34:19 2016 (r310739) @@ -507,7 +507,7 @@ hn_set_lro_lenlim(struct hn_softc *sc, i { int i; - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; } #endif @@ -1149,6 +1149,13 @@ hn_attach(device_t dev) /* Enable all available capabilities by default. */ ifp->if_capenable = ifp->if_capabilities; + /* + * Disable IPv6 TSO and TXCSUM by default, they still can + * be enabled through SIOCSIFCAP. + */ + ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6 | IFCAP_TSO6); + ifp->if_hwassist &= ~(HN_CSUM_IP6_MASK | CSUM_IP6_TSO); + if (ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) { hn_set_tso_maxsize(sc, hn_tso_maxlen, ETHERMTU); ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; @@ -2573,7 +2580,7 @@ hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS */ --ackcnt; HN_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) sc->hn_rx_ring[i].hn_lro.lro_ackcnt_lim = ackcnt; HN_UNLOCK(sc); return 0; @@ -2597,7 +2604,7 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG return error; HN_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; if (on) @@ -2665,7 +2672,7 @@ hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARG uint64_t stat; stat = 0; - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; stat += *((uint64_t *)((uint8_t *)rxr + ofs)); } @@ -2675,7 +2682,7 @@ hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARG return error; /* Zero out this stat. */ - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; } @@ -2719,7 +2726,7 @@ hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_A u_long stat; stat = 0; - for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { txr = &sc->hn_tx_ring[i]; stat += *((u_long *)((uint8_t *)txr + ofs)); } @@ -2729,7 +2736,7 @@ hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_A return error; /* Zero out this stat. */ - for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { txr = &sc->hn_tx_ring[i]; *((u_long *)((uint8_t *)txr + ofs)) = 0; } @@ -2751,7 +2758,7 @@ hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARG return error; HN_LOCK(sc); - for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { txr = &sc->hn_tx_ring[i]; *((int *)((uint8_t *)txr + ofs)) = conf; } @@ -3622,7 +3629,7 @@ hn_set_chim_size(struct hn_softc *sc, in { int i; - for (i = 0; i < sc->hn_tx_ring_inuse; ++i) + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_chim_size = chim_size; } @@ -3672,12 +3679,10 @@ hn_fixup_tx_data(struct hn_softc *sc) csum_assist |= CSUM_IP_TCP; if (sc->hn_caps & HN_CAP_UDP4CS) csum_assist |= CSUM_IP_UDP; -#ifdef notyet if (sc->hn_caps & HN_CAP_TCP6CS) csum_assist |= CSUM_IP6_TCP; if (sc->hn_caps & HN_CAP_UDP6CS) csum_assist |= CSUM_IP6_UDP; -#endif for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_csum_assist = csum_assist; From owner-svn-src-all@freebsd.org Thu Dec 29 06:45:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25C12C95497; Thu, 29 Dec 2016 06:45:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E21181F13; Thu, 29 Dec 2016 06:45:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6jb4B045686; Thu, 29 Dec 2016 06:45:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6jaen045681; Thu, 29 Dec 2016 06:45:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290645.uBT6jaen045681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 06:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310740 - in stable/10/sys/dev/hyperv: include vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:45:38 -0000 Author: sephe Date: Thu Dec 29 06:45:36 2016 New Revision: 310740 URL: https://svnweb.freebsd.org/changeset/base/310740 Log: MFC 309030,309039,309080,309081,309083 309030 hyperv/vmbus: Set a mark on the revoked channel. This will be used to fix device detach DEVMETHOD for revoked primary channel. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8522 309039 hyperv/vmbus: Merge free/active locks. These functions are only used by management stuffs, so there are no needs to introduce extra complexity. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8524 309080 hyperv/vmbus: Implement orphan support for transaction API It will be used to fix the primary channel revocation support. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8525 309081 hyperv/vmbus: Fix the primary channel revoking on vmbus side. Drivers can now use vmbus_chan_{is_revoked,set_orphan,unset_orphan}() and vmbus_xact_ctx_orphan() to fix their attach/detach DEVMETHODs for revoked primary channels. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8545 309083 hyperv/vmbus: Fix the multi-channel revoking on vmbus side. - Reference count the sub-channel when channel offer message is processed, so that immediate rescind message on the same channel will not race sub-channel open on driver side. - Drop the above reference when sub-channel is closed, this closely mimics the hypervisor's reaction when primary channel is closed on the VM side. No drivers use sub-channel after primary channel is closed. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8546 Modified: stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/include/vmbus_xact.h stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus.h ============================================================================== --- stable/10/sys/dev/hyperv/include/vmbus.h Thu Dec 29 06:34:19 2016 (r310739) +++ stable/10/sys/dev/hyperv/include/vmbus.h Thu Dec 29 06:45:36 2016 (r310740) @@ -117,6 +117,7 @@ struct vmbus_chan_br { }; struct vmbus_channel; +struct vmbus_xact_ctx; struct hyperv_guid; struct task; struct taskqueue; @@ -139,6 +140,9 @@ void vmbus_chan_close(struct vmbus_chan void vmbus_chan_intr_drain(struct vmbus_channel *chan); void vmbus_chan_run_task(struct vmbus_channel *chan, struct task *task); +void vmbus_chan_set_orphan(struct vmbus_channel *chan, + struct vmbus_xact_ctx *); +void vmbus_chan_unset_orphan(struct vmbus_channel *chan); int vmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr, int size, uint32_t *gpadl); @@ -173,6 +177,7 @@ int vmbus_chan_send_prplist(struct vmbu uint32_t vmbus_chan_id(const struct vmbus_channel *chan); uint32_t vmbus_chan_subidx(const struct vmbus_channel *chan); bool vmbus_chan_is_primary(const struct vmbus_channel *chan); +bool vmbus_chan_is_revoked(const struct vmbus_channel *chan); const struct hyperv_guid * vmbus_chan_guid_inst(const struct vmbus_channel *chan); int vmbus_chan_prplist_nelem(int br_size, int prpcnt_max, Modified: stable/10/sys/dev/hyperv/include/vmbus_xact.h ============================================================================== --- stable/10/sys/dev/hyperv/include/vmbus_xact.h Thu Dec 29 06:34:19 2016 (r310739) +++ stable/10/sys/dev/hyperv/include/vmbus_xact.h Thu Dec 29 06:45:36 2016 (r310740) @@ -40,6 +40,8 @@ struct vmbus_xact_ctx *vmbus_xact_ctx_cr size_t req_size, size_t resp_size, size_t priv_size); void vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx); +bool vmbus_xact_ctx_orphan(struct vmbus_xact_ctx *ctx); + struct vmbus_xact *vmbus_xact_get(struct vmbus_xact_ctx *ctx, size_t req_len); void vmbus_xact_put(struct vmbus_xact *xact); Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 06:34:19 2016 (r310739) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 06:45:36 2016 (r310740) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -64,6 +65,7 @@ static void vmbus_chan_cpu_default(str static int vmbus_chan_release(struct vmbus_channel *); static void vmbus_chan_set_chmap(struct vmbus_channel *); static void vmbus_chan_clear_chmap(struct vmbus_channel *); +static void vmbus_chan_detach(struct vmbus_channel *); static void vmbus_chan_ins_prilist(struct vmbus_softc *, struct vmbus_channel *); @@ -627,6 +629,32 @@ vmbus_chan_gpadl_disconnect(struct vmbus } static void +vmbus_chan_detach(struct vmbus_channel *chan) +{ + int refs; + + KASSERT(chan->ch_refs > 0, ("chan%u: invalid refcnt %d", + chan->ch_id, chan->ch_refs)); + refs = atomic_fetchadd_int(&chan->ch_refs, -1); +#ifdef INVARIANTS + if (VMBUS_CHAN_ISPRIMARY(chan)) { + KASSERT(refs == 1, ("chan%u: invalid refcnt %d for prichan", + chan->ch_id, refs + 1)); + } +#endif + if (refs == 1) { + /* + * Detach the target channel. + */ + if (bootverbose) { + vmbus_chan_printf(chan, "chan%u detached\n", + chan->ch_id); + } + taskqueue_enqueue(chan->ch_mgmt_tq, &chan->ch_detach_task); + } +} + +static void vmbus_chan_clrchmap_task(void *xchan, int pending __unused) { struct vmbus_channel *chan = xchan; @@ -751,8 +779,15 @@ vmbus_chan_close(struct vmbus_channel *c int i; subchan = vmbus_subchan_get(chan, subchan_cnt); - for (i = 0; i < subchan_cnt; ++i) + for (i = 0; i < subchan_cnt; ++i) { vmbus_chan_close_internal(subchan[i]); + /* + * This sub-channel is referenced, when it is + * linked to the primary channel; drop that + * reference now. + */ + vmbus_chan_detach(subchan[i]); + } vmbus_subchan_rel(subchan, subchan_cnt); } @@ -1113,8 +1148,10 @@ vmbus_chan_alloc(struct vmbus_softc *sc) return NULL; } + chan->ch_refs = 1; chan->ch_vmbus = sc; mtx_init(&chan->ch_subchan_lock, "vmbus subchan", NULL, MTX_DEF); + sx_init(&chan->ch_orphan_lock, "vmbus chorphan"); TAILQ_INIT(&chan->ch_subchans); vmbus_rxbr_init(&chan->ch_rxbr); vmbus_txbr_init(&chan->ch_txbr); @@ -1133,8 +1170,14 @@ vmbus_chan_free(struct vmbus_channel *ch VMBUS_CHAN_ST_ONPRIL | VMBUS_CHAN_ST_ONSUBL | VMBUS_CHAN_ST_ONLIST)) == 0, ("free busy channel")); + KASSERT(chan->ch_orphan_xact == NULL, + ("still has orphan xact installed")); + KASSERT(chan->ch_refs == 0, ("chan%u: invalid refcnt %d", + chan->ch_id, chan->ch_refs)); + hyperv_dmamem_free(&chan->ch_monprm_dma, chan->ch_monprm); mtx_destroy(&chan->ch_subchan_lock); + sx_destroy(&chan->ch_orphan_lock); vmbus_rxbr_deinit(&chan->ch_rxbr); vmbus_txbr_deinit(&chan->ch_txbr); free(chan, M_DEVBUF); @@ -1207,6 +1250,14 @@ vmbus_chan_add(struct vmbus_channel *new ("new channel is not sub-channel")); KASSERT(prichan != NULL, ("no primary channel")); + /* + * Reference count this sub-channel; it will be dereferenced + * when this sub-channel is closed. + */ + KASSERT(newchan->ch_refs == 1, ("chan%u: invalid refcnt %d", + newchan->ch_id, newchan->ch_refs)); + atomic_add_int(&newchan->ch_refs, 1); + newchan->ch_prichan = prichan; newchan->ch_dev = prichan->ch_dev; @@ -1220,7 +1271,7 @@ vmbus_chan_add(struct vmbus_channel *new wakeup(prichan); done: /* - * Hook this channel up for later rescind. + * Hook this channel up for later revocation. */ mtx_lock(&sc->vmbus_chan_lock); vmbus_chan_ins_list(sc, newchan); @@ -1353,6 +1404,7 @@ vmbus_chan_msgproc_choffer(struct vmbus_ if (error) { device_printf(sc->vmbus_dev, "add chan%u failed: %d\n", chan->ch_id, error); + atomic_subtract_int(&chan->ch_refs, 1); vmbus_chan_free(chan); return; } @@ -1368,7 +1420,7 @@ vmbus_chan_msgproc_chrescind(struct vmbu note = (const struct vmbus_chanmsg_chrescind *)msg->msg_data; if (note->chm_chanid > VMBUS_CHAN_MAX) { - device_printf(sc->vmbus_dev, "invalid rescinded chan%u\n", + device_printf(sc->vmbus_dev, "invalid revoked chan%u\n", note->chm_chanid); return; } @@ -1403,11 +1455,24 @@ vmbus_chan_msgproc_chrescind(struct vmbu mtx_unlock(&sc->vmbus_prichan_lock); } - if (bootverbose) - vmbus_chan_printf(chan, "chan%u rescinded\n", note->chm_chanid); + /* + * NOTE: + * The following processing order is critical: + * Set the REVOKED state flag before orphaning the installed xact. + */ + + if (atomic_testandset_int(&chan->ch_stflags, + VMBUS_CHAN_ST_REVOKED_SHIFT)) + panic("channel has already been revoked"); - /* Detach the target channel. */ - taskqueue_enqueue(chan->ch_mgmt_tq, &chan->ch_detach_task); + sx_xlock(&chan->ch_orphan_lock); + if (chan->ch_orphan_xact != NULL) + vmbus_xact_ctx_orphan(chan->ch_orphan_xact); + sx_xunlock(&chan->ch_orphan_lock); + + if (bootverbose) + vmbus_chan_printf(chan, "chan%u revoked\n", note->chm_chanid); + vmbus_chan_detach(chan); } static int @@ -1695,3 +1760,30 @@ vmbus_chan_mgmt_tq(const struct vmbus_ch return (chan->ch_mgmt_tq); } + +bool +vmbus_chan_is_revoked(const struct vmbus_channel *chan) +{ + + if (chan->ch_stflags & VMBUS_CHAN_ST_REVOKED) + return (true); + return (false); +} + +void +vmbus_chan_set_orphan(struct vmbus_channel *chan, struct vmbus_xact_ctx *xact) +{ + + sx_xlock(&chan->ch_orphan_lock); + chan->ch_orphan_xact = xact; + sx_xunlock(&chan->ch_orphan_lock); +} + +void +vmbus_chan_unset_orphan(struct vmbus_channel *chan) +{ + + sx_xlock(&chan->ch_orphan_lock); + chan->ch_orphan_xact = NULL; + sx_xunlock(&chan->ch_orphan_lock); +} Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h Thu Dec 29 06:34:19 2016 (r310739) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h Thu Dec 29 06:45:36 2016 (r310740) @@ -33,8 +33,9 @@ #include #include #include -#include #include +#include +#include #include #include @@ -138,6 +139,11 @@ struct vmbus_channel { struct hyperv_guid ch_guid_type; struct hyperv_guid ch_guid_inst; + struct sx ch_orphan_lock; + struct vmbus_xact_ctx *ch_orphan_xact; + + int ch_refs; + struct sysctl_ctx_list ch_sysctl_ctx; } __aligned(CACHE_LINE_SIZE); @@ -159,10 +165,12 @@ struct vmbus_channel { #define VMBUS_CHAN_ST_ONPRIL_SHIFT 1 #define VMBUS_CHAN_ST_ONSUBL_SHIFT 2 #define VMBUS_CHAN_ST_ONLIST_SHIFT 3 +#define VMBUS_CHAN_ST_REVOKED_SHIFT 4 /* sticky */ #define VMBUS_CHAN_ST_OPENED (1 << VMBUS_CHAN_ST_OPENED_SHIFT) #define VMBUS_CHAN_ST_ONPRIL (1 << VMBUS_CHAN_ST_ONPRIL_SHIFT) #define VMBUS_CHAN_ST_ONSUBL (1 << VMBUS_CHAN_ST_ONSUBL_SHIFT) #define VMBUS_CHAN_ST_ONLIST (1 << VMBUS_CHAN_ST_ONLIST_SHIFT) +#define VMBUS_CHAN_ST_REVOKED (1 << VMBUS_CHAN_ST_REVOKED_SHIFT) struct vmbus_softc; struct vmbus_message; Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Dec 29 06:34:19 2016 (r310739) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Dec 29 06:45:36 2016 (r310740) @@ -50,16 +50,18 @@ struct vmbus_xact { }; struct vmbus_xact_ctx { - uint32_t xc_flags; size_t xc_req_size; size_t xc_resp_size; size_t xc_priv_size; + struct mtx xc_lock; + /* + * Protected by xc_lock. + */ + uint32_t xc_flags; /* VMBUS_XACT_CTXF_ */ struct vmbus_xact *xc_free; - struct mtx xc_free_lock; - struct vmbus_xact *xc_active; - struct mtx xc_active_lock; + struct vmbus_xact *xc_orphan; }; #define VMBUS_XACT_CTXF_DESTROY 0x0001 @@ -71,6 +73,9 @@ static struct vmbus_xact *vmbus_xact_get uint32_t); const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, bool); +static void vmbus_xact_save_resp(struct vmbus_xact *, + const void *, size_t); +static void vmbus_xact_ctx_free(struct vmbus_xact_ctx *); static struct vmbus_xact * vmbus_xact_alloc(struct vmbus_xact_ctx *ctx, bus_dma_tag_t parent_dtag) @@ -110,10 +115,10 @@ vmbus_xact_get1(struct vmbus_xact_ctx *c { struct vmbus_xact *xact; - mtx_lock(&ctx->xc_free_lock); + mtx_lock(&ctx->xc_lock); while ((ctx->xc_flags & dtor_flag) == 0 && ctx->xc_free == NULL) - mtx_sleep(&ctx->xc_free, &ctx->xc_free_lock, 0, "gxact", 0); + mtx_sleep(&ctx->xc_free, &ctx->xc_lock, 0, "gxact", 0); if (ctx->xc_flags & dtor_flag) { /* Being destroyed */ xact = NULL; @@ -124,7 +129,7 @@ vmbus_xact_get1(struct vmbus_xact_ctx *c ctx->xc_free = NULL; } - mtx_unlock(&ctx->xc_free_lock); + mtx_unlock(&ctx->xc_lock); return (xact); } @@ -135,6 +140,9 @@ vmbus_xact_ctx_create(bus_dma_tag_t dtag { struct vmbus_xact_ctx *ctx; + KASSERT(req_size > 0, ("request size is 0")); + KASSERT(resp_size > 0, ("response size is 0")); + ctx = malloc(sizeof(*ctx), M_DEVBUF, M_WAITOK | M_ZERO); ctx->xc_req_size = req_size; ctx->xc_resp_size = resp_size; @@ -146,32 +154,51 @@ vmbus_xact_ctx_create(bus_dma_tag_t dtag return (NULL); } - mtx_init(&ctx->xc_free_lock, "vmbus xact free", NULL, MTX_DEF); - mtx_init(&ctx->xc_active_lock, "vmbus xact active", NULL, MTX_DEF); + mtx_init(&ctx->xc_lock, "vmbus xact", NULL, MTX_DEF); return (ctx); } -void -vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx) +bool +vmbus_xact_ctx_orphan(struct vmbus_xact_ctx *ctx) { - struct vmbus_xact *xact; - - mtx_lock(&ctx->xc_free_lock); + mtx_lock(&ctx->xc_lock); + if (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) { + mtx_unlock(&ctx->xc_lock); + return (false); + } ctx->xc_flags |= VMBUS_XACT_CTXF_DESTROY; - mtx_unlock(&ctx->xc_free_lock); + mtx_unlock(&ctx->xc_lock); + wakeup(&ctx->xc_free); + wakeup(&ctx->xc_active); - xact = vmbus_xact_get1(ctx, 0); - if (xact == NULL) + ctx->xc_orphan = vmbus_xact_get1(ctx, 0); + if (ctx->xc_orphan == NULL) panic("can't get xact"); + return (true); +} + +static void +vmbus_xact_ctx_free(struct vmbus_xact_ctx *ctx) +{ + KASSERT(ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY, + ("xact ctx was not orphaned")); + KASSERT(ctx->xc_orphan != NULL, ("no orphaned xact")); - vmbus_xact_free(xact); - mtx_destroy(&ctx->xc_free_lock); - mtx_destroy(&ctx->xc_active_lock); + vmbus_xact_free(ctx->xc_orphan); + mtx_destroy(&ctx->xc_lock); free(ctx, M_DEVBUF); } +void +vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx) +{ + + vmbus_xact_ctx_orphan(ctx); + vmbus_xact_ctx_free(ctx); +} + struct vmbus_xact * vmbus_xact_get(struct vmbus_xact_ctx *ctx, size_t req_len) { @@ -196,10 +223,10 @@ vmbus_xact_put(struct vmbus_xact *xact) KASSERT(ctx->xc_active == NULL, ("pending active xact")); xact->x_resp = NULL; - mtx_lock(&ctx->xc_free_lock); + mtx_lock(&ctx->xc_lock); KASSERT(ctx->xc_free == NULL, ("has free xact")); ctx->xc_free = xact; - mtx_unlock(&ctx->xc_free_lock); + mtx_unlock(&ctx->xc_lock); wakeup(&ctx->xc_free); } @@ -233,10 +260,10 @@ vmbus_xact_activate(struct vmbus_xact *x KASSERT(xact->x_resp == NULL, ("xact has pending response")); - mtx_lock(&ctx->xc_active_lock); + mtx_lock(&ctx->xc_lock); KASSERT(ctx->xc_active == NULL, ("pending active xact")); ctx->xc_active = xact; - mtx_unlock(&ctx->xc_active_lock); + mtx_unlock(&ctx->xc_lock); } void @@ -244,10 +271,10 @@ vmbus_xact_deactivate(struct vmbus_xact { struct vmbus_xact_ctx *ctx = xact->x_ctx; - mtx_lock(&ctx->xc_active_lock); + mtx_lock(&ctx->xc_lock); KASSERT(ctx->xc_active == xact, ("xact mismatch")); ctx->xc_active = NULL; - mtx_unlock(&ctx->xc_active_lock); + mtx_unlock(&ctx->xc_lock); } const void * @@ -257,25 +284,40 @@ vmbus_xact_wait1(struct vmbus_xact *xact struct vmbus_xact_ctx *ctx = xact->x_ctx; const void *resp; - mtx_lock(&ctx->xc_active_lock); + mtx_lock(&ctx->xc_lock); KASSERT(ctx->xc_active == xact, ("xact mismatch")); - while (xact->x_resp == NULL) { + while (xact->x_resp == NULL && + (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { if (can_sleep) { - mtx_sleep(&ctx->xc_active, &ctx->xc_active_lock, 0, + mtx_sleep(&ctx->xc_active, &ctx->xc_lock, 0, "wxact", 0); } else { - mtx_unlock(&ctx->xc_active_lock); + mtx_unlock(&ctx->xc_lock); DELAY(1000); - mtx_lock(&ctx->xc_active_lock); + mtx_lock(&ctx->xc_lock); } } + KASSERT(ctx->xc_active == xact, ("xact trashed")); + + if ((ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) && xact->x_resp == NULL) { + uint8_t b = 0; + + /* + * Orphaned and no response was received yet; fake up + * an one byte response. + */ + printf("vmbus: xact ctx was orphaned w/ pending xact\n"); + vmbus_xact_save_resp(ctx->xc_active, &b, sizeof(b)); + } + KASSERT(xact->x_resp != NULL, ("no response")); + ctx->xc_active = NULL; resp = xact->x_resp; *resp_len = xact->x_resp_len; - mtx_unlock(&ctx->xc_active_lock); + mtx_unlock(&ctx->xc_lock); return (resp); } @@ -300,7 +342,7 @@ vmbus_xact_save_resp(struct vmbus_xact * struct vmbus_xact_ctx *ctx = xact->x_ctx; size_t cplen = dlen; - mtx_assert(&ctx->xc_active_lock, MA_OWNED); + mtx_assert(&ctx->xc_lock, MA_OWNED); if (cplen > ctx->xc_resp_size) { printf("vmbus: xact response truncated %zu -> %zu\n", @@ -318,19 +360,47 @@ void vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen) { struct vmbus_xact_ctx *ctx = xact->x_ctx; + int do_wakeup = 0; - mtx_lock(&ctx->xc_active_lock); - vmbus_xact_save_resp(xact, data, dlen); - mtx_unlock(&ctx->xc_active_lock); - wakeup(&ctx->xc_active); + mtx_lock(&ctx->xc_lock); + /* + * NOTE: + * xc_active could be NULL, if the ctx has been orphaned. + */ + if (ctx->xc_active != NULL) { + vmbus_xact_save_resp(xact, data, dlen); + do_wakeup = 1; + } else { + KASSERT(ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY, + ("no active xact pending")); + printf("vmbus: drop xact response\n"); + } + mtx_unlock(&ctx->xc_lock); + + if (do_wakeup) + wakeup(&ctx->xc_active); } void vmbus_xact_ctx_wakeup(struct vmbus_xact_ctx *ctx, const void *data, size_t dlen) { - mtx_lock(&ctx->xc_active_lock); - KASSERT(ctx->xc_active != NULL, ("no pending xact")); - vmbus_xact_save_resp(ctx->xc_active, data, dlen); - mtx_unlock(&ctx->xc_active_lock); - wakeup(&ctx->xc_active); + int do_wakeup = 0; + + mtx_lock(&ctx->xc_lock); + /* + * NOTE: + * xc_active could be NULL, if the ctx has been orphaned. + */ + if (ctx->xc_active != NULL) { + vmbus_xact_save_resp(ctx->xc_active, data, dlen); + do_wakeup = 1; + } else { + KASSERT(ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY, + ("no active xact pending")); + printf("vmbus: drop xact response\n"); + } + mtx_unlock(&ctx->xc_lock); + + if (do_wakeup) + wakeup(&ctx->xc_active); } From owner-svn-src-all@freebsd.org Thu Dec 29 06:46:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 244F8C9550E; Thu, 29 Dec 2016 06:46:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7D8D1079; Thu, 29 Dec 2016 06:46:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6kLnT045830; Thu, 29 Dec 2016 06:46:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6kLfk045829; Thu, 29 Dec 2016 06:46:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290646.uBT6kLfk045829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310741 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:46:22 -0000 Author: arybchik Date: Thu Dec 29 06:46:20 2016 New Revision: 310741 URL: https://svnweb.freebsd.org/changeset/base/310741 Log: sfxge(4): fix misuse of siena_build_filter in common code Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8937 Modified: head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Thu Dec 29 06:45:36 2016 (r310740) +++ head/sys/dev/sfxge/common/efx_filter.c Thu Dec 29 06:46:20 2016 (r310741) @@ -1179,6 +1179,7 @@ siena_filter_restore( efx_oword_t filter; int filter_idx; int state; + uint32_t key; efx_rc_t rc; EFSYS_LOCK(enp->en_eslp, state); @@ -1192,8 +1193,10 @@ siena_filter_restore( continue; spec = &sftp->sft_spec[filter_idx]; - if ((rc = siena_filter_build(&filter, spec)) != 0) + if ((key = siena_filter_build(&filter, spec)) == 0) { + rc = EINVAL; goto fail1; + } if ((rc = siena_filter_push_entry(enp, spec->sfs_type, filter_idx, &filter)) != 0) goto fail2; From owner-svn-src-all@freebsd.org Thu Dec 29 06:47:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59F9FC95594; Thu, 29 Dec 2016 06:47:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 296F51211; Thu, 29 Dec 2016 06:47:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6lrRX045948; Thu, 29 Dec 2016 06:47:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6lrUt045947; Thu, 29 Dec 2016 06:47:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290647.uBT6lrUt045947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310742 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:47:54 -0000 Author: arybchik Date: Thu Dec 29 06:47:53 2016 New Revision: 310742 URL: https://svnweb.freebsd.org/changeset/base/310742 Log: sfxge(4): fix common code for non-Siena builds Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8938 Modified: head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:46:20 2016 (r310741) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:47:53 2016 (r310742) @@ -1105,18 +1105,16 @@ typedef struct efx_nic_cfg_s { #if EFSYS_OPT_PHY_STATS uint64_t enc_phy_stat_mask; #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_SIENA +#if EFSYS_OPT_MCDI uint8_t enc_mcdi_mdio_channel; #if EFSYS_OPT_PHY_STATS uint32_t enc_mcdi_phy_stat_mask; #endif /* EFSYS_OPT_PHY_STATS */ -#endif /* EFSYS_OPT_SIENA */ -#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) #if EFSYS_OPT_MON_STATS uint32_t *enc_mcdi_sensor_maskp; uint32_t enc_mcdi_sensor_mask_size; #endif /* EFSYS_OPT_MON_STATS */ -#endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ +#endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_BIST uint32_t enc_bist_mask; #endif /* EFSYS_OPT_BIST */ From owner-svn-src-all@freebsd.org Thu Dec 29 06:48:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14F10C955EE; Thu, 29 Dec 2016 06:48:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0229135D; Thu, 29 Dec 2016 06:48:11 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6mBgM046006; Thu, 29 Dec 2016 06:48:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6mAPU046004; Thu, 29 Dec 2016 06:48:10 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290648.uBT6mAPU046004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 06:48: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: r310743 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:48:12 -0000 Author: sephe Date: Thu Dec 29 06:48:10 2016 New Revision: 310743 URL: https://svnweb.freebsd.org/changeset/base/310743 Log: MFC 309085 hyperv/hn: Fix primary channel revocation Since hypervisor will not drain the TX bufring, once the channels are revoked: - Setup vmbus orphan handler properly. - Make sure that suspension will not wait the TX bufring draining forever. - GC the pending TX descs on detach path, before freeing the busdma stuffs. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8559 Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Dec 29 06:47:53 2016 (r310742) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Dec 29 06:48:10 2016 (r310743) @@ -336,8 +336,13 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc /* * Wait for the hypervisor to receive this NVS request. + * + * NOTE: + * The TX bufring will not be drained by the hypervisor, + * if the primary channel is revoked. */ - while (!vmbus_chan_tx_empty(sc->hn_prichan)) + while (!vmbus_chan_tx_empty(sc->hn_prichan) && + !vmbus_chan_is_revoked(sc->hn_prichan)) pause("waittx", 1); /* * Linger long enough for NVS to disconnect RXBUF. @@ -387,8 +392,13 @@ hn_nvs_disconn_chim(struct hn_softc *sc) /* * Wait for the hypervisor to receive this NVS request. + * + * NOTE: + * The TX bufring will not be drained by the hypervisor, + * if the primary channel is revoked. */ - while (!vmbus_chan_tx_empty(sc->hn_prichan)) + while (!vmbus_chan_tx_empty(sc->hn_prichan) && + !vmbus_chan_is_revoked(sc->hn_prichan)) pause("waittx", 1); /* * Linger long enough for NVS to disconnect chimney Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 06:47:53 2016 (r310742) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 06:48:10 2016 (r310743) @@ -306,7 +306,8 @@ static void hn_resume(struct hn_softc static void hn_resume_data(struct hn_softc *); static void hn_resume_mgmt(struct hn_softc *); static void hn_suspend_mgmt_taskfunc(void *, int); -static void hn_chan_drain(struct vmbus_channel *); +static void hn_chan_drain(struct hn_softc *, + struct vmbus_channel *); static void hn_update_link_status(struct hn_softc *); static void hn_change_network(struct hn_softc *); @@ -330,6 +331,8 @@ static int hn_create_tx_data(struct hn static void hn_fixup_tx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); static void hn_txdesc_dmamap_destroy(struct hn_txdesc *); +static void hn_txdesc_gc(struct hn_tx_ring *, + struct hn_txdesc *); static int hn_encap(struct ifnet *, struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_txpkt(struct ifnet *, struct hn_tx_ring *, @@ -1011,8 +1014,25 @@ hn_attach(device_t dev) */ sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev), HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE, 0); - if (sc->hn_xact == NULL) + if (sc->hn_xact == NULL) { + error = ENXIO; + goto failed; + } + + /* + * Install orphan handler for the revocation of this device's + * primary channel. + * + * NOTE: + * The processing order is critical here: + * Install the orphan handler, _before_ testing whether this + * device's primary channel has been revoked or not. + */ + vmbus_chan_set_orphan(sc->hn_prichan, sc->hn_xact); + if (vmbus_chan_is_revoked(sc->hn_prichan)) { + error = ENXIO; goto failed; + } /* * Attach the synthetic parts, i.e. NVS and RNDIS. @@ -1192,6 +1212,14 @@ hn_detach(device_t dev) struct hn_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->hn_ifp; + if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) { + /* + * In case that the vmbus missed the orphan handler + * installation. + */ + vmbus_xact_ctx_orphan(sc->hn_xact); + } + if (device_is_attached(dev)) { HN_LOCK(sc); if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { @@ -1217,8 +1245,14 @@ hn_detach(device_t dev) taskqueue_free(sc->hn_tx_taskq); taskqueue_free(sc->hn_mgmt_taskq0); - if (sc->hn_xact != NULL) + if (sc->hn_xact != NULL) { + /* + * Uninstall the orphan handler _before_ the xact is + * destructed. + */ + vmbus_chan_unset_orphan(sc->hn_prichan); vmbus_xact_ctx_destroy(sc->hn_xact); + } if_free(ifp); @@ -1457,7 +1491,7 @@ hn_txdesc_hold(struct hn_txdesc *txd) { /* 0->1 transition will never work */ - KASSERT(txd->refs > 0, ("invalid refs %d", txd->refs)); + KASSERT(txd->refs > 0, ("invalid txd refs %d", txd->refs)); atomic_add_int(&txd->refs, 1); } @@ -3475,24 +3509,43 @@ hn_txdesc_dmamap_destroy(struct hn_txdes } static void +hn_txdesc_gc(struct hn_tx_ring *txr, struct hn_txdesc *txd) +{ + + KASSERT(txd->refs == 0 || txd->refs == 1, + ("invalid txd refs %d", txd->refs)); + + /* Aggregated txds will be freed by their aggregating txd. */ + if (txd->refs > 0 && (txd->flags & HN_TXD_FLAG_ONAGG) == 0) { + int freed; + + freed = hn_txdesc_put(txr, txd); + KASSERT(freed, ("can't free txdesc")); + } +} + +static void hn_tx_ring_destroy(struct hn_tx_ring *txr) { - struct hn_txdesc *txd; + int i; if (txr->hn_txdesc == NULL) return; -#ifndef HN_USE_TXDESC_BUFRING - while ((txd = SLIST_FIRST(&txr->hn_txlist)) != NULL) { - SLIST_REMOVE_HEAD(&txr->hn_txlist, link); - hn_txdesc_dmamap_destroy(txd); - } -#else - mtx_lock(&txr->hn_tx_lock); - while ((txd = buf_ring_dequeue_sc(txr->hn_txdesc_br)) != NULL) - hn_txdesc_dmamap_destroy(txd); - mtx_unlock(&txr->hn_tx_lock); -#endif + /* + * NOTE: + * Because the freeing of aggregated txds will be deferred + * to the aggregating txd, two passes are used here: + * - The first pass GCes any pending txds. This GC is necessary, + * since if the channels are revoked, hypervisor will not + * deliver send-done for all pending txds. + * - The second pass frees the busdma stuffs, i.e. after all txds + * were freed. + */ + for (i = 0; i < txr->hn_txdesc_cnt; ++i) + hn_txdesc_gc(txr, &txr->hn_txdesc[i]); + for (i = 0; i < txr->hn_txdesc_cnt; ++i) + hn_txdesc_dmamap_destroy(&txr->hn_txdesc[i]); if (txr->hn_tx_data_dtag != NULL) bus_dma_tag_destroy(txr->hn_tx_data_dtag); @@ -4525,10 +4578,17 @@ hn_set_ring_inuse(struct hn_softc *sc, i } static void -hn_chan_drain(struct vmbus_channel *chan) +hn_chan_drain(struct hn_softc *sc, struct vmbus_channel *chan) { - while (!vmbus_chan_rx_empty(chan) || !vmbus_chan_tx_empty(chan)) + /* + * NOTE: + * The TX bufring will not be drained by the hypervisor, + * if the primary channel is revoked. + */ + while (!vmbus_chan_rx_empty(chan) || + (!vmbus_chan_is_revoked(sc->hn_prichan) && + !vmbus_chan_tx_empty(chan))) pause("waitch", 1); vmbus_chan_intr_drain(chan); } @@ -4537,6 +4597,7 @@ static void hn_suspend_data(struct hn_softc *sc) { struct vmbus_channel **subch = NULL; + struct hn_tx_ring *txr; int i, nsubch; HN_LOCK_ASSERT(sc); @@ -4545,19 +4606,23 @@ hn_suspend_data(struct hn_softc *sc) * Suspend TX. */ for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { - struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; + txr = &sc->hn_tx_ring[i]; mtx_lock(&txr->hn_tx_lock); txr->hn_suspended = 1; mtx_unlock(&txr->hn_tx_lock); /* No one is able send more packets now. */ - /* Wait for all pending sends to finish. */ - while (hn_tx_ring_pending(txr)) + /* + * Wait for all pending sends to finish. + * + * NOTE: + * We will _not_ receive all pending send-done, if the + * primary channel is revoked. + */ + while (hn_tx_ring_pending(txr) && + !vmbus_chan_is_revoked(sc->hn_prichan)) pause("hnwtx", 1 /* 1 tick */); - - taskqueue_drain(txr->hn_tx_taskq, &txr->hn_tx_task); - taskqueue_drain(txr->hn_tx_taskq, &txr->hn_txeof_task); } /* @@ -4580,12 +4645,27 @@ hn_suspend_data(struct hn_softc *sc) if (subch != NULL) { for (i = 0; i < nsubch; ++i) - hn_chan_drain(subch[i]); + hn_chan_drain(sc, subch[i]); } - hn_chan_drain(sc->hn_prichan); + hn_chan_drain(sc, sc->hn_prichan); if (subch != NULL) vmbus_subchan_rel(subch, nsubch); + + /* + * Drain any pending TX tasks. + * + * NOTE: + * The above hn_chan_drain() can dispatch TX tasks, so the TX + * tasks will have to be drained _after_ the above hn_chan_drain() + * calls. + */ + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { + txr = &sc->hn_tx_ring[i]; + + taskqueue_drain(txr->hn_tx_taskq, &txr->hn_tx_task); + taskqueue_drain(txr->hn_tx_taskq, &txr->hn_txeof_task); + } } static void From owner-svn-src-all@freebsd.org Thu Dec 29 06:49:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C996C956C6; Thu, 29 Dec 2016 06:49:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 764B215A8; Thu, 29 Dec 2016 06:49:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6nWlx046112; Thu, 29 Dec 2016 06:49:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6nW2k046111; Thu, 29 Dec 2016 06:49:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290649.uBT6nW2k046111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310744 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:49:33 -0000 Author: arybchik Date: Thu Dec 29 06:49:32 2016 New Revision: 310744 URL: https://svnweb.freebsd.org/changeset/base/310744 Log: sfxge(4): fix efx_ev_qpoll for non-Siena builds Both Siena and EF10 use the siena_ev_qpoll() implementation, but this function is not defined in builds without EFSYS_OPT_SIENA. Remove siena_ev_qpoll and inline it into efx_ev_qpoll to allow it to be used in non-Siena builds. Also remove outdated FIXME comment, as EF10 event batching/merging has been implemented long ago without needing to modify this code. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8939 Modified: head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Thu Dec 29 06:48:10 2016 (r310743) +++ head/sys/dev/sfxge/common/efx_ev.c Thu Dec 29 06:49:32 2016 (r310744) @@ -84,13 +84,6 @@ siena_ev_qprime( __in unsigned int count); static void -siena_ev_qpoll( - __in efx_evq_t *eep, - __inout unsigned int *countp, - __in const efx_ev_callbacks_t *eecp, - __in_opt void *arg); - -static void siena_ev_qpost( __in efx_evq_t *eep, __in uint16_t data); @@ -362,6 +355,8 @@ efx_ev_qprefetch( #endif /* EFSYS_OPT_EV_PREFETCH */ +#define EFX_EV_BATCH 8 + void efx_ev_qpoll( __in efx_evq_t *eep, @@ -369,14 +364,14 @@ efx_ev_qpoll( __in const efx_ev_callbacks_t *eecp, __in_opt void *arg) { - EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); + efx_qword_t ev[EFX_EV_BATCH]; + unsigned int batch; + unsigned int total; + unsigned int count; + unsigned int index; + size_t offset; - /* - * FIXME: Huntington will require support for hardware event batching - * and merging, which will need a different ev_qpoll implementation. - * - * Without those features the Falcon/Siena code can be used unchanged. - */ + /* Ensure events codes match for EF10 (Huntington/Medford) and Siena */ EFX_STATIC_ASSERT(ESF_DZ_EV_CODE_LBN == FSF_AZ_EV_CODE_LBN); EFX_STATIC_ASSERT(ESF_DZ_EV_CODE_WIDTH == FSF_AZ_EV_CODE_WIDTH); @@ -389,7 +384,125 @@ efx_ev_qpoll( EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_MCDI_EV == FSE_AZ_EV_CODE_MCDI_EVRESPONSE); #endif - siena_ev_qpoll(eep, countp, eecp, arg); + + EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); + EFSYS_ASSERT(countp != NULL); + EFSYS_ASSERT(eecp != NULL); + + count = *countp; + do { + /* Read up until the end of the batch period */ + batch = EFX_EV_BATCH - (count & (EFX_EV_BATCH - 1)); + offset = (count & eep->ee_mask) * sizeof (efx_qword_t); + for (total = 0; total < batch; ++total) { + EFSYS_MEM_READQ(eep->ee_esmp, offset, &(ev[total])); + + if (!EFX_EV_PRESENT(ev[total])) + break; + + EFSYS_PROBE3(event, unsigned int, eep->ee_index, + uint32_t, EFX_QWORD_FIELD(ev[total], EFX_DWORD_1), + uint32_t, EFX_QWORD_FIELD(ev[total], EFX_DWORD_0)); + + offset += sizeof (efx_qword_t); + } + +#if EFSYS_OPT_EV_PREFETCH && (EFSYS_OPT_EV_PREFETCH_PERIOD > 1) + /* + * Prefetch the next batch when we get within PREFETCH_PERIOD + * of a completed batch. If the batch is smaller, then prefetch + * immediately. + */ + if (total == batch && total < EFSYS_OPT_EV_PREFETCH_PERIOD) + EFSYS_MEM_PREFETCH(eep->ee_esmp, offset); +#endif /* EFSYS_OPT_EV_PREFETCH */ + + /* Process the batch of events */ + for (index = 0; index < total; ++index) { + boolean_t should_abort; + uint32_t code; + +#if EFSYS_OPT_EV_PREFETCH + /* Prefetch if we've now reached the batch period */ + if (total == batch && + index + EFSYS_OPT_EV_PREFETCH_PERIOD == total) { + offset = (count + batch) & eep->ee_mask; + offset *= sizeof (efx_qword_t); + + EFSYS_MEM_PREFETCH(eep->ee_esmp, offset); + } +#endif /* EFSYS_OPT_EV_PREFETCH */ + + EFX_EV_QSTAT_INCR(eep, EV_ALL); + + code = EFX_QWORD_FIELD(ev[index], FSF_AZ_EV_CODE); + switch (code) { + case FSE_AZ_EV_CODE_RX_EV: + should_abort = eep->ee_rx(eep, + &(ev[index]), eecp, arg); + break; + case FSE_AZ_EV_CODE_TX_EV: + should_abort = eep->ee_tx(eep, + &(ev[index]), eecp, arg); + break; + case FSE_AZ_EV_CODE_DRIVER_EV: + should_abort = eep->ee_driver(eep, + &(ev[index]), eecp, arg); + break; + case FSE_AZ_EV_CODE_DRV_GEN_EV: + should_abort = eep->ee_drv_gen(eep, + &(ev[index]), eecp, arg); + break; +#if EFSYS_OPT_MCDI + case FSE_AZ_EV_CODE_MCDI_EVRESPONSE: + should_abort = eep->ee_mcdi(eep, + &(ev[index]), eecp, arg); + break; +#endif + case FSE_AZ_EV_CODE_GLOBAL_EV: + if (eep->ee_global) { + should_abort = eep->ee_global(eep, + &(ev[index]), eecp, arg); + break; + } + /* else fallthrough */ + default: + EFSYS_PROBE3(bad_event, + unsigned int, eep->ee_index, + uint32_t, + EFX_QWORD_FIELD(ev[index], EFX_DWORD_1), + uint32_t, + EFX_QWORD_FIELD(ev[index], EFX_DWORD_0)); + + EFSYS_ASSERT(eecp->eec_exception != NULL); + (void) eecp->eec_exception(arg, + EFX_EXCEPTION_EV_ERROR, code); + should_abort = B_TRUE; + } + if (should_abort) { + /* Ignore subsequent events */ + total = index + 1; + break; + } + } + + /* + * Now that the hardware has most likely moved onto dma'ing + * into the next cache line, clear the processed events. Take + * care to only clear out events that we've processed + */ + EFX_SET_QWORD(ev[0]); + offset = (count & eep->ee_mask) * sizeof (efx_qword_t); + for (index = 0; index < total; ++index) { + EFSYS_MEM_WRITEQ(eep->ee_esmp, offset, &(ev[0])); + offset += sizeof (efx_qword_t); + } + + count += total; + + } while (total == batch); + + *countp = count; } void @@ -1072,141 +1185,6 @@ siena_ev_qprime( return (0); } -#define EFX_EV_BATCH 8 - -static void -siena_ev_qpoll( - __in efx_evq_t *eep, - __inout unsigned int *countp, - __in const efx_ev_callbacks_t *eecp, - __in_opt void *arg) -{ - efx_qword_t ev[EFX_EV_BATCH]; - unsigned int batch; - unsigned int total; - unsigned int count; - unsigned int index; - size_t offset; - - EFSYS_ASSERT(countp != NULL); - EFSYS_ASSERT(eecp != NULL); - - count = *countp; - do { - /* Read up until the end of the batch period */ - batch = EFX_EV_BATCH - (count & (EFX_EV_BATCH - 1)); - offset = (count & eep->ee_mask) * sizeof (efx_qword_t); - for (total = 0; total < batch; ++total) { - EFSYS_MEM_READQ(eep->ee_esmp, offset, &(ev[total])); - - if (!EFX_EV_PRESENT(ev[total])) - break; - - EFSYS_PROBE3(event, unsigned int, eep->ee_index, - uint32_t, EFX_QWORD_FIELD(ev[total], EFX_DWORD_1), - uint32_t, EFX_QWORD_FIELD(ev[total], EFX_DWORD_0)); - - offset += sizeof (efx_qword_t); - } - -#if EFSYS_OPT_EV_PREFETCH && (EFSYS_OPT_EV_PREFETCH_PERIOD > 1) - /* - * Prefetch the next batch when we get within PREFETCH_PERIOD - * of a completed batch. If the batch is smaller, then prefetch - * immediately. - */ - if (total == batch && total < EFSYS_OPT_EV_PREFETCH_PERIOD) - EFSYS_MEM_PREFETCH(eep->ee_esmp, offset); -#endif /* EFSYS_OPT_EV_PREFETCH */ - - /* Process the batch of events */ - for (index = 0; index < total; ++index) { - boolean_t should_abort; - uint32_t code; - -#if EFSYS_OPT_EV_PREFETCH - /* Prefetch if we've now reached the batch period */ - if (total == batch && - index + EFSYS_OPT_EV_PREFETCH_PERIOD == total) { - offset = (count + batch) & eep->ee_mask; - offset *= sizeof (efx_qword_t); - - EFSYS_MEM_PREFETCH(eep->ee_esmp, offset); - } -#endif /* EFSYS_OPT_EV_PREFETCH */ - - EFX_EV_QSTAT_INCR(eep, EV_ALL); - - code = EFX_QWORD_FIELD(ev[index], FSF_AZ_EV_CODE); - switch (code) { - case FSE_AZ_EV_CODE_RX_EV: - should_abort = eep->ee_rx(eep, - &(ev[index]), eecp, arg); - break; - case FSE_AZ_EV_CODE_TX_EV: - should_abort = eep->ee_tx(eep, - &(ev[index]), eecp, arg); - break; - case FSE_AZ_EV_CODE_DRIVER_EV: - should_abort = eep->ee_driver(eep, - &(ev[index]), eecp, arg); - break; - case FSE_AZ_EV_CODE_DRV_GEN_EV: - should_abort = eep->ee_drv_gen(eep, - &(ev[index]), eecp, arg); - break; -#if EFSYS_OPT_MCDI - case FSE_AZ_EV_CODE_MCDI_EVRESPONSE: - should_abort = eep->ee_mcdi(eep, - &(ev[index]), eecp, arg); - break; -#endif - case FSE_AZ_EV_CODE_GLOBAL_EV: - if (eep->ee_global) { - should_abort = eep->ee_global(eep, - &(ev[index]), eecp, arg); - break; - } - /* else fallthrough */ - default: - EFSYS_PROBE3(bad_event, - unsigned int, eep->ee_index, - uint32_t, - EFX_QWORD_FIELD(ev[index], EFX_DWORD_1), - uint32_t, - EFX_QWORD_FIELD(ev[index], EFX_DWORD_0)); - - EFSYS_ASSERT(eecp->eec_exception != NULL); - (void) eecp->eec_exception(arg, - EFX_EXCEPTION_EV_ERROR, code); - should_abort = B_TRUE; - } - if (should_abort) { - /* Ignore subsequent events */ - total = index + 1; - break; - } - } - - /* - * Now that the hardware has most likely moved onto dma'ing - * into the next cache line, clear the processed events. Take - * care to only clear out events that we've processed - */ - EFX_SET_QWORD(ev[0]); - offset = (count & eep->ee_mask) * sizeof (efx_qword_t); - for (index = 0; index < total; ++index) { - EFSYS_MEM_WRITEQ(eep->ee_esmp, offset, &(ev[0])); - offset += sizeof (efx_qword_t); - } - - count += total; - - } while (total == batch); - - *countp = count; -} - static void siena_ev_qpost( __in efx_evq_t *eep, From owner-svn-src-all@freebsd.org Thu Dec 29 06:51:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2361CC958A6; Thu, 29 Dec 2016 06:51:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F261A18C8; Thu, 29 Dec 2016 06:51:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6p7fJ046245; Thu, 29 Dec 2016 06:51:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6p6Q3046242; Thu, 29 Dec 2016 06:51:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290651.uBT6p6Q3046242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310745 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:51:08 -0000 Author: arybchik Date: Thu Dec 29 06:51:06 2016 New Revision: 310745 URL: https://svnweb.freebsd.org/changeset/base/310745 Log: sfxge(4): make the common code retrieve the number of FATSOv2 contexts Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8940 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 06:49:32 2016 (r310744) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 06:51:06 2016 (r310745) @@ -497,7 +497,8 @@ static __checkReturn efx_rc_t efx_mcdi_get_capabilities( __in efx_nic_t *enp, __out uint32_t *flagsp, - __out uint32_t *flags2p) + __out uint32_t *flags2p, + __out uint32_t *tso2ncp) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, @@ -525,10 +526,14 @@ efx_mcdi_get_capabilities( *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) { *flags2p = 0; - else + *tso2ncp = 0; + } else { *flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2); + *tso2ncp = MCDI_OUT_WORD(req, + GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS); + } return (0); @@ -963,9 +968,11 @@ ef10_get_datapath_caps( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint32_t flags; uint32_t flags2; + uint32_t tso2nc; efx_rc_t rc; - if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2)) != 0) + if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2, + &tso2nc)) != 0) goto fail1; #define CAP_FLAG(flags1, field) \ @@ -992,6 +999,10 @@ ef10_get_datapath_caps( encp->enc_fw_assisted_tso_v2_enabled = CAP_FLAG2(flags2, TX_TSO_V2) ? B_TRUE : B_FALSE; + /* Get the number of TSO contexts (FATSOv2) */ + encp->enc_fw_assisted_tso_v2_n_contexts = + CAP_FLAG2(flags2, TX_TSO_V2) ? tso2nc : 0; + /* Check if the firmware has vadapter/vport/vswitch support */ encp->enc_datapath_cap_evb = CAP_FLAG(flags, EVB) ? B_TRUE : B_FALSE; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:49:32 2016 (r310744) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:51:06 2016 (r310745) @@ -1139,6 +1139,8 @@ typedef struct efx_nic_cfg_s { uint32_t enc_tx_tso_tcp_header_offset_limit; boolean_t enc_fw_assisted_tso_enabled; boolean_t enc_fw_assisted_tso_v2_enabled; + /* Number of TSO contexts on the NIC (FATSOv2) */ + uint32_t enc_fw_assisted_tso_v2_n_contexts; boolean_t enc_hw_tx_insert_vlan_enabled; /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Dec 29 06:49:32 2016 (r310744) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Dec 29 06:51:06 2016 (r310745) @@ -152,6 +152,7 @@ siena_board_cfg( encp->enc_hw_tx_insert_vlan_enabled = B_FALSE; encp->enc_fw_assisted_tso_enabled = B_FALSE; encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; + encp->enc_fw_assisted_tso_v2_n_contexts = 0; encp->enc_allow_set_mac_with_installed_filters = B_TRUE; /* Siena supports two 10G ports, and 8 lanes of PCIe Gen2 */ From owner-svn-src-all@freebsd.org Thu Dec 29 06:52:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9754CC95942; Thu, 29 Dec 2016 06:52:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71ECE1B6A; Thu, 29 Dec 2016 06:52:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6qgL8049944; Thu, 29 Dec 2016 06:52:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6qgau049941; Thu, 29 Dec 2016 06:52:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290652.uBT6qgau049941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310746 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:52:43 -0000 Author: arybchik Date: Thu Dec 29 06:52:42 2016 New Revision: 310746 URL: https://svnweb.freebsd.org/changeset/base/310746 Log: sfxge(4): make the common code determine the number of PFs Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8941 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 06:51:06 2016 (r310745) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 06:52:42 2016 (r310746) @@ -961,6 +961,50 @@ ef10_nic_pio_unlink( return (efx_mcdi_unlink_piobuf(enp, vi_index)); } +static __checkReturn efx_rc_t +ef10_mcdi_get_pf_count( + __in efx_nic_t *enp, + __out uint32_t *pf_countp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_PF_COUNT_IN_LEN, + MC_CMD_GET_PF_COUNT_OUT_LEN)]; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_PF_COUNT; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_PF_COUNT_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_PF_COUNT_OUT_LEN; + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_GET_PF_COUNT_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + *pf_countp = *MCDI_OUT(req, uint8_t, + MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_OFST); + + EFSYS_ASSERT(*pf_countp != 0); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t ef10_get_datapath_caps( __in efx_nic_t *enp) @@ -975,6 +1019,9 @@ ef10_get_datapath_caps( &tso2nc)) != 0) goto fail1; + if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) + goto fail1; + #define CAP_FLAG(flags1, field) \ ((flags1) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN))) Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:51:06 2016 (r310745) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:52:42 2016 (r310746) @@ -1142,6 +1142,8 @@ typedef struct efx_nic_cfg_s { /* Number of TSO contexts on the NIC (FATSOv2) */ uint32_t enc_fw_assisted_tso_v2_n_contexts; boolean_t enc_hw_tx_insert_vlan_enabled; + /* Number of PFs on the NIC */ + uint32_t enc_hw_pf_count; /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; boolean_t enc_rx_disable_scatter_supported; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Dec 29 06:51:06 2016 (r310745) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Dec 29 06:52:42 2016 (r310746) @@ -105,6 +105,13 @@ siena_board_cfg( encp->enc_board_type = board_type; + /* + * There is no possibility to determine the number of PFs on Siena + * by issuing MCDI request, and it is not an easy task to find the + * value based on the board type, so 'enc_hw_pf_count' is set to 1 + */ + encp->enc_hw_pf_count = 1; + /* Additional capabilities */ encp->enc_clk_mult = 1; if (EFX_DWORD_FIELD(capabilities, MC_CMD_CAPABILITIES_TURBO)) { From owner-svn-src-all@freebsd.org Thu Dec 29 06:54:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2269C95A8E; Thu, 29 Dec 2016 06:54:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 712901D2C; Thu, 29 Dec 2016 06:54:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6sfAk050095; Thu, 29 Dec 2016 06:54:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6serO050087; Thu, 29 Dec 2016 06:54:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290654.uBT6serO050087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310747 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:54:42 -0000 Author: arybchik Date: Thu Dec 29 06:54:40 2016 New Revision: 310747 URL: https://svnweb.freebsd.org/changeset/base/310747 Log: sfxge(4): provide a way to find out which MAC stats are supported Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8944 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mac.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Dec 29 06:54:40 2016 (r310747) @@ -273,6 +273,12 @@ ef10_mac_loopback_set( #if EFSYS_OPT_MAC_STATS extern __checkReturn efx_rc_t +ef10_mac_stats_get_mask( + __in efx_nic_t *enp, + __inout_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size); + +extern __checkReturn efx_rc_t ef10_mac_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/ef10_mac.c Thu Dec 29 06:54:40 2016 (r310747) @@ -484,6 +484,89 @@ fail1: #if EFSYS_OPT_MAC_STATS + __checkReturn efx_rc_t +ef10_mac_stats_get_mask( + __in efx_nic_t *enp, + __inout_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size) +{ + const struct efx_mac_stats_range ef10_common[] = { + { EFX_MAC_RX_OCTETS, EFX_MAC_RX_GE_15XX_PKTS }, + { EFX_MAC_RX_FCS_ERRORS, EFX_MAC_RX_DROP_EVENTS }, + { EFX_MAC_RX_JABBER_PKTS, EFX_MAC_RX_JABBER_PKTS }, + { EFX_MAC_RX_NODESC_DROP_CNT, EFX_MAC_TX_PAUSE_PKTS }, + }; + const struct efx_mac_stats_range ef10_tx_size_bins[] = { + { EFX_MAC_TX_LE_64_PKTS, EFX_MAC_TX_GE_15XX_PKTS }, + }; + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + efx_port_t *epp = &(enp->en_port); + efx_rc_t rc; + + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_common, EFX_ARRAY_SIZE(ef10_common))) != 0) + goto fail1; + + if (epp->ep_phy_cap_mask & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) { + const struct efx_mac_stats_range ef10_40g_extra[] = { + { EFX_MAC_RX_ALIGN_ERRORS, EFX_MAC_RX_ALIGN_ERRORS }, + }; + + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_40g_extra, EFX_ARRAY_SIZE(ef10_40g_extra))) != 0) + goto fail2; + + if (encp->enc_mac_stats_40g_tx_size_bins) { + if ((rc = efx_mac_stats_mask_add_ranges(maskp, + mask_size, ef10_tx_size_bins, + EFX_ARRAY_SIZE(ef10_tx_size_bins))) != 0) + goto fail3; + } + } else { + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_tx_size_bins, EFX_ARRAY_SIZE(ef10_tx_size_bins))) != 0) + goto fail4; + } + + if (encp->enc_pm_and_rxdp_counters) { + const struct efx_mac_stats_range ef10_pm_and_rxdp[] = { + { EFX_MAC_PM_TRUNC_BB_OVERFLOW, EFX_MAC_RXDP_HLB_WAIT }, + }; + + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_pm_and_rxdp, EFX_ARRAY_SIZE(ef10_pm_and_rxdp))) != 0) + goto fail5; + } + + if (encp->enc_datapath_cap_evb) { + const struct efx_mac_stats_range ef10_vadaptor[] = { + { EFX_MAC_VADAPTER_RX_UNICAST_PACKETS, + EFX_MAC_VADAPTER_TX_OVERFLOW }, + }; + + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_vadaptor, EFX_ARRAY_SIZE(ef10_vadaptor))) != 0) + goto fail6; + } + + return (0); + +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #define EF10_MAC_STAT_READ(_esmp, _field, _eqp) \ EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp) Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 06:54:40 2016 (r310747) @@ -1091,6 +1091,20 @@ ef10_get_datapath_caps( encp->enc_init_evq_v2_supported = CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; + /* + * Check if firmware provides packet memory and Rx datapath + * counters. + */ + encp->enc_pm_and_rxdp_counters = + CAP_FLAG(flags, PM_AND_RXDP_COUNTERS) ? B_TRUE : B_FALSE; + + /* + * Check if the 40G MAC hardware is capable of reporting + * statistics for Tx size bins. + */ + encp->enc_mac_stats_40g_tx_size_bins = + CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; + #undef CAP_FLAG #undef CAP_FLAG2 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:54:40 2016 (r310747) @@ -535,6 +535,29 @@ efx_mac_stat_name( #endif /* EFSYS_OPT_NAMES */ +#define EFX_MAC_STATS_MASK_BITS_PER_PAGE (8 * sizeof (uint32_t)) + +#define EFX_MAC_STATS_MASK_NPAGES \ + (P2ROUNDUP(EFX_MAC_NSTATS, EFX_MAC_STATS_MASK_BITS_PER_PAGE) / \ + EFX_MAC_STATS_MASK_BITS_PER_PAGE) + +/* + * Get mask of MAC statistics supported by the hardware. + * + * If mask_size is insufficient to return the mask, EINVAL error is + * returned. EFX_MAC_STATS_MASK_NPAGES multiplied by size of the page + * (which is sizeof (uint32_t)) is sufficient. + */ +extern __checkReturn efx_rc_t +efx_mac_stats_get_mask( + __in efx_nic_t *enp, + __out_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size); + +#define EFX_MAC_STAT_SUPPORTED(_mask, _stat) \ + ((_mask)[(_stat) / EFX_MAC_STATS_MASK_BITS_PER_PAGE] & \ + (1ULL << ((_stat) & (EFX_MAC_STATS_MASK_BITS_PER_PAGE - 1)))) + #define EFX_MAC_STATS_SIZE 0x400 /* @@ -1150,6 +1173,8 @@ typedef struct efx_nic_cfg_s { boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; boolean_t enc_init_evq_v2_supported; + boolean_t enc_pm_and_rxdp_counters; + boolean_t enc_mac_stats_40g_tx_size_bins; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Dec 29 06:54:40 2016 (r310747) @@ -194,6 +194,7 @@ typedef struct efx_mac_ops_s { efx_loopback_type_t); #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS + efx_rc_t (*emo_stats_get_mask)(efx_nic_t *, uint32_t *, size_t); efx_rc_t (*emo_stats_upload)(efx_nic_t *, efsys_mem_t *); efx_rc_t (*emo_stats_periodic)(efx_nic_t *, efsys_mem_t *, uint16_t, boolean_t); @@ -1155,6 +1156,27 @@ efx_mcdi_get_workarounds( #endif /* EFSYS_OPT_MCDI */ +#if EFSYS_OPT_MAC_STATS + +/* + * Closed range of stats (i.e. the first and the last are included). + * The last must be greater or equal (if the range is one item only) to + * the first. + */ +struct efx_mac_stats_range { + efx_mac_stat_t first; + efx_mac_stat_t last; +}; + +extern efx_rc_t +efx_mac_stats_mask_add_ranges( + __inout_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size, + __in_ecount(rng_count) const struct efx_mac_stats_range *rngp, + __in unsigned int rng_count); + +#endif /* EFSYS_OPT_MAC_STATS */ + #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/efx_mac.c Thu Dec 29 06:54:40 2016 (r310747) @@ -57,6 +57,7 @@ static const efx_mac_ops_t __efx_siena_m siena_mac_loopback_set, /* emo_loopback_set */ #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS + siena_mac_stats_get_mask, /* emo_stats_get_mask */ efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ siena_mac_stats_update /* emo_stats_update */ @@ -80,6 +81,7 @@ static const efx_mac_ops_t __efx_ef10_ma ef10_mac_loopback_set, /* emo_loopback_set */ #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS + ef10_mac_stats_get_mask, /* emo_stats_get_mask */ efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ ef10_mac_stats_update /* emo_stats_update */ @@ -615,6 +617,105 @@ efx_mac_stat_name( #endif /* EFSYS_OPT_NAMES */ +static efx_rc_t +efx_mac_stats_mask_add_range( + __inout_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size, + __in const struct efx_mac_stats_range *rngp) +{ + unsigned int mask_npages = mask_size / sizeof (*maskp); + unsigned int el; + unsigned int el_min; + unsigned int el_max; + unsigned int low; + unsigned int high; + unsigned int width; + efx_rc_t rc; + + if ((mask_npages * EFX_MAC_STATS_MASK_BITS_PER_PAGE) <= + (unsigned int)rngp->last) { + rc = EINVAL; + goto fail1; + } + + EFSYS_ASSERT3U(rngp->first, <=, rngp->last); + EFSYS_ASSERT3U(rngp->last, <, EFX_MAC_NSTATS); + + for (el = 0; el < mask_npages; ++el) { + el_min = el * EFX_MAC_STATS_MASK_BITS_PER_PAGE; + el_max = + el_min + (EFX_MAC_STATS_MASK_BITS_PER_PAGE - 1); + if ((unsigned int)rngp->first > el_max || + (unsigned int)rngp->last < el_min) + continue; + low = MAX((unsigned int)rngp->first, el_min); + high = MIN((unsigned int)rngp->last, el_max); + width = high - low + 1; + maskp[el] |= + (width == EFX_MAC_STATS_MASK_BITS_PER_PAGE) ? + (~0ULL) : (((1ULL << width) - 1) << (low - el_min)); + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + efx_rc_t +efx_mac_stats_mask_add_ranges( + __inout_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size, + __in_ecount(rng_count) const struct efx_mac_stats_range *rngp, + __in unsigned int rng_count) +{ + unsigned int i; + efx_rc_t rc; + + for (i = 0; i < rng_count; ++i) { + if ((rc = efx_mac_stats_mask_add_range(maskp, mask_size, + &rngp[i])) != 0) + goto fail1; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_mac_stats_get_mask( + __in efx_nic_t *enp, + __out_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size) +{ + efx_port_t *epp = &(enp->en_port); + const efx_mac_ops_t *emop = epp->ep_emop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT(maskp != NULL); + EFSYS_ASSERT(mask_size % sizeof (maskp[0]) == 0); + + (void) memset(maskp, 0, mask_size); + + if ((rc = emop->emo_stats_get_mask(enp, maskp, mask_size)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t efx_mac_stats_upload( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/siena_impl.h Thu Dec 29 06:54:40 2016 (r310747) @@ -406,6 +406,12 @@ siena_mac_loopback_set( #if EFSYS_OPT_MAC_STATS extern __checkReturn efx_rc_t +siena_mac_stats_get_mask( + __in efx_nic_t *enp, + __inout_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size); + +extern __checkReturn efx_rc_t siena_mac_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Thu Dec 29 06:52:42 2016 (r310746) +++ head/sys/dev/sfxge/common/siena_mac.c Thu Dec 29 06:54:40 2016 (r310747) @@ -235,6 +235,33 @@ fail1: #if EFSYS_OPT_MAC_STATS + __checkReturn efx_rc_t +siena_mac_stats_get_mask( + __in efx_nic_t *enp, + __inout_bcount(mask_size) uint32_t *maskp, + __in size_t mask_size) +{ + const struct efx_mac_stats_range siena_stats[] = { + { EFX_MAC_RX_OCTETS, EFX_MAC_RX_GE_15XX_PKTS }, + /* EFX_MAC_RX_ERRORS is not supported */ + { EFX_MAC_RX_FCS_ERRORS, EFX_MAC_TX_EX_DEF_PKTS }, + }; + efx_rc_t rc; + + _NOTE(ARGUNUSED(enp)) + + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + siena_stats, EFX_ARRAY_SIZE(siena_stats))) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #define SIENA_MAC_STAT_READ(_esmp, _field, _eqp) \ EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp) From owner-svn-src-all@freebsd.org Thu Dec 29 06:56:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3132AC95B65; Thu, 29 Dec 2016 06:56:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009341EC5; Thu, 29 Dec 2016 06:56:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6uJHA050248; Thu, 29 Dec 2016 06:56:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6uJFk050247; Thu, 29 Dec 2016 06:56:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290656.uBT6uJFk050247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310748 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:56:20 -0000 Author: arybchik Date: Thu Dec 29 06:56:18 2016 New Revision: 310748 URL: https://svnweb.freebsd.org/changeset/base/310748 Log: sfxge(4): cleanup: simplify disable scatter logic in ef10_rx_qcreate Reviewed by: gnn Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8945 Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 06:54:40 2016 (r310747) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 06:56:18 2016 (r310748) @@ -769,12 +769,10 @@ ef10_rx_qcreate( } /* Scatter can only be disabled if the firmware supports doing so */ - if ((type != EFX_RXQ_TYPE_SCATTER) && - enp->en_nic_cfg.enc_rx_disable_scatter_supported) { - disable_scatter = B_TRUE; - } else { + if (type == EFX_RXQ_TYPE_SCATTER) disable_scatter = B_FALSE; - } + else + disable_scatter = encp->enc_rx_disable_scatter_supported; if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index, esmp, disable_scatter)) != 0) From owner-svn-src-all@freebsd.org Thu Dec 29 06:57:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1905AC95BF0; Thu, 29 Dec 2016 06:57:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2C161065; Thu, 29 Dec 2016 06:57:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6vaAP050365; Thu, 29 Dec 2016 06:57:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6vapt050364; Thu, 29 Dec 2016 06:57:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290657.uBT6vapt050364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310749 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:57:38 -0000 Author: arybchik Date: Thu Dec 29 06:57:36 2016 New Revision: 310749 URL: https://svnweb.freebsd.org/changeset/base/310749 Log: sfxge(4): use correct port number in sensor decoding The port mask used for per-port sensors in mcdi_sensor_map assumes zero-based port numbering. The port mask used in the code is based on the one-based MCDI port number. Fix this to lookup the correct per-port sensors, and to allow reporting of sensor events from higher port numbers. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8947 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Thu Dec 29 06:56:18 2016 (r310748) +++ head/sys/dev/sfxge/common/mcdi_mon.c Thu Dec 29 06:57:36 2016 (r310749) @@ -50,6 +50,9 @@ __FBSDID("$FreeBSD$"); #define MCDI_MON_PORT_P4 (0x08) #define MCDI_MON_PORT_Px (0xFFFF) +/* Get port mask from one-based MCDI port number */ +#define MCDI_MON_PORT_MASK(_emip) (1U << ((_emip)->emi_port - 1)) + /* Entry for MCDI sensor in sensor map */ #define STAT(portmask, stat) \ { (MCDI_MON_PORT_##portmask), (EFX_MON_STAT_##stat) } @@ -166,10 +169,10 @@ static const struct mcdi_sensor_map_s { static void mcdi_mon_decode_stats( __in efx_nic_t *enp, - __in_ecount(sensor_mask_size) uint32_t *sensor_mask, + __in_bcount(sensor_mask_size) uint32_t *sensor_mask, __in size_t sensor_mask_size, __in_opt efsys_mem_t *esmp, - __out_ecount_opt(sensor_mask_size) uint32_t *stat_maskp, + __out_bcount_opt(sensor_mask_size) uint32_t *stat_maskp, __inout_ecount_opt(EFX_MON_NSTATS) efx_mon_stat_value_t *stat) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); @@ -192,7 +195,8 @@ mcdi_mon_decode_stats( sensor_max = MIN((8 * sensor_mask_size), EFX_ARRAY_SIZE(mcdi_sensor_map)); - port_mask = 1U << emip->emi_port; + EFSYS_ASSERT(emip->emi_port > 0); /* MCDI port number is one-based */ + port_mask = MCDI_MON_PORT_MASK(emip); memset(stat_mask, 0, sizeof (stat_mask)); @@ -269,9 +273,8 @@ mcdi_mon_ev( efx_mon_stat_t id; efx_rc_t rc; - port_mask = (emip->emi_port == 1) - ? MCDI_MON_PORT_P1 - : MCDI_MON_PORT_P2; + EFSYS_ASSERT(emip->emi_port > 0); /* MCDI port number is one-based */ + port_mask = MCDI_MON_PORT_MASK(emip); sensor = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_MONITOR); state = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_STATE); From owner-svn-src-all@freebsd.org Thu Dec 29 06:58:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A179C95C7F; Thu, 29 Dec 2016 06:58:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0965B120D; Thu, 29 Dec 2016 06:58:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6wpvZ050482; Thu, 29 Dec 2016 06:58:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6wp8n050481; Thu, 29 Dec 2016 06:58:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290658.uBT6wp8n050481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310750 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:58:52 -0000 Author: arybchik Date: Thu Dec 29 06:58:51 2016 New Revision: 310750 URL: https://svnweb.freebsd.org/changeset/base/310750 Log: sfxge(4): add missing barrier in common code MCDI response handling The semantics of the MCDI interfacve require reading the first dword of the header before any other data in the buffer. Add a barrier to the common code MCDI handler to enforce this. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8949 Modified: head/sys/dev/sfxge/common/ef10_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Thu Dec 29 06:57:36 2016 (r310749) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Thu Dec 29 06:58:51 2016 (r310750) @@ -159,6 +159,8 @@ ef10_mcdi_poll_response( efx_dword_t hdr; EFSYS_MEM_READD(esmp, 0, &hdr); + EFSYS_MEM_READ_BARRIER(); + return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); } From owner-svn-src-all@freebsd.org Thu Dec 29 06:59:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B781C95D33; Thu, 29 Dec 2016 06:59:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3407F1394; Thu, 29 Dec 2016 06:59:25 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6xOfY050551; Thu, 29 Dec 2016 06:59:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6xOgh050549; Thu, 29 Dec 2016 06:59:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290659.uBT6xOgh050549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 06:59: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: r310751 - in stable/10/sys/dev/hyperv: include vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 06:59:25 -0000 Author: sephe Date: Thu Dec 29 06:59:24 2016 New Revision: 310751 URL: https://svnweb.freebsd.org/changeset/base/310751 Log: MFC 309128,309129,309131-309136,309138-309140,309224,309225 309128 hyperv/vmbus: Commit the GPADL id only after the connection succeeds. Minor style change. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8563 309129 hyperv/vmbus: Minor style changes. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8564 309131 hyperv/vmbus: Fix sysctl tree leakage, if channel open fails. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8565 309132 hyperv/vmbus: Don't close unopened channels. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8566 309133 hyperv/vmbus: GPADL disconnect error on a revoked channel is benign. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8567 309134 hyperv/vmbus: No stranded bufring GPADL is allowed. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8568 309135 hyperv/vmbus: Return EISCONN if the bufring GPADL can't be disconnected. So that the callers of vmbus_chan_open_br() could handle the passed in bufring memory properly. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8569 309136 hyperv/vmbus: Don't free the bufring if its GPADL can't be disconnected. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8570 309138 hyperv/vmbus: Always try disconnect/free bufring memory upon channel close While I'm here, minor wording and style changes. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8598 309139 hyperv/vmbus: Propagate close error. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8599 309140 hyperv/vmbus: Add a simplified version of channel close. So that the caller can know the channel close error and react accordingly. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8600 309224 hyperv/vmbus: Zero out GPADL if error happens. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8601 309225 hyperv/vmbus: Add supportive transaction wait function. This function supports channel revocation properly. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8611 Modified: stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus.h ============================================================================== --- stable/10/sys/dev/hyperv/include/vmbus.h Thu Dec 29 06:58:51 2016 (r310750) +++ stable/10/sys/dev/hyperv/include/vmbus.h Thu Dec 29 06:59:24 2016 (r310751) @@ -117,6 +117,7 @@ struct vmbus_chan_br { }; struct vmbus_channel; +struct vmbus_xact; struct vmbus_xact_ctx; struct hyperv_guid; struct task; @@ -130,6 +131,36 @@ vmbus_get_channel(device_t dev) return device_get_ivars(dev); } +/* + * vmbus_chan_open_br() + * + * Return values: + * 0 Succeeded. + * EISCONN Failed, and the memory passed through 'br' is still + * connected. Callers must _not_ free the the memory + * passed through 'br', if this error happens. + * other values Failed. The memory passed through 'br' is no longer + * connected. Callers are free to do anything with the + * memory passed through 'br'. + * + * + * + * vmbus_chan_close_direct() + * + * NOTE: + * Callers of this function _must_ make sure to close all sub-channels before + * closing the primary channel. + * + * Return values: + * 0 Succeeded. + * EISCONN Failed, and the memory associated with the bufring + * is still connected. Callers must _not_ free the the + * memory associated with the bufring, if this error + * happens. + * other values Failed. The memory associated with the bufring is + * no longer connected. Callers are free to do anything + * with the memory associated with the bufring. + */ int vmbus_chan_open(struct vmbus_channel *chan, int txbr_size, int rxbr_size, const void *udata, int udlen, vmbus_chan_callback_t cb, void *cbarg); @@ -137,12 +168,15 @@ int vmbus_chan_open_br(struct vmbus_cha const struct vmbus_chan_br *cbr, const void *udata, int udlen, vmbus_chan_callback_t cb, void *cbarg); void vmbus_chan_close(struct vmbus_channel *chan); +int vmbus_chan_close_direct(struct vmbus_channel *chan); void vmbus_chan_intr_drain(struct vmbus_channel *chan); void vmbus_chan_run_task(struct vmbus_channel *chan, struct task *task); void vmbus_chan_set_orphan(struct vmbus_channel *chan, struct vmbus_xact_ctx *); void vmbus_chan_unset_orphan(struct vmbus_channel *chan); +const void *vmbus_chan_xact_wait(const struct vmbus_channel *chan, + struct vmbus_xact *xact, size_t *resp_len, bool can_sleep); int vmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr, int size, uint32_t *gpadl); Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 06:58:51 2016 (r310750) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 06:59:24 2016 (r310751) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); static void vmbus_chan_update_evtflagcnt( struct vmbus_softc *, const struct vmbus_channel *); -static void vmbus_chan_close_internal( +static int vmbus_chan_close_internal( struct vmbus_channel *); static int vmbus_chan_sysctl_mnf(SYSCTL_HANDLER_ARGS); static void vmbus_chan_sysctl_create( @@ -66,6 +66,8 @@ static int vmbus_chan_release(struct v static void vmbus_chan_set_chmap(struct vmbus_channel *); static void vmbus_chan_clear_chmap(struct vmbus_channel *); static void vmbus_chan_detach(struct vmbus_channel *); +static bool vmbus_chan_wait_revoke( + const struct vmbus_channel *); static void vmbus_chan_ins_prilist(struct vmbus_softc *, struct vmbus_channel *); @@ -322,7 +324,21 @@ vmbus_chan_open(struct vmbus_channel *ch error = vmbus_chan_open_br(chan, &cbr, udata, udlen, cb, cbarg); if (error) { - hyperv_dmamem_free(&chan->ch_bufring_dma, chan->ch_bufring); + if (error == EISCONN) { + /* + * XXX + * The bufring GPADL is still connected; abandon + * this bufring, instead of having mysterious + * crash or trashed data later on. + */ + vmbus_chan_printf(chan, "chan%u bufring GPADL " + "is still connected upon channel open error; " + "leak %d bytes memory\n", chan->ch_id, + txbr_size + rxbr_size); + } else { + hyperv_dmamem_free(&chan->ch_bufring_dma, + chan->ch_bufring); + } chan->ch_bufring = NULL; } return (error); @@ -345,7 +361,7 @@ vmbus_chan_open_br(struct vmbus_channel if (udlen > VMBUS_CHANMSG_CHOPEN_UDATA_SIZE) { vmbus_chan_printf(chan, "invalid udata len %d for chan%u\n", udlen, chan->ch_id); - return EINVAL; + return (EINVAL); } br = cbr->cbr; @@ -390,6 +406,8 @@ vmbus_chan_open_br(struct vmbus_channel /* * Connect the bufrings, both RX and TX, to this channel. */ + KASSERT(chan->ch_bufring_gpadl == 0, + ("bufring GPADL is still connected")); error = vmbus_chan_gpadl_connect(chan, cbr->cbr_paddr, txbr_size + rxbr_size, &chan->ch_bufring_gpadl); if (error) { @@ -442,23 +460,33 @@ vmbus_chan_open_br(struct vmbus_channel vmbus_msghc_put(sc, mh); if (status == 0) { - if (bootverbose) { + if (bootverbose) vmbus_chan_printf(chan, "chan%u opened\n", chan->ch_id); - } - return 0; + return (0); } vmbus_chan_printf(chan, "failed to open chan%u\n", chan->ch_id); error = ENXIO; failed: + sysctl_ctx_free(&chan->ch_sysctl_ctx); vmbus_chan_clear_chmap(chan); - if (chan->ch_bufring_gpadl) { - vmbus_chan_gpadl_disconnect(chan, chan->ch_bufring_gpadl); + if (chan->ch_bufring_gpadl != 0) { + int error1; + + error1 = vmbus_chan_gpadl_disconnect(chan, + chan->ch_bufring_gpadl); + if (error1) { + /* + * Give caller a hint that the bufring GPADL is still + * connected. + */ + error = EISCONN; + } chan->ch_bufring_gpadl = 0; } atomic_clear_int(&chan->ch_stflags, VMBUS_CHAN_ST_OPENED); - return error; + return (error); } int @@ -475,6 +503,12 @@ vmbus_chan_gpadl_connect(struct vmbus_ch uint64_t page_id; /* + * Reset GPADL, so that the result would consistent, if error + * happened later on. + */ + *gpadl0 = 0; + + /* * Preliminary checks. */ @@ -500,7 +534,6 @@ vmbus_chan_gpadl_connect(struct vmbus_ch * Allocate GPADL id. */ gpadl = vmbus_gpadl_alloc(sc); - *gpadl0 = gpadl; /* * Connect this GPADL to the target channel. @@ -579,15 +612,35 @@ vmbus_chan_gpadl_connect(struct vmbus_ch vmbus_chan_printf(chan, "gpadl_conn(chan%u) failed: %u\n", chan->ch_id, status); return EIO; - } else { - if (bootverbose) { - vmbus_chan_printf(chan, - "gpadl_conn(chan%u) succeeded\n", chan->ch_id); - } + } + + /* Done; commit the GPADL id. */ + *gpadl0 = gpadl; + if (bootverbose) { + vmbus_chan_printf(chan, "gpadl_conn(chan%u) succeeded\n", + chan->ch_id); } return 0; } +static bool +vmbus_chan_wait_revoke(const struct vmbus_channel *chan) +{ +#define WAIT_COUNT 200 /* 200ms */ + + int i; + + for (i = 0; i < WAIT_COUNT; ++i) { + if (vmbus_chan_is_revoked(chan)) + return (true); + /* Not sure about the context; use busy-wait. */ + DELAY(1000); + } + return (false); + +#undef WAIT_COUNT +} + /* * Disconnect the GPA from the target channel */ @@ -604,7 +657,7 @@ vmbus_chan_gpadl_disconnect(struct vmbus vmbus_chan_printf(chan, "can not get msg hypercall for gpadl_disconn(chan%u)\n", chan->ch_id); - return EBUSY; + return (EBUSY); } req = vmbus_msghc_dataptr(mh); @@ -614,18 +667,29 @@ vmbus_chan_gpadl_disconnect(struct vmbus error = vmbus_msghc_exec(sc, mh); if (error) { + vmbus_msghc_put(sc, mh); + + if (vmbus_chan_wait_revoke(chan)) { + /* + * Error is benign; this channel is revoked, + * so this GPADL will not be touched anymore. + */ + vmbus_chan_printf(chan, + "gpadl_disconn(revoked chan%u) msg hypercall " + "exec failed: %d\n", chan->ch_id, error); + return (0); + } vmbus_chan_printf(chan, "gpadl_disconn(chan%u) msg hypercall exec failed: %d\n", chan->ch_id, error); - vmbus_msghc_put(sc, mh); - return error; + return (error); } vmbus_msghc_wait_result(sc, mh); /* Discard result; no useful information */ vmbus_msghc_put(sc, mh); - return 0; + return (0); } static void @@ -681,16 +745,34 @@ vmbus_chan_set_chmap(struct vmbus_channe chan->ch_vmbus->vmbus_chmap[chan->ch_id] = chan; } -static void +static int vmbus_chan_close_internal(struct vmbus_channel *chan) { struct vmbus_softc *sc = chan->ch_vmbus; struct vmbus_msghc *mh; struct vmbus_chanmsg_chclose *req; + uint32_t old_stflags; int error; - /* TODO: stringent check */ - atomic_clear_int(&chan->ch_stflags, VMBUS_CHAN_ST_OPENED); + /* + * NOTE: + * Sub-channels are closed upon their primary channel closing, + * so they can be closed even before they are opened. + */ + for (;;) { + old_stflags = chan->ch_stflags; + if (atomic_cmpset_int(&chan->ch_stflags, old_stflags, + old_stflags & ~VMBUS_CHAN_ST_OPENED)) + break; + } + if ((old_stflags & VMBUS_CHAN_ST_OPENED) == 0) { + /* Not opened yet; done */ + if (bootverbose) { + vmbus_chan_printf(chan, "chan%u not opened\n", + chan->ch_id); + } + return (0); + } /* * Free this channel's sysctl tree attached to its device's @@ -716,7 +798,8 @@ vmbus_chan_close_internal(struct vmbus_c vmbus_chan_printf(chan, "can not get msg hypercall for chclose(chan%u)\n", chan->ch_id); - return; + error = ENXIO; + goto disconnect; } req = vmbus_msghc_dataptr(mh); @@ -730,16 +813,37 @@ vmbus_chan_close_internal(struct vmbus_c vmbus_chan_printf(chan, "chclose(chan%u) msg hypercall exec failed: %d\n", chan->ch_id, error); - return; - } else if (bootverbose) { - vmbus_chan_printf(chan, "close chan%u\n", chan->ch_id); + goto disconnect; } + if (bootverbose) + vmbus_chan_printf(chan, "chan%u closed\n", chan->ch_id); + +disconnect: /* * Disconnect the TX+RX bufrings from this channel. */ - if (chan->ch_bufring_gpadl) { - vmbus_chan_gpadl_disconnect(chan, chan->ch_bufring_gpadl); + if (chan->ch_bufring_gpadl != 0) { + int error1; + + error1 = vmbus_chan_gpadl_disconnect(chan, + chan->ch_bufring_gpadl); + if (error1) { + /* + * XXX + * The bufring GPADL is still connected; abandon + * this bufring, instead of having mysterious + * crash or trashed data later on. + */ + vmbus_chan_printf(chan, "chan%u bufring GPADL " + "is still connected after close\n", chan->ch_id); + chan->ch_bufring = NULL; + /* + * Give caller a hint that the bufring GPADL is + * still connected. + */ + error = EISCONN; + } chan->ch_bufring_gpadl = 0; } @@ -750,6 +854,42 @@ vmbus_chan_close_internal(struct vmbus_c hyperv_dmamem_free(&chan->ch_bufring_dma, chan->ch_bufring); chan->ch_bufring = NULL; } + return (error); +} + +int +vmbus_chan_close_direct(struct vmbus_channel *chan) +{ + int error; + +#ifdef INVARIANTS + if (VMBUS_CHAN_ISPRIMARY(chan)) { + struct vmbus_channel *subchan; + + /* + * All sub-channels _must_ have been closed, or are _not_ + * opened at all. + */ + mtx_lock(&chan->ch_subchan_lock); + TAILQ_FOREACH(subchan, &chan->ch_subchans, ch_sublink) { + KASSERT( + (subchan->ch_stflags & VMBUS_CHAN_ST_OPENED) == 0, + ("chan%u: subchan%u is still opened", + chan->ch_id, subchan->ch_subidx)); + } + mtx_unlock(&chan->ch_subchan_lock); + } +#endif + + error = vmbus_chan_close_internal(chan); + if (!VMBUS_CHAN_ISPRIMARY(chan)) { + /* + * This sub-channel is referenced, when it is linked to + * the primary channel; drop that reference now. + */ + vmbus_chan_detach(chan); + } + return (error); } /* @@ -1787,3 +1927,37 @@ vmbus_chan_unset_orphan(struct vmbus_cha chan->ch_orphan_xact = NULL; sx_xunlock(&chan->ch_orphan_lock); } + +const void * +vmbus_chan_xact_wait(const struct vmbus_channel *chan, + struct vmbus_xact *xact, size_t *resp_len, bool can_sleep) +{ + const void *ret; + + if (can_sleep) + ret = vmbus_xact_wait(xact, resp_len); + else + ret = vmbus_xact_busywait(xact, resp_len); + if (vmbus_chan_is_revoked(chan)) { + /* + * This xact probably is interrupted, and the + * interruption can race the reply reception, + * so we have to make sure that there are nothing + * left on the RX bufring, i.e. this xact will + * not be touched, once this function returns. + * + * Since the hypervisor will not put more data + * onto the RX bufring once the channel is revoked, + * the following loop will be terminated, once all + * data are drained by the driver's channel + * callback. + */ + while (!vmbus_chan_rx_empty(chan)) { + if (can_sleep) + pause("chxact", 1); + else + DELAY(1000); + } + } + return (ret); +} From owner-svn-src-all@freebsd.org Thu Dec 29 07:00:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6885BC95DC6; Thu, 29 Dec 2016 07:00:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 297C61580; Thu, 29 Dec 2016 07:00:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT70Rti050696; Thu, 29 Dec 2016 07:00:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT70RKa050694; Thu, 29 Dec 2016 07:00:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290700.uBT70RKa050694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 07:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310752 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:00:28 -0000 Author: arybchik Date: Thu Dec 29 07:00:26 2016 New Revision: 310752 URL: https://svnweb.freebsd.org/changeset/base/310752 Log: sfxge(4): allow to have no NIC handle on Rx datapath in DPDK PMD It is required to minimize RxQ context in the driver or avoid chaising for the NIC handle in adapter (global per-interface) structure. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8950 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:59:24 2016 (r310751) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:00:26 2016 (r310752) @@ -1921,7 +1921,7 @@ efx_rx_scale_key_set( extern __checkReturn uint32_t efx_psuedo_hdr_hash_get( - __in efx_nic_t *enp, + __in efx_rxq_t *erp, __in efx_rx_hash_alg_t func, __in uint8_t *buffer); @@ -1929,7 +1929,7 @@ efx_psuedo_hdr_hash_get( extern __checkReturn efx_rc_t efx_psuedo_hdr_pkt_length_get( - __in efx_nic_t *enp, + __in efx_rxq_t *erp, __in uint8_t *buffer, __out uint16_t *pkt_lengthp); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Dec 29 06:59:24 2016 (r310751) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Dec 29 07:00:26 2016 (r310752) @@ -541,24 +541,30 @@ efx_rx_qdestroy( __checkReturn efx_rc_t efx_psuedo_hdr_pkt_length_get( - __in efx_nic_t *enp, + __in efx_rxq_t *erp, __in uint8_t *buffer, __out uint16_t *lengthp) { + efx_nic_t *enp = erp->er_enp; const efx_rx_ops_t *erxop = enp->en_erxop; + EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC); + return (erxop->erxo_prefix_pktlen(enp, buffer, lengthp)); } #if EFSYS_OPT_RX_SCALE __checkReturn uint32_t efx_psuedo_hdr_hash_get( - __in efx_nic_t *enp, + __in efx_rxq_t *erp, __in efx_rx_hash_alg_t func, __in uint8_t *buffer) { + efx_nic_t *enp = erp->er_enp; const efx_rx_ops_t *erxop = enp->en_erxop; + EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC); + EFSYS_ASSERT3U(enp->en_hash_support, ==, EFX_RX_HASH_AVAILABLE); return (erxop->erxo_prefix_hash(enp, func, buffer)); } Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Thu Dec 29 06:59:24 2016 (r310751) +++ head/sys/dev/sfxge/sfxge_rx.c Thu Dec 29 07:00:26 2016 (r310752) @@ -330,8 +330,9 @@ static void __sfxge_rx_deliver(struct sf } static void -sfxge_rx_deliver(struct sfxge_softc *sc, struct sfxge_rx_sw_desc *rx_desc) +sfxge_rx_deliver(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_desc) { + struct sfxge_softc *sc = rxq->sc; struct mbuf *m = rx_desc->mbuf; int flags = rx_desc->flags; int csum_flags; @@ -344,7 +345,7 @@ sfxge_rx_deliver(struct sfxge_softc *sc, if (flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) { m->m_pkthdr.flowid = - efx_psuedo_hdr_hash_get(sc->enp, + efx_psuedo_hdr_hash_get(rxq->common, EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); /* The hash covers a 4-tuple for TCP only */ @@ -423,7 +424,7 @@ static void sfxge_lro_drop(struct sfxge_ KASSERT(!c->mbuf, ("found orphaned mbuf")); if (c->next_buf.mbuf != NULL) { - sfxge_rx_deliver(rxq->sc, &c->next_buf); + sfxge_rx_deliver(rxq, &c->next_buf); LIST_REMOVE(c, active_link); } @@ -618,7 +619,7 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx return (1); deliver_buf_out: - sfxge_rx_deliver(rxq->sc, rx_buf); + sfxge_rx_deliver(rxq, rx_buf); return (1); } @@ -679,7 +680,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct unsigned bucket; /* Get the hardware hash */ - conn_hash = efx_psuedo_hdr_hash_get(sc->enp, + conn_hash = efx_psuedo_hdr_hash_get(rxq->common, EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); @@ -765,7 +766,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct sfxge_lro_new_conn(&rxq->lro, conn_hash, l2_id, nh, th); deliver_now: - sfxge_rx_deliver(sc, rx_buf); + sfxge_rx_deliver(rxq, rx_buf); } static void sfxge_lro_end_of_burst(struct sfxge_rxq *rxq) @@ -842,7 +843,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq if (rx_desc->flags & EFX_PKT_PREFIX_LEN) { uint16_t tmp_size; int rc; - rc = efx_psuedo_hdr_pkt_length_get(sc->enp, + rc = efx_psuedo_hdr_pkt_length_get(rxq->common, mtod(m, uint8_t *), &tmp_size); KASSERT(rc == 0, ("cannot get packet length: %d", rc)); @@ -891,7 +892,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq (EFX_PKT_TCP | EFX_CKSUM_TCPUDP))) sfxge_lro(rxq, prev); else - sfxge_rx_deliver(sc, prev); + sfxge_rx_deliver(rxq, prev); } prev = rx_desc; continue; @@ -912,7 +913,7 @@ discard: (EFX_PKT_TCP | EFX_CKSUM_TCPUDP))) sfxge_lro(rxq, prev); else - sfxge_rx_deliver(sc, prev); + sfxge_rx_deliver(rxq, prev); } /* From owner-svn-src-all@freebsd.org Thu Dec 29 07:02:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2B2FC95F66; Thu, 29 Dec 2016 07:02:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D77219C9; Thu, 29 Dec 2016 07:02:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT72WW1054488; Thu, 29 Dec 2016 07:02:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT72WhM054485; Thu, 29 Dec 2016 07:02:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290702.uBT72WhM054485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 07:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310753 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:02:33 -0000 Author: arybchik Date: Thu Dec 29 07:02:32 2016 New Revision: 310753 URL: https://svnweb.freebsd.org/changeset/base/310753 Log: sfxge(4): split EFX_FILTER_MATCH_LOC_MAC_IG back into separate flags The flag EFX_FILTER_MATCH_LOC_MAC_IG to represent filtering on the individual/group bit of the MAC address (with the two cases being distingusished by the MAC address in the filter specification) was introduced to mirror the Linux driver filtering code, but the implementations are different enough anyway that it isn't of much value. Having separate flags for unknown unicast and multicast simplifies the code and allows the set of flags to match those used by MCDI. It will also makes it easier to report whether these filters are supported. In the MCDI definitions, the unknown multicast and unicast flags have the values 0x40000000 and 0x80000000 respectively, and so using the same values for simplicity requires 32 bits in the filter specification to store the flags. This means the structure is now a little bigger than 64 bytes, but filters are not often used on critical paths so this shouldn't have much impact - on Linux they are also bigger than they used to be. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8951 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:00:26 2016 (r310752) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:02:32 2016 (r310753) @@ -145,6 +145,10 @@ ef10_filter_init( MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST)); + EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST)); #undef MATCH_MASK EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp); @@ -187,7 +191,6 @@ efx_mcdi_filter_op_add( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, MC_CMD_FILTER_OP_OUT_LEN)]; - uint32_t match_fields = 0; efx_rc_t rc; memset(payload, 0, sizeof (payload)); @@ -214,26 +217,10 @@ efx_mcdi_filter_op_add( goto fail1; } - if (spec->efs_match_flags & EFX_FILTER_MATCH_LOC_MAC_IG) { - /* - * The LOC_MAC_IG match flag can represent unknown unicast - * or multicast filters - use the MAC address to distinguish - * them. - */ - if (EFX_MAC_ADDR_IS_MULTICAST(spec->efs_loc_mac)) - match_fields |= 1U << - MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN; - else - match_fields |= 1U << - MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN; - } - - match_fields |= spec->efs_match_flags & (~EFX_FILTER_MATCH_LOC_MAC_IG); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); MCDI_IN_SET_DWORD(req, FILTER_OP_IN_MATCH_FIELDS, - match_fields); + spec->efs_match_flags); MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_DEST, MC_CMD_FILTER_OP_IN_RX_DEST_HOST); MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_QUEUE, @@ -892,9 +879,6 @@ efx_mcdi_get_parser_disp_info( uint8_t payload[MAX(MC_CMD_GET_PARSER_DISP_INFO_IN_LEN, MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX)]; efx_rc_t rc; - uint32_t i; - boolean_t support_unknown_ucast = B_FALSE; - boolean_t support_unknown_mcast = B_FALSE; (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PARSER_DISP_INFO; @@ -930,28 +914,6 @@ efx_mcdi_get_parser_disp_info( EFX_STATIC_ASSERT(sizeof (uint32_t) == MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN); - /* - * Remove UNKNOWN UCAST and MCAST flags, and if both are present, change - * the lower priority one to LOC_MAC_IG. - */ - for (i = 0; i < *length; i++) { - if (list[i] & MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN) { - list[i] &= - (~MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN); - support_unknown_ucast = B_TRUE; - } - if (list[i] & MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN) { - list[i] &= - (~MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN); - support_unknown_mcast = B_TRUE; - } - - if (support_unknown_ucast && support_unknown_mcast) { - list[i] &= EFX_FILTER_MATCH_LOC_MAC_IG; - break; - } - } - return (0); fail2: Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:00:26 2016 (r310752) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:02:32 2016 (r310753) @@ -2209,10 +2209,10 @@ typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport * protocol */ - EFX_FILTER_MATCH_LOC_MAC_IG = 0x0400, /* Match by local MAC address - * I/G bit. Used for RX default - * unicast and multicast/ - * broadcast filters. */ + /* Match otherwise-unmatched multicast and broadcast packets */ + EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000, + /* Match otherwise-unmatched unicast packets */ + EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x80000000, } efx_filter_match_flags_t; typedef enum efx_filter_priority_s { @@ -2234,7 +2234,7 @@ typedef enum efx_filter_priority_s { */ typedef struct efx_filter_spec_s { - uint32_t efs_match_flags:12; + uint32_t efs_match_flags; uint32_t efs_priority:2; uint32_t efs_flags:6; uint32_t efs_dmaq_id:12; Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Thu Dec 29 07:00:26 2016 (r310752) +++ head/sys/dev/sfxge/common/efx_filter.c Thu Dec 29 07:02:32 2016 (r310753) @@ -152,9 +152,6 @@ efx_filter_init( const efx_filter_ops_t *efop; efx_rc_t rc; - /* Check that efx_filter_spec_t is 64 bytes. */ - EFX_STATIC_ASSERT(sizeof (efx_filter_spec_t) == 64); - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_FILTER)); @@ -390,7 +387,7 @@ efx_filter_spec_set_uc_def( { EFSYS_ASSERT3P(spec, !=, NULL); - spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG; + spec->efs_match_flags |= EFX_FILTER_MATCH_UNKNOWN_UCAST_DST; return (0); } @@ -403,8 +400,7 @@ efx_filter_spec_set_mc_def( { EFSYS_ASSERT3P(spec, !=, NULL); - spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG; - spec->efs_loc_mac[0] = 1; + spec->efs_match_flags |= EFX_FILTER_MATCH_UNKNOWN_MCAST_DST; return (0); } From owner-svn-src-all@freebsd.org Thu Dec 29 07:04:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50A42C9406E; Thu, 29 Dec 2016 07:04:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B6DC1C81; Thu, 29 Dec 2016 07:04:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT74QWa054852; Thu, 29 Dec 2016 07:04:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT74Qlp054851; Thu, 29 Dec 2016 07:04:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290704.uBT74Qlp054851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 07:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310754 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:04:27 -0000 Author: arybchik Date: Thu Dec 29 07:04:26 2016 New Revision: 310754 URL: https://svnweb.freebsd.org/changeset/base/310754 Log: sfxge(4): don't use Tx descriptor push with TSO option descriptors It is not safe to push TSO option descriptors if pacer bypass is enabled, so to make sure that doesn't happen never push TSO option descriptors. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8952 Modified: head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Thu Dec 29 07:02:32 2016 (r310753) +++ head/sys/dev/sfxge/common/ef10_tx.c Thu Dec 29 07:04:26 2016 (r310754) @@ -470,9 +470,9 @@ fail1: } /* - * This improves performance by pushing a TX descriptor at the same time as the - * doorbell. The descriptor must be added to the TXQ, so that can be used if the - * hardware decides not to use the pushed descriptor. + * This improves performance by, when possible, pushing a TX descriptor at the + * same time as the doorbell. The descriptor must be added to the TXQ, so that + * can be used if the hardware decides not to use the pushed descriptor. */ void ef10_tx_qpush( @@ -492,16 +492,46 @@ ef10_tx_qpush( offset = id * sizeof (efx_qword_t); EFSYS_MEM_READQ(etp->et_esmp, offset, &desc); - EFX_POPULATE_OWORD_3(oword, - ERF_DZ_TX_DESC_WPTR, wptr, - ERF_DZ_TX_DESC_HWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_1), - ERF_DZ_TX_DESC_LWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_0)); - - /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */ - EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, wptr, id); - EFSYS_PIO_WRITE_BARRIER(); - EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG, etp->et_index, - &oword); + + /* + * SF Bug 65776: TSO option descriptors cannot be pushed if pacer bypass + * is enabled on the event queue this transmit queue is attached to. + * + * To ensure the code is safe, it is easiest to simply test the type of + * the descriptor to push, and only push it is if it not a TSO option + * descriptor. + */ + if ((EFX_QWORD_FIELD(desc, ESF_DZ_TX_DESC_IS_OPT) != 1) || + (EFX_QWORD_FIELD(desc, ESF_DZ_TX_OPTION_TYPE) != + ESE_DZ_TX_OPTION_DESC_TSO)) { + /* Push the descriptor and update the wptr. */ + EFX_POPULATE_OWORD_3(oword, ERF_DZ_TX_DESC_WPTR, wptr, + ERF_DZ_TX_DESC_HWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_1), + ERF_DZ_TX_DESC_LWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_0)); + + /* Ensure ordering of memory (descriptors) and PIO (doorbell) */ + EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, + wptr, id); + EFSYS_PIO_WRITE_BARRIER(); + EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG, + etp->et_index, &oword); + } else { + efx_dword_t dword; + + /* + * Only update the wptr. This is signalled to the hardware by + * only writing one DWORD of the doorbell register. + */ + EFX_POPULATE_OWORD_1(oword, ERF_DZ_TX_DESC_WPTR, wptr); + dword = oword.eo_dword[2]; + + /* Ensure ordering of memory (descriptors) and PIO (doorbell) */ + EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, + wptr, id); + EFSYS_PIO_WRITE_BARRIER(); + EFX_BAR_TBL_WRITED2(enp, ER_DZ_TX_DESC_UPD_REG, + etp->et_index, &dword, B_FALSE); + } } __checkReturn efx_rc_t From owner-svn-src-all@freebsd.org Thu Dec 29 07:05:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B53B2C94126; Thu, 29 Dec 2016 07:05:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 762E01ED9; Thu, 29 Dec 2016 07:05:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT75lEa054961; Thu, 29 Dec 2016 07:05:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT75le3054958; Thu, 29 Dec 2016 07:05:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290705.uBT75le3054958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 07:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310755 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:05:48 -0000 Author: arybchik Date: Thu Dec 29 07:05:47 2016 New Revision: 310755 URL: https://svnweb.freebsd.org/changeset/base/310755 Log: sfxge(4): do not use enum for filter flags It is not 100% correct to assign non-enum values to enum type variables. Found by ICC build (DPDK PMD upstreaming). Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8953 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:04:26 2016 (r310754) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:05:47 2016 (r310755) @@ -947,7 +947,7 @@ static __checkReturn efx_rc_t ef10_filter_insert_unicast( __in efx_nic_t *enp, __in_ecount(6) uint8_t const *addr, - __in efx_filter_flag_t filter_flags) + __in efx_filter_flags_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; @@ -978,7 +978,7 @@ fail1: static __checkReturn efx_rc_t ef10_filter_insert_all_unicast( __in efx_nic_t *enp, - __in efx_filter_flag_t filter_flags) + __in efx_filter_flags_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; @@ -1012,7 +1012,7 @@ ef10_filter_insert_multicast_list( __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, __in uint32_t count, - __in efx_filter_flag_t filter_flags, + __in efx_filter_flags_t filter_flags, __in boolean_t rollback) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; @@ -1105,7 +1105,7 @@ fail1: static __checkReturn efx_rc_t ef10_filter_insert_all_multicast( __in efx_nic_t *enp, - __in efx_filter_flag_t filter_flags) + __in efx_filter_flags_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; @@ -1207,7 +1207,7 @@ ef10_filter_reconfigure( { efx_nic_cfg_t *encp = &enp->en_nic_cfg; ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; - efx_filter_flag_t filter_flags; + efx_filter_flags_t filter_flags; unsigned int i; efx_rc_t all_unicst_rc = 0; efx_rc_t all_mulcst_rc = 0; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:04:26 2016 (r310754) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:05:47 2016 (r310755) @@ -2180,20 +2180,22 @@ efx_tx_qdestroy( #define EFX_IPPROTO_TCP 6 #define EFX_IPPROTO_UDP 17 -typedef enum efx_filter_flag_e { - EFX_FILTER_FLAG_RX_RSS = 0x01, /* use RSS to spread across - * multiple queues */ - EFX_FILTER_FLAG_RX_SCATTER = 0x02, /* enable RX scatter */ - EFX_FILTER_FLAG_RX_OVER_AUTO = 0x04, /* Override an automatic filter - * (priority EFX_FILTER_PRI_AUTO). - * May only be set by the filter - * implementation for each type. - * A removal request will - * restore the automatic filter - * in its place. */ - EFX_FILTER_FLAG_RX = 0x08, /* Filter is for RX */ - EFX_FILTER_FLAG_TX = 0x10, /* Filter is for TX */ -} efx_filter_flag_t; +/* Use RSS to spread across multiple queues */ +#define EFX_FILTER_FLAG_RX_RSS 0x01 +/* Enable RX scatter */ +#define EFX_FILTER_FLAG_RX_SCATTER 0x02 +/* + * Override an automatic filter (priority EFX_FILTER_PRI_AUTO). + * May only be set by the filter implementation for each type. + * A removal request will restore the automatic filter in its place. + */ +#define EFX_FILTER_FLAG_RX_OVER_AUTO 0x04 +/* Filter is for RX */ +#define EFX_FILTER_FLAG_RX 0x08 +/* Filter is for TX */ +#define EFX_FILTER_FLAG_TX 0x10 + +typedef unsigned int efx_filter_flags_t; typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host @@ -2289,7 +2291,7 @@ extern void efx_filter_spec_init_rx( __out efx_filter_spec_t *spec, __in efx_filter_priority_t priority, - __in efx_filter_flag_t flags, + __in efx_filter_flags_t flags, __in efx_rxq_t *erp); extern void Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Thu Dec 29 07:04:26 2016 (r310754) +++ head/sys/dev/sfxge/common/efx_filter.c Thu Dec 29 07:05:47 2016 (r310755) @@ -273,7 +273,7 @@ fail1: efx_filter_spec_init_rx( __out efx_filter_spec_t *spec, __in efx_filter_priority_t priority, - __in efx_filter_flag_t flags, + __in efx_filter_flags_t flags, __in efx_rxq_t *erp) { EFSYS_ASSERT3P(spec, !=, NULL); From owner-svn-src-all@freebsd.org Thu Dec 29 07:06:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 935CCC941AD; Thu, 29 Dec 2016 07:06:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E27D106D; Thu, 29 Dec 2016 07:06:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT76n11055050; Thu, 29 Dec 2016 07:06:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT76nQE055046; Thu, 29 Dec 2016 07:06:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290706.uBT76nQE055046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 07:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310756 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:06:50 -0000 Author: arybchik Date: Thu Dec 29 07:06:49 2016 New Revision: 310756 URL: https://svnweb.freebsd.org/changeset/base/310756 Log: sfxge(4): do not use enum type when values are bitmask ICC complains that enumerated type mixed with another type. Found by DPDK upstream build sanity check. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8954 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 07:05:47 2016 (r310755) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 07:06:49 2016 (r310756) @@ -297,13 +297,13 @@ efx_mcdi_rss_context_set_flags( MCDI_IN_POPULATE_DWORD_4(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN, - (type & (1U << EFX_RX_HASH_IPV4)) ? 1 : 0, + (type & EFX_RX_HASH_IPV4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN, - (type & (1U << EFX_RX_HASH_TCPIPV4)) ? 1 : 0, + (type & EFX_RX_HASH_TCPIPV4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN, - (type & (1U << EFX_RX_HASH_IPV6)) ? 1 : 0, + (type & EFX_RX_HASH_IPV6) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN, - (type & (1U << EFX_RX_HASH_TCPIPV6)) ? 1 : 0); + (type & EFX_RX_HASH_TCPIPV6) ? 1 : 0); efx_mcdi_execute(enp, &req); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:05:47 2016 (r310755) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:06:49 2016 (r310756) @@ -1867,12 +1867,12 @@ typedef enum efx_rx_hash_alg_e { EFX_RX_HASHALG_TOEPLITZ } efx_rx_hash_alg_t; -typedef enum efx_rx_hash_type_e { - EFX_RX_HASH_IPV4 = 0, - EFX_RX_HASH_TCPIPV4, - EFX_RX_HASH_IPV6, - EFX_RX_HASH_TCPIPV6, -} efx_rx_hash_type_t; +#define EFX_RX_HASH_IPV4 (1U << 0) +#define EFX_RX_HASH_TCPIPV4 (1U << 1) +#define EFX_RX_HASH_IPV6 (1U << 2) +#define EFX_RX_HASH_TCPIPV6 (1U << 3) + +typedef unsigned int efx_rx_hash_type_t; typedef enum efx_rx_hash_support_e { EFX_RX_HASH_UNAVAILABLE = 0, /* Hardware hash not inserted */ Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Dec 29 07:05:47 2016 (r310755) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Dec 29 07:06:49 2016 (r310756) @@ -731,12 +731,12 @@ siena_rx_scale_mode_set( case EFX_RX_HASHALG_TOEPLITZ: EFX_RX_TOEPLITZ_IPV4_HASH(enp, insert, - type & (1 << EFX_RX_HASH_IPV4), - type & (1 << EFX_RX_HASH_TCPIPV4)); + type & EFX_RX_HASH_IPV4, + type & EFX_RX_HASH_TCPIPV4); EFX_RX_TOEPLITZ_IPV6_HASH(enp, - type & (1 << EFX_RX_HASH_IPV6), - type & (1 << EFX_RX_HASH_TCPIPV6), + type & EFX_RX_HASH_IPV6, + type & EFX_RX_HASH_TCPIPV6, rc); if (rc != 0) goto fail1; Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Thu Dec 29 07:05:47 2016 (r310755) +++ head/sys/dev/sfxge/sfxge_rx.c Thu Dec 29 07:06:49 2016 (r310756) @@ -1140,8 +1140,8 @@ sfxge_rx_start(struct sfxge_softc *sc) nitems(sc->rx_indir_table))) != 0) goto fail; (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, - (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) | - (1 << EFX_RX_HASH_IPV6) | (1 << EFX_RX_HASH_TCPIPV6), B_TRUE); + EFX_RX_HASH_IPV4 | EFX_RX_HASH_TCPIPV4 | + EFX_RX_HASH_IPV6 | EFX_RX_HASH_TCPIPV6, B_TRUE); #ifdef RSS rss_getkey(toep_key); From owner-svn-src-all@freebsd.org Thu Dec 29 07:07:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E91AC94219; Thu, 29 Dec 2016 07:07:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F12B011EF; Thu, 29 Dec 2016 07:07:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT77HKw055117; Thu, 29 Dec 2016 07:07:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT77GBK055113; Thu, 29 Dec 2016 07:07:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290707.uBT77GBK055113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 07:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310757 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:07:18 -0000 Author: sephe Date: Thu Dec 29 07:07:16 2016 New Revision: 310757 URL: https://svnweb.freebsd.org/changeset/base/310757 Log: MFC 309226-309231,309235 309226 hyperv/hn: Utilize vmbus_chan_xact_wait Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8612 309227 hyperv/hn: Fix detach error handling. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8613 309228 hyperv/hn: Fix multi-packet RNDIS message aggregation size setting. Just in case that no chimney sending buffer can be used. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8619 309229 hyperv/hn: Fix attach error handling Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8620 309230 hyperv/hn: Enable multi-packet RNDIS message support by default. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8621 309231 hyperv/hn: Fix vmbus_chan_subidx usage. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8629 309235 hyperv/hn: Simplify RSS indirect table fixup API Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8630 Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Dec 29 07:06:49 2016 (r310756) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Dec 29 07:07:16 2016 (r310757) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); static int hn_nvs_conn_chim(struct hn_softc *); static int hn_nvs_conn_rxbuf(struct hn_softc *); -static int hn_nvs_disconn_chim(struct hn_softc *); -static int hn_nvs_disconn_rxbuf(struct hn_softc *); +static void hn_nvs_disconn_chim(struct hn_softc *); +static void hn_nvs_disconn_rxbuf(struct hn_softc *); static int hn_nvs_conf_ndis(struct hn_softc *, int); static int hn_nvs_init_ndis(struct hn_softc *); static int hn_nvs_doinit(struct hn_softc *, uint32_t); @@ -109,10 +109,8 @@ hn_nvs_xact_execute(struct hn_softc *sc, vmbus_xact_deactivate(xact); return (NULL); } - if (HN_CAN_SLEEP(sc)) - hdr = vmbus_xact_wait(xact, &resplen); - else - hdr = vmbus_xact_busywait(xact, &resplen); + hdr = vmbus_chan_xact_wait(sc->hn_prichan, xact, &resplen, + HN_CAN_SLEEP(sc)); /* * Check this NVS response message. @@ -275,8 +273,14 @@ hn_nvs_conn_chim(struct hn_softc *sc) goto cleanup; } if (sectsz == 0) { + /* + * Can't use chimney sending buffer; done! + */ if_printf(sc->hn_ifp, "zero chimney sending buffer " "section size\n"); + sc->hn_chim_szmax = 0; + sc->hn_chim_cnt = 0; + sc->hn_flags |= HN_FLAG_CHIM_CONNECTED; return (0); } @@ -310,7 +314,7 @@ cleanup: return (error); } -static int +static void hn_nvs_disconn_rxbuf(struct hn_softc *sc) { int error; @@ -330,7 +334,12 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc if (error) { if_printf(sc->hn_ifp, "send nvs rxbuf disconn failed: %d\n", error); - return (error); + /* + * Fine for a revoked channel, since the hypervisor + * does not drain TX bufring for a revoked channel. + */ + if (!vmbus_chan_is_revoked(sc->hn_prichan)) + sc->hn_flags |= HN_FLAG_RXBUF_REF; } sc->hn_flags &= ~HN_FLAG_RXBUF_CONNECTED; @@ -359,14 +368,13 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc if (error) { if_printf(sc->hn_ifp, "rxbuf gpadl disconn failed: %d\n", error); - return (error); + sc->hn_flags |= HN_FLAG_RXBUF_REF; } sc->hn_rxbuf_gpadl = 0; } - return (0); } -static int +static void hn_nvs_disconn_chim(struct hn_softc *sc) { int error; @@ -386,7 +394,12 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (error) { if_printf(sc->hn_ifp, "send nvs chim disconn failed: %d\n", error); - return (error); + /* + * Fine for a revoked channel, since the hypervisor + * does not drain TX bufring for a revoked channel. + */ + if (!vmbus_chan_is_revoked(sc->hn_prichan)) + sc->hn_flags |= HN_FLAG_CHIM_REF; } sc->hn_flags &= ~HN_FLAG_CHIM_CONNECTED; @@ -416,7 +429,7 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (error) { if_printf(sc->hn_ifp, "chim gpadl disconn failed: %d\n", error); - return (error); + sc->hn_flags |= HN_FLAG_CHIM_REF; } sc->hn_chim_gpadl = 0; } @@ -424,8 +437,8 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (sc->hn_chim_bmap != NULL) { free(sc->hn_chim_bmap, M_DEVBUF); sc->hn_chim_bmap = NULL; + sc->hn_chim_bmap_cnt = 0; } - return (0); } static int @@ -614,8 +627,10 @@ hn_nvs_attach(struct hn_softc *sc, int m * Connect chimney sending buffer. */ error = hn_nvs_conn_chim(sc); - if (error) + if (error) { + hn_nvs_disconn_rxbuf(sc); return (error); + } return (0); } Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 07:06:49 2016 (r310756) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Thu Dec 29 07:07:16 2016 (r310757) @@ -233,10 +233,8 @@ hn_rndis_xact_exec1(struct hn_softc *sc, if_printf(sc->hn_ifp, "RNDIS ctrl send failed: %d\n", error); return (NULL); } - if (HN_CAN_SLEEP(sc)) - return (vmbus_xact_wait(xact, comp_len)); - else - return (vmbus_xact_busywait(xact, comp_len)); + return (vmbus_chan_xact_wait(sc->hn_prichan, xact, comp_len, + HN_CAN_SLEEP(sc))); } static const void * @@ -982,7 +980,6 @@ hn_rndis_attach(struct hn_softc *sc, int /* * Configure NDIS offload settings. - * XXX no offloading, if error happened? */ hn_rndis_conf_offload(sc, mtu); return (0); Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 07:06:49 2016 (r310756) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 07:07:16 2016 (r310757) @@ -299,6 +299,7 @@ static int hn_synth_attach(struct hn_s static void hn_synth_detach(struct hn_softc *); static int hn_synth_alloc_subchans(struct hn_softc *, int *); +static bool hn_synth_attachable(const struct hn_softc *); static void hn_suspend(struct hn_softc *); static void hn_suspend_data(struct hn_softc *); static void hn_suspend_mgmt(struct hn_softc *); @@ -321,7 +322,7 @@ static void hn_destroy_rx_data(struct static int hn_check_iplen(const struct mbuf *, int); static int hn_set_rxfilter(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); -static void hn_rss_ind_fixup(struct hn_softc *, int); +static void hn_rss_ind_fixup(struct hn_softc *); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); @@ -467,7 +468,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_size &hn_tx_agg_size, 0, "Packet transmission aggregation size limit"); /* Packet transmission aggregation count limit */ -static int hn_tx_agg_pkts = 0; +static int hn_tx_agg_pkts = -1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); @@ -708,6 +709,10 @@ hn_set_txagg(struct hn_softc *sc) if (sc->hn_rndis_agg_size < size) size = sc->hn_rndis_agg_size; + /* NOTE: We only aggregate packets using chimney sending buffers. */ + if (size > (uint32_t)sc->hn_chim_szmax) + size = sc->hn_chim_szmax; + if (size <= 2 * HN_PKTSIZE_MIN(sc->hn_rndis_agg_align)) { /* Disable */ size = 0; @@ -719,10 +724,6 @@ hn_set_txagg(struct hn_softc *sc) if (size > INT_MAX) size = INT_MAX; - /* NOTE: We only aggregate packets using chimney sending buffers. */ - if (size > (uint32_t)sc->hn_chim_szmax) - size = sc->hn_chim_szmax; - /* * Setup aggregation packet count. */ @@ -819,11 +820,12 @@ hn_rss_reconfig(struct hn_softc *sc) } static void -hn_rss_ind_fixup(struct hn_softc *sc, int nchan) +hn_rss_ind_fixup(struct hn_softc *sc) { struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; - int i; + int i, nchan; + nchan = sc->hn_rx_ring_inuse; KASSERT(nchan > 1, ("invalid # of channels %d", nchan)); /* @@ -1545,7 +1547,7 @@ hn_txpkt_done(struct hn_nvs_sendctx *snd txr = txd->txr; KASSERT(txr->hn_chan == chan, ("channel mismatch, on chan%u, should be chan%u", - vmbus_chan_subidx(chan), vmbus_chan_subidx(txr->hn_chan))); + vmbus_chan_id(chan), vmbus_chan_id(txr->hn_chan))); txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); @@ -2968,7 +2970,7 @@ hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS) goto back; sc->hn_flags |= HN_FLAG_HAS_RSSIND; - hn_rss_ind_fixup(sc, sc->hn_rx_ring_inuse); + hn_rss_ind_fixup(sc); error = hn_rss_reconfig(sc); back: HN_UNLOCK(sc); @@ -3275,7 +3277,10 @@ hn_destroy_rx_data(struct hn_softc *sc) int i; if (sc->hn_rxbuf != NULL) { - hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + if ((sc->hn_flags & HN_FLAG_RXBUF_REF) == 0) + hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + else + device_printf(sc->hn_dev, "RXBUF is referenced\n"); sc->hn_rxbuf = NULL; } @@ -3287,7 +3292,12 @@ hn_destroy_rx_data(struct hn_softc *sc) if (rxr->hn_br == NULL) continue; - hyperv_dmamem_free(&rxr->hn_br_dma, rxr->hn_br); + if ((rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) == 0) { + hyperv_dmamem_free(&rxr->hn_br_dma, rxr->hn_br); + } else { + device_printf(sc->hn_dev, + "%dth channel bufring is referenced", i); + } rxr->hn_br = NULL; #if defined(INET) || defined(INET6) @@ -3756,7 +3766,12 @@ hn_destroy_tx_data(struct hn_softc *sc) int i; if (sc->hn_chim != NULL) { - hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + if ((sc->hn_flags & HN_FLAG_CHIM_REF) == 0) { + hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + } else { + device_printf(sc->hn_dev, + "chimney sending buffer is referenced"); + } sc->hn_chim = NULL; } @@ -4227,11 +4242,14 @@ hn_chan_attach(struct hn_softc *sc, stru cbr.cbr_rxsz = HN_RXBR_SIZE; error = vmbus_chan_open_br(chan, &cbr, NULL, 0, hn_chan_callback, rxr); if (error) { - if_printf(sc->hn_ifp, "open chan%u failed: %d\n", - vmbus_chan_id(chan), error); - rxr->hn_rx_flags &= ~HN_RX_FLAG_ATTACHED; - if (txr != NULL) - txr->hn_tx_flags &= ~HN_TX_FLAG_ATTACHED; + if (error == EISCONN) { + if_printf(sc->hn_ifp, "bufring is connected after " + "chan%u open failure\n", vmbus_chan_id(chan)); + rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; + } else { + if_printf(sc->hn_ifp, "open chan%u failed: %d\n", + vmbus_chan_id(chan), error); + } } return (error); } @@ -4240,7 +4258,7 @@ static void hn_chan_detach(struct hn_softc *sc, struct vmbus_channel *chan) { struct hn_rx_ring *rxr; - int idx; + int idx, error; idx = vmbus_chan_subidx(chan); @@ -4269,7 +4287,15 @@ hn_chan_detach(struct hn_softc *sc, stru * NOTE: * Channel closing does _not_ destroy the target channel. */ - vmbus_chan_close(chan); + error = vmbus_chan_close_direct(chan); + if (error == EISCONN) { + if_printf(sc->hn_ifp, "chan%u bufring is connected " + "after being closed\n", vmbus_chan_id(chan)); + rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; + } else if (error) { + if_printf(sc->hn_ifp, "chan%u close failed: %d\n", + vmbus_chan_id(chan), error); + } } static int @@ -4279,15 +4305,18 @@ hn_attach_subchans(struct hn_softc *sc) int subchan_cnt = sc->hn_rx_ring_inuse - 1; int i, error = 0; - if (subchan_cnt == 0) - return (0); + KASSERT(subchan_cnt > 0, ("no sub-channels")); /* Attach the sub-channels. */ subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); for (i = 0; i < subchan_cnt; ++i) { - error = hn_chan_attach(sc, subchans[i]); - if (error) - break; + int error1; + + error1 = hn_chan_attach(sc, subchans[i]); + if (error1) { + error = error1; + /* Move on; all channels will be detached later. */ + } } vmbus_subchan_rel(subchans, subchan_cnt); @@ -4399,16 +4428,39 @@ hn_synth_alloc_subchans(struct hn_softc return (0); } +static bool +hn_synth_attachable(const struct hn_softc *sc) +{ + int i; + + if (sc->hn_flags & HN_FLAG_ERRORS) + return (false); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + const struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; + + if (rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) + return (false); + } + return (true); +} + static int hn_synth_attach(struct hn_softc *sc, int mtu) { +#define ATTACHED_NVS 0x0002 +#define ATTACHED_RNDIS 0x0004 + struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; int error, nsubch, nchan, i; - uint32_t old_caps; + uint32_t old_caps, attached = 0; KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0, ("synthetic parts were attached")); + if (!hn_synth_attachable(sc)) + return (ENXIO); + /* Save capabilities for later verification. */ old_caps = sc->hn_caps; sc->hn_caps = 0; @@ -4422,21 +4474,23 @@ hn_synth_attach(struct hn_softc *sc, int */ error = hn_chan_attach(sc, sc->hn_prichan); if (error) - return (error); + goto failed; /* * Attach NVS. */ error = hn_nvs_attach(sc, mtu); if (error) - return (error); + goto failed; + attached |= ATTACHED_NVS; /* * Attach RNDIS _after_ NVS is attached. */ error = hn_rndis_attach(sc, mtu); if (error) - return (error); + goto failed; + attached |= ATTACHED_RNDIS; /* * Make sure capabilities are not changed. @@ -4444,9 +4498,8 @@ hn_synth_attach(struct hn_softc *sc, int if (device_is_attached(sc->hn_dev) && old_caps != sc->hn_caps) { if_printf(sc->hn_ifp, "caps mismatch old 0x%08x, new 0x%08x\n", old_caps, sc->hn_caps); - /* Restore old capabilities and abort. */ - sc->hn_caps = old_caps; - return ENXIO; + error = ENXIO; + goto failed; } /* @@ -4459,19 +4512,34 @@ hn_synth_attach(struct hn_softc *sc, int nsubch = sc->hn_rx_ring_cnt - 1; error = hn_synth_alloc_subchans(sc, &nsubch); if (error) - return (error); + goto failed; + /* NOTE: _Full_ synthetic parts detach is required now. */ + sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED; + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that NVS offered. + */ nchan = nsubch + 1; + hn_set_ring_inuse(sc, nchan); if (nchan == 1) { /* Only the primary channel can be used; done */ goto back; } /* - * Configure RSS key and indirect table _after_ all sub-channels - * are allocated. + * Attach the sub-channels. + * + * NOTE: hn_set_ring_inuse() _must_ have been called. */ + error = hn_attach_subchans(sc); + if (error) + goto failed; + /* + * Configure RSS key and indirect table _after_ all sub-channels + * are attached. + */ if ((sc->hn_flags & HN_FLAG_HAS_RSSKEY) == 0) { /* * RSS key is not set yet; set it to the default RSS key. @@ -4499,39 +4567,38 @@ hn_synth_attach(struct hn_softc *sc, int * # of usable channels may be changed, so we have to * make sure that all entries in RSS indirect table * are valid. + * + * NOTE: hn_set_ring_inuse() _must_ have been called. */ - hn_rss_ind_fixup(sc, nchan); + hn_rss_ind_fixup(sc); } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); - if (error) { - /* - * Failed to configure RSS key or indirect table; only - * the primary channel can be used. - */ - nchan = 1; - } -back: - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that NVS offered. - */ - hn_set_ring_inuse(sc, nchan); - - /* - * Attach the sub-channels, if any. - */ - error = hn_attach_subchans(sc); if (error) - return (error); - + goto failed; +back: /* * Fixup transmission aggregation setup. */ hn_set_txagg(sc); - - sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED; return (0); + +failed: + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + hn_synth_detach(sc); + } else { + if (attached & ATTACHED_RNDIS) + hn_rndis_detach(sc); + if (attached & ATTACHED_NVS) + hn_nvs_detach(sc); + hn_chan_detach(sc, sc->hn_prichan); + /* Restore old capabilities. */ + sc->hn_caps = old_caps; + } + return (error); + +#undef ATTACHED_RNDIS +#undef ATTACHED_NVS } /* @@ -4542,7 +4609,6 @@ back: static void hn_synth_detach(struct hn_softc *sc) { - HN_LOCK_ASSERT(sc); KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, ("synthetic parts were not attached")); Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 07:06:49 2016 (r310756) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 07:07:16 2016 (r310757) @@ -91,7 +91,8 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_TCP 0x0002 #define HN_TRUST_HCSUM_UDP 0x0004 -#define HN_RX_FLAG_ATTACHED 0x1 +#define HN_RX_FLAG_ATTACHED 0x0001 +#define HN_RX_FLAG_BR_REF 0x0002 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -162,8 +163,8 @@ struct hn_tx_ring { struct sysctl_oid *hn_tx_sysctl_tree; } __aligned(CACHE_LINE_SIZE); -#define HN_TX_FLAG_ATTACHED 0x1 -#define HN_TX_FLAG_HASHVAL 0x2 /* support HASHVAL pktinfo */ +#define HN_TX_FLAG_ATTACHED 0x0001 +#define HN_TX_FLAG_HASHVAL 0x0002 /* support HASHVAL pktinfo */ /* * Device-specific softc structure @@ -238,6 +239,10 @@ struct hn_softc { #define HN_FLAG_HAS_RSSIND 0x0008 #define HN_FLAG_SYNTH_ATTACHED 0x0010 #define HN_FLAG_NO_SLEEPING 0x0020 +#define HN_FLAG_RXBUF_REF 0x0040 +#define HN_FLAG_CHIM_REF 0x0080 + +#define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) #define HN_NO_SLEEPING(sc) \ do { \ From owner-svn-src-all@freebsd.org Thu Dec 29 07:10:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9233DC94355; Thu, 29 Dec 2016 07:10:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6093F13C8; Thu, 29 Dec 2016 07:10:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT7APer055300; Thu, 29 Dec 2016 07:10:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT7APh9055298; Thu, 29 Dec 2016 07:10:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290710.uBT7APh9055298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 07:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310758 - in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:10:26 -0000 Author: arybchik Date: Thu Dec 29 07:10:25 2016 New Revision: 310758 URL: https://svnweb.freebsd.org/changeset/base/310758 Log: sfxge(4): delete hunt_phy.c Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Deleted: head/sys/dev/sfxge/common/hunt_phy.c Modified: head/sys/conf/files.amd64 head/sys/modules/sfxge/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Dec 29 07:07:16 2016 (r310757) +++ head/sys/conf/files.amd64 Thu Dec 29 07:10:25 2016 (r310758) @@ -385,7 +385,6 @@ dev/sfxge/common/efx_tx.c optional sfxge dev/sfxge/common/efx_vpd.c optional sfxge pci dev/sfxge/common/efx_wol.c optional sfxge pci dev/sfxge/common/hunt_nic.c optional sfxge pci -dev/sfxge/common/hunt_phy.c optional sfxge pci dev/sfxge/common/mcdi_mon.c optional sfxge pci dev/sfxge/common/medford_nic.c optional sfxge pci dev/sfxge/common/siena_mac.c optional sfxge pci Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Thu Dec 29 07:07:16 2016 (r310757) +++ head/sys/modules/sfxge/Makefile Thu Dec 29 07:10:25 2016 (r310758) @@ -33,7 +33,7 @@ SRCS+= ef10_ev.c ef10_filter.c ef10_intr SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c ef10_vpd.c SRCS+= ef10_impl.h -SRCS+= hunt_nic.c hunt_phy.c +SRCS+= hunt_nic.c SRCS+= hunt_impl.h SRCS+= medford_nic.c From owner-svn-src-all@freebsd.org Thu Dec 29 07:11:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 616AEC94423; Thu, 29 Dec 2016 07:11:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 168A0164E; Thu, 29 Dec 2016 07:11:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT7BL3R055404; Thu, 29 Dec 2016 07:11:21 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT7BLY8055402; Thu, 29 Dec 2016 07:11:21 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290711.uBT7BLY8055402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 07:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310759 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:11:22 -0000 Author: sephe Date: Thu Dec 29 07:11:20 2016 New Revision: 310759 URL: https://svnweb.freebsd.org/changeset/base/310759 Log: MFC 309236,309237 309236 hyperv/vmbus: Make sure that the allocated GPADL is not zero. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8631 309237 hyperv/vmbus: Stringent GPADL parameter assertion. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8632 Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus.c Thu Dec 29 07:10:25 2016 (r310758) +++ stable/10/sys/dev/hyperv/vmbus/vmbus.c Thu Dec 29 07:11:20 2016 (r310759) @@ -327,7 +327,13 @@ vmbus_msghc_wakeup(struct vmbus_softc *s uint32_t vmbus_gpadl_alloc(struct vmbus_softc *sc) { - return atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + uint32_t gpadl; + +again: + gpadl = atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + if (gpadl == 0) + goto again; + return (gpadl); } static int Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 07:10:25 2016 (r310758) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 07:11:20 2016 (r310759) @@ -502,11 +502,7 @@ vmbus_chan_gpadl_connect(struct vmbus_ch int page_count, range_len, i, cnt, error; uint64_t page_id; - /* - * Reset GPADL, so that the result would consistent, if error - * happened later on. - */ - *gpadl0 = 0; + KASSERT(*gpadl0 == 0, ("GPADL is not zero")); /* * Preliminary checks. @@ -652,6 +648,8 @@ vmbus_chan_gpadl_disconnect(struct vmbus struct vmbus_chanmsg_gpadl_disconn *req; int error; + KASSERT(gpadl != 0, ("GPADL is zero")); + mh = vmbus_msghc_get(sc, sizeof(*req)); if (mh == NULL) { vmbus_chan_printf(chan, From owner-svn-src-all@freebsd.org Thu Dec 29 07:20:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C48F4C94718; Thu, 29 Dec 2016 07:20:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 918551C18; Thu, 29 Dec 2016 07:20:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT7KrZx062237; Thu, 29 Dec 2016 07:20:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT7KrkP062234; Thu, 29 Dec 2016 07:20:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290720.uBT7KrkP062234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 07:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310760 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:20:54 -0000 Author: arybchik Date: Thu Dec 29 07:20:53 2016 New Revision: 310760 URL: https://svnweb.freebsd.org/changeset/base/310760 Log: sfxge(4): fix typo in pseudo header accessor function names Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:11:20 2016 (r310759) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:20:53 2016 (r310760) @@ -1920,7 +1920,7 @@ efx_rx_scale_key_set( __in size_t n); extern __checkReturn uint32_t -efx_psuedo_hdr_hash_get( +efx_pseudo_hdr_hash_get( __in efx_rxq_t *erp, __in efx_rx_hash_alg_t func, __in uint8_t *buffer); @@ -1928,7 +1928,7 @@ efx_psuedo_hdr_hash_get( #endif /* EFSYS_OPT_RX_SCALE */ extern __checkReturn efx_rc_t -efx_psuedo_hdr_pkt_length_get( +efx_pseudo_hdr_pkt_length_get( __in efx_rxq_t *erp, __in uint8_t *buffer, __out uint16_t *pkt_lengthp); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Dec 29 07:11:20 2016 (r310759) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Dec 29 07:20:53 2016 (r310760) @@ -540,7 +540,7 @@ efx_rx_qdestroy( } __checkReturn efx_rc_t -efx_psuedo_hdr_pkt_length_get( +efx_pseudo_hdr_pkt_length_get( __in efx_rxq_t *erp, __in uint8_t *buffer, __out uint16_t *lengthp) @@ -555,7 +555,7 @@ efx_psuedo_hdr_pkt_length_get( #if EFSYS_OPT_RX_SCALE __checkReturn uint32_t -efx_psuedo_hdr_hash_get( +efx_pseudo_hdr_hash_get( __in efx_rxq_t *erp, __in efx_rx_hash_alg_t func, __in uint8_t *buffer) @@ -949,11 +949,11 @@ fail1: #endif /* - * Falcon/Siena psuedo-header + * Falcon/Siena pseudo-header * -------------------------- * * Receive packets are prefixed by an optional 16 byte pseudo-header. - * The psuedo-header is a byte array of one of the forms: + * The pseudo-header is a byte array of one of the forms: * * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 * xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.TT.TT.TT.TT Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Thu Dec 29 07:11:20 2016 (r310759) +++ head/sys/dev/sfxge/sfxge_rx.c Thu Dec 29 07:20:53 2016 (r310760) @@ -345,7 +345,7 @@ sfxge_rx_deliver(struct sfxge_rxq *rxq, if (flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) { m->m_pkthdr.flowid = - efx_psuedo_hdr_hash_get(rxq->common, + efx_pseudo_hdr_hash_get(rxq->common, EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); /* The hash covers a 4-tuple for TCP only */ @@ -680,7 +680,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct unsigned bucket; /* Get the hardware hash */ - conn_hash = efx_psuedo_hdr_hash_get(rxq->common, + conn_hash = efx_pseudo_hdr_hash_get(rxq->common, EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); @@ -843,7 +843,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq if (rx_desc->flags & EFX_PKT_PREFIX_LEN) { uint16_t tmp_size; int rc; - rc = efx_psuedo_hdr_pkt_length_get(rxq->common, + rc = efx_pseudo_hdr_pkt_length_get(rxq->common, mtod(m, uint8_t *), &tmp_size); KASSERT(rc == 0, ("cannot get packet length: %d", rc)); From owner-svn-src-all@freebsd.org Thu Dec 29 07:27:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03BD1C9493C; Thu, 29 Dec 2016 07:27:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B89041FD7; Thu, 29 Dec 2016 07:27:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT7RDcB064041; Thu, 29 Dec 2016 07:27:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT7RDa8064036; Thu, 29 Dec 2016 07:27:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290727.uBT7RDa8064036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 07:27: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: r310761 - in stable/10/sys/dev/hyperv: include vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 07:27:15 -0000 Author: sephe Date: Thu Dec 29 07:27:13 2016 New Revision: 310761 URL: https://svnweb.freebsd.org/changeset/base/310761 Log: MFC 309240,309242,309244,309245,309319,309670 309240 hyperv/vmbus: Add result polling support for xact API. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8633 309242 hyperv/vmbus: Add result polling support for message Hypercall API. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8634 309244 hyperv/vmbus: Add exec cancel support for message Hypercall API. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8635 309245 hyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response. Since hypervisor does not respond CHOPEN to a revoked channel. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8636 309319 hypver/vmbus: Remove extra assertion. It is asserted by vmbus_chan_gpadl_connect() now. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8660 309670 hyperv/vmbus: Use pause if possible. This makes booting on Hyper-V w/ small # of vCPUs work properly. Reported by: Hongxiong Xian , Hongjiang Zhang Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/include/vmbus_xact.h stable/10/sys/dev/hyperv/vmbus/vmbus.c stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c stable/10/sys/dev/hyperv/vmbus/vmbus_var.h stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus_xact.h ============================================================================== --- stable/10/sys/dev/hyperv/include/vmbus_xact.h Thu Dec 29 07:20:53 2016 (r310760) +++ stable/10/sys/dev/hyperv/include/vmbus_xact.h Thu Dec 29 07:27:13 2016 (r310761) @@ -56,6 +56,8 @@ const void *vmbus_xact_wait(struct vmbu size_t *resp_len); const void *vmbus_xact_busywait(struct vmbus_xact *xact, size_t *resp_len); +const void *vmbus_xact_poll(struct vmbus_xact *xact, + size_t *resp_len); void vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen); void vmbus_xact_ctx_wakeup(struct vmbus_xact_ctx *ctx, Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus.c Thu Dec 29 07:20:53 2016 (r310760) +++ stable/10/sys/dev/hyperv/vmbus/vmbus.c Thu Dec 29 07:27:13 2016 (r310761) @@ -309,6 +309,13 @@ vmbus_msghc_exec(struct vmbus_softc *sc return error; } +void +vmbus_msghc_exec_cancel(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) +{ + + vmbus_xact_deactivate(mh->mh_xact); +} + const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) { @@ -317,6 +324,14 @@ vmbus_msghc_wait_result(struct vmbus_sof return (vmbus_xact_wait(mh->mh_xact, &resp_len)); } +const struct vmbus_message * +vmbus_msghc_poll_result(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) +{ + size_t resp_len; + + return (vmbus_xact_poll(mh->mh_xact, &resp_len)); +} + void vmbus_msghc_wakeup(struct vmbus_softc *sc, const struct vmbus_message *msg) { Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 07:20:53 2016 (r310760) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 29 07:27:13 2016 (r310761) @@ -67,7 +67,7 @@ static void vmbus_chan_set_chmap(struc static void vmbus_chan_clear_chmap(struct vmbus_channel *); static void vmbus_chan_detach(struct vmbus_channel *); static bool vmbus_chan_wait_revoke( - const struct vmbus_channel *); + const struct vmbus_channel *, bool); static void vmbus_chan_ins_prilist(struct vmbus_softc *, struct vmbus_channel *); @@ -349,7 +349,6 @@ vmbus_chan_open_br(struct vmbus_channel const void *udata, int udlen, vmbus_chan_callback_t cb, void *cbarg) { struct vmbus_softc *sc = chan->ch_vmbus; - const struct vmbus_chanmsg_chopen_resp *resp; const struct vmbus_message *msg; struct vmbus_chanmsg_chopen *req; struct vmbus_msghc *mh; @@ -406,8 +405,6 @@ vmbus_chan_open_br(struct vmbus_channel /* * Connect the bufrings, both RX and TX, to this channel. */ - KASSERT(chan->ch_bufring_gpadl == 0, - ("bufring GPADL is still connected")); error = vmbus_chan_gpadl_connect(chan, cbr->cbr_paddr, txbr_size + rxbr_size, &chan->ch_bufring_gpadl); if (error) { @@ -453,9 +450,50 @@ vmbus_chan_open_br(struct vmbus_channel goto failed; } - msg = vmbus_msghc_wait_result(sc, mh); - resp = (const struct vmbus_chanmsg_chopen_resp *)msg->msg_data; - status = resp->chm_status; + for (;;) { + msg = vmbus_msghc_poll_result(sc, mh); + if (msg != NULL) + break; + if (vmbus_chan_is_revoked(chan)) { + int i; + + /* + * NOTE: + * Hypervisor does _not_ send response CHOPEN to + * a revoked channel. + */ + vmbus_chan_printf(chan, + "chan%u is revoked, when it is being opened\n", + chan->ch_id); + + /* + * XXX + * Add extra delay before cancel the hypercall + * execution; mainly to close any possible + * CHRESCIND and CHOPEN_RESP races on the + * hypervisor side. + */ +#define REVOKE_LINGER 100 + for (i = 0; i < REVOKE_LINGER; ++i) { + msg = vmbus_msghc_poll_result(sc, mh); + if (msg != NULL) + break; + pause("rchopen", 1); + } +#undef REVOKE_LINGER + if (msg == NULL) + vmbus_msghc_exec_cancel(sc, mh); + break; + } + pause("chopen", 1); + } + if (msg != NULL) { + status = ((const struct vmbus_chanmsg_chopen_resp *) + msg->msg_data)->chm_status; + } else { + /* XXX any non-0 value is ok here. */ + status = 0xff; + } vmbus_msghc_put(sc, mh); @@ -620,7 +658,7 @@ vmbus_chan_gpadl_connect(struct vmbus_ch } static bool -vmbus_chan_wait_revoke(const struct vmbus_channel *chan) +vmbus_chan_wait_revoke(const struct vmbus_channel *chan, bool can_sleep) { #define WAIT_COUNT 200 /* 200ms */ @@ -629,8 +667,10 @@ vmbus_chan_wait_revoke(const struct vmbu for (i = 0; i < WAIT_COUNT; ++i) { if (vmbus_chan_is_revoked(chan)) return (true); - /* Not sure about the context; use busy-wait. */ - DELAY(1000); + if (can_sleep) + pause("wchrev", 1); + else + DELAY(1000); } return (false); @@ -667,7 +707,7 @@ vmbus_chan_gpadl_disconnect(struct vmbus if (error) { vmbus_msghc_put(sc, mh); - if (vmbus_chan_wait_revoke(chan)) { + if (vmbus_chan_wait_revoke(chan, true)) { /* * Error is benign; this channel is revoked, * so this GPADL will not be touched anymore. Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_var.h Thu Dec 29 07:20:53 2016 (r310760) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_var.h Thu Dec 29 07:27:13 2016 (r310761) @@ -157,9 +157,14 @@ void vmbus_msghc_put(struct vmbus_softc void *vmbus_msghc_dataptr(struct vmbus_msghc *); int vmbus_msghc_exec_noresult(struct vmbus_msghc *); int vmbus_msghc_exec(struct vmbus_softc *, struct vmbus_msghc *); +void vmbus_msghc_exec_cancel(struct vmbus_softc *, + struct vmbus_msghc *); const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *, struct vmbus_msghc *); +const struct vmbus_message * + vmbus_msghc_poll_result(struct vmbus_softc *, + struct vmbus_msghc *); void vmbus_msghc_wakeup(struct vmbus_softc *, const struct vmbus_message *); void vmbus_msghc_reset(struct vmbus_msghc *, size_t); Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Dec 29 07:20:53 2016 (r310760) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Dec 29 07:27:13 2016 (r310761) @@ -71,8 +71,10 @@ static struct vmbus_xact *vmbus_xact_all static void vmbus_xact_free(struct vmbus_xact *); static struct vmbus_xact *vmbus_xact_get1(struct vmbus_xact_ctx *, uint32_t); -const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, +static const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, bool); +static const void *vmbus_xact_return(struct vmbus_xact *, + size_t *); static void vmbus_xact_save_resp(struct vmbus_xact *, const void *, size_t); static void vmbus_xact_ctx_free(struct vmbus_xact_ctx *); @@ -277,27 +279,13 @@ vmbus_xact_deactivate(struct vmbus_xact mtx_unlock(&ctx->xc_lock); } -const void * -vmbus_xact_wait1(struct vmbus_xact *xact, size_t *resp_len, - bool can_sleep) +static const void * +vmbus_xact_return(struct vmbus_xact *xact, size_t *resp_len) { struct vmbus_xact_ctx *ctx = xact->x_ctx; const void *resp; - mtx_lock(&ctx->xc_lock); - - KASSERT(ctx->xc_active == xact, ("xact mismatch")); - while (xact->x_resp == NULL && - (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { - if (can_sleep) { - mtx_sleep(&ctx->xc_active, &ctx->xc_lock, 0, - "wxact", 0); - } else { - mtx_unlock(&ctx->xc_lock); - DELAY(1000); - mtx_lock(&ctx->xc_lock); - } - } + mtx_assert(&ctx->xc_lock, MA_OWNED); KASSERT(ctx->xc_active == xact, ("xact trashed")); if ((ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) && xact->x_resp == NULL) { @@ -317,6 +305,32 @@ vmbus_xact_wait1(struct vmbus_xact *xact resp = xact->x_resp; *resp_len = xact->x_resp_len; + return (resp); +} + +static const void * +vmbus_xact_wait1(struct vmbus_xact *xact, size_t *resp_len, + bool can_sleep) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + const void *resp; + + mtx_lock(&ctx->xc_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + while (xact->x_resp == NULL && + (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { + if (can_sleep) { + mtx_sleep(&ctx->xc_active, &ctx->xc_lock, 0, + "wxact", 0); + } else { + mtx_unlock(&ctx->xc_lock); + DELAY(1000); + mtx_lock(&ctx->xc_lock); + } + } + resp = vmbus_xact_return(xact, resp_len); + mtx_unlock(&ctx->xc_lock); return (resp); @@ -336,6 +350,28 @@ vmbus_xact_busywait(struct vmbus_xact *x return (vmbus_xact_wait1(xact, resp_len, false /* can't sleep */)); } +const void * +vmbus_xact_poll(struct vmbus_xact *xact, size_t *resp_len) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + const void *resp; + + mtx_lock(&ctx->xc_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + if (xact->x_resp == NULL && + (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { + mtx_unlock(&ctx->xc_lock); + *resp_len = 0; + return (NULL); + } + resp = vmbus_xact_return(xact, resp_len); + + mtx_unlock(&ctx->xc_lock); + + return (resp); +} + static void vmbus_xact_save_resp(struct vmbus_xact *xact, const void *data, size_t dlen) { From owner-svn-src-all@freebsd.org Thu Dec 29 08:10:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8A53C956AC; Thu, 29 Dec 2016 08:10:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C7E412C0; Thu, 29 Dec 2016 08:10:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT8ApKR080251; Thu, 29 Dec 2016 08:10:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT8Ap9s080250; Thu, 29 Dec 2016 08:10:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290810.uBT8Ap9s080250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 08:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310762 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 08:10:53 -0000 Author: arybchik Date: Thu Dec 29 08:10:51 2016 New Revision: 310762 URL: https://svnweb.freebsd.org/changeset/base/310762 Log: sfxge(4): regenerate MCDI headers from firmwaresrc .yml Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Dec 29 07:27:13 2016 (r310761) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Dec 29 08:10:51 2016 (r310762) @@ -136,6 +136,8 @@ #define MCDI_HEADER_XFLAGS_WIDTH 8 /* Request response using event */ #define MCDI_HEADER_XFLAGS_EVREQ 0x01 +/* Request (and signal) early doorbell return */ +#define MCDI_HEADER_XFLAGS_DBRET 0x02 /* Maximum number of payload bytes */ #define MCDI_CTL_SDU_LEN_MAX_V1 0xfc @@ -149,7 +151,7 @@ /* The MC can generate events for two reasons: - * - To complete a shared memory request if XFLAGS_EVREQ was set + * - To advance a shared memory request if XFLAGS_EVREQ was set * - As a notification (link state, i2c event), controlled * via MC_CMD_LOG_CTRL * @@ -302,6 +304,12 @@ /* The clock whose frequency you've attempted to set set * doesn't exist on this NIC */ #define MC_CMD_ERR_NO_CLOCK 0x1015 +/* Returned by MC_CMD_TESTASSERT if the action that should + * have caused an assertion failed to do so. */ +#define MC_CMD_ERR_UNREACHABLE 0x1016 +/* This command needs to be processed in the background but there were no + * resources to do so. Send it again after a command has completed. */ +#define MC_CMD_ERR_QUEUE_FULL 0x1017 #define MC_CMD_ERR_CODE_OFST 0 @@ -483,8 +491,48 @@ #define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa /* enum: PTP status update */ #define MCDI_EVENT_AOE_PTP_STATUS 0xb +/* enum: FPGA header incorrect */ +#define MCDI_EVENT_AOE_FPGA_LOAD_HEADER_ERR 0xc +/* enum: FPGA Powered Off due to error in powering up FPGA */ +#define MCDI_EVENT_AOE_FPGA_POWER_OFF 0xd +/* enum: AOE FPGA load failed due to MC to MUM communication failure */ +#define MCDI_EVENT_AOE_FPGA_LOAD_FAILED 0xe +/* enum: Notify that invalid flash type detected */ +#define MCDI_EVENT_AOE_INVALID_FPGA_FLASH_TYPE 0xf +/* enum: Notify that the attempt to run FPGA Controller firmware timedout */ +#define MCDI_EVENT_AOE_FC_RUN_TIMEDOUT 0x10 #define MCDI_EVENT_AOE_ERR_DATA_LBN 8 #define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8 +#define MCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_LBN 8 +#define MCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_WIDTH 8 +/* enum: Reading from NV failed */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_NV_READ_FAIL 0x0 +/* enum: Invalid Magic Number if FPGA header */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_MAGIC_FAIL 0x1 +/* enum: Invalid Silicon type detected in header */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_SILICON_TYPE 0x2 +/* enum: Unsupported VRatio */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_VRATIO 0x3 +/* enum: Unsupported DDR Type */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_TYPE 0x4 +/* enum: DDR Voltage out of supported range */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_VOLTAGE 0x5 +/* enum: Unsupported DDR speed */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_SPEED 0x6 +/* enum: Unsupported DDR size */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_SIZE 0x7 +/* enum: Unsupported DDR rank */ +#define MCDI_EVENT_AOE_ERR_FPGA_HEADER_DDR_RANK 0x8 +#define MCDI_EVENT_AOE_ERR_CODE_INVALID_FPGA_FLASH_TYPE_INFO_LBN 8 +#define MCDI_EVENT_AOE_ERR_CODE_INVALID_FPGA_FLASH_TYPE_INFO_WIDTH 8 +/* enum: Primary boot flash */ +#define MCDI_EVENT_AOE_FLASH_TYPE_BOOT_PRIMARY 0x0 +/* enum: Secondary boot flash */ +#define MCDI_EVENT_AOE_FLASH_TYPE_BOOT_SECONDARY 0x1 +#define MCDI_EVENT_AOE_ERR_CODE_FPGA_POWER_OFF_LBN 8 +#define MCDI_EVENT_AOE_ERR_CODE_FPGA_POWER_OFF_WIDTH 8 +#define MCDI_EVENT_AOE_ERR_CODE_FPGA_LOAD_FAILED_LBN 8 +#define MCDI_EVENT_AOE_ERR_CODE_FPGA_LOAD_FAILED_WIDTH 8 #define MCDI_EVENT_RX_ERR_RXQ_LBN 0 #define MCDI_EVENT_RX_ERR_RXQ_WIDTH 12 #define MCDI_EVENT_RX_ERR_TYPE_LBN 12 @@ -765,7 +813,7 @@ #define FCDI_EVENT_BOOT_RESULT_WIDTH 32 /* FCDI_EXTENDED_EVENT_PPS structuredef: Extended FCDI event to send PPS events - * to the MC. Note that this structure | is overlaid over a normal FCDI event + * to the MC. Note that this structure | is overlayed over a normal FCDI event * such that bits 32-63 containing | event code, level, source etc remain the * same. In this case the data | field of the header is defined to be the * number of timestamps @@ -966,6 +1014,8 @@ #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_WIDTH 1 #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_LBN 5 #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_WIDTH 1 +#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_DISABLE_XIP_LBN 6 +#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_DISABLE_XIP_WIDTH 1 /* Destination address */ #define MC_CMD_COPYCODE_IN_DEST_ADDR_OFST 4 #define MC_CMD_COPYCODE_IN_NUMWORDS_OFST 8 @@ -4113,6 +4163,8 @@ #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_CAPABILITIES_OFST 8 #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_LBN 0 #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_WIDTH 1 +#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RX_TSTAMP_OOB_LBN 1 +#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RX_TSTAMP_OOB_WIDTH 1 #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED0_OFST 12 #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED1_OFST 16 #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED2_OFST 20 @@ -4676,6 +4728,10 @@ #define MC_CMD_FW_HIGH_TX_RATE 0x3 /* enum: Reserved value */ #define MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 0x4 +/* enum: Prefer to use firmware with additional "rules engine" filtering + * support + */ +#define MC_CMD_FW_RULES_ENGINE 0x5 /* enum: Only this option is allowed for non-admin functions */ #define MC_CMD_FW_DONT_CARE 0xffffffff @@ -6098,6 +6154,8 @@ #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_TLV_LBN 1 #define MC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1 +#define MC_CMD_NVRAM_INFO_OUT_READ_ONLY_LBN 5 +#define MC_CMD_NVRAM_INFO_OUT_READ_ONLY_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_CMAC_LBN 6 #define MC_CMD_NVRAM_INFO_OUT_CMAC_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_A_B_LBN 7 @@ -6117,6 +6175,8 @@ #define MC_CMD_NVRAM_INFO_V2_OUT_PROTECTED_WIDTH 1 #define MC_CMD_NVRAM_INFO_V2_OUT_TLV_LBN 1 #define MC_CMD_NVRAM_INFO_V2_OUT_TLV_WIDTH 1 +#define MC_CMD_NVRAM_INFO_V2_OUT_READ_ONLY_LBN 5 +#define MC_CMD_NVRAM_INFO_V2_OUT_READ_ONLY_WIDTH 1 #define MC_CMD_NVRAM_INFO_V2_OUT_A_B_LBN 7 #define MC_CMD_NVRAM_INFO_V2_OUT_A_B_WIDTH 1 #define MC_CMD_NVRAM_INFO_V2_OUT_PHYSDEV_OFST 16 @@ -6137,12 +6197,27 @@ #define MC_CMD_0x38_PRIVILEGE_CTG SRIOV_CTG_ADMIN -/* MC_CMD_NVRAM_UPDATE_START_IN msgrequest */ +/* MC_CMD_NVRAM_UPDATE_START_IN msgrequest: Legacy NVRAM_UPDATE_START request. + * Use NVRAM_UPDATE_START_V2_IN in new code + */ #define MC_CMD_NVRAM_UPDATE_START_IN_LEN 4 #define MC_CMD_NVRAM_UPDATE_START_IN_TYPE_OFST 0 /* Enum values, see field(s): */ /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */ +/* MC_CMD_NVRAM_UPDATE_START_V2_IN msgrequest: Extended NVRAM_UPDATE_START + * request with additional flags indicating version of command in use. See + * MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT for details of extended functionality. Use + * paired up with NVRAM_UPDATE_FINISH_V2_IN. + */ +#define MC_CMD_NVRAM_UPDATE_START_V2_IN_LEN 8 +#define MC_CMD_NVRAM_UPDATE_START_V2_IN_TYPE_OFST 0 +/* Enum values, see field(s): */ +/* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */ +#define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAGS_OFST 4 +#define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAG_REPORT_VERIFY_RESULT_LBN 0 +#define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAG_REPORT_VERIFY_RESULT_WIDTH 1 + /* MC_CMD_NVRAM_UPDATE_START_OUT msgresponse */ #define MC_CMD_NVRAM_UPDATE_START_OUT_LEN 0 @@ -6271,16 +6346,87 @@ #define MC_CMD_0x3c_PRIVILEGE_CTG SRIOV_CTG_ADMIN -/* MC_CMD_NVRAM_UPDATE_FINISH_IN msgrequest */ +/* MC_CMD_NVRAM_UPDATE_FINISH_IN msgrequest: Legacy NVRAM_UPDATE_FINISH + * request. Use NVRAM_UPDATE_FINISH_V2_IN in new code + */ #define MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN 8 #define MC_CMD_NVRAM_UPDATE_FINISH_IN_TYPE_OFST 0 /* Enum values, see field(s): */ /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */ #define MC_CMD_NVRAM_UPDATE_FINISH_IN_REBOOT_OFST 4 -/* MC_CMD_NVRAM_UPDATE_FINISH_OUT msgresponse */ +/* MC_CMD_NVRAM_UPDATE_FINISH_V2_IN msgrequest: Extended NVRAM_UPDATE_FINISH + * request with additional flags indicating version of NVRAM_UPDATE commands in + * use. See MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT for details of extended + * functionality. Use paired up with NVRAM_UPDATE_START_V2_IN. + */ +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN 12 +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_TYPE_OFST 0 +/* Enum values, see field(s): */ +/* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */ +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_REBOOT_OFST 4 +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAGS_OFST 8 +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAG_REPORT_VERIFY_RESULT_LBN 0 +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAG_REPORT_VERIFY_RESULT_WIDTH 1 + +/* MC_CMD_NVRAM_UPDATE_FINISH_OUT msgresponse: Legacy NVRAM_UPDATE_FINISH + * response. Use NVRAM_UPDATE_FINISH_V2_OUT in new code + */ #define MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN 0 +/* MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT msgresponse: + * + * Extended NVRAM_UPDATE_FINISH response that communicates the result of secure + * firmware validation where applicable back to the host. + * + * Medford only: For signed firmware images, such as those for medford, the MC + * firmware verifies the signature before marking the firmware image as valid. + * This process takes a few seconds to complete. So is likely to take more than + * the MCDI timeout. Hence signature verification is initiated when + * MC_CMD_NVRAM_UPDATE_FINISH_V2_IN is received by the firmware, however, the + * MCDI command is run in a background MCDI processing thread. This response + * payload includes the results of the signature verification. Note that the + * per-partition nvram lock in firmware is only released after the verification + * has completed. + */ +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN 4 +/* Result of nvram update completion processing */ +#define MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE_OFST 0 +/* enum: Invalid return code; only non-zero values are defined. Defined as + * unknown for backwards compatibility with NVRAM_UPDATE_FINISH_OUT. + */ +#define MC_CMD_NVRAM_VERIFY_RC_UNKNOWN 0x0 +/* enum: Verify succeeded without any errors. */ +#define MC_CMD_NVRAM_VERIFY_RC_SUCCESS 0x1 +/* enum: CMS format verification failed due to an internal error. */ +#define MC_CMD_NVRAM_VERIFY_RC_CMS_CHECK_FAILED 0x2 +/* enum: Invalid CMS format in image metadata. */ +#define MC_CMD_NVRAM_VERIFY_RC_INVALID_CMS_FORMAT 0x3 +/* enum: Message digest verification failed due to an internal error. */ +#define MC_CMD_NVRAM_VERIFY_RC_MESSAGE_DIGEST_CHECK_FAILED 0x4 +/* enum: Error in message digest calculated over the reflash-header, payload + * and reflash-trailer. + */ +#define MC_CMD_NVRAM_VERIFY_RC_BAD_MESSAGE_DIGEST 0x5 +/* enum: Signature verification failed due to an internal error. */ +#define MC_CMD_NVRAM_VERIFY_RC_SIGNATURE_CHECK_FAILED 0x6 +/* enum: There are no valid signatures in the image. */ +#define MC_CMD_NVRAM_VERIFY_RC_NO_VALID_SIGNATURES 0x7 +/* enum: Trusted approvers verification failed due to an internal error. */ +#define MC_CMD_NVRAM_VERIFY_RC_TRUSTED_APPROVERS_CHECK_FAILED 0x8 +/* enum: The Trusted approver's list is empty. */ +#define MC_CMD_NVRAM_VERIFY_RC_NO_TRUSTED_APPROVERS 0x9 +/* enum: Signature chain verification failed due to an internal error. */ +#define MC_CMD_NVRAM_VERIFY_RC_SIGNATURE_CHAIN_CHECK_FAILED 0xa +/* enum: The signers of the signatures in the image are not listed in the + * Trusted approver's list. + */ +#define MC_CMD_NVRAM_VERIFY_RC_NO_SIGNATURE_MATCH 0xb +/* enum: The image contains a test-signed certificate, but the adapter accepts + * only production signed images. + */ +#define MC_CMD_NVRAM_VERIFY_RC_REJECT_TEST_SIGNED 0xc + /***********************************/ /* MC_CMD_REBOOT @@ -6853,6 +6999,28 @@ /* MC_CMD_TESTASSERT_OUT msgresponse */ #define MC_CMD_TESTASSERT_OUT_LEN 0 +/* MC_CMD_TESTASSERT_V2_IN msgrequest */ +#define MC_CMD_TESTASSERT_V2_IN_LEN 4 +/* How to provoke the assertion */ +#define MC_CMD_TESTASSERT_V2_IN_TYPE_OFST 0 +/* enum: Assert using the FAIL_ASSERTION_WITH_USEFUL_VALUES macro. Unless + * you're testing firmware, this is what you want. + */ +#define MC_CMD_TESTASSERT_V2_IN_FAIL_ASSERTION_WITH_USEFUL_VALUES 0x0 +/* enum: Assert using assert(0); */ +#define MC_CMD_TESTASSERT_V2_IN_ASSERT_FALSE 0x1 +/* enum: Deliberately trigger a watchdog */ +#define MC_CMD_TESTASSERT_V2_IN_WATCHDOG 0x2 +/* enum: Deliberately trigger a trap by loading from an invalid address */ +#define MC_CMD_TESTASSERT_V2_IN_LOAD_TRAP 0x3 +/* enum: Deliberately trigger a trap by storing to an invalid address */ +#define MC_CMD_TESTASSERT_V2_IN_STORE_TRAP 0x4 +/* enum: Jump to an invalid address */ +#define MC_CMD_TESTASSERT_V2_IN_JUMP_TRAP 0x5 + +/* MC_CMD_TESTASSERT_V2_OUT msgresponse */ +#define MC_CMD_TESTASSERT_V2_OUT_LEN 0 + /***********************************/ /* MC_CMD_WORKAROUND @@ -7869,8 +8037,8 @@ #define NVRAM_PARTITION_TYPE_EXPANSION_UEFI 0xd00 /* enum: Spare partition 0 */ #define NVRAM_PARTITION_TYPE_SPARE_0 0x1000 -/* enum: Spare partition 1 */ -#define NVRAM_PARTITION_TYPE_SPARE_1 0x1100 +/* enum: Used for XIP code of shmbooted images */ +#define NVRAM_PARTITION_TYPE_XIP_SCRATCH 0x1100 /* enum: Spare partition 2 */ #define NVRAM_PARTITION_TYPE_SPARE_2 0x1200 /* enum: Manufacturing partition. Used during manufacture to pass information @@ -7881,6 +8049,10 @@ #define NVRAM_PARTITION_TYPE_SPARE_4 0x1400 /* enum: Spare partition 5 */ #define NVRAM_PARTITION_TYPE_SPARE_5 0x1500 +/* enum: Partition for reporting MC status. See mc_flash_layout.h + * medford_mc_status_hdr_t for layout on Medford. + */ +#define NVRAM_PARTITION_TYPE_STATUS 0x1600 /* enum: Start of reserved value range (firmware may use for any purpose) */ #define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MIN 0xff00 /* enum: End of reserved value range (firmware may use for any purpose) */ @@ -7913,6 +8085,14 @@ #define LICENSED_APP_ID_NETWORK_ACCESS_CONTROL 0x80 /* enum: TCP Direct */ #define LICENSED_APP_ID_TCP_DIRECT 0x100 +/* enum: Low Latency */ +#define LICENSED_APP_ID_LOW_LATENCY 0x200 +/* enum: SolarCapture Tap */ +#define LICENSED_APP_ID_SOLARCAPTURE_TAP 0x400 +/* enum: Capture SolarSystem 40G */ +#define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM_40G 0x800 +/* enum: Capture SolarSystem 1G */ +#define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM_1G 0x1000 #define LICENSED_APP_ID_ID_LBN 0 #define LICENSED_APP_ID_ID_WIDTH 32 @@ -7975,6 +8155,10 @@ #define LICENSED_V3_APPS_LOW_LATENCY_WIDTH 1 #define LICENSED_V3_APPS_SOLARCAPTURE_TAP_LBN 10 #define LICENSED_V3_APPS_SOLARCAPTURE_TAP_WIDTH 1 +#define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_40G_LBN 11 +#define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_40G_WIDTH 1 +#define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_1G_LBN 12 +#define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_1G_WIDTH 1 #define LICENSED_V3_APPS_MASK_LBN 0 #define LICENSED_V3_APPS_MASK_WIDTH 64 @@ -8054,6 +8238,19 @@ #define RSS_MODE_HASH_SELECTOR_LBN 0 #define RSS_MODE_HASH_SELECTOR_WIDTH 8 +/* CTPIO_STATS_MAP structuredef */ +#define CTPIO_STATS_MAP_LEN 4 +/* The (function relative) VI number */ +#define CTPIO_STATS_MAP_VI_OFST 0 +#define CTPIO_STATS_MAP_VI_LEN 2 +#define CTPIO_STATS_MAP_VI_LBN 0 +#define CTPIO_STATS_MAP_VI_WIDTH 16 +/* The target bucket for the VI */ +#define CTPIO_STATS_MAP_BUCKET_OFST 2 +#define CTPIO_STATS_MAP_BUCKET_LEN 2 +#define CTPIO_STATS_MAP_BUCKET_LBN 16 +#define CTPIO_STATS_MAP_BUCKET_WIDTH 16 + /***********************************/ /* MC_CMD_READ_REGS @@ -8509,6 +8706,8 @@ #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1 #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_LBN 12 #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_WIDTH 1 +#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_LBN 13 +#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_WIDTH 1 /* Owner ID to use if in buffer mode (zero if physical) */ #define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_OFST 20 /* The port ID associated with the v-adaptor which should contain this DMAQ. */ @@ -9442,7 +9641,11 @@ #define MC_CMD_PARSER_DISP_RW_IN_RX_DICPU 0x0 /* enum: TX dispatcher CPU */ #define MC_CMD_PARSER_DISP_RW_IN_TX_DICPU 0x1 -/* enum: Lookup engine (with original metadata format) */ +/* enum: Lookup engine (with original metadata format). Deprecated; used only + * by cmdclient as a fallback for very old Huntington firmware, and not + * supported in firmware beyond v6.4.0.1005. Use LUE_VERSIONED_METADATA + * instead. + */ #define MC_CMD_PARSER_DISP_RW_IN_LUE 0x2 /* enum: Lookup engine (with requested metadata format) */ #define MC_CMD_PARSER_DISP_RW_IN_LUE_VERSIONED_METADATA 0x3 @@ -10298,7 +10501,9 @@ * (Huntington development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2 -/* enum: Virtual switching (full feature) RX PD production firmware */ +/* enum: Full featured RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_VSWITCH 0x3 /* enum: siena_compat variant RX PD firmware using PM rather than MAC * (Huntington development only) @@ -10312,6 +10517,8 @@ * tests (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* enum: RX PD firmware parsing but not filtering network overlay tunnel @@ -10336,7 +10543,9 @@ * (Huntington development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2 -/* enum: Virtual switching (full feature) TX PD production firmware */ +/* enum: Full featured TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_VSWITCH 0x3 /* enum: siena_compat variant TX PD firmware using PM rather than MAC * (Huntington development only) @@ -10347,6 +10556,8 @@ * tests (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* Hardware capabilities of NIC */ @@ -10483,7 +10694,9 @@ * (Huntington development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2 -/* enum: Virtual switching (full feature) RX PD production firmware */ +/* enum: Full featured RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_VSWITCH 0x3 /* enum: siena_compat variant RX PD firmware using PM rather than MAC * (Huntington development only) @@ -10497,6 +10710,8 @@ * tests (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* enum: RX PD firmware parsing but not filtering network overlay tunnel @@ -10521,7 +10736,9 @@ * (Huntington development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2 -/* enum: Virtual switching (full feature) TX PD production firmware */ +/* enum: Full featured TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_VSWITCH 0x3 /* enum: siena_compat variant TX PD firmware using PM rather than MAC * (Huntington development only) @@ -10532,6 +10749,8 @@ * tests (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* Hardware capabilities of NIC */ @@ -10556,6 +10775,20 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_LBN 7 #define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_TIMESTAMPING_LBN 8 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_TIMESTAMPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TIMESTAMP_LBN 9 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TIMESTAMP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_SNIFF_LBN 10 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_SNIFF_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_SNIFF_LBN 11 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_SNIFF_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_BACKGROUND_LBN 13 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_BACKGROUND_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_DB_RETURN_LBN 14 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_DB_RETURN_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -10612,6 +10845,308 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_OFST 70 #define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_LEN 2 +/* MC_CMD_GET_CAPABILITIES_V3_OUT msgresponse */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_LEN 76 +/* First word of flags. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS1_OFST 0 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VPORT_RECONFIGURE_LBN 3 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VPORT_RECONFIGURE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_STRIPING_LBN 4 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_STRIPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_QUERY_LBN 5 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_QUERY_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_DRV_ATTACH_PREBOOT_LBN 7 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_DRV_ATTACH_PREBOOT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_FORCE_EVENT_MERGING_LBN 8 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_SET_MAC_ENHANCED_LBN 9 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_SET_MAC_ENHANCED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_SECURITY_FILTERING_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_ADDITIONAL_RSS_MODES_LBN 13 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_ADDITIONAL_RSS_MODES_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_QBB_LBN 14 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_QBB_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_RSS_LIMITED_LBN 16 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_RSS_LIMITED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_LBN 17 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_INCLUDE_FCS_LBN 18 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_INCLUDE_FCS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VLAN_INSERTION_LBN 19 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VLAN_INSERTION_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_VLAN_STRIPPING_LBN 20 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_VLAN_STRIPPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_0_LBN 22 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_0_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_14_LBN 23 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_14_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_TIMESTAMP_LBN 24 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_TIMESTAMP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_BATCHING_LBN 25 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_BATCHING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MCAST_FILTER_CHAINING_LBN 26 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MCAST_FILTER_CHAINING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_PM_AND_RXDP_COUNTERS_LBN 27 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DISABLE_SCATTER_LBN 28 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DISABLE_SCATTER_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_LBN 30 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VXLAN_NVGRE_LBN 31 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VXLAN_NVGRE_WIDTH 1 +/* RxDPCPU firmware id. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DPCPU_FW_ID_OFST 4 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DPCPU_FW_ID_LEN 2 +/* enum: Standard RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP 0x0 +/* enum: Low latency RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_LOW_LATENCY 0x1 +/* enum: Packed stream RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_PACKED_STREAM 0x2 +/* enum: BIST RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_BIST 0x10a +/* enum: RXDP Test firmware image 1 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101 +/* enum: RXDP Test firmware image 2 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102 +/* enum: RXDP Test firmware image 3 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103 +/* enum: RXDP Test firmware image 4 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104 +/* enum: RXDP Test firmware image 5 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_BACKPRESSURE 0x105 +/* enum: RXDP Test firmware image 6 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106 +/* enum: RXDP Test firmware image 7 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107 +/* enum: RXDP Test firmware image 8 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_DISABLE_DL 0x108 +/* enum: RXDP Test firmware image 9 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b +/* TxDPCPU firmware id. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DPCPU_FW_ID_OFST 6 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DPCPU_FW_ID_LEN 2 +/* enum: Standard TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP 0x0 +/* enum: Low latency TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_LOW_LATENCY 0x1 +/* enum: High packet rate TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_HIGH_PACKET_RATE 0x3 +/* enum: BIST TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_BIST 0x12d +/* enum: TXDP Test firmware image 1 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_TSO_EDIT 0x101 +/* enum: TXDP Test firmware image 2 */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102 +/* enum: TXDP CSR bus test firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_CSR 0x103 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_OFST 8 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_REV_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_REV_WIDTH 12 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_TYPE_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4 +/* enum: reserved value - do not use (may indicate alternative interpretation + * of REV field in future) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RESERVED 0x0 +/* enum: Trivial RX PD firmware for early Huntington development (Huntington + * development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1 +/* enum: RX PD firmware with approximately Siena-compatible behaviour + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2 +/* enum: Full featured RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_VSWITCH 0x3 +/* enum: siena_compat variant RX PD firmware using PM rather than MAC + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 +/* enum: Low latency RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5 +/* enum: Packed stream RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6 +/* enum: RX PD firmware handling layer 2 only for high packet rate performance + * tests (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe +/* enum: RX PD firmware parsing but not filtering network overlay tunnel + * encapsulations (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_OFST 10 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_REV_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_REV_WIDTH 12 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_TYPE_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4 +/* enum: reserved value - do not use (may indicate alternative interpretation + * of REV field in future) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RESERVED 0x0 +/* enum: Trivial TX PD firmware for early Huntington development (Huntington + * development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1 +/* enum: TX PD firmware with approximately Siena-compatible behaviour + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2 +/* enum: Full featured TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_VSWITCH 0x3 +/* enum: siena_compat variant TX PD firmware using PM rather than MAC + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */ +/* enum: TX PD firmware handling layer 2 only for high packet rate performance + * tests (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe +/* Hardware capabilities of NIC */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_HW_CAPABILITIES_OFST 12 +/* Licensed capabilities */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_LICENSE_CAPABILITIES_OFST 16 +/* Second word of flags. Not present on older firmware (check the length). */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS2_OFST 20 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_ENCAP_LBN 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_ENCAP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVQ_TIMER_CTRL_LBN 2 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVQ_TIMER_CTRL_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVENT_CUT_THROUGH_LBN 3 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EVENT_CUT_THROUGH_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_CUT_THROUGH_LBN 4 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_CUT_THROUGH_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VFIFO_ULL_MODE_LBN 5 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VFIFO_ULL_MODE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_INIT_EVQ_V2_LBN 7 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_INIT_EVQ_V2_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_TIMESTAMPING_LBN 8 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_TIMESTAMPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TIMESTAMP_LBN 9 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TIMESTAMP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_SNIFF_LBN 10 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_SNIFF_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_SNIFF_LBN 11 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_SNIFF_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_BACKGROUND_LBN 13 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_BACKGROUND_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_DB_RETURN_LBN 14 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_DB_RETURN_WIDTH 1 +/* Number of FATSOv2 contexts per datapath supported by this NIC. Not present + * on older firmware (check the length). + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2 +/* One byte per PF containing the number of the external port assigned to this + * PF, indexed by PF number. Special values indicate that a PF is either not + * present or not assigned. + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16 +/* enum: The caller is not permitted to access information on this PF. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_ACCESS_NOT_PERMITTED 0xff +/* enum: PF does not exist. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_PRESENT 0xfe +/* enum: PF does exist but is not assigned to any external port. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_ASSIGNED 0xfd +/* enum: This value indicates that PF is assigned, but it cannot be expressed + * in this field. It is intended for a possible future situation where a more + * complex scheme of PFs to ports mapping is being used. The future driver + * should look for a new field supporting the new scheme. The current/old + * driver should treat this value as PF_NOT_ASSIGNED. + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc +/* One byte per PF containing the number of its VFs, indexed by PF number. A + * special value indicates that a PF is not present. + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_OFST 42 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_LEN 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_NUM 16 +/* enum: The caller is not permitted to access information on this PF. */ +/* MC_CMD_GET_CAPABILITIES_V3_OUT_ACCESS_NOT_PERMITTED 0xff */ +/* enum: PF does not exist. */ +/* MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_PRESENT 0xfe */ +/* Number of VIs available for each external port */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_OFST 58 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_NUM 4 +/* Size of RX descriptor cache expressed as binary logarithm The actual size + * equals (2 ^ RX_DESC_CACHE_SIZE) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DESC_CACHE_SIZE_OFST 66 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DESC_CACHE_SIZE_LEN 1 +/* Size of TX descriptor cache expressed as binary logarithm The actual size + * equals (2 ^ TX_DESC_CACHE_SIZE) + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DESC_CACHE_SIZE_OFST 67 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DESC_CACHE_SIZE_LEN 1 +/* Total number of available PIO buffers */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_PIO_BUFFS_OFST 68 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_PIO_BUFFS_LEN 2 +/* Size of a single PIO buffer */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_SIZE_PIO_BUFF_OFST 70 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_SIZE_PIO_BUFF_LEN 2 +/* On chips later than Medford the amount of address space assigned to each VI + * is configurable. This is a global setting that the driver must query to + * discover the VI to address mapping. Cut-through PIO (CTPIO) is not available + * with 8k VI windows. + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_OFST 72 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_LEN 1 +/* enum: Each VI occupies 8k as on Huntington and Medford. PIO is at offset 4k. + * CTPIO is not mapped. + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_8K 0x0 +/* enum: Each VI occupies 16k. PIO is at offset 4k. CTPIO is at offset 12k. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_16K 0x1 +/* enum: Each VI occupies 64k. PIO is at offset 4k. CTPIO is at offset 12k. */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_64K 0x2 +/* Number of vFIFOs per adapter that can be used for VFIFO Stuffing + * (SF-115995-SW) in the present configuration of firmware and port mode. + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_VFIFOS_OFST 73 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_VFIFOS_LEN 1 +/* Number of buffers per adapter that can be used for VFIFO Stuffing + * (SF-115995-SW) in the present configuration of firmware and port mode. + */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_OFST 74 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_LEN 2 + /***********************************/ /* MC_CMD_V2_EXTN @@ -11770,7 +12305,7 @@ #define MC_CMD_GET_RXDP_CONFIG 0xc2 #undef MC_CMD_0xc2_PRIVILEGE_CTG -#define MC_CMD_0xc2_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0xc2_PRIVILEGE_CTG SRIOV_CTG_GENERAL /* MC_CMD_GET_RXDP_CONFIG_IN msgrequest */ #define MC_CMD_GET_RXDP_CONFIG_IN_LEN 0 @@ -12635,6 +13170,8 @@ * more data is returned. */ #define MC_CMD_PCIE_TUNE_IN_POLL_EYE_PLOT 0x6 +/* enum: Enable the SERDES BIST and set it to generate a 200MHz square wave */ +#define MC_CMD_PCIE_TUNE_IN_BIST_SQUARE_WAVE 0x7 /* Align the arguments to 32 bits */ #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_OFST 1 #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_LEN 3 @@ -12820,6 +13357,12 @@ #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0 #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126 +/* MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_IN msgrequest */ +#define MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_IN_LEN 0 + +/* MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_OUT msgrequest */ +#define MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_OUT_LEN 0 + /***********************************/ /* MC_CMD_LICENSING @@ -12887,7 +13430,9 @@ * that this operation returns a zero-length response */ #define MC_CMD_LICENSING_V3_IN_OP_UPDATE_LICENSE 0x0 -/* enum: report counts of installed licenses */ +/* enum: report counts of installed licenses Returns EAGAIN if license + * processing (updating) has been started but not yet completed. + */ #define MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE 0x1 /* MC_CMD_LICENSING_V3_OUT msgresponse */ @@ -13142,7 +13687,7 @@ #define MC_CMD_0xd4_PRIVILEGE_CTG SRIOV_CTG_GENERAL /* MC_CMD_LICENSED_V3_VALIDATE_APP_IN msgrequest */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 62 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 56 /* challenge for validation (384 bits) */ #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_OFST 0 #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_LEN 48 @@ -13151,14 +13696,9 @@ #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LEN 8 #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LO_OFST 48 #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_HI_OFST 52 -/* MAC address of the calling client MC_CMD_ERR_EPERM is returned if the - * calling client is not allowed to use this MAC address. - */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_MACADDR_OFST 56 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_MACADDR_LEN 6 /* MC_CMD_LICENSED_V3_VALIDATE_APP_OUT msgresponse */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 104 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 116 /* validation response to challenge in the form of ECDSA signature consisting * of two 384-bit integers, r and s, in big-endian order. The signature signs a * SHA-384 digest of a message constructed from the concatenation of the input @@ -13175,6 +13715,17 @@ #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_ACC 0x0 /* enum: expiry units are calendar days */ #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_DAYS 0x1 +/* base MAC address of the NIC stored in NVRAM (note that this is a constant + * value for a given NIC regardless which function is calling, effectively this + * is PF0 base MAC address) + */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_BASE_MACADDR_OFST 104 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_BASE_MACADDR_LEN 6 +/* MAC address of v-adaptor associated with the client. If no such v-adapator + * exists, then the field is filled with 0xFF. + */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_VADAPTOR_MACADDR_OFST 110 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_VADAPTOR_MACADDR_LEN 6 /***********************************/ @@ -13659,7 +14210,7 @@ #define MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST 0x200 /* enum */ #define MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS 0x400 /* enum */ /* enum: Allows to set the TX packets' source MAC address to any arbitrary MAC - * address. + * adress. */ #define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX 0x800 /* enum: Privilege that allows a Function to change the MAC address configured @@ -14565,9 +15116,12 @@ /***********************************/ /* MC_CMD_TSA_BIND * TSAN - TSAC binding communication protocol. Refer to SF-115479-TC for more - * info in respect to the binding protocol. Note- This MCDI command is only - * available over a TLS secure connection between the TSAN and TSAC, and is not - * available to host software. + * info in respect to the binding protocol. This MCDI command is only available + * over a TLS secure connection between the TSAN and TSAC, and is not available + * to host software. Note- The messages definitions that do comprise this MCDI + * command deemed as provisional. This MCDI command has not yet been used in + * any released code and may change during development. This note will be + * removed once it is regarded as stable. */ #define MC_CMD_TSA_BIND 0x119 #undef MC_CMD_0x119_PRIVILEGE_CTG @@ -14644,23 +15198,35 @@ #define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_LEN 6 /* MC_CMD_TSA_BIND_OUT_GET_ID msgresponse */ -#define MC_CMD_TSA_BIND_OUT_GET_ID_LENMIN 11 +#define MC_CMD_TSA_BIND_OUT_GET_ID_LENMIN 15 #define MC_CMD_TSA_BIND_OUT_GET_ID_LENMAX 252 -#define MC_CMD_TSA_BIND_OUT_GET_ID_LEN(num) (10+1*(num)) +#define MC_CMD_TSA_BIND_OUT_GET_ID_LEN(num) (14+1*(num)) /* The operation completion code. */ #define MC_CMD_TSA_BIND_OUT_GET_ID_OP_OFST 0 +/* Rules engine type. Note- The rules engine type allows TSAC to further + * identify the connected endpoint (e.g. TSAN, NIC Emulator) type and take the + * proper action accordingly. As an example, TSAC uses the rules engine type to + * select the SF key that differs in the case of TSAN vs. NIC Emulator. + */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_RULE_ENGINE_OFST 4 +/* enum: Hardware rules engine. */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_RULE_ENGINE_TSAN 0x1 +/* enum: Nic emulator rules engine. */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_RULE_ENGINE_NEMU 0x2 +/* enum: SSFE. */ +#define MC_CMD_TSA_BIND_OUT_GET_ID_RULE_ENGINE_SSFE 0x3 /* TSAN unique identifier for the network adapter */ -#define MC_CMD_TSA_BIND_OUT_GET_ID_TSANID_OFST 4 +#define MC_CMD_TSA_BIND_OUT_GET_ID_TSANID_OFST 8 #define MC_CMD_TSA_BIND_OUT_GET_ID_TSANID_LEN 6 /* The signature data blob. The signature is computed against the message * formed by TSAN ID concatenated with the NONCE value. Refer to SF-115479-TC * for more information also in respect to the private keys that are used to * sign the message based on TSAN pre/post-binding authentication procedure. */ -#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_OFST 10 +#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_OFST 14 #define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_LEN 1 #define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_MINNUM 1 -#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_MAXNUM 242 +#define MC_CMD_TSA_BIND_OUT_GET_ID_SIG_MAXNUM 238 /* MC_CMD_TSA_BIND_OUT_GET_TICKET msgresponse */ #define MC_CMD_TSA_BIND_OUT_GET_TICKET_LENMIN 5 @@ -15044,4 +15610,84 @@ /* MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT msgresponse */ #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT_LEN 0 + +/***********************************/ +/* MC_CMD_REKEY + * This request causes the NIC to generate a new per-NIC key and program it + * into the write-once memory. During the process all flash partitions that are + * protected with a CMAC are verified with the old per-NIC key and then signed + * with the new per-NIC key. If the NIC has already reached its rekey limit the + * REKEY op will return MC_CMD_ERR_ERANGE. The REKEY op may block until + * completion or it may return 0 and continue processing, therefore the caller + * must poll at least once to confirm that the rekeying has completed. The POLL + * operation returns MC_CMD_ERR_EBUSY if the rekey process is still running + * otherwise it will return the result of the last completed rekey operation, + * or 0 if there has not been a previous rekey. + */ +#define MC_CMD_REKEY 0x123 +#undef MC_CMD_0x123_PRIVILEGE_CTG + +#define MC_CMD_0x123_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_REKEY_IN msgrequest */ +#define MC_CMD_REKEY_IN_LEN 4 +/* the type of operation requested */ +#define MC_CMD_REKEY_IN_OP_OFST 0 +/* enum: Start the rekeying operation */ +#define MC_CMD_REKEY_IN_OP_REKEY 0x0 +/* enum: Poll for completion of the rekeying operation */ +#define MC_CMD_REKEY_IN_OP_POLL 0x1 + +/* MC_CMD_REKEY_OUT msgresponse */ +#define MC_CMD_REKEY_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS + * This interface allows the host to find out how many common pool buffers are + * not yet assigned. + */ +#define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS 0x124 +#undef MC_CMD_0x124_PRIVILEGE_CTG + +#define MC_CMD_0x124_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_IN msgrequest */ +#define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_IN_LEN 0 + +/* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT msgresponse */ +#define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_LEN 8 +/* Available buffers for the ENG to NET vFIFOs. */ +#define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_NET_OFST 0 +/* Available buffers for the ENG to ENG and NET to ENG vFIFOs. */ +#define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_ENG_OFST 4 + + +/***********************************/ +/* MC_CMD_SET_SECURITY_FUSES + * Change the security level of the adapter by setting bits in the write-once + * memory. The firmware maps each flag in the message to a set of one or more + * hardware-defined or software-defined bits and sets these bits in the write- + * once memory. For Medford the hardware-defined bits are defined in *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 29 08:16:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D184C95856; Thu, 29 Dec 2016 08:16:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5BA91638; Thu, 29 Dec 2016 08:16:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT8GiB4084154; Thu, 29 Dec 2016 08:16:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT8GiXB084153; Thu, 29 Dec 2016 08:16:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612290816.uBT8GiXB084153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 29 Dec 2016 08:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310763 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 08:16:45 -0000 Author: ngie Date: Thu Dec 29 08:16:43 2016 New Revision: 310763 URL: https://svnweb.freebsd.org/changeset/base/310763 Log: Use uint32_t instead of u_int32_t for or_last_change and services in "struct systemg" This is being done to match "struct systemg" in snmpmod(3) No functional change MFC after: 3 days Modified: head/contrib/bsnmp/snmpd/snmpmod.h Modified: head/contrib/bsnmp/snmpd/snmpmod.h ============================================================================== --- head/contrib/bsnmp/snmpd/snmpmod.h Thu Dec 29 08:10:51 2016 (r310762) +++ head/contrib/bsnmp/snmpd/snmpmod.h Thu Dec 29 08:16:43 2016 (r310763) @@ -317,8 +317,8 @@ struct systemg { u_char *contact; u_char *name; u_char *location; - u_int32_t services; - u_int32_t or_last_change; + uint32_t services; + uint32_t or_last_change; }; extern struct systemg systemg; From owner-svn-src-all@freebsd.org Thu Dec 29 08:25:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00203C95D71; Thu, 29 Dec 2016 08:25:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6B591D00; Thu, 29 Dec 2016 08:25:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT8P0qd088301; Thu, 29 Dec 2016 08:25:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT8P065088300; Thu, 29 Dec 2016 08:25:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290825.uBT8P065088300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 08:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310764 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 08:25:02 -0000 Author: arybchik Date: Thu Dec 29 08:25:00 2016 New Revision: 310764 URL: https://svnweb.freebsd.org/changeset/base/310764 Log: sfxge(4): sync up tlv_layout.h (from firmwaresrc 82cd8a5715e9) Submitted by: Matthew Slattery Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Dec 29 08:16:43 2016 (r310763) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Dec 29 08:25:00 2016 (r310764) @@ -432,6 +432,7 @@ struct tlv_firmware_options { #define TLV_FIRMWARE_VARIANT_HIGH_TX_RATE MC_CMD_FW_HIGH_TX_RATE #define TLV_FIRMWARE_VARIANT_PACKED_STREAM_HASH_MODE_1 \ MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 +#define TLV_FIRMWARE_VARIANT_RULES_ENGINE MC_CMD_FW_RULES_ENGINE }; /* Voltage settings @@ -797,20 +798,6 @@ struct tlv_tx_event_merging_config { #define TLV_TX_EVENT_MERGING_TIMEOUT_NS_DEFAULT (0xffffffff) #define TLV_TX_EVENT_MERGING_QEMPTY_TIMEOUT_NS_DEFAULT (0xffffffff) -/* Tx vFIFO Low latency configuration - * - * To keep the desired booting behaviour for the switch, it just requires to - * know if the low latency mode is enabled. - */ - -#define TLV_TAG_TX_VFIFO_ULL_MODE (0x10270000) -struct tlv_tx_vfifo_ull_mode { - uint32_t tag; - uint32_t length; - uint8_t mode; -#define TLV_TX_VFIFO_ULL_MODE_DEFAULT 0 -}; - /* BIU mode * * Medford2 tag for selecting VI window decode (see values below) @@ -856,8 +843,8 @@ typedef struct tlv_tsan_config { uint32_t netmask; uint32_t gateway; uint32_t port; - uint32_t bind_retry; - uint32_t bind_bkout; + uint32_t bind_retry; /* DEPRECATED */ + uint32_t bind_bkout; /* DEPRECATED */ } tlv_tsan_config_t; /* TSA Controller IP address configuration @@ -898,7 +885,7 @@ typedef struct tlv_binding_ticket { uint8_t bytes[]; } tlv_binding_ticket_t; -/* Solarflare private key +/* Solarflare private key (DEPRECATED) * * Sets the Solareflare private key used for signing during the binding process * @@ -907,7 +894,7 @@ typedef struct tlv_binding_ticket { * released code yet. */ -#define TLV_TAG_TMP_PIK_SF (0x10250000) +#define TLV_TAG_TMP_PIK_SF (0x10250000) /* DEPRECATED */ typedef struct tlv_pik_sf { uint32_t tag; @@ -933,4 +920,18 @@ typedef struct tlv_ca_root_cert { uint8_t bytes[]; } tlv_ca_root_cert_t; +/* Tx vFIFO Low latency configuration + * + * To keep the desired booting behaviour for the switch, it just requires to + * know if the low latency mode is enabled. + */ + +#define TLV_TAG_TX_VFIFO_ULL_MODE (0x10270000) +struct tlv_tx_vfifo_ull_mode { + uint32_t tag; + uint32_t length; + uint8_t mode; +#define TLV_TX_VFIFO_ULL_MODE_DEFAULT 0 +}; + #endif /* CI_MGMT_TLV_LAYOUT_H */ From owner-svn-src-all@freebsd.org Thu Dec 29 08:28:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 093E3C95EA5; Thu, 29 Dec 2016 08:28:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC5501F9A; Thu, 29 Dec 2016 08:28:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT8SiLn088587; Thu, 29 Dec 2016 08:28:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT8Shd6088578; Thu, 29 Dec 2016 08:28:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290828.uBT8Shd6088578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 08:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310765 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 08:28:45 -0000 Author: arybchik Date: Thu Dec 29 08:28:42 2016 New Revision: 310765 URL: https://svnweb.freebsd.org/changeset/base/310765 Log: sfxge(4): add support for firmware-verified NVRAM updates to the common code Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8942 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Dec 29 08:28:42 2016 (r310765) @@ -384,7 +384,7 @@ ef10_nvram_partn_lock( __in efx_nic_t *enp, __in uint32_t partn); -extern void +extern __checkReturn efx_rc_t ef10_nvram_partn_unlock( __in efx_nic_t *enp, __in uint32_t partn); @@ -451,7 +451,7 @@ ef10_nvram_partn_write( __out_bcount(size) caddr_t data, __in size_t size); -extern void +extern __checkReturn efx_rc_t ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, __in uint32_t partn); Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Dec 29 08:28:42 2016 (r310765) @@ -1105,6 +1105,18 @@ ef10_get_datapath_caps( encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; + /* + * Check if firmware-verified NVRAM updates must be used. + * + * The firmware trusted installer requires all NVRAM updates to use + * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) + * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated + * partition and report the result). + */ + encp->enc_fw_verified_nvram_update_required = + CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? + B_TRUE : B_FALSE; + #undef CAP_FLAG #undef CAP_FLAG2 Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/ef10_nvram.c Thu Dec 29 08:28:42 2016 (r310765) @@ -2046,22 +2046,26 @@ fail1: return (rc); } - void + __checkReturn efx_rc_t ef10_nvram_partn_unlock( __in efx_nic_t *enp, __in uint32_t partn) { - boolean_t reboot; + boolean_t reboot = B_FALSE; + uint32_t result = 0; /* FIXME: MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */ efx_rc_t rc; - reboot = B_FALSE; - if ((rc = efx_mcdi_nvram_update_finish(enp, partn, reboot)) != 0) + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, &result); + if (rc != 0) goto fail1; - return; + return (0); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + + /* FIXME: log result if verified firmware update fails */ + return (rc); } __checkReturn efx_rc_t @@ -2359,12 +2363,22 @@ fail1: return (rc); } - void + __checkReturn efx_rc_t ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, __in uint32_t partn) { - ef10_nvram_partn_unlock(enp, partn); + efx_rc_t rc; + + if ((rc = ef10_nvram_partn_unlock(enp, partn)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 08:28:42 2016 (r310765) @@ -1183,6 +1183,8 @@ typedef struct efx_nic_cfg_s { /* Minimum unidirectional bandwidth in Mb/s to max out all ports */ uint32_t enc_required_pcie_bandwidth_mbps; uint32_t enc_max_pcie_link_gen; + /* Firmware verifies integrity of NVRAM updates */ + uint32_t enc_fw_verified_nvram_update_required; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) @@ -1366,7 +1368,7 @@ efx_nvram_rw_start( __in efx_nvram_type_t type, __out_opt size_t *pref_chunkp); -extern void +extern __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, __in efx_nvram_type_t type); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Dec 29 08:28:42 2016 (r310765) @@ -453,7 +453,7 @@ typedef struct efx_nvram_ops_s { unsigned int, size_t); efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); - void (*envo_partn_rw_finish)(efx_nic_t *, uint32_t); + efx_rc_t (*envo_partn_rw_finish)(efx_nic_t *, uint32_t); efx_rc_t (*envo_partn_get_version)(efx_nic_t *, uint32_t, uint32_t *, uint16_t *); efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t, @@ -541,7 +541,8 @@ efx_mcdi_nvram_write( efx_mcdi_nvram_update_finish( __in efx_nic_t *enp, __in uint32_t partn, - __in boolean_t reboot); + __in boolean_t reboot, + __out_opt uint32_t *resultp); #if EFSYS_OPT_DIAG Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/efx_nvram.c Thu Dec 29 08:28:42 2016 (r310765) @@ -362,13 +362,14 @@ fail1: return (rc); } - void + __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, __in efx_nvram_type_t type) { const efx_nvram_ops_t *envop = enp->en_envop; uint32_t partn; + efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); @@ -378,10 +379,24 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if (envop->envo_type_to_partn(enp, type, &partn) == 0) - envop->envo_partn_rw_finish(enp, partn); + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) + goto fail1; + + if ((rc = envop->envo_partn_rw_finish(enp, partn)) != 0) + goto fail2; + + enp->en_nvram_locked = EFX_NVRAM_INVALID; + + return (0); +fail2: + EFSYS_PROBE(fail2); enp->en_nvram_locked = EFX_NVRAM_INVALID; + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } __checkReturn efx_rc_t @@ -696,12 +711,16 @@ fail1: return (rc); } +/* + * MC_CMD_NVRAM_UPDATE_START_V2 must be used to support firmware-verified + * NVRAM updates. Older firmware will ignore the flags field in the request. + */ __checkReturn efx_rc_t efx_mcdi_nvram_update_start( __in efx_nic_t *enp, __in uint32_t partn) { - uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_START_IN_LEN, + uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_START_V2_IN_LEN, MC_CMD_NVRAM_UPDATE_START_OUT_LEN)]; efx_mcdi_req_t req; efx_rc_t rc; @@ -709,11 +728,14 @@ efx_mcdi_nvram_update_start( (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_NVRAM_UPDATE_START; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_NVRAM_UPDATE_START_IN_LEN; + req.emr_in_length = MC_CMD_NVRAM_UPDATE_START_V2_IN_LEN; req.emr_out_buf = payload; req.emr_out_length = MC_CMD_NVRAM_UPDATE_START_OUT_LEN; - MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_START_IN_TYPE, partn); + MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_START_V2_IN_TYPE, partn); + + MCDI_IN_POPULATE_DWORD_1(req, NVRAM_UPDATE_START_V2_IN_FLAGS, + NVRAM_UPDATE_START_V2_IN_FLAG_REPORT_VERIFY_RESULT, 1); efx_mcdi_execute(enp, &req); @@ -886,26 +908,37 @@ fail1: return (rc); } + +/* + * MC_CMD_NVRAM_UPDATE_FINISH_V2 must be used to support firmware-verified + * NVRAM updates. Older firmware will ignore the flags field in the request. + */ __checkReturn efx_rc_t efx_mcdi_nvram_update_finish( __in efx_nic_t *enp, __in uint32_t partn, - __in boolean_t reboot) + __in boolean_t reboot, + __out_opt uint32_t *resultp) { + const efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN, - MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN, + MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)]; + uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */ efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_NVRAM_UPDATE_FINISH; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN; + req.emr_in_length = MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN; + req.emr_out_length = MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN; - MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_IN_TYPE, partn); - MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_IN_REBOOT, reboot); + MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_V2_IN_TYPE, partn); + MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_V2_IN_REBOOT, reboot); + + MCDI_IN_POPULATE_DWORD_1(req, NVRAM_UPDATE_FINISH_V2_IN_FLAGS, + NVRAM_UPDATE_FINISH_V2_IN_FLAG_REPORT_VERIFY_RESULT, 1); efx_mcdi_execute(enp, &req); @@ -914,11 +947,42 @@ efx_mcdi_nvram_update_finish( goto fail1; } + if (encp->enc_fw_verified_nvram_update_required == B_FALSE) { + /* Report success if verified updates are not supported. */ + result = MC_CMD_NVRAM_VERIFY_RC_SUCCESS; + } else { + /* Firmware-verified NVRAM updates are required */ + if (req.emr_out_length_used < + MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + result = + MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE); + + if (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS) { + /* Mandatory verification failed */ + rc = EINVAL; + goto fail3; + } + } + + if (resultp != NULL) + *resultp = result; + return (0); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* Always report verification result */ + if (resultp != NULL) + *resultp = result; + return (rc); } Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/siena_impl.h Thu Dec 29 08:28:42 2016 (r310765) @@ -136,7 +136,7 @@ siena_nvram_partn_lock( __in efx_nic_t *enp, __in uint32_t partn); -extern void +extern __checkReturn efx_rc_t siena_nvram_partn_unlock( __in efx_nic_t *enp, __in uint32_t partn); @@ -208,7 +208,7 @@ siena_nvram_partn_write( __out_bcount(size) caddr_t data, __in size_t size); -extern void +extern __checkReturn efx_rc_t siena_nvram_partn_rw_finish( __in efx_nic_t *enp, __in uint32_t partn); Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Dec 29 08:28:42 2016 (r310765) @@ -166,6 +166,8 @@ siena_board_cfg( encp->enc_required_pcie_bandwidth_mbps = 2 * 10000; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN2; + encp->enc_fw_verified_nvram_update_required = B_FALSE; + return (0); fail2: Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Thu Dec 29 08:25:00 2016 (r310764) +++ head/sys/dev/sfxge/common/siena_nvram.c Thu Dec 29 08:28:42 2016 (r310765) @@ -170,7 +170,7 @@ fail1: return (rc); } - void + __checkReturn efx_rc_t siena_nvram_partn_unlock( __in efx_nic_t *enp, __in uint32_t partn) @@ -186,14 +186,16 @@ siena_nvram_partn_unlock( partn == MC_CMD_NVRAM_TYPE_PHY_PORT1 || partn == MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO); - if ((rc = efx_mcdi_nvram_update_finish(enp, partn, reboot)) != 0) { + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, NULL); + if (rc != 0) goto fail1; - } - return; + return (0); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } #endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */ @@ -585,12 +587,22 @@ fail1: return (rc); } - void + __checkReturn efx_rc_t siena_nvram_partn_rw_finish( __in efx_nic_t *enp, __in uint32_t partn) { - siena_nvram_partn_unlock(enp, partn); + efx_rc_t rc; + + if ((rc = siena_nvram_partn_unlock(enp, partn)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } __checkReturn efx_rc_t From owner-svn-src-all@freebsd.org Thu Dec 29 08:34:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28DE8C960B2; Thu, 29 Dec 2016 08:34:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF34B13D7; Thu, 29 Dec 2016 08:34:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT8YpS1092349; Thu, 29 Dec 2016 08:34:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT8YpeX092348; Thu, 29 Dec 2016 08:34:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612290834.uBT8YpeX092348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Dec 2016 08:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310766 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 08:34:52 -0000 Author: mjg Date: Thu Dec 29 08:34:50 2016 New Revision: 310766 URL: https://svnweb.freebsd.org/changeset/base/310766 Log: cache: drop the NULL check from VP2VNODELOCK Now that negative entries are annotated with a dedicated flag, NULL vnodes are no longer passed. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Dec 29 08:28:42 2016 (r310765) +++ head/sys/kern/vfs_cache.c Thu Dec 29 08:34:50 2016 (r310766) @@ -260,12 +260,8 @@ static struct mtx *vnodelocks; static inline struct mtx * VP2VNODELOCK(struct vnode *vp) { - struct mtx *vlp; - if (vp == NULL) - return (NULL); - vlp = &vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]; - return (vlp); + return (&vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]); } /* @@ -1373,10 +1369,9 @@ cache_lock_vnodes_cel_3(struct celocksta cache_assert_vlp_locked(cel->vlp[0]); cache_assert_vlp_locked(cel->vlp[1]); MPASS(cel->vlp[2] == NULL); + MPASS(vp != NULL); vlp = VP2VNODELOCK(vp); - MPASS(vlp != NULL); - ret = true; if (vlp >= cel->vlp[1]) { mtx_lock(vlp); From owner-svn-src-all@freebsd.org Thu Dec 29 08:41:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7813BC9632D; Thu, 29 Dec 2016 08:41:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3909318E9; Thu, 29 Dec 2016 08:41:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT8fPtK095539; Thu, 29 Dec 2016 08:41:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT8fPfc095538; Thu, 29 Dec 2016 08:41:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612290841.uBT8fPfc095538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Dec 2016 08:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310767 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 08:41:26 -0000 Author: mjg Date: Thu Dec 29 08:41:25 2016 New Revision: 310767 URL: https://svnweb.freebsd.org/changeset/base/310767 Log: cache: depessimize hashing macros/inlines All hash sizes are power-of-2, but the compiler does not know that for sure and 'foo % size' forces doing a division. Store the size - 1 and use 'foo & hash' instead which allows mere shift. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Dec 29 08:34:50 2016 (r310766) +++ head/sys/kern/vfs_cache.c Thu Dec 29 08:41:25 2016 (r310767) @@ -242,26 +242,29 @@ static struct neglist ncneg_hot; static int shrink_list_turn; -static u_int numneglists; +#define numneglists (ncneghash + 1) +static u_int ncneghash; static inline struct neglist * NCP2NEGLIST(struct namecache *ncp) { - return (&neglists[(((uintptr_t)(ncp) >> 8) % numneglists)]); + return (&neglists[(((uintptr_t)(ncp) >> 8) & ncneghash)]); } -static u_int numbucketlocks; +#define numbucketlocks (ncbuckethash + 1) +static u_int ncbuckethash; static struct rwlock_padalign *bucketlocks; #define HASH2BUCKETLOCK(hash) \ - ((struct rwlock *)(&bucketlocks[((hash) % numbucketlocks)])) + ((struct rwlock *)(&bucketlocks[((hash) & ncbuckethash)])) -static u_int numvnodelocks; +#define numvnodelocks (ncvnodehash + 1) +static u_int ncvnodehash; static struct mtx *vnodelocks; static inline struct mtx * VP2VNODELOCK(struct vnode *vp) { - return (&vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]); + return (&vnodelocks[(((uintptr_t)(vp) >> 8) & ncvnodehash)]); } /* @@ -1369,9 +1372,10 @@ cache_lock_vnodes_cel_3(struct celocksta cache_assert_vlp_locked(cel->vlp[0]); cache_assert_vlp_locked(cel->vlp[1]); MPASS(cel->vlp[2] == NULL); - MPASS(vp != NULL); + MPASS(vp != NULL); vlp = VP2VNODELOCK(vp); + ret = true; if (vlp >= cel->vlp[1]) { mtx_lock(vlp); @@ -1774,21 +1778,21 @@ nchinit(void *dummy __unused) NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); - numbucketlocks = cache_roundup_2(mp_ncpus * 64); - if (numbucketlocks > nchash + 1) - numbucketlocks = nchash + 1; + ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1; + if (ncbuckethash > nchash) + ncbuckethash = nchash; bucketlocks = malloc(sizeof(*bucketlocks) * numbucketlocks, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numbucketlocks; i++) rw_init_flags(&bucketlocks[i], "ncbuc", RW_DUPOK | RW_RECURSE); - numvnodelocks = cache_roundup_2(mp_ncpus * 64); + ncvnodehash = cache_roundup_2(mp_ncpus * 64) - 1; vnodelocks = malloc(sizeof(*vnodelocks) * numvnodelocks, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numvnodelocks; i++) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); ncpurgeminvnodes = numbucketlocks; - numneglists = 4; + ncneghash = 3; neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numneglists; i++) { From owner-svn-src-all@freebsd.org Thu Dec 29 09:02:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB127C96B38; Thu, 29 Dec 2016 09:02:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4CD17B0; Thu, 29 Dec 2016 09:02:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT92nxm004741; Thu, 29 Dec 2016 09:02:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT92nTM004737; Thu, 29 Dec 2016 09:02:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290902.uBT92nTM004737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 09:02: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: r310768 - in stable/10/sys/dev/hyperv: netvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 09:02:51 -0000 Author: sephe Date: Thu Dec 29 09:02:49 2016 New Revision: 310768 URL: https://svnweb.freebsd.org/changeset/base/310768 Log: MFC 309310,309311,309316,309318 309310 hyperv/hn: Nuke the unused TX taskqueue CPU binding tunable. It was an experimental tunable, and is now deemed to be road blocker for further changes. Time to retire it. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8654 309311 hyperv/hn: Allow multiple TX taskqueues. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8655 309316 hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8658 309318 hyperv/hn: Allow TX to share event taskqueues. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8659 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/vmbus/vmbus.c stable/10/sys/dev/hyperv/vmbus/vmbus_if.m Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 08:41:25 2016 (r310767) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 29 09:02:49 2016 (r310768) @@ -172,6 +172,8 @@ do { \ #define HN_PKTSIZE(m, align) \ roundup2((m)->m_pkthdr.len + HN_RNDIS_PKT_LEN, (align)) +#define HN_RING_IDX2CPU(sc, idx) (((sc)->hn_cpu + (idx)) % mp_ncpus) + struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; @@ -414,10 +416,18 @@ SYSCTL_INT(_hw_hn, OID_AUTO, lro_entry_c #endif #endif -/* Use shared TX taskqueue */ -static int hn_share_tx_taskq = 0; -SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_taskq, CTLFLAG_RDTUN, - &hn_share_tx_taskq, 0, "Enable shared TX taskqueue"); +static int hn_tx_taskq_cnt = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_cnt, CTLFLAG_RDTUN, + &hn_tx_taskq_cnt, 0, "# of TX taskqueues"); + +#define HN_TX_TASKQ_M_INDEP 0 +#define HN_TX_TASKQ_M_GLOBAL 1 +#define HN_TX_TASKQ_M_EVTTQ 2 + +static int hn_tx_taskq_mode = HN_TX_TASKQ_M_INDEP; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_mode, CTLFLAG_RDTUN, + &hn_tx_taskq_mode, 0, "TX taskqueue modes: " + "0 - independent, 1 - share global tx taskqs, 2 - share event taskqs"); #ifndef HN_USE_TXDESC_BUFRING static int hn_use_txdesc_bufring = 0; @@ -427,11 +437,6 @@ static int hn_use_txdesc_bufring = 1; SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD, &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors"); -/* Bind TX taskqueue to the target CPU */ -static int hn_bind_tx_taskq = -1; -SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, - &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); - #ifdef HN_IFSTART_SUPPORT /* Use ifnet.if_start instead of ifnet.if_transmit */ static int hn_use_if_start = 0; @@ -473,7 +478,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); static u_int hn_cpu_index; /* next CPU for channel */ -static struct taskqueue *hn_tx_taskq; /* shared TX taskqueue */ +static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { @@ -883,19 +888,6 @@ hn_probe(device_t dev) return ENXIO; } -static void -hn_cpuset_setthread_task(void *xmask, int pending __unused) -{ - cpuset_t *mask = xmask; - int error; - - error = cpuset_setthread(curthread->td_tid, mask); - if (error) { - panic("curthread=%ju: can't pin; error=%d", - (uintmax_t)curthread->td_tid, error); - } -} - static int hn_attach(device_t dev) { @@ -919,26 +911,21 @@ hn_attach(device_t dev) /* * Setup taskqueue for transmission. */ - if (hn_tx_taskq == NULL) { - sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &sc->hn_tx_taskq); - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", - device_get_nameunit(dev)); - if (hn_bind_tx_taskq >= 0) { - int cpu = hn_bind_tx_taskq; - struct task cpuset_task; - cpuset_t cpu_set; - - if (cpu > mp_ncpus - 1) - cpu = mp_ncpus - 1; - CPU_SETOF(cpu, &cpu_set); - TASK_INIT(&cpuset_task, 0, hn_cpuset_setthread_task, - &cpu_set); - taskqueue_enqueue(sc->hn_tx_taskq, &cpuset_task); - taskqueue_drain(sc->hn_tx_taskq, &cpuset_task); + if (hn_tx_taskq_mode == HN_TX_TASKQ_M_INDEP) { + int i; + + sc->hn_tx_taskqs = + malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), + M_DEVBUF, M_WAITOK); + for (i = 0; i < hn_tx_taskq_cnt; ++i) { + sc->hn_tx_taskqs[i] = taskqueue_create("hn_tx", + M_WAITOK, taskqueue_thread_enqueue, + &sc->hn_tx_taskqs[i]); + taskqueue_start_threads(&sc->hn_tx_taskqs[i], 1, PI_NET, + "%s tx%d", device_get_nameunit(dev), i); } - } else { - sc->hn_tx_taskq = hn_tx_taskq; + } else if (hn_tx_taskq_mode == HN_TX_TASKQ_M_GLOBAL) { + sc->hn_tx_taskqs = hn_tx_taskque; } /* @@ -1243,8 +1230,13 @@ hn_detach(device_t dev) hn_destroy_rx_data(sc); hn_destroy_tx_data(sc); - if (sc->hn_tx_taskq != hn_tx_taskq) - taskqueue_free(sc->hn_tx_taskq); + if (sc->hn_tx_taskqs != NULL && sc->hn_tx_taskqs != hn_tx_taskque) { + int i; + + for (i = 0; i < hn_tx_taskq_cnt; ++i) + taskqueue_free(sc->hn_tx_taskqs[i]); + free(sc->hn_tx_taskqs, M_DEVBUF); + } taskqueue_free(sc->hn_mgmt_taskq0); if (sc->hn_xact != NULL) { @@ -3338,7 +3330,12 @@ hn_tx_ring_create(struct hn_softc *sc, i M_WAITOK, &txr->hn_tx_lock); #endif - txr->hn_tx_taskq = sc->hn_tx_taskq; + if (hn_tx_taskq_mode == HN_TX_TASKQ_M_EVTTQ) { + txr->hn_tx_taskq = VMBUS_GET_EVENT_TASKQ( + device_get_parent(dev), dev, HN_RING_IDX2CPU(sc, id)); + } else { + txr->hn_tx_taskq = sc->hn_tx_taskqs[id % hn_tx_taskq_cnt]; + } #ifdef HN_IFSTART_SUPPORT if (hn_use_if_start) { @@ -4231,7 +4228,7 @@ hn_chan_attach(struct hn_softc *sc, stru } /* Bind this channel to a proper CPU. */ - vmbus_chan_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus); + vmbus_chan_cpu_set(chan, HN_RING_IDX2CPU(sc, idx)); /* * Open this channel @@ -5377,27 +5374,42 @@ hn_chan_callback(struct vmbus_channel *c static void hn_tx_taskq_create(void *arg __unused) { + int i; + + /* + * Fix the # of TX taskqueues. + */ + if (hn_tx_taskq_cnt <= 0) + hn_tx_taskq_cnt = 1; + else if (hn_tx_taskq_cnt > mp_ncpus) + hn_tx_taskq_cnt = mp_ncpus; + + /* + * Fix the TX taskqueue mode. + */ + switch (hn_tx_taskq_mode) { + case HN_TX_TASKQ_M_INDEP: + case HN_TX_TASKQ_M_GLOBAL: + case HN_TX_TASKQ_M_EVTTQ: + break; + default: + hn_tx_taskq_mode = HN_TX_TASKQ_M_INDEP; + break; + } if (vm_guest != VM_GUEST_HV) return; - if (!hn_share_tx_taskq) + if (hn_tx_taskq_mode != HN_TX_TASKQ_M_GLOBAL) return; - hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &hn_tx_taskq); - taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); - if (hn_bind_tx_taskq >= 0) { - int cpu = hn_bind_tx_taskq; - struct task cpuset_task; - cpuset_t cpu_set; - - if (cpu > mp_ncpus - 1) - cpu = mp_ncpus - 1; - CPU_SETOF(cpu, &cpu_set); - TASK_INIT(&cpuset_task, 0, hn_cpuset_setthread_task, &cpu_set); - taskqueue_enqueue(hn_tx_taskq, &cpuset_task); - taskqueue_drain(hn_tx_taskq, &cpuset_task); + hn_tx_taskque = malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), + M_DEVBUF, M_WAITOK); + for (i = 0; i < hn_tx_taskq_cnt; ++i) { + hn_tx_taskque[i] = taskqueue_create("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &hn_tx_taskque[i]); + taskqueue_start_threads(&hn_tx_taskque[i], 1, PI_NET, + "hn tx%d", i); } } SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, @@ -5407,8 +5419,13 @@ static void hn_tx_taskq_destroy(void *arg __unused) { - if (hn_tx_taskq != NULL) - taskqueue_free(hn_tx_taskq); + if (hn_tx_taskque != NULL) { + int i; + + for (i = 0; i < hn_tx_taskq_cnt; ++i) + taskqueue_free(hn_tx_taskque[i]); + free(hn_tx_taskque, M_DEVBUF); + } } SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_tx_taskq_destroy, NULL); Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 08:41:25 2016 (r310767) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Dec 29 09:02:49 2016 (r310768) @@ -193,7 +193,7 @@ struct hn_softc { int hn_chim_szmax; int hn_cpu; - struct taskqueue *hn_tx_taskq; + struct taskqueue **hn_tx_taskqs; struct sysctl_oid *hn_tx_sysctl_tree; struct sysctl_oid *hn_rx_sysctl_tree; struct vmbus_xact_ctx *hn_xact; Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus.c Thu Dec 29 08:41:25 2016 (r310767) +++ stable/10/sys/dev/hyperv/vmbus/vmbus.c Thu Dec 29 09:02:49 2016 (r310768) @@ -99,6 +99,8 @@ static int vmbus_probe_guid_method(dev const struct hyperv_guid *); static uint32_t vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu); +static struct taskqueue *vmbus_get_eventtq_method(device_t, device_t, + int); static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); @@ -174,6 +176,7 @@ static device_method_t vmbus_methods[] = DEVMETHOD(vmbus_get_version, vmbus_get_version_method), DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method), + DEVMETHOD(vmbus_get_event_taskq, vmbus_get_eventtq_method), DEVMETHOD_END }; @@ -1208,6 +1211,15 @@ vmbus_get_vcpu_id_method(device_t bus, d return (VMBUS_PCPU_GET(sc, vcpuid, cpu)); } +static struct taskqueue * +vmbus_get_eventtq_method(device_t bus, device_t dev __unused, int cpu) +{ + const struct vmbus_softc *sc = device_get_softc(bus); + + KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu%d", cpu)); + return (VMBUS_PCPU_GET(sc, event_tq, cpu)); +} + #ifdef NEW_PCIB #define VTPM_BASE_ADDR 0xfed40000 #define FOUR_GB (1ULL << 32) Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_if.m ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_if.m Thu Dec 29 08:41:25 2016 (r310767) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_if.m Thu Dec 29 09:02:49 2016 (r310768) @@ -33,6 +33,7 @@ INTERFACE vmbus; HEADER { struct hyperv_guid; + struct taskqueue; }; METHOD uint32_t get_version { @@ -51,3 +52,9 @@ METHOD uint32_t get_vcpu_id { device_t dev; int cpu; }; + +METHOD struct taskqueue * get_event_taskq { + device_t bus; + device_t dev; + int cpu; +}; From owner-svn-src-all@freebsd.org Thu Dec 29 09:10:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B13AEC96CF0; Thu, 29 Dec 2016 09:10:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BABF1AEA; Thu, 29 Dec 2016 09:10:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT9AbTe005211; Thu, 29 Dec 2016 09:10:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT9AbYK005210; Thu, 29 Dec 2016 09:10:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612290910.uBT9AbYK005210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 29 Dec 2016 09:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310769 - stable/10/sys/dev/hyperv/storvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 09:10:38 -0000 Author: sephe Date: Thu Dec 29 09:10:37 2016 New Revision: 310769 URL: https://svnweb.freebsd.org/changeset/base/310769 Log: MFC 309320,309726,309728 309320 hyperv/storvsc: Don't use timedwait. The timeout is unnecessary. Reviewed by: jhb Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8656 309726 hyperv/storvsc: Fix the SCSI disk attachment issue. On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disks fails to attach. Mainly because those versions of Hyper-V do not set SRB_STATUS properly and deliver junky INQUERY responses. Submitted by: Hongjiang Zhang Reported by: Hongxiong Xian Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8724 309728 hyperv/storvsc: Minor style changes; no functional changes. Reported by: rpokala Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Dec 29 09:02:49 2016 (r310768) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Dec 29 09:10:37 2016 (r310769) @@ -413,13 +413,7 @@ storvsc_send_multichannel_request(struct VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, vstor_packet, VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request); - /* wait for 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - if (ret != 0) { - printf("Storvsc_error: create multi-channel timeout, %d\n", - ret); - return; - } + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) { @@ -486,10 +480,7 @@ hv_storvsc_channel_init(struct storvsc_s if (ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) { @@ -516,11 +507,7 @@ hv_storvsc_channel_init(struct storvsc_s if (ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO) { ret = EINVAL; @@ -555,11 +542,7 @@ hv_storvsc_channel_init(struct storvsc_s if ( ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); /* TODO: Check returned version */ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || @@ -588,11 +571,7 @@ hv_storvsc_channel_init(struct storvsc_s goto cleanup; } - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) @@ -672,12 +651,7 @@ hv_storvsc_host_reset(struct storvsc_sof goto cleanup; } - ret = sema_timedwait(&request->synch_sema, 5 * hz); /* KYS 5 seconds */ - - if (ret) { - goto cleanup; - } - + sema_wait(&request->synch_sema); /* * At this point, all outstanding requests in the adapter @@ -2079,6 +2053,19 @@ create_storvsc_request(union ccb *ccb, s return(0); } +static uint32_t +is_scsi_valid(const struct scsi_inquiry_data *inq_data) +{ + u_int8_t type; + + type = SID_TYPE(inq_data); + if (type == T_NODEVICE) + return (0); + if (SID_QUAL(inq_data) == SID_QUAL_BAD_LU) + return (0); + return (1); +} + /** * @brief completion function before returning to CAM * @@ -2097,6 +2084,7 @@ storvsc_io_done(struct hv_storvsc_reques struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; bus_dma_segment_t *ori_sglist = NULL; int ori_sg_count = 0; + /* destroy bounce buffer if it is used */ if (reqp->bounce_sgl_count) { ori_sglist = (bus_dma_segment_t *)ccb->csio.data_ptr; @@ -2151,6 +2139,7 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; + cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); @@ -2190,32 +2179,47 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status |= CAM_REQ_CMP; } - if (cmd->opcode == INQUIRY) { + if (cmd->opcode == INQUIRY && + vm_srb->srb_status == SRB_STATUS_SUCCESS) { + int resp_xfer_len, resp_buf_len, data_len; + uint8_t *resp_buf = (uint8_t *)csio->data_ptr; struct scsi_inquiry_data *inq_data = (struct scsi_inquiry_data *)csio->data_ptr; - uint8_t *resp_buf = (uint8_t *)csio->data_ptr; - int resp_xfer_len, resp_buf_len, data_len; /* Get the buffer length reported by host */ resp_xfer_len = vm_srb->transfer_len; + /* Get the available buffer length */ resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; data_len = (resp_buf_len < resp_xfer_len) ? resp_buf_len : resp_xfer_len; - if (bootverbose && data_len >= 5) { xpt_print(ccb->ccb_h.path, "storvsc inquiry " "(%d) [%x %x %x %x %x ... ]\n", data_len, resp_buf[0], resp_buf[1], resp_buf[2], resp_buf[3], resp_buf[4]); } - if (vm_srb->srb_status == SRB_STATUS_SUCCESS && - data_len >= SHORT_INQUIRY_LENGTH) { + /* + * XXX: Manually fix the wrong response returned from WS2012 + */ + if (!is_scsi_valid(inq_data) && + (vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8_1 || + vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8 || + vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN7)) { + if (data_len >= 4 && + (resp_buf[2] == 0 || resp_buf[3] == 0)) { + resp_buf[2] = 5; // verion=5 means SPC-3 + resp_buf[3] = 2; // resp fmt must be 2 + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "fix version and resp fmt for 0x%x\n", + vmstor_proto_version); + } + } else if (data_len >= SHORT_INQUIRY_LENGTH) { char vendor[16]; cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), sizeof(vendor)); - /* * XXX: Upgrade SPC2 to SPC3 if host is WIN8 or * WIN2012 R2 in order to support UNMAP feature. From owner-svn-src-all@freebsd.org Thu Dec 29 09:15:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2785C96F00; Thu, 29 Dec 2016 09:15:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71DC910C8; Thu, 29 Dec 2016 09:15:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT9FRdY009233; Thu, 29 Dec 2016 09:15:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT9FRGa009232; Thu, 29 Dec 2016 09:15:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290915.uBT9FRGa009232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 09:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310770 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 09:15:28 -0000 Author: arybchik Date: Thu Dec 29 09:15:27 2016 New Revision: 310770 URL: https://svnweb.freebsd.org/changeset/base/310770 Log: sfxge(4): cleanup: clarify/unify variable name used for put-list length get_count is used for get-list. Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Thu Dec 29 09:10:37 2016 (r310769) +++ head/sys/dev/sfxge/sfxge_tx.c Thu Dec 29 09:15:27 2016 (r310770) @@ -608,7 +608,7 @@ sfxge_tx_qdpl_put_unlocked(struct sfxge_ volatile uintptr_t *putp; uintptr_t old; uintptr_t new; - unsigned old_len; + unsigned int put_count; KASSERT(mbuf->m_nextpkt == NULL, ("mbuf->m_nextpkt != NULL")); @@ -622,14 +622,14 @@ sfxge_tx_qdpl_put_unlocked(struct sfxge_ old = *putp; if (old != 0) { struct mbuf *mp = (struct mbuf *)old; - old_len = mp->m_pkthdr.csum_data; + put_count = mp->m_pkthdr.csum_data; } else - old_len = 0; - if (old_len >= stdp->std_put_max) { + put_count = 0; + if (put_count >= stdp->std_put_max) { atomic_add_long(&txq->put_overflow, 1); return (ENOBUFS); } - mbuf->m_pkthdr.csum_data = old_len + 1; + mbuf->m_pkthdr.csum_data = put_count + 1; mbuf->m_nextpkt = (void *)old; } while (atomic_cmpset_ptr(putp, old, new) == 0); From owner-svn-src-all@freebsd.org Thu Dec 29 09:50:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8F37C94DE1; Thu, 29 Dec 2016 09:50:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 837CD1C00; Thu, 29 Dec 2016 09:50:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT9obo0021597; Thu, 29 Dec 2016 09:50:37 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT9obDO021596; Thu, 29 Dec 2016 09:50:37 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201612290950.uBT9obDO021596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 29 Dec 2016 09:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310771 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 09:50:38 -0000 Author: ae Date: Thu Dec 29 09:50:37 2016 New Revision: 310771 URL: https://svnweb.freebsd.org/changeset/base/310771 Log: MFC r309257: Rework ip_tryforward() to use FIB4 KPI. Modified: stable/11/sys/netinet/ip_fastfwd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_fastfwd.c ============================================================================== --- stable/11/sys/netinet/ip_fastfwd.c Thu Dec 29 09:15:27 2016 (r310770) +++ stable/11/sys/netinet/ip_fastfwd.c Thu Dec 29 09:50:37 2016 (r310771) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -107,40 +108,33 @@ __FBSDID("$FreeBSD$"); #include -static struct sockaddr_in * -ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) +static int +ip_findroute(struct nhop4_basic *pnh, struct in_addr dest, struct mbuf *m) { - struct sockaddr_in *dst; - struct rtentry *rt; + bzero(pnh, sizeof(*pnh)); + if (fib4_lookup_nh_basic(M_GETFIB(m), dest, 0, 0, pnh) != 0) { + IPSTAT_INC(ips_noroute); + IPSTAT_INC(ips_cantforward); + icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); + return (EHOSTUNREACH); + } /* - * Find route to destination. + * Drop blackholed traffic and directed broadcasts. */ - bzero(ro, sizeof(*ro)); - dst = (struct sockaddr_in *)&ro->ro_dst; - dst->sin_family = AF_INET; - dst->sin_len = sizeof(*dst); - dst->sin_addr.s_addr = dest.s_addr; - in_rtalloc_ign(ro, 0, M_GETFIB(m)); - - /* - * Route there and interface still up? - */ - rt = ro->ro_rt; - if (rt && (rt->rt_flags & RTF_UP) && - (rt->rt_ifp->if_flags & IFF_UP) && - (rt->rt_ifp->if_drv_flags & IFF_DRV_RUNNING)) { - if (rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rt->rt_gateway; - } else { - IPSTAT_INC(ips_noroute); + if ((pnh->nh_flags & (NHF_BLACKHOLE | NHF_BROADCAST)) != 0) { + IPSTAT_INC(ips_cantforward); + m_freem(m); + return (EHOSTUNREACH); + } + + if (pnh->nh_flags & NHF_REJECT) { IPSTAT_INC(ips_cantforward); - if (rt) - RTFREE(rt); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - return NULL; + return (EHOSTUNREACH); } - return dst; + + return (0); } /* @@ -155,13 +149,11 @@ ip_tryforward(struct mbuf *m) { struct ip *ip; struct mbuf *m0 = NULL; - struct route ro; - struct sockaddr_in *dst = NULL; - struct ifnet *ifp; + struct nhop4_basic nh; + struct sockaddr_in dst; struct in_addr odest, dest; uint16_t ip_len, ip_off; int error = 0; - int mtu; struct m_tag *fwd_tag = NULL; /* @@ -171,9 +163,6 @@ ip_tryforward(struct mbuf *m) M_ASSERTVALID(m); M_ASSERTPKTHDR(m); - bzero(&ro, sizeof(ro)); - - #ifdef ALTQ /* * Is packet dropped by traffic conditioner? @@ -305,29 +294,17 @@ passin: /* * Find route to destination. */ - if ((dst = ip_findroute(&ro, dest, m)) == NULL) - return NULL; /* icmp unreach already sent */ - ifp = ro.ro_rt->rt_ifp; - - /* - * Immediately drop blackholed traffic, and directed broadcasts - * for either the all-ones or all-zero subnet addresses on - * locally attached networks. - */ - if ((ro.ro_rt->rt_flags & (RTF_BLACKHOLE|RTF_BROADCAST)) != 0) - goto drop; + if (ip_findroute(&nh, dest, m) != 0) + return (NULL); /* icmp unreach already sent */ /* * Step 5: outgoing firewall packet processing */ - - /* - * Run through list of hooks for output packets. - */ if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passout; - if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { + if (pfil_run_hooks(&V_inet_pfil_hook, &m, nh.nh_ifp, PFIL_OUT, NULL) || + m == NULL) { goto drop; } @@ -352,9 +329,7 @@ forwardlocal: * Return packet for processing by ip_input(). */ m->m_flags |= M_FASTFWD_OURS; - if (ro.ro_rt) - RTFREE(ro.ro_rt); - return m; + return (m); } /* * Redo route lookup with new destination address @@ -365,10 +340,8 @@ forwardlocal: m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; } - RTFREE(ro.ro_rt); - if ((dst = ip_findroute(&ro, dest, m)) == NULL) - return NULL; /* icmp unreach already sent */ - ifp = ro.ro_rt->rt_ifp; + if (ip_findroute(&nh, dest, m) != 0) + return (NULL); /* icmp unreach already sent */ } passout: @@ -378,32 +351,15 @@ passout: ip_len = ntohs(ip->ip_len); ip_off = ntohs(ip->ip_off); - /* - * Check if route is dampned (when ARP is unable to resolve) - */ - if ((ro.ro_rt->rt_flags & RTF_REJECT) && - (ro.ro_rt->rt_expire == 0 || time_uptime < ro.ro_rt->rt_expire)) { - icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - goto consumed; - } - - /* - * Check if media link state of interface is not down - */ - if (ifp->if_link_state == LINK_STATE_DOWN) { - icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - goto consumed; - } + bzero(&dst, sizeof(dst)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(dst); + dst.sin_addr = nh.nh_addr; /* * Check if packet fits MTU or if hardware will fragment for us */ - if (ro.ro_rt->rt_mtu) - mtu = min(ro.ro_rt->rt_mtu, ifp->if_mtu); - else - mtu = ifp->if_mtu; - - if (ip_len <= mtu) { + if (ip_len <= nh.nh_mtu) { /* * Avoid confusing lower layers. */ @@ -411,9 +367,9 @@ passout: /* * Send off the packet via outgoing interface */ - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, &ro); + IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, ip, NULL); + error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, + (struct sockaddr *)&dst, NULL); } else { /* * Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery @@ -421,14 +377,15 @@ passout: if (ip_off & IP_DF) { IPSTAT_INC(ips_cantfrag); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - 0, mtu); + 0, nh.nh_mtu); goto consumed; } else { /* * We have to fragment the packet */ m->m_pkthdr.csum_flags |= CSUM_IP; - if (ip_fragment(ip, &m, mtu, ifp->if_hwassist)) + if (ip_fragment(ip, &m, nh.nh_mtu, + nh.nh_ifp->if_hwassist) != 0) goto drop; KASSERT(m != NULL, ("null mbuf and no error")); /* @@ -443,9 +400,11 @@ passout: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, &ro); + IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, + ip, NULL); + /* XXX: we can use cached route here */ + error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, + (struct sockaddr *)&dst, NULL); if (error) break; } while ((m = m0) != NULL); @@ -463,17 +422,13 @@ passout: if (error != 0) IPSTAT_INC(ips_odropped); else { - counter_u64_add(ro.ro_rt->rt_pksent, 1); IPSTAT_INC(ips_forward); IPSTAT_INC(ips_fastforward); } consumed: - RTFREE(ro.ro_rt); return NULL; drop: if (m) m_freem(m); - if (ro.ro_rt) - RTFREE(ro.ro_rt); return NULL; } From owner-svn-src-all@freebsd.org Thu Dec 29 11:25:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2603C96C0C; Thu, 29 Dec 2016 11:25:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 812F21A45; Thu, 29 Dec 2016 11:25:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTBPfUW061658; Thu, 29 Dec 2016 11:25:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTBPfeE061657; Thu, 29 Dec 2016 11:25:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612291125.uBTBPfeE061657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 29 Dec 2016 11:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310772 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 11:25:42 -0000 Author: tuexen Date: Thu Dec 29 11:25:41 2016 New Revision: 310772 URL: https://svnweb.freebsd.org/changeset/base/310772 Log: MFC r310547: Remove a KASSERT which is not always true. In case of the empty queue tp->snd_holes and tcp_sackhole_insert() failing due to memory shortage, tp->snd_holes will be empty. This problem was hit when stress tests where performed by pho. PR: 215513 Reported by: pho Tested by: pho Sponsored by: Netflix, Inc. Modified: stable/11/sys/netinet/tcp_sack.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_sack.c ============================================================================== --- stable/11/sys/netinet/tcp_sack.c Thu Dec 29 09:50:37 2016 (r310771) +++ stable/11/sys/netinet/tcp_sack.c Thu Dec 29 11:25:41 2016 (r310772) @@ -470,9 +470,6 @@ tcp_sack_doack(struct tcpcb *tp, struct tp->snd_fack = sblkp->end; sack_changed = 1; } - /* We must have at least one SACK hole in scoreboard. */ - KASSERT(!TAILQ_EMPTY(&tp->snd_holes), - ("SACK scoreboard must not be empty")); cur = TAILQ_LAST(&tp->snd_holes, sackhole_head); /* Last SACK hole. */ /* * Since the incoming sack blocks are sorted, we can process them From owner-svn-src-all@freebsd.org Thu Dec 29 11:32:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4195FC96E14; Thu, 29 Dec 2016 11:32:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1E451F36; Thu, 29 Dec 2016 11:32:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTBWhW8065604; Thu, 29 Dec 2016 11:32:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTBWgLM065597; Thu, 29 Dec 2016 11:32:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612291132.uBTBWgLM065597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 29 Dec 2016 11:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310773 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 11:32:44 -0000 Author: tuexen Date: Thu Dec 29 11:32:42 2016 New Revision: 310773 URL: https://svnweb.freebsd.org/changeset/base/310773 Log: MFC r310590: Whitespace changes. The toolchain for processing the sources has been updated. No functional change. Modified: stable/11/sys/netinet/sctp_asconf.c stable/11/sys/netinet/sctp_auth.c stable/11/sys/netinet/sctp_auth.h stable/11/sys/netinet/sctp_bsd_addr.c stable/11/sys/netinet/sctp_bsd_addr.h stable/11/sys/netinet/sctp_cc_functions.c stable/11/sys/netinet/sctp_crc32.c stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_indata.h stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_input.h stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_output.h stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctp_pcb.h stable/11/sys/netinet/sctp_ss_functions.c stable/11/sys/netinet/sctp_structs.h stable/11/sys/netinet/sctp_sysctl.c stable/11/sys/netinet/sctp_timer.c stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet/sctputil.c stable/11/sys/netinet/sctputil.h stable/11/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_asconf.c ============================================================================== --- stable/11/sys/netinet/sctp_asconf.c Thu Dec 29 11:25:41 2016 (r310772) +++ stable/11/sys/netinet/sctp_asconf.c Thu Dec 29 11:32:42 2016 (r310773) @@ -97,7 +97,7 @@ sctp_asconf_success_response(uint32_t id } static struct mbuf * -sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * error_tlv, +sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t *error_tlv, uint16_t tlv_length) { struct mbuf *m_reply = NULL; @@ -132,7 +132,7 @@ sctp_asconf_error_response(uint32_t id, return (NULL); } if (error_tlv != NULL) { - tlv = (uint8_t *) (error + 1); + tlv = (uint8_t *)(error + 1); memcpy(tlv, error_tlv, tlv_length); } SCTP_BUF_LEN(m_reply) = aph->ph.param_length; @@ -222,7 +222,7 @@ sctp_process_asconf_add_ip(struct sockad #endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *)aph, aparam_length); return (m_reply); } /* end switch */ @@ -237,7 +237,7 @@ sctp_process_asconf_add_ip(struct sockad /* add the address */ if (bad_address) { m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *)aph, aparam_length); } else if (sctp_add_remote_addr(stcb, sa, &net, stcb->asoc.port, SCTP_DONOT_SETSCOPE, @@ -245,7 +245,7 @@ sctp_process_asconf_add_ip(struct sockad SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *) aph, + SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *)aph, aparam_length); } else { /* notify upper layer */ @@ -367,7 +367,7 @@ sctp_process_asconf_delete_ip(struct soc #endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph, aparam_length); return (m_reply); } @@ -377,7 +377,7 @@ sctp_process_asconf_delete_ip(struct soc /* trying to delete the source address! */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph, + SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *)aph, aparam_length); return (m_reply); } @@ -391,7 +391,7 @@ sctp_process_asconf_delete_ip(struct soc /* what error to reply with?? */ m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_REQUEST_REFUSED, (uint8_t *) aph, + SCTP_CAUSE_REQUEST_REFUSED, (uint8_t *)aph, aparam_length); } else if (response_required) { m_reply = @@ -410,7 +410,7 @@ sctp_process_asconf_delete_ip(struct soc /* only one address in the asoc */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete last IP addr!\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_DELETING_LAST_ADDR, (uint8_t *) aph, + SCTP_CAUSE_DELETING_LAST_ADDR, (uint8_t *)aph, aparam_length); } else { if (response_required) { @@ -492,7 +492,7 @@ sctp_process_asconf_set_primary(struct s #endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph, aparam_length); return (m_reply); } @@ -563,7 +563,7 @@ sctp_process_asconf_set_primary(struct s "process_asconf_set_primary: set primary failed!\n"); /* must have been an invalid address, so report */ m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph, aparam_length); } @@ -658,7 +658,7 @@ sctp_handle_asconf(struct mbuf *m, unsig /* skip the lookup address parameter */ offset += sizeof(struct sctp_asconf_chunk); - p_addr = (struct sctp_ipv6addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), (uint8_t *) & aparam_buf); + p_addr = (struct sctp_ipv6addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), (uint8_t *)&aparam_buf); if (p_addr == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: couldn't get lookup addr!\n"); @@ -668,7 +668,7 @@ sctp_handle_asconf(struct mbuf *m, unsig /* param_length is already validated in process_control... */ offset += ntohs(p_addr->ph.param_length); /* skip lookup addr */ /* get pointer to first asconf param in ASCONF */ - aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *) & aparam_buf); + aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *)&aparam_buf); if (aph == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "Empty ASCONF received?\n"); goto send_reply; @@ -765,7 +765,7 @@ sctp_handle_asconf(struct mbuf *m, unsig /* get pointer to next asconf param */ aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), - (uint8_t *) & aparam_buf); + (uint8_t *)&aparam_buf); if (aph == NULL) { /* can't get an asconf paramhdr */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: can't get asconf param hdr!\n"); @@ -1094,7 +1094,7 @@ sctp_path_check_and_react(struct sctp_tc * NOT corresponding to the current nexthop, the path will * not be changed. */ - SCTP_RTALLOC((sctp_route_t *) & net->ro, + SCTP_RTALLOC((sctp_route_t *)&net->ro, stcb->sctp_ep->def_vrf_id, stcb->sctp_ep->fibnum); if (net->ro.ro_rt == NULL) @@ -1104,7 +1104,7 @@ sctp_path_check_and_react(struct sctp_tc switch (net->ro._l_addr.sa.sa_family) { #ifdef INET case AF_INET: - if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro)) { + if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *)&net->ro)) { changed = 1; } break; @@ -1112,7 +1112,7 @@ sctp_path_check_and_react(struct sctp_tc #ifdef INET6 case AF_INET6: if (sctp_v6src_match_nexthop( - &newifa->address.sin6, (sctp_route_t *) & net->ro)) { + &newifa->address.sin6, (sctp_route_t *)&net->ro)) { changed = 1; } break; @@ -2419,8 +2419,10 @@ sctp_is_addr_pending(struct sctp_tcb *st } } - /* we want to find the sequences which consist of ADD -> DEL -> ADD - * or DEL -> ADD */ + /* + * we want to find the sequences which consist of ADD -> DEL -> ADD + * or DEL -> ADD + */ if (add_cnt > del_cnt || (add_cnt == del_cnt && last_param_type == SCTP_ADD_IP_ADDRESS)) { return (1); @@ -2472,8 +2474,10 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_is_addr_restricted(stcb, sctp_ifa) && (!sctp_is_addr_pending(stcb, sctp_ifa))) continue; - /* found a valid local v4 address to - * use */ + /* + * found a valid local v4 address to + * use + */ if (addr_locked == SCTP_ADDR_NOT_LOCKED) SCTP_IPI_ADDR_RUNLOCK(); return (&sctp_ifa->address.sa); @@ -2490,8 +2494,10 @@ sctp_find_valid_localaddr(struct sctp_tc } sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - /* we skip unspecifed - * addresses */ + /* + * we skip unspecifed + * addresses + */ continue; } if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, @@ -2508,8 +2514,10 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_is_addr_restricted(stcb, sctp_ifa) && (!sctp_is_addr_pending(stcb, sctp_ifa))) continue; - /* found a valid local v6 address to - * use */ + /* + * found a valid local v6 address to + * use + */ if (addr_locked == SCTP_ADDR_NOT_LOCKED) SCTP_IPI_ADDR_RUNLOCK(); return (&sctp_ifa->address.sa); @@ -2777,7 +2785,7 @@ sctp_process_initack_addresses(struct sc /* go through the addresses in the init-ack */ ph = (struct sctp_paramhdr *) sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), - (uint8_t *) & tmp_param); + (uint8_t *)&tmp_param); while (ph != NULL) { ptype = ntohs(ph->param_type); plen = ntohs(ph->param_length); @@ -2791,7 +2799,7 @@ sctp_process_initack_addresses(struct sc a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr6_store); + (uint8_t *)&addr6_store); if (plen != sizeof(struct sctp_ipv6addr_param) || a6p == NULL) { return; @@ -2812,7 +2820,7 @@ sctp_process_initack_addresses(struct sc /* get the entire IPv4 address param */ a4p = (struct sctp_ipv4addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr4_store); + (uint8_t *)&addr4_store); if (plen != sizeof(struct sctp_ipv4addr_param) || a4p == NULL) { return; @@ -2874,7 +2882,7 @@ next_addr: if ((offset + sizeof(struct sctp_paramhdr)) > length) return; ph = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, - sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param); + sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param); } /* while */ } @@ -2925,7 +2933,7 @@ sctp_addr_in_initack(struct mbuf *m, uin } /* go through the addresses in the init-ack */ ph = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, - sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param); + sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param); while (ph != NULL) { ptype = ntohs(ph->param_type); plen = ntohs(ph->param_length); @@ -2941,7 +2949,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr6_store); + (uint8_t *)&addr6_store); if (a6p == NULL) { return (0); } @@ -2971,7 +2979,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a4p = (struct sctp_ipv4addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr4_store); + (uint8_t *)&addr4_store); if (a4p == NULL) { return (0); } @@ -2993,7 +3001,7 @@ sctp_addr_in_initack(struct mbuf *m, uin } ph = (struct sctp_paramhdr *) sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), - (uint8_t *) & tmp_param); + (uint8_t *)&tmp_param); } /* while */ /* not found! */ return (0); Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Thu Dec 29 11:25:41 2016 (r310772) +++ stable/11/sys/netinet/sctp_auth.c Thu Dec 29 11:32:42 2016 (r310773) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); void -sctp_clear_chunklist(sctp_auth_chklist_t * chklist) +sctp_clear_chunklist(sctp_auth_chklist_t *chklist) { bzero(chklist, sizeof(*chklist)); /* chklist->num_chunks = 0; */ @@ -73,14 +73,14 @@ sctp_alloc_chunklist(void) } void -sctp_free_chunklist(sctp_auth_chklist_t * list) +sctp_free_chunklist(sctp_auth_chklist_t *list) { if (list != NULL) SCTP_FREE(list, SCTP_M_AUTH_CL); } sctp_auth_chklist_t * -sctp_copy_chunklist(sctp_auth_chklist_t * list) +sctp_copy_chunklist(sctp_auth_chklist_t *list) { sctp_auth_chklist_t *new_list; @@ -102,7 +102,7 @@ sctp_copy_chunklist(sctp_auth_chklist_t * add a chunk to the required chunks list */ int -sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list) +sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list) { if (list == NULL) return (-1); @@ -128,7 +128,7 @@ sctp_auth_add_chunk(uint8_t chunk, sctp_ * delete a chunk from the required chunks list */ int -sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t * list) +sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t *list) { if (list == NULL) return (-1); @@ -144,7 +144,7 @@ sctp_auth_delete_chunk(uint8_t chunk, sc } size_t -sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list) +sctp_auth_get_chklist_size(const sctp_auth_chklist_t *list) { if (list == NULL) return (0); @@ -157,7 +157,7 @@ sctp_auth_get_chklist_size(const sctp_au * guarantee ptr has space for up to 256 bytes */ int -sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * ptr) +sctp_serialize_auth_chunks(const sctp_auth_chklist_t *list, uint8_t *ptr) { int i, count = 0; @@ -174,7 +174,7 @@ sctp_serialize_auth_chunks(const sctp_au } int -sctp_pack_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * ptr) +sctp_pack_auth_chunks(const sctp_auth_chklist_t *list, uint8_t *ptr) { int i, size = 0; @@ -206,8 +206,8 @@ sctp_pack_auth_chunks(const sctp_auth_ch } int -sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks, - sctp_auth_chklist_t * list) +sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks, + sctp_auth_chklist_t *list) { int i; int size; @@ -257,14 +257,14 @@ sctp_alloc_key(uint32_t keylen) } void -sctp_free_key(sctp_key_t * key) +sctp_free_key(sctp_key_t *key) { if (key != NULL) SCTP_FREE(key, SCTP_M_AUTH_KY); } void -sctp_print_key(sctp_key_t * key, const char *str) +sctp_print_key(sctp_key_t *key, const char *str) { uint32_t i; @@ -283,7 +283,7 @@ sctp_print_key(sctp_key_t * key, const c } void -sctp_show_key(sctp_key_t * key, const char *str) +sctp_show_key(sctp_key_t *key, const char *str) { uint32_t i; @@ -302,7 +302,7 @@ sctp_show_key(sctp_key_t * key, const ch } static uint32_t -sctp_get_keylen(sctp_key_t * key) +sctp_get_keylen(sctp_key_t *key) { if (key != NULL) return (key->keylen); @@ -329,7 +329,7 @@ sctp_generate_random_key(uint32_t keylen } sctp_key_t * -sctp_set_key(uint8_t * key, uint32_t keylen) +sctp_set_key(uint8_t *key, uint32_t keylen) { sctp_key_t *new_key; @@ -349,7 +349,7 @@ sctp_set_key(uint8_t * key, uint32_t key * 0 if key1 = key2 */ static int -sctp_compare_key(sctp_key_t * key1, sctp_key_t * key2) +sctp_compare_key(sctp_key_t *key1, sctp_key_t *key2) { uint32_t maxlen; uint32_t i; @@ -400,7 +400,7 @@ sctp_compare_key(sctp_key_t * key1, sctp * order for concatenation */ sctp_key_t * -sctp_compute_hashkey(sctp_key_t * key1, sctp_key_t * key2, sctp_key_t * shared) +sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key2, sctp_key_t *shared) { uint32_t keylen; sctp_key_t *new_key; @@ -474,7 +474,7 @@ sctp_alloc_sharedkey(void) } void -sctp_free_sharedkey(sctp_sharedkey_t * skey) +sctp_free_sharedkey(sctp_sharedkey_t *skey) { if (skey == NULL) return; @@ -500,7 +500,7 @@ sctp_find_sharedkey(struct sctp_keyhead int sctp_insert_sharedkey(struct sctp_keyhead *shared_keys, - sctp_sharedkey_t * new_skey) + sctp_sharedkey_t *new_skey) { sctp_sharedkey_t *skey; @@ -594,7 +594,7 @@ sctp_auth_key_release(struct sctp_tcb *s } static sctp_sharedkey_t * -sctp_copy_sharedkey(const sctp_sharedkey_t * skey) +sctp_copy_sharedkey(const sctp_sharedkey_t *skey) { sctp_sharedkey_t *new_skey; @@ -652,7 +652,7 @@ sctp_alloc_hmaclist(uint16_t num_hmacs) } void -sctp_free_hmaclist(sctp_hmaclist_t * list) +sctp_free_hmaclist(sctp_hmaclist_t *list) { if (list != NULL) { SCTP_FREE(list, SCTP_M_AUTH_HL); @@ -661,7 +661,7 @@ sctp_free_hmaclist(sctp_hmaclist_t * lis } int -sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id) +sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id) { int i; @@ -689,7 +689,7 @@ sctp_auth_add_hmacid(sctp_hmaclist_t * l } sctp_hmaclist_t * -sctp_copy_hmaclist(sctp_hmaclist_t * list) +sctp_copy_hmaclist(sctp_hmaclist_t *list) { sctp_hmaclist_t *new_list; int i; @@ -727,7 +727,7 @@ sctp_default_supported_hmaclist(void) * find the best HMAC id to use for the peer based on local support */ uint16_t -sctp_negotiate_hmacid(sctp_hmaclist_t * peer, sctp_hmaclist_t * local) +sctp_negotiate_hmacid(sctp_hmaclist_t *peer, sctp_hmaclist_t *local) { int i, j; @@ -754,7 +754,7 @@ sctp_negotiate_hmacid(sctp_hmaclist_t * * caller must guarantee ptr has appropriate space */ int -sctp_serialize_hmaclist(sctp_hmaclist_t * list, uint8_t * ptr) +sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr) { int i; uint16_t hmac_id; @@ -800,7 +800,7 @@ sctp_alloc_authinfo(void) } void -sctp_free_authinfo(sctp_authinfo_t * authinfo) +sctp_free_authinfo(sctp_authinfo_t *authinfo) { if (authinfo == NULL) return; @@ -858,7 +858,7 @@ sctp_get_hmac_block_len(uint16_t hmac_al } static void -sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t * ctx) +sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t *ctx) { switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: @@ -875,8 +875,8 @@ sctp_hmac_init(uint16_t hmac_algo, sctp_ } static void -sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t * ctx, - uint8_t * text, uint32_t textlen) +sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t *ctx, + uint8_t *text, uint32_t textlen) { switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: @@ -893,8 +893,8 @@ sctp_hmac_update(uint16_t hmac_algo, sct } static void -sctp_hmac_final(uint16_t hmac_algo, sctp_hash_context_t * ctx, - uint8_t * digest) +sctp_hmac_final(uint16_t hmac_algo, sctp_hash_context_t *ctx, + uint8_t *digest) { switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: @@ -921,8 +921,8 @@ sctp_hmac_final(uint16_t hmac_algo, sctp * resultant digest. */ uint32_t -sctp_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, uint8_t * digest) +sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, uint8_t *digest) { uint32_t digestlen; uint32_t blocklen; @@ -981,8 +981,8 @@ sctp_hmac(uint16_t hmac_algo, uint8_t * /* mbuf version */ uint32_t -sctp_hmac_m(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - struct mbuf *m, uint32_t m_offset, uint8_t * digest, uint32_t trailer) +sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + struct mbuf *m, uint32_t m_offset, uint8_t *digest, uint32_t trailer) { uint32_t digestlen; uint32_t blocklen; @@ -1029,17 +1029,17 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t sctp_hmac_update(hmac_algo, &ctx, ipad, blocklen); /* find the correct starting mbuf and offset (get start of text) */ m_tmp = m; - while ((m_tmp != NULL) && (m_offset >= (uint32_t) SCTP_BUF_LEN(m_tmp))) { + while ((m_tmp != NULL) && (m_offset >= (uint32_t)SCTP_BUF_LEN(m_tmp))) { m_offset -= SCTP_BUF_LEN(m_tmp); m_tmp = SCTP_BUF_NEXT(m_tmp); } /* now use the rest of the mbuf chain for the text */ while (m_tmp != NULL) { if ((SCTP_BUF_NEXT(m_tmp) == NULL) && trailer) { - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, SCTP_BUF_LEN(m_tmp) - (trailer + m_offset)); } else { - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, SCTP_BUF_LEN(m_tmp) - m_offset); } @@ -1064,9 +1064,9 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t * Returns -1 on error, 0 on success. */ int -sctp_verify_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, - uint8_t * digest, uint32_t digestlen) +sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, + uint8_t *digest, uint32_t digestlen) { uint32_t len; uint8_t temp[SCTP_AUTH_DIGEST_LEN_MAX]; @@ -1097,8 +1097,8 @@ sctp_verify_hmac(uint16_t hmac_algo, uin * the keylen exceeds the HMAC block len). */ uint32_t -sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t * key, uint8_t * text, - uint32_t textlen, uint8_t * digest) +sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, uint8_t *text, + uint32_t textlen, uint8_t *digest) { uint32_t digestlen; uint32_t blocklen; @@ -1132,8 +1132,8 @@ sctp_compute_hmac(uint16_t hmac_algo, sc /* mbuf version */ uint32_t -sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t * key, struct mbuf *m, - uint32_t m_offset, uint8_t * digest) +sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *key, struct mbuf *m, + uint32_t m_offset, uint8_t *digest) { uint32_t digestlen; uint32_t blocklen; @@ -1164,7 +1164,7 @@ sctp_compute_hmac_m(uint16_t hmac_algo, } int -sctp_auth_is_supported_hmac(sctp_hmaclist_t * list, uint16_t id) +sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id) { int i; @@ -1422,7 +1422,7 @@ sctp_auth_get_cookie_params(struct sctp_ length += offset; phdr = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, - sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param); + sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param); while (phdr != NULL) { ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); @@ -1489,7 +1489,7 @@ sctp_auth_get_cookie_params(struct sctp_ if (offset + sizeof(struct sctp_paramhdr) > length) break; phdr = (struct sctp_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), - (uint8_t *) & tmp_param); + (uint8_t *)&tmp_param); } /* concatenate the full random key */ keylen = sizeof(*p_random) + random_len + sizeof(*hmacs) + hmacs_len; @@ -1599,14 +1599,14 @@ sctp_bzero_m(struct mbuf *m, uint32_t m_ /* find the correct starting mbuf and offset (get start position) */ m_tmp = m; - while ((m_tmp != NULL) && (m_offset >= (uint32_t) SCTP_BUF_LEN(m_tmp))) { + while ((m_tmp != NULL) && (m_offset >= (uint32_t)SCTP_BUF_LEN(m_tmp))) { m_offset -= SCTP_BUF_LEN(m_tmp); m_tmp = SCTP_BUF_NEXT(m_tmp); } /* now use the rest of the mbuf chain */ while ((m_tmp != NULL) && (size > 0)) { - data = mtod(m_tmp, uint8_t *) + m_offset; - if (size > (uint32_t) SCTP_BUF_LEN(m_tmp)) { + data = mtod(m_tmp, uint8_t *)+m_offset; + if (size > (uint32_t)SCTP_BUF_LEN(m_tmp)) { bzero(data, SCTP_BUF_LEN(m_tmp)); size -= SCTP_BUF_LEN(m_tmp); } else { Modified: stable/11/sys/netinet/sctp_auth.h ============================================================================== --- stable/11/sys/netinet/sctp_auth.h Thu Dec 29 11:25:41 2016 (r310772) +++ stable/11/sys/netinet/sctp_auth.h Thu Dec 29 11:32:42 2016 (r310773) @@ -51,12 +51,12 @@ __FBSDID("$FreeBSD$"); typedef union sctp_hash_context { SCTP_SHA1_CTX sha1; SCTP_SHA256_CTX sha256; -} sctp_hash_context_t; +} sctp_hash_context_t; typedef struct sctp_key { uint32_t keylen; uint8_t key[]; -} sctp_key_t; +} sctp_key_t; typedef struct sctp_shared_key { LIST_ENTRY(sctp_shared_key) next; @@ -64,7 +64,7 @@ typedef struct sctp_shared_key { uint32_t refcount; /* reference count */ uint16_t keyid; /* shared key ID */ uint8_t deactivated; /* key is deactivated */ -} sctp_sharedkey_t; +} sctp_sharedkey_t; LIST_HEAD(sctp_keyhead, sctp_shared_key); @@ -72,14 +72,14 @@ LIST_HEAD(sctp_keyhead, sctp_shared_key) typedef struct sctp_auth_chklist { uint8_t chunks[256]; uint8_t num_chunks; -} sctp_auth_chklist_t; +} sctp_auth_chklist_t; /* hmac algos supported list */ typedef struct sctp_hmaclist { uint16_t max_algo; /* max algorithms allocated */ uint16_t num_algo; /* num algorithms used */ uint16_t hmac[]; -} sctp_hmaclist_t; +} sctp_hmaclist_t; /* authentication info */ typedef struct sctp_authinformation { @@ -91,7 +91,7 @@ typedef struct sctp_authinformation { uint16_t active_keyid; /* active send keyid */ uint16_t assoc_keyid; /* current send keyid (cached) */ uint16_t recv_keyid; /* last recv keyid (cached) */ -} sctp_authinfo_t; +} sctp_authinfo_t; @@ -106,42 +106,42 @@ typedef struct sctp_authinformation { /* socket option api functions */ extern sctp_auth_chklist_t *sctp_alloc_chunklist(void); -extern void sctp_free_chunklist(sctp_auth_chklist_t * chklist); -extern void sctp_clear_chunklist(sctp_auth_chklist_t * chklist); -extern sctp_auth_chklist_t *sctp_copy_chunklist(sctp_auth_chklist_t * chklist); -extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list); -extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t * list); -extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list); +extern void sctp_free_chunklist(sctp_auth_chklist_t *chklist); +extern void sctp_clear_chunklist(sctp_auth_chklist_t *chklist); +extern sctp_auth_chklist_t *sctp_copy_chunklist(sctp_auth_chklist_t *chklist); +extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list); +extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t *list); +extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t *list); extern int -sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, - uint8_t * ptr); +sctp_serialize_auth_chunks(const sctp_auth_chklist_t *list, + uint8_t *ptr); extern int -sctp_pack_auth_chunks(const sctp_auth_chklist_t * list, - uint8_t * ptr); +sctp_pack_auth_chunks(const sctp_auth_chklist_t *list, + uint8_t *ptr); extern int -sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks, - sctp_auth_chklist_t * list); +sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks, + sctp_auth_chklist_t *list); /* key handling */ extern sctp_key_t *sctp_alloc_key(uint32_t keylen); -extern void sctp_free_key(sctp_key_t * key); -extern void sctp_print_key(sctp_key_t * key, const char *str); -extern void sctp_show_key(sctp_key_t * key, const char *str); +extern void sctp_free_key(sctp_key_t *key); +extern void sctp_print_key(sctp_key_t *key, const char *str); +extern void sctp_show_key(sctp_key_t *key, const char *str); extern sctp_key_t *sctp_generate_random_key(uint32_t keylen); -extern sctp_key_t *sctp_set_key(uint8_t * key, uint32_t keylen); +extern sctp_key_t *sctp_set_key(uint8_t *key, uint32_t keylen); extern sctp_key_t * -sctp_compute_hashkey(sctp_key_t * key1, sctp_key_t * key2, - sctp_key_t * shared); +sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key2, + sctp_key_t *shared); /* shared key handling */ extern sctp_sharedkey_t *sctp_alloc_sharedkey(void); -extern void sctp_free_sharedkey(sctp_sharedkey_t * skey); +extern void sctp_free_sharedkey(sctp_sharedkey_t *skey); extern sctp_sharedkey_t * sctp_find_sharedkey(struct sctp_keyhead *shared_keys, uint16_t key_id); extern int sctp_insert_sharedkey(struct sctp_keyhead *shared_keys, - sctp_sharedkey_t * new_skey); + sctp_sharedkey_t *new_skey); extern int sctp_copy_skeylist(const struct sctp_keyhead *src, struct sctp_keyhead *dest); @@ -155,42 +155,42 @@ sctp_auth_key_release(struct sctp_tcb *s /* hmac list handling */ extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint16_t num_hmacs); -extern void sctp_free_hmaclist(sctp_hmaclist_t * list); -extern int sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id); -extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t * list); +extern void sctp_free_hmaclist(sctp_hmaclist_t *list); +extern int sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id); +extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t *list); extern sctp_hmaclist_t *sctp_default_supported_hmaclist(void); extern uint16_t -sctp_negotiate_hmacid(sctp_hmaclist_t * peer, - sctp_hmaclist_t * local); -extern int sctp_serialize_hmaclist(sctp_hmaclist_t * list, uint8_t * ptr); +sctp_negotiate_hmacid(sctp_hmaclist_t *peer, + sctp_hmaclist_t *local); +extern int sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr); extern int sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs, uint32_t num_hmacs); extern sctp_authinfo_t *sctp_alloc_authinfo(void); -extern void sctp_free_authinfo(sctp_authinfo_t * authinfo); +extern void sctp_free_authinfo(sctp_authinfo_t *authinfo); /* keyed-HMAC functions */ extern uint32_t sctp_get_auth_chunk_len(uint16_t hmac_algo); extern uint32_t sctp_get_hmac_digest_len(uint16_t hmac_algo); extern uint32_t -sctp_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, uint8_t * digest); +sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, uint8_t *digest); extern int -sctp_verify_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - uint8_t * text, uint32_t textlen, uint8_t * digest, uint32_t digestlen); +sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + uint8_t *text, uint32_t textlen, uint8_t *digest, uint32_t digestlen); extern uint32_t -sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t * key, - uint8_t * text, uint32_t textlen, uint8_t * digest); -extern int sctp_auth_is_supported_hmac(sctp_hmaclist_t * list, uint16_t id); +sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, + uint8_t *text, uint32_t textlen, uint8_t *digest); +extern int sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id); /* mbuf versions */ extern uint32_t -sctp_hmac_m(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - struct mbuf *m, uint32_t m_offset, uint8_t * digest, uint32_t trailer); +sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, + struct mbuf *m, uint32_t m_offset, uint8_t *digest, uint32_t trailer); extern uint32_t -sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t * key, - struct mbuf *m, uint32_t m_offset, uint8_t * digest); +sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *key, + struct mbuf *m, uint32_t m_offset, uint8_t *digest); /* * authentication routines @@ -212,7 +212,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, struct sctp_auth_chunk *auth, struct sctp_tcb *stcb, uint16_t key_id); extern struct mbuf * sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end, - struct sctp_auth_chunk **auth_ret, uint32_t * offset, + struct sctp_auth_chunk **auth_ret, uint32_t *offset, struct sctp_tcb *stcb, uint8_t chunk); extern int sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *ch, Modified: stable/11/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/11/sys/netinet/sctp_bsd_addr.c Thu Dec 29 11:25:41 2016 (r310772) +++ stable/11/sys/netinet/sctp_bsd_addr.c Thu Dec 29 11:32:42 2016 (r310773) @@ -477,7 +477,7 @@ again_locked: lenat++; *lenat = value; lenat++; - tick_tock = (uint32_t *) lenat; + tick_tock = (uint32_t *)lenat; lenat++; *tick_tock = sctp_get_tick_count(); copyto = (void *)lenat; @@ -498,7 +498,7 @@ no_log: int -sctp_copy_out_packet_log(uint8_t * target, int length) +sctp_copy_out_packet_log(uint8_t *target, int length) { /* * We wind through the packet log starting at start copying up to Modified: stable/11/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/11/sys/netinet/sctp_bsd_addr.h Thu Dec 29 11:25:41 2016 (r310772) +++ stable/11/sys/netinet/sctp_bsd_addr.h Thu Dec 29 11:32:42 2016 (r310773) @@ -53,7 +53,7 @@ void sctp_gather_internal_ifa_flags(stru #ifdef SCTP_PACKET_LOGGING void sctp_packet_log(struct mbuf *m); -int sctp_copy_out_packet_log(uint8_t * target, int length); +int sctp_copy_out_packet_log(uint8_t *target, int length); #endif Modified: stable/11/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/11/sys/netinet/sctp_cc_functions.c Thu Dec 29 11:25:41 2016 (r310772) +++ stable/11/sys/netinet/sctp_cc_functions.c Thu Dec 29 11:32:42 2016 (r310773) @@ -122,7 +122,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc t_ssthresh += net->ssthresh; t_cwnd += net->cwnd; if (net->lastsa > 0) { - t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) net->lastsa; + t_ucwnd_sbw += (uint64_t)net->cwnd / (uint64_t)net->lastsa; } } if (t_ucwnd_sbw == 0) { @@ -150,27 +150,31 @@ sctp_cwnd_update_after_fr(struct sctp_tc if ((asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) || (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2)) { if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) { - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->ssthresh) / - (uint64_t) t_ssthresh); + net->ssthresh = (uint32_t)(((uint64_t)4 * + (uint64_t)net->mtu * + (uint64_t)net->ssthresh) / + (uint64_t)t_ssthresh); } if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2) { uint32_t srtt; srtt = net->lastsa; - /* lastsa>>3; we don't need - * to devide ... */ + /* + * lastsa>>3; we don't need + * to devide ... + */ if (srtt == 0) { srtt = 1; } - /* Short Version => Equal to - * Contel Version MBe */ - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->cwnd) / - ((uint64_t) srtt * + /* + * Short Version => Equal to + * Contel Version MBe + */ + net->ssthresh = (uint32_t)(((uint64_t)4 * + (uint64_t)net->mtu * + (uint64_t)net->cwnd) / + ((uint64_t)srtt * t_ucwnd_sbw)); /* INCREASE FACTOR */ ; } @@ -249,7 +253,7 @@ cc_bw_same(struct sctp_tcb *stcb, struct { uint64_t oth, probepoint; - probepoint = (((uint64_t) net->cwnd) << 32); + probepoint = (((uint64_t)net->cwnd) << 32); if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { /* * rtt increased we don't update bw.. so we don't update the @@ -385,7 +389,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st uint64_t oth, probepoint; /* Bandwidth decreased. */ - probepoint = (((uint64_t) net->cwnd) << 32); + probepoint = (((uint64_t)net->cwnd) << 32); if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { /* rtt increased */ /* Did we add more */ @@ -401,8 +405,10 @@ cc_bw_decrease(struct sctp_tcb *stcb, st net->flight_size, probepoint); if (net->cc_mod.rtcc.ret_from_eq) { - /* Switch over to CA if we are less - * aggressive */ + /* + * Switch over to CA if we are less + * aggressive + */ net->ssthresh = net->cwnd - 1; net->partial_bytes_acked = 0; } @@ -528,7 +534,7 @@ cc_bw_increase(struct sctp_tcb *stcb, st * attention to the inst_ind since our overall sum is increasing. */ /* PROBE POINT 0 */ - probepoint = (((uint64_t) net->cwnd) << 32); + probepoint = (((uint64_t)net->cwnd) << 32); SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), @@ -610,8 +616,8 @@ cc_bw_limit(struct sctp_tcb *stcb, struc */ bw_shift = SCTP_BASE_SYSCTL(sctp_rttvar_bw); rtt = stcb->asoc.my_vtag; - vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); - probepoint = (((uint64_t) net->cwnd) << 32); + vtag = (rtt << 32) | (((uint32_t)(stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); + probepoint = (((uint64_t)net->cwnd) << 32); rtt = net->rtt; if (net->cc_mod.rtcc.rtt_set_this_sack) { net->cc_mod.rtcc.rtt_set_this_sack = 0; @@ -631,7 +637,7 @@ cc_bw_limit(struct sctp_tcb *stcb, struc probepoint |= ((0xb << 16) | inst_ind); } else { inst_ind = net->cc_mod.rtcc.last_inst_ind; - inst_bw = bytes_for_this_rtt / (uint64_t) (net->rtt); + inst_bw = bytes_for_this_rtt / (uint64_t)(net->rtt); /* Can't determine do not change */ probepoint |= ((0xc << 16) | inst_ind); } @@ -703,11 +709,11 @@ sctp_cwnd_update_after_sack_common(struc if (srtt > 0) { uint64_t tmp; - t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) srtt; - t_path_mptcp += (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_Z) / - (((uint64_t) net->mtu) * (uint64_t) srtt); - tmp = (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_N) / - ((uint64_t) net->mtu * (uint64_t) (srtt * srtt)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 29 11:48:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F07BC9615D; Thu, 29 Dec 2016 11:48:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 080C7159F; Thu, 29 Dec 2016 11:48:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBTBm7uW021544 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 29 Dec 2016 13:48:07 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBTBm7uW021544 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBTBm6xx021543; Thu, 29 Dec 2016 13:48:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Dec 2016 13:48:06 +0200 From: Konstantin Belousov To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r310234 - head/sys/vm Message-ID: <20161229114806.GH1923@kib.kiev.ua> References: <201612182056.uBIKuElT070792@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 11:48:13 -0000 On Wed, Dec 28, 2016 at 07:03:52PM -0800, Adrian Chadd wrote: > hi, > > I've bisected a boot failure on mips24k (carambola2) to this commit. > Nothing useful is printed - it hangs at startup time. What do you mean exactly ? Is copyright notice printed ? Show verbose dmesg of the failing boot. > > Any ideas? No. The patch you picked changes code that is only executed for the shadowed anonymous memory. AFAIK, including mips, there is no shadow chains in the kernel map. Such constructs are only instantiated when user space is operating and forking. Even if such data structure appears in the kernel mappings, vm object code is not initialized until much later in the boot, at vm_init stage. > > > -adrian > > > On 18 December 2016 at 12:56, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Dec 18 20:56:14 2016 > > New Revision: 310234 > > URL: https://svnweb.freebsd.org/changeset/base/310234 > > > > Log: > > Improve vm_object_scan_all_shadowed() to also check swap backing objects. > > > > As noted in the removed comment, it is possible and not prohibitively > > costly to look up the swap blocks for the given page index. Implement > > a swap_pager_find_least() function to do that, and use it to iterate > > simultaneously over both backing object page queue and swap > > allocations when looking for shadowed pages. > > > > Testing shows that number of new succesful scans, enabled by this > > addition, is small but non-zero. When worked out, the change both > > further reduces the depth of the shadow object chain, and frees unused > > but allocated swap and memory. > > > > Suggested and reviewed by: alc > > Tested by: pho (previous version) > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > > > Modified: > > head/sys/vm/swap_pager.c > > head/sys/vm/swap_pager.h > > head/sys/vm/vm_object.c > > > > Modified: head/sys/vm/swap_pager.c > > ============================================================================== > > --- head/sys/vm/swap_pager.c Sun Dec 18 20:40:22 2016 (r310233) > > +++ head/sys/vm/swap_pager.c Sun Dec 18 20:56:14 2016 (r310234) > > @@ -2013,6 +2013,44 @@ swp_pager_meta_ctl(vm_object_t object, v > > } > > > > /* > > + * Returns the least page index which is greater than or equal to the > > + * parameter pindex and for which there is a swap block allocated. > > + * Returns object's size if the object's type is not swap or if there > > + * are no allocated swap blocks for the object after the requested > > + * pindex. > > + */ > > +vm_pindex_t > > +swap_pager_find_least(vm_object_t object, vm_pindex_t pindex) > > +{ > > + struct swblock **pswap, *swap; > > + vm_pindex_t i, j, lim; > > + int idx; > > + > > + VM_OBJECT_ASSERT_LOCKED(object); > > + if (object->type != OBJT_SWAP || object->un_pager.swp.swp_bcount == 0) > > + return (object->size); > > + > > + mtx_lock(&swhash_mtx); > > + for (j = pindex; j < object->size; j = lim) { > > + pswap = swp_pager_hash(object, j); > > + lim = rounddown2(j + SWAP_META_PAGES, SWAP_META_PAGES); > > + if (lim > object->size) > > + lim = object->size; > > + if ((swap = *pswap) != NULL) { > > + for (idx = j & SWAP_META_MASK, i = j; i < lim; > > + i++, idx++) { > > + if (swap->swb_pages[idx] != SWAPBLK_NONE) > > + goto found; > > + } > > + } > > + } > > + i = object->size; > > +found: > > + mtx_unlock(&swhash_mtx); > > + return (i); > > +} > > + > > +/* > > * System call swapon(name) enables swapping on device name, > > * which must be in the swdevsw. Return EBUSY > > * if already swapping on this device. > > > > Modified: head/sys/vm/swap_pager.h > > ============================================================================== > > --- head/sys/vm/swap_pager.h Sun Dec 18 20:40:22 2016 (r310233) > > +++ head/sys/vm/swap_pager.h Sun Dec 18 20:56:14 2016 (r310234) > > @@ -79,6 +79,7 @@ extern int swap_pager_avail; > > struct xswdev; > > int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len); > > void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int); > > +vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex); > > void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t); > > void swap_pager_swap_init(void); > > int swap_pager_isswapped(vm_object_t, struct swdevt *); > > > > Modified: head/sys/vm/vm_object.c > > ============================================================================== > > --- head/sys/vm/vm_object.c Sun Dec 18 20:40:22 2016 (r310233) > > +++ head/sys/vm/vm_object.c Sun Dec 18 20:56:14 2016 (r310234) > > @@ -1436,36 +1436,40 @@ vm_object_scan_all_shadowed(vm_object_t > > { > > vm_object_t backing_object; > > vm_page_t p, pp; > > - vm_pindex_t backing_offset_index, new_pindex; > > + vm_pindex_t backing_offset_index, new_pindex, pi, ps; > > > > VM_OBJECT_ASSERT_WLOCKED(object); > > VM_OBJECT_ASSERT_WLOCKED(object->backing_object); > > > > backing_object = object->backing_object; > > > > - /* > > - * Initial conditions: > > - * > > - * We do not want to have to test for the existence of swap > > - * pages in the backing object. XXX but with the new swapper this > > - * would be pretty easy to do. > > - */ > > - if (backing_object->type != OBJT_DEFAULT) > > + if (backing_object->type != OBJT_DEFAULT && > > + backing_object->type != OBJT_SWAP) > > return (false); > > > > - backing_offset_index = OFF_TO_IDX(object->backing_object_offset); > > + pi = backing_offset_index = OFF_TO_IDX(object->backing_object_offset); > > + p = vm_page_find_least(backing_object, pi); > > + ps = swap_pager_find_least(backing_object, pi); > > > > - for (p = TAILQ_FIRST(&backing_object->memq); p != NULL; > > - p = TAILQ_NEXT(p, listq)) { > > - new_pindex = p->pindex - backing_offset_index; > > + /* > > + * Only check pages inside the parent object's range and > > + * inside the parent object's mapping of the backing object. > > + */ > > + for (;; pi++) { > > + if (p != NULL && p->pindex < pi) > > + p = TAILQ_NEXT(p, listq); > > + if (ps < pi) > > + ps = swap_pager_find_least(backing_object, pi); > > + if (p == NULL && ps >= backing_object->size) > > + break; > > + else if (p == NULL) > > + pi = ps; > > + else > > + pi = MIN(p->pindex, ps); > > > > - /* > > - * Ignore pages outside the parent object's range and outside > > - * the parent object's mapping of the backing object. > > - */ > > - if (p->pindex < backing_offset_index || > > - new_pindex >= object->size) > > - continue; > > + new_pindex = pi - backing_offset_index; > > + if (new_pindex >= object->size) > > + break; > > > > /* > > * See if the parent has the page or if the parent's object > > From owner-svn-src-all@freebsd.org Thu Dec 29 12:01:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9241C93222; Thu, 29 Dec 2016 12:01:55 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8EBD15CE; Thu, 29 Dec 2016 12:01:55 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTC1sQt077799; Thu, 29 Dec 2016 12:01:54 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTC1sdj077798; Thu, 29 Dec 2016 12:01:54 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612291201.uBTC1sdj077798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Dec 2016 12:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310774 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 12:01:56 -0000 Author: mjg Date: Thu Dec 29 12:01:54 2016 New Revision: 310774 URL: https://svnweb.freebsd.org/changeset/base/310774 Log: cache: move shrink lock init to nchinit This gets rid of unnecesary sysinit usage. While here also rename the lock to be consistent with the rest. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Dec 29 11:32:42 2016 (r310773) +++ head/sys/kern/vfs_cache.c Thu Dec 29 12:01:54 2016 (r310774) @@ -229,8 +229,6 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsreq struct nchstats nchstats; /* cache effectiveness statistics */ static struct mtx ncneg_shrink_lock; -MTX_SYSINIT(vfscache_shrink_neg, &ncneg_shrink_lock, "Name Cache shrink neg", - MTX_DEF); struct neglist { struct mtx nl_lock; @@ -1802,6 +1800,8 @@ nchinit(void *dummy __unused) mtx_init(&ncneg_hot.nl_lock, "ncneglh", NULL, MTX_DEF); TAILQ_INIT(&ncneg_hot.nl_list); + mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); + numcalls = counter_u64_alloc(M_WAITOK); dothits = counter_u64_alloc(M_WAITOK); dotdothits = counter_u64_alloc(M_WAITOK); From owner-svn-src-all@freebsd.org Thu Dec 29 12:11:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 463ACC93732; Thu, 29 Dec 2016 12:11:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wj0-x230.google.com (mail-wj0-x230.google.com [IPv6:2a00:1450:400c:c01::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6BD41AD3; Thu, 29 Dec 2016 12:11:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wj0-x230.google.com with SMTP id tq7so119863216wjb.0; Thu, 29 Dec 2016 04:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=PJkmFAzNzwfWdGzAHYk8e3lcPhmApRvBxo1hnw/tbNU=; b=lVB4BY/cR4YxGPqNwjKfHpPnhblfBQACrbA4So17eXbiOwxFptRaVmFyJMWgIi/Uqy cb77+RKOiTHz3QGfmtPn7RoskX43D+ORpL/4TseNKYldX0dASnW2mfUr5/kniVMCpTHY 9zeZX4p7YRwCbDgUcNRHO5z5wj3HJ+jtBEKGVp2y+amOT9wXoyZ6hcn5V0wTyi3rlffc vv8Dyimz64m6tEdsEiuKJJHnkne2zf4hkyl5F03elveMz3SVpN/LVTRul7W9iItFBfQB Q/ti4kHaeAaIOnmCPXuhpnkXDHrcPKmYbHmJaJQmi27XaHjDf7C7TW4EPAUEMYwwt2rV BO6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=PJkmFAzNzwfWdGzAHYk8e3lcPhmApRvBxo1hnw/tbNU=; b=lq5AlTNV41Nnhp9jmJT0GWtH966/jgnEkQrmfVcSRhEr50rNLa+5lmkkFcjUtfSHZ5 82eOzPvFSUUd12Jh7p5AFmmJJvc1xZbVrkJmnuat6RBZmMSS97whYgwMmzGKr/xJ/w5f 0lvUmkW61H67ZCpZAfGEXQpHNnzigzrxw9BdKtiYm3kjzFiOI8dAlLnMu6GdjSurcd9a 3vkNDwu/hnhzZSGKgb1/aNtC/ShyDRFtLY9twZNEaZkMcPmLeKlU9YSErEtFifp6RLxl jEL+9JaftdRcsAN/T1ll+YRmhLCXZy8Q4nxprbtTFqljkke/m9cFeie5glA0IiRtnWKv 7YWg== X-Gm-Message-State: AIkVDXJJDIbqRaLzQfrIqmVAWbSUzvqA6iK+K4g973Kyu2BZdww4otVaE8yYAcZ2wGnlllKJ6jTE9rwoFtcEMg== X-Received: by 10.194.67.67 with SMTP id l3mr39345871wjt.151.1483013466331; Thu, 29 Dec 2016 04:11:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.44.1 with HTTP; Thu, 29 Dec 2016 04:11:05 -0800 (PST) In-Reply-To: <20161229114806.GH1923@kib.kiev.ua> References: <201612182056.uBIKuElT070792@repo.freebsd.org> <20161229114806.GH1923@kib.kiev.ua> From: Adrian Chadd Date: Thu, 29 Dec 2016 04:11:05 -0800 Message-ID: Subject: Re: svn commit: r310234 - head/sys/vm To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 12:11:08 -0000 Hiya, It hung completely. No echoing, no early printf (after I added it), nothing. I dug into it some more and yes, it doesn't seem to be this. Something else is causing the now much larger kernel then before to not boot. Sorry! Thanks for the explanation though! -adrian From owner-svn-src-all@freebsd.org Thu Dec 29 13:27:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D175C893A4; Thu, 29 Dec 2016 13:27:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB2D1A26; Thu, 29 Dec 2016 13:27:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTDR5o2013249; Thu, 29 Dec 2016 13:27:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTDR57Y013247; Thu, 29 Dec 2016 13:27:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612291327.uBTDR57Y013247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 29 Dec 2016 13:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310775 - in head: lib/clang/libllvm usr.bin/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 13:27:06 -0000 Author: dim Date: Thu Dec 29 13:27:04 2016 New Revision: 310775 URL: https://svnweb.freebsd.org/changeset/base/310775 Log: Move llvm-objdump from CLANG_EXTRAS to installed by default We currently install three tools from binutils 2.17.50: as, ld, and objdump. Work is underway to migrate to a permissively-licensed tool-chain, with one goal being the retirement of binutils 2.17.50. LLVM's llvm-objdump is intended to be compatible with GNU objdump although it is currently missing some options and may have formatting differences. Enable it by default for testing and further investigation. It may later be changed to install as /usr/bin/objdump, it becomes a fully viable replacement. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D8879 Modified: head/lib/clang/libllvm/Makefile head/usr.bin/clang/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Thu Dec 29 12:01:54 2016 (r310774) +++ head/lib/clang/libllvm/Makefile Thu Dec 29 13:27:04 2016 (r310775) @@ -308,24 +308,24 @@ SRCS_MIN+= DebugInfo/CodeView/TypeRecord SRCS_MIN+= DebugInfo/CodeView/TypeRecordBuilder.cpp SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp SRCS_MIN+= DebugInfo/CodeView/TypeTableBuilder.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFCompileUnit.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFContext.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAranges.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugFrame.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLine.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLoc.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugMacro.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugRangeList.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFFormValue.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFTypeUnit.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFUnit.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFUnitIndex.cpp -SRCS_EXT+= DebugInfo/DWARF/SyntaxHighlighting.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp +SRCS_MIW+= DebugInfo/DWARF/SyntaxHighlighting.cpp SRCS_EXT+= DebugInfo/PDB/GenericError.cpp SRCS_EXT+= DebugInfo/PDB/PDB.cpp SRCS_EXT+= DebugInfo/PDB/PDBContext.cpp @@ -699,7 +699,7 @@ SRCS_MIN+= Target/AArch64/AArch64TargetO SRCS_MIN+= Target/AArch64/AArch64TargetTransformInfo.cpp SRCS_MIN+= Target/AArch64/AsmParser/AArch64AsmParser.cpp SRCS_XDB+= Target/AArch64/Disassembler/AArch64Disassembler.cpp -SRCS_XDB+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp +SRCS_XDW+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp SRCS_MIN+= Target/AArch64/InstPrinter/AArch64InstPrinter.cpp SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp @@ -880,7 +880,7 @@ SRCS_MIN+= Target/TargetSubtargetInfo.cp SRCS_MIN+= Target/X86/AsmParser/X86AsmInstrumentation.cpp SRCS_MIN+= Target/X86/AsmParser/X86AsmParser.cpp SRCS_XDB+= Target/X86/Disassembler/X86Disassembler.cpp -SRCS_XDB+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp +SRCS_XDW+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp SRCS_MIN+= Target/X86/InstPrinter/X86ATTInstPrinter.cpp SRCS_MIN+= Target/X86/InstPrinter/X86InstComments.cpp SRCS_MIN+= Target/X86/InstPrinter/X86IntelInstPrinter.cpp @@ -1090,6 +1090,9 @@ SRCS_MIN+= Transforms/Vectorize/SLPVecto SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp SRCS_ALL+= ${SRCS_MIN} +.if !defined(TOOLS_PREFIX) +SRCS_ALL+= ${SRCS_MIW} +.endif .if ${MK_CLANG_EXTRAS} != "no" SRCS_ALL+= ${SRCS_EXT} .endif @@ -1105,6 +1108,9 @@ SRCS_ALL+= ${SRCS_XDB} .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no" SRCS_ALL+= ${SRCS_XDL} .endif +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || !defined(TOOLS_PREFIX) +SRCS_ALL+= ${SRCS_XDW} +.endif SRCS+= ${SRCS_ALL:O} llvm/IR/Attributes.inc: ${LLVM_SRCS}/include/llvm/IR/Attributes.td Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Thu Dec 29 12:01:54 2016 (r310774) +++ head/usr.bin/clang/Makefile Thu Dec 29 13:27:04 2016 (r310775) @@ -7,6 +7,8 @@ SUBDIR+= clang-tblgen SUBDIR+= llvm-tblgen .if !defined(TOOLS_PREFIX) +SUBDIR+= llvm-objdump + .if ${MK_CLANG_EXTRAS} != "no" SUBDIR+= bugpoint SUBDIR+= clang-format @@ -25,7 +27,6 @@ SUBDIR+= llvm-link SUBDIR+= llvm-lto SUBDIR+= llvm-mc SUBDIR+= llvm-nm -SUBDIR+= llvm-objdump SUBDIR+= llvm-pdbdump SUBDIR+= llvm-profdata SUBDIR+= llvm-rtdyld From owner-svn-src-all@freebsd.org Thu Dec 29 14:00:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8490FC95066; Thu, 29 Dec 2016 14:00:11 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F3341C31; Thu, 29 Dec 2016 14:00:11 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTE0A04026004; Thu, 29 Dec 2016 14:00:10 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTE0AOX026001; Thu, 29 Dec 2016 14:00:10 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201612291400.uBTE0AOX026001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 29 Dec 2016 14:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310776 - head/sys/mips/ingenic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 14:00:11 -0000 Author: jmcneill Date: Thu Dec 29 14:00:10 2016 New Revision: 310776 URL: https://svnweb.freebsd.org/changeset/base/310776 Log: The JZ4780 I2S can feed either the internal audio codec or the HDMI transmitter, but not both at the same time. This patch: - Adds a dev.pcm.0.internal_codec sysctl node for selecting between internal and external codec - Changes playback sample rate from 96 kHz to 48 kHz for HDMI compatibility - Enables i2s clock on codec access Reviewed by: br Differential Revision: https://reviews.freebsd.org/D8960 Modified: head/sys/mips/ingenic/jz4780_aic.c head/sys/mips/ingenic/jz4780_codec.c head/sys/mips/ingenic/jz4780_codec.h Modified: head/sys/mips/ingenic/jz4780_aic.c ============================================================================== --- head/sys/mips/ingenic/jz4780_aic.c Thu Dec 29 13:27:04 2016 (r310775) +++ head/sys/mips/ingenic/jz4780_aic.c Thu Dec 29 14:00:10 2016 (r310776) @@ -81,6 +81,7 @@ struct aic_softc { void *ih; struct xdma_channel *xchan; xdma_controller_t *xdma_tx; + int internal_codec; }; /* Channel registers */ @@ -120,7 +121,7 @@ struct aic_rate { }; static struct aic_rate rate_map[] = { - { 96000 }, + { 48000 }, /* TODO: add more frequences */ { 0 }, }; @@ -355,7 +356,6 @@ aic_start(struct sc_pcminfo *scp) int reg; sc = scp->sc; - sc->pos = 0; /* Ensure clock enabled. */ reg = READ4(sc, I2SCR); @@ -387,10 +387,6 @@ aic_stop(struct sc_pcminfo *scp) xdma_terminate(sc->xchan); - sc->pos = 0; - - bzero(sc->buf_base, sc->dma_size); - return (0); } @@ -411,6 +407,8 @@ aicchan_trigger(kobj_t obj, void *data, case PCMTRIG_START: ch->run = 1; + sc->pos = 0; + aic_start(scp); break; @@ -421,6 +419,10 @@ aicchan_trigger(kobj_t obj, void *data, aic_stop(scp); + sc->pos = 0; + + bzero(sc->buf_base, sc->dma_size); + break; } @@ -448,7 +450,7 @@ static uint32_t aic_pfmt[] = { 0 }; -static struct pcmchan_caps aic_pcaps = {96000, 96000, aic_pfmt, 0}; +static struct pcmchan_caps aic_pcaps = {48000, 48000, aic_pfmt, 0}; static struct pcmchan_caps * aicchan_getcaps(kobj_t obj, void *data) @@ -583,16 +585,13 @@ aic_configure_clocks(struct aic_softc *s static int aic_configure(struct aic_softc *sc) { - int internal_codec; int reg; - internal_codec = 1; - WRITE4(sc, AICFR, AICFR_RST); /* Configure AIC */ reg = 0; - if (internal_codec) { + if (sc->internal_codec) { reg |= (AICFR_ICDC); } else { reg |= (AICFR_SYNCD | AICFR_BCKD); @@ -610,6 +609,48 @@ aic_configure(struct aic_softc *sc) } static int +sysctl_hw_pcm_internal_codec(SYSCTL_HANDLER_ARGS) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct aic_softc *sc; + int error, val; + + if (arg1 == NULL) + return (EINVAL); + + scp = arg1; + sc = scp->sc; + ch = &scp->chan[0]; + + snd_mtxlock(sc->lock); + + val = sc->internal_codec; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || req->newptr == NULL) { + snd_mtxunlock(sc->lock); + return (error); + } + if (val < 0 || val > 1) { + snd_mtxunlock(sc->lock); + return (EINVAL); + } + + if (sc->internal_codec != val) { + sc->internal_codec = val; + if (ch->run) + aic_stop(scp); + aic_configure(sc); + if (ch->run) + aic_start(scp); + } + + snd_mtxunlock(sc->lock); + + return (0); +} + +static int aic_probe(device_t dev) { @@ -635,6 +676,7 @@ aic_attach(device_t dev) sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); sc->dev = dev; sc->pos = 0; + sc->internal_codec = 1; /* Get xDMA controller */ sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); @@ -718,6 +760,13 @@ aic_attach(device_t dev) mixer_init(dev, &aicmixer_class, scp); + /* Create device sysctl node. */ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "internal_codec", CTLTYPE_INT | CTLFLAG_RW, + scp, 0, sysctl_hw_pcm_internal_codec, "I", + "use internal audio codec"); + return (0); } Modified: head/sys/mips/ingenic/jz4780_codec.c ============================================================================== --- head/sys/mips/ingenic/jz4780_codec.c Thu Dec 29 13:27:04 2016 (r310775) +++ head/sys/mips/ingenic/jz4780_codec.c Thu Dec 29 14:00:10 2016 (r310776) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include +#include + #include #include @@ -64,6 +66,7 @@ struct codec_softc { struct resource *res[1]; bus_space_tag_t bst; bus_space_handle_t bsh; + clk_t clk; }; static struct resource_spec codec_spec[] = { @@ -81,6 +84,8 @@ codec_write(struct codec_softc *sc, uint { uint32_t tmp; + clk_enable(sc->clk); + tmp = (reg << RGADW_RGADDR_S); tmp |= (val << RGADW_RGDIN_S); tmp |= RGADW_RGWR; @@ -90,6 +95,8 @@ codec_write(struct codec_softc *sc, uint while(READ4(sc, CODEC_RGADW) & RGADW_RGWR) ; + clk_disable(sc->clk); + return (0); } @@ -98,11 +105,15 @@ codec_read(struct codec_softc *sc, uint3 { uint32_t tmp; + clk_enable(sc->clk); + tmp = (reg << RGADW_RGADDR_S); WRITE4(sc, CODEC_RGADW, tmp); tmp = READ4(sc, CODEC_RGDATA); + clk_disable(sc->clk); + return (tmp); } @@ -223,6 +234,12 @@ codec_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); + if (clk_get_by_ofw_name(dev, 0, "i2s", &sc->clk) != 0) { + device_printf(dev, "could not get i2s clock\n"); + bus_release_resources(dev, codec_spec, sc->res); + return (ENXIO); + } + /* Initialize codec. */ reg = codec_read(sc, CR_VIC); reg &= ~(VIC_SB_SLEEP | VIC_SB); @@ -236,7 +253,7 @@ codec_attach(device_t dev) DELAY(10000); - /* I2S, 16-bit, 96 kHz. */ + /* I2S, 16-bit, 48 kHz. */ reg = codec_read(sc, AICR_DAC); reg &= ~(AICR_DAC_SB | DAC_ADWL_M); reg |= DAC_ADWL_16; @@ -246,7 +263,7 @@ codec_attach(device_t dev) DELAY(10000); - reg = FCR_DAC_96; + reg = FCR_DAC_48; codec_write(sc, FCR_DAC, reg); DELAY(10000); Modified: head/sys/mips/ingenic/jz4780_codec.h ============================================================================== --- head/sys/mips/ingenic/jz4780_codec.h Thu Dec 29 13:27:04 2016 (r310775) +++ head/sys/mips/ingenic/jz4780_codec.h Thu Dec 29 14:00:10 2016 (r310776) @@ -74,6 +74,7 @@ #define VIC_SB (1 << 0) /* complete power-down */ #define CR_CK 0x1C /* Clock Control Register */ #define FCR_DAC 0x1D /* DAC Frequency Control Register */ +#define FCR_DAC_48 8 /* 48 kHz. */ #define FCR_DAC_96 10 /* 96 kHz. */ #define FCR_ADC 0x20 /* ADC Frequency Control Register */ #define CR_TIMER_MSB 0x21 /* MSB of programmable counter */ From owner-svn-src-all@freebsd.org Thu Dec 29 14:08:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C762C953E1; Thu, 29 Dec 2016 14:08:26 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1E41343; Thu, 29 Dec 2016 14:08:26 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTE8Pfs030221; Thu, 29 Dec 2016 14:08:25 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTE8O73030217; Thu, 29 Dec 2016 14:08:24 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201612291408.uBTE8O73030217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 29 Dec 2016 14:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310777 - in head/sys: arm/freescale/imx dev/hdmi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 14:08:26 -0000 Author: jmcneill Date: Thu Dec 29 14:08:24 2016 New Revision: 310777 URL: https://svnweb.freebsd.org/changeset/base/310777 Log: Add support for audio on I2S based DesignWare HDMI controllers. Relnotes: yes Modified: head/sys/arm/freescale/imx/imx6_hdmi.c head/sys/dev/hdmi/dwc_hdmi.c head/sys/dev/hdmi/dwc_hdmi.h head/sys/dev/hdmi/dwc_hdmi_fdt.c head/sys/dev/hdmi/dwc_hdmireg.h Modified: head/sys/arm/freescale/imx/imx6_hdmi.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_hdmi.c Thu Dec 29 14:00:10 2016 (r310776) +++ head/sys/arm/freescale/imx/imx6_hdmi.c Thu Dec 29 14:08:24 2016 (r310777) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/hdmi/dwc_hdmi.c ============================================================================== --- head/sys/dev/hdmi/dwc_hdmi.c Thu Dec 29 14:00:10 2016 (r310776) +++ head/sys/dev/hdmi/dwc_hdmi.c Thu Dec 29 14:08:24 2016 (r310777) @@ -53,8 +53,23 @@ __FBSDID("$FreeBSD$"); #include "hdmi_if.h" #define I2C_DDC_ADDR (0x50 << 1) +#define I2C_DDC_SEGADDR (0x30 << 1) #define EDID_LENGTH 0x80 +#define EXT_TAG 0x00 +#define CEA_TAG_ID 0x02 +#define CEA_DTD 0x03 +#define DTD_BASIC_AUDIO (1 << 6) +#define CEA_REV 0x02 +#define CEA_DATA_OFF 0x03 +#define CEA_DATA_START 4 +#define BLOCK_TAG(x) (((x) >> 5) & 0x7) +#define BLOCK_TAG_VSDB 3 +#define BLOCK_LEN(x) ((x) & 0x1f) +#define HDMI_VSDB_MINLEN 5 +#define HDMI_OUI "\x03\x0c\x00" +#define HDMI_OUI_LEN 3 + static void dwc_hdmi_phy_wait_i2c_done(struct dwc_hdmi_softc *sc, int msec) { @@ -122,7 +137,7 @@ dwc_hdmi_av_composer(struct dwc_hdmi_sof HDMI_FC_INVIDCONF_IN_I_P_PROGRESSIVE); /* TODO: implement HDMI part */ - is_dvi = 1; + is_dvi = sc->sc_has_audio == 0; inv_val |= (is_dvi ? HDMI_FC_INVIDCONF_DVI_MODEZ_DVI_MODE : HDMI_FC_INVIDCONF_DVI_MODEZ_HDMI_MODE); @@ -419,6 +434,70 @@ dwc_hdmi_enable_video_path(struct dwc_hd } static void +dwc_hdmi_configure_audio(struct dwc_hdmi_softc *sc) +{ + unsigned int n; + uint8_t val; + + if (sc->sc_has_audio == 0) + return; + + /* The following values are for 48 kHz */ + switch (sc->sc_mode.dot_clock) { + case 25170: + n = 6864; + break; + case 27020: + n = 6144; + break; + case 74170: + n = 11648; + break; + case 148350: + n = 5824; + break; + default: + n = 6144; + break; + } + + WR1(sc, HDMI_AUD_N1, (n >> 0) & 0xff); + WR1(sc, HDMI_AUD_N2, (n >> 8) & 0xff); + WR1(sc, HDMI_AUD_N3, (n >> 16) & 0xff); + + val = RD1(sc, HDMI_AUD_CTS3); + val &= ~(HDMI_AUD_CTS3_N_SHIFT_MASK | HDMI_AUD_CTS3_CTS_MANUAL); + WR1(sc, HDMI_AUD_CTS3, val); + + val = RD1(sc, HDMI_AUD_CONF0); + val &= ~HDMI_AUD_CONF0_INTERFACE_MASK; + val |= HDMI_AUD_CONF0_INTERFACE_IIS; + val &= ~HDMI_AUD_CONF0_I2SINEN_MASK; + val |= HDMI_AUD_CONF0_I2SINEN_CH2; + WR1(sc, HDMI_AUD_CONF0, val); + + val = RD1(sc, HDMI_AUD_CONF1); + val &= ~HDMI_AUD_CONF1_DATAMODE_MASK; + val |= HDMI_AUD_CONF1_DATAMODE_IIS; + val &= ~HDMI_AUD_CONF1_DATWIDTH_MASK; + val |= HDMI_AUD_CONF1_DATWIDTH_16BIT; + WR1(sc, HDMI_AUD_CONF1, val); + + WR1(sc, HDMI_AUD_INPUTCLKFS, HDMI_AUD_INPUTCLKFS_64); + + WR1(sc, HDMI_FC_AUDICONF0, 1 << 4); /* CC=1 */ + WR1(sc, HDMI_FC_AUDICONF1, 0); + WR1(sc, HDMI_FC_AUDICONF2, 0); /* CA=0 */ + WR1(sc, HDMI_FC_AUDICONF3, 0); + WR1(sc, HDMI_FC_AUDSV, 0xee); /* channels valid */ + + /* Enable audio clock */ + val = RD1(sc, HDMI_MC_CLKDIS); + val &= ~HDMI_MC_CLKDIS_AUDCLK_DISABLE; + WR1(sc, HDMI_MC_CLKDIS, val); +} + +static void dwc_hdmi_video_packetize(struct dwc_hdmi_softc *sc) { unsigned int color_depth = 0; @@ -552,11 +631,15 @@ static int dwc_hdmi_set_mode(struct dwc_hdmi_softc *sc) { + /* XXX */ + sc->sc_has_audio = 1; + dwc_hdmi_disable_overflow_interrupts(sc); dwc_hdmi_av_composer(sc); dwc_hdmi_phy_init(sc); dwc_hdmi_enable_video_path(sc); - /* TODO: AVI infoframes */ + dwc_hdmi_configure_audio(sc); + /* TODO: dwc_hdmi_config_avi(sc); */ dwc_hdmi_video_packetize(sc); /* TODO: dwc_hdmi_video_csc(sc); */ dwc_hdmi_video_sample(sc); @@ -567,14 +650,17 @@ dwc_hdmi_set_mode(struct dwc_hdmi_softc } static int -hdmi_edid_read(struct dwc_hdmi_softc *sc, uint8_t **edid, uint32_t *edid_len) +hdmi_edid_read(struct dwc_hdmi_softc *sc, int block, uint8_t **edid, + uint32_t *edid_len) { device_t i2c_dev; int result; - uint8_t addr = 0; + uint8_t addr = block & 1 ? EDID_LENGTH : 0; + uint8_t segment = block >> 1; struct iic_msg msg[] = { - { 0, IIC_M_WR, 1, &addr }, - { 0, IIC_M_RD, EDID_LENGTH, NULL} + { I2C_DDC_SEGADDR, IIC_M_WR, 1, &segment }, + { I2C_DDC_ADDR, IIC_M_WR, 1, &addr }, + { I2C_DDC_ADDR, IIC_M_RD, EDID_LENGTH, sc->sc_edid } }; *edid = NULL; @@ -588,12 +674,10 @@ hdmi_edid_read(struct dwc_hdmi_softc *sc return (ENXIO); } - device_printf(sc->sc_dev, "reading EDID from %s, addr %02x\n", - device_get_nameunit(i2c_dev), I2C_DDC_ADDR/2); - - msg[0].slave = I2C_DDC_ADDR; - msg[1].slave = I2C_DDC_ADDR; - msg[1].buf = sc->sc_edid; + if (bootverbose) + device_printf(sc->sc_dev, + "reading EDID from %s, block %d, addr %02x\n", + device_get_nameunit(i2c_dev), block, I2C_DDC_ADDR/2); result = iicbus_request_bus(i2c_dev, sc->sc_dev, IIC_INTRWAIT); @@ -602,7 +686,7 @@ hdmi_edid_read(struct dwc_hdmi_softc *sc return (result); } - result = iicbus_transfer(i2c_dev, msg, 2); + result = iicbus_transfer(i2c_dev, msg, 3); iicbus_release_bus(i2c_dev, sc->sc_dev); if (result) { @@ -670,11 +754,84 @@ out: return (err); } +static int +dwc_hdmi_detect_hdmi_vsdb(uint8_t *edid) +{ + int off, p, btag, blen; + + if (edid[EXT_TAG] != CEA_TAG_ID) + return (0); + + off = edid[CEA_DATA_OFF]; + + /* CEA data block collection starts at byte 4 */ + if (off <= CEA_DATA_START) + return (0); + + /* Parse the CEA data blocks */ + for (p = CEA_DATA_START; p < off;) { + btag = BLOCK_TAG(edid[p]); + blen = BLOCK_LEN(edid[p]); + + /* Make sure the length is sane */ + if (p + blen + 1 > off) + break; + + /* Look for a VSDB with the HDMI 24-bit IEEE registration ID */ + if (btag == BLOCK_TAG_VSDB && blen >= HDMI_VSDB_MINLEN && + memcmp(&edid[p + 1], HDMI_OUI, HDMI_OUI_LEN) == 0) + return (1); + + /* Next data block */ + p += (1 + blen); + } + + /* Not found */ + return (0); +} + +static void +dwc_hdmi_detect_hdmi(struct dwc_hdmi_softc *sc) +{ + uint8_t *edid; + uint32_t edid_len; + int block; + + sc->sc_has_audio = 0; + + /* Scan through extension blocks, looking for a CEA-861 block */ + for (block = 1; block <= sc->sc_edid_info.edid_ext_block_count; + block++) { + if (hdmi_edid_read(sc, block, &edid, &edid_len) != 0) + return; + if (dwc_hdmi_detect_hdmi_vsdb(edid) != 0) { + if (bootverbose) + device_printf(sc->sc_dev, + "enabling audio support\n"); + sc->sc_has_audio = + (edid[CEA_DTD] & DTD_BASIC_AUDIO) != 0; + return; + } + } +} + int dwc_hdmi_get_edid(device_t dev, uint8_t **edid, uint32_t *edid_len) { + struct dwc_hdmi_softc *sc; + int error; + + sc = device_get_softc(dev); - return (hdmi_edid_read(device_get_softc(dev), edid, edid_len)); + memset(&sc->sc_edid_info, 0, sizeof(sc->sc_edid_info)); + + error = hdmi_edid_read(sc, 0, edid, edid_len); + if (error != 0) + return (error); + + edid_parse(*edid, &sc->sc_edid_info); + + return (0); } int @@ -685,6 +842,8 @@ dwc_hdmi_set_videomode(device_t dev, con sc = device_get_softc(dev); memcpy(&sc->sc_mode, mode, sizeof(*mode)); + dwc_hdmi_detect_hdmi(sc); + dwc_hdmi_set_mode(sc); return (0); Modified: head/sys/dev/hdmi/dwc_hdmi.h ============================================================================== --- head/sys/dev/hdmi/dwc_hdmi.h Thu Dec 29 14:00:10 2016 (r310776) +++ head/sys/dev/hdmi/dwc_hdmi.h Thu Dec 29 14:08:24 2016 (r310777) @@ -40,6 +40,9 @@ struct dwc_hdmi_softc { uint8_t sc_edid_len; struct intr_config_hook sc_mode_hook; struct videomode sc_mode; + + struct edid_info sc_edid_info; + int sc_has_audio; }; static inline uint8_t Modified: head/sys/dev/hdmi/dwc_hdmi_fdt.c ============================================================================== --- head/sys/dev/hdmi/dwc_hdmi_fdt.c Thu Dec 29 14:00:10 2016 (r310776) +++ head/sys/dev/hdmi/dwc_hdmi_fdt.c Thu Dec 29 14:08:24 2016 (r310777) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include Modified: head/sys/dev/hdmi/dwc_hdmireg.h ============================================================================== --- head/sys/dev/hdmi/dwc_hdmireg.h Thu Dec 29 14:00:10 2016 (r310776) +++ head/sys/dev/hdmi/dwc_hdmireg.h Thu Dec 29 14:08:24 2016 (r310777) @@ -250,6 +250,7 @@ #define HDMI_FC_SPDDEVICEINF 0x1062 #define HDMI_FC_AUDSCONF 0x1063 #define HDMI_FC_AUDSSTAT 0x1064 +#define HDMI_FC_AUDSV 0x1065 #define HDMI_FC_DATACH0FILL 0x1070 #define HDMI_FC_DATACH1FILL 0x1071 #define HDMI_FC_DATACH2FILL 0x1072 @@ -472,7 +473,24 @@ /* Audio Sampler Registers */ #define HDMI_AUD_CONF0 0x3100 +#define HDMI_AUD_CONF0_INTERFACE_MASK 0x20 +#define HDMI_AUD_CONF0_INTERFACE_IIS 0x20 +#define HDMI_AUD_CONF0_INTERFACE_SPDIF 0x00 +#define HDMI_AUD_CONF0_I2SINEN_MASK 0x0f +#define HDMI_AUD_CONF0_I2SINEN_CH2 0x01 +#define HDMI_AUD_CONF0_I2SINEN_CH4 0x03 +#define HDMI_AUD_CONF0_I2SINEN_CH6 0x07 +#define HDMI_AUD_CONF0_I2SINEN_CH8 0x0f #define HDMI_AUD_CONF1 0x3101 +#define HDMI_AUD_CONF1_DATAMODE_MASK 0xe0 +#define HDMI_AUD_CONF1_DATAMODE_IIS 0x00 +#define HDMI_AUD_CONF1_DATAMODE_RIGHT_J 0x20 +#define HDMI_AUD_CONF1_DATAMODE_LEFT_J 0x40 +#define HDMI_AUD_CONF1_DATAMODE_BURST_1 0x60 +#define HDMI_AUD_CONF1_DATAMDOE_BURST_2 0x80 +#define HDMI_AUD_CONF1_DATWIDTH_MASK 0x1f +#define HDMI_AUD_CONF1_DATWIDTH_16BIT 16 +#define HDMI_AUD_CONF1_DATWIDTH_24BIT 24 #define HDMI_AUD_INT 0x3102 #define HDMI_AUD_CONF2 0x3103 #define HDMI_AUD_N1 0x3200 @@ -481,7 +499,14 @@ #define HDMI_AUD_CTS1 0x3203 #define HDMI_AUD_CTS2 0x3204 #define HDMI_AUD_CTS3 0x3205 +#define HDMI_AUD_CTS3_N_SHIFT_MASK 0xe0 +#define HDMI_AUD_CTS3_CTS_MANUAL 0x10 #define HDMI_AUD_INPUTCLKFS 0x3206 +#define HDMI_AUD_INPUTCLKFS_128 0 +#define HDMI_AUD_INPUTCLKFS_256 1 +#define HDMI_AUD_INPUTCLKFS_512 2 +#define HDMI_AUD_INPUTCLKFS_1024 3 +#define HDMI_AUD_INPUTCLKFS_64 4 #define HDMI_AUD_SPDIFINT 0x3302 #define HDMI_AUD_CONF0_HBR 0x3400 #define HDMI_AUD_HBR_STATUS 0x3401 From owner-svn-src-all@freebsd.org Thu Dec 29 14:38:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A040DC95E43; Thu, 29 Dec 2016 14:38:34 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77BAD12F3; Thu, 29 Dec 2016 14:38:34 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id uBTEcFsj006549; Thu, 29 Dec 2016 06:38:20 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id uBTEcARM006548; Thu, 29 Dec 2016 06:38:10 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201612291438.uBTEcARM006548@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r310773 - in stable/11/sys: netinet netinet6 In-Reply-To: <201612291132.uBTBWgLM065597@repo.freebsd.org> To: Michael Tuexen Date: Thu, 29 Dec 2016 06:38:10 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 14:38:34 -0000 > Author: tuexen > Date: Thu Dec 29 11:32:42 2016 > New Revision: 310773 > URL: https://svnweb.freebsd.org/changeset/base/310773 > > Log: > MFC r310590: > > Whitespace changes. > > The toolchain for processing the sources has been updated. No functional > change. What tool chain? It is still broken in at least 1 respect: > /* now use the rest of the mbuf chain for the text */ > while (m_tmp != NULL) { > if ((SCTP_BUF_NEXT(m_tmp) == NULL) && trailer) { > - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, > + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, ^^^^^^^^^^^^^^ > SCTP_BUF_LEN(m_tmp) - (trailer + m_offset)); > } else { > - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, > + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, ^^^^^^^^^^^ > SCTP_BUF_LEN(m_tmp) - m_offset); > } > ... others errors of this type occur in this patch. I think it would of been better to revert the old patch that messed up some comments before creating this change as now there are other changes intermingled making the 2 changes inter-dependent. Even with this small nit, I applaud the number of style(9) corrections! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Dec 29 15:09:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CBB9C96A13; Thu, 29 Dec 2016 15:09:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AEA5170C; Thu, 29 Dec 2016 15:09:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTF9Ywk055184; Thu, 29 Dec 2016 15:09:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTF9YxM055182; Thu, 29 Dec 2016 15:09:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612291509.uBTF9YxM055182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Dec 2016 15:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310778 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 15:09:35 -0000 Author: mav Date: Thu Dec 29 15:09:34 2016 New Revision: 310778 URL: https://svnweb.freebsd.org/changeset/base/310778 Log: Improve use of I/O's private area. - Since I/Os are allocates from per-port pools, make allocations store pointer to CTL softc there, and use it where needed instead of global. - Created bunch of helper macros to access LUN, port and CTL softc. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Dec 29 14:08:24 2016 (r310777) +++ head/sys/cam/ctl/ctl.c Thu Dec 29 15:09:34 2016 (r310778) @@ -437,7 +437,6 @@ static int ctl_alloc_lun(struct ctl_soft struct ctl_be_lun *be_lun); static int ctl_free_lun(struct ctl_lun *lun); static void ctl_create_lun(struct ctl_be_lun *be_lun); -static struct ctl_port * ctl_io_port(struct ctl_io_hdr *io_hdr); static int ctl_do_mode_select(union ctl_io *io); static int ctl_pro_preempt(struct ctl_softc *softc, struct ctl_lun *lun, @@ -448,7 +447,7 @@ static int ctl_pro_preempt(struct ctl_so struct scsi_per_res_out_parms* param); static void ctl_pro_preempt_other(struct ctl_lun *lun, union ctl_ha_msg *msg); -static void ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg); +static void ctl_hndl_per_res_out_on_other_sc(union ctl_io *io); static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len); @@ -567,13 +566,12 @@ static struct ctl_frontend ha_frontend = static void ctl_ha_datamove(union ctl_io *io) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(io); struct ctl_sg_entry *sgl; union ctl_ha_msg msg; uint32_t sg_entries_sent; int do_sg_copy, i, j; - lun = (struct ctl_lun *)io->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; memset(&msg.dt, 0, sizeof(msg.dt)); msg.hdr.msg_type = CTL_MSG_DATAMOVE; msg.hdr.original_sc = io->io_hdr.original_sc; @@ -1803,7 +1801,8 @@ ctl_init(void) args.mda_si_drv1 = softc; error = make_dev_s(&args, &softc->dev, "cam/ctl"); if (error != 0) { - free(control_softc, M_DEVBUF); + free(softc, M_DEVBUF); + control_softc = NULL; return (error); } @@ -1815,7 +1814,7 @@ ctl_init(void) if (softc->sysctl_tree == NULL) { printf("%s: unable to allocate sysctl tree\n", __func__); destroy_dev(softc->dev); - free(control_softc, M_DEVBUF); + free(softc, M_DEVBUF); control_softc = NULL; return (ENOMEM); } @@ -1963,7 +1962,7 @@ ctl_shutdown(void) sysctl_ctx_free(&softc->sysctl_ctx); - free(control_softc, M_DEVBUF); + free(softc, M_DEVBUF); control_softc = NULL; } @@ -2205,18 +2204,16 @@ ctl_create_iid(struct ctl_port *port, in static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { - struct ctl_softc *softc = control_softc; + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_port *port = CTL_PORT(ctsio); union ctl_ha_msg msg_info; - struct ctl_port *port; struct ctl_lun *lun; const struct ctl_cmd_entry *entry; uint32_t targ_lun; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - mtx_lock(&softc->ctl_lock); /* Make sure that we know about this port. */ - port = ctl_io_port(&ctsio->io_hdr); if (port == NULL || (port->status & CTL_PORT_STATUS_ONLINE) == 0) { ctl_set_internal_failure(ctsio, /*sks_valid*/ 0, /*retry_count*/ 1); @@ -2224,6 +2221,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc } /* Make sure that we know about this LUN. */ + mtx_lock(&softc->ctl_lock); if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); @@ -2256,8 +2254,8 @@ ctl_serialize_other_sc_cmd(struct ctl_sc goto badjuju; } - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = lun->be_lun; + CTL_LUN(ctsio) = lun; + CTL_BACKEND_LUN(ctsio) = lun->be_lun; /* * Every I/O goes into the OOA queue for a @@ -3625,13 +3623,6 @@ ctl_encode_lun(uint32_t decoded) return ((((uint64_t)RPL_LUNDATA_ATYP_EXTLUN | 0x22) << 56) | (l << 16)); } -static struct ctl_port * -ctl_io_port(struct ctl_io_hdr *io_hdr) -{ - - return (control_softc->ctl_ports[io_hdr->nexus.targ_port]); -} - int ctl_ffz(uint32_t *mask, uint32_t first, uint32_t last) { @@ -3749,7 +3740,6 @@ int ctl_pool_create(struct ctl_softc *ctl_softc, const char *pool_name, uint32_t total_ctl_io, void **npool) { -#ifdef IO_POOLS struct ctl_io_pool *pool; pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, @@ -3759,14 +3749,15 @@ ctl_pool_create(struct ctl_softc *ctl_so snprintf(pool->name, sizeof(pool->name), "CTL IO %s", pool_name); pool->ctl_softc = ctl_softc; +#ifdef IO_POOLS pool->zone = uma_zsecond_create(pool->name, NULL, NULL, NULL, NULL, ctl_softc->io_zone); /* uma_prealloc(pool->zone, total_ctl_io); */ - - *npool = pool; #else - *npool = ctl_softc->io_zone; + pool->zone = ctl_softc->io_zone; #endif + + *npool = pool; return (0); } @@ -3779,64 +3770,54 @@ ctl_pool_free(struct ctl_io_pool *pool) #ifdef IO_POOLS uma_zdestroy(pool->zone); - free(pool, M_CTL); #endif + free(pool, M_CTL); } union ctl_io * ctl_alloc_io(void *pool_ref) { - union ctl_io *io; -#ifdef IO_POOLS struct ctl_io_pool *pool = (struct ctl_io_pool *)pool_ref; + union ctl_io *io; io = uma_zalloc(pool->zone, M_WAITOK); -#else - io = uma_zalloc((uma_zone_t)pool_ref, M_WAITOK); -#endif - if (io != NULL) + if (io != NULL) { io->io_hdr.pool = pool_ref; + CTL_SOFTC(io) = pool->ctl_softc; + } return (io); } union ctl_io * ctl_alloc_io_nowait(void *pool_ref) { - union ctl_io *io; -#ifdef IO_POOLS struct ctl_io_pool *pool = (struct ctl_io_pool *)pool_ref; + union ctl_io *io; io = uma_zalloc(pool->zone, M_NOWAIT); -#else - io = uma_zalloc((uma_zone_t)pool_ref, M_NOWAIT); -#endif - if (io != NULL) + if (io != NULL) { io->io_hdr.pool = pool_ref; + CTL_SOFTC(io) = pool->ctl_softc; + } return (io); } void ctl_free_io(union ctl_io *io) { -#ifdef IO_POOLS struct ctl_io_pool *pool; -#endif if (io == NULL) return; -#ifdef IO_POOLS pool = (struct ctl_io_pool *)io->io_hdr.pool; uma_zfree(pool->zone, io); -#else - uma_zfree((uma_zone_t)io->io_hdr.pool, io); -#endif } void ctl_zero_io(union ctl_io *io) { - void *pool_ref; + struct ctl_io_pool *pool; if (io == NULL) return; @@ -3844,9 +3825,10 @@ ctl_zero_io(union ctl_io *io) /* * May need to preserve linked list pointers at some point too. */ - pool_ref = io->io_hdr.pool; + pool = io->io_hdr.pool; memset(io, 0, sizeof(*io)); - io->io_hdr.pool = pool_ref; + io->io_hdr.pool = pool; + CTL_SOFTC(io) = pool->ctl_softc; } int @@ -4653,12 +4635,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft static int ctl_free_lun(struct ctl_lun *lun) { - struct ctl_softc *softc; + struct ctl_softc *softc = lun->ctl_softc; struct ctl_lun *nlun; int i; - softc = lun->ctl_softc; - mtx_assert(&softc->ctl_lock, MA_OWNED); STAILQ_REMOVE(&softc->lun_list, lun, ctl_lun, links); @@ -5159,13 +5139,12 @@ ctl_config_read_done(union ctl_io *io) int ctl_scsi_release(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); uint32_t residx; CTL_DEBUG_PRINT(("ctl_scsi_release\n")); residx = ctl_get_initindex(&ctsio->io_hdr.nexus); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; /* * XXX KDM right now, we only support LUN reservation. We don't @@ -5197,13 +5176,12 @@ ctl_scsi_release(struct ctl_scsiio *ctsi int ctl_scsi_reserve(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); uint32_t residx; CTL_DEBUG_PRINT(("ctl_reserve\n")); residx = ctl_get_initindex(&ctsio->io_hdr.nexus); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; /* * XXX KDM right now, we only support LUN reservation. We don't @@ -5238,13 +5216,12 @@ bailout: int ctl_start_stop(struct ctl_scsiio *ctsio) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_start_stop_unit *cdb; - struct ctl_lun *lun; int retval; CTL_DEBUG_PRINT(("ctl_start_stop\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_start_stop_unit *)ctsio->cdb; if ((cdb->how & SSS_PC_MASK) == 0) { @@ -5293,14 +5270,13 @@ ctl_start_stop(struct ctl_scsiio *ctsio) int ctl_prevent_allow(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_prevent *cdb; int retval; uint32_t initidx; CTL_DEBUG_PRINT(("ctl_prevent_allow\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_prevent *)ctsio->cdb; if ((lun->flags & CTL_LUN_REMOVABLE) == 0) { @@ -5334,8 +5310,7 @@ ctl_prevent_allow(struct ctl_scsiio *cts int ctl_sync_cache(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; - struct ctl_softc *softc; + struct ctl_lun *lun = CTL_LUN(ctsio); struct ctl_lba_len_flags *lbalen; uint64_t starting_lba; uint32_t block_count; @@ -5344,8 +5319,6 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_sync_cache\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - softc = lun->ctl_softc; retval = 0; switch (ctsio->cdb[0]) { @@ -5401,13 +5374,10 @@ int ctl_format(struct ctl_scsiio *ctsio) { struct scsi_format *cdb; - struct ctl_lun *lun; int length, defect_list_len; CTL_DEBUG_PRINT(("ctl_format\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - cdb = (struct scsi_format *)ctsio->cdb; length = 0; @@ -5486,7 +5456,7 @@ bailout: int ctl_read_buffer(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); uint64_t buffer_offset; uint32_t len; uint8_t byte2; @@ -5494,7 +5464,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio static uint8_t echo_descr[4] = { 0 }; CTL_DEBUG_PRINT(("ctl_read_buffer\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + switch (ctsio->cdb[0]) { case READ_BUFFER: { struct scsi_read_buffer *cdb; @@ -5561,13 +5531,12 @@ ctl_read_buffer(struct ctl_scsiio *ctsio int ctl_write_buffer(struct ctl_scsiio *ctsio) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_write_buffer *cdb; - struct ctl_lun *lun; int buffer_offset, len; CTL_DEBUG_PRINT(("ctl_write_buffer\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_write_buffer *)ctsio->cdb; len = scsi_3btoul(cdb->length); @@ -5614,7 +5583,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi int ctl_write_same(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; @@ -5623,8 +5592,6 @@ ctl_write_same(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_write_same\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - switch (ctsio->cdb[0]) { case WRITE_SAME_10: { struct scsi_write_same_10 *cdb; @@ -5728,7 +5695,7 @@ ctl_write_same(struct ctl_scsiio *ctsio) int ctl_unmap(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_unmap *cdb; struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_header *hdr; @@ -5740,9 +5707,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_unmap\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_unmap *)ctsio->cdb; - len = scsi_2btoul(cdb->length); byte2 = cdb->byte2; @@ -5832,12 +5797,11 @@ int ctl_default_page_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, uint8_t *page_ptr) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); uint8_t *current_cp; int set_ua; uint32_t initidx; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); set_ua = 0; @@ -5887,13 +5851,12 @@ int ctl_ie_page_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, uint8_t *page_ptr) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_info_exceptions_page *pg; - struct ctl_lun *lun; uint64_t t; (void)ctl_default_page_handler(ctsio, page_index, page_ptr); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; pg = (struct scsi_info_exceptions_page *)page_ptr; mtx_lock(&lun->lun_lock); if (pg->info_flags & SIEP_FLAGS_TEST) { @@ -5930,19 +5893,18 @@ ctl_ie_page_handler(struct ctl_scsiio *c static int ctl_do_mode_select(union ctl_io *io) { + struct ctl_lun *lun = CTL_LUN(io); struct scsi_mode_page_header *page_header; struct ctl_page_index *page_index; struct ctl_scsiio *ctsio; int page_len, page_len_offset, page_len_size; union ctl_modepage_info *modepage_info; - struct ctl_lun *lun; uint16_t *len_left, *len_used; int retval, i; ctsio = &io->scsiio; page_index = NULL; page_len = 0; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; modepage_info = (union ctl_modepage_info *) ctsio->io_hdr.ctl_private[CTL_PRIV_MODEPAGE].bytes; @@ -6155,12 +6117,11 @@ bailout_no_done: int ctl_mode_select(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); union ctl_modepage_info *modepage_info; int bd_len, i, header_size, param_len, pf, rtd, sp; uint32_t initidx; - lun = ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); switch (ctsio->cdb[0]) { case MODE_SELECT_6: { @@ -6305,7 +6266,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio int ctl_mode_sense(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); int pc, page_code, dbd, llba, subpage; int alloc_len, page_len, header_len, total_len; struct scsi_mode_block_descr *block_desc; @@ -6317,7 +6278,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_mode_sense\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; switch (ctsio->cdb[0]) { case MODE_SENSE_6: { struct scsi_mode_sense_6 *cdb; @@ -6653,12 +6613,11 @@ ctl_lbp_log_sense_handler(struct ctl_scs struct ctl_page_index *page_index, int pc) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_log_param_header *phdr; uint8_t *data; uint64_t val; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; data = page_index->page_data; if (lun->backend->lun_attr != NULL && @@ -6722,13 +6681,12 @@ ctl_sap_log_sense_handler(struct ctl_scs struct ctl_page_index *page_index, int pc) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct stat_page *data; uint64_t rn, wn, rb, wb; struct bintime rt, wt; int i; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; data = (struct stat_page *)page_index->page_data; scsi_ulto2b(SLP_SAP, data->sap.hdr.param_code); @@ -6781,10 +6739,9 @@ ctl_ie_log_sense_handler(struct ctl_scsi struct ctl_page_index *page_index, int pc) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_log_informational_exceptions *data; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; data = (struct scsi_log_informational_exceptions *)page_index->page_data; scsi_ulto2b(SLP_IE_GEN, data->hdr.param_code); @@ -6800,7 +6757,7 @@ ctl_ie_log_sense_handler(struct ctl_scsi int ctl_log_sense(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); int i, pc, page_code, subpage; int alloc_len, total_len; struct ctl_page_index *page_index; @@ -6809,7 +6766,6 @@ ctl_log_sense(struct ctl_scsiio *ctsio) 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; @@ -6886,9 +6842,9 @@ ctl_log_sense(struct ctl_scsiio *ctsio) int ctl_read_capacity(struct ctl_scsiio *ctsio) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_read_capacity *cdb; struct scsi_read_capacity_data *data; - struct ctl_lun *lun; uint32_t lba; CTL_DEBUG_PRINT(("ctl_read_capacity\n")); @@ -6908,8 +6864,6 @@ ctl_read_capacity(struct ctl_scsiio *cts return (CTL_RETVAL_COMPLETE); } - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; ctsio->residual = 0; @@ -6944,9 +6898,9 @@ ctl_read_capacity(struct ctl_scsiio *cts int ctl_read_capacity_16(struct ctl_scsiio *ctsio) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_read_capacity_16 *cdb; struct scsi_read_capacity_data_long *data; - struct ctl_lun *lun; uint64_t lba; uint32_t alloc_len; @@ -6969,8 +6923,6 @@ ctl_read_capacity_16(struct ctl_scsiio * return (CTL_RETVAL_COMPLETE); } - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; @@ -7005,9 +6957,9 @@ ctl_read_capacity_16(struct ctl_scsiio * int ctl_get_lba_status(struct ctl_scsiio *ctsio) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_get_lba_status *cdb; struct scsi_get_lba_status_data *data; - struct ctl_lun *lun; struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t alloc_len, total_len; @@ -7015,7 +6967,6 @@ ctl_get_lba_status(struct ctl_scsiio *ct CTL_DEBUG_PRINT(("ctl_get_lba_status\n")); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_get_lba_status *)ctsio->cdb; lba = scsi_8btou64(cdb->addr); alloc_len = scsi_4btoul(cdb->alloc_len); @@ -7128,12 +7079,12 @@ ctl_read_defect(struct ctl_scsiio *ctsio int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_maintenance_in *cdb; int retval; int alloc_len, ext, total_len = 0, g, pc, pg, ts, os; int num_ha_groups, num_target_ports, shared_group; - struct ctl_lun *lun; - struct ctl_softc *softc; struct ctl_port *port; struct scsi_target_group_data *rtg_ptr; struct scsi_target_group_data_extended *rtg_ext_ptr; @@ -7142,9 +7093,6 @@ ctl_report_tagret_port_groups(struct ctl CTL_DEBUG_PRINT(("ctl_report_tagret_port_groups\n")); cdb = (struct scsi_maintenance_in *)ctsio->cdb; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - softc = lun->ctl_softc; - retval = CTL_RETVAL_COMPLETE; switch (cdb->byte2 & STG_PDF_MASK) { @@ -7310,7 +7258,7 @@ ctl_report_tagret_port_groups(struct ctl int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_report_supported_opcodes *cdb; const struct ctl_cmd_entry *entry, *sentry; struct scsi_report_supported_opcodes_all *all; @@ -7323,8 +7271,6 @@ ctl_report_supported_opcodes(struct ctl_ CTL_DEBUG_PRINT(("ctl_report_supported_opcodes\n")); cdb = (struct scsi_report_supported_opcodes *)ctsio->cdb; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - retval = CTL_RETVAL_COMPLETE; opcode = cdb->requested_opcode; @@ -7589,11 +7535,11 @@ ctl_report_timestamp(struct ctl_scsiio * int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_per_res_in *cdb; int alloc_len, total_len = 0; /* struct scsi_per_res_in_rsrv in_data; */ - struct ctl_lun *lun; - struct ctl_softc *softc; uint64_t key; CTL_DEBUG_PRINT(("ctl_persistent_reserve_in\n")); @@ -7602,9 +7548,6 @@ ctl_persistent_reserve_in(struct ctl_scs alloc_len = scsi_2btoul(cdb->length); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - softc = lun->ctl_softc; - retry: mtx_lock(&lun->lun_lock); switch (cdb->action) { @@ -8167,12 +8110,12 @@ ctl_pro_preempt_other(struct ctl_lun *lu int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_lun *lun = CTL_LUN(ctsio); int retval; u_int32_t param_len; struct scsi_per_res_out *cdb; - struct ctl_lun *lun; struct scsi_per_res_out_parms* param; - struct ctl_softc *softc; uint32_t residx; uint64_t res_key, sa_res_key, key; uint8_t type; @@ -8181,11 +8124,8 @@ ctl_persistent_reserve_out(struct ctl_sc CTL_DEBUG_PRINT(("ctl_persistent_reserve_out\n")); - retval = CTL_RETVAL_COMPLETE; - cdb = (struct scsi_per_res_out *)ctsio->cdb; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - softc = lun->ctl_softc; + retval = CTL_RETVAL_COMPLETE; /* * We only support whole-LUN scope. The scope & type are ignored for @@ -8559,9 +8499,10 @@ done: * in sync. */ static void -ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg) +ctl_hndl_per_res_out_on_other_sc(union ctl_io *io) { - struct ctl_softc *softc = control_softc; + struct ctl_softc *softc = CTL_SOFTC(io); + union ctl_ha_msg *msg = (union ctl_ha_msg *)&io->presio.pr_msg; struct ctl_lun *lun; int i; uint32_t residx, targ_lun; @@ -8680,15 +8621,13 @@ ctl_hndl_per_res_out_on_other_sc(union c int ctl_read_write(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; int flags, retval; int isread; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - CTL_DEBUG_PRINT(("ctl_read_write: command: %#x\n", ctsio->cdb[0])); flags = 0; @@ -8873,15 +8812,14 @@ ctl_read_write(struct ctl_scsiio *ctsio) static int ctl_cnw_cont(union ctl_io *io) { + struct ctl_lun *lun = CTL_LUN(io); struct ctl_scsiio *ctsio; - struct ctl_lun *lun; struct ctl_lba_len_flags *lbalen; int retval; ctsio = &io->scsiio; ctsio->io_hdr.status = CTL_STATUS_NONE; ctsio->io_hdr.flags &= ~CTL_FLAG_IO_CONT; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; lbalen = (struct ctl_lba_len_flags *) &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; lbalen->flags &= ~CTL_LLF_COMPARE; @@ -8895,14 +8833,12 @@ ctl_cnw_cont(union ctl_io *io) int ctl_cnw(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; int flags, retval; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - CTL_DEBUG_PRINT(("ctl_cnw: command: %#x\n", ctsio->cdb[0])); flags = 0; @@ -8983,15 +8919,13 @@ ctl_cnw(struct ctl_scsiio *ctsio) int ctl_verify(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; int bytchk, flags; int retval; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - CTL_DEBUG_PRINT(("ctl_verify: command: %#x\n", ctsio->cdb[0])); bytchk = 0; @@ -9087,19 +9021,17 @@ ctl_verify(struct ctl_scsiio *ctsio) int ctl_report_luns(struct ctl_scsiio *ctsio) { - struct ctl_softc *softc; + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_port *port = CTL_PORT(ctsio); + struct ctl_lun *lun, *request_lun = CTL_LUN(ctsio); struct scsi_report_luns *cdb; struct scsi_report_luns_data *lun_data; - struct ctl_lun *lun, *request_lun; - struct ctl_port *port; int num_filled, num_luns, num_port_luns, retval; uint32_t alloc_len, lun_datalen; uint32_t initidx, targ_lun_id, lun_id; retval = CTL_RETVAL_COMPLETE; cdb = (struct scsi_report_luns *)ctsio->cdb; - port = ctl_io_port(&ctsio->io_hdr); - softc = port->ctl_softc; CTL_DEBUG_PRINT(("ctl_report_luns\n")); @@ -9152,9 +9084,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio return (retval); } - request_lun = (struct ctl_lun *) - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - lun_datalen = sizeof(*lun_data) + (num_luns * sizeof(struct scsi_report_luns_lundata)); @@ -9245,10 +9174,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio int ctl_request_sense(struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_request_sense *cdb; struct scsi_sense_data *sense_ptr; - struct ctl_softc *softc; - struct ctl_lun *lun; uint32_t initidx; int have_error; u_int sense_len = SSD_FULL_SIZE; @@ -9258,9 +9187,6 @@ ctl_request_sense(struct ctl_scsiio *cts cdb = (struct scsi_request_sense *)ctsio->cdb; - softc = control_softc; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - CTL_DEBUG_PRINT(("ctl_request_sense\n")); /* @@ -9403,13 +9329,11 @@ ctl_tur(struct ctl_scsiio *ctsio) static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_supported_pages *pages; int sup_page_size; - struct ctl_lun *lun; int p; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - sup_page_size = sizeof(struct scsi_vpd_supported_pages) * SCSI_EVPD_NUM_SUPPORTED_PAGES; ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); @@ -9478,12 +9402,10 @@ ctl_inquiry_evpd_supported(struct ctl_sc static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_unit_serial_number *sn_ptr; - struct ctl_lun *lun; int data_len; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - data_len = 4 + CTL_SN_LEN; ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); sn_ptr = (struct scsi_vpd_unit_serial_number *)ctsio->kern_data_ptr; @@ -9537,12 +9459,10 @@ ctl_inquiry_evpd_serial(struct ctl_scsii static int ctl_inquiry_evpd_eid(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_extended_inquiry_data *eid_ptr; - struct ctl_lun *lun; int data_len; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - data_len = sizeof(struct scsi_vpd_extended_inquiry_data); ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); eid_ptr = (struct scsi_vpd_extended_inquiry_data *)ctsio->kern_data_ptr; @@ -9613,12 +9533,10 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * static int ctl_inquiry_evpd_mpp(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_mode_page_policy *mpp_ptr; - struct ctl_lun *lun; int data_len; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - data_len = sizeof(struct scsi_vpd_mode_page_policy) + sizeof(struct scsi_vpd_mode_page_policy_descr); @@ -9667,19 +9585,14 @@ ctl_inquiry_evpd_mpp(struct ctl_scsiio * static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_port *port = CTL_PORT(ctsio); + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_device_id *devid_ptr; struct scsi_vpd_id_descriptor *desc; - struct ctl_softc *softc; - struct ctl_lun *lun; - struct ctl_port *port; int data_len, g; uint8_t proto; - softc = control_softc; - - port = ctl_io_port(&ctsio->io_hdr); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - data_len = sizeof(struct scsi_vpd_device_id) + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_rel_trgt_port_id) + @@ -9792,16 +9705,14 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio static int ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, int alloc_len) { - struct ctl_softc *softc = control_softc; + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_scsi_ports *sp; struct scsi_vpd_port_designation *pd; struct scsi_vpd_port_designation_cont *pdc; - struct ctl_lun *lun; struct ctl_port *port; int data_len, num_target_ports, iid_len, id_len; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - num_target_ports = 0; iid_len = 0; id_len = 0; @@ -9895,12 +9806,10 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_block_limits *bl_ptr; - struct ctl_lun *lun; uint64_t ival; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*bl_ptr), M_CTL, M_WAITOK | M_ZERO); bl_ptr = (struct scsi_vpd_block_limits *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -9972,13 +9881,11 @@ ctl_inquiry_evpd_block_limits(struct ctl static int ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_lun *lun = CTL_LUN(ctsio); 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; - ctsio->kern_data_ptr = malloc(sizeof(*bdc_ptr), M_CTL, M_WAITOK | M_ZERO); bdc_ptr = (struct scsi_vpd_block_device_characteristics *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -10032,12 +9939,10 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len) { + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_logical_block_prov *lbp_ptr; - struct ctl_lun *lun; const char *value; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*lbp_ptr), M_CTL, M_WAITOK | M_ZERO); lbp_ptr = (struct scsi_vpd_logical_block_prov *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -10095,11 +10000,10 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; + struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_inquiry *cdb; int alloc_len, retval; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_inquiry *)ctsio->cdb; alloc_len = scsi_2btoul(cdb->length); @@ -10162,21 +10066,19 @@ err: static int ctl_inquiry_std(struct ctl_scsiio *ctsio) { + struct ctl_softc *softc = CTL_SOFTC(ctsio); + struct ctl_port *port = CTL_PORT(ctsio); + struct ctl_lun *lun = CTL_LUN(ctsio); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 29 16:35:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22769C95746; Thu, 29 Dec 2016 16:35:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE1381933; Thu, 29 Dec 2016 16:35:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTGZo14091754; Thu, 29 Dec 2016 16:35:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTGZo4W091753; Thu, 29 Dec 2016 16:35:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612291635.uBTGZo4W091753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Dec 2016 16:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310779 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 16:35:51 -0000 Author: mjg Date: Thu Dec 29 16:35:49 2016 New Revision: 310779 URL: https://svnweb.freebsd.org/changeset/base/310779 Log: cache: sprinkle __predict_false Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Dec 29 15:09:34 2016 (r310778) +++ head/sys/kern/vfs_cache.c Thu Dec 29 16:35:49 2016 (r310779) @@ -1104,7 +1104,7 @@ cache_lookup(struct vnode *dvp, struct v uint32_t hash; int error, ltype; - if (!doingcache) { + if (__predict_false(!doingcache)) { cnp->cn_flags &= ~MAKEENTRY; return (0); } @@ -1544,13 +1544,13 @@ cache_enter_time(struct vnode *dvp, stru VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp, ("cache_enter: Doomed vnode used as src")); - if (!doingcache) + if (__predict_false(!doingcache)) return; /* * Avoid blowout in namecache entries. */ - if (numcache >= desiredvnodes * ncsizefactor) + if (__predict_false(numcache >= desiredvnodes * ncsizefactor)) return; cache_celockstate_init(&cel); @@ -2054,9 +2054,9 @@ kern___getcwd(struct thread *td, char *b struct vnode *cdir, *rdir; int error; - if (disablecwd) + if (__predict_false(disablecwd)) return (ENODEV); - if (buflen < 2) + if (__predict_false(buflen < 2)) return (EINVAL); if (buflen > path_max) buflen = path_max; @@ -2107,9 +2107,9 @@ vn_fullpath(struct thread *td, struct vn struct vnode *rdir; int error; - if (disablefullpath) + if (__predict_false(disablefullpath)) return (ENODEV); - if (vn == NULL) + if (__predict_false(vn == NULL)) return (EINVAL); buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); @@ -2141,9 +2141,9 @@ vn_fullpath_global(struct thread *td, st char *buf; int error; - if (disablefullpath) + if (__predict_false(disablefullpath)) return (ENODEV); - if (vn == NULL) + if (__predict_false(vn == NULL)) return (EINVAL); buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, MAXPATHLEN); @@ -2407,7 +2407,7 @@ vn_path_to_global_path(struct thread *td ASSERT_VOP_ELOCKED(vp, __func__); /* Return ENODEV if sysctl debug.disablefullpath==1 */ - if (disablefullpath) + if (__predict_false(disablefullpath)) return (ENODEV); /* Construct global filesystem path from vp. */ From owner-svn-src-all@freebsd.org Thu Dec 29 17:09:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DE0C961A3; Thu, 29 Dec 2016 17:09:40 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A242B1875; Thu, 29 Dec 2016 17:09:40 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1403) id F2E8962F7; Thu, 29 Dec 2016 17:09:39 +0000 (UTC) Date: Thu, 29 Dec 2016 18:09:39 +0100 From: "Piotr P. Stefaniak" To: "Rodney W. Grimes" Cc: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r310773 - in stable/11/sys: netinet netinet6 Message-ID: <20161229170939.GA23243@freefall.freebsd.org> References: <201612291132.uBTBWgLM065597@repo.freebsd.org> <201612291438.uBTEcARM006548@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <201612291438.uBTEcARM006548@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 17:09:40 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2016-12-29 06:38:10, Rodney W. Grimes wrote: >> Author: tuexen >> Date: Thu Dec 29 11:32:42 2016 >> New Revision: 310773 >> URL: https://svnweb.freebsd.org/changeset/base/310773 >> >> Log: >> MFC r310590: >> >> Whitespace changes. >> >> The toolchain for processing the sources has been updated. No function= al >> change. > >What tool chain? It is still broken in at least 1 respect: It's indent(1) from FreeBSD HEAD. >> /* now use the rest of the mbuf chain for the text */ >> while (m_tmp !=3D NULL) { >> if ((SCTP_BUF_NEXT(m_tmp) =3D=3D NULL) && trailer) { >> - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, >> + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, > = ^^^^^^^^^^^^^^ >> SCTP_BUF_LEN(m_tmp) - (trailer + m_offset)); >> } else { >> - sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *) + m_offset, >> + sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, uint8_t *)+m_offset, > = ^^^^^^^^^^^ > >> SCTP_BUF_LEN(m_tmp) - m_offset); >> } >> >... others errors of this type occur in this patch. This is caused by an old bug in indent that hasn't presented itself until -ta was used to automatically recognize tokens ending with "_t" as type names. >I think it would of been better to revert the old patch that messed up som= e comments >before creating this change as now there are other changes intermingled ma= king the 2 >changes inter-dependent. Two things have changed since that old patch that you refer to: 1) newest version of FreeBSD indent(1) was used 2) the option -ta was added It's the 1) that fixed comment formatting (broken earlier by me) since the old patch. It's the 2) that is responsible for some of the corrections that you applaud. It's also 2) that is responsible for uncovering the old bug in indent that I haven't fixed yet. >Even with this small nit, I applaud the number of style(9) corrections! > >--=20 >Rod Grimes rgrimes@freebsd= =2Eorg > --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEElaLNZulp/QcHQR2KSnkqwcVL7lkFAlhlQ0oACgkQSnkqwcVL 7lll2Qf/a7/MsUfXnmbwtk5fl9UnxMi72UDWHFwXIy4h1sHcvp31cDN9wPp1H+wa b04mRF6MSVmeMjpxeITlT8PG7oHcgP1DIU8mZuw5Lb9Z8SfAN7fdvArXVPJvLiOB cOIQHg4HXs+QOfcwe4qCx49BQkIzx+sWlXq1tNF7/xyyxMme9/k6EKyEcwWESbfv s2nGvWtEBl+hsO7fkfzlwN3bOzUzexwIwIQOkd0mbkaBmbz5BmsuY5usUyvApxpo cBkax+alezMPQLbEMCAwEY8ceyYOgpodwfUeY9XMq+HNMrxn67NUBVE9Hr7GVKPe H5Khig9EtyNAJBJwpLmas//rC7jnUA== =TNcf -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-all@freebsd.org Thu Dec 29 17:31:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70211C96AB6; Thu, 29 Dec 2016 17:31:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD50157A; Thu, 29 Dec 2016 17:31:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTHV7ed013722; Thu, 29 Dec 2016 17:31:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTHV7C9013708; Thu, 29 Dec 2016 17:31:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612291731.uBTHV7C9013708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 29 Dec 2016 17:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310780 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 17:31:08 -0000 Author: adrian Date: Thu Dec 29 17:31:07 2016 New Revision: 310780 URL: https://svnweb.freebsd.org/changeset/base/310780 Log: [ar71xx] put in an implicit read-after-write to flush things out. Note: I may need to revisit this for mips74k. Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Thu Dec 29 16:35:49 2016 (r310779) +++ head/sys/mips/atheros/ar71xxreg.h Thu Dec 29 17:31:07 2016 (r310780) @@ -527,7 +527,10 @@ typedef enum { *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) #define ATH_WRITE_REG(reg, val) \ - *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val) + do { \ + *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val); \ + (void) ATH_READ_REG(reg); \ + } while (0) static inline void ar71xx_ddr_flush(uint32_t reg) From owner-svn-src-all@freebsd.org Thu Dec 29 17:31:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B120AC96B77; Thu, 29 Dec 2016 17:31:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80B9A178D; Thu, 29 Dec 2016 17:31:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTHVcjq015367; Thu, 29 Dec 2016 17:31:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTHVc74015366; Thu, 29 Dec 2016 17:31:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612291731.uBTHVc74015366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 29 Dec 2016 17:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310781 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 17:31:39 -0000 Author: adrian Date: Thu Dec 29 17:31:38 2016 New Revision: 310781 URL: https://svnweb.freebsd.org/changeset/base/310781 Log: [ar71xx] add EARLY_PRINTF support for the AR933x (Hornet) UART. Tested: * Carambola 2 Modified: head/sys/mips/atheros/uart_bus_ar933x.c Modified: head/sys/mips/atheros/uart_bus_ar933x.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar933x.c Thu Dec 29 17:31:07 2016 (r310780) +++ head/sys/mips/atheros/uart_bus_ar933x.c Thu Dec 29 17:31:38 2016 (r310781) @@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EARLY_PRINTF +#include +#endif #include "uart_if.h" @@ -88,4 +91,25 @@ uart_ar933x_probe(device_t dev) return (uart_bus_probe(dev, 2, freq, 0, 0)); } +/* + * Assume the UART is setup by the bootloader and just echo that. + */ +#if defined(EARLY_PRINTF) +static void +ar933x_early_putc(int c) +{ + int i = 1000; + + /* Wait until FIFO is clear */ + while ((i > 0) && (ATH_READ_REG(AR71XX_UART_ADDR + AR933X_UART_CS_REG) & + AR933X_UART_CS_TX_BUSY)) + i--; + + /* Write it out */ + ATH_WRITE_REG(AR71XX_UART_ADDR + AR933X_UART_DATA_REG, + (c & 0xff)| AR933X_UART_DATA_TX_CSR); +} +early_putc_t *early_putc = ar933x_early_putc; +#endif /* EARLY_PRINTF */ + DRIVER_MODULE(uart, apb, uart_ar933x_driver, uart_devclass, 0, 0); From owner-svn-src-all@freebsd.org Thu Dec 29 18:02:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF22CC966F6; Thu, 29 Dec 2016 18:02:29 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wj0-x242.google.com (mail-wj0-x242.google.com [IPv6:2a00:1450:400c:c01::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7189E1038; Thu, 29 Dec 2016 18:02:29 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wj0-x242.google.com with SMTP id qs7so20744879wjc.1; Thu, 29 Dec 2016 10:02:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VKzF+RRrmNeMDMt0RHM7aLXIVKET5scTKxT26mHUN2Y=; b=ERXT8lD3eCMfUwNUNZs62APACFL2y62f8oRYkIT2sLzLiXBxvNAlFQNrxq0pEo9RZD L7lj1aZqNgoXaV0dmnl3YcKJqOtCgHCB2QOcBkfypyO6FTLwRIf1e9ZoAarrP/qarBGt T5QifcLO25FrWU5AyePH5gGqfR1A3T51nvDNQfQNrMkvY6oz525w4+KwBiuRXoZemj71 vdbu0KrjcTLUMFEBwO1u5vaj5VIyXeAb0CSDAg6FSLyEV2LkUf651YTf6NrOOuvavuua BHTW6GaTwzFoagle5c3jyQvPvtLsFu5inQrOBsS1tvzJ2nvZqv0Ix5nvfdUXNYOr15d+ lSZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VKzF+RRrmNeMDMt0RHM7aLXIVKET5scTKxT26mHUN2Y=; b=CkBeqDN2BPS8QdGUCje2Hx89IxrIonFxTu4ibylDJfTOn57UMtc9s1SlxpiRqKw91d WBQKNhz5R/kY8lkn6nxWxQlO5zn/WmSFFcrFc7gZ1xslC3x7UxB0BAU96QzkOKHJmB8M QExPlur1QCPmzFC5zGXIUjI1rxZllH7X/aS8McHQNaXGOaK4HbsYckhKYT6VAsblGNgw Zda3/vjGlfV1mhJd/ANxbQE/UOHScJXX2fr80eq8tmqwz42So44O8QdMavliiPRFVchh WEbz5cjQ4x7ZBnePZV5QepkvXauVMuJqucAmuLIqlohrDj89DHy600vM3h191TtXYDTe Ei7Q== X-Gm-Message-State: AIkVDXKEf2q4l5U3l/JyWgfcwkGCgYLIe6z1jxSahCNUIHhwZh/NR1wK50zx7mWEGiQtgw== X-Received: by 10.194.69.230 with SMTP id h6mr43158332wju.63.1483034547252; Thu, 29 Dec 2016 10:02:27 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id g184sm66350143wme.23.2016.12.29.10.02.25 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 29 Dec 2016 10:02:26 -0800 (PST) Date: Thu, 29 Dec 2016 19:02:24 +0100 From: Mateusz Guzik To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310778 - head/sys/cam/ctl Message-ID: <20161229180223.GD29676@dft-labs.eu> References: <201612291509.uBTF9YxM055182@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201612291509.uBTF9YxM055182@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 18:02:29 -0000 On Thu, Dec 29, 2016 at 03:09:34PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu Dec 29 15:09:34 2016 > New Revision: 310778 > URL: https://svnweb.freebsd.org/changeset/base/310778 > > Log: > Improve use of I/O's private area. > > - Since I/Os are allocates from per-port pools, make allocations store > pointer to CTL softc there, and use it where needed instead of global. > - Created bunch of helper macros to access LUN, port and CTL softc. > This fails to build with: sys/modules/ctl/../../cam/ctl/ctl.c:12522:27: error: member reference base type 'void' is not a structure or union mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED); Looks like thep roblem is that CTL_SOFTC indeed does not cast and returns void instead: +#define CTL_SOFTC(io) ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[1]) -- Mateusz Guzik From owner-svn-src-all@freebsd.org Thu Dec 29 18:08:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D42BAC96937; Thu, 29 Dec 2016 18:08:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C8E71448; Thu, 29 Dec 2016 18:08:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTI84EW029033; Thu, 29 Dec 2016 18:08:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTI84k1029032; Thu, 29 Dec 2016 18:08:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612291808.uBTI84k1029032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Dec 2016 18:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310782 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 18:08:05 -0000 Author: mav Date: Thu Dec 29 18:08:04 2016 New Revision: 310782 URL: https://svnweb.freebsd.org/changeset/base/310782 Log: Fix build with enabled debug after r310778. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Dec 29 17:31:38 2016 (r310781) +++ head/sys/cam/ctl/ctl.c Thu Dec 29 18:08:04 2016 (r310782) @@ -12519,7 +12519,7 @@ ctl_datamove(union ctl_io *io) { void (*fe_datamove)(union ctl_io *io); - mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED); + mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED); CTL_DEBUG_PRINT(("ctl_datamove\n")); @@ -13012,7 +13012,7 @@ static void ctl_datamove_remote(union ctl_io *io) { - mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED); + mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED); if (io->io_hdr.flags & CTL_FLAG_FAILOVER) { ctl_failover_io(io, /*have_lock*/ 0); From owner-svn-src-all@freebsd.org Thu Dec 29 18:09:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B21ABC969BC; Thu, 29 Dec 2016 18:09:01 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A3031612; Thu, 29 Dec 2016 18:09:01 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id u144so67563235wmu.0; Thu, 29 Dec 2016 10:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=uxuFp7Xe/E1EEnH+TWX5XbO3EsrDUoO724HR46wCKME=; b=WKBJzMGRzNItwmqC85NEZX3uyWofimCicLtlV47znuzdDpuIC0YLorKfgi2RmzZNEP 6siXZIe118U78TSmBQhwskROFRc5kXNgkJxxFDB0OyitN4LDzBCp8YogOWKgRNc2YYyd ylVrH4D2hfLPPN0mRbn3qCN6JKzoxp2Plchffp7ibZO6nsxQgqZR8rDL9d39ndFOjcWv XCDMFKSMPFyN0F5QKq1yix73rC6KuAVx9wWK3+QtE4AKMGiNOANIfqjFWF1BLupH1onN lnW3T225XY/d3ndS/8RnuzzgN1GC18dhtjbNb4npvkqxf98aixEUP3IN0GdO6biKqA6l 4hHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=uxuFp7Xe/E1EEnH+TWX5XbO3EsrDUoO724HR46wCKME=; b=QYO5uxQXKjziNovXFU93utu/npvTxuXK52LyC/9JOKtz6BGIFOoX2V/h/13Y05A58W PeBcdRxCmF5iolkIOs+9Q0wsa+B1qSwLWb+ugUsekbeIWSr7eXliqI8LgNJWF+9IzRpJ BcgG+jYzyjxEWafmUjNw8wdNKBV4vtivivcpu88QAzjNSQaADFonHoqP4skjbF+DWDe9 qtjroti6EF7xm4A9D/ab1lAk87VsEErF/NNl3hnWKi9pJIhLxplT869dj9Um9mzXVJbn AHZ5k/iOfhstnC1yUvFMAD20lSqSjMEttgu+CMOxv4rtwmQ3pEl2HOQJ+wHwV2kVps6+ UShg== X-Gm-Message-State: AIkVDXJklLQazx5+4ei0BTWp9EQQvYwOZMG6dBxP+11bUzsuun7cAy/uNYyho7eowStB4A== X-Received: by 10.28.136.80 with SMTP id k77mr38560690wmd.57.1483034939337; Thu, 29 Dec 2016 10:08:59 -0800 (PST) Received: from spectre.mavhome.dp.ua ([92.38.100.11]) by smtp.gmail.com with ESMTPSA id l67sm66249685wmf.20.2016.12.29.10.08.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Dec 2016 10:08:58 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r310778 - head/sys/cam/ctl To: Mateusz Guzik References: <201612291509.uBTF9YxM055182@repo.freebsd.org> <20161229180223.GD29676@dft-labs.eu> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Alexander Motin Message-ID: <88db7459-d498-7c19-d335-e9e33cf5b529@FreeBSD.org> Date: Thu, 29 Dec 2016 20:08:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161229180223.GD29676@dft-labs.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 18:09:01 -0000 On 29.12.2016 20:02, Mateusz Guzik wrote: > On Thu, Dec 29, 2016 at 03:09:34PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Thu Dec 29 15:09:34 2016 >> New Revision: 310778 >> URL: https://svnweb.freebsd.org/changeset/base/310778 >> >> Log: >> Improve use of I/O's private area. >> >> - Since I/Os are allocates from per-port pools, make allocations store >> pointer to CTL softc there, and use it where needed instead of global. >> - Created bunch of helper macros to access LUN, port and CTL softc. >> > > This fails to build with: > > sys/modules/ctl/../../cam/ctl/ctl.c:12522:27: error: member reference > base type 'void' is not a structure or union > mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED); > > Looks like thep roblem is that CTL_SOFTC indeed does not cast and > returns void instead: > +#define CTL_SOFTC(io) ((io)->io_hdr.ctl_private[CTL_PRIV_LUN].ptrs[1]) Thank you! Fixed. -- Alexander Motin From owner-svn-src-all@freebsd.org Thu Dec 29 19:18:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E39FC96058; Thu, 29 Dec 2016 19:18:39 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CDA01C67; Thu, 29 Dec 2016 19:18:39 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1403) id AF61753C; Thu, 29 Dec 2016 19:18:38 +0000 (UTC) Date: Thu, 29 Dec 2016 20:18:38 +0100 From: "Piotr P. Stefaniak" To: "Rodney W. Grimes" Cc: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r310773 - in stable/11/sys: netinet netinet6 Message-ID: <20161229191838.GB23243@freefall.freebsd.org> References: <201612291132.uBTBWgLM065597@repo.freebsd.org> <201612291438.uBTEcARM006548@pdx.rh.CN85.dnsmgr.net> <20161229170939.GA23243@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6sX45UoQRIJXqkqR" Content-Disposition: inline In-Reply-To: <20161229170939.GA23243@freefall.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 19:18:39 -0000 --6sX45UoQRIJXqkqR Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On 2016-12-29 18:09:39, Piotr P. Stefaniak wrote: >2) the option -ta was added To clarify, what I mean is that the process that generates the sources started using the -ta switch of indent(1), not that the feature was recently implemented. --6sX45UoQRIJXqkqR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEElaLNZulp/QcHQR2KSnkqwcVL7lkFAlhlYYUACgkQSnkqwcVL 7lnq/Qf+I01XC2M7w0b9yJUx8AKQGxQJIw8gG9Ey+23186dVXd0Rm09H+Ci1Rshe n9F+KJe16eQNeeV8Hn/z00pHeEYyIRoJzerrfd9u+6i49W268e9UpsChovnixAK5 3VS3UeQIaRQiYWWgmGalxK4Mg/TedvgrHk4W4O1Ly300MEKwvtyB5FwrYGRsYkm9 dRyUkUctO7FyAuEylzAhcJjzj8Y5K9N2WNyT4rylfKWChX+RbnTf1FnSQ5xIOPzL fyIu62+0XwZ07iZbRle8It5c6aGjlT8Y4XYt2g4VlFUarR/hfDmlkZxUy3xtHr1C faR9W2qmVTzNPuf0SoZnGao7UODczw== =kGwm -----END PGP SIGNATURE----- --6sX45UoQRIJXqkqR-- From owner-svn-src-all@freebsd.org Thu Dec 29 19:57:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63774C96D11; Thu, 29 Dec 2016 19:57:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BE331444; Thu, 29 Dec 2016 19:57:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTJvkKd073985; Thu, 29 Dec 2016 19:57:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTJvkAK073983; Thu, 29 Dec 2016 19:57:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201612291957.uBTJvkAK073983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 29 Dec 2016 19:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310783 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 19:57:47 -0000 Author: ae Date: Thu Dec 29 19:57:46 2016 New Revision: 310783 URL: https://svnweb.freebsd.org/changeset/base/310783 Log: When we are sending IP fragments, update ip pointers in IP_PROBE() for each fragment. MFC after: 1 week Modified: head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Thu Dec 29 18:08:04 2016 (r310782) +++ head/sys/netinet/ip_fastfwd.c Thu Dec 29 19:57:46 2016 (r310783) @@ -400,8 +400,9 @@ passout: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, - ip, NULL); + IP_PROBE(send, NULL, NULL, + mtod(m, struct ip *), nh.nh_ifp, + mtod(m, struct ip *), NULL); /* XXX: we can use cached route here */ error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, (struct sockaddr *)&dst, NULL); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Dec 29 18:08:04 2016 (r310782) +++ head/sys/netinet/ip_output.c Thu Dec 29 19:57:46 2016 (r310783) @@ -696,7 +696,8 @@ sendit: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); + IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp, + mtod(m, struct ip *), NULL); error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); } else From owner-svn-src-all@freebsd.org Thu Dec 29 20:11:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DB11C9633D; Thu, 29 Dec 2016 20:11:51 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07A991F1F; Thu, 29 Dec 2016 20:11:50 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTKBobQ080979; Thu, 29 Dec 2016 20:11:50 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTKBofm080964; Thu, 29 Dec 2016 20:11:50 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612292011.uBTKBofm080964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 29 Dec 2016 20:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310784 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 20:11:51 -0000 Author: kan Date: Thu Dec 29 20:11:50 2016 New Revision: 310784 URL: https://svnweb.freebsd.org/changeset/base/310784 Log: Use mips_dcache_wbinv_range instead of mips_dcache_wb_range on CPU_XBURST Ingenic CPUs treat plain cache writeback as local-only operation and do nothing if that is a remote CPU that holds the dirty cache line. They do broadcast invalidate and write-and-invalidate to other cores though, so take advantage of that and use wbinv in place of wb as this still gives us required busdma semantics. Otherwise we'd have to do IPI to remote CPU ourselves. Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Thu Dec 29 19:57:46 2016 (r310783) +++ head/sys/mips/mips/busdma_machdep.c Thu Dec 29 20:11:50 2016 (r310784) @@ -66,6 +66,16 @@ __FBSDID("$FreeBSD$"); #define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 +/* + * On XBurst cores from Ingenic, cache-line writeback is local + * only, unless accompanied by invalidation. Invalidations force + * dirty line writeout and invalidation requests forwarded to + * other cores if other cores have the cache line dirty. + */ +#if defined(SMP) && defined(CPU_XBURST) +#define BUS_DMA_FORCE_WBINV +#endif + struct bounce_zone; struct bus_dma_tag { @@ -1069,7 +1079,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int /* * dcache invalidation operates on cache line aligned addresses * and could modify areas of memory that share the same cache line - * at the beginning and the ending of the buffer. In order to + * at the beginning and the ending of the buffer. In order to * prevent a data loss we save these chunks in temporary buffer * before invalidation and restore them afer it. * @@ -1099,7 +1109,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: case BUS_DMASYNC_POSTREAD: - /* + /* * Save buffers that might be modified by invalidation */ if (size_cl) @@ -1107,14 +1117,14 @@ bus_dmamap_sync_buf(vm_offset_t buf, int if (size_clend) memcpy (tmp_clend, (void*)buf_clend, size_clend); mips_dcache_inv_range(buf, len); - /* + /* * Restore them */ if (size_cl) memcpy ((void*)buf_cl, tmp_cl, size_cl); if (size_clend) memcpy ((void*)buf_clend, tmp_clend, size_clend); - /* + /* * Copies above have brought corresponding memory * cache lines back into dirty state. Write them back * out and invalidate affected cache lines again if @@ -1132,7 +1142,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int break; case BUS_DMASYNC_PREREAD: - /* + /* * Save buffers that might be modified by invalidation */ if (size_cl) @@ -1147,7 +1157,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int memcpy ((void *)buf_cl, tmp_cl, size_cl); if (size_clend) memcpy ((void *)buf_clend, tmp_clend, size_clend); - /* + /* * Copies above have brought corresponding memory * cache lines back into dirty state. Write them back * out and invalidate affected cache lines again if @@ -1161,7 +1171,11 @@ bus_dmamap_sync_buf(vm_offset_t buf, int break; case BUS_DMASYNC_PREWRITE: +#ifdef BUS_DMA_FORCE_WBINV + mips_dcache_wbinv_range(buf, len); +#else mips_dcache_wb_range(buf, len); +#endif break; } } @@ -1175,19 +1189,24 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, if (op & BUS_DMASYNC_PREWRITE) { if (bpage->datavaddr != 0) bcopy((void *)bpage->datavaddr, - (void *)(bpage->vaddr_nocache != 0 ? + (void *)(bpage->vaddr_nocache != 0 ? bpage->vaddr_nocache : bpage->vaddr), bpage->datacount); else physcopyout(bpage->dataaddr, - (void *)(bpage->vaddr_nocache != 0 ? + (void *)(bpage->vaddr_nocache != 0 ? bpage->vaddr_nocache : bpage->vaddr), bpage->datacount); if (bpage->vaddr_nocache == 0) { +#ifdef BUS_DMA_FORCE_WBINV + mips_dcache_wbinv_range(bpage->vaddr, + bpage->datacount); +#else mips_dcache_wb_range(bpage->vaddr, bpage->datacount); +#endif } dmat->bounce_zone->total_bounced++; } @@ -1197,11 +1216,11 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, bpage->datacount); } if (bpage->datavaddr != 0) - bcopy((void *)(bpage->vaddr_nocache != 0 ? + bcopy((void *)(bpage->vaddr_nocache != 0 ? bpage->vaddr_nocache : bpage->vaddr), (void *)bpage->datavaddr, bpage->datacount); else - physcopyin((void *)(bpage->vaddr_nocache != 0 ? + physcopyin((void *)(bpage->vaddr_nocache != 0 ? bpage->vaddr_nocache : bpage->vaddr), bpage->dataaddr, bpage->datacount); dmat->bounce_zone->total_bounced++; @@ -1214,7 +1233,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus { struct sync_list *sl, *end; int aligned; - + if (op == BUS_DMASYNC_POSTWRITE) return; if (STAILQ_FIRST(&map->bpages)) @@ -1233,7 +1252,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (map->sync_count) { end = &map->slist[map->sync_count]; for (sl = &map->slist[0]; sl != end; sl++) - bus_dmamap_sync_buf(sl->vaddr, sl->datacount, op, + bus_dmamap_sync_buf(sl->vaddr, sl->datacount, op, aligned); } } From owner-svn-src-all@freebsd.org Thu Dec 29 20:27:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC37C96801; Thu, 29 Dec 2016 20:27:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E5BA17CB; Thu, 29 Dec 2016 20:27:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTKRsa6086081; Thu, 29 Dec 2016 20:27:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTKRsxi086080; Thu, 29 Dec 2016 20:27:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201612292027.uBTKRsxi086080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 29 Dec 2016 20:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310785 - head/cddl/lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 20:27:55 -0000 Author: ae Date: Thu Dec 29 20:27:54 2016 New Revision: 310785 URL: https://svnweb.freebsd.org/changeset/base/310785 Log: Convert ipv4_flags and ipv4_offset fields into host byte order. Also save only high bits in the ipv4_flags, because it is defined as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20. Reviewed by: markj@ MFC after: 1 week Modified: head/cddl/lib/libdtrace/ip.d Modified: head/cddl/lib/libdtrace/ip.d ============================================================================== --- head/cddl/lib/libdtrace/ip.d Thu Dec 29 20:11:50 2016 (r310784) +++ head/cddl/lib/libdtrace/ip.d Thu Dec 29 20:27:54 2016 (r310785) @@ -255,8 +255,8 @@ translator ipv4info_t < struct ip *p > { ipv4_tos = p == NULL ? 0 : p->ip_tos; ipv4_length = p == NULL ? 0 : ntohs(p->ip_len); ipv4_ident = p == NULL ? 0 : ntohs(p->ip_id); - ipv4_flags = p == NULL ? 0 : (p->ip_off & 0xe000); - ipv4_offset = p == NULL ? 0 : p->ip_off; + ipv4_flags = p == NULL ? 0 : (ntohs(p->ip_off) & 0xe000) >> 8; + ipv4_offset = p == NULL ? 0 : ntohs(p->ip_off) & 0x1fff; ipv4_ttl = p == NULL ? 0 : p->ip_ttl; ipv4_protocol = p == NULL ? 0 : p->ip_p; ipv4_protostr = p == NULL ? "" : protocols[p->ip_p]; From owner-svn-src-all@freebsd.org Thu Dec 29 20:28:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4329C96892; Thu, 29 Dec 2016 20:28:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50D6E1954; Thu, 29 Dec 2016 20:28:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTKSppw086162; Thu, 29 Dec 2016 20:28:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTKSolC086152; Thu, 29 Dec 2016 20:28:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201612292028.uBTKSolC086152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 29 Dec 2016 20:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310786 - head/tests/sys/geom/class/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 20:28:52 -0000 Author: asomers Date: Thu Dec 29 20:28:50 2016 New Revision: 310786 URL: https://svnweb.freebsd.org/changeset/base/310786 Log: Reduce the runtime of the GELI tests There is no reduction in test coverage. On my system runtime is reduced from 38m32s to 6m24s. tests/sys/geom/class/eli/conf.sh tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh tests/sys/geom/class/eli/onetime_test.sh Move the looping code into common functions in conf.sh, and remove alias ciphers from the list. tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Move a few commands that don't need to be in the inner loop out. tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Reduce the sector count tests/sys/geom/class/eli/Makefile tests/sys/geom/class/eli/init_alias_test.sh Add a test for initializing a GELI device using one of the cipher aliases, and check that the alias is correctly interpreted. MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8814 Added: head/tests/sys/geom/class/eli/init_alias_test.sh (contents, props changed) Modified: head/tests/sys/geom/class/eli/Makefile head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/init_a_test.sh head/tests/sys/geom/class/eli/init_test.sh head/tests/sys/geom/class/eli/integrity_copy_test.sh head/tests/sys/geom/class/eli/integrity_data_test.sh head/tests/sys/geom/class/eli/integrity_hmac_test.sh head/tests/sys/geom/class/eli/onetime_a_test.sh head/tests/sys/geom/class/eli/onetime_test.sh Modified: head/tests/sys/geom/class/eli/Makefile ============================================================================== --- head/tests/sys/geom/class/eli/Makefile Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/Makefile Thu Dec 29 20:28:50 2016 (r310786) @@ -11,6 +11,7 @@ TAP_TESTS_SH+= detach_l_test TAP_TESTS_SH+= init_B_test TAP_TESTS_SH+= init_J_test TAP_TESTS_SH+= init_a_test +TAP_TESTS_SH+= init_alias_test TAP_TESTS_SH+= init_i_P_test TAP_TESTS_SH+= init_test TAP_TESTS_SH+= integrity_copy_test Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/conf.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -11,6 +11,54 @@ while [ -c /dev/md$no ]; do : $(( no += 1 )) done +# Execute `func` for each combination of cipher, sectorsize, and hmac algo +# `func` usage should be: +# func +for_each_geli_config() { + func=$1 + + for cipher in aes-xts:128 aes-xts:256 \ + aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des-cbc:192 \ + blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ + blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ + blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \ + hmac/sha384 hmac/sha512; do + for secsize in 512 1024 2048 4096 8192; do + ${func} $cipher $aalgo $secsize + done + done + done +} + +# Execute `func` for each combination of cipher, and sectorsize, with no hmac +# `func` usage should be: +# func +for_each_geli_config_nointegrity() { + func=$1 + + for cipher in aes-xts:128 aes-xts:256 \ + aes-cbc:128 aes-cbc:192 aes-cbc:256 \ + 3des-cbc:192 \ + blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ + blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ + blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do + ealgo=${cipher%%:*} + keylen=${cipher##*:} + for secsize in 512 1024 2048 4096 8192; do + ${func} $cipher $aalgo $secsize + done + done +} + + geli_test_cleanup() { [ -c /dev/md${no}.eli ] && geli detach md${no}.eli Modified: head/tests/sys/geom/class/eli/init_a_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_a_test.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/init_a_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -6,55 +6,45 @@ base=`basename $0` sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 +rnd=`mktemp $base.XXXXXX` || exit 1 -echo "1..1380" - -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do +do_test() { + cipher=$1 + aalgo=$2 + secsize=$3 ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done - done -done + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no +} + +echo "1..600" + +i=1 + +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${rnd} bs=8192 count=${sectors} >/dev/null 2>&1 + +for_each_geli_config do_test + +rm -f $rnd rm -f $keyfile Added: head/tests/sys/geom/class/eli/init_alias_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/init_alias_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -0,0 +1,64 @@ +#!/bin/sh +# $FreeBSD$ + +# Test "geli init"'s various cipher aliases +. $(dirname $0)/conf.sh + +base=`basename $0` +sectors=100 +keyfile=`mktemp $base.XXXXXX` || exit 1 +rnd=`mktemp $base.XXXXXX` || exit 1 + +do_test() { + ealgo=$1 + keylen=$2 + expected_ealgo=$3 + expected_keylen=$4 + + geli init -B none -e $ealgo -l $keylen -P -K $keyfile md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + real_ealgo=`geli list md${no}.eli | awk '/EncryptionAlgorithm/ {print $2}'` + real_keylen=`geli list md${no}.eli | awk '/KeyLength/ {print $2}'` + + if [ ${real_ealgo} = ${expected_ealgo} ]; then + echo "ok $i - ${ealgo} aliased to ${real_ealgo}" + else + echo "not ok $i - expected ${expected_ealgo} but got ${real_ealgo}" + fi + i=$((i+1)) + + if [ ${real_keylen} = ${expected_keylen} ]; then + echo "ok $i - keylen=${keylen} for ealgo=${ealgo} aliases to ${real_keylen}" + else + echo "not ok $i - expected ${expected_keylen} but got ${real_keylen}" + fi + i=$((i+1)) + + geli detach md${no} +} + +echo "1..38" +i=1 +mdconfig -a -t malloc -s 1024k -u $no || exit 1 +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +for spec in aes:0:AES-XTS:128 aes:128:AES-XTS:128 aes:256:AES-XTS:256 \ + 3des:0:3DES-CBC:192 3des:192:3DES-CBC:192 \ + blowfish:0:Blowfish-CBC:128 blowfish:128:Blowfish-CBC:128 \ + blowfish:160:Blowfish-CBC:160 blowfish:192:Blowfish-CBC:192 \ + blowfish:224:Blowfish-CBC:224 blowfish:256:Blowfish-CBC:256 \ + blowfish:288:Blowfish-CBC:288 blowfish:352:Blowfish-CBC:352 \ + blowfish:384:Blowfish-CBC:384 blowfish:416:Blowfish-CBC:416 \ + blowfish:448:Blowfish-CBC:448 \ + camellia:0:CAMELLIA-CBC:128 camellia:128:CAMELLIA-CBC:128 \ + camellia:256:CAMELLIA-CBC:256 ; do + + ealgo=`echo $spec | cut -d : -f 1` + keylen=`echo $spec | cut -d : -f 2` + expected_ealgo=`echo $spec | cut -d : -f 3` + expected_keylen=`echo $spec | cut -d : -f 4` + + do_test $ealgo $keylen $expected_ealgo $expected_keylen +done + +rm -f $keyfile Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/init_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -4,62 +4,52 @@ . $(dirname $0)/conf.sh base=`basename $0` -sectors=100 +sectors=32 keyfile=`mktemp $base.XXXXXX` || exit 1 +rnd=`mktemp $base.XXXXXX` || exit 1 -echo "1..460" +echo "1..200" -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do +do_test() { + cipher=$1 + secsize=$2 ealgo=${cipher%%:*} keylen=${cipher##*:} - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - if [ ${md_rnd} != ${md_edev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done -done + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + + geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + if [ ${md_rnd} != ${md_edev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no +} + +i=1 +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 +for_each_geli_config_nointegrity do_test + +rm -f $rnd rm -f $keyfile Modified: head/tests/sys/geom/class/eli/integrity_copy_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_copy_test.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/integrity_copy_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -4,96 +4,85 @@ . $(dirname $0)/conf.sh base=`basename $0` -sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 -echo "1..5520" +echo "1..2400" -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do +do_test() { + cipher=$1 + aalgo=$2 + secsize=$3 ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - #mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - mdconfig -a -t malloc -s $sectors -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Copy first small sector to the second small sector. - # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` - ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Copy first big sector to the second big sector. - # This should be detected as corruption. - dd if=/dev/md${no} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done + + mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + geli attach -p -k $keyfile md${no} + + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Copy first small sector to the second small sector. + # This should be detected as corruption. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - small 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + ms=`diskinfo /dev/md${no} | awk '{print $3 - 512}'` + ns=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` + + # Fix the corruption + dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + + dd if=/dev/md${no}.eli bs=${secsize} count=2 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - big 1 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + # Copy first big sector to the second big sector. + # This should be detected as corruption. + dd if=/dev/md${no} of=${sector} bs=${usecsize} count=1 >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=${usecsize} count=1 seek=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=2 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - big 2 aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no +} + + +i=1 +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +for_each_geli_config do_test rm -f $keyfile $sector Modified: head/tests/sys/geom/class/eli/integrity_data_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_data_test.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/integrity_data_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -4,66 +4,42 @@ . $(dirname $0)/conf.sh base=`basename $0` -sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 -echo "1..2760" +echo "1..600" -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do +do_test() { + cipher=$1 + aalgo=$2 + secsize=$3 ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Corrupt 8 bytes of data. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=/dev/random of=${sector} bs=1 count=8 seek=64 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done + + mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + + # Corrupt 8 bytes of data. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/random of=${sector} bs=1 count=8 seek=64 conv=notrunc >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli of=/dev/null bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no +} + +i=1 +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +for_each_geli_config do_test rm -f $keyfile $sector Modified: head/tests/sys/geom/class/eli/integrity_hmac_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_hmac_test.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/integrity_hmac_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -4,66 +4,43 @@ . $(dirname $0)/conf.sh base=`basename $0` -sectors=100 keyfile=`mktemp $base.XXXXXX` || exit 1 sector=`mktemp $base.XXXXXX` || exit 1 -echo "1..2760" +echo "1..600" -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do +do_test() { + cipher=$1 + aalgo=$2 + secsize=$3 ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 1 - - dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 - - geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null - geli attach -p -k $keyfile md${no} - - dd if=/dev/random of=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - # Corrupt 8 bytes of HMAC. - dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 - dd if=/dev/random of=${sector} bs=1 count=16 conv=notrunc >/dev/null 2>&1 - dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 - geli attach -p -k $keyfile md${no} - - dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - mdconfig -d -u $no - done - done -done + + mdconfig -a -t malloc -s `expr $secsize \* 2 + 512`b -u $no || exit 2 + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K $keyfile -s $secsize md${no} 2>/dev/null + + # Corrupt 8 bytes of HMAC. + dd if=/dev/md${no} of=${sector} bs=512 count=1 >/dev/null 2>&1 + dd if=/dev/random of=${sector} bs=1 count=16 conv=notrunc >/dev/null 2>&1 + dd if=${sector} of=/dev/md${no} bs=512 count=1 >/dev/null 2>&1 + geli attach -p -k $keyfile md${no} + + dd if=/dev/md${no}.eli bs=${secsize} count=1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no +} + + +i=1 +dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 + +for_each_geli_config do_test rm -f $keyfile $sector Modified: head/tests/sys/geom/class/eli/onetime_a_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_a_test.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/onetime_a_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -4,51 +4,42 @@ . $(dirname $0)/conf.sh base=`basename $0` -sectors=100 +sectors=8 +rnd=`mktemp $base.XXXXXX` || exit 1 -echo "1..1380" +echo "1..600" -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do +do_test() { + cipher=$1 + aalgo=$2 + secsize=$3 ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 - - geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done - done -done + + mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 + geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + mdconfig -d -u $no +} + +i=1 +dd if=/dev/random of=${rnd} bs=1024 count=1024 >/dev/null 2>&1 + +for_each_geli_config do_test + +rm -f $rnd Modified: head/tests/sys/geom/class/eli/onetime_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_test.sh Thu Dec 29 20:27:54 2016 (r310785) +++ head/tests/sys/geom/class/eli/onetime_test.sh Thu Dec 29 20:28:50 2016 (r310786) @@ -6,54 +6,45 @@ base=`basename $0` sectors=100 -echo "1..460" +echo "1..200" -i=1 -for cipher in aes:0 aes:128 aes:256 \ - aes-xts:0 aes-xts:128 aes-xts:256 \ - aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des:0 3des:192 \ - 3des-cbc:0 3des-cbc:192 \ - blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ - blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ - blowfish:416 blowfish:448 \ - blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ - blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ - camellia:0 camellia:128 camellia:192 camellia:256 \ - camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do +do_test() { + cipher=$1 + secsize=$2 ealgo=${cipher%%:*} keylen=${cipher##*:} - for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp $base.XXXXXX` || exit 1 - mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 - - geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null - - secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` - - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null - - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` - - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - if [ ${md_rnd} != ${md_edev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - fi - i=$((i+1)) - - geli detach md${no} - rm -f $rnd - mdconfig -d -u $no - done -done + + rnd=`mktemp $base.XXXXXX` || exit 1 + mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 + + geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null + + secs=`diskinfo /dev/md${no}.eli | awk '{print $4}'` + + dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 + dd if=${rnd} of=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null + + md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/md${no}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_edev=`dd if=/dev/md${no} bs=${secsize} count=${secs} 2>/dev/null | md5` + + if [ ${md_rnd} = ${md_ddev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + if [ ${md_rnd} != ${md_edev} ]; then + echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + else + echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + i=$((i+1)) + + geli detach md${no} + rm -f $rnd + mdconfig -d -u $no +} + +i=1 +for_each_geli_config_nointegrity do_test From owner-svn-src-all@freebsd.org Thu Dec 29 21:03:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2C6BC9675E; Thu, 29 Dec 2016 21:03:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91DE01074; Thu, 29 Dec 2016 21:03:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTL30am001966; Thu, 29 Dec 2016 21:03:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTL30qV001965; Thu, 29 Dec 2016 21:03:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612292103.uBTL30qV001965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Dec 2016 21:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310787 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:03:01 -0000 Author: markj Date: Thu Dec 29 21:03:00 2016 New Revision: 310787 URL: https://svnweb.freebsd.org/changeset/base/310787 Log: MFC r309657: Require the STACK option for code that captures stacks of running threads. Modified: stable/11/sys/x86/x86/mca.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/mca.c ============================================================================== --- stable/11/sys/x86/x86/mca.c Thu Dec 29 20:28:50 2016 (r310786) +++ stable/11/sys/x86/x86/mca.c Thu Dec 29 21:03:00 2016 (r310787) @@ -508,7 +508,7 @@ mca_record_entry(enum scan_mode mode, co STAILQ_INSERT_TAIL(&mca_records, rec, link); mca_count++; mtx_unlock_spin(&mca_lock); - if (mode == CMCI) + if (mode == CMCI && !cold) taskqueue_enqueue(mca_tq, &mca_refill_task); } @@ -714,6 +714,9 @@ mca_createtq(void *dummy) mca_tq = taskqueue_create_fast("mca", M_WAITOK, taskqueue_thread_enqueue, &mca_tq); taskqueue_start_threads(&mca_tq, 1, PI_SWI(SWI_TQ), "mca taskq"); + + /* CMCIs during boot may have claimed items from the freelist. */ + mca_fill_freelist(); } SYSINIT(mca_createtq, SI_SUB_CONFIGURE, SI_ORDER_ANY, mca_createtq, NULL); From owner-svn-src-all@freebsd.org Thu Dec 29 21:05:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DFD2C96853; Thu, 29 Dec 2016 21:05:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0817C120F; Thu, 29 Dec 2016 21:05:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x242.google.com with SMTP id 3so24270329qtr.2; Thu, 29 Dec 2016 13:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JA7dJb/98pmoIo205lKDDkzeJLlDG1O/c7FSWtJkHJ4=; b=H+jL6s2gm+afswCIrJJo1Ol7uyuJgNz+qM+ioj7RClCgt4HoqZeoqqbyP3mup61wN0 K9+FJ7gOA6yX64Dj7Owg03LUQuQzbL/0aQUB0Q93uf7eHmQj6J3dcV7LUDdd06DRAKav 2Rs3HrjYLzTA8Cs8ECZpIy5bvIIYaiQJ4aHhFynlLelOyrdt993t5aFbl3+rVejla49H 7W7FZy8/T2Rk3EjMu+vV6J9upeCNX32bxkcQ3gXhb7FFQ2BPYRtDU+wdWho0ZMER9KV0 OFssVwRCcWi+P/WCQoyPJ+6rEml/GsZLM+3ZeIM/J33tvWW8QJsijPqrjfb1NWRMG51s AI2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=JA7dJb/98pmoIo205lKDDkzeJLlDG1O/c7FSWtJkHJ4=; b=c2KpojOxxMkQBAqImhd3wwVMxH41hf/Vkds5zGXRIlFzilXPnO0VnQWDrOvPsKDsCE ce5aXNCJ11r+vdHt/M+g7pFDdpIdZxB3UQIkspUj8xJUCjoJIURw/AEDwkwtBR+JKJqu trVhvnAws+uNb3b32bkrMW/eJBTaULA8Ft1g4C1ZL+dxA4jOsH5EVu5iNrkccYhlcDZU oD1L8Eg6RCwLkMBrtnjv5bdVSNyrOL4NwlREDpFjTbjEJWflExgOhU5y6a3WKkwL84mo HAWyF9E8yvLVCdjINrRVJdzXIur1UJo4wf5sTftWa0gq7NoVPqZ2LIUC/3IYK6neM9cg DOJg== X-Gm-Message-State: AIkVDXKdAk2BqbZo2+koLM3fA8RZDDiW/TsEqaWB3ElfFcnOL9r0JR6Kw0sbDcqq3mb00A== X-Received: by 10.237.47.227 with SMTP id m90mr40040504qtd.120.1483045527099; Thu, 29 Dec 2016 13:05:27 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id 83sm26673609qky.43.2016.12.29.13.05.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Dec 2016 13:05:26 -0800 (PST) Sender: Mark Johnston Date: Thu, 29 Dec 2016 13:11:37 -0800 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r310787 - stable/11/sys/x86/x86 Message-ID: <20161229211137.GD29960@wkstn-mjohnston.west.isilon.com> References: <201612292103.uBTL30qV001965@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612292103.uBTL30qV001965@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:05:28 -0000 On Thu, Dec 29, 2016 at 09:03:00PM +0000, Mark Johnston wrote: > Author: markj > Date: Thu Dec 29 21:03:00 2016 > New Revision: 310787 > URL: https://svnweb.freebsd.org/changeset/base/310787 > > Log: > MFC r309657: > Require the STACK option for code that captures stacks of running threads. > > Modified: > stable/11/sys/x86/x86/mca.c > Directory Properties: > stable/11/ (props changed) The commit message is wrong - this was an MFC of r310084. From owner-svn-src-all@freebsd.org Thu Dec 29 21:06:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03217C96946; Thu, 29 Dec 2016 21:06:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD8DF138C; Thu, 29 Dec 2016 21:06:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTL6V8S002150; Thu, 29 Dec 2016 21:06:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTL6Vba002149; Thu, 29 Dec 2016 21:06:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612292106.uBTL6Vba002149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Dec 2016 21:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310788 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:06:33 -0000 Author: markj Date: Thu Dec 29 21:06:31 2016 New Revision: 310788 URL: https://svnweb.freebsd.org/changeset/base/310788 Log: MFC r309657: Require the STACK option for code that captures stacks of running threads. Modified: stable/11/sys/x86/x86/stack_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/stack_machdep.c ============================================================================== --- stable/11/sys/x86/x86/stack_machdep.c Thu Dec 29 21:03:00 2016 (r310787) +++ stable/11/sys/x86/x86/stack_machdep.c Thu Dec 29 21:06:31 2016 (r310788) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_stack.h" + #include #include #include @@ -59,6 +61,7 @@ typedef struct i386_frame *x86_frame_t; typedef struct amd64_frame *x86_frame_t; #endif +#ifdef STACK static struct stack *nmi_stack; static volatile struct thread *nmi_pending; @@ -66,6 +69,7 @@ static volatile struct thread *nmi_pendi static struct mtx nmi_lock; MTX_SYSINIT(nmi_lock, &nmi_lock, "stack_nmi", MTX_SPIN); #endif +#endif static void stack_capture(struct thread *td, struct stack *st, register_t fp) @@ -95,6 +99,7 @@ int stack_nmi_handler(struct trapframe *tf) { +#ifdef STACK /* Don't consume an NMI that wasn't meant for us. */ if (nmi_stack == NULL || curthread != nmi_pending) return (0); @@ -107,6 +112,9 @@ stack_nmi_handler(struct trapframe *tf) atomic_store_rel_ptr((long *)&nmi_pending, (long)NULL); return (1); +#else + return (0); +#endif } void @@ -125,6 +133,7 @@ int stack_save_td_running(struct stack *st, struct thread *td) { +#ifdef STACK THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_IS_RUNNING(td)); @@ -148,10 +157,13 @@ stack_save_td_running(struct stack *st, if (st->depth == 0) /* We interrupted a thread in user mode. */ return (EAGAIN); -#else +#else /* !SMP */ KASSERT(0, ("curthread isn't running")); -#endif +#endif /* SMP */ return (0); +#else /* !STACK */ + return (EOPNOTSUPP); +#endif /* STACK */ } void From owner-svn-src-all@freebsd.org Thu Dec 29 21:30:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FED8C96391; Thu, 29 Dec 2016 21:30:53 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F98012FA; Thu, 29 Dec 2016 21:30:53 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTLUq57011630; Thu, 29 Dec 2016 21:30:52 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTLUqus011628; Thu, 29 Dec 2016 21:30:52 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612292130.uBTLUqus011628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 29 Dec 2016 21:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310789 - head/lib/libpam/static_libpam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:30:53 -0000 Author: kan Date: Thu Dec 29 21:30:52 2016 New Revision: 310789 URL: https://svnweb.freebsd.org/changeset/base/310789 Log: Use compiler driver to build relocatable object This works better with external toolchains where LD will not necessarily defailt to emulation we want. Compiler driver knows better. Modified: head/lib/libpam/static_libpam/Makefile Modified: head/lib/libpam/static_libpam/Makefile ============================================================================== --- head/lib/libpam/static_libpam/Makefile Thu Dec 29 21:06:31 2016 (r310788) +++ head/lib/libpam/static_libpam/Makefile Thu Dec 29 21:30:52 2016 (r310789) @@ -64,6 +64,6 @@ CLEANFILES+= openpam_static.o \ openpam_static_modules.o openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} - ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} + ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC} .include "${.CURDIR}/../libpam/Makefile" From owner-svn-src-all@freebsd.org Thu Dec 29 21:36:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB0D0C966C6; Thu, 29 Dec 2016 21:36:05 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73F481950; Thu, 29 Dec 2016 21:36:05 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTLa48N014149; Thu, 29 Dec 2016 21:36:04 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTLa4Yq014148; Thu, 29 Dec 2016 21:36:04 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612292136.uBTLa4Yq014148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 29 Dec 2016 21:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310790 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:36:05 -0000 Author: kan Date: Thu Dec 29 21:36:04 2016 New Revision: 310790 URL: https://svnweb.freebsd.org/changeset/base/310790 Log: Use TARGET_ARCH instead of MACHINE_ARCH for MIPS kernel MACHINE_ARCH is overwritten by config file and will not contain -hf suffix, so uname -p reported by kernel will be wrong. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Dec 29 21:30:52 2016 (r310789) +++ head/sys/conf/kern.pre.mk Thu Dec 29 21:36:04 2016 (r310790) @@ -74,7 +74,7 @@ CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KE CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 .if ${MACHINE_CPUARCH} == "mips" -CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${MACHINE_ARCH}"' +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${TARGET_ARCH}"' .endif CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} From owner-svn-src-all@freebsd.org Thu Dec 29 21:55:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8283FC96E61; Thu, 29 Dec 2016 21:55:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51CA01366; Thu, 29 Dec 2016 21:55:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTLtNUF022329; Thu, 29 Dec 2016 21:55:23 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTLtNc5022328; Thu, 29 Dec 2016 21:55:23 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612292155.uBTLtNc5022328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 29 Dec 2016 21:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310791 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:55:24 -0000 Author: gonzo Date: Thu Dec 29 21:55:23 2016 New Revision: 310791 URL: https://svnweb.freebsd.org/changeset/base/310791 Log: [qemu] Fix VERSATILEPB kernel boot in QEMU broken by r300968 QEMU does not implement hardware debug registers so when dbg_monitor_is_enabled is called kernel receives "invalid instruction" exception. QEMU implements only DIDR register and on read returns all zeroes to indicate that it doesn't support other registers. Real hardware has Version bits set. MFC after: 1 week Modified: head/sys/arm/arm/debug_monitor.c Modified: head/sys/arm/arm/debug_monitor.c ============================================================================== --- head/sys/arm/arm/debug_monitor.c Thu Dec 29 21:36:04 2016 (r310790) +++ head/sys/arm/arm/debug_monitor.c Thu Dec 29 21:55:23 2016 (r310791) @@ -792,10 +792,21 @@ dbg_get_ossr(void) static __inline boolean_t dbg_arch_supported(void) { + uint32_t dbg_didr; switch (dbg_model) { case ID_DFR0_CP_DEBUG_M_V6: case ID_DFR0_CP_DEBUG_M_V6_1: + dbg_didr = cp14_dbgdidr_get(); + /* + * read-all-zeroes is used by QEMU + * to indicate that ARMv6 debug support + * is not implemented. Real hardware has at + * least version bits set + */ + if (dbg_didr == 0) + return (FALSE); + return (TRUE); case ID_DFR0_CP_DEBUG_M_V7: case ID_DFR0_CP_DEBUG_M_V7_1: /* fall through */ return (TRUE); From owner-svn-src-all@freebsd.org Thu Dec 29 21:57:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89B62C96ED2; Thu, 29 Dec 2016 21:57:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD011597; Thu, 29 Dec 2016 21:57:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTLvGR3022470; Thu, 29 Dec 2016 21:57:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTLvGWJ022468; Thu, 29 Dec 2016 21:57:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612292157.uBTLvGWJ022468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 29 Dec 2016 21:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310792 - in head: lib/clang/libllvm usr.bin/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:57:17 -0000 Author: dim Date: Thu Dec 29 21:57:16 2016 New Revision: 310792 URL: https://svnweb.freebsd.org/changeset/base/310792 Log: Revert r310775 for now, until we can figure out why it does not seem to work properly when cross-building. Sorry for the breakage. Modified: head/lib/clang/libllvm/Makefile head/usr.bin/clang/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Thu Dec 29 21:55:23 2016 (r310791) +++ head/lib/clang/libllvm/Makefile Thu Dec 29 21:57:16 2016 (r310792) @@ -308,24 +308,24 @@ SRCS_MIN+= DebugInfo/CodeView/TypeRecord SRCS_MIN+= DebugInfo/CodeView/TypeRecordBuilder.cpp SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp SRCS_MIN+= DebugInfo/CodeView/TypeTableBuilder.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp -SRCS_MIW+= DebugInfo/DWARF/SyntaxHighlighting.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFCompileUnit.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFContext.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAranges.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugFrame.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLine.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLoc.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugMacro.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFDebugRangeList.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFFormValue.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFTypeUnit.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFUnit.cpp +SRCS_EXT+= DebugInfo/DWARF/DWARFUnitIndex.cpp +SRCS_EXT+= DebugInfo/DWARF/SyntaxHighlighting.cpp SRCS_EXT+= DebugInfo/PDB/GenericError.cpp SRCS_EXT+= DebugInfo/PDB/PDB.cpp SRCS_EXT+= DebugInfo/PDB/PDBContext.cpp @@ -699,7 +699,7 @@ SRCS_MIN+= Target/AArch64/AArch64TargetO SRCS_MIN+= Target/AArch64/AArch64TargetTransformInfo.cpp SRCS_MIN+= Target/AArch64/AsmParser/AArch64AsmParser.cpp SRCS_XDB+= Target/AArch64/Disassembler/AArch64Disassembler.cpp -SRCS_XDW+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp +SRCS_XDB+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp SRCS_MIN+= Target/AArch64/InstPrinter/AArch64InstPrinter.cpp SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp @@ -880,7 +880,7 @@ SRCS_MIN+= Target/TargetSubtargetInfo.cp SRCS_MIN+= Target/X86/AsmParser/X86AsmInstrumentation.cpp SRCS_MIN+= Target/X86/AsmParser/X86AsmParser.cpp SRCS_XDB+= Target/X86/Disassembler/X86Disassembler.cpp -SRCS_XDW+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp +SRCS_XDB+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp SRCS_MIN+= Target/X86/InstPrinter/X86ATTInstPrinter.cpp SRCS_MIN+= Target/X86/InstPrinter/X86InstComments.cpp SRCS_MIN+= Target/X86/InstPrinter/X86IntelInstPrinter.cpp @@ -1090,9 +1090,6 @@ SRCS_MIN+= Transforms/Vectorize/SLPVecto SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp SRCS_ALL+= ${SRCS_MIN} -.if !defined(TOOLS_PREFIX) -SRCS_ALL+= ${SRCS_MIW} -.endif .if ${MK_CLANG_EXTRAS} != "no" SRCS_ALL+= ${SRCS_EXT} .endif @@ -1108,9 +1105,6 @@ SRCS_ALL+= ${SRCS_XDB} .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no" SRCS_ALL+= ${SRCS_XDL} .endif -.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || !defined(TOOLS_PREFIX) -SRCS_ALL+= ${SRCS_XDW} -.endif SRCS+= ${SRCS_ALL:O} llvm/IR/Attributes.inc: ${LLVM_SRCS}/include/llvm/IR/Attributes.td Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Thu Dec 29 21:55:23 2016 (r310791) +++ head/usr.bin/clang/Makefile Thu Dec 29 21:57:16 2016 (r310792) @@ -7,8 +7,6 @@ SUBDIR+= clang-tblgen SUBDIR+= llvm-tblgen .if !defined(TOOLS_PREFIX) -SUBDIR+= llvm-objdump - .if ${MK_CLANG_EXTRAS} != "no" SUBDIR+= bugpoint SUBDIR+= clang-format @@ -27,6 +25,7 @@ SUBDIR+= llvm-link SUBDIR+= llvm-lto SUBDIR+= llvm-mc SUBDIR+= llvm-nm +SUBDIR+= llvm-objdump SUBDIR+= llvm-pdbdump SUBDIR+= llvm-profdata SUBDIR+= llvm-rtdyld From owner-svn-src-all@freebsd.org Thu Dec 29 21:57:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CF54C96F41 for ; Thu, 29 Dec 2016 21:57:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB881707 for ; Thu, 29 Dec 2016 21:57:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id b123so40115880itb.2 for ; Thu, 29 Dec 2016 13:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zJXTIwJ/gwvLhnjsZPWR0uDdMXpUIu+q/Aat+5Sk0rM=; b=kaMn4wAMwzjNy1wyEwDAPvVepmhbMcpYgSv75ikTg4DlDtY78L8stImmcWz6MXK3rh J6ckMmql0u0Zf9Fgzj04zIFlfmM3gObltmeunv4YaRFRTWfSI3SHRY4YJtX2p6g1LmJ1 TlMdji41WQDUgT6s/J9mXjRZOTyVdt8j5BsaRBymn3S+0MP+70BNxGP9JsZ3891Fu/8X 2PFqG1nhnEZ0CzftDtkQNVHPwEhnrbX0j6vZSnaOc88SJBWrY+2WrR7EfSWvft9/Ydhk 7jMuJnl2Ii6DY27cnS71UDjDdeO1ai56sX7UI9tLWMYv35wALTyrjlQsh/eSnIPGKqD4 OjqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zJXTIwJ/gwvLhnjsZPWR0uDdMXpUIu+q/Aat+5Sk0rM=; b=BleIaJDTcJJdlED3NpZVjuPitD0kUFUnKLWAp0sgIFSJ1Pg8Bq1HSrpaeyVVJP8+c7 x8BqiyI6YHi7PvhKfAX9YW5tSl4ulmmV6AATpgnE/o0eiYioeaW5kqkVRMsjFSh7D5MG z0yR6lat3xXSQSlfqC9B2S5AnOQs1ODJt0b7jqvwELEroNcC2MhJOS85WwddZ1CxyeVL sfDo6qYFPZ6gIJBp6nDUyfVfrFlzPuXg+xiom76F9b2dreeMwOUP/lgW4ni0IX4yf3ws pOPSHFasq+hICNpshu1ZR+5xRV4M74J+ztmK7gagYqZZknO9e14fR+aFlBxysAAAxXhX vxFw== X-Gm-Message-State: AIkVDXLtGC9LDal1g/9YWFjplThcMEFfJDM0B2ZAKFy/AJCIrWUYkEGS5nYb9zVfaTjedoWoH66a7re+IyQyGQ== X-Received: by 10.36.73.134 with SMTP id e6mr4522124itd.60.1483048670288; Thu, 29 Dec 2016 13:57:50 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.22.135 with HTTP; Thu, 29 Dec 2016 13:57:49 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <201612292136.uBTLa4Yq014148@repo.freebsd.org> References: <201612292136.uBTLa4Yq014148@repo.freebsd.org> From: Warner Losh Date: Thu, 29 Dec 2016 14:57:49 -0700 X-Google-Sender-Auth: WjSGcJUqAz_D-MWRo-Z4Jkr5_eU Message-ID: Subject: Re: svn commit: r310790 - head/sys/conf To: Alexander Kabaev Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 21:57:51 -0000 On Thu, Dec 29, 2016 at 2:36 PM, Alexander Kabaev wrote: > Author: kan > Date: Thu Dec 29 21:36:04 2016 > New Revision: 310790 > URL: https://svnweb.freebsd.org/changeset/base/310790 > > Log: > Use TARGET_ARCH instead of MACHINE_ARCH for MIPS kernel TARGET_ARCH is only defined for cross builds. I'm pretty sure this is wrong. It won't work for native builds. TARGET_ARCH only has meaning in Makefile.inc1. > MACHINE_ARCH is overwritten by config file and will not > contain -hf suffix, so uname -p reported by kernel will > be wrong. Then that must be fixed instead. Warner > Modified: > head/sys/conf/kern.pre.mk > > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Thu Dec 29 21:30:52 2016 (r310789) > +++ head/sys/conf/kern.pre.mk Thu Dec 29 21:36:04 2016 (r310790) > @@ -74,7 +74,7 @@ CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KE > CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 > CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 > .if ${MACHINE_CPUARCH} == "mips" > -CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${MACHINE_ARCH}"' > +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${TARGET_ARCH}"' > .endif > CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT} > CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} > From owner-svn-src-all@freebsd.org Thu Dec 29 22:36:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4C9FC96EBF; Thu, 29 Dec 2016 22:36:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 845541DCA; Thu, 29 Dec 2016 22:36:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTMaGwE038799; Thu, 29 Dec 2016 22:36:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTMaG5B038798; Thu, 29 Dec 2016 22:36:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612292236.uBTMaG5B038798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 29 Dec 2016 22:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310793 - head/sys/dev/rtwn/rtl8812a X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 22:36:17 -0000 Author: avos Date: Thu Dec 29 22:36:16 2016 New Revision: 310793 URL: https://svnweb.freebsd.org/changeset/base/310793 Log: rtwn: silence compiler warning (-Wmaybe-uninitialized). Reported by: adrian Modified: head/sys/dev/rtwn/rtl8812a/r12a_chan.c Modified: head/sys/dev/rtwn/rtl8812a/r12a_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_chan.c Thu Dec 29 21:57:16 2016 (r310792) +++ head/sys/dev/rtwn/rtl8812a/r12a_chan.c Thu Dec 29 22:36:16 2016 (r310793) @@ -332,7 +332,7 @@ r12a_set_band(struct rtwn_softc *sc, str /* XXX PATH_B is set by vendor driver. */ for (i = 0; i < 2; i++) { - uint16_t val; + uint16_t val = 0; switch ((swing >> i * 2) & 0x3) { case 0: From owner-svn-src-all@freebsd.org Fri Dec 30 00:34:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB312C97662; Fri, 30 Dec 2016 00:34:53 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5DA31363; Fri, 30 Dec 2016 00:34:53 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU0YqwZ088923; Fri, 30 Dec 2016 00:34:52 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU0YqFA088918; Fri, 30 Dec 2016 00:34:52 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612300034.uBU0YqFA088918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Fri, 30 Dec 2016 00:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310794 - in head/sys: conf mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 00:34:54 -0000 Author: kan Date: Fri Dec 30 00:34:52 2016 New Revision: 310794 URL: https://svnweb.freebsd.org/changeset/base/310794 Log: Support mips[*]hf variants in config files Recognize new MACHINE_ARCH names now as we have added hardfloat support. Switch JZ4780 to mipselhf and remove all uses of TARGET_ARCH in kernel .mk files. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D8989 Modified: head/sys/conf/files.mips head/sys/conf/kern.mk head/sys/conf/kern.pre.mk head/sys/conf/options.mips head/sys/mips/conf/JZ4780 Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Dec 29 22:36:16 2016 (r310793) +++ head/sys/conf/files.mips Fri Dec 30 00:34:52 2016 (r310794) @@ -52,7 +52,7 @@ kern/kern_clocksource.c standard kern/link_elf_obj.c standard kern/subr_busdma_bufalloc.c standard kern/subr_dummy_vdso_tc.c standard -kern/subr_sfbuf.c optional mips | mipsel | mipsn32 +kern/subr_sfbuf.c standard # gcc/clang runtime libkern/ffsl.c standard @@ -61,8 +61,8 @@ libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard libkern/memmove.c standard -libkern/cmpdi2.c optional mips | mipsel -libkern/ucmpdi2.c optional mips | mipsel +libkern/cmpdi2.c optional mips | mipshf | mipsel | mipselhf +libkern/ucmpdi2.c optional mips | mipshf | mipsel | mipselhf libkern/ashldi3.c standard libkern/ashrdi3.c standard Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Dec 29 22:36:16 2016 (r310793) +++ head/sys/conf/kern.mk Fri Dec 30 00:34:52 2016 (r310794) @@ -184,7 +184,7 @@ CFLAGS.gcc+= -mcall-aixdesc .if ${MACHINE_CPUARCH} == "mips" CFLAGS+= -msoft-float INLINE_LIMIT?= 8000 -.if ${TARGET_ARCH:Mmips*hf} != "" +.if ${MACHINE_ARCH:Mmips*hf} != "" CFLAGS+= -DCPU_HAVEFPU .endif .endif Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Dec 29 22:36:16 2016 (r310793) +++ head/sys/conf/kern.pre.mk Fri Dec 30 00:34:52 2016 (r310794) @@ -74,7 +74,7 @@ CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KE CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 .if ${MACHINE_CPUARCH} == "mips" -CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${TARGET_ARCH}"' +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${MACHINE_ARCH}"' .endif CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Thu Dec 29 22:36:16 2016 (r310793) +++ head/sys/conf/options.mips Fri Dec 30 00:34:52 2016 (r310794) @@ -50,9 +50,13 @@ CPU_MALTA opt_global.h # which MACHINE_ARCH architecture MIPS +MIPSHF MIPSEL +MIPSELHF MIPS64 +MIPS64HF MIPS64EL +MIPS64ELHF MIPSN32 COMPAT_FREEBSD32 opt_compat.h Modified: head/sys/mips/conf/JZ4780 ============================================================================== --- head/sys/mips/conf/JZ4780 Thu Dec 29 22:36:16 2016 (r310793) +++ head/sys/mips/conf/JZ4780 Fri Dec 30 00:34:52 2016 (r310794) @@ -5,7 +5,7 @@ #NO_UNIVERSE ident JZ4780 -machine mips mipsel +machine mips mipselhf cpu CPU_XBURST cpu CPU_MIPS4KC From owner-svn-src-all@freebsd.org Fri Dec 30 00:41:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07128C979E5; Fri, 30 Dec 2016 00:41:15 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from st11p00im-asmtp002.me.com (st11p00im-asmtp002.me.com [17.172.80.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2F4817AD; Fri, 30 Dec 2016 00:41:14 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.st11p00im-asmtp002.me.com by st11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OIZ00A002Q7A400@st11p00im-asmtp002.me.com>; Fri, 30 Dec 2016 00:41:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1483058467; bh=WIxk6NTYZRSHD46Rc8u5XNlNxT1uiJ0IV241iewp8LY=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=qnwj5cYFgWI5dmoo1o7Az26CUuhO/duLkIHYaNM9eA+hlYSXi1+C+4WIdoQmCCl0F vpkYWh7+BtsZQIU6IDDSUkuFPccQx0fJjcY8WVTZ7Lq518T29tA/bsra01s+5ntSVd ThxZwFMVDVJvUBza/U3S7SJ3sBpImcGLCzsU2Jfhu0YWccTo3FzQI/TMCQmqa2zXim azHy4dkheS7fELULsxursbXOmsndKzrYRCMwZFrsMYdQAb1Jw4Fh+tbvDKUfC1sh5n vVdZ4KHBbMMj9A9F/RscLZU9qt9s1v3dWurzom5hLOfODHZtbUPlm2bhLPUJaXsUwh glymK7+Q+Q0GA== Received: from [10.0.0.7] (c-73-6-177-70.hsd1.tx.comcast.net [73.6.177.70]) by st11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OIZ00AS538H2K00@st11p00im-asmtp002.me.com>; Fri, 30 Dec 2016 00:41:07 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-29_19:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612300010 User-Agent: Microsoft-MacOutlook/f.1d.0.161209 Date: Thu, 29 Dec 2016 18:41:05 -0600 Subject: Re: svn commit: r310782 - head/sys/cam/ctl From: Ravi Pokala Sender: "Pokala, Ravi" To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <18B83785-95E0-42B1-B359-72C94C2E5D0D@panasas.com> Thread-topic: svn commit: r310782 - head/sys/cam/ctl References: <201612291808.uBTI84k1029032@repo.freebsd.org> In-reply-to: <201612291808.uBTI84k1029032@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 00:41:15 -0000 Hi Alexander, Wouldn't it be better to put the cast directly in the definition of CTL_SOFTC()? That puts the cast in a single place, and anything that calls CTL_SOFTC() will expect a (struct ctl_softc *) anyway. Thanks, and happy holidays! -Ravi (rpokala@) -----Original Message----- > From: on behalf of Alexander Motin > Date: 2016-12-29, Thursday at 12:08 > To: , , > Subject: svn commit: r310782 - head/sys/cam/ctl > > Author: mav > Date: Thu Dec 29 18:08:04 2016 > New Revision: 310782 > URL: https://svnweb.freebsd.org/changeset/base/310782 > > Log: > Fix build with enabled debug after r310778. > > MFC after: 2 weeks > > Modified: > head/sys/cam/ctl/ctl.c > > Modified: head/sys/cam/ctl/ctl.c > ============================================================================== > --- head/sys/cam/ctl/ctl.c Thu Dec 29 17:31:38 2016 (r310781) > +++ head/sys/cam/ctl/ctl.c Thu Dec 29 18:08:04 2016 (r310782) > @@ -12519,7 +12519,7 @@ ctl_datamove(union ctl_io *io) > { > void (*fe_datamove)(union ctl_io *io); > > - mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED); > + mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED); > > CTL_DEBUG_PRINT(("ctl_datamove\n")); > > @@ -13012,7 +13012,7 @@ static void > ctl_datamove_remote(union ctl_io *io) > { > > - mtx_assert(&CTL_SOFTC(io)->ctl_lock, MA_NOTOWNED); > + mtx_assert(&((struct ctl_softc *)CTL_SOFTC(io))->ctl_lock, MA_NOTOWNED); > > if (io->io_hdr.flags & CTL_FLAG_FAILOVER) { > ctl_failover_io(io, /*have_lock*/ 0); From owner-svn-src-all@freebsd.org Fri Dec 30 01:17:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7CAEC97358; Fri, 30 Dec 2016 01:17:48 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B2E019B0; Fri, 30 Dec 2016 01:17:48 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id uBU1HkI7008659; Thu, 29 Dec 2016 17:17:46 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id uBU1HkpP008658; Thu, 29 Dec 2016 17:17:46 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201612300117.uBU1HkpP008658@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r310773 - in stable/11/sys: netinet netinet6 In-Reply-To: <20161229191838.GB23243@freefall.freebsd.org> To: "Piotr P. Stefaniak" Date: Thu, 29 Dec 2016 17:17:46 -0800 (PST) CC: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen , svn-src-stable-11@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 01:17:48 -0000 -- Start of PGP signed section. > On 2016-12-29 18:09:39, Piotr P. Stefaniak wrote: > >2) the option -ta was added > > To clarify, what I mean is that the process that generates the sources > started using the -ta switch of indent(1), not that the feature was > recently implemented. Can you clarify what process these source files are generated by? If these are not the source files, but are being generated by some other thing then wouldn't we want the true sources and the generation process in the repsitory? If this is running indent(1) over source files to clean them up, then that is not "generating" sources per say, but instead cleaning them up with indent(1). -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Dec 30 01:24:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2128C9759B; Fri, 30 Dec 2016 01:24:09 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9EBD1E13; Fri, 30 Dec 2016 01:24:09 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1O8lQ008919; Fri, 30 Dec 2016 01:24:08 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1O8wd008918; Fri, 30 Dec 2016 01:24:08 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201612300124.uBU1O8wd008918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 30 Dec 2016 01:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310795 - stable/11/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 01:24:10 -0000 Author: gnn Date: Fri Dec 30 01:24:08 2016 New Revision: 310795 URL: https://svnweb.freebsd.org/changeset/base/310795 Log: MFC: 310175 Remove extra DOF_SEC_XLIMPORT from the DOF_SEC_ISLOADABLE macro Sponsored by: DARPA, AFRL Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri Dec 30 00:34:52 2016 (r310794) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri Dec 30 01:24:08 2016 (r310795) @@ -739,8 +739,8 @@ typedef struct dof_sec { ((x) == DOF_SECT_PRARGS) || ((x) == DOF_SECT_PROFFS) || \ ((x) == DOF_SECT_INTTAB) || ((x) == DOF_SECT_XLTAB) || \ ((x) == DOF_SECT_XLMEMBERS) || ((x) == DOF_SECT_XLIMPORT) || \ - ((x) == DOF_SECT_XLIMPORT) || ((x) == DOF_SECT_XLEXPORT) || \ - ((x) == DOF_SECT_PREXPORT) || ((x) == DOF_SECT_PRENOFFS)) + ((x) == DOF_SECT_XLEXPORT) || ((x) == DOF_SECT_PREXPORT) || \ + ((x) == DOF_SECT_PRENOFFS)) typedef struct dof_ecbdesc { dof_secidx_t dofe_probes; /* link to DOF_SECT_PROBEDESC */ From owner-svn-src-all@freebsd.org Fri Dec 30 01:27:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32432C976C9; Fri, 30 Dec 2016 01:27:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C30E71010; Fri, 30 Dec 2016 01:27:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1RSaE009085; Fri, 30 Dec 2016 01:27:28 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1RR0E009081; Fri, 30 Dec 2016 01:27:27 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612300127.uBU1RR0E009081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 01:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310796 - in vendor/libarchive/dist: . libarchive libarchive/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 01:27:29 -0000 Author: mm Date: Fri Dec 30 01:27:27 2016 New Revision: 310796 URL: https://svnweb.freebsd.org/changeset/base/310796 Log: Update vendor/libarchive to git to 379867ecb330b3a952fb7bfa7bffb7bbd5547205 Vendor changes: PR #771: Add NFSv4 ACL support to pax and restricted pax Added: vendor/libarchive/dist/libarchive/test/test_acl_pax_nfs4.tar.uu vendor/libarchive/dist/libarchive/test/test_acl_pax_posix1e.tar.uu - copied, changed from r310795, vendor/libarchive/dist/libarchive/test/test_acl_pax.tar.uu vendor/libarchive/dist/libarchive/test/test_acl_text.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_star_acl.c - copied, changed from r310795, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.c vendor/libarchive/dist/libarchive/test/test_compat_star_acl_nfs4.tar.uu Deleted: vendor/libarchive/dist/libarchive/test/test_acl_pax.tar.uu vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.c Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_acl_private.h vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_acl.3 vendor/libarchive/dist/libarchive/archive_entry_locale.h vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/libarchive-formats.5 vendor/libarchive/dist/libarchive/tar.5 vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/libarchive/test/test.h vendor/libarchive/dist/libarchive/test/test_acl_freebsd_nfs4.c vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c vendor/libarchive/dist/libarchive/test/test_acl_nfs4.c vendor/libarchive/dist/libarchive/test/test_acl_pax.c vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Fri Dec 30 01:24:08 2016 (r310795) +++ vendor/libarchive/dist/Makefile.am Fri Dec 30 01:27:27 2016 (r310796) @@ -328,6 +328,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_acl_nfs4.c \ libarchive/test/test_acl_pax.c \ libarchive/test/test_acl_posix1e.c \ + libarchive/test/test_acl_text.c \ libarchive/test/test_archive_api_feature.c \ libarchive/test/test_archive_clear_error.c \ libarchive/test/test_archive_cmdline.c \ @@ -376,7 +377,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_plexus_archiver_tar.c \ libarchive/test/test_compat_solaris_tar_acl.c \ libarchive/test/test_compat_solaris_pax_sparse.c \ - libarchive/test/test_compat_star_acl_posix1e.c \ + libarchive/test/test_compat_star_acl.c \ libarchive/test/test_compat_tar_hardlink.c \ libarchive/test/test_compat_uudecode.c \ libarchive/test/test_compat_uudecode_large.c \ @@ -598,7 +599,8 @@ libarchive_TESTS_ENVIRONMENT= LIBARCHIVE libarchive_test_EXTRA_DIST=\ libarchive/test/list.h \ - libarchive/test/test_acl_pax.tar.uu \ + libarchive/test/test_acl_pax_posix1e.tar.uu \ + libarchive/test/test_acl_pax_nfs4.tar.uu \ libarchive/test/test_archive_string_conversion.txt.Z.uu \ libarchive/test/test_compat_bzip2_1.tbz.uu \ libarchive/test/test_compat_bzip2_2.tbz.uu \ @@ -635,6 +637,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \ libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu \ libarchive/test/test_compat_solaris_tar_acl.tar.uu \ + libarchive/test/test_compat_star_acl_nfs4.tar.uu \ libarchive/test/test_compat_star_acl_posix1e.tar.uu \ libarchive/test/test_compat_tar_hardlink_1.tar.uu \ libarchive/test/test_compat_uudecode_large.tar.Z.uu \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Fri Dec 30 01:24:08 2016 (r310795) +++ vendor/libarchive/dist/NEWS Fri Dec 30 01:27:27 2016 (r310796) @@ -1,3 +1,6 @@ +Dec 27, 2016: NFSv4 ACL read and write support for pax + Deprecated functions: archive_entry_acl_text(), archive_entry_acl_text_w() + Oct 26, 2016: Remove liblzmadec support Oct 23, 2016: libarchive 3.2.2 released Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Fri Dec 30 01:24:08 2016 (r310795) +++ vendor/libarchive/dist/libarchive/archive_acl.c Fri Dec 30 01:27:27 2016 (r310796) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003-2010 Tim Kientzle + * Copyright (c) 2016 Martin Matuska * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,23 +56,31 @@ static struct archive_acl_entry *acl_new static int archive_acl_add_entry_len_l(struct archive_acl *acl, int type, int permset, int tag, int id, const char *name, size_t len, struct archive_string_conv *sc); +static int archive_acl_text_want_type(struct archive_acl *acl, int flags); +static ssize_t archive_acl_text_len(struct archive_acl *acl, int want_type, + int flags, int wide, struct archive *a, + struct archive_string_conv *sc); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); +static int is_nfs4_flags_w(const wchar_t *start, const wchar_t *end, + int *result); +static int is_nfs4_perms_w(const wchar_t *start, const wchar_t *end, + int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, const wchar_t **end, wchar_t *sep); -static int prefix_w(const wchar_t *start, const wchar_t *end, - const wchar_t *test); -static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id); +static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, int flags, const wchar_t *wname, int perm, int id); static void append_id_w(wchar_t **wp, int id); static int isint(const char *start, const char *end, int *result); static int ismode(const char *start, const char *end, int *result); +static int is_nfs4_flags(const char *start, const char *end, + int *result); +static int is_nfs4_perms(const char *start, const char *end, + int *result); static void next_field(const char **p, const char **start, const char **end, char *sep); -static int prefix_c(const char *start, const char *end, - const char *test); -static void append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id); +static void append_entry(char **p, const char *prefix, int type, + int tag, int flags, const char *name, int perm, int id); static void append_id(char **p, int id); void @@ -375,8 +384,8 @@ archive_acl_reset(struct archive_acl *ac * standard permissions and include them in the returned list. */ int -archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type, int *type, - int *permset, int *tag, int *id, const char **name) +archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type, + int *type, int *permset, int *tag, int *id, const char **name) { *name = NULL; *id = -1; @@ -441,130 +450,273 @@ archive_acl_next(struct archive *a, stru } /* - * Generate a text version of the ACL. The flags parameter controls - * the style of the generated ACL. + * Determine what type of ACL do we want */ -const wchar_t * -archive_acl_text_w(struct archive *a, struct archive_acl *acl, int flags) +static int +archive_acl_text_want_type(struct archive_acl *acl, int flags) { - int count; - size_t length; - const wchar_t *wname; - const wchar_t *prefix; - wchar_t separator; - struct archive_acl_entry *ap; - int id, r; - wchar_t *wp; + int want_type; - if (acl->acl_text_w != NULL) { - free (acl->acl_text_w); - acl->acl_text_w = NULL; + /* Check if ACL is NFSv4 */ + if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + /* NFSv4 should never mix with POSIX.1e */ + if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) + return (0); + else + return (ARCHIVE_ENTRY_ACL_TYPE_NFS4); } - separator = L','; + /* Now deal with POSIX.1e ACLs */ + + want_type = 0; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) + want_type |= ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + want_type |= ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + + /* By default we want both access and default ACLs */ + if (want_type == 0) + return (ARCHIVE_ENTRY_ACL_TYPE_POSIX1E); + + return (want_type); +} + +/* + * Calculate ACL text string length + */ +static ssize_t +archive_acl_text_len(struct archive_acl *acl, int want_type, int flags, + int wide, struct archive *a, struct archive_string_conv *sc) { + struct archive_acl_entry *ap; + const char *name; + const wchar_t *wname; + int count, idlen, tmp, r; + ssize_t length; + size_t len; + count = 0; length = 0; - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & flags) != 0) { - count++; - if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && - (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) - length += 8; /* "default:" */ - length += 5; /* tag name */ - length += 1; /* colon */ - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0 && wname != NULL) - length += wcslen(wname); - else if (r < 0 && errno == ENOMEM) - return (NULL); - else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + count++; + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0 + && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + length += 8; /* "default:" */ + switch (ap->tag) { + case ARCHIVE_ENTRY_ACL_USER_OBJ: + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + length += 6; /* "owner@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_USER: + case ARCHIVE_ENTRY_ACL_MASK: + length += 4; /* "user", "mask" */ + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + length += 6; /* "group@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_GROUP: + case ARCHIVE_ENTRY_ACL_OTHER: + length += 5; /* "group", "other" */ + break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + length += 9; /* "everyone@" */ + break; + } + length += 1; /* colon after tag */ + if (ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (wide) { + r = archive_mstring_get_wcs(a, &ap->name, + &wname); + if (r == 0 && wname != NULL) + length += wcslen(wname); + else if (r < 0 && errno == ENOMEM) + return (0); + else + length += sizeof(uid_t) * 3 + 1; + } else { + r = archive_mstring_get_mbs_l(&ap->name, &name, + &len, sc); + if (r != 0) + return (0); + if (len > 0 && name != NULL) + length += len; + else + length += sizeof(uid_t) * 3 + 1; + } + length += 1; /* colon after user or group name */ + } else if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) + length += 1; /* 2nd colon empty user,group or other */ + + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0) + && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) + && (ap->tag == ARCHIVE_ENTRY_ACL_OTHER + || ap->tag == ARCHIVE_ENTRY_ACL_MASK)) { + /* Solaris has no colon after other: and mask: */ + length = length - 1; + } + + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* rwxpdDaARWcCos:fdinSFI:deny */ + length += 27; + if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DENY) == 0) + length += 1; /* allow, alarm, audit */ + } else length += 3; /* rwx */ + + if ((ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) && + (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) != 0) { length += 1; /* colon */ - length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; - length ++; /* newline */ + /* ID digit count */ + idlen = 1; + tmp = ap->id; + while (tmp > 9) { + tmp = tmp / 10; + idlen++; + } + length += idlen; } - ap = ap->next; + length ++; /* entry separator */ } - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { - length += 10; /* "user::rwx\n" */ - length += 11; /* "group::rwx\n" */ - length += 11; /* "other::rwx\n" */ - } + /* Add filemode-mapping access entries to the length */ + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + if ((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0) { + /* "user::rwx\ngroup::rwx\nother:rwx\n" */ + length += 31; + } else { + /* "user::rwx\ngroup::rwx\nother::rwx\n" */ + length += 32; + } + } else if (count == 0) + return (0); + + /* The terminating character is included in count */ + return (length); +} - if (count == 0) +/* + * Generate a wide text version of the ACL. The flags parameter controls + * the type and style of the generated ACL. + */ +wchar_t * +archive_acl_to_text_w(struct archive_acl *acl, ssize_t *text_len, int flags, + struct archive *a) +{ + int count; + ssize_t length; + size_t len; + const wchar_t *wname; + const wchar_t *prefix; + wchar_t separator; + struct archive_acl_entry *ap; + int id, r, want_type; + wchar_t *wp, *ws; + + want_type = archive_acl_text_want_type(acl, flags); + + /* Both NFSv4 and POSIX.1 types found */ + if (want_type == 0) return (NULL); + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) + flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; + + length = archive_acl_text_len(acl, want_type, flags, 1, a, NULL); + + if (length == 0) + return (NULL); + + if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA) + separator = L','; + else + separator = L'\n'; + /* Now, allocate the string and actually populate it. */ - wp = acl->acl_text_w = (wchar_t *)malloc(length * sizeof(wchar_t)); - if (wp == NULL) + wp = ws = (wchar_t *)malloc(length * sizeof(wchar_t)); + if (wp == NULL) { + if (errno == ENOMEM) + __archive_errx(1, "No memory"); return (NULL); + } count = 0; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL, acl->mode & 0700, -1); - *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + *wp++ = separator; + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL, acl->mode & 0070, -1); - *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + *wp++ = separator; + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, flags, NULL, acl->mode & 0007, -1); count += 3; - - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0) { - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry_w(&wp, NULL, ap->tag, wname, - ap->permset, id); - count++; - } else if (r < 0 && errno == ENOMEM) - return (NULL); - } - ap = ap->next; - } } - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT && + (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0) prefix = L"default:"; else prefix = NULL; - ap = acl->acl_head; - count = 0; - while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0) { - if (count > 0) - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry_w(&wp, prefix, ap->tag, - wname, ap->permset, id); - count ++; - } else if (r < 0 && errno == ENOMEM) - return (NULL); - } - ap = ap->next; - } + r = archive_mstring_get_wcs(a, &ap->name, &wname); + if (r == 0) { + if (count > 0) + *wp++ = separator; + if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) + id = ap->id; + else + id = -1; + append_entry_w(&wp, prefix, ap->type, ap->tag, flags, + wname, ap->permset, id); + count++; + } else if (r < 0 && errno == ENOMEM) + return (NULL); } - return (acl->acl_text_w); -} + /* Add terminating character */ + *wp++ = L'\0'; + + len = wcslen(ws); + if ((ssize_t)len > (length - 1)) + __archive_errx(1, "Buffer overrun"); + + if (text_len != NULL) + *text_len = len; + + return (ws); +} static void append_id_w(wchar_t **wp, int id) @@ -577,8 +729,8 @@ append_id_w(wchar_t **wp, int id) } static void -append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id) +append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, int flags, const wchar_t *wname, int perm, int id) { if (prefix != NULL) { wcscpy(*wp, prefix); @@ -588,6 +740,10 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_USER_OBJ: wname = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + wcscpy(*wp, L"owner@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: wcscpy(*wp, L"user"); @@ -595,6 +751,10 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_GROUP_OBJ: wname = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + wcscpy(*wp, L"group@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: wcscpy(*wp, L"group"); @@ -609,154 +769,209 @@ append_entry_w(wchar_t **wp, const wchar wname = NULL; id = -1; break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + wcscpy(*wp, L"everyone@"); + wname = NULL; + id = -1; + break; } *wp += wcslen(*wp); *(*wp)++ = L':'; - if (wname != NULL) { - wcscpy(*wp, wname); + if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (wname != NULL) { + wcscpy(*wp, wname); + *wp += wcslen(*wp); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id_w(wp, id); + id = -1; + } + /* Solaris style has no second colon after other and mask */ + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) + || (tag != ARCHIVE_ENTRY_ACL_OTHER + && tag != ARCHIVE_ENTRY_ACL_MASK)) + *(*wp)++ = L':'; + } + if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + /* POSIX.1e ACL perms */ + *(*wp)++ = (perm & 0444) ? L'r' : L'-'; + *(*wp)++ = (perm & 0222) ? L'w' : L'-'; + *(*wp)++ = (perm & 0111) ? L'x' : L'-'; + } else { + /* NFS4 ACL perms */ + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? L'r' : L'-'; + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? L'w' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? L'x' : L'-'; + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | + ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? L'p' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? L'd' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? L'D' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? L'a' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? L'A' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? L'R' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? L'W' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? L'c' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? L'C' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? L'o' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? L's' : L'-'; + *(*wp)++ = L':'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? L'f' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? L'd' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? L'i' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? L'n' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? L'S' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? L'F' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? L'I' : L'-'; + *(*wp)++ = L':'; + switch (type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + wcscpy(*wp, L"allow"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + wcscpy(*wp, L"deny"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + wcscpy(*wp, L"audit"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + wcscpy(*wp, L"alarm"); + break; + default: + break; + } *wp += wcslen(*wp); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id_w(wp, id); - id = -1; } - *(*wp)++ = L':'; - *(*wp)++ = (perm & 0444) ? L'r' : L'-'; - *(*wp)++ = (perm & 0222) ? L'w' : L'-'; - *(*wp)++ = (perm & 0111) ? L'x' : L'-'; if (id != -1) { *(*wp)++ = L':'; append_id_w(wp, id); } - **wp = L'\0'; } -int -archive_acl_text_l(struct archive_acl *acl, int flags, - const char **acl_text, size_t *acl_text_len, +/* + * Generate a text version of the ACL. The flags parameter controls + * the type and style of the generated ACL. + */ +char * +archive_acl_to_text_l(struct archive_acl *acl, ssize_t *text_len, int flags, struct archive_string_conv *sc) { int count; - size_t length; + ssize_t length; + size_t len; const char *name; const char *prefix; char separator; struct archive_acl_entry *ap; - size_t len; - int id, r; - char *p; + int id, r, want_type; + char *p, *s; - if (acl->acl_text != NULL) { - free (acl->acl_text); - acl->acl_text = NULL; - } + want_type = archive_acl_text_want_type(acl, flags); - *acl_text = NULL; - if (acl_text_len != NULL) - *acl_text_len = 0; - separator = ','; - count = 0; - length = 0; - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & flags) != 0) { - count++; - if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && - (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) - length += 8; /* "default:" */ - length += 5; /* tag name */ - length += 1; /* colon */ - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (len > 0 && name != NULL) - length += len; - else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ - length += 3; /* rwx */ - length += 1; /* colon */ - length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; - length ++; /* newline */ - } - ap = ap->next; - } + /* Both NFSv4 and POSIX.1 types found */ + if (want_type == 0) + return (NULL); - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { - length += 10; /* "user::rwx\n" */ - length += 11; /* "group::rwx\n" */ - length += 11; /* "other::rwx\n" */ - } + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) + flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; - if (count == 0) - return (0); + length = archive_acl_text_len(acl, want_type, flags, 0, NULL, sc); + + if (length == 0) + return (NULL); + + if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA) + separator = ','; + else + separator = '\n'; /* Now, allocate the string and actually populate it. */ - p = acl->acl_text = (char *)malloc(length); - if (p == NULL) - return (-1); + p = s = (char *)malloc(length * sizeof(char)); + if (p == NULL) { + if (errno == ENOMEM) + __archive_errx(1, "No memory"); + return (NULL); + } count = 0; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL, acl->mode & 0700, -1); - *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + *p++ = separator; + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL, acl->mode & 0070, -1); - *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + *p++ = separator; + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, flags, NULL, acl->mode & 0007, -1); count += 3; - - for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) == 0) - continue; - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - *p++ = separator; - if (name == NULL || (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { - id = ap->id; - } else { - id = -1; - } - append_entry(&p, NULL, ap->tag, name, - ap->permset, id); - count++; - } } - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT && + (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0) prefix = "default:"; else prefix = NULL; - count = 0; - for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) == 0) - continue; - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (count > 0) - *p++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry(&p, prefix, ap->tag, - name, ap->permset, id); - count ++; + r = archive_mstring_get_mbs_l( + &ap->name, &name, &len, sc); + if (r != 0) + return (NULL); + if (count > 0) + *p++ = separator; + if (name == NULL || + (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { + id = ap->id; + } else { + id = -1; } + append_entry(&p, prefix, ap->type, ap->tag, flags, name, + ap->permset, id); + count++; } - *acl_text = acl->acl_text; - if (acl_text_len != NULL) - *acl_text_len = strlen(acl->acl_text); - return (0); + /* Add terminating character */ + *p++ = '\0'; + + len = strlen(s); + + if ((ssize_t)len > (length - 1)) + __archive_errx(1, "Buffer overrun"); + + if (text_len != NULL) + *text_len = len; + + return (s); } static void @@ -770,8 +985,8 @@ append_id(char **p, int id) } static void -append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id) +append_entry(char **p, const char *prefix, int type, + int tag, int flags, const char *name, int perm, int id) { if (prefix != NULL) { strcpy(*p, prefix); @@ -781,6 +996,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_USER_OBJ: name = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + strcpy(*p, "owner@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: strcpy(*p, "user"); @@ -788,6 +1007,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_GROUP_OBJ: name = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + strcpy(*p, "group@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: strcpy(*p, "group"); @@ -802,48 +1025,146 @@ append_entry(char **p, const char *prefi name = NULL; id = -1; break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + strcpy(*p, "everyone@"); + name = NULL; + id = -1; + break; } *p += strlen(*p); *(*p)++ = ':'; - if (name != NULL) { - strcpy(*p, name); + if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (name != NULL) { + strcpy(*p, name); + *p += strlen(*p); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id(p, id); + id = -1; + } + /* Solaris style has no second colon after other and mask */ + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) + || (tag != ARCHIVE_ENTRY_ACL_OTHER + && tag != ARCHIVE_ENTRY_ACL_MASK)) + *(*p)++ = ':'; + } + if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + /* POSIX.1e ACL perms */ + *(*p)++ = (perm & 0444) ? 'r' : '-'; + *(*p)++ = (perm & 0222) ? 'w' : '-'; + *(*p)++ = (perm & 0111) ? 'x' : '-'; + } else { + /* NFS4 ACL perms */ + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? 'r' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? 'w' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_EXECUTE)) ? 'x' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | + ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? 'p' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? 'd' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? 'D' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? 'a' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? 'A' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? 'R' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? 'W' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ACL) ? 'c' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ACL) ? 'C' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? 'o' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? 's' : '-'; + *(*p)++ = ':'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? 'f' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? 'd' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? 'i' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? 'n' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? 'S' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? 'F' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? 'I' : '-'; + *(*p)++ = ':'; + switch (type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + strcpy(*p, "allow"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + strcpy(*p, "deny"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + strcpy(*p, "audit"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + strcpy(*p, "alarm"); + break; + } *p += strlen(*p); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id(p, id); - id = -1; } - *(*p)++ = ':'; - *(*p)++ = (perm & 0444) ? 'r' : '-'; - *(*p)++ = (perm & 0222) ? 'w' : '-'; - *(*p)++ = (perm & 0111) ? 'x' : '-'; if (id != -1) { *(*p)++ = ':'; append_id(p, id); } - **p = '\0'; } /* - * Parse a textual ACL. This automatically recognizes and supports - * extensions described above. The 'type' argument is used to - * indicate the type that should be used for any entries not - * explicitly marked as "default:". + * Parse a wide ACL text string. + * + * The want_type argument may be one of the following: + * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - text is a POSIX.1e ACL of type ACCESS + * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - text is a POSIX.1e ACL of type DEFAULT + * ARCHIVE_ENTRY_ACL_TYPE_NFS4 - text is as a NFSv4 ACL + * + * POSIX.1e ACL entries prefixed with "default:" are treated as + * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless type is ARCHIVE_ENTRY_ACL_TYPE_NFS4 */ int -archive_acl_parse_w(struct archive_acl *acl, - const wchar_t *text, int default_type) +archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, + int want_type) { struct { const wchar_t *start; const wchar_t *end; - } field[4], name; + } field[6], name; - int fields, n; - int type, tag, permset, id; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 30 01:31:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C723EC977D5; Fri, 30 Dec 2016 01:31:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96A8E13B6; Fri, 30 Dec 2016 01:31:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1V3kR012074; Fri, 30 Dec 2016 01:31:03 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1V3pe012073; Fri, 30 Dec 2016 01:31:03 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612300131.uBU1V3pe012073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 01:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310797 - vendor/libarchive/dist/libarchive X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 01:31:04 -0000 Author: mm Date: Fri Dec 30 01:31:03 2016 New Revision: 310797 URL: https://svnweb.freebsd.org/changeset/base/310797 Log: Update vendor/libarchive to git e8a9de5eaf3b79fc3d990d056343bb52c51c5ba4 Fix style typo in tar.5 Modified: vendor/libarchive/dist/libarchive/tar.5 Modified: vendor/libarchive/dist/libarchive/tar.5 ============================================================================== --- vendor/libarchive/dist/libarchive/tar.5 Fri Dec 30 01:27:27 2016 (r310796) +++ vendor/libarchive/dist/libarchive/tar.5 Fri Dec 30 01:31:03 2016 (r310797) @@ -441,7 +441,7 @@ archives to store files much larger than Vendor-specific attributes used by Joerg Schilling's .Nm star implementation. -.It Cm SCHILY.acl.access , Cm SCHILY.acl.default, .Cm SCHILY.acl.ace +.It Cm SCHILY.acl.access , Cm SCHILY.acl.default, Cm SCHILY.acl.ace Stores the access, default and NFSv4 ACLs as textual strings in a format that is an extension of the format specified by POSIX.1e draft 17. In particular, each user or group access specification can include From owner-svn-src-all@freebsd.org Fri Dec 30 01:34:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20B88C97BF3; Fri, 30 Dec 2016 01:34:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD448196B; Fri, 30 Dec 2016 01:34:08 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1Y8kV013123; Fri, 30 Dec 2016 01:34:08 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1Y6YP013108; Fri, 30 Dec 2016 01:34:06 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612300134.uBU1Y6YP013108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 01:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310798 - in vendor/libarchive/dist: cpio libarchive libarchive/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 01:34:09 -0000 Author: mm Date: Fri Dec 30 01:34:06 2016 New Revision: 310798 URL: https://svnweb.freebsd.org/changeset/base/310798 Log: Update vendor/libarchive to git 2a2488a81599f9cd065a8254b16a6fd48d81c3b4 Vendor bugfixes: PR #843: Fix memory leak of struct archive_entry in cpio/cpio.c PR #851: Spelling fixes Fix two protoypes in manual page archive_read_disk.3 Modified: vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/libarchive/archive_match.c vendor/libarchive/dist/libarchive/archive_rb.c vendor/libarchive/dist/libarchive/archive_read_disk.3 vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c Modified: vendor/libarchive/dist/cpio/cpio.c ============================================================================== --- vendor/libarchive/dist/cpio/cpio.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/cpio/cpio.c Fri Dec 30 01:34:06 2016 (r310798) @@ -703,6 +703,7 @@ file_to_archive(struct cpio *cpio, const lafe_warnc(0, "%s", archive_error_string(cpio->archive_read_disk)); if (r <= ARCHIVE_FAILED) { + archive_entry_free(entry); cpio->return_value = 1; return (r); } Modified: vendor/libarchive/dist/libarchive/archive_match.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_match.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_match.c Fri Dec 30 01:34:06 2016 (r310798) @@ -471,7 +471,7 @@ archive_match_path_excluded(struct archi } /* - * Utilty functions to get statistic information for inclusion patterns. + * Utility functions to get statistic information for inclusion patterns. */ int archive_match_path_unmatched_inclusions(struct archive *_a) @@ -1270,7 +1270,7 @@ set_timefilter_pathname_wcs(struct archi #endif /* _WIN32 && !__CYGWIN__ */ /* - * Call back funtions for archive_rb. + * Call back functions for archive_rb. */ static int cmp_node_mbs(const struct archive_rb_node *n1, @@ -1405,7 +1405,7 @@ add_entry(struct archive_match *a, int f &(a->exclusion_tree), pathname); /* - * We always overwrite comparison condision. + * We always overwrite comparison condition. * If you do not want to overwrite it, you should not * call archive_match_exclude_entry(). We cannot know * what behavior you really expect since overwriting @@ -1481,7 +1481,7 @@ time_excluded(struct archive_match *a, s if (nsec == a->older_ctime_nsec && (a->older_ctime_filter & ARCHIVE_MATCH_EQUAL) == 0) - return (1); /* Eeual, skip it. */ + return (1); /* Equal, skip it. */ } } if (a->newer_mtime_filter) { @@ -1513,7 +1513,7 @@ time_excluded(struct archive_match *a, s } } - /* If there is no excluson list, include the file. */ + /* If there is no exclusion list, include the file. */ if (a->exclusion_entry_list.count == 0) return (0); @@ -1700,7 +1700,7 @@ add_owner_id(struct archive_match *a, st break; } - /* Add oowner id. */ + /* Add owner id. */ if (i == ids->count) ids->ids[ids->count++] = id; else if (ids->ids[i] != id) { Modified: vendor/libarchive/dist/libarchive/archive_rb.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_rb.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_rb.c Fri Dec 30 01:34:06 2016 (r310798) @@ -312,7 +312,7 @@ __archive_rb_tree_insert_rebalance(struc father = RB_FATHER(self); if (RB_BLACK_P(father)) { /* - * If our greatgrandpa is black, we're done. + * If our great-grandpa is black, we're done. */ return; } Modified: vendor/libarchive/dist/libarchive/archive_read_disk.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk.3 Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_read_disk.3 Fri Dec 30 01:34:06 2016 (r310798) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2012 +.Dd December 30, 2016 .Dt ARCHIVE_READ_DISK 3 .Os .Sh NAME @@ -54,9 +54,9 @@ Streaming Archive Library (libarchive, - .Fn archive_read_disk_set_symlink_physical "struct archive *" .Ft int .Fn archive_read_disk_set_symlink_hybrid "struct archive *" -.Ft int +.Ft const char * .Fn archive_read_disk_gname "struct archive *" "gid_t" -.Ft int +.Ft const char * .Fn archive_read_disk_uname "struct archive *" "uid_t" .Ft int .Fo archive_read_disk_set_gname_lookup Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Fri Dec 30 01:34:06 2016 (r310798) @@ -374,7 +374,7 @@ struct iso9660 { size_t utf16be_path_len; unsigned char *utf16be_previous_path; size_t utf16be_previous_path_len; - /* Null buufer used in bidder to improve its performance. */ + /* Null buffer used in bidder to improve its performance. */ unsigned char null[2048]; }; @@ -1199,7 +1199,7 @@ archive_read_format_iso9660_read_header( archive_string_conversion_from_charset( &(a->archive), "UTF-16BE", 1); if (iso9660->sconv_utf16be == NULL) - /* Coundn't allocate memory */ + /* Couldn't allocate memory */ return (ARCHIVE_FATAL); } if (iso9660->utf16be_path == NULL) { @@ -2407,7 +2407,7 @@ read_CE(struct archive_read *a, struct i return (ARCHIVE_FATAL); } while (heap->cnt && heap->reqs[0].offset == iso9660->current_position); - /* NOTE: Do not move this consume's code to fron of + /* NOTE: Do not move this consume's code to front of * do-while loop. Registration of nested CE extension * might cause error because of current position. */ __archive_read_consume(a, step); @@ -2729,7 +2729,7 @@ next_cache_entry(struct archive_read *a, if (file == NULL) { /* * If directory entries all which are descendant of - * rr_moved are stil remaning, expose their. + * rr_moved are still remaining, expose their. */ if (iso9660->re_files.first != NULL && iso9660->rr_moved != NULL && @@ -2852,7 +2852,7 @@ next_cache_entry(struct archive_read *a, empty_files.last = &empty_files.first; /* Collect files which has the same file serial number. * Peek pending_files so that file which number is different - * is not put bak. */ + * is not put back. */ while (iso9660->pending_files.used > 0 && (iso9660->pending_files.files[0]->number == -1 || iso9660->pending_files.files[0]->number == number)) { @@ -2860,7 +2860,7 @@ next_cache_entry(struct archive_read *a, /* This file has the same offset * but it's wrong offset which empty files * and symlink files have. - * NOTE: This wrong offse was recorded by + * NOTE: This wrong offset was recorded by * old mkisofs utility. If ISO images is * created by latest mkisofs, this does not * happen. Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Fri Dec 30 01:34:06 2016 (r310798) @@ -308,7 +308,7 @@ struct archive_write_disk { #define MAXIMUM_DIR_MODE 0775 /* - * Maxinum uncompressed size of a decmpfs block. + * Maximum uncompressed size of a decmpfs block. */ #define MAX_DECMPFS_BLOCK_SIZE (64 * 1024) /* @@ -323,7 +323,7 @@ struct archive_write_disk { #define RSRC_F_SIZE 50 /* Size of Resource fork footer. */ /* Size to write compressed data to resource fork. */ #define COMPRESSED_W_SIZE (64 * 1024) -/* decmpfs difinitions. */ +/* decmpfs definitions. */ #define MAX_DECMPFS_XATTR_SIZE 3802 #ifndef DECMPFS_XATTR_NAME #define DECMPFS_XATTR_NAME "com.apple.decmpfs" @@ -632,9 +632,9 @@ _archive_write_disk_header(struct archiv /* * NOTE: UF_COMPRESSED is ignored even if the filesystem * supports HFS+ Compression because the file should - * have at least an extended attriute "com.apple.decmpfs" + * have at least an extended attribute "com.apple.decmpfs" * before the flag is set to indicate that the file have - * been compressed. If hte filesystem does not support + * been compressed. If the filesystem does not support * HFS+ Compression the system call will fail. */ if (a->fd < 0 || fchflags(a->fd, UF_COMPRESSED) != 0) @@ -1247,7 +1247,7 @@ hfs_drive_compressor(struct archive_writ ret = hfs_write_compressed_data(a, bytes_used + rsrc_size); a->compressed_buffer_remaining = a->compressed_buffer_size; - /* If the compressed size is not enouph smaller than + /* If the compressed size is not enough smaller than * the uncompressed size. cancel HFS+ compression. * TODO: study a behavior of ditto utility and improve * the condition to fall back into no HFS+ compression. */ @@ -1352,7 +1352,7 @@ hfs_write_decmpfs_block(struct archive_w (uint32_t *)(a->resource_fork + RSRC_H_SIZE); /* Set the block count to the resource fork. */ archive_le32enc(a->decmpfs_block_info++, block_count); - /* Get the position where we are goint to set compressed + /* Get the position where we are going to set compressed * data. */ a->compressed_rsrc_position = RSRC_H_SIZE + 4 + (block_count * 8); @@ -1425,7 +1425,7 @@ hfs_write_data_block(struct archive_writ bytes_to_write = size; /* Seek if necessary to the specified offset. */ if (a->offset < a->fd_offset) { - /* Can't support backword move. */ + /* Can't support backward move. */ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek failed"); return (ARCHIVE_FATAL); Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Fri Dec 30 01:34:06 2016 (r310798) @@ -161,7 +161,7 @@ struct isofile { /* Used for managing struct isofile list. */ struct isofile *allnext; struct isofile *datanext; - /* Used for managing a hardlined struct isofile list. */ + /* Used for managing a hardlinked struct isofile list. */ struct isofile *hlnext; struct isofile *hardlink_target; @@ -528,7 +528,7 @@ struct iso_option { * - allow more then 8 depths of directory trees; * - disable a version number to a File Name; * - disable a forced period to the tail of a File Name; - * - the maxinum length of files and directories is raised to 193. + * - the maximum length of files and directories is raised to 193. * if rockridge option is disabled, raised to 207. */ unsigned int iso_level:3; @@ -626,7 +626,7 @@ struct iso_option { * : NOTE Our rockridge=useful option does not set a zero * : to uid and gid, you should use application * : option such as --gid,--gname,--uid and --uname - * : badtar options instead. + * : bsdtar options instead. * Type : boolean/string * Default: Enabled as rockridge=useful * COMPAT : mkisofs -r / -R @@ -660,7 +660,7 @@ struct iso_option { * : for making zisofs. * : When the file size is less than one Logical Block * : size, that file will not zisofs'ed since it does - * : reduece an ISO-image size. + * : reduce an ISO-image size. * : * : When you specify option 'boot=', that * : 'boot-image' file won't be converted to zisofs file. @@ -703,7 +703,7 @@ struct iso9660 { } all_file_list; /* A list of struct isofile entries which have its - * contents and are not a directory, a hardlined file + * contents and are not a directory, a hardlinked file * and a symlink file. */ struct { struct isofile *first; @@ -1907,9 +1907,9 @@ iso9660_close(struct archive_write *a) iso9660->primary.rootent); if (ret < 0) return (ret); - /* Make sure we have UTF-16BE convertors. - * if there is no file entry, convertors are still - * uninitilized. */ + /* Make sure we have UTF-16BE converters. + * if there is no file entry, converters are still + * uninitialized. */ if (iso9660->sconv_to_utf16be == NULL) { iso9660->sconv_to_utf16be = archive_string_conversion_to_charset( @@ -2959,7 +2959,7 @@ set_directory_record_rr(unsigned char *b gid = archive_entry_gid(file->entry); if (iso9660->opt.rr == OPT_RR_USEFUL) { /* - * This action is simular mkisofs -r option + * This action is similar to mkisofs -r option * but our rockridge=useful option does not * set a zero to uid and gid. */ @@ -3108,7 +3108,7 @@ set_directory_record_rr(unsigned char *b /* * flg len * +----+----+ - * | 02 | 00 | CURREENT component. + * | 02 | 00 | CURRENT component. * +----+----+ (".") */ if (nc != NULL) { @@ -3947,7 +3947,7 @@ write_VD(struct archive_write *a, struct "Abstract File", 0, D_CHAR); if (r != ARCHIVE_OK) return (r); - /* Bibliongraphic File Identifier */ + /* Bibliographic File Identifier */ r = set_file_identifier(bp, 777, 813, vdc, a, vdd, &(iso9660->bibliographic_file_identifier), "Bibliongraphic File", 0, D_CHAR); @@ -6135,7 +6135,7 @@ isoent_gen_iso9660_identifier(struct arc off = ffmax - extlen; if (off == 0) { /* A dot('.') character - * does't place to the first + * doesn't place to the first * byte of identifier. */ off ++; extlen --; @@ -7149,7 +7149,7 @@ isoent_create_boot_catalog(struct archiv iso9660->el_torito.catalog = isoent; /* - * Get a boot medai type. + * Get a boot media type. */ switch (iso9660->opt.boot_type) { default: Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c Fri Dec 30 01:34:06 2016 (r310798) @@ -79,7 +79,7 @@ typedef enum { WT_RVIS, /* conversion, unsupported */ WT_CONV, - /* continutation, unsupported at the moment */ + /* continuation, unsupported at the moment */ WT_CONT, /* invalid type */ LAST_WT Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Fri Dec 30 01:34:06 2016 (r310798) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); * - When writing an XML element , * which is a file type a symbolic link is referencing is always marked * as "broken". Xar utility uses stat(2) to get the file type, but, in - * libarcive format writer, we should not use it; if it is needed, we + * libarchive format writer, we should not use it; if it is needed, we * should get about it at archive_read_disk.c. * - It is possible to appear both and elements. * Xar utility generates on BSD platform and on Linux @@ -1227,7 +1227,7 @@ make_file_entry(struct archive_write *a, case AE_IFLNK: /* * xar utility has checked a file type, which - * a symblic-link file has referenced. + * a symbolic-link file has referenced. * For example: * ../ref/ * The symlink target file is "../ref/" and its @@ -1237,8 +1237,8 @@ make_file_entry(struct archive_write *a, * The symlink target file is "../f" and its * file type is a regular file. * - * But our implemention cannot do it, and then we - * always record that a attribute "type" is "borken", + * But our implementation cannot do it, and then we + * always record that a attribute "type" is "broken", * for example: * foo/bar * It means "foo/bar" is not reachable. @@ -1544,7 +1544,7 @@ make_toc(struct archive_write *a) } /* - * Start recoding TOC + * Start recording TOC */ r = xmlTextWriterStartElement(writer, BAD_CAST("xar")); if (r < 0) { @@ -2484,7 +2484,7 @@ file_connect_hardlink_files(struct xar * archive_entry_set_nlink(target->entry, hl->nlink); if (hl->nlink > 1) /* It means this file is a hardlink - * targe itself. */ + * target itself. */ target->hardlink_target = target; for (nf = target->hlnext; nf != NULL; nf = nf->hlnext) { Modified: vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_acl_freebsd_posix1e.c Fri Dec 30 01:34:06 2016 (r310798) @@ -283,7 +283,7 @@ DEFINE_TEST(test_acl_freebsd_posix1e_res } /* - * Verify ACL reaed-from-disk. This test is FreeBSD-specific. + * Verify ACL read-from-disk. This test is FreeBSD-specific. */ DEFINE_TEST(test_acl_freebsd_posix1e_read) { Modified: vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c Fri Dec 30 01:34:06 2016 (r310798) @@ -688,7 +688,7 @@ test_symname() assertEqualInt(32, archive_read_data(a, buff, sizeof(buff))); assertEqualMem(buff, "hellohellohello\nhellohellohello\n", 32); - /* Verify symbolic-linke symlinkfile. */ + /* Verify symbolic-link symlinkfile. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt((AE_IFLNK | 0755), archive_entry_mode(ae)); assertEqualString("symlinkfile", archive_entry_pathname(ae)); Modified: vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c Fri Dec 30 01:34:06 2016 (r310798) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_bz2.c 201247 2009-12-30 05:59:21Z kientzle $"); /* -PLEASE use old cdrtools; mkisofs verion is 2.01. +PLEASE use old cdrtools; mkisofs version is 2.01. This version mkisofs made wrong "SL" System Use Entry of RRIP. Execute the following command to rebuild the data for this program: Modified: vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c Fri Dec 30 01:34:06 2016 (r310798) @@ -1116,7 +1116,7 @@ cleanup: * - the filename of second file is stored in UTF-8. * * Whenever hdrcharset option is specified, we will correctly read the - * filename of sencod file, which is stored in UTF-8. + * filename of second file, which is stored in UTF-8. */ DEFINE_TEST(test_read_format_zip_filename_KOI8R_UTF8_2) Modified: vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c Fri Dec 30 01:34:06 2016 (r310798) @@ -719,7 +719,7 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualInt(5, archive_entry_ctime(ae)); assert(archive_entry_mtime_is_set(ae)); assertEqualInt(5, archive_entry_mtime(ae)); - /* Trim lngname to 64 characters. */ + /* Trim longname to 64 characters. */ longname[64] = '\0'; assertEqualString(longname, archive_entry_pathname(ae)); assert((AE_IFREG | 0400) == archive_entry_mode(ae)); Modified: vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c Fri Dec 30 01:31:03 2016 (r310797) +++ vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c Fri Dec 30 01:34:06 2016 (r310798) @@ -25,7 +25,7 @@ #include "test.h" /* - * Check that a "zisofs" ISO 9660 imaeg is correctly created. + * Check that a "zisofs" ISO 9660 image is correctly created. */ static const unsigned char primary_id[] = { From owner-svn-src-all@freebsd.org Fri Dec 30 01:59:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76ACDC974A1; Fri, 30 Dec 2016 01:59:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511DB13AB; Fri, 30 Dec 2016 01:59:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU1xJHQ021392; Fri, 30 Dec 2016 01:59:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU1xJJn021389; Fri, 30 Dec 2016 01:59:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612300159.uBU1xJJn021389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 30 Dec 2016 01:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310799 - in stable/10/sys: conf dev/hyperv/netvsc modules/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 01:59:20 -0000 Author: sephe Date: Fri Dec 30 01:59:19 2016 New Revision: 310799 URL: https://svnweb.freebsd.org/changeset/base/310799 Log: MFC 309346,309348 309346 hyperv/hn: Add HN_DEBUG kernel option. If bufring is used for per-TX ring descs, don't update "available" counter, which is only used to help debugging. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8674 309348 hyperv/hn: Don't hold txdesc, if no BPFs are attached. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8675 Modified: stable/10/sys/conf/options stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/modules/hyperv/netvsc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Fri Dec 30 01:34:06 2016 (r310798) +++ stable/10/sys/conf/options Fri Dec 30 01:59:19 2016 (r310799) @@ -947,3 +947,6 @@ RANDOM_RWFILE opt_random.h # Intel em(4) driver EM_MULTIQUEUE opt_em.h + +# Hyper-V network driver +HN_DEBUG opt_hn.h Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Dec 30 01:34:06 2016 (r310798) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Dec 30 01:59:19 2016 (r310799) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_inet.h" +#include "opt_hn.h" #include #include @@ -1436,10 +1437,12 @@ hn_txdesc_put(struct hn_tx_ring *txr, st txr->hn_txdesc_avail++; SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); mtx_unlock_spin(&txr->hn_txlist_spin); -#else +#else /* HN_USE_TXDESC_BUFRING */ +#ifdef HN_DEBUG atomic_add_int(&txr->hn_txdesc_avail, 1); - buf_ring_enqueue(txr->hn_txdesc_br, txd); #endif + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif /* !HN_USE_TXDESC_BUFRING */ return 1; } @@ -1465,8 +1468,10 @@ hn_txdesc_get(struct hn_tx_ring *txr) if (txd != NULL) { #ifdef HN_USE_TXDESC_BUFRING +#ifdef HN_DEBUG atomic_subtract_int(&txr->hn_txdesc_avail, 1); #endif +#endif /* HN_USE_TXDESC_BUFRING */ KASSERT(txd->m == NULL && txd->refs == 0 && STAILQ_EMPTY(&txd->agg_list) && txd->chim_index == HN_NVS_CHIM_IDX_INVALID && @@ -1933,17 +1938,20 @@ done: static int hn_txpkt(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd) { - int error, send_failed = 0; + int error, send_failed = 0, has_bpf; again: - /* - * Make sure that this txd and any aggregated txds are not freed - * before ETHER_BPF_MTAP. - */ - hn_txdesc_hold(txd); + has_bpf = bpf_peers_present(ifp->if_bpf); + if (has_bpf) { + /* + * Make sure that this txd and any aggregated txds are not + * freed before ETHER_BPF_MTAP. + */ + hn_txdesc_hold(txd); + } error = txr->hn_sendpkt(txr, txd); if (!error) { - if (bpf_peers_present(ifp->if_bpf)) { + if (has_bpf) { const struct hn_txdesc *tmp_txd; ETHER_BPF_MTAP(ifp, txd->m); @@ -1966,7 +1974,8 @@ again: txr->hn_pkts += txr->hn_stat_pkts; txr->hn_sends++; } - hn_txdesc_put(txr, txd); + if (has_bpf) + hn_txdesc_put(txr, txd); if (__predict_false(error)) { int freed; @@ -3479,9 +3488,11 @@ hn_tx_ring_create(struct hn_softc *sc, i if (txr->hn_tx_sysctl_tree != NULL) { child = SYSCTL_CHILDREN(txr->hn_tx_sysctl_tree); +#ifdef HN_DEBUG SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", CTLFLAG_RD, &txr->hn_txdesc_avail, 0, "# of available TX descs"); +#endif #ifdef HN_IFSTART_SUPPORT if (!hn_use_if_start) #endif Modified: stable/10/sys/modules/hyperv/netvsc/Makefile ============================================================================== --- stable/10/sys/modules/hyperv/netvsc/Makefile Fri Dec 30 01:34:06 2016 (r310798) +++ stable/10/sys/modules/hyperv/netvsc/Makefile Fri Dec 30 01:59:19 2016 (r310799) @@ -5,7 +5,7 @@ KMOD= hv_netvsc SRCS= hn_nvs.c hn_rndis.c if_hn.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h +SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h opt_hn.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc From owner-svn-src-all@freebsd.org Fri Dec 30 02:00:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D1F5C97546; Fri, 30 Dec 2016 02:00:43 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from st11p00im-asmtp003.me.com (st11p00im-asmtp003.me.com [17.172.80.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E96EF15D1; Fri, 30 Dec 2016 02:00:42 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.st11p00im-asmtp003.me.com by st11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OIZ0050041U0Z00@st11p00im-asmtp003.me.com>; Fri, 30 Dec 2016 00:59:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1483059566; bh=nfna8saqi11VWLLv4lqG21xac7TWPsR5WFKEMqhuXF0=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=mqx0/Ln1SQuuqXSSESW7BA/6OTHkqBFuKvSoxBr3E3Z1vILaMhq95Ft15wNoX0SER zDGhBj8KTIixyykbi7NZ5BqXNkj99RkjzV7KypvKIgzRZYJuqKgAD8gYrRERdB0v29 2+joYAko+yNspO+4gnfM8sXd/9nVbWZevnOTEe++xIjvwIQaxuzidz0yPYnsfjdxrX dfRx2uFIvHyghycVuCO6Sh9MyZdt5SJ71+KaesM0C77hu8O2MEcx0NRaBBHuehw+9e Aq9PYtLbR4rVpgIRyR+TqCsKv0GTwCV/HZf54Eqmmn0/bX7KF4vX7faDEYt84L32sw idshNlav3H7tw== Received: from [10.0.0.7] (c-73-6-177-70.hsd1.tx.comcast.net [73.6.177.70]) by st11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OIZ0001542XGK10@st11p00im-asmtp003.me.com>; Fri, 30 Dec 2016 00:59:25 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-29_19:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612300013 User-Agent: Microsoft-MacOutlook/f.1d.0.161209 Date: Thu, 29 Dec 2016 18:59:17 -0600 Subject: Re: svn commit: r310789 - head/lib/libpam/static_libpam From: Ravi Pokala Sender: "Pokala, Ravi" To: Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <1A7F0D4F-1F4D-4885-B7E9-F764D4FA72BF@panasas.com> Thread-topic: svn commit: r310789 - head/lib/libpam/static_libpam References: <201612292130.uBTLUqus011628@repo.freebsd.org> In-reply-to: <201612292130.uBTLUqus011628@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 02:00:43 -0000 Hi Alexander, I'm a little confused - the original version had to have had a compile-only step to generate the object first, before running the link-only operation against the object. The new code replaces the link-only operation with a compile+link operation. Shouldn't the pre-existing compile-only operation be removed, since the new compile+link operation supersedes it? Thanks, Ravi (rpokala@) -----Original Message----- > From: on behalf of Alexander Kabaev > Date: 2016-12-29, Thursday at 15:30 > To: , , > Subject: svn commit: r310789 - head/lib/libpam/static_libpam > > Author: kan > Date: Thu Dec 29 21:30:52 2016 > New Revision: 310789 > URL: https://svnweb.freebsd.org/changeset/base/310789 > > Log: > Use compiler driver to build relocatable object > > This works better with external toolchains where LD > will not necessarily defailt to emulation we want. > Compiler driver knows better. > > Modified: > head/lib/libpam/static_libpam/Makefile > > Modified: head/lib/libpam/static_libpam/Makefile > ============================================================================== > --- head/lib/libpam/static_libpam/Makefile Thu Dec 29 21:06:31 2016 (r310788) > +++ head/lib/libpam/static_libpam/Makefile Thu Dec 29 21:30:52 2016 (r310789) > @@ -64,6 +64,6 @@ CLEANFILES+= openpam_static.o \ > openpam_static_modules.o > > openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} > - ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} > + ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC} > > .include "${.CURDIR}/../libpam/Makefile" From owner-svn-src-all@freebsd.org Fri Dec 30 02:02:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17520C975D4; Fri, 30 Dec 2016 02:02:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2C991961; Fri, 30 Dec 2016 02:02:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU2215I022325; Fri, 30 Dec 2016 02:02:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU221EG022324; Fri, 30 Dec 2016 02:02:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612300202.uBU221EG022324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 30 Dec 2016 02:02: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: r310800 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 02:02:02 -0000 Author: sephe Date: Fri Dec 30 02:02:00 2016 New Revision: 310800 URL: https://svnweb.freebsd.org/changeset/base/310800 Log: MFC 309704 hyperv/vmbus: Utilize vmbus_chan_run_task() Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8686 Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Fri Dec 30 01:59:19 2016 (r310799) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Fri Dec 30 02:02:00 2016 (r310800) @@ -772,8 +772,7 @@ vmbus_chan_clear_chmap(struct vmbus_chan struct task chmap_task; TASK_INIT(&chmap_task, 0, vmbus_chan_clrchmap_task, chan); - taskqueue_enqueue(chan->ch_tq, &chmap_task); - taskqueue_drain(chan->ch_tq, &chmap_task); + vmbus_chan_run_task(chan, &chmap_task); } static void From owner-svn-src-all@freebsd.org Fri Dec 30 02:06:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68DCAC977FB; Fri, 30 Dec 2016 02:06:19 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20F841BD8; Fri, 30 Dec 2016 02:06:19 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qk0-x244.google.com with SMTP id n21so37334300qka.0; Thu, 29 Dec 2016 18:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=kp2PJbhLjq1XmvJogHDxpLTu+ieazEmd6N4OMDJBk4w=; b=T3Sr9Gh0yYi0SceSiHufXKeD+QwHKSWW/ifMDS/S5fMS+rZGXaMYYls9MuW1sZS2lA WZjiumvlZggV1+9cB2cvMARCgbfPoLwSL4p24ZE6zjgknrvoLGGBmXu4ylPeu8bnDiPH 8mXQc5l2vjz5foXQBERvSftKoH+EYATaa+e3yuRP6aRsMj09r8BG2M+YSe9BowMRFdeY sUIjjxcrNctWgxK0O4Q+bo/AVXvdHfZg6DIZQhugnJC+BeDFWJAz3oCd6/NYQ0PQXDSk acfKiiUUYSvaQehoA2g8CAhadsk1V4rzQ+9+BnzSx2jpaUsf9EDIgyfevOzpQZfHwvrX 1KKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=kp2PJbhLjq1XmvJogHDxpLTu+ieazEmd6N4OMDJBk4w=; b=V5gtTjy/h+DgQjkKkEZ/o3oUJMBmtepPIX1MQS23aej8EB+CoWlEOsve7u3HaAQhTf 1gWfsPg9Z8atqm6GUGJP+W5pytfQX5pd8WEcdZLlgd5NA6coAf10nhKRWosYs+x78+Ke wjr+06lqIGE+4myUp9BDWA3W5igR8a0llb9ey625Kf5AySdgito9SnRrg2pPcV3b+wRO ksjFir3wkb/biRKUpRWbWJ9Sdtnxotx/yx3WO4t94X8rYShYTEmOUunyLAgAgwCJ++Dv UCf8gnZA5HnAef5S9+DcS+X66GJBvT6HptDLFiHaGzq/LMXxhCXjtNmpn4VbVlD48jjj 9ZQA== X-Gm-Message-State: AIkVDXIw+3wlak6zaGlLbhqx/qZ6E80B4S1QuAI8UP19n0XlwUx6z7HCJbACuPMR23LtJg== X-Received: by 10.55.72.141 with SMTP id v135mr38997207qka.50.1483063578365; Thu, 29 Dec 2016 18:06:18 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id 5sm34336480qts.47.2016.12.29.18.06.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2016 18:06:17 -0800 (PST) Date: Thu, 29 Dec 2016 21:06:12 -0500 From: Alexander Kabaev To: Ravi Pokala Cc: Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310789 - head/lib/libpam/static_libpam Message-ID: <20161229210612.3696bff0@kan> In-Reply-To: <1A7F0D4F-1F4D-4885-B7E9-F764D4FA72BF@panasas.com> References: <201612292130.uBTLUqus011628@repo.freebsd.org> <1A7F0D4F-1F4D-4885-B7E9-F764D4FA72BF@panasas.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/RQnhCKh2Cbfb=ik3eCsZc0c"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 02:06:19 -0000 --Sig_/RQnhCKh2Cbfb=ik3eCsZc0c Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 29 Dec 2016 18:59:17 -0600 Ravi Pokala wrote: > Hi Alexander, >=20 > I'm a little confused - the original version had to have had a > compile-only step to generate the object first, before running the > link-only operation against the object. The new code replaces the > link-only operation with a compile+link operation. Shouldn't the > pre-existing compile-only operation be removed, since the new > compile+link operation supersedes it? >=20 > Thanks, >=20 > Ravi (rpokala@) >=20 Well, clearly it does not replace link-only operation with compile+link as you suggest. It feeds .o file to to the compiler driver which then invokes ld with all the correct parameters for the target object format. --=20 Alexander Kabaev --Sig_/RQnhCKh2Cbfb=ik3eCsZc0c Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEExffZlZm2QeE8UVaRBxMimZJ5Ln4FAlhlwRRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM1 RjdEOTk1OTlCNjQxRTEzQzUxNTY5MTA3MTMyMjk5OTI3OTJFN0UACgkQBxMimZJ5 Ln55tw//VIbU0QL0qAG5vSOAKAAAb0W3BsexhuM4iMYO6qNCsSY+wgjq+dxmgoco kePb2YDc4l/+eTfAx1PeIMNHUHAyhihECJiQ276Dj8OUgog8j8wjzEUdmeJAlk9A hVI8mV/MAY5onkQ2YTsRX/F0L5mPZzqHeks/Sr745fCrn30bBr81E/o8k90yj/vq vqs3CsXFVxPGgcopv5jGSIvtYGj92jC56C49oCfZyq2S4mgCBW0+Kk4uq2jxm39q 68cQUznKtTfPMeODKKgOvf+D/iipu6aaT127r7QfQm7vzJJpPdDAARDpNX7nKcrs EVYEtKGhz0PO0sY7wVCPwmjFAamdOqaHQezaxsBynLrgbfcUEUX7kyjv3tYDY3/5 2J8R20eAYox5TuMGgkWK77xYEyHiODNcAgrwQ77/uFV8vodtgKFbfkdwKVmQnzk+ VDcuLHTTk99e7Jwggcu7XUOvJr7G26Gb0g32j3yp7qlAr2ZGEBJxSMPgrQzd5zXK gG8VHTby5c7/7R9MJw/L/gT0Y3rdt0tOMO5zU46jLm3+6yke+nqG5AQ9fK2Cim4i oVKDL4G4EcfVicMqCgihtORXawt9Zn0G4KXtWrCRBcJr67cNuFMn6eedznL9pr01 SUpnVCPvLy1m/tM9RM3BQFa3zLR3NCjI70RNyhX4ecZcjwzDgBU= =i6OC -----END PGP SIGNATURE----- --Sig_/RQnhCKh2Cbfb=ik3eCsZc0c-- From owner-svn-src-all@freebsd.org Fri Dec 30 02:13:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2063C979D3; Fri, 30 Dec 2016 02:13:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACC291EDB; Fri, 30 Dec 2016 02:13:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU2DLaJ029239; Fri, 30 Dec 2016 02:13:21 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU2DLMl029233; Fri, 30 Dec 2016 02:13:21 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612300213.uBU2DLMl029233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 30 Dec 2016 02:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310801 - in stable/10/sys/dev/hyperv: include utilities vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 02:13:22 -0000 Author: sephe Date: Fri Dec 30 02:13:21 2016 New Revision: 310801 URL: https://svnweb.freebsd.org/changeset/base/310801 Log: MFC 309705 hyperv/timesync: Support "sent TC" to improve accuracy. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8723 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/utilities/hv_timesync.c stable/10/sys/dev/hyperv/utilities/vmbus_icreg.h stable/10/sys/dev/hyperv/vmbus/hyperv_reg.h stable/10/sys/dev/hyperv/vmbus/hyperv_var.h stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Fri Dec 30 02:02:00 2016 (r310800) +++ stable/10/sys/dev/hyperv/include/hyperv.h Fri Dec 30 02:13:21 2016 (r310801) @@ -36,6 +36,23 @@ #include #include +#define MSR_HV_TIME_REF_COUNT 0x40000020 + +#define CPUID_HV_MSR_TIME_REFCNT 0x0002 /* MSR_HV_TIME_REF_COUNT */ +#define CPUID_HV_MSR_SYNIC 0x0004 /* MSRs for SynIC */ +#define CPUID_HV_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ +#define CPUID_HV_MSR_APIC 0x0010 /* MSR_HV_{EOI,ICR,TPR} */ +#define CPUID_HV_MSR_HYPERCALL 0x0020 /* MSR_HV_GUEST_OS_ID + * MSR_HV_HYPERCALL */ +#define CPUID_HV_MSR_VP_INDEX 0x0040 /* MSR_HV_VP_INDEX */ +#define CPUID_HV_MSR_GUEST_IDLE 0x0400 /* MSR_HV_GUEST_IDLE */ + +#ifndef NANOSEC +#define NANOSEC 1000000000ULL +#endif +#define HYPERV_TIMER_NS_FACTOR 100ULL +#define HYPERV_TIMER_FREQ (NANOSEC / HYPERV_TIMER_NS_FACTOR) + struct hyperv_guid { uint8_t hv_guid[16]; } __packed; @@ -44,4 +61,6 @@ struct hyperv_guid { int hyperv_guid2str(const struct hyperv_guid *, char *, size_t); +extern u_int hyperv_features; /* CPUID_HV_MSR_ */ + #endif /* _HYPERV_H_ */ Modified: stable/10/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_timesync.c Fri Dec 30 02:02:00 2016 (r310800) +++ stable/10/sys/dev/hyperv/utilities/hv_timesync.c Fri Dec 30 02:13:21 2016 (r310801) @@ -46,10 +46,14 @@ __FBSDID("$FreeBSD$"); #define VMBUS_TIMESYNC_FWVER \ VMBUS_IC_VERSION(VMBUS_TIMESYNC_FWVER_MAJOR, 0) -#define VMBUS_TIMESYNC_MSGVER_MAJOR 3 +#define VMBUS_TIMESYNC_MSGVER_MAJOR 4 #define VMBUS_TIMESYNC_MSGVER \ VMBUS_IC_VERSION(VMBUS_TIMESYNC_MSGVER_MAJOR, 0) +#define VMBUS_TIMESYNC_DORTT(sc) \ + ((sc)->ic_msgver >= VMBUS_IC_VERSION(4, 0) && \ + (hyperv_features & CPUID_HV_MSR_TIME_REFCNT)) + static const struct vmbus_ic_desc vmbus_timesync_descs[] = { { .ic_guid = { .hv_guid = { @@ -81,12 +85,16 @@ SYSCTL_INT(_hw_hvtimesync, OID_AUTO, sam &vmbus_ts_sample_verbose, 0, "Increase sample request verbosity."); static void -vmbus_timesync(struct hv_util_sc *sc, uint64_t hvtime, uint8_t tsflags) +vmbus_timesync(struct hv_util_sc *sc, uint64_t hvtime, uint64_t sent_tc, + uint8_t tsflags) { struct timespec vm_ts; - uint64_t hv_ns, vm_ns; + uint64_t hv_ns, vm_ns, rtt = 0; + + if (VMBUS_TIMESYNC_DORTT(sc)) + rtt = rdmsr(MSR_HV_TIME_REF_COUNT) - sent_tc; - hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE) * VMBUS_ICMSG_TS_FACTOR; + hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE + rtt) * HYPERV_TIMER_NS_FACTOR; nanotime(&vm_ts); vm_ns = (vm_ts.tv_sec * NANOSEC) + vm_ts.tv_nsec; @@ -174,6 +182,8 @@ vmbus_timesync_cb(struct vmbus_channel * VMBUS_TIMESYNC_FWVER, VMBUS_TIMESYNC_MSGVER); if (error) return; + if (VMBUS_TIMESYNC_DORTT(sc)) + device_printf(sc->ic_dev, "RTT\n"); break; case VMBUS_ICMSG_TYPE_TIMESYNC: @@ -183,7 +193,8 @@ vmbus_timesync_cb(struct vmbus_channel * return; } msg = data; - vmbus_timesync(sc, msg->ic_hvtime, msg->ic_tsflags); + vmbus_timesync(sc, msg->ic_hvtime, msg->ic_sent_tc, + msg->ic_tsflags); break; default: Modified: stable/10/sys/dev/hyperv/utilities/vmbus_icreg.h ============================================================================== --- stable/10/sys/dev/hyperv/utilities/vmbus_icreg.h Fri Dec 30 02:02:00 2016 (r310800) +++ stable/10/sys/dev/hyperv/utilities/vmbus_icreg.h Fri Dec 30 02:13:21 2016 (r310801) @@ -114,18 +114,13 @@ struct vmbus_icmsg_timesync { struct vmbus_icmsg_hdr ic_hdr; uint64_t ic_hvtime; uint64_t ic_vmtime; - uint64_t ic_rtt; + uint64_t ic_sent_tc; uint8_t ic_tsflags; /* VMBUS_ICMSG_TS_FLAG_ */ } __packed; #define VMBUS_ICMSG_TS_FLAG_SYNC 0x01 #define VMBUS_ICMSG_TS_FLAG_SAMPLE 0x02 -/* XXX consolidate w/ hyperv */ #define VMBUS_ICMSG_TS_BASE 116444736000000000ULL -#define VMBUS_ICMSG_TS_FACTOR 100ULL -#ifndef NANOSEC -#define NANOSEC 1000000000ULL -#endif #endif /* !_VMBUS_ICREG_H_ */ Modified: stable/10/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hyperv_reg.h Fri Dec 30 02:02:00 2016 (r310800) +++ stable/10/sys/dev/hyperv/vmbus/hyperv_reg.h Fri Dec 30 02:13:21 2016 (r310801) @@ -57,8 +57,6 @@ #define MSR_HV_VP_INDEX 0x40000002 -#define MSR_HV_TIME_REF_COUNT 0x40000020 - #define MSR_HV_SCONTROL 0x40000080 #define MSR_HV_SCTRL_ENABLE 0x0001ULL #define MSR_HV_SCTRL_RSVD_MASK 0xfffffffffffffffeULL @@ -106,15 +104,7 @@ #define CPUID_LEAF_HV_IDENTITY 0x40000002 #define CPUID_LEAF_HV_FEATURES 0x40000003 -/* EAX: features */ -#define CPUID_HV_MSR_TIME_REFCNT 0x0002 /* MSR_HV_TIME_REF_COUNT */ -#define CPUID_HV_MSR_SYNIC 0x0004 /* MSRs for SynIC */ -#define CPUID_HV_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ -#define CPUID_HV_MSR_APIC 0x0010 /* MSR_HV_{EOI,ICR,TPR} */ -#define CPUID_HV_MSR_HYPERCALL 0x0020 /* MSR_HV_GUEST_OS_ID - * MSR_HV_HYPERCALL */ -#define CPUID_HV_MSR_VP_INDEX 0x0040 /* MSR_HV_VP_INDEX */ -#define CPUID_HV_MSR_GUEST_IDLE 0x0400 /* MSR_HV_GUEST_IDLE */ +/* EAX: features include/hyperv.h CPUID_HV_MSR */ /* ECX: power management features */ #define CPUPM_HV_CSTATE_MASK 0x000f /* deepest C-state */ #define CPUPM_HV_C3_HPET 0x0010 /* C3 requires HPET */ Modified: stable/10/sys/dev/hyperv/vmbus/hyperv_var.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hyperv_var.h Fri Dec 30 02:02:00 2016 (r310800) +++ stable/10/sys/dev/hyperv/vmbus/hyperv_var.h Fri Dec 30 02:13:21 2016 (r310801) @@ -31,13 +31,6 @@ #include -#ifndef NANOSEC -#define NANOSEC 1000000000ULL -#endif -#define HYPERV_TIMER_NS_FACTOR 100ULL -#define HYPERV_TIMER_FREQ (NANOSEC / HYPERV_TIMER_NS_FACTOR) - -extern u_int hyperv_features; extern u_int hyperv_recommends; uint64_t hypercall_post_message(bus_addr_t msg_paddr); Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Fri Dec 30 02:02:00 2016 (r310800) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Fri Dec 30 02:13:21 2016 (r310801) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include From owner-svn-src-all@freebsd.org Fri Dec 30 02:18:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E7AFC97AFD; Fri, 30 Dec 2016 02:18:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F13910D8; Fri, 30 Dec 2016 02:18:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU2IZk4029473; Fri, 30 Dec 2016 02:18:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU2IZBO029468; Fri, 30 Dec 2016 02:18:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612300218.uBU2IZBO029468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 30 Dec 2016 02:18: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: r310802 - in stable/10/sys/dev/hyperv: include netvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 02:18:36 -0000 Author: sephe Date: Fri Dec 30 02:18:34 2016 New Revision: 310802 URL: https://svnweb.freebsd.org/changeset/base/310802 Log: MFC 309874,309875 309874 hyperv/vmbus: Add channel polling support. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8738 309875 hyperv/hn: Add polling support Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8739 Modified: stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus.h ============================================================================== --- stable/10/sys/dev/hyperv/include/vmbus.h Fri Dec 30 02:13:21 2016 (r310801) +++ stable/10/sys/dev/hyperv/include/vmbus.h Fri Dec 30 02:18:34 2016 (r310802) @@ -50,6 +50,9 @@ #define VMBUS_VERSION_MAJOR(ver) (((uint32_t)(ver)) >> 16) #define VMBUS_VERSION_MINOR(ver) (((uint32_t)(ver)) & 0xffff) +#define VMBUS_CHAN_POLLHZ_MIN 100 /* 10ms interval */ +#define VMBUS_CHAN_POLLHZ_MAX 1000000 /* 1us interval */ + /* * GPA stuffs. */ @@ -221,4 +224,8 @@ bool vmbus_chan_tx_empty(const struct v struct taskqueue * vmbus_chan_mgmt_tq(const struct vmbus_channel *chan); +void vmbus_chan_poll_enable(struct vmbus_channel *chan, + u_int pollhz); +void vmbus_chan_poll_disable(struct vmbus_channel *chan); + #endif /* !_VMBUS_H_ */ Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Dec 30 02:13:21 2016 (r310801) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Fri Dec 30 02:18:34 2016 (r310802) @@ -286,6 +286,7 @@ static int hn_txagg_size_sysctl(SYSCTL static int hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *); static void hn_init_locked(struct hn_softc *); @@ -312,6 +313,8 @@ static void hn_resume_mgmt(struct hn_s static void hn_suspend_mgmt_taskfunc(void *, int); static void hn_chan_drain(struct hn_softc *, struct vmbus_channel *); +static void hn_polling(struct hn_softc *, u_int); +static void hn_chan_polling(struct vmbus_channel *, u_int); static void hn_update_link_status(struct hn_softc *); static void hn_change_network(struct hn_softc *); @@ -1095,6 +1098,10 @@ hn_attach(device_t dev) hn_txagg_pkts_sysctl, "I", "Packet transmission aggregation packets, " "0 -- disable, -1 -- auto"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "polling", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + hn_polling_sysctl, "I", + "Polling frequency: [100,1000000], 0 disable polling"); /* * Setup the ifmedia, which has been initialized earlier. @@ -2347,6 +2354,9 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, break; } + /* Disable polling. */ + hn_polling(sc, 0); + /* * Suspend this interface before the synthetic parts * are ripped. @@ -2392,6 +2402,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, */ hn_resume(sc); + /* + * Re-enable polling if this interface is running and + * the polling is requested. + */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && sc->hn_pollhz > 0) + hn_polling(sc, sc->hn_pollhz); + HN_UNLOCK(sc); break; @@ -2518,6 +2535,9 @@ hn_stop(struct hn_softc *sc) KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, ("synthetic parts were not attached")); + /* Disable polling. */ + hn_polling(sc, 0); + /* Clear RUNNING bit _before_ hn_suspend_data() */ atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); hn_suspend_data(sc); @@ -2555,6 +2575,10 @@ hn_init_locked(struct hn_softc *sc) /* Everything is ready; unleash! */ atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); + + /* Re-enable polling if requested. */ + if (sc->hn_pollhz > 0) + hn_polling(sc, sc->hn_pollhz); } static void @@ -2862,6 +2886,61 @@ hn_txagg_align_sysctl(SYSCTL_HANDLER_ARG return (sysctl_handle_int(oidp, &align, 0, req)); } +static void +hn_chan_polling(struct vmbus_channel *chan, u_int pollhz) +{ + if (pollhz == 0) + vmbus_chan_poll_disable(chan); + else + vmbus_chan_poll_enable(chan, pollhz); +} + +static void +hn_polling(struct hn_softc *sc, u_int pollhz) +{ + int nsubch = sc->hn_rx_ring_inuse - 1; + + HN_LOCK_ASSERT(sc); + + if (nsubch > 0) { + struct vmbus_channel **subch; + int i; + + subch = vmbus_subchan_get(sc->hn_prichan, nsubch); + for (i = 0; i < nsubch; ++i) + hn_chan_polling(subch[i], pollhz); + vmbus_subchan_rel(subch, nsubch); + } + hn_chan_polling(sc->hn_prichan, pollhz); +} + +static int +hn_polling_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int pollhz, error; + + pollhz = sc->hn_pollhz; + error = sysctl_handle_int(oidp, &pollhz, 0, req); + if (error || req->newptr == NULL) + return (error); + + if (pollhz != 0 && + (pollhz < VMBUS_CHAN_POLLHZ_MIN || pollhz > VMBUS_CHAN_POLLHZ_MAX)) + return (EINVAL); + + HN_LOCK(sc); + if (sc->hn_pollhz != pollhz) { + sc->hn_pollhz = pollhz; + if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) && + (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) + hn_polling(sc, sc->hn_pollhz); + } + HN_UNLOCK(sc); + + return (0); +} + static int hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS) { Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Fri Dec 30 02:13:21 2016 (r310801) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Fri Dec 30 02:18:34 2016 (r310802) @@ -213,6 +213,8 @@ struct hn_softc { uint32_t hn_caps; /* HN_CAP_ */ uint32_t hn_flags; /* HN_FLAG_ */ + u_int hn_pollhz; + void *hn_rxbuf; uint32_t hn_rxbuf_gpadl; struct hyperv_dma hn_rxbuf_dma; Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Fri Dec 30 02:13:21 2016 (r310801) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Fri Dec 30 02:18:34 2016 (r310802) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -50,6 +51,11 @@ __FBSDID("$FreeBSD$"); #include #include +struct vmbus_chan_pollarg { + struct vmbus_channel *poll_chan; + u_int poll_hz; +}; + static void vmbus_chan_update_evtflagcnt( struct vmbus_softc *, const struct vmbus_channel *); @@ -68,6 +74,10 @@ static void vmbus_chan_clear_chmap(str static void vmbus_chan_detach(struct vmbus_channel *); static bool vmbus_chan_wait_revoke( const struct vmbus_channel *, bool); +static void vmbus_chan_poll_timeout(void *); +static bool vmbus_chan_poll_cancel_intq( + struct vmbus_channel *); +static void vmbus_chan_poll_cancel(struct vmbus_channel *); static void vmbus_chan_ins_prilist(struct vmbus_softc *, struct vmbus_channel *); @@ -84,7 +94,11 @@ static void vmbus_chan_rem_sublist(str static void vmbus_chan_task(void *, int); static void vmbus_chan_task_nobatch(void *, int); +static void vmbus_chan_poll_task(void *, int); static void vmbus_chan_clrchmap_task(void *, int); +static void vmbus_chan_pollcfg_task(void *, int); +static void vmbus_chan_polldis_task(void *, int); +static void vmbus_chan_poll_cancel_task(void *, int); static void vmbus_prichan_attach_task(void *, int); static void vmbus_subchan_attach_task(void *, int); static void vmbus_prichan_detach_task(void *, int); @@ -782,6 +796,22 @@ vmbus_chan_set_chmap(struct vmbus_channe chan->ch_vmbus->vmbus_chmap[chan->ch_id] = chan; } +static void +vmbus_chan_poll_cancel_task(void *xchan, int pending __unused) +{ + + vmbus_chan_poll_cancel_intq(xchan); +} + +static void +vmbus_chan_poll_cancel(struct vmbus_channel *chan) +{ + struct task poll_cancel; + + TASK_INIT(&poll_cancel, 0, vmbus_chan_poll_cancel_task, chan); + vmbus_chan_run_task(chan, &poll_cancel); +} + static int vmbus_chan_close_internal(struct vmbus_channel *chan) { @@ -818,6 +848,11 @@ vmbus_chan_close_internal(struct vmbus_c sysctl_ctx_free(&chan->ch_sysctl_ctx); /* + * Cancel polling, if it is enabled. + */ + vmbus_chan_poll_cancel(chan); + + /* * NOTE: * Order is critical. This channel _must_ be uninstalled first, * else the channel task may be enqueued by the IDT after it has @@ -1185,6 +1220,9 @@ vmbus_chan_task(void *xchan, int pending vmbus_chan_callback_t cb = chan->ch_cb; void *cbarg = chan->ch_cbarg; + KASSERT(chan->ch_poll_intvl == 0, + ("chan%u: interrupted in polling mode", chan->ch_id)); + /* * Optimize host to guest signaling by ensuring: * 1. While reading the channel, we disable interrupts from @@ -1216,9 +1254,145 @@ vmbus_chan_task_nobatch(void *xchan, int { struct vmbus_channel *chan = xchan; + KASSERT(chan->ch_poll_intvl == 0, + ("chan%u: interrupted in polling mode", chan->ch_id)); + chan->ch_cb(chan, chan->ch_cbarg); +} + +static void +vmbus_chan_poll_timeout(void *xchan) +{ + struct vmbus_channel *chan = xchan; + + KASSERT(chan->ch_poll_intvl != 0, + ("chan%u: polling timeout in interrupt mode", chan->ch_id)); + taskqueue_enqueue(chan->ch_tq, &chan->ch_poll_task); +} + +static void +vmbus_chan_poll_task(void *xchan, int pending __unused) +{ + struct vmbus_channel *chan = xchan; + + KASSERT(chan->ch_poll_intvl != 0, + ("chan%u: polling in interrupt mode", chan->ch_id)); + callout_reset_sbt_curcpu(&chan->ch_poll_timeo, chan->ch_poll_intvl, 0, + vmbus_chan_poll_timeout, chan, chan->ch_poll_flags); chan->ch_cb(chan, chan->ch_cbarg); } +static void +vmbus_chan_pollcfg_task(void *xarg, int pending __unused) +{ + const struct vmbus_chan_pollarg *arg = xarg; + struct vmbus_channel *chan = arg->poll_chan; + sbintime_t intvl; + int poll_flags; + + /* + * Save polling interval. + */ + intvl = SBT_1S / arg->poll_hz; + if (intvl == 0) + intvl = 1; + if (intvl == chan->ch_poll_intvl) { + /* Nothing changes; done */ + return; + } + chan->ch_poll_intvl = intvl; + + /* Adjust callout flags. */ + poll_flags = C_DIRECT_EXEC; + if (arg->poll_hz <= hz) + poll_flags |= C_HARDCLOCK; + chan->ch_poll_flags = poll_flags; + + /* + * Disable interrupt from the RX bufring (TX bufring does not + * generate interrupt to VM), and disconnect this channel from + * the channel map to make sure that ISR can not enqueue this + * channel task anymore. + */ + critical_enter(); + vmbus_rxbr_intr_mask(&chan->ch_rxbr); + chan->ch_vmbus->vmbus_chmap[chan->ch_id] = NULL; + critical_exit(); + + /* + * NOTE: + * At this point, this channel task will not be enqueued by + * the ISR anymore, time to cancel the pending one. + */ + taskqueue_cancel(chan->ch_tq, &chan->ch_task, NULL); + + /* Kick start! */ + taskqueue_enqueue(chan->ch_tq, &chan->ch_poll_task); +} + +static bool +vmbus_chan_poll_cancel_intq(struct vmbus_channel *chan) +{ + + if (chan->ch_poll_intvl == 0) { + /* Not enabled. */ + return (false); + } + + /* + * Stop polling callout, so that channel polling task + * will not be enqueued anymore. + */ + callout_drain(&chan->ch_poll_timeo); + + /* + * Disable polling by resetting polling interval. + * + * NOTE: + * The polling interval resetting MUST be conducted + * after the callout is drained; mainly to keep the + * proper assertion in place. + */ + chan->ch_poll_intvl = 0; + + /* + * NOTE: + * At this point, this channel polling task will not be + * enqueued by the callout anymore, time to cancel the + * pending one. + */ + taskqueue_cancel(chan->ch_tq, &chan->ch_poll_task, NULL); + + /* Polling was enabled. */ + return (true); +} + +static void +vmbus_chan_polldis_task(void *xchan, int pending __unused) +{ + struct vmbus_channel *chan = xchan; + + if (!vmbus_chan_poll_cancel_intq(chan)) { + /* Already disabled; done. */ + return; + } + + /* + * Plug this channel back to the channel map and unmask + * the RX bufring interrupt. + */ + critical_enter(); + chan->ch_vmbus->vmbus_chmap[chan->ch_id] = chan; + __compiler_membar(); + vmbus_rxbr_intr_unmask(&chan->ch_rxbr); + critical_exit(); + + /* + * Kick start the interrupt task, just in case unmasking + * interrupt races ISR. + */ + taskqueue_enqueue(chan->ch_tq, &chan->ch_task); +} + static __inline void vmbus_event_flags_proc(struct vmbus_softc *sc, volatile u_long *event_flags, int flag_cnt) @@ -1333,6 +1507,9 @@ vmbus_chan_alloc(struct vmbus_softc *sc) vmbus_rxbr_init(&chan->ch_rxbr); vmbus_txbr_init(&chan->ch_txbr); + TASK_INIT(&chan->ch_poll_task, 0, vmbus_chan_poll_task, chan); + callout_init(&chan->ch_poll_timeo, 1); + return chan; } @@ -1351,6 +1528,8 @@ vmbus_chan_free(struct vmbus_channel *ch ("still has orphan xact installed")); KASSERT(chan->ch_refs == 0, ("chan%u: invalid refcnt %d", chan->ch_id, chan->ch_refs)); + KASSERT(chan->ch_poll_intvl == 0, ("chan%u: polling is activated", + chan->ch_id)); hyperv_dmamem_free(&chan->ch_monprm_dma, chan->ch_monprm); mtx_destroy(&chan->ch_subchan_lock); @@ -1998,3 +2177,32 @@ vmbus_chan_xact_wait(const struct vmbus_ } return (ret); } + +void +vmbus_chan_poll_enable(struct vmbus_channel *chan, u_int pollhz) +{ + struct vmbus_chan_pollarg arg; + struct task poll_cfg; + + KASSERT(chan->ch_flags & VMBUS_CHAN_FLAG_BATCHREAD, + ("enable polling on non-batch chan%u", chan->ch_id)); + KASSERT(pollhz >= VMBUS_CHAN_POLLHZ_MIN && + pollhz <= VMBUS_CHAN_POLLHZ_MAX, ("invalid pollhz %u", pollhz)); + + arg.poll_chan = chan; + arg.poll_hz = pollhz; + TASK_INIT(&poll_cfg, 0, vmbus_chan_pollcfg_task, &arg); + vmbus_chan_run_task(chan, &poll_cfg); +} + +void +vmbus_chan_poll_disable(struct vmbus_channel *chan) +{ + struct task poll_dis; + + KASSERT(chan->ch_flags & VMBUS_CHAN_FLAG_BATCHREAD, + ("disable polling on non-batch chan%u", chan->ch_id)); + + TASK_INIT(&poll_dis, 0, vmbus_chan_polldis_task, chan); + vmbus_chan_run_task(chan, &poll_dis); +} Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h Fri Dec 30 02:13:21 2016 (r310801) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h Fri Dec 30 02:18:34 2016 (r310802) @@ -30,6 +30,7 @@ #define _VMBUS_CHANVAR_H_ #include +#include #include #include #include @@ -49,6 +50,7 @@ struct vmbus_channel { * target CPU. */ uint32_t ch_flags; /* VMBUS_CHAN_FLAG_ */ + int ch_poll_flags; /* callout flags */ /* * RX bufring; immediately following ch_txbr. @@ -57,6 +59,9 @@ struct vmbus_channel { struct taskqueue *ch_tq; struct task ch_task; + struct task ch_poll_task; + sbintime_t ch_poll_intvl; + struct callout ch_poll_timeo; vmbus_chan_callback_t ch_cb; void *ch_cbarg; From owner-svn-src-all@freebsd.org Fri Dec 30 02:22:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C696C97D15; Fri, 30 Dec 2016 02:22:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8961553; Fri, 30 Dec 2016 02:22:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU2Mc0l033355; Fri, 30 Dec 2016 02:22:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU2Mcqd033353; Fri, 30 Dec 2016 02:22:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201612300222.uBU2Mcqd033353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 30 Dec 2016 02:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310803 - head/tests/sys/geom/class/nop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 02:22:39 -0000 Author: asomers Date: Fri Dec 30 02:22:38 2016 New Revision: 310803 URL: https://svnweb.freebsd.org/changeset/base/310803 Log: ATFify the gnop tests Also, add test cases for the -p, -P, and -s options to gnop create Reviewed by: ngie MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D8892 Added: head/tests/sys/geom/class/nop/nop_test.sh (contents, props changed) Deleted: head/tests/sys/geom/class/nop/1_test.sh head/tests/sys/geom/class/nop/2_test.sh head/tests/sys/geom/class/nop/conf.sh Modified: head/tests/sys/geom/class/nop/Makefile Modified: head/tests/sys/geom/class/nop/Makefile ============================================================================== --- head/tests/sys/geom/class/nop/Makefile Fri Dec 30 02:18:34 2016 (r310802) +++ head/tests/sys/geom/class/nop/Makefile Fri Dec 30 02:22:38 2016 (r310803) @@ -4,13 +4,6 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} -TAP_TESTS_SH+= 1_test -TAP_TESTS_SH+= 2_test - -${PACKAGE}FILES+= conf.sh - -.for t in ${TAP_TESTS_SH} -TEST_METADATA.$t+= required_user="root" -.endfor +ATF_TESTS_SH+= nop_test .include Added: head/tests/sys/geom/class/nop/nop_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/nop/nop_test.sh Fri Dec 30 02:22:38 2016 (r310803) @@ -0,0 +1,166 @@ +# Copyright (c) 2016 Alan Somers +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +MD_DEVS="md.devs" +PLAINFILES=plainfiles + +atf_test_case diskinfo cleanup +diskinfo_head() +{ + atf_set "descr" "gnop should preserve diskinfo's basic properties" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +diskinfo_body() +{ + us=$(alloc_md) + atf_check gnop create /dev/${us} + md_secsize=$(diskinfo ${us} | cut -wf 2) + md_mediasize=$(diskinfo ${us} | cut -wf 3) + md_stripesize=$(diskinfo ${us} | cut -wf 5) + nop_secsize=$(diskinfo ${us}.nop | cut -wf 2) + nop_mediasize=$(diskinfo ${us}.nop | cut -wf 3) + nop_stripesize=$(diskinfo ${us}.nop | cut -wf 5) + atf_check_equal "$md_secsize" "$nop_secsize" + atf_check_equal "$md_mediasize" "$nop_mediasize" + atf_check_equal "$md_stripesize" "$nop_stripesize" +} +diskinfo_cleanup() +{ + common_cleanup +} + +atf_test_case io cleanup +io_head() +{ + atf_set "descr" "I/O works on gnop devices" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +io_body() +{ + us=$(alloc_md) + atf_check gnop create /dev/${us} + + echo src >> $PLAINFILES + echo dst >> $PLAINFILES + dd if=/dev/random of=src bs=1m count=1 >/dev/null 2>&1 + dd if=src of=/dev/${us}.nop bs=1m count=1 > /dev/null 2>&1 + dd if=/dev/${us}.nop of=dst bs=1m count=1 > /dev/null 2>&1 + + atf_check_equal `md5 -q src` `md5 -q dst` +} +io_cleanup() +{ + common_cleanup +} + +atf_test_case size cleanup +size_head() +{ + atf_set "descr" "Test gnop's -s option" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +size_body() +{ + us=$(alloc_md) + for mediasize in 65536 524288 1048576; do + atf_check gnop create -s ${mediasize} /dev/${us} + gnop_mediasize=`diskinfo /dev/${us}.nop | cut -wf 3` + atf_check_equal "${mediasize}" "${gnop_mediasize}" + atf_check gnop destroy /dev/${us}.nop + done + # We shouldn't be able to extend the provider's size + atf_check -s not-exit:0 -e ignore gnop create -s 2097152 /dev/${us} +} +size_cleanup() +{ + common_cleanup +} + +atf_test_case stripesize cleanup +stripesize_head() +{ + atf_set "descr" "Test gnop's -p and -P options" + atf_set "require.user" "root" + atf_set "timeout" 15 +} +stripesize_body() +{ + us=$(alloc_md) + for ss in 512 1024 2048 4096 8192; do + for sofs in `seq 0 512 ${ss}`; do + [ "$sofs" -eq "$ss" ] && continue + atf_check gnop create -p ${ss} -P ${sofs} /dev/${us} + gnop_ss=`diskinfo /dev/${us}.nop | cut -wf 5` + gnop_sofs=`diskinfo /dev/${us}.nop | cut -wf 6` + atf_check_equal "${ss}" "${gnop_ss}" + atf_check_equal "${sofs}" "${gnop_sofs}" + atf_check gnop destroy /dev/${us}.nop + done + done +} +stripesize_cleanup() +{ + common_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case io + atf_add_test_case diskinfo + atf_add_test_case stripesize + atf_add_test_case size +} + +alloc_md() +{ + local md + + md=$(mdconfig -a -t swap -s 1M) || atf_fail "mdconfig -a failed" + echo ${md} >> $MD_DEVS + echo ${md} +} + +common_cleanup() +{ + if [ -f "$MD_DEVS" ]; then + while read test_md; do + gnop destroy -f ${test_md}.nop 2>/dev/null + mdconfig -d -u $test_md 2>/dev/null + done < $MD_DEVS + rm $MD_DEVS + fi + + if [ -f "$PLAINFILES" ]; then + while read f; do + rm -f ${f} + done < ${PLAINFILES} + rm ${PLAINFILES} + fi + true +} From owner-svn-src-all@freebsd.org Fri Dec 30 03:08:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA80EC967A8; Fri, 30 Dec 2016 03:08:47 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B5C31723; Fri, 30 Dec 2016 03:08:47 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU38kc5049967; Fri, 30 Dec 2016 03:08:46 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU38kNu049966; Fri, 30 Dec 2016 03:08:46 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201612300308.uBU38kNu049966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 30 Dec 2016 03:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310804 - head/sys/dev/rtwn/rtl8812a X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 03:08:47 -0000 Author: kevlo Date: Fri Dec 30 03:08:46 2016 New Revision: 310804 URL: https://svnweb.freebsd.org/changeset/base/310804 Log: - Fix incorrect values in the computation of OFDM and MCS Tx power. - Make power a uint8_t rather than a uint16_t. - Replace the hardcoded RF chains. Reviewed by: avos Modified: head/sys/dev/rtwn/rtl8812a/r12a_chan.c Modified: head/sys/dev/rtwn/rtl8812a/r12a_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_chan.c Fri Dec 30 02:22:38 2016 (r310803) +++ head/sys/dev/rtwn/rtl8812a/r12a_chan.c Fri Dec 30 03:08:46 2016 (r310804) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); static void r12a_write_txpower(struct rtwn_softc *sc, int chain, - struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT]) + struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT]) { if (IEEE80211_IS_CHAN_2GHZ(c)) { @@ -163,7 +163,7 @@ r12a_get_power_group(struct rtwn_softc * static void r12a_get_txpower(struct rtwn_softc *sc, int chain, - struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT]) + struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT]) { struct r12a_softc *rs = sc->sc_priv; int i, ridx, group, max_mcs; @@ -187,11 +187,8 @@ r12a_get_txpower(struct rtwn_softc *sc, for (ridx = RTWN_RIDX_OFDM6; ridx <= max_mcs; ridx++) power[ridx] = rs->ht40_tx_pwr_2g[chain][group]; - if (RTWN_RATE_IS_OFDM(ridx)) { - uint8_t pwr_diff = rs->ofdm_tx_pwr_diff_2g[chain][0]; - for (ridx = RTWN_RIDX_CCK1; ridx <= max_mcs; ridx++) - power[ridx] += pwr_diff; - } + for (ridx = RTWN_RIDX_OFDM6; ridx <= RTWN_RIDX_OFDM54; ridx++) + power[ridx] += rs->ofdm_tx_pwr_diff_2g[chain][0]; for (i = 0; i < sc->ntxchains; i++) { uint8_t min_mcs; @@ -208,7 +205,7 @@ r12a_get_txpower(struct rtwn_softc *sc, else pwr_diff = rs->bw20_tx_pwr_diff_2g[chain][i]; - min_mcs = RTWN_RIDX_MCS(i * 8 + 7); + min_mcs = RTWN_RIDX_MCS(i * 8); for (ridx = min_mcs; ridx <= max_mcs; ridx++) power[ridx] += pwr_diff; } @@ -216,6 +213,9 @@ r12a_get_txpower(struct rtwn_softc *sc, for (ridx = RTWN_RIDX_OFDM6; ridx <= max_mcs; ridx++) power[ridx] = rs->ht40_tx_pwr_5g[chain][group]; + for (ridx = RTWN_RIDX_OFDM6; ridx <= RTWN_RIDX_OFDM54; ridx++) + power[ridx] += rs->ofdm_tx_pwr_diff_5g[chain][0]; + for (i = 0; i < sc->ntxchains; i++) { uint8_t min_mcs; uint8_t pwr_diff; @@ -231,7 +231,7 @@ r12a_get_txpower(struct rtwn_softc *sc, else pwr_diff = rs->bw20_tx_pwr_diff_5g[chain][i]; - min_mcs = RTWN_RIDX_MCS(i * 8 + 7); + min_mcs = RTWN_RIDX_MCS(i * 8); for (ridx = min_mcs; ridx <= max_mcs; ridx++) power[ridx] += pwr_diff; } @@ -256,7 +256,7 @@ r12a_get_txpower(struct rtwn_softc *sc, static void r12a_set_txpower(struct rtwn_softc *sc, struct ieee80211_channel *c) { - uint16_t power[RTWN_RIDX_COUNT]; + uint8_t power[RTWN_RIDX_COUNT]; int i; for (i = 0; i < sc->ntxchains; i++) { @@ -463,7 +463,7 @@ r12a_set_chan(struct rtwn_softc *sc, str /* RTL8812AU-specific */ rtwn_r12a_fix_spur(sc, c); - for (i = 0; i < 2; i++) + for (i = 0; i < sc->nrxchains; i++) rtwn_rf_setbits(sc, i, R92C_RF_CHNLBW, 0xc00, val); /* Set Tx power for this new channel. */ From owner-svn-src-all@freebsd.org Fri Dec 30 06:17:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D94E0C9790C; Fri, 30 Dec 2016 06:17:54 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA9301B43; Fri, 30 Dec 2016 06:17:54 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1403) id 0957271D7; Fri, 30 Dec 2016 06:17:54 +0000 (UTC) Date: Fri, 30 Dec 2016 07:17:53 +0100 From: "Piotr P. Stefaniak" To: "Rodney W. Grimes" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen , svn-src-stable-11@freebsd.org Subject: Re: svn commit: r310773 - in stable/11/sys: netinet netinet6 Message-ID: <20161230061753.GD23243@freefall.freebsd.org> References: <20161229191838.GB23243@freefall.freebsd.org> <201612300117.uBU1HkpP008658@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SO98HVl1bnMOfKZd" Content-Disposition: inline In-Reply-To: <201612300117.uBU1HkpP008658@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 06:17:55 -0000 --SO98HVl1bnMOfKZd Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On 2016-12-29 17:17:46, Rodney W. Grimes wrote: >-- Start of PGP signed section. >> On 2016-12-29 18:09:39, Piotr P. Stefaniak wrote: >> >2) the option -ta was added >> >> To clarify, what I mean is that the process that generates the sources >> started using the -ta switch of indent(1), not that the feature was >> recently implemented. > >Can you clarify what process these source files are generated by? If >these are not the source files, but are being generated by some other >thing then wouldn't we want the true sources and the generation process >in the repsitory? I think that Michael would be the best person to answer that; I'm merely the one who fixes and breaks indent(1). >If this is running indent(1) over source files to clean them up, >then that is not "generating" sources per say, but instead cleaning >them up with indent(1). That's what I mean. Sorry for the confusion. --SO98HVl1bnMOfKZd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEElaLNZulp/QcHQR2KSnkqwcVL7lkFAlhl/AkACgkQSnkqwcVL 7lnp5Af/SoLkiIfm6on/LbJk9dTC2eBod/YfvDLPqHUoJah8gPQKi0byV2YGLB37 2PdctdH3n1LQRgP1UjgfUI7OdfxWDuk6iFm14m6LQvg7KgvZazBn23XnacFpJY2M OhgH5cdArskmCPm8LxT7pGvS1k3P1ytp/9bakzCgR/1GMIPyKbMnC+rnuif8K6x0 kGd78wCAHnmEYQYZCKbFxLeOHdBwJYu/tgX2gdtQDzKzCvg+8BPhwEYyZOodHtBP cTg6rTz4ln8RQjfqBXRoh6ALc8hXM9P4IGlBzp55kWDtDw90VELF48GNH65Ixmig 2T5Sok26RZF9Q2ctrMJJlnpRAiu6Sw== =0UDT -----END PGP SIGNATURE----- --SO98HVl1bnMOfKZd-- From owner-svn-src-all@freebsd.org Fri Dec 30 06:26:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E880C97B29; Fri, 30 Dec 2016 06:26:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1447F1F5B; Fri, 30 Dec 2016 06:26:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU6QIV0030142; Fri, 30 Dec 2016 06:26:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU6QIuS030139; Fri, 30 Dec 2016 06:26:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612300626.uBU6QIuS030139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Dec 2016 06:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310805 - in head/sys: kern sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 06:26:19 -0000 Author: mjg Date: Fri Dec 30 06:26:17 2016 New Revision: 310805 URL: https://svnweb.freebsd.org/changeset/base/310805 Log: Remove cpu_spinwait after seq_consistent. It does not add any benefit as the read routine will do it as necessary. Modified: head/sys/kern/kern_descrip.c head/sys/sys/seq.h head/sys/vm/vm_domain.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Dec 30 03:08:46 2016 (r310804) +++ head/sys/kern/kern_descrip.c Fri Dec 30 06:26:17 2016 (r310805) @@ -2556,10 +2556,8 @@ fget_unlocked(struct filedesc *fdp, int fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde(fde); fp = fde->fde_file; - if (!seq_consistent(fd_seq(fdt, fd), seq)) { - cpu_spinwait(); + if (!seq_consistent(fd_seq(fdt, fd), seq)) continue; - } #else fp = fdt->fdt_ofiles[fd].fde_file; #endif Modified: head/sys/sys/seq.h ============================================================================== --- head/sys/sys/seq.h Fri Dec 30 03:08:46 2016 (r310804) +++ head/sys/sys/seq.h Fri Dec 30 06:26:17 2016 (r310805) @@ -59,7 +59,6 @@ typedef uint32_t seq_t; * lobj = gobj; * if (seq_consistent(&gobj->seq, seq)) * break; - * cpu_spinwait(); * } * foo(lobj); */ Modified: head/sys/vm/vm_domain.c ============================================================================== --- head/sys/vm/vm_domain.c Fri Dec 30 03:08:46 2016 (r310804) +++ head/sys/vm/vm_domain.c Fri Dec 30 06:26:17 2016 (r310805) @@ -140,7 +140,6 @@ vm_domain_policy_localcopy(struct vm_dom *dst = *src; if (seq_consistent(&src->seq, seq)) return; - cpu_spinwait(); } } @@ -168,7 +167,6 @@ vm_domain_policy_copy(struct vm_domain_p seq_write_end(&dst->seq); return; } - cpu_spinwait(); } } @@ -330,7 +328,6 @@ vm_domain_iterator_set_policy(struct vm_ _vm_domain_iterator_set_policy(vi, &vt_lcl); return; } - cpu_spinwait(); } } From owner-svn-src-all@freebsd.org Fri Dec 30 07:52:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0556FC97FD0; Fri, 30 Dec 2016 07:52:13 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9AC1131F; Fri, 30 Dec 2016 07:52:12 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.121] (p4FE30FE4.dip0.t-ipconnect.de [79.227.15.228]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 3959E721E280C; Fri, 30 Dec 2016 08:52:02 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r310773 - in stable/11/sys: netinet netinet6 From: Michael Tuexen In-Reply-To: <20161230061753.GD23243@freefall.freebsd.org> Date: Fri, 30 Dec 2016 08:52:00 +0100 Cc: "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-11@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <4498A998-FBB6-406D-8122-6A5BE7839E6F@freebsd.org> References: <20161229191838.GB23243@freefall.freebsd.org> <201612300117.uBU1HkpP008658@pdx.rh.CN85.dnsmgr.net> <20161230061753.GD23243@freefall.freebsd.org> To: "Piotr P. Stefaniak" X-Mailer: Apple Mail (2.3259) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 07:52:13 -0000 > On 30 Dec 2016, at 07:17, Piotr P. Stefaniak wrote: > > On 2016-12-29 17:17:46, Rodney W. Grimes wrote: >> -- Start of PGP signed section. >>> On 2016-12-29 18:09:39, Piotr P. Stefaniak wrote: >>> >2) the option -ta was added >>> >>> To clarify, what I mean is that the process that generates the sources >>> started using the -ta switch of indent(1), not that the feature was >>> recently implemented. >> >> Can you clarify what process these source files are generated by? If >> these are not the source files, but are being generated by some other >> thing then wouldn't we want the true sources and the generation process >> in the repsitory? I don't know. As far as I know, this kind of processing was happening right from the beginning of the integration of SCTP in FreeBSD. The script which runs is available at: https://github.com/sctplab/sctp-idata/blob/master/src/freebsd_prepare calling https://github.com/sctplab/sctp-idata/blob/master/src/s9indent Please note that this processing is happening for years. I added the -ta recently, since Piotr suggested it... The sources are also available at https://github.com/sctplab/sctp-idata/tree/master/src in the netinet and netinet6 directory. Please note that the upstream sources are ifdef'ed to allow * to be compiled in the FreeBSD kernel * to be compiled as a network kernel extension for Mac OS X * to be compiled as a loadable module for Windows (this worked in the past and the maintainer stopped) * to be compiled in a user land stack (with some glue code) being used in Firefox and Chrome browsers. Except for the -ta change, nothing has changed on my side, just ident was evolving and I wanted to keep the changes related to this isolated in a commit. That way I know that there is no upstream change in the source code. Best regards Michael > > I think that Michael would be the best person to answer that; I'm merely > the one who fixes and breaks indent(1). > >> If this is running indent(1) over source files to clean them up, >> then that is not "generating" sources per say, but instead cleaning >> them up with indent(1). > > That's what I mean. Sorry for the confusion. From owner-svn-src-all@freebsd.org Fri Dec 30 08:37:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15CE6C97828; Fri, 30 Dec 2016 08:37:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4913122B; Fri, 30 Dec 2016 08:37:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU8bVec082815; Fri, 30 Dec 2016 08:37:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU8bV6t082814; Fri, 30 Dec 2016 08:37:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612300837.uBU8bV6t082814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 30 Dec 2016 08:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310806 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 08:37:32 -0000 Author: hselasky Date: Fri Dec 30 08:37:30 2016 New Revision: 310806 URL: https://svnweb.freebsd.org/changeset/base/310806 Log: Add MSIX rewrite table quirk for use with VMs. This patch solves IRQ generation problems using the mlx5en(4) driver with xenserver v6.5.0 in SRIOV and PCI-passthrough modes. Until further the hw.pci.msix_rewrite_table quirk must be set manually in /boot/loader.conf . Reviewed by: jhb @ Sponsored by: Mellanox Technologies MFC after: 2 weeks Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Dec 30 06:26:17 2016 (r310805) +++ head/sys/dev/pci/pci.c Fri Dec 30 08:37:30 2016 (r310806) @@ -356,6 +356,11 @@ static int pci_do_msix = 1; SYSCTL_INT(_hw_pci, OID_AUTO, enable_msix, CTLFLAG_RWTUN, &pci_do_msix, 1, "Enable support for MSI-X interrupts"); +static int pci_msix_rewrite_table = 0; +SYSCTL_INT(_hw_pci, OID_AUTO, msix_rewrite_table, CTLFLAG_RWTUN, + &pci_msix_rewrite_table, 0, + "Rewrite entire MSI-X table when updating MSI-X entries"); + static int pci_honor_msi_blacklist = 1; SYSCTL_INT(_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RDTUN, &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI/MSI-X"); @@ -1482,11 +1487,10 @@ pci_find_extcap_method(device_t dev, dev /* * Support for MSI-X message interrupts. */ -void -pci_enable_msix_method(device_t dev, device_t child, u_int index, - uint64_t address, uint32_t data) +static void +pci_write_msix_entry(device_t dev, u_int index, uint64_t address, uint32_t data) { - struct pci_devinfo *dinfo = device_get_ivars(child); + struct pci_devinfo *dinfo = device_get_ivars(dev); struct pcicfg_msix *msix = &dinfo->cfg.msix; uint32_t offset; @@ -1495,6 +1499,31 @@ pci_enable_msix_method(device_t dev, dev bus_write_4(msix->msix_table_res, offset, address & 0xffffffff); bus_write_4(msix->msix_table_res, offset + 4, address >> 32); bus_write_4(msix->msix_table_res, offset + 8, data); +} + +void +pci_enable_msix_method(device_t dev, device_t child, u_int index, + uint64_t address, uint32_t data) +{ + + if (pci_msix_rewrite_table) { + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_msix *msix = &dinfo->cfg.msix; + + /* + * Some VM hosts require MSIX to be disabled in the + * control register before updating the MSIX table + * entries are allowed. It is not enough to only + * disable MSIX while updating a single entry. MSIX + * must be disabled while updating all entries in the + * table. + */ + pci_write_config(child, + msix->msix_location + PCIR_MSIX_CTRL, + msix->msix_ctrl & ~PCIM_MSIXCTRL_MSIX_ENABLE, 2); + pci_resume_msix(child); + } else + pci_write_msix_entry(child, index, address, data); /* Enable MSI -> HT mapping. */ pci_ht_map_msi(child, address); @@ -1570,7 +1599,8 @@ pci_resume_msix(device_t dev) if (mte->mte_vector == 0 || mte->mte_handlers == 0) continue; mv = &msix->msix_vectors[mte->mte_vector - 1]; - pci_enable_msix(dev, i, mv->mv_address, mv->mv_data); + pci_write_msix_entry(dev, i, mv->mv_address, + mv->mv_data); pci_unmask_msix(dev, i); } } @@ -4401,12 +4431,20 @@ pci_setup_intr(device_t dev, device_t ch mv->mv_address = addr; mv->mv_data = data; } - if (mte->mte_handlers == 0) { + + /* + * The MSIX table entry must be made valid by + * incrementing the mte_handlers before + * calling pci_enable_msix() and + * pci_resume_msix(). Else the MSIX rewrite + * table quirk will not work as expected. + */ + mte->mte_handlers++; + if (mte->mte_handlers == 1) { pci_enable_msix(child, rid - 1, mv->mv_address, mv->mv_data); pci_unmask_msix(child, rid - 1); } - mte->mte_handlers++; } /* From owner-svn-src-all@freebsd.org Fri Dec 30 08:59:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ADABC97D7E; Fri, 30 Dec 2016 08:59:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1F81B4E; Fri, 30 Dec 2016 08:59:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU8xoB0091084; Fri, 30 Dec 2016 08:59:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU8xoBd091077; Fri, 30 Dec 2016 08:59:50 GMT (envelope-from np@FreeBSD.org) Message-Id: <201612300859.uBU8xoBd091077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 30 Dec 2016 08:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310807 - in head: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 08:59:51 -0000 Author: np Date: Fri Dec 30 08:59:49 2016 New Revision: 310807 URL: https://svnweb.freebsd.org/changeset/base/310807 Log: cxgbe(4): Updates to link configuration. - Update struct link_settings and associated shared code. - Add tunables to control FEC and autonegotiation. All ports inherit these values as their initial settings. hw.cxgbe.fec hw.cxgbe.autoneg - Add per-port sysctls to control FEC and autonegotiation. These can be modified at any time. dev...fec dev...autoneg MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_vf.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Fri Dec 30 08:37:30 2016 (r310806) +++ head/share/man/man4/cxgbe.4 Fri Dec 30 08:59:49 2016 (r310807) @@ -289,6 +289,24 @@ The default is 3 (both rx_pause and tx_p This tunable establishes the default PAUSE settings for all ports. Settings can be displayed and controlled on a per-port basis via the dev..X.pause_settings sysctl. +.It Va hw.cxgbe.fec +FEC (Forward Error Correction) settings. +0 diables FEC. +Bit 0 enables RS FEC, bit 1 enables BASE-R RS, bit 3 is reserved. +The default is -1 which lets the driver pick a value. +This tunable establishes the default FEC settings for all ports. +Settings can be displayed and controlled on a per-port basis via the +dev..X.fec sysctl. +.It Va hw.cxgbe.autoneg +Link autonegotiation settings. +This tunable establishes the default autonegotiation settings for all ports. +Settings can be displayed and controlled on a per-port basis via the +dev..X.autoneg sysctl. +0 disables autonegotiation. +1 enables autonegotiation. +The default is -1 which lets the driver pick a value. +dev..X.autoneg is -1 for port and module combinations that do not support +autonegotiation. .It Va hw.cxgbe.buffer_packing Allow the hardware to deliver multiple frames in the same receive buffer opportunistically. Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Dec 30 08:37:30 2016 (r310806) +++ head/sys/dev/cxgbe/adapter.h Fri Dec 30 08:59:49 2016 (r310807) @@ -265,7 +265,6 @@ struct port_info { uint8_t tx_chan; uint8_t rx_chan_map; /* rx MPS channel bitmap */ - int linkdnrc; struct link_config link_cfg; struct timeval last_refreshed; @@ -1098,7 +1097,7 @@ int t4_os_find_pci_capability(struct ada int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); -void t4_os_link_changed(struct adapter *, int, int, int); +void t4_os_link_changed(struct adapter *, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); void t4_init_devnames(struct adapter *); void t4_add_adapter(struct adapter *); Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Dec 30 08:37:30 2016 (r310806) +++ head/sys/dev/cxgbe/common/common.h Fri Dec 30 08:59:49 2016 (r310807) @@ -62,6 +62,12 @@ enum { PAUSE_AUTONEG = 1 << 2 }; +enum { + FEC_RS = 1 << 0, + FEC_BASER_RS = 1 << 1, + FEC_RESERVED = 1 << 2, +}; + struct port_stats { u64 tx_octets; /* total # of octets in good frames */ u64 tx_frames; /* all good frames */ @@ -392,12 +398,16 @@ struct trace_params { struct link_config { unsigned short supported; /* link capabilities */ unsigned short advertising; /* advertised capabilities */ - unsigned int requested_speed; /* speed user has requested */ - unsigned int speed; /* actual link speed */ + unsigned short lp_advertising; /* peer advertised capabilities */ + unsigned int requested_speed; /* speed user has requested */ + unsigned int speed; /* actual link speed */ unsigned char requested_fc; /* flow control user has requested */ unsigned char fc; /* actual link flow control */ + unsigned char requested_fec; /* FEC user has requested */ + unsigned char fec; /* actual FEC */ unsigned char autoneg; /* autonegotiating? */ unsigned char link_ok; /* link up? */ + unsigned char link_down_rc; /* link down reason */ }; #include "adapter.h" Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Dec 30 08:37:30 2016 (r310806) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Dec 30 08:59:49 2016 (r310807) @@ -3683,9 +3683,7 @@ void t4_ulprx_read_la(struct adapter *ad } } -#define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ - FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_25G | \ - FW_PORT_CAP_SPEED_40G | FW_PORT_CAP_SPEED_100G | \ +#define ADVERT_MASK (V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED) | \ FW_PORT_CAP_ANEG) /** @@ -3705,14 +3703,23 @@ int t4_link_l1cfg(struct adapter *adap, struct link_config *lc) { struct fw_port_cmd c; - unsigned int fc = 0, mdi = V_FW_PORT_CAP_MDI(FW_PORT_CAP_MDI_AUTO); + unsigned int mdi = V_FW_PORT_CAP_MDI(FW_PORT_CAP_MDI_AUTO); + unsigned int fc, fec; - lc->link_ok = 0; + fc = 0; if (lc->requested_fc & PAUSE_RX) fc |= FW_PORT_CAP_FC_RX; if (lc->requested_fc & PAUSE_TX) fc |= FW_PORT_CAP_FC_TX; + fec = 0; + if (lc->requested_fec & FEC_RS) + fec |= FW_PORT_CAP_FEC_RS; + if (lc->requested_fec & FEC_BASER_RS) + fec |= FW_PORT_CAP_FEC_BASER_RS; + if (lc->requested_fec & FEC_RESERVED) + fec |= FW_PORT_CAP_FEC_RESERVED; + memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC | @@ -3723,13 +3730,16 @@ int t4_link_l1cfg(struct adapter *adap, if (!(lc->supported & FW_PORT_CAP_ANEG)) { c.u.l1cfg.rcap = cpu_to_be32((lc->supported & ADVERT_MASK) | - fc); - lc->fc = lc->requested_fc & (PAUSE_RX | PAUSE_TX); + fc | fec); + lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; + lc->fec = lc->requested_fec; } else if (lc->autoneg == AUTONEG_DISABLE) { - c.u.l1cfg.rcap = cpu_to_be32(lc->requested_speed | fc | mdi); - lc->fc = lc->requested_fc & (PAUSE_RX | PAUSE_TX); + c.u.l1cfg.rcap = cpu_to_be32(lc->requested_speed | + fc | fec | mdi); + lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; + lc->fec = lc->requested_fec; } else - c.u.l1cfg.rcap = cpu_to_be32(lc->advertising | fc | mdi); + c.u.l1cfg.rcap = cpu_to_be32(lc->advertising | fc | fec | mdi); return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); } @@ -7517,18 +7527,14 @@ int t4_handle_fw_rpl(struct adapter *ada } if (link_ok != lc->link_ok || speed != lc->speed || fc != lc->fc) { /* something changed */ - int reason; - if (!link_ok && lc->link_ok) - reason = G_FW_PORT_CMD_LINKDNRC(stat); - else - reason = -1; - + lc->link_down_rc = G_FW_PORT_CMD_LINKDNRC(stat); lc->link_ok = link_ok; lc->speed = speed; lc->fc = fc; lc->supported = be16_to_cpu(p->u.info.pcap); - t4_os_link_changed(adap, i, link_ok, reason); + lc->lp_advertising = be16_to_cpu(p->u.info.lpacap); + t4_os_link_changed(adap, i, link_ok); } } else { CH_WARN_RATELIMIT(adap, "Unknown firmware reply %d\n", opcode); @@ -7562,17 +7568,34 @@ static void get_pci_mode(struct adapter /** * init_link_config - initialize a link's SW state * @lc: structure holding the link state - * @caps: link capabilities + * @pcaps: supported link capabilities + * @acaps: advertised link capabilities * * Initializes the SW state maintained for each link, including the link's * capabilities and default speed/flow-control/autonegotiation settings. */ -static void init_link_config(struct link_config *lc, unsigned int caps) +static void init_link_config(struct link_config *lc, unsigned int pcaps, + unsigned int acaps) { - lc->supported = caps; + unsigned int fec; + + lc->supported = pcaps; + lc->lp_advertising = 0; lc->requested_speed = 0; lc->speed = 0; lc->requested_fc = lc->fc = PAUSE_RX | PAUSE_TX; + lc->link_ok = 0; + lc->link_down_rc = 255; + + fec = 0; + if (acaps & FW_PORT_CAP_FEC_RS) + fec |= FEC_RS; + if (acaps & FW_PORT_CAP_FEC_BASER_RS) + fec |= FEC_BASER_RS; + if (acaps & FW_PORT_CAP_FEC_RESERVED) + fec |= FEC_RESERVED; + lc->requested_fec = lc->fec = fec; + if (lc->supported & FW_PORT_CAP_ANEG) { lc->advertising = lc->supported & ADVERT_MASK; lc->autoneg = AUTONEG_ENABLE; @@ -8126,7 +8149,8 @@ int t4_port_init(struct adapter *adap, i p->port_type = G_FW_PORT_CMD_PTYPE(ret); p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); - init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); + init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap), + be16_to_cpu(c.u.info.acap)); } ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &rss_size); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Dec 30 08:37:30 2016 (r310806) +++ head/sys/dev/cxgbe/t4_main.c Fri Dec 30 08:59:49 2016 (r310807) @@ -359,6 +359,24 @@ static int t4_pause_settings = PAUSE_TX TUNABLE_INT("hw.cxgbe.pause_settings", &t4_pause_settings); /* + * Forward Error Correction settings (bit 0, 1, 2 = FEC_RS, FEC_BASER_RS, + * FEC_RESERVED respectively). + * -1 to run with the firmware default. + * 0 to disable FEC. + */ +static int t4_fec = -1; +TUNABLE_INT("hw.cxgbe.fec", &t4_fec); + +/* + * Link autonegotiation. + * -1 to run with the firmware default. + * 0 to disable. + * 1 to enable. + */ +static int t4_autoneg = -1; +TUNABLE_INT("hw.cxgbe.autoneg", &t4_autoneg); + +/* * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed, * encouraged respectively). */ @@ -493,6 +511,8 @@ static int sysctl_holdoff_pktc_idx(SYSCT static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); static int sysctl_pause_settings(SYSCTL_HANDLER_ARGS); +static int sysctl_fec(SYSCTL_HANDLER_ARGS); +static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); #ifdef SBUF_DRAIN @@ -922,6 +942,7 @@ t4_attach(device_t dev) n10g = n1g = 0; for_each_port(sc, i) { struct port_info *pi; + struct link_config *lc; pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK); sc->port[i] = pi; @@ -950,12 +971,19 @@ t4_attach(device_t dev) goto done; } - pi->link_cfg.requested_fc &= ~(PAUSE_TX | PAUSE_RX); - pi->link_cfg.requested_fc |= t4_pause_settings; - pi->link_cfg.fc &= ~(PAUSE_TX | PAUSE_RX); - pi->link_cfg.fc |= t4_pause_settings; + lc = &pi->link_cfg; + lc->requested_fc &= ~(PAUSE_TX | PAUSE_RX); + lc->requested_fc |= t4_pause_settings; + if (t4_fec != -1) { + lc->requested_fec = t4_fec & + G_FW_PORT_CAP_FEC(lc->supported); + } + if (lc->supported & FW_PORT_CAP_ANEG && t4_autoneg != -1) { + lc->autoneg = t4_autoneg ? AUTONEG_ENABLE : + AUTONEG_DISABLE; + } - rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, &pi->link_cfg); + rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); if (rc != 0) { device_printf(dev, "port %d l1cfg failed: %d\n", i, rc); free(pi->vi, M_CXGBE); @@ -978,8 +1006,6 @@ t4_attach(device_t dev) n1g++; } - pi->linkdnrc = -1; - pi->dev = device_add_child(dev, sc->names->ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, @@ -4060,8 +4086,8 @@ cxgbe_uninit_synchronized(struct vi_info pi->link_cfg.link_ok = 0; pi->link_cfg.speed = 0; - pi->linkdnrc = -1; - t4_os_link_changed(sc, pi->port_id, 0, -1); + pi->link_cfg.link_down_rc = 255; + t4_os_link_changed(sc, pi->port_id, 0); return (0); } @@ -5274,8 +5300,14 @@ cxgbe_sysctls(struct port_info *pi) } SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_settings", - CTLTYPE_STRING | CTLFLAG_RW, pi, PAUSE_TX, sysctl_pause_settings, - "A", "PAUSE settings (bit 0 = rx_pause, bit 1 = tx_pause)"); + CTLTYPE_STRING | CTLFLAG_RW, pi, 0, sysctl_pause_settings, "A", + "PAUSE settings (bit 0 = rx_pause, bit 1 = tx_pause)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fec", + CTLTYPE_STRING | CTLFLAG_RW, pi, 0, sysctl_fec, "A", + "Forward Error Correction (bit 0 = RS, bit 1 = BASER_RS)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "autoneg", + CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_autoneg, "I", + "autonegotiation (-1 = not supported)"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "max_speed", CTLFLAG_RD, NULL, port_top_speed(pi), "max speed (in Gbps)"); @@ -5735,12 +5767,9 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARG if (rc) return (rc); if ((lc->requested_fc & (PAUSE_TX | PAUSE_RX)) != n) { - int link_ok = lc->link_ok; - lc->requested_fc &= ~(PAUSE_TX | PAUSE_RX); lc->requested_fc |= n; rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); - lc->link_ok = link_ok; /* restore */ } end_synchronized_op(sc, 0); } @@ -5749,6 +5778,97 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARG } static int +sysctl_fec(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + struct adapter *sc = pi->adapter; + struct link_config *lc = &pi->link_cfg; + int rc; + + if (req->newptr == NULL) { + struct sbuf *sb; + static char *bits = "\20\1RS\2BASER_RS\3RESERVED"; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return(rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, "%b", lc->fec & M_FW_PORT_CAP_FEC, bits); + rc = sbuf_finish(sb); + sbuf_delete(sb); + } else { + char s[2]; + int n; + + s[0] = '0' + (lc->requested_fec & M_FW_PORT_CAP_FEC); + s[1] = 0; + + rc = sysctl_handle_string(oidp, s, sizeof(s), req); + if (rc != 0) + return(rc); + + if (s[1] != 0) + return (EINVAL); + if (s[0] < '0' || s[0] > '9') + return (EINVAL); /* not a number */ + n = s[0] - '0'; + if (n & ~M_FW_PORT_CAP_FEC) + return (EINVAL); /* some other bit is set too */ + + rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, + "t4fec"); + if (rc) + return (rc); + if ((lc->requested_fec & M_FW_PORT_CAP_FEC) != n) { + lc->requested_fec = n & + G_FW_PORT_CAP_FEC(lc->supported); + rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); + } + end_synchronized_op(sc, 0); + } + + return (rc); +} + +static int +sysctl_autoneg(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + struct adapter *sc = pi->adapter; + struct link_config *lc = &pi->link_cfg; + int rc, val, old; + + if (lc->supported & FW_PORT_CAP_ANEG) + val = lc->autoneg == AUTONEG_ENABLE ? 1 : 0; + else + val = -1; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + if ((lc->supported & FW_PORT_CAP_ANEG) == 0) + return (ENOTSUP); + + val = val ? AUTONEG_ENABLE : AUTONEG_DISABLE; + if (lc->autoneg == val) + return (0); /* no change */ + + rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, + "t4aneg"); + if (rc) + return (rc); + old = lc->autoneg; + lc->autoneg = val; + rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); + if (rc != 0) + lc->autoneg = old; + return (rc); +} + +static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; @@ -6493,6 +6613,7 @@ sysctl_linkdnrc(SYSCTL_HANDLER_ARGS) { int rc = 0; struct port_info *pi = arg1; + struct link_config *lc = &pi->link_cfg; struct sbuf *sb; rc = sysctl_wire_old_buffer(req, 0); @@ -6502,10 +6623,10 @@ sysctl_linkdnrc(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - if (pi->linkdnrc < 0) + if (lc->link_ok || lc->link_down_rc == 255) sbuf_printf(sb, "n/a"); else - sbuf_printf(sb, "%s", t4_link_down_rc_str(pi->linkdnrc)); + sbuf_printf(sb, "%s", t4_link_down_rc_str(lc->link_down_rc)); rc = sbuf_finish(sb); sbuf_delete(sb); @@ -8973,19 +9094,13 @@ t4_os_portmod_changed(const struct adapt } void -t4_os_link_changed(struct adapter *sc, int idx, int link_stat, int reason) +t4_os_link_changed(struct adapter *sc, int idx, int link_stat) { struct port_info *pi = sc->port[idx]; struct vi_info *vi; struct ifnet *ifp; int v; - if (link_stat) - pi->linkdnrc = -1; - else { - if (reason >= 0) - pi->linkdnrc = reason; - } for_each_vi(pi, v, vi) { ifp = vi->ifp; if (ifp == NULL) Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Fri Dec 30 08:37:30 2016 (r310806) +++ head/sys/dev/cxgbe/t4_vf.c Fri Dec 30 08:59:49 2016 (r310807) @@ -668,8 +668,6 @@ t4vf_attach(device_t dev) n1g++; } - pi->linkdnrc = -1; - pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, From owner-svn-src-all@freebsd.org Fri Dec 30 09:38:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EECE7C91B95; Fri, 30 Dec 2016 09:38:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE05D1DF0; Fri, 30 Dec 2016 09:38:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBU9cjCQ007197; Fri, 30 Dec 2016 09:38:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBU9cjJL007196; Fri, 30 Dec 2016 09:38:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612300938.uBU9cjJL007196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 30 Dec 2016 09:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310808 - stable/11/usr.bin/dtc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 09:38:47 -0000 Author: dim Date: Fri Dec 30 09:38:45 2016 New Revision: 310808 URL: https://svnweb.freebsd.org/changeset/base/310808 Log: MFC r309191 (by rakuco): fdt: Expect strchr() to return a const char* In C, strchr(3) returns a char*, whereas C++ defines two overloads: * const char *strchr(const char*, int) * char *strchr(char*, int) Building fdt.cc (with the WITHOUT_GPL_DTC knob set) with libc++ 3.9.0 (imported in r309124) was failing because libc++ r260377 added the first overload to string.h, leading to failures such as: fdt.cc:1638:8: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *' Just define val as a const char* to fix it. Upstreamed in https://github.com/davidchisnall/dtc/pull/14 Modified: stable/11/usr.bin/dtc/fdt.cc Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/dtc/fdt.cc ============================================================================== --- stable/11/usr.bin/dtc/fdt.cc Fri Dec 30 08:59:49 2016 (r310807) +++ stable/11/usr.bin/dtc/fdt.cc Fri Dec 30 09:38:45 2016 (r310808) @@ -1590,7 +1590,7 @@ device_tree::parse_dts(const char *fn, F bool device_tree::parse_define(const char *def) { - char *val = strchr(def, '='); + const char *val = strchr(def, '='); if (!val) { if (strlen(def) != 0) From owner-svn-src-all@freebsd.org Fri Dec 30 11:02:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6965C9638B; Fri, 30 Dec 2016 11:02:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 863471333; Fri, 30 Dec 2016 11:02:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUB2GHF042263; Fri, 30 Dec 2016 11:02:16 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUB2GSF042262; Fri, 30 Dec 2016 11:02:16 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201612301102.uBUB2GSF042262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 30 Dec 2016 11:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310809 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 11:02:17 -0000 Author: gavin Date: Fri Dec 30 11:02:16 2016 New Revision: 310809 URL: https://svnweb.freebsd.org/changeset/base/310809 Log: Fix bit value for a debug flag definition. Pointy hat to: gavin Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Dec 30 09:38:45 2016 (r310808) +++ head/sys/dev/usb/wlan/if_run.c Fri Dec 30 11:02:16 2016 (r310809) @@ -105,7 +105,7 @@ enum { RUN_DEBUG_RSSI = 0x00004000, /* dump RSSI lookups */ RUN_DEBUG_RESET = 0x00008000, /* initialization progress */ RUN_DEBUG_CALIB = 0x00010000, /* calibration progress */ - RUN_DEBUG_CMD = 0x00010000, /* command queue */ + RUN_DEBUG_CMD = 0x00020000, /* command queue */ RUN_DEBUG_ANY = 0xffffffff }; From owner-svn-src-all@freebsd.org Fri Dec 30 11:49:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60C32C96D23; Fri, 30 Dec 2016 11:49:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 042C61505; Fri, 30 Dec 2016 11:49:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUBnc2t059704; Fri, 30 Dec 2016 11:49:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUBncWm059703; Fri, 30 Dec 2016 11:49:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301149.uBUBncWm059703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 11:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310810 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 11:49:39 -0000 Author: arybchik Date: Fri Dec 30 11:49:37 2016 New Revision: 310810 URL: https://svnweb.freebsd.org/changeset/base/310810 Log: sfxge(4): cleanup: check deferred packet list tunables once Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8973 Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 11:02:16 2016 (r310809) +++ head/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 11:49:37 2016 (r310810) @@ -1785,26 +1785,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u (rc = tso_init(txq)) != 0) goto fail3; - if (sfxge_tx_dpl_get_max <= 0) { - log(LOG_ERR, "%s=%d must be greater than 0", - SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max); - rc = EINVAL; - goto fail_tx_dpl_get_max; - } - if (sfxge_tx_dpl_get_non_tcp_max <= 0) { - log(LOG_ERR, "%s=%d must be greater than 0", - SFXGE_PARAM_TX_DPL_GET_NON_TCP_MAX, - sfxge_tx_dpl_get_non_tcp_max); - rc = EINVAL; - goto fail_tx_dpl_get_max; - } - if (sfxge_tx_dpl_put_max < 0) { - log(LOG_ERR, "%s=%d must be greater or equal to 0", - SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max); - rc = EINVAL; - goto fail_tx_dpl_put_max; - } - /* Initialize the deferred packet list. */ stdp = &txq->dpl; stdp->std_put_max = sfxge_tx_dpl_put_max; @@ -1849,8 +1829,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u fail_txq_stat_init: fail_dpl_node: -fail_tx_dpl_put_max: -fail_tx_dpl_get_max: fail3: fail_txq_node: free(txq->pend_desc, M_SFXGE); @@ -1951,6 +1929,26 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); + if (sfxge_tx_dpl_get_max <= 0) { + log(LOG_ERR, "%s=%d must be greater than 0", + SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max); + rc = EINVAL; + goto fail_tx_dpl_get_max; + } + if (sfxge_tx_dpl_get_non_tcp_max <= 0) { + log(LOG_ERR, "%s=%d must be greater than 0", + SFXGE_PARAM_TX_DPL_GET_NON_TCP_MAX, + sfxge_tx_dpl_get_non_tcp_max); + rc = EINVAL; + goto fail_tx_dpl_get_non_tcp_max; + } + if (sfxge_tx_dpl_put_max < 0) { + log(LOG_ERR, "%s=%d must be greater or equal to 0", + SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max); + rc = EINVAL; + goto fail_tx_dpl_put_max; + } + sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; sc->tso_fw_assisted = sfxge_tso_fw_assisted; @@ -2003,5 +2001,8 @@ fail2: fail: fail_txq_node: sc->txq_count = 0; +fail_tx_dpl_put_max: +fail_tx_dpl_get_non_tcp_max: +fail_tx_dpl_get_max: return (rc); } From owner-svn-src-all@freebsd.org Fri Dec 30 11:52:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAD67C96FEE; Fri, 30 Dec 2016 11:52:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD53B1A39; Fri, 30 Dec 2016 11:52:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUBqt1P063546; Fri, 30 Dec 2016 11:52:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUBqtS2063544; Fri, 30 Dec 2016 11:52:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301152.uBUBqtS2063544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 11:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310811 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 11:52:57 -0000 Author: arybchik Date: Fri Dec 30 11:52:55 2016 New Revision: 310811 URL: https://svnweb.freebsd.org/changeset/base/310811 Log: sfxge(4): cleanup: remove now-unused function flags Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8966 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Dec 30 11:49:37 2016 (r310810) +++ head/sys/dev/sfxge/common/efx.h Fri Dec 30 11:52:55 2016 (r310811) @@ -128,11 +128,6 @@ typedef struct efx_rxq_s efx_rxq_t; typedef struct efx_nic_s efx_nic_t; -#define EFX_NIC_FUNC_PRIMARY 0x00000001 -#define EFX_NIC_FUNC_LINKCTRL 0x00000002 -#define EFX_NIC_FUNC_TRUSTED 0x00000004 - - extern __checkReturn efx_rc_t efx_nic_create( __in efx_family_t family, @@ -1100,7 +1095,6 @@ typedef struct efx_nic_cfg_s { unsigned int enc_features; uint8_t enc_mac_addr[6]; uint8_t enc_port; /* PHY port number */ - uint32_t enc_func_flags; uint32_t enc_intr_vec_base; uint32_t enc_intr_limit; uint32_t enc_evq_limit; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 11:49:37 2016 (r310810) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 11:52:55 2016 (r310811) @@ -1184,11 +1184,9 @@ efx_mcdi_drv_attach( __in efx_nic_t *enp, __in boolean_t attach) { - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_DRV_ATTACH_IN_LEN, MC_CMD_DRV_ATTACH_EXT_OUT_LEN)]; - uint32_t flags; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); @@ -1219,36 +1217,8 @@ efx_mcdi_drv_attach( goto fail2; } - if (attach == B_FALSE) { - flags = 0; - } else if (enp->en_family == EFX_FAMILY_SIENA) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - - /* Create synthetic privileges for Siena functions */ - flags = EFX_NIC_FUNC_LINKCTRL | EFX_NIC_FUNC_TRUSTED; - if (emip->emi_port == 1) - flags |= EFX_NIC_FUNC_PRIMARY; - } else { - EFX_STATIC_ASSERT(EFX_NIC_FUNC_PRIMARY == - (1u << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY)); - EFX_STATIC_ASSERT(EFX_NIC_FUNC_LINKCTRL == - (1u << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL)); - EFX_STATIC_ASSERT(EFX_NIC_FUNC_TRUSTED == - (1u << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)); - - /* Save function privilege flags (EF10 and later) */ - if (req.emr_out_length_used < MC_CMD_DRV_ATTACH_EXT_OUT_LEN) { - rc = EMSGSIZE; - goto fail3; - } - flags = MCDI_OUT_DWORD(req, DRV_ATTACH_EXT_OUT_FUNC_FLAGS); - } - encp->enc_func_flags = flags; - return (0); -fail3: - EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-all@freebsd.org Fri Dec 30 11:54:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D58C960F0; Fri, 30 Dec 2016 11:54:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9A311C23; Fri, 30 Dec 2016 11:54:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUBsSnX063644; Fri, 30 Dec 2016 11:54:28 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUBsR99063640; Fri, 30 Dec 2016 11:54:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301154.uBUBsR99063640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 11:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310812 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 11:54:29 -0000 Author: arybchik Date: Fri Dec 30 11:54:27 2016 New Revision: 310812 URL: https://svnweb.freebsd.org/changeset/base/310812 Log: sfxge(4): support non-interrupting event queues creation Poll-mode driver does not use interrupts and number of used event queues should not be limitted by the number of interrupts allocated for the NIC. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8967 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Dec 30 11:52:55 2016 (r310811) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Dec 30 11:54:27 2016 (r310812) @@ -49,6 +49,12 @@ __FBSDID("$FreeBSD$"); #define EFX_EV_QSTAT_INCR(_eep, _stat) #endif +/* + * Non-interrupting event queue requires interrrupting event queue to + * refer to for wake-up events even if wake ups are never used. + * It could be even non-allocated event queue. + */ +#define EFX_EF10_ALWAYS_INTERRUPTING_EVQ_INDEX (0) static __checkReturn boolean_t ef10_ev_rx( @@ -151,6 +157,7 @@ efx_mcdi_init_evq( uint64_t addr; int npages; int i; + boolean_t interrupting; int ev_cut_through; efx_rc_t rc; @@ -171,6 +178,9 @@ efx_mcdi_init_evq( MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_INSTANCE, instance); MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_IRQ_NUM, irq); + interrupting = ((flags & EFX_EVQ_FLAGS_NOTIFY_MASK) == + EFX_EVQ_FLAGS_NOTIFY_INTERRUPT); + /* * On Huntington RX and TX event batching can only be requested together * (even if the datapath firmware doesn't actually support RX @@ -194,7 +204,7 @@ efx_mcdi_init_evq( goto fail2; } MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS, - INIT_EVQ_IN_FLAG_INTERRUPTING, 1, + INIT_EVQ_IN_FLAG_INTERRUPTING, interrupting, INIT_EVQ_IN_FLAG_RPTR_DOS, 0, INIT_EVQ_IN_FLAG_INT_ARMD, 0, INIT_EVQ_IN_FLAG_CUT_THRU, ev_cut_through, @@ -280,6 +290,7 @@ efx_mcdi_init_evq_v2( uint8_t payload[ MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), MC_CMD_INIT_EVQ_V2_OUT_LEN)]; + boolean_t interrupting; unsigned int evq_type; efx_qword_t *dma_addr; uint64_t addr; @@ -304,6 +315,9 @@ efx_mcdi_init_evq_v2( MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance); MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq); + interrupting = ((flags & EFX_EVQ_FLAGS_NOTIFY_MASK) == + EFX_EVQ_FLAGS_NOTIFY_INTERRUPT); + switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) { case EFX_EVQ_FLAGS_TYPE_AUTO: evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO; @@ -319,7 +333,7 @@ efx_mcdi_init_evq_v2( goto fail2; } MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS, - INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1, + INIT_EVQ_V2_IN_FLAG_INTERRUPTING, interrupting, INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0, INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0, INIT_EVQ_V2_IN_FLAG_TYPE, evq_type); @@ -484,7 +498,17 @@ ef10_ev_qcreate( eep->ee_mcdi = ef10_ev_mcdi; /* Set up the event queue */ - irq = index; /* INIT_EVQ expects function-relative vector number */ + /* INIT_EVQ expects function-relative vector number */ + if ((flags & EFX_EVQ_FLAGS_NOTIFY_MASK) == + EFX_EVQ_FLAGS_NOTIFY_INTERRUPT) { + irq = index; + } else if (index == EFX_EF10_ALWAYS_INTERRUPTING_EVQ_INDEX) { + irq = index; + flags = (flags & ~EFX_EVQ_FLAGS_NOTIFY_MASK) | + EFX_EVQ_FLAGS_NOTIFY_INTERRUPT; + } else { + irq = EFX_EF10_ALWAYS_INTERRUPTING_EVQ_INDEX; + } /* * Interrupts may be raised for events immediately after the queue is Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Dec 30 11:52:55 2016 (r310811) +++ head/sys/dev/sfxge/common/efx.h Fri Dec 30 11:54:27 2016 (r310812) @@ -1624,6 +1624,10 @@ efx_ev_fini( #define EFX_EVQ_FLAGS_TYPE_THROUGHPUT (0x1) #define EFX_EVQ_FLAGS_TYPE_LOW_LATENCY (0x2) +#define EFX_EVQ_FLAGS_NOTIFY_MASK (0xC) +#define EFX_EVQ_FLAGS_NOTIFY_INTERRUPT (0x0) /* Interrupting (default) */ +#define EFX_EVQ_FLAGS_NOTIFY_DISABLED (0x4) /* Non-interrupting */ + extern __checkReturn efx_rc_t efx_ev_qcreate( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Fri Dec 30 11:52:55 2016 (r310811) +++ head/sys/dev/sfxge/common/efx_ev.c Fri Dec 30 11:54:27 2016 (r310812) @@ -235,17 +235,32 @@ efx_ev_qcreate( EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit); + switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) { + case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT: + break; + case EFX_EVQ_FLAGS_NOTIFY_DISABLED: + if (us != 0) { + rc = EINVAL; + goto fail1; + } + break; + default: + rc = EINVAL; + goto fail2; + } + /* Allocate an EVQ object */ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_evq_t), eep); if (eep == NULL) { rc = ENOMEM; - goto fail1; + goto fail3; } eep->ee_magic = EFX_EVQ_MAGIC; eep->ee_enp = enp; eep->ee_index = index; eep->ee_mask = n - 1; + eep->ee_flags = flags; eep->ee_esmp = esmp; /* @@ -261,16 +276,20 @@ efx_ev_qcreate( if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, flags, eep)) != 0) - goto fail2; + goto fail4; return (0); -fail2: - EFSYS_PROBE(fail2); +fail4: + EFSYS_PROBE(fail4); *eepp = NULL; enp->en_ev_qcount--; EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -553,11 +572,19 @@ efx_ev_qmoderate( EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); - if ((rc = eevop->eevo_qmoderate(eep, us)) != 0) + if ((eep->ee_flags & EFX_EVQ_FLAGS_NOTIFY_MASK) == + EFX_EVQ_FLAGS_NOTIFY_DISABLED) { + rc = EINVAL; goto fail1; + } + + if ((rc = eevop->eevo_qmoderate(eep, us)) != 0) + goto fail2; return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -1267,6 +1294,7 @@ siena_ev_qcreate( uint32_t size; efx_oword_t oword; efx_rc_t rc; + boolean_t notify_mode; _NOTE(ARGUNUSED(esmp)) @@ -1307,8 +1335,13 @@ siena_ev_qcreate( eep->ee_mcdi = siena_ev_mcdi; #endif /* EFSYS_OPT_MCDI */ + notify_mode = ((flags & EFX_EVQ_FLAGS_NOTIFY_MASK) != + EFX_EVQ_FLAGS_NOTIFY_INTERRUPT); + /* Set up the new event queue */ - EFX_POPULATE_OWORD_1(oword, FRF_CZ_TIMER_Q_EN, 1); + EFX_POPULATE_OWORD_3(oword, FRF_CZ_TIMER_Q_EN, 1, + FRF_CZ_HOST_NOTIFY_MODE, notify_mode, + FRF_CZ_TIMER_MODE, FFE_CZ_TIMER_MODE_DIS); EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL, index, &oword, B_TRUE); EFX_POPULATE_OWORD_3(oword, FRF_AZ_EVQ_EN, 1, FRF_AZ_EVQ_SIZE, size, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 11:52:55 2016 (r310811) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 11:54:27 2016 (r310812) @@ -711,6 +711,8 @@ struct efx_evq_s { #endif /* EFSYS_OPT_MCDI */ efx_evq_rxq_state_t ee_rxq_state[EFX_EV_RX_NLABELS]; + + uint32_t ee_flags; }; #define EFX_EVQ_MAGIC 0x08081997 From owner-svn-src-all@freebsd.org Fri Dec 30 11:56:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E5DAC96167; Fri, 30 Dec 2016 11:56:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78EA21DC3; Fri, 30 Dec 2016 11:56:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUBuDpI063787; Fri, 30 Dec 2016 11:56:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUBuDZi063780; Fri, 30 Dec 2016 11:56:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301156.uBUBuDZi063780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 11:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310813 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 11:56:14 -0000 Author: arybchik Date: Fri Dec 30 11:56:12 2016 New Revision: 310813 URL: https://svnweb.freebsd.org/changeset/base/310813 Log: sfxge(4): add per-command timeout reporting to the common code In newer firmware that supports multithreaded MCDI processing, longer running commands may be run ina background thread. Add support for drivers to query the appropriate timeout for each MCDI request. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8968 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 11:54:27 2016 (r310812) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 11:56:12 2016 (r310813) @@ -330,6 +330,12 @@ ef10_mcdi_feature_supported( __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp); +extern void +ef10_mcdi_get_timeout( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *timeoutp); + #endif /* EFSYS_OPT_MCDI */ /* NVRAM */ Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Fri Dec 30 11:54:27 2016 (r310812) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Fri Dec 30 11:56:12 2016 (r310813) @@ -108,6 +108,46 @@ ef10_mcdi_fini( emip->emi_new_epoch = B_FALSE; } +/* + * In older firmware all commands are processed in a single thread, so a long + * running command for one PCIe function can block processing for another + * function (see bug 61269). + * + * In newer firmware that supports multithreaded MCDI processing, we can extend + * the timeout for long-running requests which we know firmware may choose to + * process in a background thread. + */ +#define EF10_MCDI_CMD_TIMEOUT_US (10 * 1000 * 1000) +#define EF10_MCDI_CMD_LONG_TIMEOUT_US (60 * 1000 * 1000) + + void +ef10_mcdi_get_timeout( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *timeoutp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + + switch (emrp->emr_cmd) { + case MC_CMD_POLL_BIST: + case MC_CMD_NVRAM_ERASE: + case MC_CMD_LICENSING_V3: + case MC_CMD_NVRAM_UPDATE_FINISH: + if (encp->enc_fw_verified_nvram_update_required != B_FALSE) { + /* + * Potentially longer running commands, which firmware + * may choose to process in a background thread. + */ + *timeoutp = EF10_MCDI_CMD_LONG_TIMEOUT_US; + break; + } + /* FALLTHRU */ + default: + *timeoutp = EF10_MCDI_CMD_TIMEOUT_US; + break; + } +} + void ef10_mcdi_send_request( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Dec 30 11:54:27 2016 (r310812) +++ head/sys/dev/sfxge/common/efx.h Fri Dec 30 11:56:12 2016 (r310813) @@ -243,6 +243,12 @@ efx_mcdi_new_epoch( __in efx_nic_t *enp); extern void +efx_mcdi_get_timeout( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *usec_timeoutp); + +extern void efx_mcdi_request_start( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 11:54:27 2016 (r310812) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 11:56:12 2016 (r310813) @@ -427,7 +427,10 @@ typedef struct efx_mcdi_ops_s { boolean_t (*emco_poll_response)(efx_nic_t *); void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); void (*emco_fini)(efx_nic_t *); - efx_rc_t (*emco_feature_supported)(efx_nic_t *, efx_mcdi_feature_id_t, boolean_t *); + efx_rc_t (*emco_feature_supported)(efx_nic_t *, + efx_mcdi_feature_id_t, boolean_t *); + void (*emco_get_timeout)(efx_nic_t *, efx_mcdi_req_t *, + uint32_t *); } efx_mcdi_ops_t; typedef struct efx_mcdi_s { Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 11:54:27 2016 (r310812) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 11:56:12 2016 (r310813) @@ -67,6 +67,7 @@ static const efx_mcdi_ops_t __efx_mcdi_s siena_mcdi_read_response, /* emco_read_response */ siena_mcdi_fini, /* emco_fini */ siena_mcdi_feature_supported, /* emco_feature_supported */ + siena_mcdi_get_timeout, /* emco_get_timeout */ }; #endif /* EFSYS_OPT_SIENA */ @@ -81,6 +82,7 @@ static const efx_mcdi_ops_t __efx_mcdi_e ef10_mcdi_read_response, /* emco_read_response */ ef10_mcdi_fini, /* emco_fini */ ef10_mcdi_feature_supported, /* emco_feature_supported */ + ef10_mcdi_get_timeout, /* emco_get_timeout */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -605,6 +607,17 @@ efx_mcdi_request_abort( return (aborted); } + void +efx_mcdi_get_timeout( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *timeoutp) +{ + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + + emcop->emco_get_timeout(enp, emrp, timeoutp); +} + __checkReturn efx_rc_t efx_mcdi_request_errcode( __in unsigned int err) Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Fri Dec 30 11:54:27 2016 (r310812) +++ head/sys/dev/sfxge/common/siena_impl.h Fri Dec 30 11:56:12 2016 (r310813) @@ -127,6 +127,12 @@ siena_mcdi_feature_supported( __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp); +extern void +siena_mcdi_get_timeout( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *timeoutp); + #endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Fri Dec 30 11:54:27 2016 (r310812) +++ head/sys/dev/sfxge/common/siena_mcdi.c Fri Dec 30 11:56:12 2016 (r310813) @@ -247,4 +247,19 @@ fail1: return (rc); } +/* Default timeout for MCDI command processing. */ +#define SIENA_MCDI_CMD_TIMEOUT_US (10 * 1000 * 1000) + + void +siena_mcdi_get_timeout( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *timeoutp) +{ + _NOTE(ARGUNUSED(enp, emrp)) + + *timeoutp = SIENA_MCDI_CMD_TIMEOUT_US; +} + + #endif /* EFSYS_OPT_SIENA && EFSYS_OPT_MCDI */ From owner-svn-src-all@freebsd.org Fri Dec 30 11:58:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE53DC96268; Fri, 30 Dec 2016 11:58:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F870105C; Fri, 30 Dec 2016 11:58:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUBwNAR064010; Fri, 30 Dec 2016 11:58:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUBwNB3064008; Fri, 30 Dec 2016 11:58:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301158.uBUBwNB3064008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 11:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310814 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 11:58:24 -0000 Author: arybchik Date: Fri Dec 30 11:58:23 2016 New Revision: 310814 URL: https://svnweb.freebsd.org/changeset/base/310814 Log: sfxge(4): make verified update result available from ef10_nvram_partn_unlock() Manftest needs to know exactly what went wrong with the verified update so that failing boards can be correctly diagnosed. Submitted by: Tom Millington Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8969 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 11:56:12 2016 (r310813) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 11:58:23 2016 (r310814) @@ -393,7 +393,8 @@ ef10_nvram_partn_lock( extern __checkReturn efx_rc_t ef10_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *resultp); #endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 30 11:56:12 2016 (r310813) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 30 11:58:23 2016 (r310814) @@ -1828,7 +1828,7 @@ ef10_nvram_partn_write_segment_tlv( goto fail7; /* Unlock the partition */ - ef10_nvram_partn_unlock(enp, partn); + ef10_nvram_partn_unlock(enp, partn, NULL); EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data); @@ -1843,7 +1843,7 @@ fail5: fail4: EFSYS_PROBE(fail4); - ef10_nvram_partn_unlock(enp, partn); + ef10_nvram_partn_unlock(enp, partn, NULL); fail3: EFSYS_PROBE(fail3); @@ -2049,13 +2049,16 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *resultp) { boolean_t reboot = B_FALSE; - uint32_t result = 0; /* FIXME: MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */ efx_rc_t rc; - rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, &result); + if (resultp != NULL) + *resultp = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, resultp); if (rc != 0) goto fail1; @@ -2064,7 +2067,6 @@ ef10_nvram_partn_unlock( fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* FIXME: log result if verified firmware update fails */ return (rc); } @@ -2370,7 +2372,7 @@ ef10_nvram_partn_rw_finish( { efx_rc_t rc; - if ((rc = ef10_nvram_partn_unlock(enp, partn)) != 0) + if ((rc = ef10_nvram_partn_unlock(enp, partn, NULL)) != 0) goto fail1; return (0); From owner-svn-src-all@freebsd.org Fri Dec 30 12:00:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DA9C968C1; Fri, 30 Dec 2016 12:00:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C32815D7; Fri, 30 Dec 2016 12:00:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUC0H24064154; Fri, 30 Dec 2016 12:00:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUC0HAq064152; Fri, 30 Dec 2016 12:00:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301200.uBUC0HAq064152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 12:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310815 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 12:00:18 -0000 Author: arybchik Date: Fri Dec 30 12:00:17 2016 New Revision: 310815 URL: https://svnweb.freebsd.org/changeset/base/310815 Log: sfxge(4): add functions to efx_bootcfg supporting whole partition access Expose expcfg partition layout discovery and validating buffer copy routines. Needed for whole-partition expcfg operations. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8970 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Dec 30 11:58:23 2016 (r310814) +++ head/sys/dev/sfxge/common/efx.h Fri Dec 30 12:00:17 2016 (r310815) @@ -1422,6 +1422,29 @@ efx_nvram_fini( #if EFSYS_OPT_BOOTCFG +/* Report size and offset of bootcfg sector in NVRAM partition. */ +extern __checkReturn efx_rc_t +efx_bootcfg_sector_info( + __in efx_nic_t *enp, + __in uint32_t pf, + __out_opt uint32_t *sector_countp, + __out size_t *offsetp, + __out size_t *max_sizep); + +/* + * Copy bootcfg sector data to a target buffer which may differ in size. + * Optionally corrects format errors in source buffer. + */ +extern efx_rc_t +efx_bootcfg_copy_sector( + __in efx_nic_t *enp, + __inout_bcount(sector_length) + uint8_t *sector, + __in size_t sector_length, + __out_bcount(data_size) uint8_t *data, + __in size_t data_size, + __in boolean_t handle_format_errors); + extern efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Fri Dec 30 11:58:23 2016 (r310814) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Fri Dec 30 12:00:17 2016 (r310815) @@ -42,17 +42,24 @@ __FBSDID("$FreeBSD$"); */ #define BOOTCFG_MAX_SIZE 0x1000 +/* Medford per-PF bootcfg sector */ +#define BOOTCFG_PER_PF 0x800 +#define BOOTCFG_PF_COUNT 16 + #define DHCP_END ((uint8_t)0xff) #define DHCP_PAD ((uint8_t)0) -/* Report size and offset of bootcfg sector in NVRAM partition. */ -static __checkReturn efx_rc_t -efx_bootcfg_sector( +/* Report the layout of bootcfg sectors in NVRAM partition. */ + __checkReturn efx_rc_t +efx_bootcfg_sector_info( __in efx_nic_t *enp, + __in uint32_t pf, + __out_opt uint32_t *sector_countp, __out size_t *offsetp, __out size_t *max_sizep) { + uint32_t count; size_t max_size; size_t offset; int rc; @@ -62,6 +69,7 @@ efx_bootcfg_sector( case EFX_FAMILY_SIENA: max_size = BOOTCFG_MAX_SIZE; offset = 0; + count = 1; break; #endif /* EFSYS_OPT_SIENA */ @@ -69,16 +77,20 @@ efx_bootcfg_sector( case EFX_FAMILY_HUNTINGTON: max_size = BOOTCFG_MAX_SIZE; offset = 0; + count = 1; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: { - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - /* Shared partition (array indexed by PF) */ - max_size = 0x0800; - offset = max_size * encp->enc_pf; + max_size = BOOTCFG_PER_PF; + count = BOOTCFG_PF_COUNT; + if (pf >= count) { + rc = EINVAL; + goto fail2; + } + offset = max_size * pf; break; } #endif /* EFSYS_OPT_MEDFORD */ @@ -90,11 +102,17 @@ efx_bootcfg_sector( } EFSYS_ASSERT3U(max_size, <=, BOOTCFG_MAX_SIZE); + if (sector_countp != NULL) + *sector_countp = count; *offsetp = offset; *max_sizep = max_size; return (0); +#if EFSYS_OPT_MEDFORD +fail2: + EFSYS_PROBE(fail2); +#endif fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -104,7 +122,7 @@ fail1: static __checkReturn uint8_t efx_bootcfg_csum( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t const *data, __in size_t size) { _NOTE(ARGUNUSED(enp)) @@ -120,7 +138,7 @@ efx_bootcfg_csum( static __checkReturn efx_rc_t efx_bootcfg_verify( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t const *data, __in size_t size, __out_opt size_t *usedp) { @@ -183,6 +201,95 @@ fail1: return (rc); } +/* + * Copy bootcfg sector data to a target buffer which may differ in size. + * Optionally corrects format errors in source buffer. + */ + efx_rc_t +efx_bootcfg_copy_sector( + __in efx_nic_t *enp, + __inout_bcount(sector_length) + uint8_t *sector, + __in size_t sector_length, + __out_bcount(data_size) uint8_t *data, + __in size_t data_size, + __in boolean_t handle_format_errors) +{ + size_t used_bytes; + efx_rc_t rc; + + /* Verify that the area is correctly formatted and checksummed */ + rc = efx_bootcfg_verify(enp, sector, sector_length, + &used_bytes); + + if (!handle_format_errors) { + if (rc != 0) + goto fail1; + + if ((used_bytes < 2) || + (sector[used_bytes - 1] != DHCP_END)) { + /* Block too short, or DHCP_END missing */ + rc = ENOENT; + goto fail2; + } + } + + /* Synthesize empty format on verification failure */ + if (rc != 0 || used_bytes == 0) { + sector[0] = 0; + sector[1] = DHCP_END; + used_bytes = 2; + } + EFSYS_ASSERT(used_bytes >= 2); /* checksum and DHCP_END */ + EFSYS_ASSERT(used_bytes <= sector_length); + EFSYS_ASSERT(sector_length >= 2); + + /* + * Legacy bootcfg sectors don't terminate with a DHCP_END character. + * Modify the returned payload so it does. + * Reinitialise the sector if there isn't room for the character. + */ + if (sector[used_bytes - 1] != DHCP_END) { + if (used_bytes >= sector_length) { + sector[0] = 0; + used_bytes = 1; + } + sector[used_bytes] = DHCP_END; + ++used_bytes; + } + + /* + * Verify that the target buffer is large enough for the + * entire used bootcfg area, then copy into the target buffer. + */ + if (used_bytes > data_size) { + rc = ENOSPC; + goto fail3; + } + memcpy(data, sector, used_bytes); + + /* Zero out the unused portion of the target buffer */ + if (used_bytes < data_size) + (void) memset(data + used_bytes, 0, data_size - used_bytes); + + /* + * The checksum includes trailing data after any DHCP_END character, + * which we've just modified (by truncation or appending DHCP_END). + */ + data[0] -= efx_bootcfg_csum(enp, data, data_size); + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, @@ -195,13 +302,20 @@ efx_bootcfg_read( size_t sector_length; size_t sector_offset; efx_rc_t rc; + uint32_t sector_number; +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + sector_number = enp->en_nic_cfg.enc_pf; +#else + sector_number = 0; +#endif rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length); if (rc != 0) goto fail1; /* The bootcfg sector may be stored in a (larger) shared partition */ - rc = efx_bootcfg_sector(enp, §or_offset, §or_length); + rc = efx_bootcfg_sector_info(enp, sector_number, + NULL, §or_offset, §or_length); if (rc != 0) goto fail2; @@ -232,17 +346,18 @@ efx_bootcfg_read( if ((rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) goto fail5; - rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset, - (caddr_t)payload, sector_length); - - efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); - - if (rc != 0) + if ((rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, + sector_offset, (caddr_t)payload, sector_length)) != 0) { + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); goto fail6; + } + + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + goto fail7; /* Verify that the area is correctly formatted and checksummed */ rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, - &used_bytes); + &used_bytes); if (rc != 0 || used_bytes == 0) { payload[0] = (uint8_t)~DHCP_END; payload[1] = DHCP_END; @@ -274,7 +389,7 @@ efx_bootcfg_read( */ if (used_bytes > size) { rc = ENOSPC; - goto fail7; + goto fail8; } if (sector_length > size) { memcpy(data, payload, used_bytes); @@ -293,6 +408,8 @@ efx_bootcfg_read( return (0); +fail8: + EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); fail6: @@ -326,13 +443,21 @@ efx_bootcfg_write( size_t sector_offset; size_t used_bytes; efx_rc_t rc; + uint32_t sector_number; + +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + sector_number = enp->en_nic_cfg.enc_pf; +#else + sector_number = 0; +#endif rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length); if (rc != 0) goto fail1; /* The bootcfg sector may be stored in a (larger) shared partition */ - rc = efx_bootcfg_sector(enp, §or_offset, §or_length); + rc = efx_bootcfg_sector_info(enp, sector_number, + NULL, §or_offset, §or_length); if (rc != 0) goto fail2; @@ -396,16 +521,18 @@ efx_bootcfg_write( goto fail10; if ((rc = efx_nvram_write_chunk(enp, EFX_NVRAM_BOOTROM_CFG, - 0, partn_data, partn_length)) != 0) { + 0, (caddr_t)partn_data, partn_length)) != 0) goto fail11; - } - efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + goto fail12; EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); return (0); +fail12: + EFSYS_PROBE(fail12); fail11: EFSYS_PROBE(fail11); fail10: @@ -413,7 +540,7 @@ fail10: fail9: EFSYS_PROBE(fail9); - efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); fail8: EFSYS_PROBE(fail8); From owner-svn-src-all@freebsd.org Fri Dec 30 12:02:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2195DC96DE2; Fri, 30 Dec 2016 12:02:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D68B51AAF; Fri, 30 Dec 2016 12:02:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUC2Hul067849; Fri, 30 Dec 2016 12:02:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUC2GiB067845; Fri, 30 Dec 2016 12:02:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301202.uBUC2GiB067845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 12:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310816 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 12:02:18 -0000 Author: arybchik Date: Fri Dec 30 12:02:16 2016 New Revision: 310816 URL: https://svnweb.freebsd.org/changeset/base/310816 Log: sfxge(4): fix efx_filter_supported_filters API The previous API had various problems, including the length of the caller provided buffer not being specified, no means being available to discover how big the buffer needs to be, and a lack of clarity of what the resulting list contains. To fix it: - add the buffer length as a parameter - if the provided buffer is too short, fail with ENOSPC and return the required length - ensure that the list contents are valid and add comments describing it It is safe to change this API as, unsuprisingly, it has no users. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8971 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Dec 30 12:00:17 2016 (r310815) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Dec 30 12:02:16 2016 (r310816) @@ -871,13 +871,16 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_get_parser_disp_info( - __in efx_nic_t *enp, - __out uint32_t *list, - __out size_t *length) + __in efx_nic_t *enp, + __out_ecount(buffer_length) uint32_t *buffer, + __in size_t buffer_length, + __out size_t *list_lengthp) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_PARSER_DISP_INFO_IN_LEN, MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX)]; + size_t matches_count; + size_t list_size; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); @@ -897,25 +900,41 @@ efx_mcdi_get_parser_disp_info( goto fail1; } - *length = MCDI_OUT_DWORD(req, + matches_count = MCDI_OUT_DWORD(req, GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES); if (req.emr_out_length_used < - MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(*length)) { + MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(matches_count)) { rc = EMSGSIZE; goto fail2; } - memcpy(list, - MCDI_OUT2(req, - uint32_t, - GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES), - (*length) * sizeof (uint32_t)); + *list_lengthp = matches_count; + + if (buffer_length < matches_count) { + rc = ENOSPC; + goto fail3; + } + + /* + * Check that the elements in the list in the MCDI response are the size + * we expect, so we can just copy them directly. Any conversion of the + * flags is handled by the caller. + */ EFX_STATIC_ASSERT(sizeof (uint32_t) == MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN); + list_size = matches_count * + MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN; + memcpy(buffer, + MCDI_OUT2(req, uint32_t, + GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES), + list_size); + return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: @@ -926,14 +945,55 @@ fail1: __checkReturn efx_rc_t ef10_filter_supported_filters( - __in efx_nic_t *enp, - __out uint32_t *list, - __out size_t *length) + __in efx_nic_t *enp, + __out_ecount(buffer_length) uint32_t *buffer, + __in size_t buffer_length, + __out size_t *list_lengthp) { - efx_rc_t rc; - if ((rc = efx_mcdi_get_parser_disp_info(enp, list, length)) != 0) + size_t mcdi_list_length; + size_t list_length; + uint32_t i; + efx_rc_t rc; + uint32_t all_filter_flags = + (EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST | + EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT | + EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT | + EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_INNER_VID | + EFX_FILTER_MATCH_OUTER_VID | EFX_FILTER_MATCH_IP_PROTO | + EFX_FILTER_MATCH_UNKNOWN_MCAST_DST | + EFX_FILTER_MATCH_UNKNOWN_UCAST_DST); + + rc = efx_mcdi_get_parser_disp_info(enp, buffer, buffer_length, + &mcdi_list_length); + if (rc != 0) { + if (rc == ENOSPC) { + /* Pass through mcdi_list_length for the list length */ + *list_lengthp = mcdi_list_length; + } goto fail1; + } + + /* + * The static assertions in ef10_filter_init() ensure that the values of + * the EFX_FILTER_MATCH flags match those used by MCDI, so they don't + * need to be converted. + * + * In case support is added to MCDI for additional flags, remove any + * matches from the list which include flags we don't support. The order + * of the matches is preserved as they are ordered from highest to + * lowest priority. + */ + EFSYS_ASSERT(mcdi_list_length <= buffer_length); + list_length = 0; + for (i = 0; i < mcdi_list_length; i++) { + if ((buffer[i] & ~all_filter_flags) == 0) { + buffer[list_length] = buffer[i]; + list_length++; + } + } + + *list_lengthp = list_length; return (0); Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 12:00:17 2016 (r310815) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Dec 30 12:02:16 2016 (r310816) @@ -1028,9 +1028,10 @@ ef10_filter_delete( extern __checkReturn efx_rc_t ef10_filter_supported_filters( - __in efx_nic_t *enp, - __out uint32_t *list, - __out size_t *length); + __in efx_nic_t *enp, + __out_ecount(buffer_length) uint32_t *buffer, + __in size_t buffer_length, + __out size_t *list_lengthp); extern __checkReturn efx_rc_t ef10_filter_reconfigure( Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Dec 30 12:00:17 2016 (r310815) +++ head/sys/dev/sfxge/common/efx.h Fri Dec 30 12:02:16 2016 (r310816) @@ -2312,9 +2312,10 @@ efx_filter_restore( extern __checkReturn efx_rc_t efx_filter_supported_filters( - __in efx_nic_t *enp, - __out uint32_t *list, - __out size_t *length); + __in efx_nic_t *enp, + __out_ecount(buffer_length) uint32_t *buffer, + __in size_t buffer_length, + __out size_t *list_lengthp); extern void efx_filter_spec_init_rx( Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Dec 30 12:00:17 2016 (r310815) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Dec 30 12:02:16 2016 (r310816) @@ -64,9 +64,10 @@ siena_filter_delete( static __checkReturn efx_rc_t siena_filter_supported_filters( - __in efx_nic_t *enp, - __out uint32_t *list, - __out size_t *length); + __in efx_nic_t *enp, + __out_ecount(buffer_length) uint32_t *buffer, + __in size_t buffer_length, + __out size_t *list_lengthp); #endif /* EFSYS_OPT_SIENA */ @@ -212,11 +213,22 @@ efx_filter_fini( enp->en_mod_flags &= ~EFX_MOD_FILTER; } +/* + * Query the possible combinations of match flags which can be filtered on. + * These are returned as a list, of which each 32 bit element is a bitmask + * formed of EFX_FILTER_MATCH flags. + * + * The combinations are ordered in priority from highest to lowest. + * + * If the provided buffer is too short to hold the list, the call with fail with + * ENOSPC and *list_lengthp will be set to the buffer length required. + */ __checkReturn efx_rc_t efx_filter_supported_filters( - __in efx_nic_t *enp, - __out uint32_t *list, - __out size_t *length) + __in efx_nic_t *enp, + __out_ecount(buffer_length) uint32_t *buffer, + __in size_t buffer_length, + __out size_t *list_lengthp) { efx_rc_t rc; @@ -225,11 +237,20 @@ efx_filter_supported_filters( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER); EFSYS_ASSERT(enp->en_efop->efo_supported_filters != NULL); - if ((rc = enp->en_efop->efo_supported_filters(enp, list, length)) != 0) + if (buffer == NULL) { + rc = EINVAL; goto fail1; + } + + rc = enp->en_efop->efo_supported_filters(enp, buffer, buffer_length, + list_lengthp); + if (rc != 0) + goto fail2; return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -1349,23 +1370,20 @@ fail1: return (rc); } -#define MAX_SUPPORTED 4 +#define SIENA_MAX_SUPPORTED_MATCHES 4 static __checkReturn efx_rc_t siena_filter_supported_filters( - __in efx_nic_t *enp, - __out uint32_t *list, - __out size_t *length) -{ - int index = 0; - uint32_t rx_matches[MAX_SUPPORTED]; + __in efx_nic_t *enp, + __out_ecount(buffer_length) uint32_t *buffer, + __in size_t buffer_length, + __out size_t *list_lengthp) +{ + uint32_t index = 0; + uint32_t rx_matches[SIENA_MAX_SUPPORTED_MATCHES]; + size_t list_length; efx_rc_t rc; - if (list == NULL) { - rc = EINVAL; - goto fail1; - } - rx_matches[index++] = EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO | EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT | @@ -1382,14 +1400,22 @@ siena_filter_supported_filters( rx_matches[index++] = EFX_FILTER_MATCH_LOC_MAC; } - EFSYS_ASSERT3U(index, <=, MAX_SUPPORTED); + EFSYS_ASSERT3U(index, <=, SIENA_MAX_SUPPORTED_MATCHES); + list_length = index; + + *list_lengthp = list_length; + + if (buffer_length < list_length) { + rc = ENOSPC; + goto fail1; + } - *length = index; - memcpy(list, rx_matches, *length); + memcpy(buffer, rx_matches, list_length * sizeof (rx_matches[0])); return (0); fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 12:00:17 2016 (r310815) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 12:02:16 2016 (r310816) @@ -231,7 +231,8 @@ typedef struct efx_filter_ops_s { efx_rc_t (*efo_add)(efx_nic_t *, efx_filter_spec_t *, boolean_t may_replace); efx_rc_t (*efo_delete)(efx_nic_t *, efx_filter_spec_t *); - efx_rc_t (*efo_supported_filters)(efx_nic_t *, uint32_t *, size_t *); + efx_rc_t (*efo_supported_filters)(efx_nic_t *, uint32_t *, + size_t, size_t *); efx_rc_t (*efo_reconfigure)(efx_nic_t *, uint8_t const *, boolean_t, boolean_t, boolean_t, boolean_t, uint8_t const *, uint32_t); From owner-svn-src-all@freebsd.org Fri Dec 30 12:06:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A66C96F0D; Fri, 30 Dec 2016 12:06:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 024301D9B; Fri, 30 Dec 2016 12:06:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUC6ufI068206; Fri, 30 Dec 2016 12:06:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUC6txq068199; Fri, 30 Dec 2016 12:06:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301206.uBUC6txq068199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 12:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310817 - in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 12:06:57 -0000 Author: arybchik Date: Fri Dec 30 12:06:55 2016 New Revision: 310817 URL: https://svnweb.freebsd.org/changeset/base/310817 Log: sfxge(4): remove obsolete Wake-On-LAN support Wake-on-lan is not supported in production on any of our adapters, as they don't have the required AUX power connector. (It's possible that AUX power is supplied to some of our ALOM or mezz adapters, but if so then we've never implemented or tested WoL support.) Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8972 Deleted: head/sys/dev/sfxge/common/efx_wol.c Modified: head/sys/conf/files.amd64 head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/modules/sfxge/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Dec 30 12:02:16 2016 (r310816) +++ head/sys/conf/files.amd64 Fri Dec 30 12:06:55 2016 (r310817) @@ -383,7 +383,6 @@ dev/sfxge/common/efx_rx.c optional sfxge dev/sfxge/common/efx_sram.c optional sfxge pci dev/sfxge/common/efx_tx.c optional sfxge pci dev/sfxge/common/efx_vpd.c optional sfxge pci -dev/sfxge/common/efx_wol.c optional sfxge pci dev/sfxge/common/hunt_nic.c optional sfxge pci dev/sfxge/common/mcdi_mon.c optional sfxge pci dev/sfxge/common/medford_nic.c optional sfxge pci Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Fri Dec 30 12:02:16 2016 (r310816) +++ head/sys/dev/sfxge/common/efsys.h Fri Dec 30 12:06:55 2016 (r310817) @@ -266,7 +266,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_BOOTCFG 0 #define EFSYS_OPT_DIAG 0 -#define EFSYS_OPT_WOL 1 #define EFSYS_OPT_RX_SCALE 1 #define EFSYS_OPT_QSTATS 1 #define EFSYS_OPT_FILTER 1 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Dec 30 12:02:16 2016 (r310816) +++ head/sys/dev/sfxge/common/efx.h Fri Dec 30 12:06:55 2016 (r310817) @@ -1075,7 +1075,6 @@ efx_bist_stop( #define EFX_FEATURE_LFSR_HASH_INSERT 0x00000002 #define EFX_FEATURE_LINK_EVENTS 0x00000004 #define EFX_FEATURE_PERIODIC_MAC_STATS 0x00000008 -#define EFX_FEATURE_WOL 0x00000010 #define EFX_FEATURE_MCDI 0x00000020 #define EFX_FEATURE_LOOKAHEAD_SPLIT 0x00000040 #define EFX_FEATURE_MAC_HEADER_FILTERS 0x00000080 @@ -1459,87 +1458,6 @@ efx_bootcfg_write( #endif /* EFSYS_OPT_BOOTCFG */ -#if EFSYS_OPT_WOL - -typedef enum efx_wol_type_e { - EFX_WOL_TYPE_INVALID, - EFX_WOL_TYPE_MAGIC, - EFX_WOL_TYPE_BITMAP, - EFX_WOL_TYPE_LINK, - EFX_WOL_NTYPES, -} efx_wol_type_t; - -typedef enum efx_lightsout_offload_type_e { - EFX_LIGHTSOUT_OFFLOAD_TYPE_INVALID, - EFX_LIGHTSOUT_OFFLOAD_TYPE_ARP, - EFX_LIGHTSOUT_OFFLOAD_TYPE_NS, -} efx_lightsout_offload_type_t; - -#define EFX_WOL_BITMAP_MASK_SIZE (48) -#define EFX_WOL_BITMAP_VALUE_SIZE (128) - -typedef union efx_wol_param_u { - struct { - uint8_t mac_addr[6]; - } ewp_magic; - struct { - uint8_t mask[EFX_WOL_BITMAP_MASK_SIZE]; /* 1 bit per byte */ - uint8_t value[EFX_WOL_BITMAP_VALUE_SIZE]; /* value to match */ - uint8_t value_len; - } ewp_bitmap; -} efx_wol_param_t; - -typedef union efx_lightsout_offload_param_u { - struct { - uint8_t mac_addr[6]; - uint32_t ip; - } elop_arp; - struct { - uint8_t mac_addr[6]; - uint32_t solicited_node[4]; - uint32_t ip[4]; - } elop_ns; -} efx_lightsout_offload_param_t; - -extern __checkReturn efx_rc_t -efx_wol_init( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t -efx_wol_filter_clear( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t -efx_wol_filter_add( - __in efx_nic_t *enp, - __in efx_wol_type_t type, - __in efx_wol_param_t *paramp, - __out uint32_t *filter_idp); - -extern __checkReturn efx_rc_t -efx_wol_filter_remove( - __in efx_nic_t *enp, - __in uint32_t filter_id); - -extern __checkReturn efx_rc_t -efx_lightsout_offload_add( - __in efx_nic_t *enp, - __in efx_lightsout_offload_type_t type, - __in efx_lightsout_offload_param_t *paramp, - __out uint32_t *filter_idp); - -extern __checkReturn efx_rc_t -efx_lightsout_offload_remove( - __in efx_nic_t *enp, - __in efx_lightsout_offload_type_t type, - __in uint32_t filter_id); - -extern void -efx_wol_fini( - __in efx_nic_t *enp); - -#endif /* EFSYS_OPT_WOL */ - #if EFSYS_OPT_DIAG typedef enum efx_pattern_type_t { Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Fri Dec 30 12:02:16 2016 (r310816) +++ head/sys/dev/sfxge/common/efx_check.h Fri Dec 30 12:06:55 2016 (r310817) @@ -307,10 +307,8 @@ #endif /* EFSYS_OPT_VPD */ /* Support Wake on LAN */ -#if EFSYS_OPT_WOL -# if !EFSYS_OPT_SIENA -# error "WOL requires SIENA" -# endif +#ifdef EFSYS_OPT_WOL +# error "WOL is obsolete and is not supported" #endif /* EFSYS_OPT_WOL */ #ifdef EFSYS_OPT_MCAST_FILTER_LIST Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 12:02:16 2016 (r310816) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 12:06:55 2016 (r310817) @@ -74,7 +74,6 @@ extern "C" { #define EFX_MOD_TX 0x00000100 #define EFX_MOD_PORT 0x00000200 #define EFX_MOD_MON 0x00000400 -#define EFX_MOD_WOL 0x00000800 #define EFX_MOD_FILTER 0x00001000 #define EFX_MOD_LIC 0x00002000 Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Fri Dec 30 12:02:16 2016 (r310816) +++ head/sys/dev/sfxge/common/efx_nic.c Fri Dec 30 12:06:55 2016 (r310817) @@ -268,7 +268,6 @@ efx_nic_create( EFX_FEATURE_LFSR_HASH_INSERT | EFX_FEATURE_LINK_EVENTS | EFX_FEATURE_PERIODIC_MAC_STATS | - EFX_FEATURE_WOL | EFX_FEATURE_MCDI | EFX_FEATURE_LOOKAHEAD_SPLIT | EFX_FEATURE_MAC_HEADER_FILTERS | @@ -279,7 +278,6 @@ efx_nic_create( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: enp->en_enop = &__efx_nic_hunt_ops; - /* FIXME: Add WOL support */ enp->en_features = EFX_FEATURE_IPV6 | EFX_FEATURE_LINK_EVENTS | Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri Dec 30 12:02:16 2016 (r310816) +++ head/sys/modules/sfxge/Makefile Fri Dec 30 12:06:55 2016 (r310817) @@ -17,7 +17,7 @@ SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfx SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_lic.c efx_mac.c SRCS+= efx_mcdi.c efx_mon.c efx_nic.c SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c -SRCS+= efx_vpd.c efx_wol.c efx_filter.c efx_hash.c +SRCS+= efx_vpd.c efx_filter.c efx_hash.c SRCS+= efsys.h SRCS+= efx.h efx_check.h efx_impl.h efx_mcdi.h efx_regs.h efx_regs_ef10.h SRCS+= efx_regs_mcdi.h efx_regs_pci.h efx_types.h efx_phy_ids.h From owner-svn-src-all@freebsd.org Fri Dec 30 12:10:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 441EEC96FF2; Fri, 30 Dec 2016 12:10:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDD501F47; Fri, 30 Dec 2016 12:10:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUCAGUi068384; Fri, 30 Dec 2016 12:10:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUCAGlR068383; Fri, 30 Dec 2016 12:10:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301210.uBUCAGlR068383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 12:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310818 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 12:10:17 -0000 Author: arybchik Date: Fri Dec 30 12:10:15 2016 New Revision: 310818 URL: https://svnweb.freebsd.org/changeset/base/310818 Log: sfxge(4): support per-command MCDI timeout Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/sfxge_mcdi.c Modified: head/sys/dev/sfxge/sfxge_mcdi.c ============================================================================== --- head/sys/dev/sfxge/sfxge_mcdi.c Fri Dec 30 12:06:55 2016 (r310817) +++ head/sys/dev/sfxge/sfxge_mcdi.c Fri Dec 30 12:10:15 2016 (r310818) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #define SFXGE_MCDI_POLL_INTERVAL_MIN 10 /* 10us in 1us units */ #define SFXGE_MCDI_POLL_INTERVAL_MAX 100000 /* 100ms in 1us units */ -#define SFXGE_MCDI_WATCHDOG_INTERVAL 10000000 /* 10s in 1us units */ static void sfxge_mcdi_timeout(struct sfxge_softc *sc) @@ -70,7 +69,7 @@ sfxge_mcdi_timeout(struct sfxge_softc *s } static void -sfxge_mcdi_poll(struct sfxge_softc *sc) +sfxge_mcdi_poll(struct sfxge_softc *sc, uint32_t timeout_us) { efx_nic_t *enp; clock_t delay_total; @@ -87,7 +86,7 @@ sfxge_mcdi_poll(struct sfxge_softc *sc) return; } - if (delay_total > SFXGE_MCDI_WATCHDOG_INTERVAL) { + if (delay_total > timeout_us) { aborted = efx_mcdi_request_abort(enp); KASSERT(aborted, ("abort failed")); sfxge_mcdi_timeout(sc); @@ -115,6 +114,7 @@ sfxge_mcdi_execute(void *arg, efx_mcdi_r { struct sfxge_softc *sc; struct sfxge_mcdi *mcdi; + uint32_t timeout_us = 0; sc = (struct sfxge_softc *)arg; mcdi = &sc->mcdi; @@ -125,8 +125,11 @@ sfxge_mcdi_execute(void *arg, efx_mcdi_r ("MCDI not initialized")); /* Issue request and poll for completion. */ + efx_mcdi_get_timeout(sc->enp, emrp, &timeout_us); + KASSERT(timeout_us > 0, ("MCDI timeout not initialized")); + efx_mcdi_request_start(sc->enp, emrp, B_FALSE); - sfxge_mcdi_poll(sc); + sfxge_mcdi_poll(sc, timeout_us); SFXGE_MCDI_UNLOCK(mcdi); } From owner-svn-src-all@freebsd.org Fri Dec 30 12:19:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B7CC972F7; Fri, 30 Dec 2016 12:19:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03BB516B6; Fri, 30 Dec 2016 12:19:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUCJfFW072777; Fri, 30 Dec 2016 12:19:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUCJeHV072773; Fri, 30 Dec 2016 12:19:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301219.uBUCJeHV072773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 12:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310819 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 12:19:42 -0000 Author: arybchik Date: Fri Dec 30 12:19:40 2016 New Revision: 310819 URL: https://svnweb.freebsd.org/changeset/base/310819 Log: sfxge(4): cleanup: add efsys_lock_state_t for type of state param in EFSYS_LOCK() This allows the common code to use the correct type for the lock state local variable passed to EFSYS_LOCK() and EFSYS_UNLOCK(). On Windows, this allows warning supression pragmas to be removed. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Dec 30 12:19:40 2016 (r310819) @@ -471,7 +471,7 @@ ef10_filter_restore( efx_filter_spec_t *spec; ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; boolean_t restoring; - int state; + efsys_lock_state_t state; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || @@ -546,7 +546,7 @@ ef10_filter_add_internal( int ins_index; boolean_t replacing = B_FALSE; unsigned int i; - int state; + efsys_lock_state_t state; boolean_t locked = B_FALSE; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || @@ -748,7 +748,7 @@ ef10_filter_delete_internal( efx_rc_t rc; ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t *spec; - int state; + efsys_lock_state_t state; uint32_t filter_idx = filter_id % EFX_EF10_FILTER_TBL_ROWS; /* @@ -822,7 +822,7 @@ ef10_filter_delete( unsigned int hash; unsigned int depth; unsigned int i; - int state; + efsys_lock_state_t state; boolean_t locked = B_FALSE; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/efsys.h Fri Dec 30 12:19:40 2016 (r310819) @@ -1094,6 +1094,8 @@ typedef struct efsys_lock_s { #define SFXGE_EFSYS_LOCK_ASSERT_OWNED(_eslp) \ mtx_assert(&(_eslp)->lock, MA_OWNED) +typedef int efsys_lock_state_t; + #define EFSYS_LOCK_MAGIC 0x000010c4 #define EFSYS_LOCK(_lockp, _state) \ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Dec 30 12:19:40 2016 (r310819) @@ -1047,7 +1047,7 @@ siena_filter_tbl_clear( siena_filter_t *sfp = enp->en_filter.ef_siena_filter; siena_filter_tbl_t *sftp = &sfp->sf_tbl[tbl_id]; int index; - int state; + efsys_lock_state_t state; EFSYS_LOCK(enp->en_eslp, state); @@ -1195,7 +1195,7 @@ siena_filter_restore( siena_filter_spec_t *spec; efx_oword_t filter; int filter_idx; - int state; + efsys_lock_state_t state; uint32_t key; efx_rc_t rc; @@ -1253,7 +1253,7 @@ siena_filter_add( efx_oword_t filter; int filter_idx; unsigned int depth; - int state; + efsys_lock_state_t state; uint32_t key; @@ -1334,7 +1334,7 @@ siena_filter_delete( efx_oword_t filter; int filter_idx; unsigned int depth; - int state; + efsys_lock_state_t state; uint32_t key; EFSYS_ASSERT3P(spec, !=, NULL); Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 12:19:40 2016 (r310819) @@ -183,7 +183,7 @@ efx_mcdi_new_epoch( __in efx_nic_t *enp) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - int state; + efsys_lock_state_t state; /* Start a new epoch (allow fresh MCDI requests to succeed) */ EFSYS_LOCK(enp->en_eslp, state); @@ -254,7 +254,7 @@ efx_mcdi_request_start( unsigned int seq; unsigned int xflags; boolean_t new_epoch; - int state; + efsys_lock_state_t state; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); @@ -502,7 +502,7 @@ efx_mcdi_request_poll( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; - int state; + efsys_lock_state_t state; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -570,7 +570,7 @@ efx_mcdi_request_abort( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; boolean_t aborted; - int state; + efsys_lock_state_t state; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); @@ -756,7 +756,7 @@ efx_mcdi_ev_cpl( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_req_t *emrp; - int state; + efsys_lock_state_t state; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); @@ -867,7 +867,7 @@ efx_mcdi_ev_death( const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_req_t *emrp = NULL; boolean_t ev_cpl; - int state; + efsys_lock_state_t state; /* * The MCDI request (if there is one) has been terminated, either From owner-svn-src-all@freebsd.org Fri Dec 30 12:23:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4040C975B3; Fri, 30 Dec 2016 12:23:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B3561B5A; Fri, 30 Dec 2016 12:23:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUCN2fD076638; Fri, 30 Dec 2016 12:23:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUCN24l076637; Fri, 30 Dec 2016 12:23:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301223.uBUCN24l076637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 12:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310820 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 12:23:03 -0000 Author: arybchik Date: Fri Dec 30 12:23:02 2016 New Revision: 310820 URL: https://svnweb.freebsd.org/changeset/base/310820 Log: sfxge(4): move queue size checks to after the NIC config has been populated Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8974 Modified: head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Fri Dec 30 12:19:40 2016 (r310819) +++ head/sys/dev/sfxge/sfxge.c Fri Dec 30 12:23:02 2016 (r310820) @@ -737,6 +737,16 @@ sfxge_create(struct sfxge_softc *sc) goto fail3; sc->enp = enp; + /* Initialize MCDI to talk to the microcontroller. */ + DBGPRINT(sc->dev, "mcdi_init..."); + if ((error = sfxge_mcdi_init(sc)) != 0) + goto fail4; + + /* Probe the NIC and build the configuration data area. */ + DBGPRINT(sc->dev, "nic_probe..."); + if ((error = efx_nic_probe(enp)) != 0) + goto fail5; + if (!ISP2(sfxge_rx_ring_entries) || (sfxge_rx_ring_entries < EFX_RXQ_MINNDESCS) || (sfxge_rx_ring_entries > EFX_RXQ_MAXNDESCS)) { @@ -759,16 +769,6 @@ sfxge_create(struct sfxge_softc *sc) } sc->txq_entries = sfxge_tx_ring_entries; - /* Initialize MCDI to talk to the microcontroller. */ - DBGPRINT(sc->dev, "mcdi_init..."); - if ((error = sfxge_mcdi_init(sc)) != 0) - goto fail4; - - /* Probe the NIC and build the configuration data area. */ - DBGPRINT(sc->dev, "nic_probe..."); - if ((error = efx_nic_probe(enp)) != 0) - goto fail5; - SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "version", CTLFLAG_RD, @@ -861,14 +861,14 @@ fail7: efx_nvram_fini(enp); fail6: +fail_tx_ring_entries: +fail_rx_ring_entries: efx_nic_unprobe(enp); fail5: sfxge_mcdi_fini(sc); fail4: -fail_tx_ring_entries: -fail_rx_ring_entries: sc->enp = NULL; efx_nic_destroy(enp); SFXGE_EFSYS_LOCK_DESTROY(&sc->enp_lock); From owner-svn-src-all@freebsd.org Fri Dec 30 13:04:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC524C97117; Fri, 30 Dec 2016 13:04:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8991710FC; Fri, 30 Dec 2016 13:04:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUD4hYu093177; Fri, 30 Dec 2016 13:04:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUD4hBH093176; Fri, 30 Dec 2016 13:04:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612301304.uBUD4hBH093176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Dec 2016 13:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310821 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 13:04:44 -0000 Author: kib Date: Fri Dec 30 13:04:43 2016 New Revision: 310821 URL: https://svnweb.freebsd.org/changeset/base/310821 Log: Style. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Dec 30 12:23:02 2016 (r310820) +++ head/sys/vm/vm_map.c Fri Dec 30 13:04:43 2016 (r310821) @@ -2927,8 +2927,8 @@ vm_map_entry_delete(vm_map_t map, vm_map offidxstart = OFF_TO_IDX(entry->offset); offidxend = offidxstart + count; VM_OBJECT_WLOCK(object); - if (object->ref_count != 1 && - ((object->flags & (OBJ_NOSPLIT|OBJ_ONEMAPPING)) == OBJ_ONEMAPPING || + if (object->ref_count != 1 && ((object->flags & (OBJ_NOSPLIT | + OBJ_ONEMAPPING)) == OBJ_ONEMAPPING || object == kernel_object || object == kmem_object)) { vm_object_collapse(object); @@ -2941,7 +2941,8 @@ vm_map_entry_delete(vm_map_t map, vm_map vm_object_page_remove(object, offidxstart, offidxend, OBJPR_NOTMAPPED); if (object->type == OBJT_SWAP) - swap_pager_freespace(object, offidxstart, count); + swap_pager_freespace(object, offidxstart, + count); if (offidxend >= object->size && offidxstart < object->size) { size1 = object->size; @@ -2949,8 +2950,9 @@ vm_map_entry_delete(vm_map_t map, vm_map if (object->cred != NULL) { size1 -= object->size; KASSERT(object->charge >= ptoa(size1), - ("vm_map_entry_delete: object->charge < 0")); - swap_release_by_cred(ptoa(size1), object->cred); + ("object %p charge < 0", object)); + swap_release_by_cred(ptoa(size1), + object->cred); object->charge -= ptoa(size1); } } @@ -3168,13 +3170,15 @@ vm_map_copy_entry( if ((src_object = src_entry->object.vm_object) != NULL) { VM_OBJECT_WLOCK(src_object); charged = ENTRY_CHARGED(src_entry); - if ((src_object->handle == NULL) && - (src_object->type == OBJT_DEFAULT || - src_object->type == OBJT_SWAP)) { + if (src_object->handle == NULL && + (src_object->type == OBJT_DEFAULT || + src_object->type == OBJT_SWAP)) { vm_object_collapse(src_object); - if ((src_object->flags & (OBJ_NOSPLIT|OBJ_ONEMAPPING)) == OBJ_ONEMAPPING) { + if ((src_object->flags & (OBJ_NOSPLIT | + OBJ_ONEMAPPING)) == OBJ_ONEMAPPING) { vm_object_split(src_entry); - src_object = src_entry->object.vm_object; + src_object = + src_entry->object.vm_object; } } vm_object_reference_locked(src_object); @@ -3201,8 +3205,10 @@ vm_map_copy_entry( *fork_charge += size; } } - src_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY); - dst_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY); + src_entry->eflags |= MAP_ENTRY_COW | + MAP_ENTRY_NEEDS_COPY; + dst_entry->eflags |= MAP_ENTRY_COW | + MAP_ENTRY_NEEDS_COPY; dst_entry->offset = src_entry->offset; if (src_entry->eflags & MAP_ENTRY_VN_WRITECNT) { /* @@ -3825,10 +3831,10 @@ Retry: rv = KERN_NO_SPACE; /* Grow the underlying object if applicable. */ else if (stack_entry->object.vm_object == NULL || - vm_object_coalesce(stack_entry->object.vm_object, - stack_entry->offset, - (vm_size_t)(stack_entry->end - stack_entry->start), - (vm_size_t)grow_amount, cred != NULL)) { + vm_object_coalesce(stack_entry->object.vm_object, + stack_entry->offset, + (vm_size_t)(stack_entry->end - stack_entry->start), + (vm_size_t)grow_amount, cred != NULL)) { map->size += (addr - stack_entry->end); /* Update the current entry. */ stack_entry->end = addr; From owner-svn-src-all@freebsd.org Fri Dec 30 13:39:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32638C97AA5; Fri, 30 Dec 2016 13:39:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF3CC13B1; Fri, 30 Dec 2016 13:39:31 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x244.google.com with SMTP id n85so21900422ioi.1; Fri, 30 Dec 2016 05:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=JrMUF5xdjCdh9hGG6gSG1jJJCjMdrKHg6fTFe0yNotg=; b=qPfxCPzyfd49rxuwWZ+OXoBwMt0GThknd+Xnjxe8iLzs1MvlAgK0c9ULYpiYQyVNtb BwBXA+hXqNFhxQSnSQa3vE+7NNfQZg8jHymdQh3IzJrUP/phE5qPXvmVq4FZV3BwHEVE pK/HqwZ25IO5clFoRlhbWoObwJlEpOsFHGLWgavBB4Zi0g9yO75rz49V7ubQWYAaj2Ml zWTjqTANGWWBMDPwCXvZZl6paw6IgbLlG2aTt5AZeTE0IL09PZOBKsjSCinn/2DQxko/ 6XaJcfxmOmUfn1GV39zhry2oGZ/IE6r+0NFnyRFMv6R0/3We8qXC6YCwj7BZsaULK8b6 cTcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=JrMUF5xdjCdh9hGG6gSG1jJJCjMdrKHg6fTFe0yNotg=; b=NXPZyMPRHcpCfjwQKUQVoPMOStZsFzj3aZCIB4NxN/6Tbkge+KCevtpg3Wi1vdvafm nSE9xwqS2/kU7iP+jo2SyvD2Xlu0T7x6tXju4PSigNCGxS96WTIzf2a9firgAWivJ0pb oPTotFC5KkE97bopYmZ22j6KJqB/fHTyfnmwXvDLgykAnfDJeEfnmeTBD+iPdR06uXhn CZZEkg5zVliY4DqYAwO1D928ft/xRrIqPGGlqzU7x4+ivRZPB2JINdlmFZn/Vom360ST FufK/G2js09FEjsHEX4zxP4YPtY7IGjhh8zDfXXdKChcaao+YSEAIVMZ+2tkhxQBNW1y TlEw== X-Gm-Message-State: AIkVDXI+0EMzE4WWsvHQ3HCBt2lNW+aSBAPcNnfnKlKoKI4VcyeCB5NCnbgNb9tdUFgUtT34R4FjabtZAoSAHA== X-Received: by 10.107.23.134 with SMTP id 128mr31845801iox.162.1483105170113; Fri, 30 Dec 2016 05:39:30 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.175.133 with HTTP; Fri, 30 Dec 2016 05:39:09 -0800 (PST) In-Reply-To: <1A7F0D4F-1F4D-4885-B7E9-F764D4FA72BF@panasas.com> References: <201612292130.uBTLUqus011628@repo.freebsd.org> <1A7F0D4F-1F4D-4885-B7E9-F764D4FA72BF@panasas.com> From: Ed Maste Date: Fri, 30 Dec 2016 08:39:09 -0500 X-Google-Sender-Auth: APl1142Gifjx5M41Mh1GFn15cbY Message-ID: Subject: Re: svn commit: r310789 - head/lib/libpam/static_libpam To: Ravi Pokala Cc: Alexander Kabaev , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 13:39:32 -0000 On 29 December 2016 at 19:59, Ravi Pokala wrote: > > I'm a little confused - the original version had to have had a compile-on= ly step to generate the object first, before running the link-only operatio= n against the object. The new code replaces the link-only operation with a = compile+link operation. Shouldn't the pre-existing compile-only operation b= e removed, since the new compile+link operation supersedes it? Hi Ravi, This change: >> - ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} >> + ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.= ALLSRC} is not actually compiling, it's just invoking the compiler driver to in turn invoke the linker. The input in ${.ALLSRC} is still a collection of object files. From owner-svn-src-all@freebsd.org Fri Dec 30 14:47:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF04C97D42; Fri, 30 Dec 2016 14:47:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D60F161C; Fri, 30 Dec 2016 14:47:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUElkth034739; Fri, 30 Dec 2016 14:47:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUElkDI034738; Fri, 30 Dec 2016 14:47:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612301447.uBUElkDI034738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Dec 2016 14:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310822 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 14:47:47 -0000 Author: adrian Date: Fri Dec 30 14:47:46 2016 New Revision: 310822 URL: https://svnweb.freebsd.org/changeset/base/310822 Log: [netmap] fix locking regressions * Firmware oriented NICs may need to sleep in their configuration paths. Use RLOCK instead of WLOCK to allow this to again occur. This fixes netmap on cxgbe. * Change the worker lock to a normal mutex rather than a spin lock. Drivers shouldn't be doing netmap work from the fast interrupt handlers, so it's not required to be a spinlock. Submitted by: luigi, Vincenzo Maffione Reviewed by: jhb Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Fri Dec 30 13:04:43 2016 (r310821) +++ head/sys/dev/netmap/netmap_freebsd.c Fri Dec 30 14:47:46 2016 (r310822) @@ -92,7 +92,7 @@ nm_os_selinfo_uninit(NM_SELINFO_T *si) void nm_os_ifnet_lock(void) { - IFNET_WLOCK(); + IFNET_RLOCK(); } void @@ -1090,8 +1090,8 @@ nm_kthread_worker(void *data) continue; } else if (nmk->run) { /* wait on event with one second timeout */ - msleep_spin((void *)(uintptr_t)ctx->cfg.wchan, - &nmk->worker_lock, "nmk_ev", hz); + msleep((void *)(uintptr_t)ctx->cfg.wchan, + &nmk->worker_lock, 0, "nmk_ev", hz); nmk->scheduled++; } mtx_unlock(&nmk->worker_lock); @@ -1122,7 +1122,7 @@ nm_os_kthread_create(struct nm_kthread_c if (!nmk) return NULL; - mtx_init(&nmk->worker_lock, "nm_kthread lock", NULL, MTX_SPIN); + mtx_init(&nmk->worker_lock, "nm_kthread lock", NULL, MTX_DEF); nmk->worker_ctx.worker_fn = cfg->worker_fn; nmk->worker_ctx.worker_private = cfg->worker_private; nmk->worker_ctx.type = cfg->type; From owner-svn-src-all@freebsd.org Fri Dec 30 14:54:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD667C971D9; Fri, 30 Dec 2016 14:54:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C9561E6B; Fri, 30 Dec 2016 14:54:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUEssW1039068; Fri, 30 Dec 2016 14:54:54 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUEssCb039067; Fri, 30 Dec 2016 14:54:54 GMT (envelope-from des@FreeBSD.org) Message-Id: <201612301454.uBUEssCb039067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 30 Dec 2016 14:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310823 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 14:54:55 -0000 Author: des Date: Fri Dec 30 14:54:54 2016 New Revision: 310823 URL: https://svnweb.freebsd.org/changeset/base/310823 Log: Fix inverted loop condition which broke multi-line responses to CONNECT. PR: 194483 Submitted by: Miłosz Kaniewski MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Fri Dec 30 14:47:46 2016 (r310822) +++ head/lib/libfetch/http.c Fri Dec 30 14:54:54 2016 (r310823) @@ -1432,7 +1432,7 @@ http_connect(struct url *URL, struct url default: /* ignore */ ; } - } while (h < hdr_end); + } while (h > hdr_end); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { From owner-svn-src-all@freebsd.org Fri Dec 30 16:06:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0A15C9751B; Fri, 30 Dec 2016 16:06:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C05FB1DB7; Fri, 30 Dec 2016 16:06:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUG65Qa067227; Fri, 30 Dec 2016 16:06:05 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUG65MI067225; Fri, 30 Dec 2016 16:06:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <201612301606.uBUG65MI067225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 30 Dec 2016 16:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310824 - head/sys/dev/xdma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 16:06:07 -0000 Author: br Date: Fri Dec 30 16:06:05 2016 New Revision: 310824 URL: https://svnweb.freebsd.org/changeset/base/310824 Log: o Fix unlocking. o Fix types for ds_addr/ds_len. Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma.c head/sys/dev/xdma/xdma.h Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Fri Dec 30 14:54:54 2016 (r310823) +++ head/sys/dev/xdma/xdma.c Fri Dec 30 16:06:05 2016 (r310824) @@ -412,7 +412,7 @@ xdma_prep_memcpy(xdma_channel_t *xchan, if (ret != 0) { device_printf(xdma->dev, "%s: Can't prepare memcpy transfer.\n", __func__); - XDMA_UNLOCK(); + XCHAN_UNLOCK(xchan); return (-1); } @@ -460,7 +460,8 @@ xdma_prep_cyclic(xdma_channel_t *xchan, if (ret != 0) { device_printf(xdma->dev, "%s: Can't prepare cyclic transfer.\n", __func__); - XDMA_UNLOCK(); + XCHAN_UNLOCK(xchan); + return (-1); } Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Fri Dec 30 14:54:54 2016 (r310823) +++ head/sys/dev/xdma/xdma.h Fri Dec 30 16:06:05 2016 (r310824) @@ -77,8 +77,8 @@ struct xdma_channel_config { typedef struct xdma_channel_config xdma_config_t; struct xdma_descriptor { - uintptr_t ds_addr; - uint32_t ds_len; + bus_addr_t ds_addr; + bus_size_t ds_len; }; typedef struct xdma_descriptor xdma_descriptor_t; From owner-svn-src-all@freebsd.org Fri Dec 30 16:19:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3024CC978E4; Fri, 30 Dec 2016 16:19:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D921415C3; Fri, 30 Dec 2016 16:19:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUGJKAi071676; Fri, 30 Dec 2016 16:19:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUGJJcV071673; Fri, 30 Dec 2016 16:19:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612301619.uBUGJJcV071673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Dec 2016 16:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310825 - in stable/11/sys/boot/efi/loader/arch: amd64 arm64 i386 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 16:19:21 -0000 Author: emaste Date: Fri Dec 30 16:19:19 2016 New Revision: 310825 URL: https://svnweb.freebsd.org/changeset/base/310825 Log: MFC r305854: Use arch-specific .text padding fill value in EFI loaders The fill pattern was previously an ia64 instruction sequence. Presumably ia64's linker script was copied as a starting point. Modified: stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Dec 30 16:06:05 2016 (r310824) +++ stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Dec 30 16:19:19 2016 (r310825) @@ -19,7 +19,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) Modified: stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Dec 30 16:06:05 2016 (r310824) +++ stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Dec 30 16:19:19 2016 (r310825) @@ -15,7 +15,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xD4200000 . = ALIGN(16); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) Modified: stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Dec 30 16:06:05 2016 (r310824) +++ stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Dec 30 16:19:19 2016 (r310825) @@ -14,7 +14,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) From owner-svn-src-all@freebsd.org Fri Dec 30 16:22:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5DD9C97AF2; Fri, 30 Dec 2016 16:22:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F28D19C9; Fri, 30 Dec 2016 16:22:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUGMOLU075541; Fri, 30 Dec 2016 16:22:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUGMOCR075539; Fri, 30 Dec 2016 16:22:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612301622.uBUGMOCR075539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Dec 2016 16:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310826 - in stable/11/sys: amd64/linux compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 16:22:25 -0000 Author: emaste Date: Fri Dec 30 16:22:24 2016 New Revision: 310826 URL: https://svnweb.freebsd.org/changeset/base/310826 Log: MFC r305994: Catch up to sys/capability.h rename to sys/capsicum.h in r263232 Also include r305995, reverting an unintended change from r305994. Modified: stable/11/sys/amd64/linux/linux_machdep.c stable/11/sys/compat/linux/linux_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/11/sys/amd64/linux/linux_machdep.c Fri Dec 30 16:19:19 2016 (r310825) +++ stable/11/sys/amd64/linux/linux_machdep.c Fri Dec 30 16:22:24 2016 (r310826) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Fri Dec 30 16:19:19 2016 (r310825) +++ stable/11/sys/compat/linux/linux_event.c Fri Dec 30 16:22:24 2016 (r310826) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include From owner-svn-src-all@freebsd.org Fri Dec 30 16:23:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BEA5C97B71; Fri, 30 Dec 2016 16:23:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF0751B41; Fri, 30 Dec 2016 16:23:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUGNE2B075623; Fri, 30 Dec 2016 16:23:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUGNDVF075622; Fri, 30 Dec 2016 16:23:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612301623.uBUGNDVF075622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Dec 2016 16:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310827 - in stable/11/sys/boot/efi/loader/arch: amd64 i386 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 16:23:15 -0000 Author: emaste Date: Fri Dec 30 16:23:13 2016 New Revision: 310827 URL: https://svnweb.freebsd.org/changeset/base/310827 Log: MFC r306264: Use 32-bit value for .text padding, for linker portability GNU ld interprets the padding value as a variable-length byte string, while GNU gold and LLVM lld interpret it as a 32-bit value. Modified: stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Dec 30 16:22:24 2016 (r310826) +++ stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Dec 30 16:23:13 2016 (r310827) @@ -19,7 +19,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0xCC + } =0xCCCCCCCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) Modified: stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Dec 30 16:22:24 2016 (r310826) +++ stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Dec 30 16:23:13 2016 (r310827) @@ -14,7 +14,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0xCC + } =0xCCCCCCCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) From owner-svn-src-all@freebsd.org Fri Dec 30 16:26:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDFD3C97CBE; Fri, 30 Dec 2016 16:26:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D81E1DBC; Fri, 30 Dec 2016 16:26:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUGQsvr075790; Fri, 30 Dec 2016 16:26:54 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUGQs1w075789; Fri, 30 Dec 2016 16:26:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201612301626.uBUGQs1w075789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 30 Dec 2016 16:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310828 - head/sys/dev/xdma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 16:26:55 -0000 Author: br Date: Fri Dec 30 16:26:54 2016 New Revision: 310828 URL: https://svnweb.freebsd.org/changeset/base/310828 Log: Add parenthesis. Noticed by: hps Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma.c Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Fri Dec 30 16:23:13 2016 (r310827) +++ head/sys/dev/xdma/xdma.c Fri Dec 30 16:26:54 2016 (r310828) @@ -73,9 +73,9 @@ static struct mtx xdma_mtx; /* * Per channel locks. */ -#define XCHAN_LOCK(xchan) mtx_lock(&xchan->mtx_lock) -#define XCHAN_UNLOCK(xchan) mtx_unlock(&xchan->mtx_lock) -#define XCHAN_ASSERT_LOCKED(xchan) mtx_assert(&xchan->mtx_lock, MA_OWNED) +#define XCHAN_LOCK(xchan) mtx_lock(&(xchan)->mtx_lock) +#define XCHAN_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_lock) +#define XCHAN_ASSERT_LOCKED(xchan) mtx_assert(&(xchan)->mtx_lock, MA_OWNED) /* * Allocate virtual xDMA channel. From owner-svn-src-all@freebsd.org Fri Dec 30 17:12:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 742C2C9726D; Fri, 30 Dec 2016 17:12:42 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4402A11F5; Fri, 30 Dec 2016 17:12:42 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHCf9w097145; Fri, 30 Dec 2016 17:12:41 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHCfaW097144; Fri, 30 Dec 2016 17:12:41 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201612301712.uBUHCfaW097144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Fri, 30 Dec 2016 17:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310829 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:12:42 -0000 Author: kan Date: Fri Dec 30 17:12:41 2016 New Revision: 310829 URL: https://svnweb.freebsd.org/changeset/base/310829 Log: Restore status quo: mips64 does not need subr_sfbuf.c Reported by: br Modified: head/sys/conf/files.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Fri Dec 30 16:26:54 2016 (r310828) +++ head/sys/conf/files.mips Fri Dec 30 17:12:41 2016 (r310829) @@ -52,7 +52,8 @@ kern/kern_clocksource.c standard kern/link_elf_obj.c standard kern/subr_busdma_bufalloc.c standard kern/subr_dummy_vdso_tc.c standard -kern/subr_sfbuf.c standard +kern/subr_sfbuf.c optional mips | mipsel | mipsn32 +kern/subr_sfbuf.c optional mipshf | mipselhf # gcc/clang runtime libkern/ffsl.c standard From owner-svn-src-all@freebsd.org Fri Dec 30 17:24:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A4FCC97594; Fri, 30 Dec 2016 17:24:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA971829; Fri, 30 Dec 2016 17:24:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHOTlg001259; Fri, 30 Dec 2016 17:24:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHOT38001256; Fri, 30 Dec 2016 17:24:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301724.uBUHOT38001256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:24: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: r310830 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:24:30 -0000 Author: arybchik Date: Fri Dec 30 17:24:28 2016 New Revision: 310830 URL: https://svnweb.freebsd.org/changeset/base/310830 Log: MFC r310627 sfxge(4): do not limit driver RSS table to RSS channels max Specification of entire RSS table in the driver allows to spread traffic more equally across CPUs/RSS channels if number of RSS channels is not power of 2. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_rx.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Fri Dec 30 17:12:41 2016 (r310829) +++ stable/10/sys/dev/sfxge/sfxge.h Fri Dec 30 17:24:28 2016 (r310830) @@ -302,7 +302,7 @@ struct sfxge_softc { unsigned int max_rss_channels; uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; - unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; + unsigned int rx_indir_table[EFX_RSS_TBL_SIZE]; struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX]; Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Fri Dec 30 17:12:41 2016 (r310829) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Fri Dec 30 17:24:28 2016 (r310830) @@ -1128,10 +1128,10 @@ sfxge_rx_start(struct sfxge_softc *sc) /* * Set up the scale table. Enable all hash types and hash insertion. */ - for (index = 0; index < SFXGE_RX_SCALE_MAX; index++) + for (index = 0; index < nitems(sc->rx_indir_table); index++) sc->rx_indir_table[index] = index % sc->rxq_count; if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, - SFXGE_RX_SCALE_MAX)) != 0) + nitems(sc->rx_indir_table))) != 0) goto fail; (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) | Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 17:12:41 2016 (r310829) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 17:24:28 2016 (r310830) @@ -820,8 +820,9 @@ sfxge_if_transmit(struct ifnet *ifp, str /* check if flowid is set */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { uint32_t hash = m->m_pkthdr.flowid; + uint32_t idx = hash % nitems(sc->rx_indir_table); - index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX]; + index = sc->rx_indir_table[idx]; } #if SFXGE_TX_PARSE_EARLY if (m->m_pkthdr.csum_flags & CSUM_TSO) From owner-svn-src-all@freebsd.org Fri Dec 30 17:26:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C70B0C97655; Fri, 30 Dec 2016 17:26:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87CFC19BA; Fri, 30 Dec 2016 17:26:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHQJ4G001390; Fri, 30 Dec 2016 17:26:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHQJro001387; Fri, 30 Dec 2016 17:26:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301726.uBUHQJro001387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310831 - stable/11/sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:26:20 -0000 Author: arybchik Date: Fri Dec 30 17:26:19 2016 New Revision: 310831 URL: https://svnweb.freebsd.org/changeset/base/310831 Log: MFC r310627 sfxge(4): do not limit driver RSS table to RSS channels max Specification of entire RSS table in the driver allows to spread traffic more equally across CPUs/RSS channels if number of RSS channels is not power of 2. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/sfxge.h stable/11/sys/dev/sfxge/sfxge_rx.c stable/11/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/11/sys/dev/sfxge/sfxge.h Fri Dec 30 17:24:28 2016 (r310830) +++ stable/11/sys/dev/sfxge/sfxge.h Fri Dec 30 17:26:19 2016 (r310831) @@ -301,7 +301,7 @@ struct sfxge_softc { unsigned int max_rss_channels; uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; - unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; + unsigned int rx_indir_table[EFX_RSS_TBL_SIZE]; struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX]; Modified: stable/11/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_rx.c Fri Dec 30 17:24:28 2016 (r310830) +++ stable/11/sys/dev/sfxge/sfxge_rx.c Fri Dec 30 17:26:19 2016 (r310831) @@ -1128,7 +1128,7 @@ sfxge_rx_start(struct sfxge_softc *sc) /* * Set up the scale table. Enable all hash types and hash insertion. */ - for (index = 0; index < SFXGE_RX_SCALE_MAX; index++) + for (index = 0; index < nitems(sc->rx_indir_table); index++) #ifdef RSS sc->rx_indir_table[index] = rss_get_indirection_to_bucket(index) % sc->rxq_count; @@ -1136,7 +1136,7 @@ sfxge_rx_start(struct sfxge_softc *sc) sc->rx_indir_table[index] = index % sc->rxq_count; #endif if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, - SFXGE_RX_SCALE_MAX)) != 0) + nitems(sc->rx_indir_table))) != 0) goto fail; (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) | Modified: stable/11/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 17:24:28 2016 (r310830) +++ stable/11/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 17:26:19 2016 (r310831) @@ -838,8 +838,9 @@ sfxge_if_transmit(struct ifnet *ifp, str /* check if flowid is set */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { uint32_t hash = m->m_pkthdr.flowid; + uint32_t idx = hash % nitems(sc->rx_indir_table); - index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX]; + index = sc->rx_indir_table[idx]; } #endif #if SFXGE_TX_PARSE_EARLY From owner-svn-src-all@freebsd.org Fri Dec 30 17:35:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CF7DC978A1; Fri, 30 Dec 2016 17:35:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D00251F33; Fri, 30 Dec 2016 17:35:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHZ4PZ005606; Fri, 30 Dec 2016 17:35:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHZ4bG005605; Fri, 30 Dec 2016 17:35:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301735.uBUHZ4bG005605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:35: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: r310832 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:35:05 -0000 Author: arybchik Date: Fri Dec 30 17:35:03 2016 New Revision: 310832 URL: https://svnweb.freebsd.org/changeset/base/310832 Log: MFC r310677 sfxge(4): cleanup: fix typo in siena_mac_loopback_set() instrumentation Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/siena_mac.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mac.c Fri Dec 30 17:26:19 2016 (r310831) +++ stable/10/sys/dev/sfxge/common/siena_mac.c Fri Dec 30 17:35:03 2016 (r310832) @@ -223,7 +223,7 @@ siena_mac_loopback_set( return (0); fail1: - EFSYS_PROBE(fail2); + EFSYS_PROBE1(fail1, efx_rc_t, rc); epp->ep_loopback_type = old_loopback_type; epp->ep_loopback_link_mode = old_loopback_link_mode; From owner-svn-src-all@freebsd.org Fri Dec 30 17:36:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E36FFC97995; Fri, 30 Dec 2016 17:36:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2736118A; Fri, 30 Dec 2016 17:36:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHa8J9005799; Fri, 30 Dec 2016 17:36:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHa8dO005798; Fri, 30 Dec 2016 17:36:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301736.uBUHa8dO005798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310833 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:36:10 -0000 Author: arybchik Date: Fri Dec 30 17:36:08 2016 New Revision: 310833 URL: https://svnweb.freebsd.org/changeset/base/310833 Log: MFC r310677 sfxge(4): cleanup: fix typo in siena_mac_loopback_set() instrumentation Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/siena_mac.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_mac.c Fri Dec 30 17:35:03 2016 (r310832) +++ stable/11/sys/dev/sfxge/common/siena_mac.c Fri Dec 30 17:36:08 2016 (r310833) @@ -223,7 +223,7 @@ siena_mac_loopback_set( return (0); fail1: - EFSYS_PROBE(fail2); + EFSYS_PROBE1(fail1, efx_rc_t, rc); epp->ep_loopback_type = old_loopback_type; epp->ep_loopback_link_mode = old_loopback_link_mode; From owner-svn-src-all@freebsd.org Fri Dec 30 17:37:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF676C97A1D; Fri, 30 Dec 2016 17:37:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3A8130B; Fri, 30 Dec 2016 17:37:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHb6L7005884; Fri, 30 Dec 2016 17:37:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHb62e005883; Fri, 30 Dec 2016 17:37:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612301737.uBUHb62e005883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Dec 2016 17:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310834 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:37:07 -0000 Author: kib Date: Fri Dec 30 17:37:06 2016 New Revision: 310834 URL: https://svnweb.freebsd.org/changeset/base/310834 Log: Assert that the pages found on the object queue by vm_page_next() and vm_page_prev() have correct ownership. In collaboration with: alc Sponsored by: The FreeBSD Foundation (kib) MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Dec 30 17:36:08 2016 (r310833) +++ head/sys/vm/vm_page.c Fri Dec 30 17:37:06 2016 (r310834) @@ -1328,9 +1328,11 @@ vm_page_next(vm_page_t m) vm_page_t next; VM_OBJECT_ASSERT_LOCKED(m->object); - if ((next = TAILQ_NEXT(m, listq)) != NULL && - next->pindex != m->pindex + 1) - next = NULL; + if ((next = TAILQ_NEXT(m, listq)) != NULL) { + MPASS(next->object == m->object); + if (next->pindex != m->pindex + 1) + next = NULL; + } return (next); } @@ -1346,9 +1348,11 @@ vm_page_prev(vm_page_t m) vm_page_t prev; VM_OBJECT_ASSERT_LOCKED(m->object); - if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && - prev->pindex != m->pindex - 1) - prev = NULL; + if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL) { + MPASS(prev->object == m->object); + if (prev->pindex != m->pindex - 1) + prev = NULL; + } return (prev); } From owner-svn-src-all@freebsd.org Fri Dec 30 17:42:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9EDFC97E97; Fri, 30 Dec 2016 17:42:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98E4D1A8E; Fri, 30 Dec 2016 17:42:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHg57C009792; Fri, 30 Dec 2016 17:42:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHg555009791; Fri, 30 Dec 2016 17:42:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301742.uBUHg555009791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310835 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:42:06 -0000 Author: arybchik Date: Fri Dec 30 17:42:05 2016 New Revision: 310835 URL: https://svnweb.freebsd.org/changeset/base/310835 Log: MFC r310678 sfxge(4): cleanup: remove trailing whitespace Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_types.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_types.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_types.h Fri Dec 30 17:37:06 2016 (r310834) +++ stable/10/sys/dev/sfxge/common/efx_types.h Fri Dec 30 17:42:05 2016 (r310835) @@ -1310,7 +1310,7 @@ extern int fix_lint; /* * Set or clear a numbered bit within an octword. */ - + #define EFX_SHIFT64(_bit, _base) \ (((_bit) >= (_base) && (_bit) < (_base) + 64) ? \ ((uint64_t)1 << ((_bit) - (_base))) : \ From owner-svn-src-all@freebsd.org Fri Dec 30 17:43:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B60EEC97FA5; Fri, 30 Dec 2016 17:43:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84CEA1D3B; Fri, 30 Dec 2016 17:43:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHhlb3010037; Fri, 30 Dec 2016 17:43:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHhl5X010036; Fri, 30 Dec 2016 17:43:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301743.uBUHhl5X010036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310836 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:43:48 -0000 Author: arybchik Date: Fri Dec 30 17:43:47 2016 New Revision: 310836 URL: https://svnweb.freebsd.org/changeset/base/310836 Log: MFC r310678 sfxge(4): cleanup: remove trailing whitespace Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_types.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_types.h Fri Dec 30 17:42:05 2016 (r310835) +++ stable/11/sys/dev/sfxge/common/efx_types.h Fri Dec 30 17:43:47 2016 (r310836) @@ -1310,7 +1310,7 @@ extern int fix_lint; /* * Set or clear a numbered bit within an octword. */ - + #define EFX_SHIFT64(_bit, _base) \ (((_bit) >= (_base) && (_bit) < (_base) + 64) ? \ ((uint64_t)1 << ((_bit) - (_base))) : \ From owner-svn-src-all@freebsd.org Fri Dec 30 17:47:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5248AC97036; Fri, 30 Dec 2016 17:47:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F54A1EDD; Fri, 30 Dec 2016 17:47:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHl9Np010245; Fri, 30 Dec 2016 17:47:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHl94w010244; Fri, 30 Dec 2016 17:47:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301747.uBUHl94w010244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:47: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: r310837 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:47:10 -0000 Author: arybchik Date: Fri Dec 30 17:47:09 2016 New Revision: 310837 URL: https://svnweb.freebsd.org/changeset/base/310837 Log: MFC r310679 sfxge(4): cleanup: fix wrong indent Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Fri Dec 30 17:43:47 2016 (r310836) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Fri Dec 30 17:47:09 2016 (r310837) @@ -329,7 +329,7 @@ efx_tx_qcreate( if ((rc = etxop->etxo_qcreate(enp, index, label, esmp, n, id, flags, eep, etp, addedp)) != 0) - goto fail2; + goto fail2; enp->en_tx_qcount++; *etpp = etp; From owner-svn-src-all@freebsd.org Fri Dec 30 17:50:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEE66C971BC; Fri, 30 Dec 2016 17:50:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC50119A; Fri, 30 Dec 2016 17:50:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHo2a7010426; Fri, 30 Dec 2016 17:50:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHo2da010425; Fri, 30 Dec 2016 17:50:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301750.uBUHo2da010425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310838 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:50:03 -0000 Author: arybchik Date: Fri Dec 30 17:50:02 2016 New Revision: 310838 URL: https://svnweb.freebsd.org/changeset/base/310838 Log: MFC r310679 sfxge(4): cleanup: fix wrong indent Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_tx.c Fri Dec 30 17:47:09 2016 (r310837) +++ stable/11/sys/dev/sfxge/common/efx_tx.c Fri Dec 30 17:50:02 2016 (r310838) @@ -329,7 +329,7 @@ efx_tx_qcreate( if ((rc = etxop->etxo_qcreate(enp, index, label, esmp, n, id, flags, eep, etp, addedp)) != 0) - goto fail2; + goto fail2; enp->en_tx_qcount++; *etpp = etp; From owner-svn-src-all@freebsd.org Fri Dec 30 17:57:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BFDC974B0; Fri, 30 Dec 2016 17:57:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5594F16CC; Fri, 30 Dec 2016 17:57:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHvEBd014306; Fri, 30 Dec 2016 17:57:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHvEBn014305; Fri, 30 Dec 2016 17:57:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301757.uBUHvEBn014305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:57: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: r310839 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:57:15 -0000 Author: arybchik Date: Fri Dec 30 17:57:14 2016 New Revision: 310839 URL: https://svnweb.freebsd.org/changeset/base/310839 Log: MFC r310680 sfxge(4): cleanup: use spaces around binary arithmetic operations Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_lic.c Fri Dec 30 17:50:02 2016 (r310838) +++ stable/10/sys/dev/sfxge/common/efx_lic.c Fri Dec 30 17:57:14 2016 (r310839) @@ -456,7 +456,7 @@ fail1: * Value (V): L bytes - payload */ #define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) -#define EFX_LICENSE_V1V2_HEADER_LENGTH (2*sizeof(uint16_t)) +#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof(uint16_t)) __checkReturn efx_rc_t efx_lic_v1v2_find_start( @@ -1082,9 +1082,10 @@ efx_mcdi_licensing_v3_get_id( } else { /* Shift ID down to start of buffer */ memmove(bufferp, - bufferp+MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, - *lengthp); - memset(bufferp+(*lengthp), 0, MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); + bufferp + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, + *lengthp); + memset(bufferp + (*lengthp), 0, + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); } return (0); From owner-svn-src-all@freebsd.org Fri Dec 30 18:00:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5C0AC9759F; Fri, 30 Dec 2016 18:00:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 906D918E1; Fri, 30 Dec 2016 18:00:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUI0V5T014526; Fri, 30 Dec 2016 18:00:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUI0VlF014524; Fri, 30 Dec 2016 18:00:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612301800.uBUI0VlF014524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 30 Dec 2016 18:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310840 - in head: lib/clang/libllvm usr.bin/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:00:32 -0000 Author: dim Date: Fri Dec 30 18:00:31 2016 New Revision: 310840 URL: https://svnweb.freebsd.org/changeset/base/310840 Log: Reapply 310775, now it also builds correctly if lldb is disabled: Move llvm-objdump from CLANG_EXTRAS to installed by default We currently install three tools from binutils 2.17.50: as, ld, and objdump. Work is underway to migrate to a permissively-licensed tool-chain, with one goal being the retirement of binutils 2.17.50. LLVM's llvm-objdump is intended to be compatible with GNU objdump although it is currently missing some options and may have formatting differences. Enable it by default for testing and further investigation. It may later be changed to install as /usr/bin/objdump, it becomes a fully viable replacement. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D8879 Modified: head/lib/clang/libllvm/Makefile head/usr.bin/clang/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Fri Dec 30 17:57:14 2016 (r310839) +++ head/lib/clang/libllvm/Makefile Fri Dec 30 18:00:31 2016 (r310840) @@ -308,24 +308,24 @@ SRCS_MIN+= DebugInfo/CodeView/TypeRecord SRCS_MIN+= DebugInfo/CodeView/TypeRecordBuilder.cpp SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp SRCS_MIN+= DebugInfo/CodeView/TypeTableBuilder.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFCompileUnit.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFContext.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugAranges.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugFrame.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLine.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugLoc.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugMacro.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFDebugRangeList.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFFormValue.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFTypeUnit.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFUnit.cpp -SRCS_EXT+= DebugInfo/DWARF/DWARFUnitIndex.cpp -SRCS_EXT+= DebugInfo/DWARF/SyntaxHighlighting.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp +SRCS_MIW+= DebugInfo/DWARF/SyntaxHighlighting.cpp SRCS_EXT+= DebugInfo/PDB/GenericError.cpp SRCS_EXT+= DebugInfo/PDB/PDB.cpp SRCS_EXT+= DebugInfo/PDB/PDBContext.cpp @@ -484,10 +484,10 @@ SRCS_MIN+= MC/MCCodeEmitter.cpp SRCS_MIN+= MC/MCCodeView.cpp SRCS_MIN+= MC/MCContext.cpp SRCS_XDL+= MC/MCDisassembler/Disassembler.cpp -SRCS_XDB+= MC/MCDisassembler/MCDisassembler.cpp -SRCS_XDB+= MC/MCDisassembler/MCExternalSymbolizer.cpp +SRCS_XDW+= MC/MCDisassembler/MCDisassembler.cpp +SRCS_XDW+= MC/MCDisassembler/MCExternalSymbolizer.cpp SRCS_MIN+= MC/MCDisassembler/MCRelocationInfo.cpp -SRCS_XDB+= MC/MCDisassembler/MCSymbolizer.cpp +SRCS_XDW+= MC/MCDisassembler/MCSymbolizer.cpp SRCS_MIN+= MC/MCDwarf.cpp SRCS_MIN+= MC/MCELFObjectTargetWriter.cpp SRCS_MIN+= MC/MCELFStreamer.cpp @@ -698,8 +698,8 @@ SRCS_MIN+= Target/AArch64/AArch64TargetM SRCS_MIN+= Target/AArch64/AArch64TargetObjectFile.cpp SRCS_MIN+= Target/AArch64/AArch64TargetTransformInfo.cpp SRCS_MIN+= Target/AArch64/AsmParser/AArch64AsmParser.cpp -SRCS_XDB+= Target/AArch64/Disassembler/AArch64Disassembler.cpp -SRCS_XDB+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp +SRCS_XDW+= Target/AArch64/Disassembler/AArch64Disassembler.cpp +SRCS_XDW+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp SRCS_MIN+= Target/AArch64/InstPrinter/AArch64InstPrinter.cpp SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp @@ -760,7 +760,7 @@ SRCS_MIN+= Target/ARM/Thumb2InstrInfo.cp SRCS_MIN+= Target/ARM/Thumb2SizeReduction.cpp SRCS_MIN+= Target/ARM/ThumbRegisterInfo.cpp SRCS_MIN+= Target/Mips/AsmParser/MipsAsmParser.cpp -SRCS_XDB+= Target/Mips/Disassembler/MipsDisassembler.cpp +SRCS_XDW+= Target/Mips/Disassembler/MipsDisassembler.cpp SRCS_MIN+= Target/Mips/InstPrinter/MipsInstPrinter.cpp SRCS_MIN+= Target/Mips/MCTargetDesc/MipsABIFlagsSection.cpp SRCS_MIN+= Target/Mips/MCTargetDesc/MipsABIInfo.cpp @@ -849,7 +849,7 @@ SRCS_MIN+= Target/PowerPC/PPCVSXSwapRemo SRCS_MIN+= Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp SRCS_MIN+= Target/Sparc/AsmParser/SparcAsmParser.cpp SRCS_MIN+= Target/Sparc/DelaySlotFiller.cpp -SRCS_XDB+= Target/Sparc/Disassembler/SparcDisassembler.cpp +SRCS_XDW+= Target/Sparc/Disassembler/SparcDisassembler.cpp SRCS_MIN+= Target/Sparc/InstPrinter/SparcInstPrinter.cpp SRCS_MIN+= Target/Sparc/LeonPasses.cpp SRCS_MIN+= Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp @@ -879,8 +879,8 @@ SRCS_MIN+= Target/TargetRecip.cpp SRCS_MIN+= Target/TargetSubtargetInfo.cpp SRCS_MIN+= Target/X86/AsmParser/X86AsmInstrumentation.cpp SRCS_MIN+= Target/X86/AsmParser/X86AsmParser.cpp -SRCS_XDB+= Target/X86/Disassembler/X86Disassembler.cpp -SRCS_XDB+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp +SRCS_XDW+= Target/X86/Disassembler/X86Disassembler.cpp +SRCS_XDW+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp SRCS_MIN+= Target/X86/InstPrinter/X86ATTInstPrinter.cpp SRCS_MIN+= Target/X86/InstPrinter/X86InstComments.cpp SRCS_MIN+= Target/X86/InstPrinter/X86IntelInstPrinter.cpp @@ -1090,6 +1090,9 @@ SRCS_MIN+= Transforms/Vectorize/SLPVecto SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp SRCS_ALL+= ${SRCS_MIN} +.if !defined(TOOLS_PREFIX) +SRCS_ALL+= ${SRCS_MIW} +.endif .if ${MK_CLANG_EXTRAS} != "no" SRCS_ALL+= ${SRCS_EXT} .endif @@ -1105,6 +1108,9 @@ SRCS_ALL+= ${SRCS_XDB} .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no" SRCS_ALL+= ${SRCS_XDL} .endif +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || !defined(TOOLS_PREFIX) +SRCS_ALL+= ${SRCS_XDW} +.endif SRCS+= ${SRCS_ALL:O} llvm/IR/Attributes.inc: ${LLVM_SRCS}/include/llvm/IR/Attributes.td Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Fri Dec 30 17:57:14 2016 (r310839) +++ head/usr.bin/clang/Makefile Fri Dec 30 18:00:31 2016 (r310840) @@ -7,6 +7,8 @@ SUBDIR+= clang-tblgen SUBDIR+= llvm-tblgen .if !defined(TOOLS_PREFIX) +SUBDIR+= llvm-objdump + .if ${MK_CLANG_EXTRAS} != "no" SUBDIR+= bugpoint SUBDIR+= clang-format @@ -25,7 +27,6 @@ SUBDIR+= llvm-link SUBDIR+= llvm-lto SUBDIR+= llvm-mc SUBDIR+= llvm-nm -SUBDIR+= llvm-objdump SUBDIR+= llvm-pdbdump SUBDIR+= llvm-profdata SUBDIR+= llvm-rtdyld From owner-svn-src-all@freebsd.org Fri Dec 30 18:01:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A269C975FF; Fri, 30 Dec 2016 18:01:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 260CB1ABC; Fri, 30 Dec 2016 18:01:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUI14wt015320; Fri, 30 Dec 2016 18:01:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUI14H8015319; Fri, 30 Dec 2016 18:01:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301801.uBUI14H8015319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 18:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310841 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:01:05 -0000 Author: arybchik Date: Fri Dec 30 18:01:04 2016 New Revision: 310841 URL: https://svnweb.freebsd.org/changeset/base/310841 Log: MFC r310680 sfxge(4): cleanup: use spaces around binary arithmetic operations Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_lic.c Fri Dec 30 18:00:31 2016 (r310840) +++ stable/11/sys/dev/sfxge/common/efx_lic.c Fri Dec 30 18:01:04 2016 (r310841) @@ -456,7 +456,7 @@ fail1: * Value (V): L bytes - payload */ #define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) -#define EFX_LICENSE_V1V2_HEADER_LENGTH (2*sizeof(uint16_t)) +#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof(uint16_t)) __checkReturn efx_rc_t efx_lic_v1v2_find_start( @@ -1082,9 +1082,10 @@ efx_mcdi_licensing_v3_get_id( } else { /* Shift ID down to start of buffer */ memmove(bufferp, - bufferp+MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, - *lengthp); - memset(bufferp+(*lengthp), 0, MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); + bufferp + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, + *lengthp); + memset(bufferp + (*lengthp), 0, + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); } return (0); From owner-svn-src-all@freebsd.org Fri Dec 30 18:02:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5595EC97699; Fri, 30 Dec 2016 18:02:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 247111E23; Fri, 30 Dec 2016 18:02:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUI2CtN018355; Fri, 30 Dec 2016 18:02:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUI2CaQ018353; Fri, 30 Dec 2016 18:02:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301802.uBUI2CaQ018353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 18:02: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: r310842 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:02:13 -0000 Author: arybchik Date: Fri Dec 30 18:02:12 2016 New Revision: 310842 URL: https://svnweb.freebsd.org/changeset/base/310842 Log: MFC r310681 sfxge(4): cleanup: remove unnecessary spaces Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 18:01:04 2016 (r310841) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Fri Dec 30 18:02:12 2016 (r310842) @@ -564,7 +564,7 @@ typedef struct efx_lic_ops_s { efx_rc_t (*elo_find_start) (efx_nic_t *, caddr_t, size_t, uint32_t *); efx_rc_t (*elo_find_end)(efx_nic_t *, caddr_t, size_t, - uint32_t , uint32_t *); + uint32_t, uint32_t *); boolean_t (*elo_find_key)(efx_nic_t *, caddr_t, size_t, uint32_t, uint32_t *, uint32_t *); boolean_t (*elo_validate_key)(efx_nic_t *, Modified: stable/10/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_lic.c Fri Dec 30 18:01:04 2016 (r310841) +++ stable/10/sys/dev/sfxge/common/efx_lic.c Fri Dec 30 18:02:12 2016 (r310842) @@ -627,7 +627,7 @@ efx_lic_v1v2_write_key( // Ensure space for terminator remains if ((offset + length) > - (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) { + (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH)) { rc = ENOSPC; goto fail1; } From owner-svn-src-all@freebsd.org Fri Dec 30 18:14:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B18C97D27; Fri, 30 Dec 2016 18:14:32 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8DA415FA; Fri, 30 Dec 2016 18:14:31 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUIEVO1022589; Fri, 30 Dec 2016 18:14:31 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUIEUQ5022584; Fri, 30 Dec 2016 18:14:30 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201612301814.uBUIEUQ5022584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 30 Dec 2016 18:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310843 - in vendor-sys/ck/dist: include include/gcc include/gcc/aarch64 include/gcc/arm include/gcc/ppc64 include/gcc/x86_64 src X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:14:32 -0000 Author: cognet Date: Fri Dec 30 18:14:30 2016 New Revision: 310843 URL: https://svnweb.freebsd.org/changeset/base/310843 Log: Import CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mainly to add the option to disable double-related functions, as we don't want them in the kernel. Added: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h (contents, props changed) vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h (contents, props changed) Deleted: vendor-sys/ck/dist/src/Makefile.in Modified: vendor-sys/ck/dist/include/ck_pr.h vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h vendor-sys/ck/dist/include/gcc/arm/ck_pr.h vendor-sys/ck/dist/include/gcc/ck_pr.h vendor-sys/ck/dist/include/gcc/ppc64/ck_pr.h vendor-sys/ck/dist/include/gcc/x86_64/ck_pr.h Modified: vendor-sys/ck/dist/include/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/ck_pr.h Fri Dec 30 18:02:12 2016 (r310842) +++ vendor-sys/ck/dist/include/ck_pr.h Fri Dec 30 18:14:30 2016 (r310843) @@ -169,7 +169,9 @@ ck_pr_rfo(const void *m) #define ck_pr_store_ptr(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), ptr) #define ck_pr_store_char(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), char) +#ifndef CK_PR_DISABLE_DOUBLE #define ck_pr_store_double(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), double) +#endif #define ck_pr_store_uint(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), uint) #define ck_pr_store_int(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), int) #define ck_pr_store_32(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), 32) @@ -187,7 +189,9 @@ ck_pr_rfo(const void *m) #define CK_PR_LOAD_SAFE(SRC, TYPE) ck_pr_md_load_##TYPE((SRC)) #define ck_pr_load_char(SRC) CK_PR_LOAD_SAFE((SRC), char) +#ifndef CK_PR_DISABLE_DOUBLE #define ck_pr_load_double(SRC) CK_PR_LOAD_SAFE((SRC), double) +#endif #define ck_pr_load_uint(SRC) CK_PR_LOAD_SAFE((SRC), uint) #define ck_pr_load_int(SRC) CK_PR_LOAD_SAFE((SRC), int) #define ck_pr_load_32(SRC) CK_PR_LOAD_SAFE((SRC), 32) @@ -275,7 +279,8 @@ CK_PR_BIN_S(or, int, int, |) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_ADD_DOUBLE #define CK_F_PR_ADD_DOUBLE @@ -287,7 +292,7 @@ CK_PR_BIN_S(add, double, double, +) CK_PR_BIN_S(sub, double, double, -) #endif /* CK_F_PR_SUB_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -675,7 +680,8 @@ CK_PR_UNARY_Z_S(dec, int, int, -, 1) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_INC_DOUBLE #define CK_F_PR_INC_DOUBLE @@ -687,7 +693,7 @@ CK_PR_UNARY_S(inc, add, double, double) CK_PR_UNARY_S(dec, sub, double, double) #endif /* CK_F_PR_DEC_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -914,14 +920,15 @@ CK_PR_N_Z_S(int, int) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_NEG_DOUBLE #define CK_F_PR_NEG_DOUBLE CK_PR_N_S(neg, double, double, -) #endif /* CK_F_PR_NEG_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -1105,7 +1112,8 @@ CK_PR_FAS_S(int, int) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_FAA_DOUBLE #define CK_F_PR_FAA_DOUBLE @@ -1117,7 +1125,7 @@ CK_PR_FAA_S(double, double) CK_PR_FAS_S(double, double) #endif /* CK_F_PR_FAS_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) Modified: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h Fri Dec 30 18:02:12 2016 (r310842) +++ vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h Fri Dec 30 18:14:30 2016 (r310843) @@ -124,7 +124,9 @@ CK_PR_LOAD_S(uint, unsigned int, "ldr") CK_PR_LOAD_S(int, int, "ldr") CK_PR_LOAD_S(short, short, "ldrh") CK_PR_LOAD_S(char, char, "ldrb") +#ifndef CK_PR_DISABLE_DOUBLE CK_PR_LOAD_S_64(double, double, "ldr") +#endif #undef CK_PR_LOAD_S #undef CK_PR_LOAD_S_64 @@ -167,326 +169,59 @@ CK_PR_STORE_S(uint, unsigned int, "str") CK_PR_STORE_S(int, int, "str") CK_PR_STORE_S(short, short, "strh") CK_PR_STORE_S(char, char, "strb") +#ifndef CK_PR_DISABLE_DOUBLE CK_PR_STORE_S_64(double, double, "str") +#endif #undef CK_PR_STORE_S #undef CK_PR_STORE_S_64 #undef CK_PR_STORE #undef CK_PR_STORE_64 -CK_CC_INLINE static bool -ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) -{ - uint64_t tmp1, tmp2; - __asm__ __volatile__("1:" - "ldxp %0, %1, [%4];" - "mov %2, %0;" - "mov %3, %1;" - "eor %0, %0, %5;" - "eor %1, %1, %6;" - "orr %1, %0, %1;" - "mov %w0, #0;" - "cbnz %1, 2f;" - "stxp %w0, %7, %8, [%4];" - "cbnz %w0, 1b;" - "mov %w0, #1;" - "2:" - : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1]) - : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1])); - - return (tmp1); -} - -CK_CC_INLINE static bool -ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) -{ - return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), - CK_CPP_CAST(uint64_t *, compare), - CK_CPP_CAST(uint64_t *, set), - CK_CPP_CAST(uint64_t *, value))); -} - -CK_CC_INLINE static bool -ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) -{ - uint64_t tmp1, tmp2; - __asm__ __volatile__("1:" - "ldxp %0, %1, [%2];" - "eor %0, %0, %3;" - "eor %1, %1, %4;" - "orr %1, %0, %1;" - "mov %w0, #0;" - "cbnz %1, 2f;" - "stxp %w0, %5, %6, [%2];" - "cbnz %w0, 1b;" - "mov %w0, #1;" - "2:" - : "=&r" (tmp1), "=&r" (tmp2) - : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1])); - - return (tmp1); -} -CK_CC_INLINE static bool -ck_pr_cas_ptr_2(void *target, void *compare, void *set) -{ - return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), - CK_CPP_CAST(uint64_t *, compare), - CK_CPP_CAST(uint64_t *, set))); -} - - -#define CK_PR_CAS(N, M, T, W, R) \ - CK_CC_INLINE static bool \ - ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - "cmp %" R "0, %" R "4;" \ - "b.ne 2f;" \ - "stxr" W " %w1, %" R "3, [%2];" \ - "cbnz %w1, 1b;" \ - "2:" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (set), \ - "r" (compare) \ - : "memory", "cc"); \ - *(T *)value = previous; \ - return (previous == compare); \ - } \ - CK_CC_INLINE static bool \ - ck_pr_cas_##N(M *target, T compare, T set) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__( \ - "1:" \ - "ldxr" W " %" R "0, [%2];" \ - "cmp %" R "0, %" R "4;" \ - "b.ne 2f;" \ - "stxr" W " %w1, %" R "3, [%2];" \ - "cbnz %w1, 1b;" \ - "2:" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (set), \ - "r" (compare) \ - : "memory", "cc"); \ - return (previous == compare); \ - } - -CK_PR_CAS(ptr, void, void *, "", "") - -#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) -CK_PR_CAS_S(64, uint64_t, "", "") -CK_PR_CAS_S(double, double, "", "") -CK_PR_CAS_S(32, uint32_t, "", "w") -CK_PR_CAS_S(uint, unsigned int, "", "w") -CK_PR_CAS_S(int, int, "", "w") -CK_PR_CAS_S(16, uint16_t, "h", "w") -CK_PR_CAS_S(8, uint8_t, "b", "w") -CK_PR_CAS_S(short, short, "h", "w") -CK_PR_CAS_S(char, char, "b", "w") - - -#undef CK_PR_CAS_S -#undef CK_PR_CAS - -#define CK_PR_FAS(N, M, T, W, R) \ - CK_CC_INLINE static T \ - ck_pr_fas_##N(M *target, T v) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - "stxr" W " %w1, %" R "3, [%2];"\ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (v) \ - : "memory", "cc"); \ - return (previous); \ - } - -CK_PR_FAS(64, uint64_t, uint64_t, "", "") -CK_PR_FAS(32, uint32_t, uint32_t, "", "w") -CK_PR_FAS(ptr, void, void *, "", "") -CK_PR_FAS(int, int, int, "", "w") -CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") -CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") -CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") -CK_PR_FAS(short, short, short, "h", "w") -CK_PR_FAS(char, char, char, "b", "w") - - -#undef CK_PR_FAS - -#define CK_PR_UNARY(O, N, M, T, I, W, R) \ - CK_CC_INLINE static void \ - ck_pr_##O##_##N(M *target) \ - { \ - T previous = 0; \ - T tmp = 0; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - I ";" \ - "stxr" W " %w1, %" R "0, [%2];" \ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target) \ - : "memory", "cc"); \ - return; \ - } - -CK_PR_UNARY(inc, ptr, void, void *, "add %0, %0, #1", "", "") -CK_PR_UNARY(dec, ptr, void, void *, "sub %0, %0, #1", "", "") -CK_PR_UNARY(not, ptr, void, void *, "mvn %0, %0", "", "") -CK_PR_UNARY(neg, ptr, void, void *, "neg %0, %0", "", "") -CK_PR_UNARY(inc, 64, uint64_t, uint64_t, "add %0, %0, #1", "", "") -CK_PR_UNARY(dec, 64, uint64_t, uint64_t, "sub %0, %0, #1", "", "") -CK_PR_UNARY(not, 64, uint64_t, uint64_t, "mvn %0, %0", "", "") -CK_PR_UNARY(neg, 64, uint64_t, uint64_t, "neg %0, %0", "", "") - -#define CK_PR_UNARY_S(S, T, W) \ - CK_PR_UNARY(inc, S, T, T, "add %w0, %w0, #1", W, "w") \ - CK_PR_UNARY(dec, S, T, T, "sub %w0, %w0, #1", W, "w") \ - CK_PR_UNARY(not, S, T, T, "mvn %w0, %w0", W, "w") \ - CK_PR_UNARY(neg, S, T, T, "neg %w0, %w0", W, "w") \ - -CK_PR_UNARY_S(32, uint32_t, "") -CK_PR_UNARY_S(uint, unsigned int, "") -CK_PR_UNARY_S(int, int, "") -CK_PR_UNARY_S(16, uint16_t, "h") -CK_PR_UNARY_S(8, uint8_t, "b") -CK_PR_UNARY_S(short, short, "h") -CK_PR_UNARY_S(char, char, "b") - -#undef CK_PR_UNARY_S -#undef CK_PR_UNARY - -#define CK_PR_BINARY(O, N, M, T, I, W, R) \ - CK_CC_INLINE static void \ - ck_pr_##O##_##N(M *target, T delta) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];"\ - I " %" R "0, %" R "0, %" R "3;" \ - "stxr" W " %w1, %" R "0, [%2];" \ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (delta) \ - : "memory", "cc"); \ - return; \ - } - -CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "", "") -CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "", "") -CK_PR_BINARY(or, ptr, void, uintptr_t, "orr", "", "") -CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "", "") -CK_PR_BINARY(xor, ptr, void, uintptr_t, "eor", "", "") -CK_PR_BINARY(and, 64, uint64_t, uint64_t, "and", "", "") -CK_PR_BINARY(add, 64, uint64_t, uint64_t, "add", "", "") -CK_PR_BINARY(or, 64, uint64_t, uint64_t, "orr", "", "") -CK_PR_BINARY(sub, 64, uint64_t, uint64_t, "sub", "", "") -CK_PR_BINARY(xor, 64, uint64_t, uint64_t, "eor", "", "") - -#define CK_PR_BINARY_S(S, T, W) \ - CK_PR_BINARY(and, S, T, T, "and", W, "w") \ - CK_PR_BINARY(add, S, T, T, "add", W, "w") \ - CK_PR_BINARY(or, S, T, T, "orr", W, "w") \ - CK_PR_BINARY(sub, S, T, T, "sub", W, "w") \ - CK_PR_BINARY(xor, S, T, T, "eor", W, "w") - -CK_PR_BINARY_S(32, uint32_t, "") -CK_PR_BINARY_S(uint, unsigned int, "") -CK_PR_BINARY_S(int, int, "") -CK_PR_BINARY_S(16, uint16_t, "h") -CK_PR_BINARY_S(8, uint8_t, "b") -CK_PR_BINARY_S(short, short, "h") -CK_PR_BINARY_S(char, char, "b") - -#undef CK_PR_BINARY_S -#undef CK_PR_BINARY - -CK_CC_INLINE static void * -ck_pr_faa_ptr(void *target, uintptr_t delta) -{ - uintptr_t previous, r, tmp; - - __asm__ __volatile__("1:" - "ldxr %0, [%3];" - "add %1, %4, %0;" - "stxr %w2, %1, [%3];" - "cbnz %w2, 1b;" - : "=&r" (previous), - "=&r" (r), - "=&r" (tmp) - : "r" (target), - "r" (delta) - : "memory", "cc"); - - return (void *)(previous); -} - -CK_CC_INLINE static uint64_t -ck_pr_faa_64(uint64_t *target, uint64_t delta) -{ - uint64_t previous, r, tmp; - - __asm__ __volatile__("1:" - "ldxr %0, [%3];" - "add %1, %4, %0;" - "stxr %w2, %1, [%3];" - "cbnz %w2, 1b;" - : "=&r" (previous), - "=&r" (r), - "=&r" (tmp) - : "r" (target), - "r" (delta) - : "memory", "cc"); - - return (previous); -} - -#define CK_PR_FAA(S, T, W) \ - CK_CC_INLINE static T \ - ck_pr_faa_##S(T *target, T delta) \ - { \ - T previous, r, tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %w0, [%3];" \ - "add %w1, %w4, %w0;" \ - "stxr" W " %w2, %w1, [%3];" \ - "cbnz %w2, 1b;" \ - : "=&r" (previous), \ - "=&r" (r), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (delta) \ - : "memory", "cc"); \ - return (previous); \ - } - -CK_PR_FAA(32, uint32_t, "") -CK_PR_FAA(uint, unsigned int, "") -CK_PR_FAA(int, int, "") -CK_PR_FAA(16, uint16_t, "h") -CK_PR_FAA(8, uint8_t, "b") -CK_PR_FAA(short, short, "h") -CK_PR_FAA(char, char, "b") +#ifdef CK_MD_LSE_ENABLE +#include "ck_pr_lse.h" +#else +#include "ck_pr_llsc.h" +#endif + +/* + * ck_pr_neg_*() functions can only be implemented via LL/SC, as there are no + * LSE alternatives. + */ +#define CK_PR_NEG(N, M, T, W, R) \ + CK_CC_INLINE static void \ + ck_pr_neg_##N(M *target) \ + { \ + T previous = 0; \ + T tmp = 0; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "neg %" R "0, %" R "0;" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_NEG(ptr, void, void *, "", "") +CK_PR_NEG(64, uint64_t, uint64_t, "", "") + +#define CK_PR_NEG_S(S, T, W) \ + CK_PR_NEG(S, T, T, W, "w") \ + +CK_PR_NEG_S(32, uint32_t, "") +CK_PR_NEG_S(uint, unsigned int, "") +CK_PR_NEG_S(int, int, "") +CK_PR_NEG_S(16, uint16_t, "h") +CK_PR_NEG_S(8, uint8_t, "b") +CK_PR_NEG_S(short, short, "h") +CK_PR_NEG_S(char, char, "b") -#undef CK_PR_FAA +#undef CK_PR_NEG_S +#undef CK_PR_NEG #endif /* CK_PR_AARCH64_H */ Added: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h Fri Dec 30 18:14:30 2016 (r310843) @@ -0,0 +1,352 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2013-2016 Olivier Houchard. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef CK_PR_AARCH64_LLSC_H +#define CK_PR_AARCH64_LLSC_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +CK_CC_INLINE static bool +ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) +{ + uint64_t tmp1, tmp2; + + __asm__ __volatile__("1:" + "ldxp %0, %1, [%4];" + "mov %2, %0;" + "mov %3, %1;" + "eor %0, %0, %5;" + "eor %1, %1, %6;" + "orr %1, %0, %1;" + "mov %w0, #0;" + "cbnz %1, 2f;" + "stxp %w0, %7, %8, [%4];" + "cbnz %w0, 1b;" + "mov %w0, #1;" + "2:" + : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1]) + : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1]) + : "cc", "memory"); + + return (tmp1); +} + +CK_CC_INLINE static bool +ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) +{ + return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set), + CK_CPP_CAST(uint64_t *, value))); +} + +CK_CC_INLINE static bool +ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) +{ + uint64_t tmp1, tmp2; + + __asm__ __volatile__("1:" + "ldxp %0, %1, [%2];" + "eor %0, %0, %3;" + "eor %1, %1, %4;" + "orr %1, %0, %1;" + "mov %w0, #0;" + "cbnz %1, 2f;" + "stxp %w0, %5, %6, [%2];" + "cbnz %w0, 1b;" + "mov %w0, #1;" + "2:" + : "=&r" (tmp1), "=&r" (tmp2) + : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1]) + : "cc", "memory"); + + return (tmp1); +} +CK_CC_INLINE static bool +ck_pr_cas_ptr_2(void *target, void *compare, void *set) +{ + return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set))); +} + + +#define CK_PR_CAS(N, M, T, W, R) \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "cmp %" R "0, %" R "4;" \ + "b.ne 2f;" \ + "stxr" W " %w1, %" R "3, [%2];" \ + "cbnz %w1, 1b;" \ + "2:" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (set), \ + "r" (compare) \ + : "memory", "cc"); \ + *(T *)value = previous; \ + return (previous == compare); \ + } \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N(M *target, T compare, T set) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__( \ + "1:" \ + "ldxr" W " %" R "0, [%2];" \ + "cmp %" R "0, %" R "4;" \ + "b.ne 2f;" \ + "stxr" W " %w1, %" R "3, [%2];" \ + "cbnz %w1, 1b;" \ + "2:" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (set), \ + "r" (compare) \ + : "memory", "cc"); \ + return (previous == compare); \ + } + +CK_PR_CAS(ptr, void, void *, "", "") + +#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) +CK_PR_CAS_S(64, uint64_t, "", "") +#ifndef CK_PR_DISABLE_DOUBLE +CK_PR_CAS_S(double, double, "", "") +#endif +CK_PR_CAS_S(32, uint32_t, "", "w") +CK_PR_CAS_S(uint, unsigned int, "", "w") +CK_PR_CAS_S(int, int, "", "w") +CK_PR_CAS_S(16, uint16_t, "h", "w") +CK_PR_CAS_S(8, uint8_t, "b", "w") +CK_PR_CAS_S(short, short, "h", "w") +CK_PR_CAS_S(char, char, "b", "w") + + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W, R) \ + CK_CC_INLINE static T \ + ck_pr_fas_##N(M *target, T v) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "stxr" W " %w1, %" R "3, [%2];"\ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (v) \ + : "memory", "cc"); \ + return (previous); \ + } + +CK_PR_FAS(64, uint64_t, uint64_t, "", "") +CK_PR_FAS(32, uint32_t, uint32_t, "", "w") +CK_PR_FAS(ptr, void, void *, "", "") +CK_PR_FAS(int, int, int, "", "w") +CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") +CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") +CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") +CK_PR_FAS(short, short, short, "h", "w") +CK_PR_FAS(char, char, char, "b", "w") + + +#undef CK_PR_FAS + +#define CK_PR_UNARY(O, N, M, T, I, W, R) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target) \ + { \ + T previous = 0; \ + T tmp = 0; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + I ";" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_UNARY(inc, ptr, void, void *, "add %0, %0, #1", "", "") +CK_PR_UNARY(dec, ptr, void, void *, "sub %0, %0, #1", "", "") +CK_PR_UNARY(not, ptr, void, void *, "mvn %0, %0", "", "") +CK_PR_UNARY(inc, 64, uint64_t, uint64_t, "add %0, %0, #1", "", "") +CK_PR_UNARY(dec, 64, uint64_t, uint64_t, "sub %0, %0, #1", "", "") +CK_PR_UNARY(not, 64, uint64_t, uint64_t, "mvn %0, %0", "", "") + +#define CK_PR_UNARY_S(S, T, W) \ + CK_PR_UNARY(inc, S, T, T, "add %w0, %w0, #1", W, "w") \ + CK_PR_UNARY(dec, S, T, T, "sub %w0, %w0, #1", W, "w") \ + CK_PR_UNARY(not, S, T, T, "mvn %w0, %w0", W, "w") \ + +CK_PR_UNARY_S(32, uint32_t, "") +CK_PR_UNARY_S(uint, unsigned int, "") +CK_PR_UNARY_S(int, int, "") +CK_PR_UNARY_S(16, uint16_t, "h") +CK_PR_UNARY_S(8, uint8_t, "b") +CK_PR_UNARY_S(short, short, "h") +CK_PR_UNARY_S(char, char, "b") + +#undef CK_PR_UNARY_S +#undef CK_PR_UNARY + +#define CK_PR_BINARY(O, N, M, T, I, W, R) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target, T delta) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];"\ + I " %" R "0, %" R "0, %" R "3;" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (delta) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "", "") +CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "", "") +CK_PR_BINARY(or, ptr, void, uintptr_t, "orr", "", "") +CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "", "") +CK_PR_BINARY(xor, ptr, void, uintptr_t, "eor", "", "") +CK_PR_BINARY(and, 64, uint64_t, uint64_t, "and", "", "") +CK_PR_BINARY(add, 64, uint64_t, uint64_t, "add", "", "") +CK_PR_BINARY(or, 64, uint64_t, uint64_t, "orr", "", "") +CK_PR_BINARY(sub, 64, uint64_t, uint64_t, "sub", "", "") +CK_PR_BINARY(xor, 64, uint64_t, uint64_t, "eor", "", "") + +#define CK_PR_BINARY_S(S, T, W) \ + CK_PR_BINARY(and, S, T, T, "and", W, "w") \ + CK_PR_BINARY(add, S, T, T, "add", W, "w") \ + CK_PR_BINARY(or, S, T, T, "orr", W, "w") \ + CK_PR_BINARY(sub, S, T, T, "sub", W, "w") \ + CK_PR_BINARY(xor, S, T, T, "eor", W, "w") + +CK_PR_BINARY_S(32, uint32_t, "") +CK_PR_BINARY_S(uint, unsigned int, "") +CK_PR_BINARY_S(int, int, "") +CK_PR_BINARY_S(16, uint16_t, "h") +CK_PR_BINARY_S(8, uint8_t, "b") +CK_PR_BINARY_S(short, short, "h") +CK_PR_BINARY_S(char, char, "b") + +#undef CK_PR_BINARY_S +#undef CK_PR_BINARY + +CK_CC_INLINE static void * +ck_pr_faa_ptr(void *target, uintptr_t delta) +{ + uintptr_t previous, r, tmp; + + __asm__ __volatile__("1:" + "ldxr %0, [%3];" + "add %1, %4, %0;" + "stxr %w2, %1, [%3];" + "cbnz %w2, 1b;" + : "=&r" (previous), + "=&r" (r), + "=&r" (tmp) + : "r" (target), + "r" (delta) + : "memory", "cc"); + + return (void *)(previous); +} + +CK_CC_INLINE static uint64_t +ck_pr_faa_64(uint64_t *target, uint64_t delta) +{ + uint64_t previous, r, tmp; + + __asm__ __volatile__("1:" + "ldxr %0, [%3];" + "add %1, %4, %0;" + "stxr %w2, %1, [%3];" + "cbnz %w2, 1b;" + : "=&r" (previous), + "=&r" (r), + "=&r" (tmp) + : "r" (target), + "r" (delta) + : "memory", "cc"); + + return (previous); +} + +#define CK_PR_FAA(S, T, W) \ + CK_CC_INLINE static T \ + ck_pr_faa_##S(T *target, T delta) \ + { \ + T previous, r, tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %w0, [%3];" \ + "add %w1, %w4, %w0;" \ + "stxr" W " %w2, %w1, [%3];" \ + "cbnz %w2, 1b;" \ + : "=&r" (previous), \ + "=&r" (r), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (delta) \ + : "memory", "cc"); \ + return (previous); \ + } + +CK_PR_FAA(32, uint32_t, "") +CK_PR_FAA(uint, unsigned int, "") +CK_PR_FAA(int, int, "") +CK_PR_FAA(16, uint16_t, "h") +CK_PR_FAA(8, uint8_t, "b") +CK_PR_FAA(short, short, "h") +CK_PR_FAA(char, char, "b") + +#undef CK_PR_FAA + +#endif /* CK_PR_AARCH64_LLSC_H */ Added: vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h Fri Dec 30 18:14:30 2016 (r310843) @@ -0,0 +1,298 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2013-2016 Olivier Houchard. + * Copyright 2016 Alexey Kopytov. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef CK_PR_AARCH64_LSE_H +#define CK_PR_AARCH64_LSE_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +CK_CC_INLINE static bool +ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) +{ + uint64_t tmp1; + uint64_t tmp2; + register uint64_t x0 __asm__ ("x0") = compare[0]; + register uint64_t x1 __asm__ ("x1") = compare[1]; + register uint64_t x2 __asm__ ("x2") = set[0]; + register uint64_t x3 __asm__ ("x3") = set[1]; + + __asm__ __volatile__("casp %0, %1, %4, %5, [%6];" + "eor %2, %0, %7;" + "eor %3, %1, %8;" + "orr %2, %2, %3;" + : "+&r" (x0), "+&r" (x1), "=&r" (tmp1), "=&r" (tmp2) + : "r" (x2), "r" (x3), "r" (target), "r" (compare[0]), "r" (compare[1]) + : "memory"); + + value[0] = x0; + value[1] = x1; + + return (!!tmp1); +} + +CK_CC_INLINE static bool +ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) +{ + return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set), + CK_CPP_CAST(uint64_t *, value))); +} + +CK_CC_INLINE static bool +ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) +{ + register uint64_t x0 __asm__ ("x0") = compare[0]; + register uint64_t x1 __asm__ ("x1") = compare[1]; + register uint64_t x2 __asm__ ("x2") = set[0]; + register uint64_t x3 __asm__ ("x3") = set[1]; + + __asm__ __volatile__("casp %0, %1, %2, %3, [%4];" + "eor %0, %0, %5;" + "eor %1, %1, %6;" + "orr %0, %0, %1;" + : "+&r" (x0), "+&r" (x1) + : "r" (x2), "r" (x3), "r" (target), "r" (compare[0]), "r" (compare[1]) + : "memory"); + + return (!!x0); +} +CK_CC_INLINE static bool +ck_pr_cas_ptr_2(void *target, void *compare, void *set) +{ + return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set))); +} + + +#define CK_PR_CAS(N, M, T, W, R) \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ + { \ + *(T *)value = compare; \ + __asm__ __volatile__( \ + "cas" W " %" R "0, %" R "2, [%1];" \ + : "+&r" (*(T *)value) \ + : "r" (target), \ + "r" (set) \ + : "memory"); \ + return (*(T *)value == compare); \ + } \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N(M *target, T compare, T set) \ + { \ + T previous = compare; \ + __asm__ __volatile__( \ + "cas" W " %" R "0, %" R "2, [%1];" \ + : "+&r" (previous) \ + : "r" (target), \ + "r" (set) \ + : "memory"); \ + return (previous == compare); \ + } + +CK_PR_CAS(ptr, void, void *, "", "") + +#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) +CK_PR_CAS_S(64, uint64_t, "", "") +#ifndef CK_PR_DISABLE_DOUBLE +CK_PR_CAS_S(double, double, "", "") +#endif +CK_PR_CAS_S(32, uint32_t, "", "w") +CK_PR_CAS_S(uint, unsigned int, "", "w") +CK_PR_CAS_S(int, int, "", "w") +CK_PR_CAS_S(16, uint16_t, "h", "w") +CK_PR_CAS_S(8, uint8_t, "b", "w") +CK_PR_CAS_S(short, short, "h", "w") +CK_PR_CAS_S(char, char, "b", "w") + + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W, R) \ + CK_CC_INLINE static T \ + ck_pr_fas_##N(M *target, T v) \ + { \ + T previous; \ + __asm__ __volatile__( \ + "swp" W " %" R "2, %" R "0, [%1];" \ + : "=&r" (previous) \ + : "r" (target), \ + "r" (v) \ + : "memory"); \ + return (previous); \ + } + +CK_PR_FAS(64, uint64_t, uint64_t, "", "") +CK_PR_FAS(32, uint32_t, uint32_t, "", "w") +CK_PR_FAS(ptr, void, void *, "", "") +CK_PR_FAS(int, int, int, "", "w") +CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") +CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") +CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 30 18:17:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73E5FC97DE8; Fri, 30 Dec 2016 18:17:45 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A03C177E; Fri, 30 Dec 2016 18:17:45 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUIHiuM022735; Fri, 30 Dec 2016 18:17:44 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUIHiau022734; Fri, 30 Dec 2016 18:17:44 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201612301817.uBUIHiau022734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 30 Dec 2016 18:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310844 - vendor-sys/ck/20161230 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:17:45 -0000 Author: cognet Date: Fri Dec 30 18:17:44 2016 New Revision: 310844 URL: https://svnweb.freebsd.org/changeset/base/310844 Log: Tag CK import as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8 Added: vendor-sys/ck/20161230/ - copied from r310843, vendor-sys/ck/dist/ From owner-svn-src-all@freebsd.org Fri Dec 30 18:21:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FCBAC9702C; Fri, 30 Dec 2016 18:21:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0C881B36; Fri, 30 Dec 2016 18:21:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUILrfw024349; Fri, 30 Dec 2016 18:21:53 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUILrDc024348; Fri, 30 Dec 2016 18:21:53 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201612301821.uBUILrDc024348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 30 Dec 2016 18:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310845 - head/sys/boot/i386/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:21:54 -0000 Author: tsoome Date: Fri Dec 30 18:21:52 2016 New Revision: 310845 URL: https://svnweb.freebsd.org/changeset/base/310845 Log: boot2 will deadlock if extended keys are used on text input The boot2 family of bootblocks (zfsboot/gptzfsboot) are using separate implementation if keyboard reading code, which has deadlock case when extended key (arrows etc) are pressed. The problem is about avoiding the noise from some systems, generating false key events with scan code 1 and ascii code 00, so the code does attempt to filter such cases out. Unfortunately the extended keys also set ascii 0, and therefore the pressed key event is ignored and the keypress is never read, resulting in infinite loop. This update is moving the check to keyhit() function and is allowing the rest of the code to process the extended keys. Reviewed by: bapt, allanjude Approved by: allanjude (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8608 Modified: head/sys/boot/i386/common/cons.c Modified: head/sys/boot/i386/common/cons.c ============================================================================== --- head/sys/boot/i386/common/cons.c Fri Dec 30 18:17:44 2016 (r310844) +++ head/sys/boot/i386/common/cons.c Fri Dec 30 18:21:52 2016 (r310845) @@ -65,18 +65,17 @@ int getc(int fn) { - /* - * The extra comparison against zero is an attempt to work around - * what appears to be a bug in QEMU and Bochs. Both emulators - * sometimes report a key-press with scancode one and ascii zero - * when no such key is pressed in reality. As far as I can tell, - * this only happens shortly after a reboot. - */ v86.ctl = V86_FLAGS; v86.addr = 0x16; v86.eax = fn << 8; v86int(); - return fn == 0 ? v86.eax & 0xff : (!V86_ZR(v86.efl) && (v86.eax & 0xff)); + + if (fn == 0) + return (v86.eax); + + if (V86_ZR(v86.efl)) + return (0); + return (v86.eax); } int @@ -106,14 +105,22 @@ getchar(void) int keyhit(unsigned int secs) { - uint32_t t0, t1; + uint32_t t0, t1, c; if (OPT_CHECK(RBX_NOINTR)) return (0); secs *= SECOND; t0 = 0; for (;;) { - if (xgetc(1)) + /* + * The extra comparison is an attempt to work around + * what appears to be a bug in QEMU and Bochs. Both emulators + * sometimes report a key-press with scancode one and ascii zero + * when no such key is pressed in reality. As far as I can tell, + * this only happens shortly after a reboot. + */ + c = xgetc(1); + if (c != 0 && c != 0x0100) return (1); if (secs > 0) { t1 = *(uint32_t *)PTOV(0x46c); @@ -134,9 +141,19 @@ getstr(char *cmdstr, size_t cmdstrsize) s = cmdstr; for (;;) { - switch (c = xgetc(0)) { - case 0: + c = xgetc(0); + + /* Translate some extended codes. */ + switch (c) { + case 0x5300: /* delete */ + c = '\177'; break; + default: + c &= 0xff; + break; + } + + switch (c) { case '\177': case '\b': if (s > cmdstr) { @@ -149,9 +166,11 @@ getstr(char *cmdstr, size_t cmdstrsize) *s = 0; return; default: - if (s - cmdstr < cmdstrsize - 1) - *s++ = c; - putchar(c); + if (c >= 0x20 && c <= 0x7e) { + if (s - cmdstr < cmdstrsize - 1) + *s++ = c; + putchar(c); + } break; } } From owner-svn-src-all@freebsd.org Fri Dec 30 18:24:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 134C2C970A0; Fri, 30 Dec 2016 18:24:00 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFF1E1D49; Fri, 30 Dec 2016 18:23:59 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUINxs2026765; Fri, 30 Dec 2016 18:23:59 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUINwCw026758; Fri, 30 Dec 2016 18:23:58 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201612301823.uBUINwCw026758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 30 Dec 2016 18:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310846 - in head/sys/contrib/ck: . include include/gcc include/gcc/aarch64 include/gcc/arm include/gcc/ppc64 include/gcc/x86_64 src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:24:00 -0000 Author: cognet Date: Fri Dec 30 18:23:58 2016 New Revision: 310846 URL: https://svnweb.freebsd.org/changeset/base/310846 Log: Merge CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mostly to make sure we don't use any FP instruction. Added: head/sys/contrib/ck/include/gcc/aarch64/ck_pr_llsc.h - copied unchanged from r310844, vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h head/sys/contrib/ck/include/gcc/aarch64/ck_pr_lse.h - copied unchanged from r310844, vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h Deleted: head/sys/contrib/ck/src/Makefile.in Modified: head/sys/contrib/ck/FREEBSD-Xlist head/sys/contrib/ck/include/ck_md.h head/sys/contrib/ck/include/ck_pr.h head/sys/contrib/ck/include/gcc/aarch64/ck_pr.h head/sys/contrib/ck/include/gcc/arm/ck_pr.h head/sys/contrib/ck/include/gcc/ck_pr.h head/sys/contrib/ck/include/gcc/ppc64/ck_pr.h head/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Directory Properties: head/sys/contrib/ck/ (props changed) Modified: head/sys/contrib/ck/FREEBSD-Xlist ============================================================================== --- head/sys/contrib/ck/FREEBSD-Xlist Fri Dec 30 18:21:52 2016 (r310845) +++ head/sys/contrib/ck/FREEBSD-Xlist Fri Dec 30 18:23:58 2016 (r310846) @@ -8,3 +8,4 @@ */regressions */tools */include/ck_md.h.in +*/src/Makefile.in Modified: head/sys/contrib/ck/include/ck_md.h ============================================================================== --- head/sys/contrib/ck/include/ck_md.h Fri Dec 30 18:21:52 2016 (r310845) +++ head/sys/contrib/ck/include/ck_md.h Fri Dec 30 18:23:58 2016 (r310846) @@ -49,6 +49,10 @@ #define CK_MD_VMA_BITS_UNKNOWN #endif /* CK_MD_VMA_BITS_UNKNOWN */ +#ifndef CK_PR_DISABLE_DOUBLE +#define CK_PR_DISABLE_DOUBLE +#endif /* CK_PR_DISABLE_DOUBLE */ + #ifndef CK_MD_RMO #define CK_MD_RMO #endif /* CK_MD_RMO */ Modified: head/sys/contrib/ck/include/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/ck_pr.h Fri Dec 30 18:21:52 2016 (r310845) +++ head/sys/contrib/ck/include/ck_pr.h Fri Dec 30 18:23:58 2016 (r310846) @@ -173,7 +173,9 @@ ck_pr_rfo(const void *m) #define ck_pr_store_ptr(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), ptr) #define ck_pr_store_char(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), char) +#ifndef CK_PR_DISABLE_DOUBLE #define ck_pr_store_double(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), double) +#endif #define ck_pr_store_uint(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), uint) #define ck_pr_store_int(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), int) #define ck_pr_store_32(DST, VAL) CK_PR_STORE_SAFE((DST), (VAL), 32) @@ -191,7 +193,9 @@ ck_pr_rfo(const void *m) #define CK_PR_LOAD_SAFE(SRC, TYPE) ck_pr_md_load_##TYPE((SRC)) #define ck_pr_load_char(SRC) CK_PR_LOAD_SAFE((SRC), char) +#ifndef CK_PR_DISABLE_DOUBLE #define ck_pr_load_double(SRC) CK_PR_LOAD_SAFE((SRC), double) +#endif #define ck_pr_load_uint(SRC) CK_PR_LOAD_SAFE((SRC), uint) #define ck_pr_load_int(SRC) CK_PR_LOAD_SAFE((SRC), int) #define ck_pr_load_32(SRC) CK_PR_LOAD_SAFE((SRC), 32) @@ -279,7 +283,8 @@ CK_PR_BIN_S(or, int, int, |) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_ADD_DOUBLE #define CK_F_PR_ADD_DOUBLE @@ -291,7 +296,7 @@ CK_PR_BIN_S(add, double, double, +) CK_PR_BIN_S(sub, double, double, -) #endif /* CK_F_PR_SUB_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -679,7 +684,8 @@ CK_PR_UNARY_Z_S(dec, int, int, -, 1) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_INC_DOUBLE #define CK_F_PR_INC_DOUBLE @@ -691,7 +697,7 @@ CK_PR_UNARY_S(inc, add, double, double) CK_PR_UNARY_S(dec, sub, double, double) #endif /* CK_F_PR_DEC_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -918,14 +924,15 @@ CK_PR_N_Z_S(int, int) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_NEG_DOUBLE #define CK_F_PR_NEG_DOUBLE CK_PR_N_S(neg, double, double, -) #endif /* CK_F_PR_NEG_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) @@ -1109,7 +1116,8 @@ CK_PR_FAS_S(int, int) #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ -#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) +#if defined(CK_F_PR_LOAD_DOUBLE) && defined(CK_F_PR_CAS_DOUBLE_VALUE) && \ + !defined(CK_PR_DISABLE_DOUBLE) #ifndef CK_F_PR_FAA_DOUBLE #define CK_F_PR_FAA_DOUBLE @@ -1121,7 +1129,7 @@ CK_PR_FAA_S(double, double) CK_PR_FAS_S(double, double) #endif /* CK_F_PR_FAS_DOUBLE */ -#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE */ +#endif /* CK_F_PR_LOAD_DOUBLE && CK_F_PR_CAS_DOUBLE_VALUE && !CK_PR_DISABLE_DOUBLE */ #if defined(CK_F_PR_LOAD_UINT) && defined(CK_F_PR_CAS_UINT_VALUE) Modified: head/sys/contrib/ck/include/gcc/aarch64/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/aarch64/ck_pr.h Fri Dec 30 18:21:52 2016 (r310845) +++ head/sys/contrib/ck/include/gcc/aarch64/ck_pr.h Fri Dec 30 18:23:58 2016 (r310846) @@ -124,7 +124,9 @@ CK_PR_LOAD_S(uint, unsigned int, "ldr") CK_PR_LOAD_S(int, int, "ldr") CK_PR_LOAD_S(short, short, "ldrh") CK_PR_LOAD_S(char, char, "ldrb") +#ifndef CK_PR_DISABLE_DOUBLE CK_PR_LOAD_S_64(double, double, "ldr") +#endif #undef CK_PR_LOAD_S #undef CK_PR_LOAD_S_64 @@ -167,326 +169,59 @@ CK_PR_STORE_S(uint, unsigned int, "str") CK_PR_STORE_S(int, int, "str") CK_PR_STORE_S(short, short, "strh") CK_PR_STORE_S(char, char, "strb") +#ifndef CK_PR_DISABLE_DOUBLE CK_PR_STORE_S_64(double, double, "str") +#endif #undef CK_PR_STORE_S #undef CK_PR_STORE_S_64 #undef CK_PR_STORE #undef CK_PR_STORE_64 -CK_CC_INLINE static bool -ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) -{ - uint64_t tmp1, tmp2; - __asm__ __volatile__("1:" - "ldxp %0, %1, [%4];" - "mov %2, %0;" - "mov %3, %1;" - "eor %0, %0, %5;" - "eor %1, %1, %6;" - "orr %1, %0, %1;" - "mov %w0, #0;" - "cbnz %1, 2f;" - "stxp %w0, %7, %8, [%4];" - "cbnz %w0, 1b;" - "mov %w0, #1;" - "2:" - : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1]) - : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1])); - - return (tmp1); -} - -CK_CC_INLINE static bool -ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) -{ - return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), - CK_CPP_CAST(uint64_t *, compare), - CK_CPP_CAST(uint64_t *, set), - CK_CPP_CAST(uint64_t *, value))); -} - -CK_CC_INLINE static bool -ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) -{ - uint64_t tmp1, tmp2; - __asm__ __volatile__("1:" - "ldxp %0, %1, [%2];" - "eor %0, %0, %3;" - "eor %1, %1, %4;" - "orr %1, %0, %1;" - "mov %w0, #0;" - "cbnz %1, 2f;" - "stxp %w0, %5, %6, [%2];" - "cbnz %w0, 1b;" - "mov %w0, #1;" - "2:" - : "=&r" (tmp1), "=&r" (tmp2) - : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1])); - - return (tmp1); -} -CK_CC_INLINE static bool -ck_pr_cas_ptr_2(void *target, void *compare, void *set) -{ - return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), - CK_CPP_CAST(uint64_t *, compare), - CK_CPP_CAST(uint64_t *, set))); -} - - -#define CK_PR_CAS(N, M, T, W, R) \ - CK_CC_INLINE static bool \ - ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - "cmp %" R "0, %" R "4;" \ - "b.ne 2f;" \ - "stxr" W " %w1, %" R "3, [%2];" \ - "cbnz %w1, 1b;" \ - "2:" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (set), \ - "r" (compare) \ - : "memory", "cc"); \ - *(T *)value = previous; \ - return (previous == compare); \ - } \ - CK_CC_INLINE static bool \ - ck_pr_cas_##N(M *target, T compare, T set) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__( \ - "1:" \ - "ldxr" W " %" R "0, [%2];" \ - "cmp %" R "0, %" R "4;" \ - "b.ne 2f;" \ - "stxr" W " %w1, %" R "3, [%2];" \ - "cbnz %w1, 1b;" \ - "2:" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (set), \ - "r" (compare) \ - : "memory", "cc"); \ - return (previous == compare); \ - } - -CK_PR_CAS(ptr, void, void *, "", "") - -#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) -CK_PR_CAS_S(64, uint64_t, "", "") -CK_PR_CAS_S(double, double, "", "") -CK_PR_CAS_S(32, uint32_t, "", "w") -CK_PR_CAS_S(uint, unsigned int, "", "w") -CK_PR_CAS_S(int, int, "", "w") -CK_PR_CAS_S(16, uint16_t, "h", "w") -CK_PR_CAS_S(8, uint8_t, "b", "w") -CK_PR_CAS_S(short, short, "h", "w") -CK_PR_CAS_S(char, char, "b", "w") - - -#undef CK_PR_CAS_S -#undef CK_PR_CAS - -#define CK_PR_FAS(N, M, T, W, R) \ - CK_CC_INLINE static T \ - ck_pr_fas_##N(M *target, T v) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - "stxr" W " %w1, %" R "3, [%2];"\ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (v) \ - : "memory", "cc"); \ - return (previous); \ - } - -CK_PR_FAS(64, uint64_t, uint64_t, "", "") -CK_PR_FAS(32, uint32_t, uint32_t, "", "w") -CK_PR_FAS(ptr, void, void *, "", "") -CK_PR_FAS(int, int, int, "", "w") -CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") -CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") -CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") -CK_PR_FAS(short, short, short, "h", "w") -CK_PR_FAS(char, char, char, "b", "w") - - -#undef CK_PR_FAS - -#define CK_PR_UNARY(O, N, M, T, I, W, R) \ - CK_CC_INLINE static void \ - ck_pr_##O##_##N(M *target) \ - { \ - T previous = 0; \ - T tmp = 0; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];" \ - I ";" \ - "stxr" W " %w1, %" R "0, [%2];" \ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target) \ - : "memory", "cc"); \ - return; \ - } - -CK_PR_UNARY(inc, ptr, void, void *, "add %0, %0, #1", "", "") -CK_PR_UNARY(dec, ptr, void, void *, "sub %0, %0, #1", "", "") -CK_PR_UNARY(not, ptr, void, void *, "mvn %0, %0", "", "") -CK_PR_UNARY(neg, ptr, void, void *, "neg %0, %0", "", "") -CK_PR_UNARY(inc, 64, uint64_t, uint64_t, "add %0, %0, #1", "", "") -CK_PR_UNARY(dec, 64, uint64_t, uint64_t, "sub %0, %0, #1", "", "") -CK_PR_UNARY(not, 64, uint64_t, uint64_t, "mvn %0, %0", "", "") -CK_PR_UNARY(neg, 64, uint64_t, uint64_t, "neg %0, %0", "", "") - -#define CK_PR_UNARY_S(S, T, W) \ - CK_PR_UNARY(inc, S, T, T, "add %w0, %w0, #1", W, "w") \ - CK_PR_UNARY(dec, S, T, T, "sub %w0, %w0, #1", W, "w") \ - CK_PR_UNARY(not, S, T, T, "mvn %w0, %w0", W, "w") \ - CK_PR_UNARY(neg, S, T, T, "neg %w0, %w0", W, "w") \ - -CK_PR_UNARY_S(32, uint32_t, "") -CK_PR_UNARY_S(uint, unsigned int, "") -CK_PR_UNARY_S(int, int, "") -CK_PR_UNARY_S(16, uint16_t, "h") -CK_PR_UNARY_S(8, uint8_t, "b") -CK_PR_UNARY_S(short, short, "h") -CK_PR_UNARY_S(char, char, "b") - -#undef CK_PR_UNARY_S -#undef CK_PR_UNARY - -#define CK_PR_BINARY(O, N, M, T, I, W, R) \ - CK_CC_INLINE static void \ - ck_pr_##O##_##N(M *target, T delta) \ - { \ - T previous; \ - T tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %" R "0, [%2];"\ - I " %" R "0, %" R "0, %" R "3;" \ - "stxr" W " %w1, %" R "0, [%2];" \ - "cbnz %w1, 1b;" \ - : "=&r" (previous), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (delta) \ - : "memory", "cc"); \ - return; \ - } - -CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "", "") -CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "", "") -CK_PR_BINARY(or, ptr, void, uintptr_t, "orr", "", "") -CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "", "") -CK_PR_BINARY(xor, ptr, void, uintptr_t, "eor", "", "") -CK_PR_BINARY(and, 64, uint64_t, uint64_t, "and", "", "") -CK_PR_BINARY(add, 64, uint64_t, uint64_t, "add", "", "") -CK_PR_BINARY(or, 64, uint64_t, uint64_t, "orr", "", "") -CK_PR_BINARY(sub, 64, uint64_t, uint64_t, "sub", "", "") -CK_PR_BINARY(xor, 64, uint64_t, uint64_t, "eor", "", "") - -#define CK_PR_BINARY_S(S, T, W) \ - CK_PR_BINARY(and, S, T, T, "and", W, "w") \ - CK_PR_BINARY(add, S, T, T, "add", W, "w") \ - CK_PR_BINARY(or, S, T, T, "orr", W, "w") \ - CK_PR_BINARY(sub, S, T, T, "sub", W, "w") \ - CK_PR_BINARY(xor, S, T, T, "eor", W, "w") - -CK_PR_BINARY_S(32, uint32_t, "") -CK_PR_BINARY_S(uint, unsigned int, "") -CK_PR_BINARY_S(int, int, "") -CK_PR_BINARY_S(16, uint16_t, "h") -CK_PR_BINARY_S(8, uint8_t, "b") -CK_PR_BINARY_S(short, short, "h") -CK_PR_BINARY_S(char, char, "b") - -#undef CK_PR_BINARY_S -#undef CK_PR_BINARY - -CK_CC_INLINE static void * -ck_pr_faa_ptr(void *target, uintptr_t delta) -{ - uintptr_t previous, r, tmp; - - __asm__ __volatile__("1:" - "ldxr %0, [%3];" - "add %1, %4, %0;" - "stxr %w2, %1, [%3];" - "cbnz %w2, 1b;" - : "=&r" (previous), - "=&r" (r), - "=&r" (tmp) - : "r" (target), - "r" (delta) - : "memory", "cc"); - - return (void *)(previous); -} - -CK_CC_INLINE static uint64_t -ck_pr_faa_64(uint64_t *target, uint64_t delta) -{ - uint64_t previous, r, tmp; - - __asm__ __volatile__("1:" - "ldxr %0, [%3];" - "add %1, %4, %0;" - "stxr %w2, %1, [%3];" - "cbnz %w2, 1b;" - : "=&r" (previous), - "=&r" (r), - "=&r" (tmp) - : "r" (target), - "r" (delta) - : "memory", "cc"); - - return (previous); -} - -#define CK_PR_FAA(S, T, W) \ - CK_CC_INLINE static T \ - ck_pr_faa_##S(T *target, T delta) \ - { \ - T previous, r, tmp; \ - __asm__ __volatile__("1:" \ - "ldxr" W " %w0, [%3];" \ - "add %w1, %w4, %w0;" \ - "stxr" W " %w2, %w1, [%3];" \ - "cbnz %w2, 1b;" \ - : "=&r" (previous), \ - "=&r" (r), \ - "=&r" (tmp) \ - : "r" (target), \ - "r" (delta) \ - : "memory", "cc"); \ - return (previous); \ - } - -CK_PR_FAA(32, uint32_t, "") -CK_PR_FAA(uint, unsigned int, "") -CK_PR_FAA(int, int, "") -CK_PR_FAA(16, uint16_t, "h") -CK_PR_FAA(8, uint8_t, "b") -CK_PR_FAA(short, short, "h") -CK_PR_FAA(char, char, "b") +#ifdef CK_MD_LSE_ENABLE +#include "ck_pr_lse.h" +#else +#include "ck_pr_llsc.h" +#endif + +/* + * ck_pr_neg_*() functions can only be implemented via LL/SC, as there are no + * LSE alternatives. + */ +#define CK_PR_NEG(N, M, T, W, R) \ + CK_CC_INLINE static void \ + ck_pr_neg_##N(M *target) \ + { \ + T previous = 0; \ + T tmp = 0; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "neg %" R "0, %" R "0;" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_NEG(ptr, void, void *, "", "") +CK_PR_NEG(64, uint64_t, uint64_t, "", "") + +#define CK_PR_NEG_S(S, T, W) \ + CK_PR_NEG(S, T, T, W, "w") \ + +CK_PR_NEG_S(32, uint32_t, "") +CK_PR_NEG_S(uint, unsigned int, "") +CK_PR_NEG_S(int, int, "") +CK_PR_NEG_S(16, uint16_t, "h") +CK_PR_NEG_S(8, uint8_t, "b") +CK_PR_NEG_S(short, short, "h") +CK_PR_NEG_S(char, char, "b") -#undef CK_PR_FAA +#undef CK_PR_NEG_S +#undef CK_PR_NEG #endif /* CK_PR_AARCH64_H */ Copied: head/sys/contrib/ck/include/gcc/aarch64/ck_pr_llsc.h (from r310844, vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/include/gcc/aarch64/ck_pr_llsc.h Fri Dec 30 18:23:58 2016 (r310846, copy of r310844, vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_llsc.h) @@ -0,0 +1,352 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2013-2016 Olivier Houchard. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef CK_PR_AARCH64_LLSC_H +#define CK_PR_AARCH64_LLSC_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +CK_CC_INLINE static bool +ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) +{ + uint64_t tmp1, tmp2; + + __asm__ __volatile__("1:" + "ldxp %0, %1, [%4];" + "mov %2, %0;" + "mov %3, %1;" + "eor %0, %0, %5;" + "eor %1, %1, %6;" + "orr %1, %0, %1;" + "mov %w0, #0;" + "cbnz %1, 2f;" + "stxp %w0, %7, %8, [%4];" + "cbnz %w0, 1b;" + "mov %w0, #1;" + "2:" + : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1]) + : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1]) + : "cc", "memory"); + + return (tmp1); +} + +CK_CC_INLINE static bool +ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) +{ + return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set), + CK_CPP_CAST(uint64_t *, value))); +} + +CK_CC_INLINE static bool +ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) +{ + uint64_t tmp1, tmp2; + + __asm__ __volatile__("1:" + "ldxp %0, %1, [%2];" + "eor %0, %0, %3;" + "eor %1, %1, %4;" + "orr %1, %0, %1;" + "mov %w0, #0;" + "cbnz %1, 2f;" + "stxp %w0, %5, %6, [%2];" + "cbnz %w0, 1b;" + "mov %w0, #1;" + "2:" + : "=&r" (tmp1), "=&r" (tmp2) + : "r" (target), "r" (compare[0]), "r" (compare[1]), "r" (set[0]), "r" (set[1]) + : "cc", "memory"); + + return (tmp1); +} +CK_CC_INLINE static bool +ck_pr_cas_ptr_2(void *target, void *compare, void *set) +{ + return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set))); +} + + +#define CK_PR_CAS(N, M, T, W, R) \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "cmp %" R "0, %" R "4;" \ + "b.ne 2f;" \ + "stxr" W " %w1, %" R "3, [%2];" \ + "cbnz %w1, 1b;" \ + "2:" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (set), \ + "r" (compare) \ + : "memory", "cc"); \ + *(T *)value = previous; \ + return (previous == compare); \ + } \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N(M *target, T compare, T set) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__( \ + "1:" \ + "ldxr" W " %" R "0, [%2];" \ + "cmp %" R "0, %" R "4;" \ + "b.ne 2f;" \ + "stxr" W " %w1, %" R "3, [%2];" \ + "cbnz %w1, 1b;" \ + "2:" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (set), \ + "r" (compare) \ + : "memory", "cc"); \ + return (previous == compare); \ + } + +CK_PR_CAS(ptr, void, void *, "", "") + +#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) +CK_PR_CAS_S(64, uint64_t, "", "") +#ifndef CK_PR_DISABLE_DOUBLE +CK_PR_CAS_S(double, double, "", "") +#endif +CK_PR_CAS_S(32, uint32_t, "", "w") +CK_PR_CAS_S(uint, unsigned int, "", "w") +CK_PR_CAS_S(int, int, "", "w") +CK_PR_CAS_S(16, uint16_t, "h", "w") +CK_PR_CAS_S(8, uint8_t, "b", "w") +CK_PR_CAS_S(short, short, "h", "w") +CK_PR_CAS_S(char, char, "b", "w") + + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W, R) \ + CK_CC_INLINE static T \ + ck_pr_fas_##N(M *target, T v) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + "stxr" W " %w1, %" R "3, [%2];"\ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (v) \ + : "memory", "cc"); \ + return (previous); \ + } + +CK_PR_FAS(64, uint64_t, uint64_t, "", "") +CK_PR_FAS(32, uint32_t, uint32_t, "", "w") +CK_PR_FAS(ptr, void, void *, "", "") +CK_PR_FAS(int, int, int, "", "w") +CK_PR_FAS(uint, unsigned int, unsigned int, "", "w") +CK_PR_FAS(16, uint16_t, uint16_t, "h", "w") +CK_PR_FAS(8, uint8_t, uint8_t, "b", "w") +CK_PR_FAS(short, short, short, "h", "w") +CK_PR_FAS(char, char, char, "b", "w") + + +#undef CK_PR_FAS + +#define CK_PR_UNARY(O, N, M, T, I, W, R) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target) \ + { \ + T previous = 0; \ + T tmp = 0; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];" \ + I ";" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_UNARY(inc, ptr, void, void *, "add %0, %0, #1", "", "") +CK_PR_UNARY(dec, ptr, void, void *, "sub %0, %0, #1", "", "") +CK_PR_UNARY(not, ptr, void, void *, "mvn %0, %0", "", "") +CK_PR_UNARY(inc, 64, uint64_t, uint64_t, "add %0, %0, #1", "", "") +CK_PR_UNARY(dec, 64, uint64_t, uint64_t, "sub %0, %0, #1", "", "") +CK_PR_UNARY(not, 64, uint64_t, uint64_t, "mvn %0, %0", "", "") + +#define CK_PR_UNARY_S(S, T, W) \ + CK_PR_UNARY(inc, S, T, T, "add %w0, %w0, #1", W, "w") \ + CK_PR_UNARY(dec, S, T, T, "sub %w0, %w0, #1", W, "w") \ + CK_PR_UNARY(not, S, T, T, "mvn %w0, %w0", W, "w") \ + +CK_PR_UNARY_S(32, uint32_t, "") +CK_PR_UNARY_S(uint, unsigned int, "") +CK_PR_UNARY_S(int, int, "") +CK_PR_UNARY_S(16, uint16_t, "h") +CK_PR_UNARY_S(8, uint8_t, "b") +CK_PR_UNARY_S(short, short, "h") +CK_PR_UNARY_S(char, char, "b") + +#undef CK_PR_UNARY_S +#undef CK_PR_UNARY + +#define CK_PR_BINARY(O, N, M, T, I, W, R) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target, T delta) \ + { \ + T previous; \ + T tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %" R "0, [%2];"\ + I " %" R "0, %" R "0, %" R "3;" \ + "stxr" W " %w1, %" R "0, [%2];" \ + "cbnz %w1, 1b;" \ + : "=&r" (previous), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (delta) \ + : "memory", "cc"); \ + return; \ + } + +CK_PR_BINARY(and, ptr, void, uintptr_t, "and", "", "") +CK_PR_BINARY(add, ptr, void, uintptr_t, "add", "", "") +CK_PR_BINARY(or, ptr, void, uintptr_t, "orr", "", "") +CK_PR_BINARY(sub, ptr, void, uintptr_t, "sub", "", "") +CK_PR_BINARY(xor, ptr, void, uintptr_t, "eor", "", "") +CK_PR_BINARY(and, 64, uint64_t, uint64_t, "and", "", "") +CK_PR_BINARY(add, 64, uint64_t, uint64_t, "add", "", "") +CK_PR_BINARY(or, 64, uint64_t, uint64_t, "orr", "", "") +CK_PR_BINARY(sub, 64, uint64_t, uint64_t, "sub", "", "") +CK_PR_BINARY(xor, 64, uint64_t, uint64_t, "eor", "", "") + +#define CK_PR_BINARY_S(S, T, W) \ + CK_PR_BINARY(and, S, T, T, "and", W, "w") \ + CK_PR_BINARY(add, S, T, T, "add", W, "w") \ + CK_PR_BINARY(or, S, T, T, "orr", W, "w") \ + CK_PR_BINARY(sub, S, T, T, "sub", W, "w") \ + CK_PR_BINARY(xor, S, T, T, "eor", W, "w") + +CK_PR_BINARY_S(32, uint32_t, "") +CK_PR_BINARY_S(uint, unsigned int, "") +CK_PR_BINARY_S(int, int, "") +CK_PR_BINARY_S(16, uint16_t, "h") +CK_PR_BINARY_S(8, uint8_t, "b") +CK_PR_BINARY_S(short, short, "h") +CK_PR_BINARY_S(char, char, "b") + +#undef CK_PR_BINARY_S +#undef CK_PR_BINARY + +CK_CC_INLINE static void * +ck_pr_faa_ptr(void *target, uintptr_t delta) +{ + uintptr_t previous, r, tmp; + + __asm__ __volatile__("1:" + "ldxr %0, [%3];" + "add %1, %4, %0;" + "stxr %w2, %1, [%3];" + "cbnz %w2, 1b;" + : "=&r" (previous), + "=&r" (r), + "=&r" (tmp) + : "r" (target), + "r" (delta) + : "memory", "cc"); + + return (void *)(previous); +} + +CK_CC_INLINE static uint64_t +ck_pr_faa_64(uint64_t *target, uint64_t delta) +{ + uint64_t previous, r, tmp; + + __asm__ __volatile__("1:" + "ldxr %0, [%3];" + "add %1, %4, %0;" + "stxr %w2, %1, [%3];" + "cbnz %w2, 1b;" + : "=&r" (previous), + "=&r" (r), + "=&r" (tmp) + : "r" (target), + "r" (delta) + : "memory", "cc"); + + return (previous); +} + +#define CK_PR_FAA(S, T, W) \ + CK_CC_INLINE static T \ + ck_pr_faa_##S(T *target, T delta) \ + { \ + T previous, r, tmp; \ + __asm__ __volatile__("1:" \ + "ldxr" W " %w0, [%3];" \ + "add %w1, %w4, %w0;" \ + "stxr" W " %w2, %w1, [%3];" \ + "cbnz %w2, 1b;" \ + : "=&r" (previous), \ + "=&r" (r), \ + "=&r" (tmp) \ + : "r" (target), \ + "r" (delta) \ + : "memory", "cc"); \ + return (previous); \ + } + +CK_PR_FAA(32, uint32_t, "") +CK_PR_FAA(uint, unsigned int, "") +CK_PR_FAA(int, int, "") +CK_PR_FAA(16, uint16_t, "h") +CK_PR_FAA(8, uint8_t, "b") +CK_PR_FAA(short, short, "h") +CK_PR_FAA(char, char, "b") + +#undef CK_PR_FAA + +#endif /* CK_PR_AARCH64_LLSC_H */ Copied: head/sys/contrib/ck/include/gcc/aarch64/ck_pr_lse.h (from r310844, vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/include/gcc/aarch64/ck_pr_lse.h Fri Dec 30 18:23:58 2016 (r310846, copy of r310844, vendor-sys/ck/dist/include/gcc/aarch64/ck_pr_lse.h) @@ -0,0 +1,298 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2013-2016 Olivier Houchard. + * Copyright 2016 Alexey Kopytov. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef CK_PR_AARCH64_LSE_H +#define CK_PR_AARCH64_LSE_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +CK_CC_INLINE static bool +ck_pr_cas_64_2_value(uint64_t target[2], uint64_t compare[2], uint64_t set[2], uint64_t value[2]) +{ + uint64_t tmp1; + uint64_t tmp2; + register uint64_t x0 __asm__ ("x0") = compare[0]; + register uint64_t x1 __asm__ ("x1") = compare[1]; + register uint64_t x2 __asm__ ("x2") = set[0]; + register uint64_t x3 __asm__ ("x3") = set[1]; + + __asm__ __volatile__("casp %0, %1, %4, %5, [%6];" + "eor %2, %0, %7;" + "eor %3, %1, %8;" + "orr %2, %2, %3;" + : "+&r" (x0), "+&r" (x1), "=&r" (tmp1), "=&r" (tmp2) + : "r" (x2), "r" (x3), "r" (target), "r" (compare[0]), "r" (compare[1]) + : "memory"); + + value[0] = x0; + value[1] = x1; + + return (!!tmp1); +} + +CK_CC_INLINE static bool +ck_pr_cas_ptr_2_value(void *target, void *compare, void *set, void *value) +{ + return (ck_pr_cas_64_2_value(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set), + CK_CPP_CAST(uint64_t *, value))); +} + +CK_CC_INLINE static bool +ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2]) +{ + register uint64_t x0 __asm__ ("x0") = compare[0]; + register uint64_t x1 __asm__ ("x1") = compare[1]; + register uint64_t x2 __asm__ ("x2") = set[0]; + register uint64_t x3 __asm__ ("x3") = set[1]; + + __asm__ __volatile__("casp %0, %1, %2, %3, [%4];" + "eor %0, %0, %5;" + "eor %1, %1, %6;" + "orr %0, %0, %1;" + : "+&r" (x0), "+&r" (x1) + : "r" (x2), "r" (x3), "r" (target), "r" (compare[0]), "r" (compare[1]) + : "memory"); + + return (!!x0); +} +CK_CC_INLINE static bool +ck_pr_cas_ptr_2(void *target, void *compare, void *set) +{ + return (ck_pr_cas_64_2(CK_CPP_CAST(uint64_t *, target), + CK_CPP_CAST(uint64_t *, compare), + CK_CPP_CAST(uint64_t *, set))); +} + + +#define CK_PR_CAS(N, M, T, W, R) \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ + { \ + *(T *)value = compare; \ + __asm__ __volatile__( \ + "cas" W " %" R "0, %" R "2, [%1];" \ + : "+&r" (*(T *)value) \ + : "r" (target), \ + "r" (set) \ + : "memory"); \ + return (*(T *)value == compare); \ + } \ + CK_CC_INLINE static bool \ + ck_pr_cas_##N(M *target, T compare, T set) \ + { \ + T previous = compare; \ + __asm__ __volatile__( \ + "cas" W " %" R "0, %" R "2, [%1];" \ + : "+&r" (previous) \ + : "r" (target), \ + "r" (set) \ + : "memory"); \ + return (previous == compare); \ + } + +CK_PR_CAS(ptr, void, void *, "", "") + +#define CK_PR_CAS_S(N, M, W, R) CK_PR_CAS(N, M, M, W, R) +CK_PR_CAS_S(64, uint64_t, "", "") +#ifndef CK_PR_DISABLE_DOUBLE +CK_PR_CAS_S(double, double, "", "") +#endif +CK_PR_CAS_S(32, uint32_t, "", "w") +CK_PR_CAS_S(uint, unsigned int, "", "w") +CK_PR_CAS_S(int, int, "", "w") +CK_PR_CAS_S(16, uint16_t, "h", "w") +CK_PR_CAS_S(8, uint8_t, "b", "w") +CK_PR_CAS_S(short, short, "h", "w") +CK_PR_CAS_S(char, char, "b", "w") + + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W, R) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 30 18:39:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 927C8C974F0; Fri, 30 Dec 2016 18:39:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72E4715C3; Fri, 30 Dec 2016 18:39:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3725710A746; Fri, 30 Dec 2016 13:39:21 -0500 (EST) From: John Baldwin To: Alexander Kabaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310789 - head/lib/libpam/static_libpam Date: Fri, 30 Dec 2016 10:38:26 -0800 Message-ID: <2270028.8V7VsJ8Web@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201612292130.uBTLUqus011628@repo.freebsd.org> References: <201612292130.uBTLUqus011628@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 30 Dec 2016 13:39:21 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:39:22 -0000 On Thursday, December 29, 2016 09:30:52 PM Alexander Kabaev wrote: > Author: kan > Date: Thu Dec 29 21:30:52 2016 > New Revision: 310789 > URL: https://svnweb.freebsd.org/changeset/base/310789 > > Log: > Use compiler driver to build relocatable object > > This works better with external toolchains where LD > will not necessarily defailt to emulation we want. > Compiler driver knows better. I think this was the case I had added the XLDFLAGS in my mips cross-building patches for. I'm fine with dropping the XLDFLAGS bits and depending on the compiler driver if we think that is the better solution. > Modified: > head/lib/libpam/static_libpam/Makefile > > Modified: head/lib/libpam/static_libpam/Makefile > ============================================================================== > --- head/lib/libpam/static_libpam/Makefile Thu Dec 29 21:06:31 2016 (r310788) > +++ head/lib/libpam/static_libpam/Makefile Thu Dec 29 21:30:52 2016 (r310789) > @@ -64,6 +64,6 @@ CLEANFILES+= openpam_static.o \ > openpam_static_modules.o > > openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} > - ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} > + ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC} > > .include "${.CURDIR}/../libpam/Makefile" > -- John Baldwin From owner-svn-src-all@freebsd.org Fri Dec 30 18:46:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96511C976F6; Fri, 30 Dec 2016 18:46:22 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56DA219FA; Fri, 30 Dec 2016 18:46:22 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUIkLg4035071; Fri, 30 Dec 2016 18:46:21 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUIkLu9035070; Fri, 30 Dec 2016 18:46:21 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201612301846.uBUIkLu9035070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 30 Dec 2016 18:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310847 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:46:22 -0000 Author: jpaetzel Date: Fri Dec 30 18:46:21 2016 New Revision: 310847 URL: https://svnweb.freebsd.org/changeset/base/310847 Log: Harden CARP against network loops. If there is a loop in the network a CARP that is in MASTER state will see it's own broadcasts, which will then cause it to assume BACKUP state. When it assumes BACKUP it will stop sending advertisements. In that state it will no longer see advertisements and will assume MASTER... We can't catch all the cases where we are seeing our own CARP broadcast, but we can catch the obvious case. Submitted by: torek Obtained from: FreeNAS MFC after: 2 weeks Sponsored by: iXsystems Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Dec 30 18:23:58 2016 (r310846) +++ head/sys/netinet/ip_carp.c Fri Dec 30 18:46:21 2016 (r310847) @@ -581,27 +581,90 @@ carp6_input(struct mbuf **mp, int *offp, } #endif /* INET6 */ +/* + * This routine should not be necessary at all, but some switches + * (VMWare ESX vswitches) can echo our own packets back at us, + * and we must ignore them or they will cause us to drop out of + * MASTER mode. + * + * We cannot catch all cases of network loops. Instead, what we + * do here is catch any packet that arrives with a carp header + * with a VHID of 0, that comes from an address that is our own. + * These packets are by definition "from us" (even if they are from + * a misconfigured host that is pretending to be us). + * + * The VHID test is outside this mini-function. + */ +static int +carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) +{ + struct ip *ip4; + struct in_addr in4; + struct ip6_hdr *ip6; + struct in6_addr in6; + + switch (af) { + case AF_INET: + ip4 = mtod(m, struct ip *); + in4 = ifatoia(ifa)->ia_addr.sin_addr; + return (in4.s_addr == ip4->ip_src.s_addr); + + case AF_INET6: + ip6 = mtod(m, struct ip6_hdr *); + in6 = ifatoia6(ifa)->ia_addr.sin6_addr; + return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); + + default: /* how did this happen? */ + break; + } + return (0); +} + static void carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ifaddr *ifa; + struct ifaddr *ifa, *match; struct carp_softc *sc; uint64_t tmp_counter; struct timeval sc_tv, ch_tv; + int error; - /* verify that the VHID is valid on the receiving interface */ + /* + * Verify that the VHID is valid on the receiving interface. + * + * There should be just one match. If there are none + * the VHID is not valid and we drop the packet. If + * there are multiple VHID matches, take just the first + * one, for compatibility with previous code. While we're + * scanning, check for obvious loops in the network topology + * (these should never happen, and as noted above, we may + * miss real loops; this is just a double-check). + */ IF_ADDR_RLOCK(ifp); - IFNET_FOREACH_IFA(ifp, ifa) - if (ifa->ifa_addr->sa_family == af && - ifa->ifa_carp->sc_vhid == ch->carp_vhid) { - ifa_ref(ifa); - break; - } + error = 0; + match = NULL; + IFNET_FOREACH_IFA(ifp, ifa) { + if (match == NULL && ifa->ifa_carp != NULL && + ifa->ifa_addr->sa_family == af && + ifa->ifa_carp->sc_vhid == ch->carp_vhid) + match = ifa; + if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) + error = ELOOP; + } + ifa = error ? NULL : match; + if (ifa != NULL) + ifa_ref(ifa); IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { - CARPSTATS_INC(carps_badvhid); + if (error == ELOOP) { + CARP_DEBUG("dropping looped packet on interface %s\n", + ifp->if_xname); + CARPSTATS_INC(carps_badif); /* ??? */ + } else { + CARPSTATS_INC(carps_badvhid); + } m_freem(m); return; } @@ -787,12 +850,41 @@ carp_send_ad_error(struct carp_softc *sc } } +/* + * Pick the best ifaddr on the given ifp for sending CARP + * advertisements. + * + * "Best" here is defined by ifa_preferred(). This function is much + * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). + * + * (This could be simplified to return the actual address, except that + * it has a different format in AF_INET and AF_INET6.) + */ +static struct ifaddr * +carp_best_ifa(int af, struct ifnet *ifp) +{ + struct ifaddr *ifa, *best; + + if (af >= AF_MAX) + return (NULL); + best = NULL; + IF_ADDR_RLOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family == af && + (best == NULL || ifa_preferred(best, ifa))) + best = ifa; + } + IF_ADDR_RUNLOCK(ifp); + if (best != NULL) + ifa_ref(best); + return (best); +} + static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; - struct sockaddr sa; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -841,9 +933,7 @@ carp_send_ad_locked(struct carp_softc *s ip->ip_sum = 0; ip_fillid(ip); - bzero(&sa, sizeof(sa)); - sa.sa_family = AF_INET; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { ip->ip_src.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; @@ -887,11 +977,9 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; - bzero(&sa, sizeof(sa)); /* set the source address */ - sa.sa_family = AF_INET6; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); if (ifa != NULL) { bcopy(IFA_IN6(ifa), &ip6->ip6_src, sizeof(struct in6_addr)); From owner-svn-src-all@freebsd.org Fri Dec 30 18:55:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FC50C978F5; Fri, 30 Dec 2016 18:55:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 222651F8C; Fri, 30 Dec 2016 18:55:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUItX7d038980; Fri, 30 Dec 2016 18:55:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUItXkt038979; Fri, 30 Dec 2016 18:55:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612301855.uBUItXkt038979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Dec 2016 18:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310849 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 18:55:34 -0000 Author: kib Date: Fri Dec 30 18:55:33 2016 New Revision: 310849 URL: https://svnweb.freebsd.org/changeset/base/310849 Log: Fix two similar bugs in the populate vm_fault() code. If pager' populate method succeeded, but other thread raced with us and modified vm_map, we must unbusy all pages busied by the pager, before we retry the whole fault handling. If pager instantiated more pages than fit into the current map entry, we must unbusy the pages which are clipped. Also do some refactoring, clarify comments and use more clear local variable names. Reported and tested by: kargl, subbsd@gmail.com (previous version) Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Dec 30 18:51:56 2016 (r310848) +++ head/sys/vm/vm_fault.c Fri Dec 30 18:55:33 2016 (r310849) @@ -304,13 +304,45 @@ vm_fault_restore_map_lock(struct faultst fs->lookup_still_valid = true; } +static void +vm_fault_populate_check_page(vm_page_t m) +{ + + /* + * Check each page to ensure that the pager is obeying the + * interface: the page must be installed in the object, fully + * valid, and exclusively busied. + */ + MPASS(m != NULL); + MPASS(m->valid == VM_PAGE_BITS_ALL); + MPASS(vm_page_xbusied(m)); +} + +static void +vm_fault_populate_cleanup(vm_object_t object, vm_pindex_t first, + vm_pindex_t last) +{ + vm_page_t m; + vm_pindex_t pidx; + + VM_OBJECT_ASSERT_WLOCKED(object); + MPASS(first <= last); + for (pidx = first, m = vm_page_lookup(object, pidx); + pidx <= last; pidx++, m = vm_page_next(m)) { + vm_fault_populate_check_page(m); + vm_page_lock(m); + vm_page_deactivate(m); + vm_page_unlock(m); + vm_page_xunbusy(m); + } +} static int vm_fault_populate(struct faultstate *fs, vm_offset_t vaddr, vm_prot_t prot, int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold) { vm_page_t m; - vm_pindex_t f_first, f_last, pidx; + vm_pindex_t map_first, map_last, pager_first, pager_last, pidx; int rv; MPASS(fs->object == fs->first_object); @@ -319,8 +351,8 @@ vm_fault_populate(struct faultstate *fs, MPASS(fs->first_object->backing_object == NULL); MPASS(fs->lookup_still_valid); - f_first = OFF_TO_IDX(fs->entry->offset); - f_last = OFF_TO_IDX(fs->entry->offset + fs->entry->end - + pager_first = OFF_TO_IDX(fs->entry->offset); + pager_last = OFF_TO_IDX(fs->entry->offset + fs->entry->end - fs->entry->start) - 1; unlock_map(fs); unlock_vp(fs); @@ -334,7 +366,7 @@ vm_fault_populate(struct faultstate *fs, * to the driver. */ rv = vm_pager_populate(fs->first_object, fs->first_pindex, - fault_type, fs->entry->max_protection, &f_first, &f_last); + fault_type, fs->entry->max_protection, &pager_first, &pager_last); VM_OBJECT_ASSERT_WLOCKED(fs->first_object); if (rv == VM_PAGER_BAD) { @@ -351,34 +383,40 @@ vm_fault_populate(struct faultstate *fs, return (KERN_FAILURE); /* AKA SIGSEGV */ /* Ensure that the driver is obeying the interface. */ - MPASS(f_first <= f_last); - MPASS(fs->first_pindex <= f_last); - MPASS(fs->first_pindex >= f_first); - MPASS(f_last < fs->first_object->size); + MPASS(pager_first <= pager_last); + MPASS(fs->first_pindex <= pager_last); + MPASS(fs->first_pindex >= pager_first); + MPASS(pager_last < fs->first_object->size); vm_fault_restore_map_lock(fs); - if (fs->map->timestamp != fs->map_generation) + if (fs->map->timestamp != fs->map_generation) { + vm_fault_populate_cleanup(fs->first_object, pager_first, + pager_last); return (KERN_RESOURCE_SHORTAGE); /* RetryFault */ + } - /* Clip pager response to fit into the vm_map_entry. */ - f_first = MAX(OFF_TO_IDX(fs->entry->offset), f_first); - f_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start + - fs->entry->offset), f_last); - - pidx = f_first; - for (m = vm_page_lookup(fs->first_object, pidx); pidx <= f_last; - pidx++, m = vm_page_next(m)) { - /* - * Check each page to ensure that the driver is - * obeying the interface: the page must be installed - * in the object, fully valid, and exclusively busied. - */ - MPASS(m != NULL); - MPASS(vm_page_xbusied(m)); - MPASS(m->valid == VM_PAGE_BITS_ALL); - MPASS(m->object == fs->first_object); - MPASS(m->pindex == pidx); - + /* + * The map is unchanged after our last unlock. Process the fault. + * + * The range [pager_first, pager_last] that is given to the + * pager is only a hint. The pager may populate any range + * within the object that includes the requested page index. + * In case the pager expanded the range, clip it to fit into + * the map entry. + */ + map_first = MAX(OFF_TO_IDX(fs->entry->offset), pager_first); + if (map_first > pager_first) + vm_fault_populate_cleanup(fs->first_object, pager_first, + map_first - 1); + map_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start + + fs->entry->offset), pager_last); + if (map_last < pager_last) + vm_fault_populate_cleanup(fs->first_object, map_last + 1, + pager_last); + + for (pidx = map_first, m = vm_page_lookup(fs->first_object, pidx); + pidx <= map_last; pidx++, m = vm_page_next(m)) { + vm_fault_populate_check_page(m); vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags, true); VM_OBJECT_WUNLOCK(fs->first_object); From owner-svn-src-all@freebsd.org Fri Dec 30 19:06:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D00C4C97E09; Fri, 30 Dec 2016 19:06:33 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8672D1809; Fri, 30 Dec 2016 19:06:33 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUJ6WSk043438; Fri, 30 Dec 2016 19:06:32 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUJ6TMl043407; Fri, 30 Dec 2016 19:06:29 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201612301906.uBUJ6TMl043407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 30 Dec 2016 19:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310850 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys/boot/pc98/libpc98 s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 19:06:33 -0000 Author: tsoome Date: Fri Dec 30 19:06:29 2016 New Revision: 310850 URL: https://svnweb.freebsd.org/changeset/base/310850 Log: dosfs support in libstand is broken since r298230 Apparently the libstand dosfs optimization is a bit too optimistic and did introduce possible memory corruption. This patch is backing out the bad part and since this results in dosfs reading full blocks now, we can also remove extra offset argument from dv_strategy callback. The analysis of the issue and the backout patch is provided by Mikhail Kupchik. PR: 214423 Submitted by: Mikhail Kupchik Reported by: Mikhail Kupchik Reviewed by: bapt, allanjude Approved by: allanjude (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8644 Modified: head/lib/libstand/cd9660.c head/lib/libstand/dosfs.c head/lib/libstand/ext2fs.c head/lib/libstand/nandfs.c head/lib/libstand/read.c head/lib/libstand/stand.h head/lib/libstand/ufs.c head/lib/libstand/write.c head/sys/boot/common/bcache.c head/sys/boot/common/bootstrap.h head/sys/boot/common/disk.c head/sys/boot/common/md.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/i386/libfirewire/firewire.c head/sys/boot/i386/libi386/bioscd.c head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/libi386/pxe.c head/sys/boot/mips/beri/loader/beri_disk_cfi.c head/sys/boot/mips/beri/loader/beri_disk_sdcard.c head/sys/boot/ofw/libofw/ofw_disk.c head/sys/boot/pc98/libpc98/bioscd.c head/sys/boot/pc98/libpc98/biosdisk.c head/sys/boot/powerpc/kboot/hostdisk.c head/sys/boot/powerpc/ps3/ps3cdrom.c head/sys/boot/powerpc/ps3/ps3disk.c head/sys/boot/uboot/lib/disk.c head/sys/boot/usb/storage/umass_loader.c head/sys/boot/userboot/userboot/host.c head/sys/boot/userboot/userboot/userboot_disk.c head/sys/boot/zfs/zfs.c Modified: head/lib/libstand/cd9660.c ============================================================================== --- head/lib/libstand/cd9660.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/cd9660.c Fri Dec 30 19:06:29 2016 (r310850) @@ -143,7 +143,7 @@ susp_lookup_record(struct open_file *f, if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) { shc = (ISO_RRIP_CONT *)sh; error = f->f_dev->dv_strategy(f->f_devdata, F_READ, - cdb2devb(isonum_733(shc->location)), 0, + cdb2devb(isonum_733(shc->location)), ISO_DEFAULT_BLOCK_SIZE, susp_buffer, &read); /* Bail if it fails. */ @@ -288,7 +288,7 @@ cd9660_open(const char *path, struct ope for (bno = 16;; bno++) { twiddle(1); rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno), - 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); + ISO_DEFAULT_BLOCK_SIZE, buf, &read); if (rc) goto out; if (read != ISO_DEFAULT_BLOCK_SIZE) { @@ -322,7 +322,7 @@ cd9660_open(const char *path, struct ope twiddle(1); rc = f->f_dev->dv_strategy (f->f_devdata, F_READ, - cdb2devb(bno + boff), 0, + cdb2devb(bno + boff), ISO_DEFAULT_BLOCK_SIZE, buf, &read); if (rc) @@ -387,7 +387,7 @@ cd9660_open(const char *path, struct ope bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); twiddle(1); rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno), - 0, ISO_DEFAULT_BLOCK_SIZE, buf, &read); + ISO_DEFAULT_BLOCK_SIZE, buf, &read); if (rc) goto out; if (read != ISO_DEFAULT_BLOCK_SIZE) { @@ -444,7 +444,7 @@ buf_read_file(struct open_file *f, char twiddle(16); rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, - cdb2devb(blkno), 0, ISO_DEFAULT_BLOCK_SIZE, + cdb2devb(blkno), ISO_DEFAULT_BLOCK_SIZE, fp->f_buf, &read); if (rc) return (rc); Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/dosfs.c Fri Dec 30 19:06:29 2016 (r310850) @@ -154,7 +154,7 @@ static int fatcnt(DOS_FS *, u_int); static int fatget(DOS_FS *, u_int *); static int fatend(u_int, u_int); static int ioread(DOS_FS *, u_int, void *, u_int); -static int ioget(struct open_file *, daddr_t, size_t, void *, u_int); +static int ioget(struct open_file *, daddr_t, void *, u_int); static void dos_read_fat(DOS_FS *fs, struct open_file *fd) @@ -172,7 +172,7 @@ dos_read_fat(DOS_FS *fs, struct open_fil fat.buf = malloc(secbyt(fs->spf)); if (fat.buf != NULL) { - if (ioget(fd, fs->lsnfat, 0, fat.buf, secbyt(fs->spf)) == 0) { + if (ioget(fd, fs->lsnfat, fat.buf, secbyt(fs->spf)) == 0) { fat.size = fs->spf; fat.unit = dd->d_unit; return; @@ -199,7 +199,7 @@ dos_mount(DOS_FS *fs, struct open_file * fs->fd = fd; if ((err = !(buf = malloc(secbyt(1))) ? errno : 0) || - (err = ioget(fs->fd, 0, 0, buf, secbyt(1))) || + (err = ioget(fs->fd, 0, buf, secbyt(1))) || (err = parsebs(fs, (DOS_BS *)buf))) { if (buf != NULL) free(buf); @@ -619,7 +619,7 @@ lookup(DOS_FS *fs, u_int clus, const cha else return (EINVAL); for (sec = 0; sec < nsec; sec++) { - if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1)))) + if ((err = ioget(fs->fd, lsec + sec, dir, secbyt(1)))) return (err); for (ent = 0; ent < DEPSEC; ent++) { if (!*dir[ent].de.name) @@ -768,8 +768,7 @@ static int fatget(DOS_FS *fs, u_int *c) { u_char buf[4]; - u_char *s; - u_int x, offset, off, n, nbyte, lsec; + u_int x, offset, n, nbyte; struct devdesc *dd = fs->fd->f_devdata; int err = 0; @@ -783,25 +782,9 @@ fatget(DOS_FS *fs, u_int *c) offset = fatoff(fs->fatsz, *c); nbyte = fs->fatsz != 32 ? 2 : 4; - s = buf; - if ((off = offset & (SECSIZ - 1))) { - offset -= off; - lsec = bytsec(offset); - offset += SECSIZ; - if ((n = SECSIZ - off) > nbyte) - n = nbyte; - memcpy(s, fat.buf + secbyt(lsec) + off, n); - s += n; - nbyte -= n; - } - n = nbyte & (SECSIZ - 1); - if (nbyte -= n) { - memcpy(s, fat.buf + secbyt(bytsec(offset)), nbyte); - offset += nbyte; - s += nbyte; - } - if (n) - memcpy(s, fat.buf + secbyt(bytsec(offset)), n); + if (offset + nbyte > secbyt(fat.size)) + return (EINVAL); + memcpy(buf, fat.buf + offset, nbyte); } x = fs->fatsz != 32 ? cv2(buf) : cv4(buf); @@ -827,28 +810,31 @@ ioread(DOS_FS *fs, u_int offset, void *b char *s; u_int off, n; int err; + u_char local_buf[SECSIZ]; s = buf; if ((off = offset & (SECSIZ - 1))) { offset -= off; if ((n = SECSIZ - off) > nbyte) n = nbyte; - if ((err = ioget(fs->fd, bytsec(offset), off, s, n))) + if ((err = ioget(fs->fd, bytsec(offset), local_buf, sizeof(local_buf)))) return (err); + memcpy(s, local_buf + off, n); offset += SECSIZ; s += n; nbyte -= n; } n = nbyte & (SECSIZ - 1); if (nbyte -= n) { - if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte))) + if ((err = ioget(fs->fd, bytsec(offset), s, nbyte))) return (err); offset += nbyte; s += nbyte; } if (n) { - if ((err = ioget(fs->fd, bytsec(offset), 0, s, n))) + if ((err = ioget(fs->fd, bytsec(offset), local_buf, sizeof(local_buf)))) return (err); + memcpy(s, local_buf, n); } return (0); } @@ -857,8 +843,8 @@ ioread(DOS_FS *fs, u_int offset, void *b * Sector-based I/O primitive */ static int -ioget(struct open_file *fd, daddr_t lsec, size_t offset, void *buf, u_int size) +ioget(struct open_file *fd, daddr_t lsec, void *buf, u_int size) { - return ((fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, offset, + return ((fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, size, buf, NULL)); } Modified: head/lib/libstand/ext2fs.c ============================================================================== --- head/lib/libstand/ext2fs.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/ext2fs.c Fri Dec 30 19:06:29 2016 (r310850) @@ -355,7 +355,7 @@ ext2fs_open(const char *upath, struct op fp->f_fs = fs; twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - EXT2_SBLOCK, 0, EXT2_SBSIZE, (char *)fs, &buf_size); + EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size); if (error) goto out; @@ -397,7 +397,7 @@ ext2fs_open(const char *upath, struct op fp->f_bg = malloc(len); twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, 0, len, + EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len, (char *)fp->f_bg, &buf_size); if (error) goto out; @@ -509,7 +509,7 @@ ext2fs_open(const char *upath, struct op twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, - F_READ, fsb_to_db(fs, disk_block), 0, + F_READ, fsb_to_db(fs, disk_block), fs->fs_bsize, buf, &buf_size); if (error) goto out; @@ -570,7 +570,7 @@ read_inode(ino_t inumber, struct open_fi buf = malloc(fs->fs_bsize); twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - ino_to_db(fs, fp->f_bg, inumber), 0, fs->fs_bsize, buf, &rsize); + ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize); if (error) goto out; if (rsize != fs->fs_bsize) { @@ -667,7 +667,7 @@ block_map(struct open_file *f, daddr_t f malloc(fs->fs_bsize); twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsb_to_db(fp->f_fs, ind_block_num), 0, fs->fs_bsize, + fsb_to_db(fp->f_fs, ind_block_num), fs->fs_bsize, fp->f_blk[level], &fp->f_blksize[level]); if (error) return (error); @@ -725,7 +725,7 @@ buf_read_file(struct open_file *f, char } else { twiddle(4); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsb_to_db(fs, disk_block), 0, block_size, + fsb_to_db(fs, disk_block), block_size, fp->f_buf, &fp->f_buf_size); if (error) goto done; Modified: head/lib/libstand/nandfs.c ============================================================================== --- head/lib/libstand/nandfs.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/nandfs.c Fri Dec 30 19:06:29 2016 (r310850) @@ -1024,7 +1024,7 @@ ioread(struct open_file *f, off_t pos, v buffer = malloc(nsec * bsize); - err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos, 0, + err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos, nsec * bsize, buffer, NULL); memcpy(buf, (void *)((uintptr_t)buffer + off), length); Modified: head/lib/libstand/read.c ============================================================================== --- head/lib/libstand/read.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/read.c Fri Dec 30 19:06:29 2016 (r310850) @@ -79,7 +79,7 @@ read(int fd, void *dest, size_t bcount) if (f->f_flags & F_RAW) { twiddle(4); errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - btodb(f->f_offset), 0, bcount, dest, &resid); + btodb(f->f_offset), bcount, dest, &resid); if (errno) return (-1); f->f_offset += resid; Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/stand.h Fri Dec 30 19:06:29 2016 (r310850) @@ -139,7 +139,7 @@ struct devsw { int dv_type; /* opaque type constant, arch-dependant */ int (*dv_init)(void); /* early probe call */ int (*dv_strategy)(void *devdata, int rw, daddr_t blk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); int (*dv_open)(struct open_file *f, ...); int (*dv_close)(struct open_file *f); int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); Modified: head/lib/libstand/ufs.c ============================================================================== --- head/lib/libstand/ufs.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/ufs.c Fri Dec 30 19:06:29 2016 (r310850) @@ -157,7 +157,7 @@ read_inode(inumber, f) buf = malloc(fs->fs_bsize); twiddle(1); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fs, ino_to_fsba(fs, inumber)), 0, fs->fs_bsize, + fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize, buf, &rsize); if (rc) goto out; @@ -267,7 +267,7 @@ block_map(f, file_block, disk_block_p) malloc(fs->fs_bsize); twiddle(1); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fp->f_fs, ind_block_num), 0, + fsbtodb(fp->f_fs, ind_block_num), fs->fs_bsize, fp->f_blk[level], &fp->f_blksize[level]); @@ -348,7 +348,7 @@ buf_write_file(f, buf_p, size_p) twiddle(4); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fs, disk_block), 0, + fsbtodb(fs, disk_block), block_size, fp->f_buf, &fp->f_buf_size); if (rc) return (rc); @@ -367,7 +367,7 @@ buf_write_file(f, buf_p, size_p) twiddle(4); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, - fsbtodb(fs, disk_block), 0, + fsbtodb(fs, disk_block), block_size, fp->f_buf, &fp->f_buf_size); return (rc); } @@ -408,7 +408,7 @@ buf_read_file(f, buf_p, size_p) } else { twiddle(4); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fs, disk_block), 0, + fsbtodb(fs, disk_block), block_size, fp->f_buf, &fp->f_buf_size); if (rc) return (rc); @@ -521,7 +521,7 @@ ufs_open(upath, f) */ for (i = 0; sblock_try[i] != -1; i++) { rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - sblock_try[i] / DEV_BSIZE, 0, SBLOCKSIZE, + sblock_try[i] / DEV_BSIZE, SBLOCKSIZE, (char *)fs, &buf_size); if (rc) goto out; @@ -651,7 +651,7 @@ ufs_open(upath, f) twiddle(1); rc = (f->f_dev->dv_strategy)(f->f_devdata, - F_READ, fsbtodb(fs, disk_block), 0, + F_READ, fsbtodb(fs, disk_block), fs->fs_bsize, buf, &buf_size); if (rc) goto out; Modified: head/lib/libstand/write.c ============================================================================== --- head/lib/libstand/write.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/lib/libstand/write.c Fri Dec 30 19:06:29 2016 (r310850) @@ -82,7 +82,7 @@ write(fd, dest, bcount) if (f->f_flags & F_RAW) { twiddle(4); errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, - btodb(f->f_offset), 0, bcount, dest, &resid); + btodb(f->f_offset), bcount, dest, &resid); if (errno) return (-1); f->f_offset += resid; Modified: head/sys/boot/common/bcache.c ============================================================================== --- head/sys/boot/common/bcache.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/common/bcache.c Fri Dec 30 19:06:29 2016 (r310850) @@ -182,8 +182,8 @@ bcache_free(void *cache) * cache with the new values. */ static int -write_strategy(void *devdata, int rw, daddr_t blk, size_t offset, - size_t size, char *buf, size_t *rsize) +write_strategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize) { struct bcache_devdata *dd = (struct bcache_devdata *)devdata; struct bcache *bc = dd->dv_cache; @@ -197,7 +197,7 @@ write_strategy(void *devdata, int rw, da } /* Write the blocks */ - return (dd->dv_strategy(dd->dv_devdata, rw, blk, offset, size, buf, rsize)); + return (dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize)); } /* @@ -206,8 +206,8 @@ write_strategy(void *devdata, int rw, da * device I/O and then use the I/O results to populate the cache. */ static int -read_strategy(void *devdata, int rw, daddr_t blk, size_t offset, - size_t size, char *buf, size_t *rsize) +read_strategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize) { struct bcache_devdata *dd = (struct bcache_devdata *)devdata; struct bcache *bc = dd->dv_cache; @@ -225,7 +225,7 @@ read_strategy(void *devdata, int rw, dad *rsize = 0; nblk = size / bcache_blksize; - if ((nblk == 0 && size != 0) || offset != 0) + if (nblk == 0 && size != 0) nblk++; result = 0; complete = 1; @@ -246,8 +246,7 @@ read_strategy(void *devdata, int rw, dad if (complete) { /* whole set was in cache, return it */ if (bc->ra < BCACHE_READAHEAD) bc->ra <<= 1; /* increase read ahead */ - bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, - buf, size); + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); goto done; } @@ -282,7 +281,7 @@ read_strategy(void *devdata, int rw, dad * in either case we should return the data in bcache and only * return error if there is no data. */ - result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, 0, + result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, &r_size); r_size /= bcache_blksize; @@ -307,8 +306,7 @@ read_strategy(void *devdata, int rw, dad size = i * bcache_blksize; if (size != 0) { - bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, - buf, size); + bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); result = 0; } @@ -323,8 +321,8 @@ read_strategy(void *devdata, int rw, dad * directly to the disk. XXX tune this. */ int -bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset, - size_t size, char *buf, size_t *rsize) +bcache_strategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize) { struct bcache_devdata *dd = (struct bcache_devdata *)devdata; struct bcache *bc = dd->dv_cache; @@ -339,23 +337,16 @@ bcache_strategy(void *devdata, int rw, d /* bypass large requests, or when the cache is inactive */ if (bc == NULL || - (offset == 0 && ((size * 2 / bcache_blksize) > bcache_nblks))) { + ((size * 2 / bcache_blksize) > bcache_nblks)) { DEBUG("bypass %d from %d", size / bcache_blksize, blk); bcache_bypasses++; - return (dd->dv_strategy(dd->dv_devdata, rw, blk, offset, size, buf, - rsize)); - } - - /* normalize offset */ - while (offset >= bcache_blksize) { - blk++; - offset -= bcache_blksize; + return (dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize)); } switch (rw) { case F_READ: nblk = size / bcache_blksize; - if (offset || (size != 0 && nblk == 0)) + if (size != 0 && nblk == 0) nblk++; /* read at least one block */ ret = 0; @@ -366,14 +357,10 @@ bcache_strategy(void *devdata, int rw, d if (size <= bcache_blksize) csize = size; - else { + else csize = cblk * bcache_blksize; - if (offset) - csize -= (bcache_blksize - offset); - } - ret = read_strategy(devdata, rw, blk, offset, - csize, buf+total, &isize); + ret = read_strategy(devdata, rw, blk, csize, buf+total, &isize); /* * we may have error from read ahead, if we have read some data @@ -384,8 +371,7 @@ bcache_strategy(void *devdata, int rw, d ret = 0; break; } - blk += (offset+isize) / bcache_blksize; - offset = 0; + blk += isize / bcache_blksize; total += isize; size -= isize; nblk = size / bcache_blksize; @@ -396,7 +382,7 @@ bcache_strategy(void *devdata, int rw, d return (ret); case F_WRITE: - return write_strategy(devdata, rw, blk, offset, size, buf, rsize); + return write_strategy(devdata, rw, blk, size, buf, rsize); } return -1; } Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/common/bootstrap.h Fri Dec 30 19:06:29 2016 (r310850) @@ -77,8 +77,8 @@ void bcache_init(u_int nblks, size_t bsi void bcache_add_dev(int); void *bcache_allocate(void); void bcache_free(void *); -int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t offset, - size_t size, char *buf, size_t *rsize); +int bcache_strategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize); /* * Disk block cache @@ -86,7 +86,7 @@ int bcache_strategy(void *devdata, int r struct bcache_devdata { int (*dv_strategy)(void *devdata, int rw, daddr_t blk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); void *dv_devdata; void *dv_cache; }; Modified: head/sys/boot/common/disk.c ============================================================================== --- head/sys/boot/common/disk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/common/disk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -178,7 +178,7 @@ ptblread(void *d, void *buf, size_t bloc dev = (struct disk_devdesc *)d; od = (struct open_disk *)dev->d_opendata; - return (dev->d_dev->dv_strategy(dev, F_READ, offset, 0, + return (dev->d_dev->dv_strategy(dev, F_READ, offset, blocks * od->sectorsize, (char *)buf, NULL)); } @@ -244,7 +244,7 @@ disk_read(struct disk_devdesc *dev, void int ret; od = (struct open_disk *)dev->d_opendata; - ret = dev->d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset, 0, + ret = dev->d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset, blocks * od->sectorsize, buf, NULL); return (ret); @@ -257,7 +257,7 @@ disk_write(struct disk_devdesc *dev, voi int ret; od = (struct open_disk *)dev->d_opendata; - ret = dev->d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset, 0, + ret = dev->d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset, blocks * od->sectorsize, buf, NULL); return (ret); Modified: head/sys/boot/common/md.c ============================================================================== --- head/sys/boot/common/md.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/common/md.c Fri Dec 30 19:06:29 2016 (r310850) @@ -60,7 +60,7 @@ static struct { /* devsw I/F */ static int md_init(void); -static int md_strategy(void *, int, daddr_t, size_t, size_t, char *, size_t *); +static int md_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int md_open(struct open_file *, ...); static int md_close(struct open_file *); static int md_print(int); @@ -84,7 +84,7 @@ md_init(void) } static int -md_strategy(void *devdata, int rw, daddr_t blk, size_t offset, size_t size, +md_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, size_t *rsize) { struct devdesc *dev = (struct devdesc *)devdata; Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/efi/libefi/efipart.c Fri Dec 30 19:06:29 2016 (r310850) @@ -41,10 +41,8 @@ __FBSDID("$FreeBSD$"); static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; static int efipart_init(void); -static int efipart_strategy(void *, int, daddr_t, size_t, size_t, char *, - size_t *); -static int efipart_realstrategy(void *, int, daddr_t, size_t, size_t, char *, - size_t *); +static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static int efipart_realstrategy(void *, int, daddr_t, size_t, char *, size_t *); static int efipart_open(struct open_file *, ...); static int efipart_close(struct open_file *); static int efipart_print(int); @@ -289,8 +287,8 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i } static int -efipart_strategy(void *devdata, int rw, daddr_t blk, size_t offset, - size_t size, char *buf, size_t *rsize) +efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize) { struct bcache_devdata bcd; struct devdesc *dev; @@ -299,13 +297,12 @@ efipart_strategy(void *devdata, int rw, bcd.dv_strategy = efipart_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = PD(dev).pd_bcache; - return (bcache_strategy(&bcd, rw, blk, offset, size, - buf, rsize)); + return (bcache_strategy(&bcd, rw, blk, size, buf, rsize)); } static int -efipart_realstrategy(void *devdata, int rw, daddr_t blk, size_t offset, - size_t size, char *buf, size_t *rsize) +efipart_realstrategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize) { struct devdesc *dev = (struct devdesc *)devdata; EFI_BLOCK_IO *blkio; Modified: head/sys/boot/i386/libfirewire/firewire.c ============================================================================== --- head/sys/boot/i386/libfirewire/firewire.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/i386/libfirewire/firewire.c Fri Dec 30 19:06:29 2016 (r310850) @@ -66,7 +66,7 @@ struct crom_src_buf { static int fw_init(void); static int fw_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int fw_open(struct open_file *f, ...); static int fw_close(struct open_file *f); static int fw_print(int verbose); @@ -210,7 +210,7 @@ fw_cleanup() } static int -fw_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +fw_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { return (EIO); Modified: head/sys/boot/i386/libi386/bioscd.c ============================================================================== --- head/sys/boot/i386/libi386/bioscd.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/i386/libi386/bioscd.c Fri Dec 30 19:06:29 2016 (r310850) @@ -95,9 +95,9 @@ static int nbcinfo = 0; static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest); static int bc_init(void); static int bc_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int bc_realstrategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int bc_open(struct open_file *f, ...); static int bc_close(struct open_file *f); static int bc_print(int verbose); @@ -237,7 +237,7 @@ bc_close(struct open_file *f) } static int -bc_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +bc_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct bcache_devdata bcd; @@ -248,11 +248,11 @@ bc_strategy(void *devdata, int rw, daddr bcd.dv_devdata = devdata; bcd.dv_cache = BC(dev).bc_bcache; - return (bcache_strategy(&bcd, rw, dblk, offset, size, buf, rsize)); + return (bcache_strategy(&bcd, rw, dblk, size, buf, rsize)); } static int -bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct i386_devdesc *dev; Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/i386/libi386/biosdisk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -128,10 +128,10 @@ static int bd_write(struct disk_devdesc static int bd_int13probe(struct bdinfo *bd); static int bd_init(void); -static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsize); -static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsize); +static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsize); +static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsize); static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); static int bd_ioctl(struct open_file *f, u_long cmd, void *data); @@ -502,7 +502,7 @@ bd_ioctl(struct open_file *f, u_long cmd } static int -bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct bcache_devdata bcd; @@ -512,12 +512,12 @@ bd_strategy(void *devdata, int rw, daddr bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = BD(dev).bd_bcache; - return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, offset, + return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, size, buf, rsize)); } static int -bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/i386/libi386/pxe.c Fri Dec 30 19:06:29 2016 (r310850) @@ -72,7 +72,7 @@ static void bangpxe_call(int func); static int pxe_init(void); static int pxe_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int pxe_open(struct open_file *f, ...); static int pxe_close(struct open_file *f); static int pxe_print(int verbose); @@ -247,8 +247,8 @@ pxe_init(void) static int -pxe_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, size_t size, - char *buf, size_t *rsize) +pxe_strategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsize) { return (EIO); } Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c ============================================================================== --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Fri Dec 30 19:06:29 2016 (r310850) @@ -45,7 +45,7 @@ static int beri_cfi_disk_init(void); static int beri_cfi_disk_open(struct open_file *, ...); static int beri_cfi_disk_close(struct open_file *); static void beri_cfi_disk_cleanup(void); -static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, size_t, +static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int beri_cfi_disk_print(int); @@ -69,8 +69,8 @@ beri_cfi_disk_init(void) } static int -beri_cfi_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsizep) +beri_cfi_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsizep) { int error; Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c ============================================================================== --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Fri Dec 30 19:06:29 2016 (r310850) @@ -45,7 +45,7 @@ static int beri_sdcard_disk_init(void); static int beri_sdcard_disk_open(struct open_file *, ...); static int beri_sdcard_disk_close(struct open_file *); static void beri_sdcard_disk_cleanup(void); -static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, size_t, +static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int beri_sdcard_disk_print(int); @@ -69,8 +69,8 @@ beri_sdcard_disk_init(void) } static int -beri_sdcard_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsizep) +beri_sdcard_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsizep) { int error; Modified: head/sys/boot/ofw/libofw/ofw_disk.c ============================================================================== --- head/sys/boot/ofw/libofw/ofw_disk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/ofw/libofw/ofw_disk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); static int ofwd_init(void); static int ofwd_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int ofwd_open(struct open_file *f, ...); static int ofwd_close(struct open_file *f); static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); @@ -83,8 +83,8 @@ ofwd_init(void) } static int -ofwd_strategy(void *devdata, int flag __unused, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsize) +ofwd_strategy(void *devdata, int flag __unused, daddr_t dblk, size_t size, + char *buf, size_t *rsize) { struct ofw_devdesc *dp = (struct ofw_devdesc *)devdata; daddr_t pos; Modified: head/sys/boot/pc98/libpc98/bioscd.c ============================================================================== --- head/sys/boot/pc98/libpc98/bioscd.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/pc98/libpc98/bioscd.c Fri Dec 30 19:06:29 2016 (r310850) @@ -94,9 +94,9 @@ static int nbcinfo = 0; static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest); static int bc_init(void); static int bc_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int bc_realstrategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int bc_open(struct open_file *f, ...); static int bc_close(struct open_file *f); static int bc_print(int verbose); @@ -233,7 +233,7 @@ bc_close(struct open_file *f) } static int -bc_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +bc_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct bcache_devdata bcd; @@ -244,11 +244,11 @@ bc_strategy(void *devdata, int rw, daddr bcd.dv_devdata = devdata; bcd.dv_cache = BC(dev).bc_bcache; - return (bcache_strategy(&bcd, rw, dblk, offset, size, buf, rsize)); + return (bcache_strategy(&bcd, rw, dblk, size, buf, rsize)); } static int -bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct i386_devdesc *dev; Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/pc98/libpc98/biosdisk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -118,9 +118,9 @@ static int bd_printbsdslice(struct open_ static int bd_init(void); static int bd_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); static int bd_print(int verbose); @@ -746,7 +746,7 @@ bd_closedisk(struct open_disk *od) } static int -bd_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, size_t size, +bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct bcache_devdata bcd; @@ -756,12 +756,11 @@ bd_strategy(void *devdata, int rw, daddr bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = BD(dev).bd_bcache; - return(bcache_strategy(&bcd, rw, dblk+od->od_boff, offset, - size, buf, rsize)); + return(bcache_strategy(&bcd, rw, dblk+od->od_boff, size, buf, rsize)); } static int -bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t offset, +bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { struct open_disk *od = (struct open_disk *)(((struct i386_devdesc *)devdata)->d_kind.biosdisk.data); Modified: head/sys/boot/powerpc/kboot/hostdisk.c ============================================================================== --- head/sys/boot/powerpc/kboot/hostdisk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/powerpc/kboot/hostdisk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); static int hostdisk_init(void); static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int hostdisk_open(struct open_file *f, ...); static int hostdisk_close(struct open_file *f); static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); @@ -58,8 +58,8 @@ hostdisk_init(void) } static int -hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsize) +hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsize) { struct devdesc *desc = devdata; daddr_t pos; Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c ============================================================================== --- head/sys/boot/powerpc/ps3/ps3cdrom.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Fri Dec 30 19:06:29 2016 (r310850) @@ -46,7 +46,7 @@ static int ps3cdrom_init(void); static int ps3cdrom_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int ps3cdrom_open(struct open_file *f, ...); static int ps3cdrom_close(struct open_file *f); static int ps3cdrom_print(int verbose); @@ -76,7 +76,7 @@ static int ps3cdrom_init(void) } static int ps3cdrom_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize) + size_t size, char *buf, size_t *rsize) { struct ps3_devdesc *dev = (struct ps3_devdesc *) devdata; int err; Modified: head/sys/boot/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/boot/powerpc/ps3/ps3disk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/powerpc/ps3/ps3disk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -58,7 +58,7 @@ static void ps3disk_uuid_letoh(uuid_t *u static int ps3disk_init(void); static int ps3disk_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int ps3disk_open(struct open_file *f, ...); static int ps3disk_close(struct open_file *f); static int ps3disk_print(int verbose); @@ -109,7 +109,7 @@ static int ps3disk_init(void) } static int ps3disk_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize) + size_t size, char *buf, size_t *rsize) { struct ps3_devdesc *dev = (struct ps3_devdesc *) devdata; struct open_dev *od = (struct open_dev *) dev->d_disk.data; Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/uboot/lib/disk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -73,8 +73,7 @@ static int stor_readdev(struct disk_devd /* devsw I/F */ static int stor_init(void); -static int stor_strategy(void *, int, daddr_t, size_t, size_t, char *, - size_t *); +static int stor_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int stor_open(struct open_file *, ...); static int stor_close(struct open_file *); static int stor_ioctl(struct open_file *f, u_long cmd, void *data); @@ -144,7 +143,7 @@ stor_cleanup(void) } static int -stor_strategy(void *devdata, int rw, daddr_t blk, size_t offset, size_t size, +stor_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; Modified: head/sys/boot/usb/storage/umass_loader.c ============================================================================== --- head/sys/boot/usb/storage/umass_loader.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/usb/storage/umass_loader.c Fri Dec 30 19:06:29 2016 (r310850) @@ -48,8 +48,7 @@ static int umass_disk_open(struct open_f static int umass_disk_close(struct open_file *); static void umass_disk_cleanup(void); static int umass_disk_ioctl(struct open_file *, u_long, void *); -static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, char *, - size_t *); +static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int umass_disk_print(int); struct devsw umass_disk = { @@ -85,8 +84,8 @@ umass_disk_init(void) } static int -umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsizep) +umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsizep) { if (umass_uaa.device == NULL) return (ENXIO); Modified: head/sys/boot/userboot/userboot/host.c ============================================================================== --- head/sys/boot/userboot/userboot/host.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/userboot/userboot/host.c Fri Dec 30 19:06:29 2016 (r310850) @@ -171,8 +171,8 @@ host_dev_close(struct open_file *f) } static int -host_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsize) +host_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t size, + char *buf, size_t *rsize) { return (ENOSYS); Modified: head/sys/boot/userboot/userboot/userboot_disk.c ============================================================================== --- head/sys/boot/userboot/userboot/userboot_disk.c Fri Dec 30 18:55:33 2016 (r310849) +++ head/sys/boot/userboot/userboot/userboot_disk.c Fri Dec 30 19:06:29 2016 (r310850) @@ -54,9 +54,9 @@ static struct userdisk_info *ud_info; static int userdisk_init(void); static void userdisk_cleanup(void); static int userdisk_strategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int userdisk_realstrategy(void *devdata, int flag, daddr_t dblk, - size_t offset, size_t size, char *buf, size_t *rsize); + size_t size, char *buf, size_t *rsize); static int userdisk_open(struct open_file *f, ...); static int userdisk_close(struct open_file *f); static int userdisk_ioctl(struct open_file *f, u_long cmd, void *data); @@ -189,8 +189,8 @@ userdisk_close(struct open_file *f) } static int -userdisk_strategy(void *devdata, int rw, daddr_t dblk, size_t offset, - size_t size, char *buf, size_t *rsize) +userdisk_strategy(void *devdata, int rw, daddr_t dblk, size_t size, + char *buf, size_t *rsize) { struct bcache_devdata bcd; struct disk_devdesc *dev; @@ -199,13 +199,13 @@ userdisk_strategy(void *devdata, int rw, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 30 19:43:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91D74C972B0; Fri, 30 Dec 2016 19:43:24 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6100E163C; Fri, 30 Dec 2016 19:43:24 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUJhNl3064690; Fri, 30 Dec 2016 19:43:23 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUJhNTg064689; Fri, 30 Dec 2016 19:43:23 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612301943.uBUJhNTg064689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 19:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310851 - stable/11/sys/arm/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 19:43:24 -0000 Author: loos Date: Fri Dec 30 19:43:23 2016 New Revision: 310851 URL: https://svnweb.freebsd.org/changeset/base/310851 Log: MFC r303227 Remove unused USB ethernet driver from BEAGLEBONE/AM335x kernel. Modified: stable/11/sys/arm/conf/BEAGLEBONE Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/11/sys/arm/conf/BEAGLEBONE Fri Dec 30 19:06:29 2016 (r310850) +++ stable/11/sys/arm/conf/BEAGLEBONE Fri Dec 30 19:43:23 2016 (r310851) @@ -114,7 +114,6 @@ device bpf # USB Ethernet support, requires miibus device miibus -device axe # ASIX Electronics USB Ethernet # Device mode support and USFS template device usb_template # Control of the gadget From owner-svn-src-all@freebsd.org Fri Dec 30 19:55:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB688C97542; Fri, 30 Dec 2016 19:55:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95C261ABE; Fri, 30 Dec 2016 19:55:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUJt4uL068865; Fri, 30 Dec 2016 19:55:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUJt4Vm068861; Fri, 30 Dec 2016 19:55:04 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612301955.uBUJt4Vm068861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 19:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310852 - in stable/11/sys: arm/altera/socfpga conf dev/mii X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 19:55:05 -0000 Author: loos Date: Fri Dec 30 19:55:04 2016 New Revision: 310852 URL: https://svnweb.freebsd.org/changeset/base/310852 Log: MFC of r303230, r303253 and r303420: Add support for the Microchip/Micrel KSZ9031 Gigabit Ethernet PHY. Enable the build of micphy as part of generic miibus build, but only for FDT enabled systems. The Micrel PHYs reads the optional external delays from DTB. Tested on uBMC and uFW. Sponsored by: Rubicon Communications (Netgate) Modified: stable/11/sys/arm/altera/socfpga/files.socfpga stable/11/sys/conf/files stable/11/sys/dev/mii/micphy.c stable/11/sys/dev/mii/miidevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- stable/11/sys/arm/altera/socfpga/files.socfpga Fri Dec 30 19:43:23 2016 (r310851) +++ stable/11/sys/arm/altera/socfpga/files.socfpga Fri Dec 30 19:55:04 2016 (r310852) @@ -9,7 +9,6 @@ arm/altera/socfpga/socfpga_rstmgr.c sta arm/altera/socfpga/socfpga_mp.c optional smp arm/altera/socfpga/socfpga_gpio.c optional gpio -dev/mii/micphy.c optional micphy dev/mmc/host/dwmmc.c optional dwmmc # BERI specific Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Fri Dec 30 19:43:23 2016 (r310851) +++ stable/11/sys/conf/files Fri Dec 30 19:55:04 2016 (r310852) @@ -2094,6 +2094,7 @@ dev/mii/icsphy.c optional miibus | icsp dev/mii/ip1000phy.c optional miibus | ip1000phy dev/mii/jmphy.c optional miibus | jmphy dev/mii/lxtphy.c optional miibus | lxtphy +dev/mii/micphy.c optional miibus fdt | micphy fdt dev/mii/mii.c optional miibus | mii dev/mii/mii_bitbang.c optional miibus | mii_bitbang dev/mii/mii_physubr.c optional miibus | mii Modified: stable/11/sys/dev/mii/micphy.c ============================================================================== --- stable/11/sys/dev/mii/micphy.c Fri Dec 30 19:43:23 2016 (r310851) +++ stable/11/sys/dev/mii/micphy.c Fri Dec 30 19:55:04 2016 (r310852) @@ -67,6 +67,14 @@ __FBSDID("$FreeBSD$"); #define MII_KSZPHY_CLK_CONTROL_PAD_SKEW 0x104 #define MII_KSZPHY_RX_DATA_PAD_SKEW 0x105 #define MII_KSZPHY_TX_DATA_PAD_SKEW 0x106 +/* KSZ9031 */ +#define MII_KSZ9031_MMD_ACCESS_CTRL 0x0d +#define MII_KSZ9031_MMD_ACCESS_DATA 0x0e +#define MII_KSZ9031_MMD_DATA_NOINC (1 << 14) +#define MII_KSZ9031_CONTROL_PAD_SKEW 0x4 +#define MII_KSZ9031_RX_DATA_PAD_SKEW 0x5 +#define MII_KSZ9031_TX_DATA_PAD_SKEW 0x6 +#define MII_KSZ9031_CLOCK_PAD_SKEW 0x8 #define PS_TO_REG(p) ((p) / 200) @@ -95,6 +103,7 @@ DRIVER_MODULE(micphy, miibus, micphy_dri static const struct mii_phydesc micphys[] = { MII_PHY_DESC(MICREL, KSZ9021), + MII_PHY_DESC(MICREL, KSZ9031), MII_PHY_END }; @@ -104,48 +113,128 @@ static const struct mii_phy_funcs micphy mii_phy_reset }; +static uint32_t +ksz9031_read(struct mii_softc *sc, uint32_t devaddr, uint32_t reg) +{ + /* Set up device address and register. */ + PHY_WRITE(sc, MII_KSZ9031_MMD_ACCESS_CTRL, devaddr); + PHY_WRITE(sc, MII_KSZ9031_MMD_ACCESS_DATA, reg); + + /* Select register data for MMD and read the value. */ + PHY_WRITE(sc, MII_KSZ9031_MMD_ACCESS_CTRL, + MII_KSZ9031_MMD_DATA_NOINC | devaddr); + + return (PHY_READ(sc, MII_KSZ9031_MMD_ACCESS_DATA)); +} + +static void +ksz9031_write(struct mii_softc *sc, uint32_t devaddr, uint32_t reg, + uint32_t val) +{ + + /* Set up device address and register. */ + PHY_WRITE(sc, MII_KSZ9031_MMD_ACCESS_CTRL, devaddr); + PHY_WRITE(sc, MII_KSZ9031_MMD_ACCESS_DATA, reg); + + /* Select register data for MMD and write the value. */ + PHY_WRITE(sc, MII_KSZ9031_MMD_ACCESS_CTRL, + MII_KSZ9031_MMD_DATA_NOINC | devaddr); + PHY_WRITE(sc, MII_KSZ9031_MMD_ACCESS_DATA, val); +} + +static uint32_t +ksz9021_read(struct mii_softc *sc, uint32_t reg) +{ + + PHY_WRITE(sc, MII_KSZPHY_EXTREG, reg); + + return (PHY_READ(sc, MII_KSZPHY_EXTREG_READ)); +} + static void -micphy_write(struct mii_softc *sc, uint32_t reg, uint32_t val) +ksz9021_write(struct mii_softc *sc, uint32_t reg, uint32_t val) { PHY_WRITE(sc, MII_KSZPHY_EXTREG, KSZPHY_EXTREG_WRITE | reg); PHY_WRITE(sc, MII_KSZPHY_EXTREG_WRITE, val); } -static int -ksz9021_load_values(struct mii_softc *sc, phandle_t node, uint32_t reg, - char *field1, char *field2, - char *field3, char *field4) +static void +ksz90x1_load_values(struct mii_softc *sc, phandle_t node, + uint32_t dev, uint32_t reg, char *field1, uint32_t f1mask, int f1off, + char *field2, uint32_t f2mask, int f2off, char *field3, uint32_t f3mask, + int f3off, char *field4, uint32_t f4mask, int f4off) { pcell_t dts_value[1]; int len; int val; - val = 0; + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ9031) + val = ksz9031_read(sc, dev, reg); + else + val = ksz9021_read(sc, reg); if ((len = OF_getproplen(node, field1)) > 0) { OF_getencprop(node, field1, dts_value, len); - val = PS_TO_REG(dts_value[0]); + val &= ~(f1mask << f1off); + val |= (PS_TO_REG(dts_value[0]) & f1mask) << f1off; } - if ((len = OF_getproplen(node, field2)) > 0) { + if (field2 != NULL && (len = OF_getproplen(node, field2)) > 0) { OF_getencprop(node, field2, dts_value, len); - val |= PS_TO_REG(dts_value[0]) << 4; + val &= ~(f2mask << f2off); + val |= (PS_TO_REG(dts_value[0]) & f2mask) << f2off; } - if ((len = OF_getproplen(node, field3)) > 0) { + if (field3 != NULL && (len = OF_getproplen(node, field3)) > 0) { OF_getencprop(node, field3, dts_value, len); - val |= PS_TO_REG(dts_value[0]) << 8; + val &= ~(f3mask << f3off); + val |= (PS_TO_REG(dts_value[0]) & f3mask) << f3off; } - if ((len = OF_getproplen(node, field4)) > 0) { + if (field4 != NULL && (len = OF_getproplen(node, field4)) > 0) { OF_getencprop(node, field4, dts_value, len); - val |= PS_TO_REG(dts_value[0]) << 12; + val &= ~(f4mask << f4off); + val |= (PS_TO_REG(dts_value[0]) & f4mask) << f4off; } - micphy_write(sc, reg, val); + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ9031) + ksz9031_write(sc, dev, reg, val); + else + ksz9021_write(sc, reg, val); +} - return (0); +static void +ksz9031_load_values(struct mii_softc *sc, phandle_t node) +{ + + ksz90x1_load_values(sc, node, 2, MII_KSZ9031_CONTROL_PAD_SKEW, + "txen-skew-ps", 0xf, 0, "rxdv-skew-ps", 0xf, 4, + NULL, 0, 0, NULL, 0, 0); + ksz90x1_load_values(sc, node, 2, MII_KSZ9031_RX_DATA_PAD_SKEW, + "rxd0-skew-ps", 0xf, 0, "rxd1-skew-ps", 0xf, 4, + "rxd2-skew-ps", 0xf, 8, "rxd3-skew-ps", 0xf, 12); + ksz90x1_load_values(sc, node, 2, MII_KSZ9031_TX_DATA_PAD_SKEW, + "txd0-skew-ps", 0xf, 0, "txd1-skew-ps", 0xf, 4, + "txd2-skew-ps", 0xf, 8, "txd3-skew-ps", 0xf, 12); + ksz90x1_load_values(sc, node, 2, MII_KSZ9031_CLOCK_PAD_SKEW, + "rxc-skew-ps", 0x1f, 0, "txc-skew-ps", 0x1f, 5, + NULL, 0, 0, NULL, 0, 0); +} + +static void +ksz9021_load_values(struct mii_softc *sc, phandle_t node) +{ + + ksz90x1_load_values(sc, node, 0, MII_KSZPHY_CLK_CONTROL_PAD_SKEW, + "txen-skew-ps", 0xf, 0, "txc-skew-ps", 0xf, 4, + "rxdv-skew-ps", 0xf, 8, "rxc-skew-ps", 0xf, 12); + ksz90x1_load_values(sc, node, 0, MII_KSZPHY_RX_DATA_PAD_SKEW, + "rxd0-skew-ps", 0xf, 0, "rxd1-skew-ps", 0xf, 4, + "rxd2-skew-ps", 0xf, 8, "rxd3-skew-ps", 0xf, 12); + ksz90x1_load_values(sc, node, 0, MII_KSZPHY_TX_DATA_PAD_SKEW, + "txd0-skew-ps", 0xf, 0, "txd1-skew-ps", 0xf, 4, + "txd2-skew-ps", 0xf, 8, "txd3-skew-ps", 0xf, 12); } static int @@ -174,17 +263,10 @@ micphy_attach(device_t dev) if ((node = ofw_bus_get_node(parent)) == -1) return (ENXIO); - ksz9021_load_values(sc, node, MII_KSZPHY_CLK_CONTROL_PAD_SKEW, - "txen-skew-ps", "txc-skew-ps", - "rxdv-skew-ps", "rxc-skew-ps"); - - ksz9021_load_values(sc, node, MII_KSZPHY_RX_DATA_PAD_SKEW, - "rxd0-skew-ps", "rxd1-skew-ps", - "rxd2-skew-ps", "rxd3-skew-ps"); - - ksz9021_load_values(sc, node, MII_KSZPHY_TX_DATA_PAD_SKEW, - "txd0-skew-ps", "txd1-skew-ps", - "txd2-skew-ps", "txd3-skew-ps"); + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ9031) + ksz9031_load_values(sc, node); + else + ksz9021_load_values(sc, node); return (0); } Modified: stable/11/sys/dev/mii/miidevs ============================================================================== --- stable/11/sys/dev/mii/miidevs Fri Dec 30 19:43:23 2016 (r310851) +++ stable/11/sys/dev/mii/miidevs Fri Dec 30 19:55:04 2016 (r310852) @@ -283,6 +283,7 @@ model MARVELL E1111 0x000c Marvell 88E1 /* Micrel PHYs */ model MICREL KSZ9021 0x0021 Micrel KSZ9021 10/100/1000 PHY +model MICREL KSZ9031 0x0022 Micrel KSZ9031 10/100/1000 PHY /* Myson Technology PHYs */ model xxMYSON MTD972 0x0000 MTD972 10/100 media interface From owner-svn-src-all@freebsd.org Fri Dec 30 20:00:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10EEDC9766D; Fri, 30 Dec 2016 20:00:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4C9D1DD5; Fri, 30 Dec 2016 20:00:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUK0gZS069187; Fri, 30 Dec 2016 20:00:42 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUK0gFK069186; Fri, 30 Dec 2016 20:00:42 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201612302000.uBUK0gFK069186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 30 Dec 2016 20:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310853 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:00:43 -0000 Author: tsoome Date: Fri Dec 30 20:00:41 2016 New Revision: 310853 URL: https://svnweb.freebsd.org/changeset/base/310853 Log: loader: nandfs calls strategy with one extra argument. The strategy argument cleanup in r310850 did miss another call to strategy(), and left it with extra argument. Reviewed by: allanjude Approved by: allanjude (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9003 Modified: head/lib/libstand/nandfs.c Modified: head/lib/libstand/nandfs.c ============================================================================== --- head/lib/libstand/nandfs.c Fri Dec 30 19:55:04 2016 (r310852) +++ head/lib/libstand/nandfs.c Fri Dec 30 20:00:41 2016 (r310853) @@ -1045,7 +1045,7 @@ nandfs_probe_sectorsize(struct open_file for (i = 512; i < (16 * 1024); i <<= 1) { NANDFS_DEBUG("%d ", i); - err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, 0, i, + err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, i, buffer, NULL); if (err == 0) { From owner-svn-src-all@freebsd.org Fri Dec 30 20:16:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0654C97BAE; Fri, 30 Dec 2016 20:16:10 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF93E14BC; Fri, 30 Dec 2016 20:16:10 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKG94t076782; Fri, 30 Dec 2016 20:16:09 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKG9Di076781; Fri, 30 Dec 2016 20:16:09 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201612302016.uBUKG9Di076781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Fri, 30 Dec 2016 20:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310854 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:16:11 -0000 Author: jmcneill Date: Fri Dec 30 20:16:09 2016 New Revision: 310854 URL: https://svnweb.freebsd.org/changeset/base/310854 Log: Add missing reg property to usbphy node. MFC after: 1 week Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/a83t.dtsi Fri Dec 30 20:00:41 2016 (r310853) +++ head/sys/boot/fdt/dts/arm/a83t.dtsi Fri Dec 30 20:16:09 2016 (r310854) @@ -176,6 +176,9 @@ usbphy: phy@01c19400 { compatible = "allwinner,sun8i-a83t-usb-phy"; + reg = <0x01c19400 0x2c>, + <0x01c1a800 0x4>, + <0x01c1a800 0x4>; clocks = <&usb_clk 8>, <&usb_clk 9>, <&usb_clk 10>, From owner-svn-src-all@freebsd.org Fri Dec 30 20:18:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB640C97CC0; Fri, 30 Dec 2016 20:18:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95F5E169A; Fri, 30 Dec 2016 20:18:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKIoDJ076912; Fri, 30 Dec 2016 20:18:50 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKIofF076909; Fri, 30 Dec 2016 20:18:50 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302018.uBUKIofF076909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310855 - in stable/11/sys/arm/ti: am335x cpsw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:18:51 -0000 Author: loos Date: Fri Dec 30 20:18:50 2016 New Revision: 310855 URL: https://svnweb.freebsd.org/changeset/base/310855 Log: MFC of r305112, r305113, r305119, r305141 and r305432: Replace magic numbers with the proper register names. Fix the build, revert r305119, move the control module register data to am335x_scm.h and fix if_cpsw.c to include the correct header. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/am335x/am335x_prcm.c stable/11/sys/arm/ti/am335x/am335x_scm.h stable/11/sys/arm/ti/cpsw/if_cpsw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_prcm.c Fri Dec 30 20:16:09 2016 (r310854) +++ stable/11/sys/arm/ti/am335x/am335x_prcm.c Fri Dec 30 20:18:50 2016 (r310855) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include +#include "am335x_scm.h" + #define CM_PER 0 #define CM_PER_L4LS_CLKSTCTRL (CM_PER + 0x000) #define CM_PER_L3S_CLKSTCTRL (CM_PER + 0x004) @@ -619,10 +621,9 @@ am335x_clk_get_sysclk_freq(struct ti_clo { uint32_t ctrl_status; - /* Read the input clock freq from the control module */ - /* control_status reg (0x40) */ - if (ti_scm_reg_read_4(0x40, &ctrl_status)) - return ENXIO; + /* Read the input clock freq from the control module. */ + if (ti_scm_reg_read_4(SCM_CTRL_STATUS, &ctrl_status)) + return (ENXIO); switch ((ctrl_status>>22) & 0x3) { case 0x0: Modified: stable/11/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_scm.h Fri Dec 30 20:16:09 2016 (r310854) +++ stable/11/sys/arm/ti/am335x/am335x_scm.h Fri Dec 30 20:18:50 2016 (r310855) @@ -29,10 +29,13 @@ #define __AM335X_SCM_H__ /* AM335x-specific registers for control module (scm) */ +#define SCM_CTRL_STATUS 0x40 #define SCM_USB_CTRL0 0x620 #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 #define SCM_USB_STS1 0x62C +#define SCM_MAC_ID0_LO 0x630 +#define SCM_MAC_ID0_HI 0x634 #define SCM_PWMSS_CTRL 0x664 #endif /* __AM335X_SCM_H__ */ Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:16:09 2016 (r310854) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:18:50 2016 (r310855) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -87,8 +90,6 @@ __FBSDID("$FreeBSD$"); #include "if_cpswreg.h" #include "if_cpswvar.h" - -#include #include "miibus_if.h" @@ -1019,14 +1020,14 @@ cpswp_attach(device_t dev) IFQ_SET_READY(&ifp->if_snd); /* Get high part of MAC address from control module (mac_id[0|1]_hi) */ - ti_scm_reg_read_4(0x634 + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_HI + sc->unit * 8, ®); mac_addr[0] = reg & 0xFF; mac_addr[1] = (reg >> 8) & 0xFF; mac_addr[2] = (reg >> 16) & 0xFF; mac_addr[3] = (reg >> 24) & 0xFF; /* Get low part of MAC address from control module (mac_id[0|1]_lo) */ - ti_scm_reg_read_4(0x630 + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_LO + sc->unit * 8, ®); mac_addr[4] = reg & 0xFF; mac_addr[5] = (reg >> 8) & 0xFF; From owner-svn-src-all@freebsd.org Fri Dec 30 20:28:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD57AC98157; Fri, 30 Dec 2016 20:28:08 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ECD51C89; Fri, 30 Dec 2016 20:28:08 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKS7sK081294; Fri, 30 Dec 2016 20:28:07 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKS7cV081290; Fri, 30 Dec 2016 20:28:07 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302028.uBUKS7cV081290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310856 - in stable/11/sys/arm/ti: . am335x X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:28:08 -0000 Author: loos Date: Fri Dec 30 20:28:07 2016 New Revision: 310856 URL: https://svnweb.freebsd.org/changeset/base/310856 Log: MFC of r305114, r305115 and r305149: Allow the use of control module extensions to cope with specific platform features. Add a driver for the AM335x bandgap sensor, an on-die temperature sensor as part of the AM335x control module extension. TI says that the bandgap sensor is not very accurate on AM335x, but in our tests it seems to be a good reference for the SoC temperature. TI details: http://processors.wiki.ti.com/index.php/AM335x_Thermal_Considerations#Measuring_Case_Temperature Sponsored by: Rubicon Communications, LLC (Netgate) Added: stable/11/sys/arm/ti/am335x/am335x_scm.c - copied unchanged from r305115, head/sys/arm/ti/am335x/am335x_scm.c Modified: stable/11/sys/arm/ti/am335x/am335x_scm.h stable/11/sys/arm/ti/am335x/files.am335x stable/11/sys/arm/ti/ti_scm.c Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/arm/ti/am335x/am335x_scm.c (from r305115, head/sys/arm/ti/am335x/am335x_scm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/arm/ti/am335x/am335x_scm.c Fri Dec 30 20:28:07 2016 (r310856, copy of r305115, head/sys/arm/ti/am335x/am335x_scm.c) @@ -0,0 +1,169 @@ +/*- + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#define TZ_ZEROC 2731 + +struct am335x_scm_softc { + int sc_last_temp; + struct sysctl_oid *sc_temp_oid; +}; + +static int +am335x_scm_temp_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + int i, temp; + struct am335x_scm_softc *sc; + uint32_t reg; + + dev = (device_t)arg1; + sc = device_get_softc(dev); + + /* Read the temperature and convert to Kelvin. */ + for(i = 50; i > 0; i--) { + ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + if ((reg & SCM_BGAP_EOCZ) == 0) + break; + DELAY(50); + } + if ((reg & SCM_BGAP_EOCZ) == 0) { + sc->sc_last_temp = + (reg >> SCM_BGAP_TEMP_SHIFT) & SCM_BGAP_TEMP_MASK; + sc->sc_last_temp *= 10; + } + temp = sc->sc_last_temp + TZ_ZEROC; + + return (sysctl_handle_int(oidp, &temp, 0, req)); +} + +static void +am335x_scm_identify(driver_t *driver, device_t parent) +{ + device_t child; + + /* AM335x only. */ + if (ti_chip() != CHIP_AM335X) + return; + + /* Make sure we attach only once. */ + if (device_find_child(parent, "am335x_scm", -1) != NULL) + return; + + child = device_add_child(parent, "am335x_scm", -1); + if (child == NULL) + device_printf(parent, "cannot add ti_scm child\n"); +} + +static int +am335x_scm_probe(device_t dev) +{ + + device_set_desc(dev, "AM335x Control Module Extension"); + + return (BUS_PROBE_DEFAULT); +} + +static int +am335x_scm_attach(device_t dev) +{ + struct am335x_scm_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *tree; + uint32_t reg; + + /* Set ADC to continous mode, clear output reset. */ + reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV; + ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); + /* Flush write. */ + ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + /* Start the ADC conversion. */ + reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; + ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); + + /* Temperature sysctl. */ + sc = device_get_softc(dev); + ctx = device_get_sysctl_ctx(dev); + tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + sc->sc_temp_oid = SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, + "temperature", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, 0, am335x_scm_temp_sysctl, "IK", "Current temperature"); + + return (0); +} + +static int +am335x_scm_detach(device_t dev) +{ + struct am335x_scm_softc *sc; + + sc = device_get_softc(dev); + + /* Remove temperature sysctl. */ + if (sc->sc_temp_oid != NULL) + sysctl_remove_oid(sc->sc_temp_oid, 1, 0); + + /* Stop the bandgap ADC. */ + ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_BGOFF); + + return (0); +} + +static device_method_t am335x_scm_methods[] = { + DEVMETHOD(device_identify, am335x_scm_identify), + DEVMETHOD(device_probe, am335x_scm_probe), + DEVMETHOD(device_attach, am335x_scm_attach), + DEVMETHOD(device_detach, am335x_scm_detach), + + DEVMETHOD_END +}; + +static driver_t am335x_scm_driver = { + "am335x_scm", + am335x_scm_methods, + sizeof(struct am335x_scm_softc), +}; + +static devclass_t am335x_scm_devclass; + +DRIVER_MODULE(am335x_scm, ti_scm, am335x_scm_driver, am335x_scm_devclass, 0, 0); +MODULE_VERSION(am335x_scm, 1); +MODULE_DEPEND(am335x_scm, ti_scm, 1, 1, 1); Modified: stable/11/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_scm.h Fri Dec 30 20:18:50 2016 (r310855) +++ stable/11/sys/arm/ti/am335x/am335x_scm.h Fri Dec 30 20:28:07 2016 (r310856) @@ -30,6 +30,14 @@ /* AM335x-specific registers for control module (scm) */ #define SCM_CTRL_STATUS 0x40 +#define SCM_BGAP_CTRL 0x448 +#define SCM_BGAP_TEMP_MASK 0xff +#define SCM_BGAP_TEMP_SHIFT 8 +#define SCM_BGAP_BGOFF (1 << 6) +#define SCM_BGAP_SOC (1 << 4) +#define SCM_BGAP_CLRZ (1 << 3) +#define SCM_BGAP_CONTCONV (1 << 2) +#define SCM_BGAP_EOCZ (1 << 1) #define SCM_USB_CTRL0 0x620 #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 Modified: stable/11/sys/arm/ti/am335x/files.am335x ============================================================================== --- stable/11/sys/arm/ti/am335x/files.am335x Fri Dec 30 20:18:50 2016 (r310855) +++ stable/11/sys/arm/ti/am335x/files.am335x Fri Dec 30 20:28:07 2016 (r310856) @@ -13,6 +13,7 @@ arm/ti/am335x/am335x_pwmss.c standard arm/ti/am335x/am335x_ehrpwm.c standard arm/ti/am335x/am335x_ecap.c standard arm/ti/am335x/am335x_rtc.c optional am335x_rtc +arm/ti/am335x/am335x_scm.c standard arm/ti/am335x/am335x_scm_padconf.c standard arm/ti/am335x/am335x_usbss.c optional musb fdt arm/ti/am335x/am335x_musb.c optional musb fdt Modified: stable/11/sys/arm/ti/ti_scm.c ============================================================================== --- stable/11/sys/arm/ti/ti_scm.c Fri Dec 30 20:18:50 2016 (r310855) +++ stable/11/sys/arm/ti/ti_scm.c Fri Dec 30 20:28:07 2016 (r310856) @@ -129,7 +129,10 @@ ti_scm_attach(device_t dev) ti_scm_sc = sc; - return (0); + /* Attach platform extensions, if any. */ + bus_generic_probe(dev); + + return (bus_generic_attach(dev)); } int From owner-svn-src-all@freebsd.org Fri Dec 30 20:33:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20A3C98434; Fri, 30 Dec 2016 20:33:55 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72B0510EF; Fri, 30 Dec 2016 20:33:55 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKXsbe085054; Fri, 30 Dec 2016 20:33:54 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKXsij085051; Fri, 30 Dec 2016 20:33:54 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302033.uBUKXsij085051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310857 - stable/11/sys/arm/ti/cpsw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:33:55 -0000 Author: loos Date: Fri Dec 30 20:33:54 2016 New Revision: 310857 URL: https://svnweb.freebsd.org/changeset/base/310857 Log: MFC r306376: Add a sysctl to control the interrupt pacing on AM335x integrated switch. The hardware can be set to limit the number of interrupts from 2 to 63 interrupts per ms. To keep the compatibility with the TI documentation the sysctl take the interval between the interrupts pulses: 16~500 us. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c stable/11/sys/arm/ti/cpsw/if_cpswreg.h stable/11/sys/arm/ti/cpsw/if_cpswvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:28:07 2016 (r310856) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:33:54 2016 (r310857) @@ -583,6 +583,11 @@ cpsw_init(struct cpsw_softc *sc) struct cpsw_slot *slot; uint32_t reg; + /* Disable the interrupt pacing. */ + reg = cpsw_read_4(sc, CPSW_WR_INT_CONTROL); + reg &= ~(CPSW_WR_INT_PACE_EN | CPSW_WR_INT_PRESCALE_MASK); + cpsw_write_4(sc, CPSW_WR_INT_CONTROL, reg); + /* Clear ALE */ cpsw_write_4(sc, CPSW_ALE_CONTROL, CPSW_ALE_CTL_CLEAR_TBL); @@ -2492,6 +2497,51 @@ cpsw_stat_attached(SYSCTL_HANDLER_ARGS) } static int +cpsw_intr_coalesce(SYSCTL_HANDLER_ARGS) +{ + int error; + struct cpsw_softc *sc; + uint32_t ctrl, intr_per_ms; + + sc = (struct cpsw_softc *)arg1; + error = sysctl_handle_int(oidp, &sc->coal_us, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + ctrl = cpsw_read_4(sc, CPSW_WR_INT_CONTROL); + ctrl &= ~(CPSW_WR_INT_PACE_EN | CPSW_WR_INT_PRESCALE_MASK); + if (sc->coal_us == 0) { + /* Disable the interrupt pace hardware. */ + cpsw_write_4(sc, CPSW_WR_INT_CONTROL, ctrl); + cpsw_write_4(sc, CPSW_WR_C_RX_IMAX(0), 0); + cpsw_write_4(sc, CPSW_WR_C_TX_IMAX(0), 0); + return (0); + } + + if (sc->coal_us > CPSW_WR_C_IMAX_US_MAX) + sc->coal_us = CPSW_WR_C_IMAX_US_MAX; + if (sc->coal_us < CPSW_WR_C_IMAX_US_MIN) + sc->coal_us = CPSW_WR_C_IMAX_US_MIN; + intr_per_ms = 1000 / sc->coal_us; + /* Just to make sure... */ + if (intr_per_ms > CPSW_WR_C_IMAX_MAX) + intr_per_ms = CPSW_WR_C_IMAX_MAX; + if (intr_per_ms < CPSW_WR_C_IMAX_MIN) + intr_per_ms = CPSW_WR_C_IMAX_MIN; + + /* Set the prescale to produce 4us pulses from the 125 Mhz clock. */ + ctrl |= (125 * 4) & CPSW_WR_INT_PRESCALE_MASK; + + /* Enable the interrupt pace hardware. */ + cpsw_write_4(sc, CPSW_WR_C_RX_IMAX(0), intr_per_ms); + cpsw_write_4(sc, CPSW_WR_C_TX_IMAX(0), intr_per_ms); + ctrl |= CPSW_WR_INT_C0_RX_PULSE | CPSW_WR_INT_C0_TX_PULSE; + cpsw_write_4(sc, CPSW_WR_INT_CONTROL, ctrl); + + return (0); +} + +static int cpsw_stat_uptime(SYSCTL_HANDLER_ARGS) { struct cpsw_softc *swsc; @@ -2576,6 +2626,10 @@ cpsw_add_sysctls(struct cpsw_softc *sc) CTLTYPE_UINT | CTLFLAG_RD, sc, 0, cpsw_stat_attached, "IU", "Time since driver attach"); + SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, "intr_coalesce_us", + CTLTYPE_UINT | CTLFLAG_RW, sc, 0, cpsw_intr_coalesce, "IU", + "minimum time between interrupts"); + node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "ports", CTLFLAG_RD, NULL, "CPSW Ports Statistics"); ports_parent = SYSCTL_CHILDREN(node); Modified: stable/11/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpswreg.h Fri Dec 30 20:28:07 2016 (r310856) +++ stable/11/sys/arm/ti/cpsw/if_cpswreg.h Fri Dec 30 20:33:54 2016 (r310857) @@ -138,6 +138,17 @@ #define CPSW_WR_SOFT_RESET (CPSW_WR_OFFSET + 0x04) #define CPSW_WR_CONTROL (CPSW_WR_OFFSET + 0x08) #define CPSW_WR_INT_CONTROL (CPSW_WR_OFFSET + 0x0c) +#define CPSW_WR_INT_C0_RX_PULSE (1 << 16) +#define CPSW_WR_INT_C0_TX_PULSE (1 << 17) +#define CPSW_WR_INT_C1_RX_PULSE (1 << 18) +#define CPSW_WR_INT_C1_TX_PULSE (1 << 19) +#define CPSW_WR_INT_C2_RX_PULSE (1 << 20) +#define CPSW_WR_INT_C2_TX_PULSE (1 << 21) +#define CPSW_WR_INT_PACE_EN \ + (CPSW_WR_INT_C0_RX_PULSE | CPSW_WR_INT_C0_TX_PULSE | \ + CPSW_WR_INT_C1_RX_PULSE | CPSW_WR_INT_C1_TX_PULSE | \ + CPSW_WR_INT_C2_RX_PULSE | CPSW_WR_INT_C2_TX_PULSE) +#define CPSW_WR_INT_PRESCALE_MASK 0xfff #define CPSW_WR_C_RX_THRESH_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x10) #define CPSW_WR_C_RX_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x14) #define CPSW_WR_C_TX_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x18) @@ -151,6 +162,13 @@ #define CPSW_WR_C_MISC_HOST_PEND (1 << 2) #define CPSW_WR_C_MISC_MDIOLINK (1 << 1) #define CPSW_WR_C_MISC_MDIOUSER (1 << 0) +#define CPSW_WR_C_RX_IMAX(p) (CPSW_WR_OFFSET + (0x08 * (p)) + 0x70) +#define CPSW_WR_C_TX_IMAX(p) (CPSW_WR_OFFSET + (0x08 * (p)) + 0x74) +#define CPSW_WR_C_IMAX_MASK 0x3f +#define CPSW_WR_C_IMAX_MAX 63 +#define CPSW_WR_C_IMAX_MIN 2 +#define CPSW_WR_C_IMAX_US_MAX 500 +#define CPSW_WR_C_IMAX_US_MIN 16 #define CPSW_CPPI_RAM_OFFSET 0x2000 #define CPSW_CPPI_RAM_SIZE 0x2000 Modified: stable/11/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpswvar.h Fri Dec 30 20:28:07 2016 (r310856) +++ stable/11/sys/arm/ti/cpsw/if_cpswvar.h Fri Dec 30 20:33:54 2016 (r310857) @@ -80,6 +80,7 @@ struct cpsw_softc { phandle_t node; struct bintime attach_uptime; /* system uptime when attach happened. */ struct cpsw_port port[2]; + unsigned coal_us; /* RX and TX buffer tracking */ struct cpsw_queue rx, tx; From owner-svn-src-all@freebsd.org Fri Dec 30 20:34:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC85AC984C8; Fri, 30 Dec 2016 20:34:48 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from st11p00im-asmtp004.me.com (st11p00im-asmtp004.me.com [17.172.80.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2986127C; Fri, 30 Dec 2016 20:34:48 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.st11p00im-asmtp004.me.com by st11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OJ000N00JJJIR00@st11p00im-asmtp004.me.com>; Fri, 30 Dec 2016 19:34:41 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1483126481; bh=mDjEU4W4XaCOcPUfmRQ77sfklHMrSJLSimHeMlsGWAI=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=a0N2I+Tl7e6441mxk8CNgo0qnemoddhuiXiB3pU9iED+f+u4y1yw7jE9JgaLBlMTR x4tPKknxODlGkog7BJ7KMdLgv5ofd0Pbsd7rjIJICsLFid3lm5y45WPeRECl8iTF4a rOs/v8Z+PkbZSrBHQn8HpPIHyrioAzF+DoZnJDs6dPBRfpZOOq8/yio9zJlsly3iv+ b2fUcoieGKCwKgfIN29BR5rZ1c9k+zzghvVUGUSssD43QitFAfhep8qOkX7saIsT/U I9qE40M4JARG00Flj8qilc0sqK/DsbBK9q4XQNl77lbvu1f1AC4wj3FAQrlNZAEMFj 2R89oRTTUYdsA== Received: from [10.0.0.7] (c-73-6-177-70.hsd1.tx.comcast.net [73.6.177.70]) by st11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OJ0000VMJPQJJ20@st11p00im-asmtp004.me.com>; Fri, 30 Dec 2016 19:34:40 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-30_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612300305 User-Agent: Microsoft-MacOutlook/f.1d.0.161209 Date: Fri, 30 Dec 2016 13:34:38 -0600 Subject: Re: svn commit: r310789 - head/lib/libpam/static_libpam From: Ravi Pokala Sender: "Pokala, Ravi" To: Ed Maste Cc: Alexander Kabaev , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-id: Thread-topic: svn commit: r310789 - head/lib/libpam/static_libpam References: <201612292130.uBTLUqus011628@repo.freebsd.org> <1A7F0D4F-1F4D-4885-B7E9-F764D4FA72BF@panasas.com> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:34:49 -0000 -----Original Message----- > From: on behalf of Ed Maste > Date: 2016-12-30, Friday at 07:39 > To: Ravi Pokala > Cc: Alexander Kabaev , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" > Subject: Re: svn commit: r310789 - head/lib/libpam/static_libpam > > On 29 December 2016 at 19:59, Ravi Pokala wrote: >> >> I'm a little confused - the original version had to have had a compile-only step to generate the object first, before running the link-only operation against the object. The new code replaces the link-only operation with a compile+link operation. Shouldn't the pre-existing compile-only operation be removed, since the new compile+link operation supersedes it? > > Hi Ravi, > > This change: > >>> - ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} >>> + ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC} > > is not actually compiling, it's just invoking the compiler driver to > in turn invoke the linker. The input in ${.ALLSRC} is still a > collection of object files. Ahhh! My knowledge of `make' is terrible, so I thought ${.ALLSRC} must have been referring to actual source files in some non-obvious way. I also thought some special flag would be needed when passing an object file to the compiler, rather than a source file. Combine those two, and there was my problem. Thanks for clarifying! -Ravi (rpokala@) From owner-svn-src-all@freebsd.org Fri Dec 30 20:38:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7AD8C985A9; Fri, 30 Dec 2016 20:38:35 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 887D81489; Fri, 30 Dec 2016 20:38:35 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKcYss085296; Fri, 30 Dec 2016 20:38:34 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKcYA0085295; Fri, 30 Dec 2016 20:38:34 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302038.uBUKcYA0085295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310858 - stable/11/sys/arm/ti/cpsw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:38:35 -0000 Author: loos Date: Fri Dec 30 20:38:34 2016 New Revision: 310858 URL: https://svnweb.freebsd.org/changeset/base/310858 Log: MFC of r306388, r306510, r306511 and r306513: Fix a typo. Sort and remove unnecessary includes. Fix a typo in CPSW_DEBUG MACRO and then replace all the CPSWP_DEBUG() calls with CPSW_DEBUG(). Remove the GLOBAL queue lock which just adds unnecessary complexity to code (when used together with the individual tx and rx locks). Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:33:54 2016 (r310857) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:38:34 2016 (r310858) @@ -48,35 +48,27 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include +#include #include +#include +#include #include +#include +#include #include +#include #include +#include +#include +#include + #include #include #include -#include #include #include #include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include #include #include @@ -263,8 +255,6 @@ static struct cpsw_stat { * Basic debug support. */ -#define IF_DEBUG(_sc) if ((_sc)->if_flags & IFF_DEBUG) - static void cpsw_debugf_head(const char *funcname) { @@ -273,7 +263,6 @@ cpsw_debugf_head(const char *funcname) printf("%02d:%02d:%02d %s ", t / (60 * 60), (t / 60) % 60, t % 60, funcname); } -#include static void cpsw_debugf(const char *fmt, ...) { @@ -287,20 +276,12 @@ cpsw_debugf(const char *fmt, ...) } #define CPSW_DEBUGF(_sc, a) do { \ - if (sc->debug) { \ - cpsw_debugf_head(__func__); \ - cpsw_debugf a; \ - } \ -} while (0) - -#define CPSWP_DEBUGF(_sc, a) do { \ - IF_DEBUG((_sc)) { \ + if ((_sc)->debug) { \ cpsw_debugf_head(__func__); \ cpsw_debugf a; \ } \ } while (0) - /* * Locking macros */ @@ -320,25 +301,6 @@ cpsw_debugf(const char *fmt, ...) #define CPSW_RX_UNLOCK(sc) mtx_unlock(&(sc)->rx.lock) #define CPSW_RX_LOCK_ASSERT(sc) mtx_assert(&(sc)->rx.lock, MA_OWNED) -#define CPSW_GLOBAL_LOCK(sc) do { \ - if ((mtx_owned(&(sc)->tx.lock) ? 1 : 0) != \ - (mtx_owned(&(sc)->rx.lock) ? 1 : 0)) { \ - panic("cpsw deadlock possibility detection!"); \ - } \ - mtx_lock(&(sc)->tx.lock); \ - mtx_lock(&(sc)->rx.lock); \ -} while (0) - -#define CPSW_GLOBAL_UNLOCK(sc) do { \ - CPSW_RX_UNLOCK(sc); \ - CPSW_TX_UNLOCK(sc); \ -} while (0) - -#define CPSW_GLOBAL_LOCK_ASSERT(sc) do { \ - CPSW_TX_LOCK_ASSERT(sc); \ - CPSW_RX_LOCK_ASSERT(sc); \ -} while (0) - #define CPSW_PORT_LOCK(_sc) do { \ mtx_assert(&(_sc)->lock, MA_NOTOWNED); \ mtx_lock(&(_sc)->lock); \ @@ -1061,7 +1023,7 @@ cpswp_detach(device_t dev) struct cpswp_softc *sc; sc = device_get_softc(dev); - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); if (device_is_attached(dev)) { ether_ifdetach(sc->ifp); CPSW_PORT_LOCK(sc); @@ -1107,7 +1069,7 @@ cpswp_init(void *arg) { struct cpswp_softc *sc = arg; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK(sc); cpswp_init_locked(arg); CPSW_PORT_UNLOCK(sc); @@ -1120,7 +1082,7 @@ cpswp_init_locked(void *arg) struct ifnet *ifp; uint32_t reg; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK_ASSERT(sc); ifp = sc->ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) @@ -1198,7 +1160,7 @@ cpsw_rx_teardown_locked(struct cpsw_soft cpsw_write_4(sc, CPSW_CPDMA_RX_TEARDOWN, 0); for (;;) { received = cpsw_rx_dequeue(sc); - CPSW_GLOBAL_UNLOCK(sc); + CPSW_RX_UNLOCK(sc); while (received != NULL) { next = received->m_nextpkt; received->m_nextpkt = NULL; @@ -1207,7 +1169,7 @@ cpsw_rx_teardown_locked(struct cpsw_soft if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); received = next; } - CPSW_GLOBAL_LOCK(sc); + CPSW_RX_LOCK(sc); if (!sc->rx.running) { CPSW_DEBUGF(sc, ("finished RX teardown (%d retries)", i)); @@ -1249,7 +1211,7 @@ cpswp_stop_locked(struct cpswp_softc *sc uint32_t reg; ifp = sc->ifp; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK_ASSERT(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -1264,10 +1226,12 @@ cpswp_stop_locked(struct cpswp_softc *sc /* Tear down the RX/TX queues. */ if (cpsw_ports_down(sc->swsc)) { - CPSW_GLOBAL_LOCK(sc->swsc); + CPSW_RX_LOCK(sc->swsc); cpsw_rx_teardown_locked(sc->swsc); + CPSW_RX_UNLOCK(sc->swsc); + CPSW_TX_LOCK(sc->swsc); cpsw_tx_teardown_locked(sc->swsc); - CPSW_GLOBAL_UNLOCK(sc->swsc); + CPSW_TX_UNLOCK(sc->swsc); } /* Stop MAC RX/TX modules. */ @@ -1371,7 +1335,7 @@ cpswp_ioctl(struct ifnet *ifp, u_long co if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { changed = ifp->if_flags ^ sc->if_flags; - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: UP & RUNNING (changed=0x%x)", changed)); if (changed & IFF_PROMISC) @@ -1381,12 +1345,12 @@ cpswp_ioctl(struct ifnet *ifp, u_long co cpsw_set_allmulti(sc, ifp->if_flags & IFF_ALLMULTI); } else { - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: UP but not RUNNING; starting up")); cpswp_init_locked(sc); } } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: not UP but RUNNING; shutting down")); cpswp_stop_locked(sc); } @@ -1497,7 +1461,7 @@ cpswp_miibus_statchg(device_t dev) uint32_t mac_control, reg; sc = device_get_softc(dev); - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); reg = CPSW_SL_MACCONTROL(sc->unit); mac_control = cpsw_read_4(sc->swsc, reg); @@ -1775,7 +1739,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) "Can't defragment packet; dropping\n"); m_freem(slot->mbuf); } else { - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("Requeueing defragmented packet")); IF_PREPEND(&sc->ifp->if_snd, m0); } @@ -1795,7 +1759,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bus_dmamap_sync(sc->swsc->mbuf_dtag, slot->dmamap, BUS_DMASYNC_PREWRITE); - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("Queueing TX packet: %d segments + %d pad bytes", nsegs, padlen)); @@ -1941,7 +1905,7 @@ cpsw_tx_dequeue(struct cpsw_softc *sc) /* TearDown complete is only marked on the SOP for the packet. */ if ((flags & (CPDMA_BD_SOP | CPDMA_BD_TDOWNCMPLT)) == - (CPDMA_BD_EOP | CPDMA_BD_TDOWNCMPLT)) { + (CPDMA_BD_SOP | CPDMA_BD_TDOWNCMPLT)) { CPSW_DEBUGF(sc, ("TX teardown in progress")); cpsw_write_cp(sc, &sc->tx, 0xfffffffc); // TODO: Increment a count of dropped TX packets @@ -2124,7 +2088,7 @@ cpswp_ifmedia_sts(struct ifnet *ifp, str struct mii_data *mii; sc = ifp->if_softc; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK(sc); mii = sc->mii; @@ -2141,7 +2105,7 @@ cpswp_ifmedia_upd(struct ifnet *ifp) struct cpswp_softc *sc; sc = ifp->if_softc; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK(sc); mii_mediachg(sc->mii); sc->media_status = sc->mii->mii_media.ifm_media; @@ -2174,7 +2138,7 @@ cpsw_tx_watchdog(void *msc) struct cpsw_softc *sc; sc = msc; - CPSW_GLOBAL_LOCK(sc); + CPSW_TX_LOCK(sc); if (sc->tx.active_queue_len == 0 || !sc->tx.running) { sc->watchdog.timer = 0; /* Nothing to do. */ } else if (sc->tx.queue_removes > sc->tx.queue_removes_at_last_tick) { @@ -2191,7 +2155,7 @@ cpsw_tx_watchdog(void *msc) } } sc->tx.queue_removes_at_last_tick = sc->tx.queue_removes; - CPSW_GLOBAL_UNLOCK(sc); + CPSW_TX_UNLOCK(sc); /* Schedule another timeout one second from now */ callout_reset(&sc->watchdog.callout, hz, cpsw_tx_watchdog, sc); From owner-svn-src-all@freebsd.org Fri Dec 30 20:40:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744A5C98798; Fri, 30 Dec 2016 20:40:26 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE321868; Fri, 30 Dec 2016 20:40:26 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKePNU085433; Fri, 30 Dec 2016 20:40:25 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKeP1o085432; Fri, 30 Dec 2016 20:40:25 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302040.uBUKeP1o085432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310859 - stable/11/sys/arm/ti/cpsw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:40:26 -0000 Author: loos Date: Fri Dec 30 20:40:25 2016 New Revision: 310859 URL: https://svnweb.freebsd.org/changeset/base/310859 Log: MFC r306654: Enable the TX completion interrupt for the cpsw NIC to assure the free tx descriptors are reclaimed as soon as possible. Without this the free buffers are reclaimed only on watchdog runs or after trying to enqueue more packets. Sponsored by: Rubicon Communications, LLC (Netgte) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:38:34 2016 (r310858) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:40:25 2016 (r310859) @@ -117,6 +117,7 @@ static void cpsw_intr_rx(void *arg); static struct mbuf *cpsw_rx_dequeue(struct cpsw_softc *); static void cpsw_rx_enqueue(struct cpsw_softc *); static void cpswp_start(struct ifnet *); +static void cpsw_intr_tx(void *); static void cpswp_tx_enqueue(struct cpswp_softc *); static int cpsw_tx_dequeue(struct cpsw_softc *); @@ -209,6 +210,15 @@ static struct resource_spec irq_res_spec { -1, 0 } }; +static struct { + void (*cb)(void *); +} cpsw_intr_cb[] = { + { cpsw_intr_rx_thresh }, + { cpsw_intr_rx }, + { cpsw_intr_tx }, + { cpsw_intr_misc }, +}; + /* Number of entries here must match size of stats * array in struct cpswp_softc. */ static struct cpsw_stat { @@ -590,13 +600,15 @@ cpsw_init(struct cpsw_softc *sc) /* Enable Interrupts for core 0 */ cpsw_write_4(sc, CPSW_WR_C_RX_THRESH_EN(0), 0xFF); cpsw_write_4(sc, CPSW_WR_C_RX_EN(0), 0xFF); + cpsw_write_4(sc, CPSW_WR_C_TX_EN(0), 0xFF); cpsw_write_4(sc, CPSW_WR_C_MISC_EN(0), 0x1F); /* Enable host Error Interrupt */ cpsw_write_4(sc, CPSW_CPDMA_DMA_INTMASK_SET, 3); - /* Enable interrupts for RX Channel 0 */ + /* Enable interrupts for RX and TX on Channel 0 */ cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET, 1); + cpsw_write_4(sc, CPSW_CPDMA_TX_INTMASK_SET, 1); /* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */ /* TODO Calculate MDCLK=CLK/(CLKDIV+1) */ @@ -645,22 +657,14 @@ cpsw_probe(device_t dev) static int cpsw_intr_attach(struct cpsw_softc *sc) { + int i; - /* Note: We don't use sc->irq_res[2] (TX interrupt) */ - if (bus_setup_intr(sc->dev, sc->irq_res[0], - INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_rx_thresh, - sc, &sc->ih_cookie[0]) != 0) { - return (-1); - } - if (bus_setup_intr(sc->dev, sc->irq_res[1], - INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_rx, - sc, &sc->ih_cookie[1]) != 0) { - return (-1); - } - if (bus_setup_intr(sc->dev, sc->irq_res[3], - INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_misc, - sc, &sc->ih_cookie[3]) != 0) { - return (-1); + for (i = 0; i < CPSW_INTR_COUNT; i++) { + if (bus_setup_intr(sc->dev, sc->irq_res[i], + INTR_TYPE_NET | INTR_MPSAFE, NULL, + cpsw_intr_cb[i].cb, sc, &sc->ih_cookie[i]) != 0) { + return (-1); + } } return (0); @@ -1696,6 +1700,18 @@ cpswp_start(struct ifnet *ifp) } static void +cpsw_intr_tx(void *arg) +{ + struct cpsw_softc *sc; + + sc = (struct cpsw_softc *)arg; + CPSW_TX_LOCK(sc); + cpsw_tx_dequeue(sc); + cpsw_write_4(sc, CPSW_CPDMA_CPDMA_EOI_VECTOR, 2); + CPSW_TX_UNLOCK(sc); +} + +static void cpswp_tx_enqueue(struct cpswp_softc *sc) { bus_dma_segment_t segs[CPSW_TXFRAGS]; From owner-svn-src-all@freebsd.org Fri Dec 30 20:43:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90C80C989C0; Fri, 30 Dec 2016 20:43:01 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F59D1CAB; Fri, 30 Dec 2016 20:43:01 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKh0NP089148; Fri, 30 Dec 2016 20:43:00 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKh0WK089145; Fri, 30 Dec 2016 20:43:00 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302043.uBUKh0WK089145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310860 - stable/11/sys/arm/ti/cpsw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:43:01 -0000 Author: loos Date: Fri Dec 30 20:43:00 2016 New Revision: 310860 URL: https://svnweb.freebsd.org/changeset/base/310860 Log: MFC r306717: if_cpsw overhaul: - Fix RX and TX teardown: . TX teardown would not reclaim the abandoned descriptors; . Interrupt storms in RX teardown; . Fixed the acknowledge of the teardown completion interrupt. - Remove temporary lists for the descriptors; - Simplified the descriptor handling (less writes and reads from descriptors where possible); - Better debug; - Add support for the RX threshold interrupts: With interrupt moderation only, an RX overrun is likely to happen. The RX threshold is set to trigger a non paced interrupt everytime your RX free buffers are under the minimum threshold, helping to prevent the rx overrun. The NIC now survive when pushed over its limits (where previously it would lock up in a few seconds). uFW (600MHz SoC) can now forward up to 560Mb/s of UDP traffic (netmap pkt-gen as source and sink). TCP forwarding rate is over 350Mb/s. No difference (other than CPU use) was seen on Beaglebone black (1GHz SoC) for his fast ethernet. Tested on: uFW, BBB Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c stable/11/sys/arm/ti/cpsw/if_cpswreg.h stable/11/sys/arm/ti/cpsw/if_cpswvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:40:25 2016 (r310859) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:43:00 2016 (r310860) @@ -336,6 +336,8 @@ cpsw_debugf(const char *fmt, ...) bus_write_region_4(sc->mem_res, slot->bd_offset, (uint32_t *) val, 4) #define cpsw_cpdma_write_bd_next(sc, slot, next_slot) \ cpsw_write_4(sc, slot->bd_offset, cpsw_cpdma_bd_paddr(sc, next_slot)) +#define cpsw_cpdma_write_bd_flags(sc, slot, val) \ + bus_write_2(sc->mem_res, slot->bd_offset + 14, val) #define cpsw_cpdma_read_bd_flags(sc, slot) \ bus_read_2(sc->mem_res, slot->bd_offset + 14) #define cpsw_write_hdp_slot(sc, queue, slot) \ @@ -383,7 +385,8 @@ cpsw_dump_slot(struct cpsw_softc *sc, st int i; cpsw_cpdma_read_bd(sc, slot, &bd); - printf("BD Addr: 0x%08x Next: 0x%08x\n", cpsw_cpdma_bd_paddr(sc, slot), bd.next); + printf("BD Addr : 0x%08x Next : 0x%08x\n", + cpsw_cpdma_bd_paddr(sc, slot), bd.next); printf(" BufPtr: 0x%08x BufLen: 0x%08x\n", bd.bufptr, bd.buflen); printf(" BufOff: 0x%08x PktLen: 0x%08x\n", bd.bufoff, bd.pktlen); printf(" Flags: "); @@ -417,7 +420,7 @@ cpsw_dump_queue(struct cpsw_softc *sc, s int others = 0; STAILQ_FOREACH(slot, q, next) { - if (i > 4) + if (i > CPSW_TXFRAGS) ++others; else cpsw_dump_slot(sc, slot); @@ -581,16 +584,14 @@ cpsw_init(struct cpsw_softc *sc) /* Enable statistics for ports 0, 1 and 2 */ cpsw_write_4(sc, CPSW_SS_STAT_PORT_EN, 7); - /* Experiment: Turn off flow control */ - /* This seems to fix the watchdog resets that have plagued - earlier versions of this driver; I'm not yet sure if there - are negative effects yet. */ + /* Turn off flow control. */ cpsw_write_4(sc, CPSW_SS_FLOW_CONTROL, 0); /* Make IP hdr aligned with 4 */ cpsw_write_4(sc, CPSW_CPDMA_RX_BUFFER_OFFSET, 2); /* Initialize RX Buffer Descriptors */ + cpsw_write_4(sc, CPSW_CPDMA_RX_PENDTHRESH(0), 0); cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), 0); /* Enable TX & RX DMA */ @@ -607,7 +608,8 @@ cpsw_init(struct cpsw_softc *sc) cpsw_write_4(sc, CPSW_CPDMA_DMA_INTMASK_SET, 3); /* Enable interrupts for RX and TX on Channel 0 */ - cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET, 1); + cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET, + CPSW_CPDMA_RX_INT(0) | CPSW_CPDMA_RX_INT_THRESH(0)); cpsw_write_4(sc, CPSW_CPDMA_TX_INTMASK_SET, 1); /* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */ @@ -625,6 +627,8 @@ cpsw_init(struct cpsw_softc *sc) if (slot != NULL) cpsw_write_hdp_slot(sc, &sc->rx, slot); cpsw_rx_enqueue(sc); + cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), sc->rx.active_queue_len); + cpsw_write_4(sc, CPSW_CPDMA_RX_PENDTHRESH(0), CPSW_TXFRAGS); /* Activate network interface. */ sc->rx.running = 1; @@ -1154,58 +1158,52 @@ cpsw_shutdown(device_t dev) } static void -cpsw_rx_teardown_locked(struct cpsw_softc *sc) +cpsw_rx_teardown(struct cpsw_softc *sc) { - struct ifnet *ifp; - struct mbuf *received, *next; int i = 0; + CPSW_RX_LOCK(sc); CPSW_DEBUGF(sc, ("starting RX teardown")); + sc->rx.teardown = 1; cpsw_write_4(sc, CPSW_CPDMA_RX_TEARDOWN, 0); - for (;;) { - received = cpsw_rx_dequeue(sc); - CPSW_RX_UNLOCK(sc); - while (received != NULL) { - next = received->m_nextpkt; - received->m_nextpkt = NULL; - ifp = received->m_pkthdr.rcvif; - (*ifp->if_input)(ifp, received); - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - received = next; - } - CPSW_RX_LOCK(sc); - if (!sc->rx.running) { - CPSW_DEBUGF(sc, - ("finished RX teardown (%d retries)", i)); - return; - } + CPSW_RX_UNLOCK(sc); + while (sc->rx.running) { if (++i > 10) { device_printf(sc->dev, "Unable to cleanly shutdown receiver\n"); return; } - DELAY(10); + DELAY(200); } + if (!sc->rx.running) + CPSW_DEBUGF(sc, ("finished RX teardown (%d retries)", i)); } static void -cpsw_tx_teardown_locked(struct cpsw_softc *sc) +cpsw_tx_teardown(struct cpsw_softc *sc) { int i = 0; + CPSW_TX_LOCK(sc); CPSW_DEBUGF(sc, ("starting TX teardown")); - cpsw_write_4(sc, CPSW_CPDMA_TX_TEARDOWN, 0); + /* Start the TX queue teardown if queue is not empty. */ + if (STAILQ_FIRST(&sc->tx.active) != NULL) + cpsw_write_4(sc, CPSW_CPDMA_TX_TEARDOWN, 0); + else + sc->tx.teardown = 1; cpsw_tx_dequeue(sc); while (sc->tx.running && ++i < 10) { - DELAY(10); + DELAY(200); cpsw_tx_dequeue(sc); } if (sc->tx.running) { device_printf(sc->dev, "Unable to cleanly shutdown transmitter\n"); } - CPSW_DEBUGF(sc, ("finished TX teardown (%d retries, %d idle buffers)", - i, sc->tx.active_queue_len)); + CPSW_DEBUGF(sc, + ("finished TX teardown (%d retries, %d idle buffers)", i, + sc->tx.active_queue_len)); + CPSW_TX_UNLOCK(sc); } static void @@ -1230,12 +1228,8 @@ cpswp_stop_locked(struct cpswp_softc *sc /* Tear down the RX/TX queues. */ if (cpsw_ports_down(sc->swsc)) { - CPSW_RX_LOCK(sc->swsc); - cpsw_rx_teardown_locked(sc->swsc); - CPSW_RX_UNLOCK(sc->swsc); - CPSW_TX_LOCK(sc->swsc); - cpsw_tx_teardown_locked(sc->swsc); - CPSW_TX_UNLOCK(sc->swsc); + cpsw_rx_teardown(sc->swsc); + cpsw_tx_teardown(sc->swsc); } /* Stop MAC RX/TX modules. */ @@ -1350,12 +1344,11 @@ cpswp_ioctl(struct ifnet *ifp, u_long co ifp->if_flags & IFF_ALLMULTI); } else { CPSW_DEBUGF(sc->swsc, - ("SIOCSIFFLAGS: UP but not RUNNING; starting up")); + ("SIOCSIFFLAGS: starting up")); cpswp_init_locked(sc); } } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - CPSW_DEBUGF(sc->swsc, - ("SIOCSIFFLAGS: not UP but RUNNING; shutting down")); + CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: shutting down")); cpswp_stop_locked(sc); } @@ -1498,16 +1491,22 @@ cpswp_miibus_statchg(device_t dev) static void cpsw_intr_rx(void *arg) { - struct cpsw_softc *sc = arg; + struct cpsw_softc *sc; struct ifnet *ifp; struct mbuf *received, *next; + sc = (struct cpsw_softc *)arg; CPSW_RX_LOCK(sc); + if (sc->rx.teardown) { + sc->rx.running = 0; + sc->rx.teardown = 0; + cpsw_write_cp(sc, &sc->rx, 0xfffffffc); + } received = cpsw_rx_dequeue(sc); cpsw_rx_enqueue(sc); cpsw_write_4(sc, CPSW_CPDMA_CPDMA_EOI_VECTOR, 1); CPSW_RX_UNLOCK(sc); - + while (received != NULL) { next = received->m_nextpkt; received->m_nextpkt = NULL; @@ -1522,20 +1521,28 @@ static struct mbuf * cpsw_rx_dequeue(struct cpsw_softc *sc) { struct cpsw_cpdma_bd bd; - struct cpsw_slot *slot; + struct cpsw_slot *last, *slot; struct cpswp_softc *psc; struct mbuf *mb_head, *mb_tail; int port, removed = 0; + last = NULL; mb_head = mb_tail = NULL; /* Pull completed packets off hardware RX queue. */ while ((slot = STAILQ_FIRST(&sc->rx.active)) != NULL) { cpsw_cpdma_read_bd(sc, slot, &bd); - if (bd.flags & CPDMA_BD_OWNER) - break; /* Still in use by hardware */ - CPSW_DEBUGF(sc, ("Removing received packet from RX queue")); + /* + * Stop on packets still in use by hardware, but do not stop + * on packets with the teardown complete flag, they will be + * discarded later. + */ + if ((bd.flags & (CPDMA_BD_OWNER | CPDMA_BD_TDOWNCMPLT)) == + CPDMA_BD_OWNER) + break; + + last = slot; ++removed; STAILQ_REMOVE_HEAD(&sc->rx.active, next); STAILQ_INSERT_TAIL(&sc->rx.avail, slot, next); @@ -1544,16 +1551,14 @@ cpsw_rx_dequeue(struct cpsw_softc *sc) bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap); if (bd.flags & CPDMA_BD_TDOWNCMPLT) { - CPSW_DEBUGF(sc, ("RX teardown in progress")); + CPSW_DEBUGF(sc, ("RX teardown is complete")); m_freem(slot->mbuf); slot->mbuf = NULL; - cpsw_write_cp(sc, &sc->rx, 0xfffffffc); sc->rx.running = 0; + sc->rx.teardown = 0; break; } - cpsw_write_cp_slot(sc, &sc->rx, slot); - port = (bd.flags & CPDMA_BD_PORT_MASK) - 1; KASSERT(port >= 0 && port <= 1, ("patcket received with invalid port: %d", port)); @@ -1586,15 +1591,20 @@ cpsw_rx_dequeue(struct cpsw_softc *sc) } mb_tail = slot->mbuf; slot->mbuf = NULL; + if (sc->rx_batch > 0 && sc->rx_batch == removed) + break; } if (removed != 0) { + cpsw_write_cp_slot(sc, &sc->rx, last); sc->rx.queue_removes += removed; - sc->rx.active_queue_len -= removed; sc->rx.avail_queue_len += removed; + sc->rx.active_queue_len -= removed; if (sc->rx.avail_queue_len > sc->rx.max_avail_queue_len) sc->rx.max_avail_queue_len = sc->rx.avail_queue_len; + CPSW_DEBUGF(sc, ("Removed %d received packet(s) from RX queue", removed)); } + return (mb_head); } @@ -1603,13 +1613,16 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) { bus_dma_segment_t seg[1]; struct cpsw_cpdma_bd bd; - struct cpsw_slots tmpqueue = STAILQ_HEAD_INITIALIZER(tmpqueue); - struct cpsw_slot *slot, *prev_slot = NULL; - struct cpsw_slot *last_old_slot, *first_new_slot; + struct cpsw_slot *first_new_slot, *last_old_slot, *next, *slot; int error, nsegs, added = 0; + uint32_t flags; /* Register new mbufs with hardware. */ + first_new_slot = NULL; + last_old_slot = STAILQ_LAST(&sc->rx.active, cpsw_slot, next); while ((slot = STAILQ_FIRST(&sc->rx.avail)) != NULL) { + if (first_new_slot == NULL) + first_new_slot = slot; if (slot->mbuf == NULL) { slot->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (slot->mbuf == NULL) { @@ -1639,8 +1652,11 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) bus_dmamap_sync(sc->mbuf_dtag, slot->dmamap, BUS_DMASYNC_PREREAD); - /* Create and submit new rx descriptor*/ - bd.next = 0; + /* Create and submit new rx descriptor. */ + if ((next = STAILQ_NEXT(slot, next)) != NULL) + bd.next = cpsw_cpdma_bd_paddr(sc, next); + else + bd.next = 0; bd.bufptr = seg->ds_addr; bd.bufoff = 0; bd.buflen = MCLBYTES - 1; @@ -1649,38 +1665,35 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) cpsw_cpdma_write_bd(sc, slot, &bd); ++added; - if (prev_slot != NULL) - cpsw_cpdma_write_bd_next(sc, prev_slot, slot); - prev_slot = slot; STAILQ_REMOVE_HEAD(&sc->rx.avail, next); - sc->rx.avail_queue_len--; - STAILQ_INSERT_TAIL(&tmpqueue, slot, next); + STAILQ_INSERT_TAIL(&sc->rx.active, slot, next); } - if (added == 0) + if (added == 0 || first_new_slot == NULL) return; CPSW_DEBUGF(sc, ("Adding %d buffers to RX queue", added)); /* Link new entries to hardware RX queue. */ - last_old_slot = STAILQ_LAST(&sc->rx.active, cpsw_slot, next); - first_new_slot = STAILQ_FIRST(&tmpqueue); - STAILQ_CONCAT(&sc->rx.active, &tmpqueue); - if (first_new_slot == NULL) { - return; - } else if (last_old_slot == NULL) { + if (last_old_slot == NULL) { /* Start a fresh queue. */ cpsw_write_hdp_slot(sc, &sc->rx, first_new_slot); } else { /* Add buffers to end of current queue. */ cpsw_cpdma_write_bd_next(sc, last_old_slot, first_new_slot); /* If underrun, restart queue. */ - if (cpsw_cpdma_read_bd_flags(sc, last_old_slot) & CPDMA_BD_EOQ) { + if ((flags = cpsw_cpdma_read_bd_flags(sc, last_old_slot)) & + CPDMA_BD_EOQ) { + flags &= ~CPDMA_BD_EOQ; + cpsw_cpdma_write_bd_flags(sc, last_old_slot, flags); cpsw_write_hdp_slot(sc, &sc->rx, first_new_slot); + sc->rx.queue_restart++; } } sc->rx.queue_adds += added; + sc->rx.avail_queue_len -= added; sc->rx.active_queue_len += added; + cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), sc->rx.active_queue_len); if (sc->rx.active_queue_len > sc->rx.max_active_queue_len) { sc->rx.max_active_queue_len = sc->rx.active_queue_len; } @@ -1689,13 +1702,16 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) static void cpswp_start(struct ifnet *ifp) { - struct cpswp_softc *sc = ifp->if_softc; + struct cpswp_softc *sc; - CPSW_TX_LOCK(sc->swsc); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && sc->swsc->tx.running) { - cpswp_tx_enqueue(sc); - cpsw_tx_dequeue(sc->swsc); + sc = ifp->if_softc; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sc->swsc->tx.running == 0) { + return; } + CPSW_TX_LOCK(sc->swsc); + cpswp_tx_enqueue(sc); + cpsw_tx_dequeue(sc->swsc); CPSW_TX_UNLOCK(sc->swsc); } @@ -1706,6 +1722,8 @@ cpsw_intr_tx(void *arg) sc = (struct cpsw_softc *)arg; CPSW_TX_LOCK(sc); + if (cpsw_read_4(sc, CPSW_CPDMA_TX_CP(0)) == 0xfffffffc) + cpsw_write_cp(sc, &sc->tx, 0xfffffffc); cpsw_tx_dequeue(sc); cpsw_write_4(sc, CPSW_CPDMA_CPDMA_EOI_VECTOR, 2); CPSW_TX_UNLOCK(sc); @@ -1716,9 +1734,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) { bus_dma_segment_t segs[CPSW_TXFRAGS]; struct cpsw_cpdma_bd bd; - struct cpsw_slots tmpqueue = STAILQ_HEAD_INITIALIZER(tmpqueue); - struct cpsw_slot *slot, *prev_slot = NULL; - struct cpsw_slot *last_old_slot, *first_new_slot; + struct cpsw_slot *first_new_slot, *last, *last_old_slot, *next, *slot; struct mbuf *m0; int error, flags, nsegs, seg, added = 0, padlen; @@ -1728,6 +1744,9 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) ((sc->unit + 1) & CPDMA_BD_PORT_MASK); } /* Pull pending packets from IF queue and prep them for DMA. */ + last = NULL; + first_new_slot = NULL; + last_old_slot = STAILQ_LAST(&sc->swsc->tx.active, cpsw_slot, next); while ((slot = STAILQ_FIRST(&sc->swsc->tx.avail)) != NULL) { IF_DEQUEUE(&sc->ifp->if_snd, m0); if (m0 == NULL) @@ -1779,12 +1798,24 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) ("Queueing TX packet: %d segments + %d pad bytes", nsegs, padlen)); + if (first_new_slot == NULL) + first_new_slot = slot; + + /* Link from the previous descriptor. */ + if (last != NULL) + cpsw_cpdma_write_bd_next(sc->swsc, last, slot); + slot->ifp = sc->ifp; + /* If there is only one segment, the for() loop * gets skipped and the single buffer gets set up * as both SOP and EOP. */ - /* Start by setting up the first buffer */ - bd.next = 0; + if (nsegs > 1) { + next = STAILQ_NEXT(slot, next); + bd.next = cpsw_cpdma_bd_paddr(sc->swsc, next); + } else + bd.next = 0; + /* Start by setting up the first buffer. */ bd.bufptr = segs[0].ds_addr; bd.bufoff = 0; bd.buflen = segs[0].ds_len; @@ -1793,19 +1824,16 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) for (seg = 1; seg < nsegs; ++seg) { /* Save the previous buffer (which isn't EOP) */ cpsw_cpdma_write_bd(sc->swsc, slot, &bd); - if (prev_slot != NULL) { - cpsw_cpdma_write_bd_next(sc->swsc, prev_slot, - slot); - } - prev_slot = slot; STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); - sc->swsc->tx.avail_queue_len--; - STAILQ_INSERT_TAIL(&tmpqueue, slot, next); - ++added; + STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next); slot = STAILQ_FIRST(&sc->swsc->tx.avail); /* Setup next buffer (which isn't SOP) */ - bd.next = 0; + if (nsegs > seg + 1) { + next = STAILQ_NEXT(slot, next); + bd.next = cpsw_cpdma_bd_paddr(sc->swsc, next); + } else + bd.next = 0; bd.bufptr = segs[seg].ds_addr; bd.bufoff = 0; bd.buflen = segs[seg].ds_len; @@ -1815,25 +1843,18 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) /* Save the final buffer. */ if (padlen <= 0) bd.flags |= CPDMA_BD_EOP; + else { + next = STAILQ_NEXT(slot, next); + bd.next = cpsw_cpdma_bd_paddr(sc->swsc, next); + } cpsw_cpdma_write_bd(sc->swsc, slot, &bd); - if (prev_slot != NULL) - cpsw_cpdma_write_bd_next(sc->swsc, prev_slot, slot); - prev_slot = slot; STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); - sc->swsc->tx.avail_queue_len--; - STAILQ_INSERT_TAIL(&tmpqueue, slot, next); - ++added; + STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next); if (padlen > 0) { slot = STAILQ_FIRST(&sc->swsc->tx.avail); - STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); - sc->swsc->tx.avail_queue_len--; - STAILQ_INSERT_TAIL(&tmpqueue, slot, next); - ++added; - - /* Setup buffer of null pad bytes (definitely EOP) */ - cpsw_cpdma_write_bd_next(sc->swsc, prev_slot, slot); - prev_slot = slot; + + /* Setup buffer of null pad bytes (definitely EOP). */ bd.next = 0; bd.bufptr = sc->swsc->null_mbuf_paddr; bd.bufoff = 0; @@ -1842,8 +1863,14 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER | flags; cpsw_cpdma_write_bd(sc->swsc, slot, &bd); ++nsegs; + + STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); + STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next); } + last = slot; + + added += nsegs; if (nsegs > sc->swsc->tx.longest_chain) sc->swsc->tx.longest_chain = nsegs; @@ -1852,33 +1879,27 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) BPF_MTAP(sc->ifp, m0); } - /* Attach the list of new buffers to the hardware TX queue. */ - last_old_slot = STAILQ_LAST(&sc->swsc->tx.active, cpsw_slot, next); - first_new_slot = STAILQ_FIRST(&tmpqueue); - STAILQ_CONCAT(&sc->swsc->tx.active, &tmpqueue); - if (first_new_slot == NULL) { + if (first_new_slot == NULL) return; - } else if (last_old_slot == NULL) { - /* Start a fresh queue. */ - sc->swsc->last_hdp = cpsw_cpdma_bd_paddr(sc->swsc, first_new_slot); - cpsw_write_hdp_slot(sc->swsc, &sc->swsc->tx, first_new_slot); - } else { + + /* Attach the list of new buffers to the hardware TX queue. */ + if (last_old_slot != NULL && + (cpsw_cpdma_read_bd_flags(sc->swsc, last_old_slot) & + CPDMA_BD_EOQ) == 0) { /* Add buffers to end of current queue. */ cpsw_cpdma_write_bd_next(sc->swsc, last_old_slot, first_new_slot); - /* If underrun, restart queue. */ - if (cpsw_cpdma_read_bd_flags(sc->swsc, last_old_slot) & - CPDMA_BD_EOQ) { - sc->swsc->last_hdp = cpsw_cpdma_bd_paddr(sc->swsc, first_new_slot); - cpsw_write_hdp_slot(sc->swsc, &sc->swsc->tx, - first_new_slot); - } + } else { + /* Start a fresh queue. */ + cpsw_write_hdp_slot(sc->swsc, &sc->swsc->tx, first_new_slot); } sc->swsc->tx.queue_adds += added; + sc->swsc->tx.avail_queue_len -= added; sc->swsc->tx.active_queue_len += added; if (sc->swsc->tx.active_queue_len > sc->swsc->tx.max_active_queue_len) { sc->swsc->tx.max_active_queue_len = sc->swsc->tx.active_queue_len; } + CPSW_DEBUGF(sc->swsc, ("Queued %d TX packet(s)", added)); } static int @@ -1888,27 +1909,31 @@ cpsw_tx_dequeue(struct cpsw_softc *sc) struct cpsw_cpdma_bd bd; uint32_t flags, removed = 0; - slot = STAILQ_FIRST(&sc->tx.active); - if (slot == NULL && cpsw_read_cp(sc, &sc->tx) == 0xfffffffc) { - CPSW_DEBUGF(sc, ("TX teardown of an empty queue")); - cpsw_write_cp(sc, &sc->tx, 0xfffffffc); - sc->tx.running = 0; - return (0); - } - /* Pull completed buffers off the hardware TX queue. */ + slot = STAILQ_FIRST(&sc->tx.active); while (slot != NULL) { flags = cpsw_cpdma_read_bd_flags(sc, slot); - if (flags & CPDMA_BD_OWNER) + + /* TearDown complete is only marked on the SOP for the packet. */ + if ((flags & (CPDMA_BD_SOP | CPDMA_BD_TDOWNCMPLT)) == + (CPDMA_BD_SOP | CPDMA_BD_TDOWNCMPLT)) { + sc->tx.teardown = 1; + } + + if ((flags & CPDMA_BD_OWNER) != 0 && sc->tx.teardown == 0) break; /* Hardware is still using this packet. */ - CPSW_DEBUGF(sc, ("TX removing completed packet")); bus_dmamap_sync(sc->mbuf_dtag, slot->dmamap, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap); m_freem(slot->mbuf); slot->mbuf = NULL; - if (slot->ifp) - if_inc_counter(slot->ifp, IFCOUNTER_OPACKETS, 1); + + if (slot->ifp) { + if (sc->tx.teardown == 0) + if_inc_counter(slot->ifp, IFCOUNTER_OPACKETS, 1); + else + if_inc_counter(slot->ifp, IFCOUNTER_OQDROPS, 1); + } /* Dequeue any additional buffers used by this packet. */ while (slot != NULL && slot->mbuf == NULL) { @@ -1919,37 +1944,34 @@ cpsw_tx_dequeue(struct cpsw_softc *sc) slot = STAILQ_FIRST(&sc->tx.active); } - /* TearDown complete is only marked on the SOP for the packet. */ - if ((flags & (CPDMA_BD_SOP | CPDMA_BD_TDOWNCMPLT)) == - (CPDMA_BD_SOP | CPDMA_BD_TDOWNCMPLT)) { - CPSW_DEBUGF(sc, ("TX teardown in progress")); - cpsw_write_cp(sc, &sc->tx, 0xfffffffc); - // TODO: Increment a count of dropped TX packets - sc->tx.running = 0; - break; - } + cpsw_write_cp_slot(sc, &sc->tx, last_removed_slot); - if ((flags & CPDMA_BD_EOP) == 0) - flags = cpsw_cpdma_read_bd_flags(sc, last_removed_slot); - if ((flags & (CPDMA_BD_EOP | CPDMA_BD_EOQ)) == + /* Restart the TX queue if necessary. */ + cpsw_cpdma_read_bd(sc, last_removed_slot, &bd); + if (slot != NULL && bd.next != 0 && (bd.flags & + (CPDMA_BD_EOP | CPDMA_BD_OWNER | CPDMA_BD_EOQ)) == (CPDMA_BD_EOP | CPDMA_BD_EOQ)) { - cpsw_cpdma_read_bd(sc, last_removed_slot, &bd); - if (bd.next != 0 && bd.next != sc->last_hdp) { - /* Restart the queue. */ - sc->last_hdp = bd.next; - cpsw_write_4(sc, sc->tx.hdp_offset, bd.next); - } + cpsw_write_hdp_slot(sc, &sc->tx, slot); + sc->tx.queue_restart++; + break; } } if (removed != 0) { - cpsw_write_cp_slot(sc, &sc->tx, last_removed_slot); sc->tx.queue_removes += removed; sc->tx.active_queue_len -= removed; sc->tx.avail_queue_len += removed; if (sc->tx.avail_queue_len > sc->tx.max_avail_queue_len) sc->tx.max_avail_queue_len = sc->tx.avail_queue_len; + CPSW_DEBUGF(sc, ("TX removed %d completed packet(s)", removed)); + } + + if (sc->tx.teardown && STAILQ_EMPTY(&sc->tx.active)) { + CPSW_DEBUGF(sc, ("TX teardown is complete")); + sc->tx.teardown = 0; + sc->tx.running = 0; } + return (removed); } @@ -1962,11 +1984,25 @@ cpsw_tx_dequeue(struct cpsw_softc *sc) static void cpsw_intr_rx_thresh(void *arg) { - struct cpsw_softc *sc = arg; - uint32_t stat = cpsw_read_4(sc, CPSW_WR_C_RX_THRESH_STAT(0)); + struct cpsw_softc *sc; + struct ifnet *ifp; + struct mbuf *received, *next; - CPSW_DEBUGF(sc, ("stat=%x", stat)); + sc = (struct cpsw_softc *)arg; + CPSW_RX_LOCK(sc); + received = cpsw_rx_dequeue(sc); + cpsw_rx_enqueue(sc); cpsw_write_4(sc, CPSW_CPDMA_CPDMA_EOI_VECTOR, 0); + CPSW_RX_UNLOCK(sc); + + while (received != NULL) { + next = received->m_nextpkt; + received->m_nextpkt = NULL; + ifp = received->m_pkthdr.rcvif; + (*ifp->if_input)(ifp, received); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + received = next; + } } static void @@ -2138,6 +2174,11 @@ cpsw_tx_watchdog_full_reset(struct cpsw_ cpsw_debugf_head("CPSW watchdog"); device_printf(sc->dev, "watchdog timeout\n"); + printf("CPSW_CPDMA_TX%d_HDP=0x%x\n", 0, + cpsw_read_4(sc, CPSW_CPDMA_TX_HDP(0))); + printf("CPSW_CPDMA_TX%d_CP=0x%x\n", 0, + cpsw_read_4(sc, CPSW_CPDMA_TX_CP(0))); + cpsw_dump_queue(sc, &sc->tx.active); for (i = 0; i < CPSW_PORTS; i++) { if (!sc->dualemac && i != sc->active_slave) continue; @@ -2569,6 +2610,9 @@ cpsw_add_queue_sysctls(struct sysctl_ctx SYSCTL_ADD_UINT(ctx, parent, OID_AUTO, "totalDequeued", CTLFLAG_RD, &queue->queue_removes, 0, "Total buffers removed from queue"); + SYSCTL_ADD_UINT(ctx, parent, OID_AUTO, "queueRestart", + CTLFLAG_RD, &queue->queue_restart, 0, + "Total times the queue has been restarted"); SYSCTL_ADD_UINT(ctx, parent, OID_AUTO, "longestChain", CTLFLAG_RD, &queue->longest_chain, 0, "Max buffers used for a single packet"); @@ -2602,6 +2646,9 @@ cpsw_add_sysctls(struct cpsw_softc *sc) SYSCTL_ADD_INT(ctx, parent, OID_AUTO, "debug", CTLFLAG_RW, &sc->debug, 0, "Enable switch debug messages"); + SYSCTL_ADD_INT(ctx, parent, OID_AUTO, "rx_batch", + CTLFLAG_RW, &sc->rx_batch, 0, "Set the rx batch size"); + SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, "attachedSecs", CTLTYPE_UINT | CTLFLAG_RD, sc, 0, cpsw_stat_attached, "IU", "Time since driver attach"); Modified: stable/11/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpswreg.h Fri Dec 30 20:40:25 2016 (r310859) +++ stable/11/sys/arm/ti/cpsw/if_cpswreg.h Fri Dec 30 20:43:00 2016 (r310860) @@ -64,10 +64,13 @@ #define CPSW_CPDMA_RX_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0xA4) #define CPSW_CPDMA_RX_INTMASK_SET (CPSW_CPDMA_OFFSET + 0xA8) #define CPSW_CPDMA_RX_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0xAc) +#define CPSW_CPDMA_RX_INT_THRESH(_ch) (1 << (8 + ((_ch) & 7))) +#define CPSW_CPDMA_RX_INT(_ch) (1 << (0 + ((_ch) & 7))) #define CPSW_CPDMA_DMA_INTSTAT_RAW (CPSW_CPDMA_OFFSET + 0xB0) #define CPSW_CPDMA_DMA_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0xB4) #define CPSW_CPDMA_DMA_INTMASK_SET (CPSW_CPDMA_OFFSET + 0xB8) #define CPSW_CPDMA_DMA_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0xBC) +#define CPSW_CPDMA_RX_PENDTHRESH(p) (CPSW_CPDMA_OFFSET + 0x0c0 + ((p) * 0x04)) #define CPSW_CPDMA_RX_FREEBUFFER(p) (CPSW_CPDMA_OFFSET + 0x0e0 + ((p) * 0x04)) #define CPSW_STATS_OFFSET 0x0900 Modified: stable/11/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpswvar.h Fri Dec 30 20:40:25 2016 (r310859) +++ stable/11/sys/arm/ti/cpsw/if_cpswvar.h Fri Dec 30 20:43:00 2016 (r310860) @@ -52,11 +52,13 @@ STAILQ_HEAD(cpsw_slots, cpsw_slot); struct cpsw_queue { struct mtx lock; int running; + int teardown; struct cpsw_slots active; struct cpsw_slots avail; uint32_t queue_adds; /* total bufs added */ uint32_t queue_removes; /* total bufs removed */ uint32_t queue_removes_at_last_tick; /* Used by watchdog */ + uint32_t queue_restart; int queue_slots; int active_queue_len; int max_active_queue_len; @@ -77,6 +79,7 @@ struct cpsw_softc { int active_slave; int debug; int dualemac; + int rx_batch; phandle_t node; struct bintime attach_uptime; /* system uptime when attach happened. */ struct cpsw_port port[2]; @@ -84,7 +87,6 @@ struct cpsw_softc { /* RX and TX buffer tracking */ struct cpsw_queue rx, tx; - uint32_t last_hdp; /* We expect 1 memory resource and 4 interrupts from the device tree. */ int mem_rid; From owner-svn-src-all@freebsd.org Fri Dec 30 20:45:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3201C98A95; Fri, 30 Dec 2016 20:45:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 638751EB7; Fri, 30 Dec 2016 20:45:28 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKjRjP089513; Fri, 30 Dec 2016 20:45:27 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKjRZV089512; Fri, 30 Dec 2016 20:45:27 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302045.uBUKjRZV089512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310861 - stable/11/sys/contrib/vchiq/interface/compat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:45:28 -0000 Author: loos Date: Fri Dec 30 20:45:27 2016 New Revision: 310861 URL: https://svnweb.freebsd.org/changeset/base/310861 Log: MFC r308659: Reduce dmesg verbosity. Modified: stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.c ============================================================================== --- stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.c Fri Dec 30 20:43:00 2016 (r310860) +++ stable/11/sys/contrib/vchiq/interface/compat/vchi_bsd.c Fri Dec 30 20:45:27 2016 (r310861) @@ -300,7 +300,6 @@ void sema_sysinit(void *arg) { struct semaphore *s = arg; - printf("sema_sysinit\n"); _sema_init(s, 1); } From owner-svn-src-all@freebsd.org Fri Dec 30 20:48:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF329C98BD5; Fri, 30 Dec 2016 20:48:23 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9AC12AC; Fri, 30 Dec 2016 20:48:23 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKmMcH089989; Fri, 30 Dec 2016 20:48:22 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKmMaZ089988; Fri, 30 Dec 2016 20:48:22 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302048.uBUKmMaZ089988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310862 - stable/11/sys/arm/ti X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:48:23 -0000 Author: loos Date: Fri Dec 30 20:48:22 2016 New Revision: 310862 URL: https://svnweb.freebsd.org/changeset/base/310862 Log: MFC r308692: Fix ti_gpio_detach() to avoid crashing if something goes wrong. Sponsored by: Rubicon Communication, LLC (Netgate) Modified: stable/11/sys/arm/ti/ti_gpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/ti_gpio.c ============================================================================== --- stable/11/sys/arm/ti/ti_gpio.c Fri Dec 30 20:45:27 2016 (r310861) +++ stable/11/sys/arm/ti/ti_gpio.c Fri Dec 30 20:48:22 2016 (r310862) @@ -782,7 +782,8 @@ ti_gpio_detach(device_t dev) /* Disable all interrupts */ if (sc->sc_mem_res != NULL) ti_gpio_intr_clr(sc, 0xffffffff); - gpiobus_detach_bus(dev); + if (sc->sc_busdev != NULL) + gpiobus_detach_bus(dev); #ifdef INTRNG if (sc->sc_isrcs != NULL) ti_gpio_pic_detach(sc); @@ -801,10 +802,12 @@ ti_gpio_detach(device_t dev) bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_hdl); } - bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, - sc->sc_irq_res); - bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, - sc->sc_mem_res); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, + sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, + sc->sc_mem_res); TI_GPIO_LOCK_DESTROY(sc); return (0); From owner-svn-src-all@freebsd.org Fri Dec 30 21:00:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C48C98F44; Fri, 30 Dec 2016 21:00:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 419401B4C; Fri, 30 Dec 2016 21:00:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUL0juU094219; Fri, 30 Dec 2016 21:00:45 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUL0jjC094218; Fri, 30 Dec 2016 21:00:45 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201612302100.uBUL0jjC094218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Fri, 30 Dec 2016 21:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310863 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 21:00:46 -0000 Author: pstef Date: Fri Dec 30 21:00:45 2016 New Revision: 310863 URL: https://svnweb.freebsd.org/changeset/base/310863 Log: indent(1): Avoid out of bounds access of array ps.paren_indents ps.p_l_follow can't be allowed to grow beyond maximum index of paren_indents. Approved by: pfg (mentor) Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Dec 30 20:48:22 2016 (r310862) +++ head/usr.bin/indent/indent.c Fri Dec 30 21:00:45 2016 (r310863) @@ -525,7 +525,12 @@ check_type: break; case lparen: /* got a '(' or '[' */ - ++ps.p_l_follow; /* count parens to make Healy happy */ + /* count parens to make Healy happy */ + if (++ps.p_l_follow == nitems(ps.paren_indents)) { + diag3(0, "Reached internal limit of %d unclosed parens", + nitems(ps.paren_indents)); + ps.p_l_follow--; + } if (ps.want_blank && *token != '[' && (ps.last_token != ident || proc_calls_space || /* offsetof (1) is never allowed a space; sizeof (2) gets From owner-svn-src-all@freebsd.org Fri Dec 30 21:33:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A29C1C988CB; Fri, 30 Dec 2016 21:33:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 679971DCE; Fri, 30 Dec 2016 21:33:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBULX1kK010092; Fri, 30 Dec 2016 21:33:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBULX1YA010091; Fri, 30 Dec 2016 21:33:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612302133.uBULX1YA010091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 30 Dec 2016 21:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310864 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 21:33:02 -0000 Author: ngie Date: Fri Dec 30 21:33:01 2016 New Revision: 310864 URL: https://svnweb.freebsd.org/changeset/base/310864 Log: Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6 structs under the INET6 #ifdef. Similarly (even though it doesn't seem to affect the build), conditionalize all IPv4 structs under the INET #ifdef This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not verified other MACHINE/TARGET pairs (e.g. armv6/arm). MFC after: 2 weeks X-MFC with: r310847 Pointyhat to: jpaetzel Reported by: O. Hartmann Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Dec 30 21:00:45 2016 (r310863) +++ head/sys/netinet/ip_carp.c Fri Dec 30 21:33:01 2016 (r310864) @@ -598,23 +598,29 @@ carp6_input(struct mbuf **mp, int *offp, static int carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) { +#ifdef INET struct ip *ip4; struct in_addr in4; +#endif +#ifdef INET6 struct ip6_hdr *ip6; struct in6_addr in6; +#endif switch (af) { +#ifdef INET case AF_INET: ip4 = mtod(m, struct ip *); in4 = ifatoia(ifa)->ia_addr.sin_addr; return (in4.s_addr == ip4->ip_src.s_addr); - +#endif +#ifdef INET6 case AF_INET6: ip6 = mtod(m, struct ip6_hdr *); in6 = ifatoia6(ifa)->ia_addr.sin6_addr; return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); - - default: /* how did this happen? */ +#endif + default: break; } return (0); From owner-svn-src-all@freebsd.org Fri Dec 30 21:41:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A92C98D08; Fri, 30 Dec 2016 21:41:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9415158A; Fri, 30 Dec 2016 21:41:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBULf22E010794; Fri, 30 Dec 2016 21:41:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBULf2Mk010793; Fri, 30 Dec 2016 21:41:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612302141.uBULf2Mk010793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 30 Dec 2016 21:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310865 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 21:41:03 -0000 Author: ngie Date: Fri Dec 30 21:41:01 2016 New Revision: 310865 URL: https://svnweb.freebsd.org/changeset/base/310865 Log: Fix whitespace in a comment and fixing a spelling error in a comment MFC after: 3 days Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Fri Dec 30 21:33:01 2016 (r310864) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Fri Dec 30 21:41:01 2016 (r310865) @@ -1308,8 +1308,7 @@ update_ifa_info(void) /* * Update arp table - * -*/ + */ void mib_arp_update(void) { @@ -1351,7 +1350,7 @@ mib_arp_update(void) /* - * Intput on the routing socket. + * Input on the routing socket. */ static void route_input(int fd, void *udata __unused) From owner-svn-src-all@freebsd.org Fri Dec 30 21:53:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6574FC971D5; Fri, 30 Dec 2016 21:53:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3303B103F; Fri, 30 Dec 2016 21:53:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id i5so23169593pgh.2; Fri, 30 Dec 2016 13:53:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=jnTYEn7PqRLVYRNettPKkBew/BXMsmOe8eiBzrQeRvQ=; b=APakOPdtAyuzZJT9YV1PFSq1sTa7/6gJJq2mqoWoqxgp//Ee+x4yUDVY038sjcZoXN cMNoqbgLfc4vKfe0cRQ+TqZVSxagO8DFoJsPp7ZEijIpDAuCXLbDSUoqZu2RoN1kLE59 9WVT3q4s1nLhZpWzXUHXisOlYVgOvdm5eAZKhZoMX83ta+Nue36I8CJNKjqbyC4/Zk8Z WYpBmJMaBlabZFEvgSY7s+gbSHEJMwJ9A+n1Z7ySMXWj2HNJ4DJxpOcy6svt11NG5V+q nu8VjrC4dV/xnpfUfNxMCqZ8Q664yk1xoPz/c0u926zwtSrFmPQS5pZkfxtsehCwYUYq /CpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=jnTYEn7PqRLVYRNettPKkBew/BXMsmOe8eiBzrQeRvQ=; b=FApiSjkwNlNKpofbiL9LwXm7IOGF2d5+v9PP2y0lHbaBd+YahqaYgva+GTlYyVO0+e v4o2pCNymihE0JaL5Q1Uq5NEiMFI9YroeWvKM7MiXjVijl1CTEvsnJB86fkKd2K8Hqq6 7FAEUkQ/w/KFCNlBYH+ll6PWqm/gXd96WQhvzTGaxC3LTVFd1t0hHq1wP/FRExI5pAl4 YqKFRPCsDGcGcdIZMAqj6W7ujj1SqbW6knWOAbI2ubgFeuOT0Esd896ljlOGp89/W30G /Kz1ClUFNZbZYyk4zNMHJXZnhrREAt4YuGvcsbrBQB03M2NRcEod+ZA/5yv+tcPdvBx9 r+mA== X-Gm-Message-State: AIkVDXIktKRB8cC1hThTPQpQ79ACI1VL/mJt40J1Kqo9rqbP31pF54PTkiPyxgsbiHkzXw== X-Received: by 10.98.55.131 with SMTP id e125mr45126530pfa.58.1483134790625; Fri, 30 Dec 2016 13:53:10 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m19sm7434531pfk.72.2016.12.30.13.53.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Dec 2016 13:53:09 -0800 (PST) Subject: Re: svn commit: r310864 - head/sys/netinet Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_916A96D5-9467-4891-84C7-DEFCB3F72453"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201612302133.uBULX1YA010091@repo.freebsd.org> Date: Fri, 30 Dec 2016 13:53:09 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <320706A4-1CA3-4ECB-81F6-D29B9ECB15B9@gmail.com> References: <201612302133.uBULX1YA010091@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 21:53:11 -0000 --Apple-Mail=_916A96D5-9467-4891-84C7-DEFCB3F72453 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 30, 2016, at 13:33, Ngie Cooper wrote: >=20 > Author: ngie > Date: Fri Dec 30 21:33:01 2016 > New Revision: 310864 > URL: https://svnweb.freebsd.org/changeset/base/310864 >=20 > Log: > Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all = IPv6 > structs under the INET6 #ifdef. Similarly (even though it doesn't = seem > to affect the build), conditionalize all IPv4 structs under the INET > #ifdef >=20 > This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have = not > verified other MACHINE/TARGET pairs (e.g. armv6/arm). Quick note (mostly for myself): I=E2=80=99m running "make = tinderbox=E2=80=9D to address this concern and see if I can spot other = issues. Cheers, -Ngie --Apple-Mail=_916A96D5-9467-4891-84C7-DEFCB3F72453 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYZtdFAAoJEPWDqSZpMIYVzsIQALIMsrmdQKWMsmhkv8QivTUJ fO8ZhMIv8c85zO6FdoioZoaMWS4N2mQSUbsMUQ6CHmqYtErVamtZSQS7Z5j7kqxy yMXLjhUFSntFCjmBBS8pSrpt0XBy8JVy0PHuU3+W4ZyJGBcHZyOAcWcsWQHW+zrH GqJCQKDWi6pps8yFakiI3dgD4W2w9PqcwpgO71Of0sOdgrdXLktHmBWk6Ls6lj/6 ysloZVwEK44rhofWnOtNUTJenbGph3oixGlfaWDoP97DpNsrJ6TuEhCIiWBrR558 2deaklUNOJWaPk0ZMWpJqatZgBpeidn8nkaWpDDG0kvKkhAwhxyFYKv7w7nb0fUD SzLieCvo7vH20t3ErWDMHBsexA5UWg8RmiwsMnHP03i1p1o4BhDdEQQtHu9+7pfX rPepEQn/NlTXOCfp5kW1Wo1ynohN7JI7ppNudEWSekExCVX+6Vk0fH6TNB7NJ+Df U9YXcdB8GSjWJPptNLLcqBap+cLuY88E3y9iCLa47srNhzOr+EDTc3Q4UBjAsFkw zcYmZrXb91F7iM+XJ0AyrfHWUBmw5ZwB9lxxE8HbckGzKHTcqSxnfyLynqbhE4K6 x0Wjw6yxT5913SImuZatjnfZn4w5OajjWoMFuTgMcXiAhIz+xOZHEri+SgGQ0Pqw 5REpQW4sdheKS1BqZF1s =i90V -----END PGP SIGNATURE----- --Apple-Mail=_916A96D5-9467-4891-84C7-DEFCB3F72453-- From owner-svn-src-all@freebsd.org Fri Dec 30 22:00:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2873C973B3; Fri, 30 Dec 2016 22:00:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F74D165A; Fri, 30 Dec 2016 22:00:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id n5so23187530pgh.3; Fri, 30 Dec 2016 14:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=yKGMFJ0yUhaA2SM3LkX7h1vCjYr6rler1Exvkw0in34=; b=OjwJPiDg1xmNUTckZ/uriBs+yM0yEFa3dTGBXi+htqSB0RByK6OBC3Y4HZXrEglPPE K4i2XsRiCJl2TrHyqtA3G2KC1PLI41eGe2NKdZ7vVNbiCKifxgvCp+WK8/RbU8Cd84do sr4dVdJnpXgMfNKheDjIvNzwAKPGTqdk80jbY6mk7kZPzyzECTIV+FBTDSl7kArc3nmr PfKgABQKj58ZqSYnTzQV762IYuYF2oxIhvl7EBKuxnM5pI2Lid+GH88z6K/hl8WKZhN0 Ba1EWyrjYjKBS8JE3GYnRtyylcYmbAryFF/C986W3J+8DQMBIKBFtYUixH2vFk2DfPhi lQQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=yKGMFJ0yUhaA2SM3LkX7h1vCjYr6rler1Exvkw0in34=; b=UOPfTcNzG89HY7RP5vlPaGxbQcJMyqMVGwPLiRSOVHEUBggOyaI653GLRnmfeh9h+H toZg+PLjMDSPyxwQ2OrsmcO9zzoTB66LImC+V+rImsf3Xq5+eaaHkV9tW2TCQ0Zy4kNU nQ8vj9qxsEqGsdMM+vyLojaFfXdvIt/Cjshx+CGL8Fzge7siGlTROvobzS0caS2KKvRh ioHe6BrWaeiTZ+yABa5Ve39CICb3W3ctdOAApt+HXnA7+nTrBN6o8IVbBKTm/mlscXf1 wyu2XlUA8msPL69NAaEmdSli0MfJxfSk0jVm1uhSn35sp4q+wQEGSSEpSI0W6cJ9kwGE rePw== X-Gm-Message-State: AIkVDXIM3v0VXixSKvPvp/ebdzpAAnJEfXZXizV4gqBmTv1OAdt8qID8uzjeSsRSDQfQ1A== X-Received: by 10.99.47.7 with SMTP id v7mr89616403pgv.39.1483135256900; Fri, 30 Dec 2016 14:00:56 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i76sm114710681pfk.89.2016.12.30.14.00.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Dec 2016 14:00:56 -0800 (PST) Subject: Re: svn commit: r310864 - head/sys/netinet Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_96D41712-ABF4-4162-8CA1-C39FF5FD4D1A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <320706A4-1CA3-4ECB-81F6-D29B9ECB15B9@gmail.com> Date: Fri, 30 Dec 2016 14:00:55 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201612302133.uBULX1YA010091@repo.freebsd.org> <320706A4-1CA3-4ECB-81F6-D29B9ECB15B9@gmail.com> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 22:00:57 -0000 --Apple-Mail=_96D41712-ABF4-4162-8CA1-C39FF5FD4D1A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 30, 2016, at 13:53, Ngie Cooper (yaneurabeya) = wrote: >=20 >>=20 >> On Dec 30, 2016, at 13:33, Ngie Cooper wrote: >>=20 >> Author: ngie >> Date: Fri Dec 30 21:33:01 2016 >> New Revision: 310864 >> URL: https://svnweb.freebsd.org/changeset/base/310864 >>=20 >> Log: >> Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all = IPv6 >> structs under the INET6 #ifdef. Similarly (even though it doesn't = seem >> to affect the build), conditionalize all IPv4 structs under the INET >> #ifdef >>=20 >> This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have = not >> verified other MACHINE/TARGET pairs (e.g. armv6/arm). >=20 > Quick note (mostly for myself): I=E2=80=99m running "make = tinderbox=E2=80=9D to address this concern and see if I can spot other = issues. > Cheers, I realized looking at the code that unfortunately it=E2=80=99s still = broken when both IPv4/IPv6 are disabled :/. -Ngie --Apple-Mail=_96D41712-ABF4-4162-8CA1-C39FF5FD4D1A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYZtkXAAoJEPWDqSZpMIYVP0kQALq8Irx5jJPTt9MhlOxkUFUZ 6gF6efsTtzO1S5JFXjmRQRGGftleWOzD1j97eLZCxo9VHt7GOct3MbjBH+dFPNU3 NS/JXSfnsa3ilbU+wcyhgS9pr+4rhWbW26jCntJN42cEAiHX3ePkmWSVqkDAm/MM f4aWyLaRKMFhzYE832qgX/CALXwV2qMnxMAgT8f5jbSGK3GjsMQQEcQC3GLqU4VB e1KHEbqQIObfBy81+FLRnVrrotCJDq4AhYSBaM1eCg3owES1JWC3m65t8gAi+Pdj nAtr/oRl3A/3F/RHB+45BaCsiwq8tvjNlcCZbCSK293xO7f8HqiM0Sf67eUJoHHn QBbAFcSbdqUp50nguNGcMhbkBTqq+nkZ+lXSibsxo2gfanjBVlpZxzkLZyjpDEk0 qEGrIi4hTi9d5dRuYwxplF8VT1KJMWtKKM5A8jCjVgFmTqxelbfRiVc9Vq1cgG3+ if88PRm7kZe+4xRyrowT0ovM4gjCXtNwjtR8PMUsF9wMpn9fGFiBnO+7TGuYtetf FOVvmQoEIDO43xp/4qkXM2ej4K+YrzjrfAFzreDyFrch5hWuft+3ZYoCyABqY/kX 9M54hNFrWHIN2SOqNSnRX4Tfx07OcFZKNuW+EHlo8ImICxu2hZEM+wGZ19n3WOeF QVBwk7KEq2ck6wSxXNb2 =nHwR -----END PGP SIGNATURE----- --Apple-Mail=_96D41712-ABF4-4162-8CA1-C39FF5FD4D1A-- From owner-svn-src-all@freebsd.org Fri Dec 30 22:18:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036A7C979E7; Fri, 30 Dec 2016 22:18:24 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94C541F06; Fri, 30 Dec 2016 22:18:23 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUMIM86027173; Fri, 30 Dec 2016 22:18:22 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUMIMZZ027169; Fri, 30 Dec 2016 22:18:22 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612302218.uBUMIMZZ027169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 22:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310866 - in head: . contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 22:18:24 -0000 Author: mm Date: Fri Dec 30 22:18:22 2016 New Revision: 310866 URL: https://svnweb.freebsd.org/changeset/base/310866 Log: MFV r310796, r310797: Sync libarchive with vendor. Vendor changes (relevant to FreeBSD): PR #771: Add NFSv4 ACL support to pax and restricted pax NFSv4 ACL information may now be stored to and restored from tar archives. ACL must be non-trivial and supported by the underlying filesystem, e.g. natively by ZFS or by UFS with the NFSv4 ACL enable flag set. MFC after: 2 weeks Relnotes: yes Added: head/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu - copied unchanged from r310796, vendor/libarchive/dist/libarchive/test/test_acl_pax_nfs4.tar.uu head/contrib/libarchive/libarchive/test/test_acl_pax_posix1e.tar.uu - copied unchanged from r310796, vendor/libarchive/dist/libarchive/test/test_acl_pax_posix1e.tar.uu head/contrib/libarchive/libarchive/test/test_acl_text.c - copied unchanged from r310796, vendor/libarchive/dist/libarchive/test/test_acl_text.c head/contrib/libarchive/libarchive/test/test_compat_star_acl.c - copied unchanged from r310796, vendor/libarchive/dist/libarchive/test/test_compat_star_acl.c head/contrib/libarchive/libarchive/test/test_compat_star_acl_nfs4.tar.uu - copied unchanged from r310796, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_nfs4.tar.uu Deleted: head/contrib/libarchive/libarchive/test/test_acl_pax.tar.uu head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c Modified: head/ObsoleteFiles.inc head/contrib/libarchive/NEWS head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_acl_private.h head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_entry_locale.h head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/libarchive-formats.5 head/contrib/libarchive/libarchive/tar.5 head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/test.h head/contrib/libarchive/libarchive/test/test_acl_freebsd_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c head/contrib/libarchive/libarchive/test/test_acl_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_pax.c head/contrib/libarchive/libarchive/test/test_acl_posix1e.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Dec 30 21:41:01 2016 (r310865) +++ head/ObsoleteFiles.inc Fri Dec 30 22:18:22 2016 (r310866) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu +OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu # 20161217: new clang import which bumps version from 3.9.0 to 3.9.1. OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/asan_interface.h Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Fri Dec 30 21:41:01 2016 (r310865) +++ head/contrib/libarchive/NEWS Fri Dec 30 22:18:22 2016 (r310866) @@ -1,3 +1,6 @@ +Dec 27, 2016: NFSv4 ACL read and write support for pax + Deprecated functions: archive_entry_acl_text(), archive_entry_acl_text_w() + Oct 26, 2016: Remove liblzmadec support Oct 23, 2016: libarchive 3.2.2 released Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Fri Dec 30 21:41:01 2016 (r310865) +++ head/contrib/libarchive/libarchive/archive_acl.c Fri Dec 30 22:18:22 2016 (r310866) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003-2010 Tim Kientzle + * Copyright (c) 2016 Martin Matuska * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,23 +56,31 @@ static struct archive_acl_entry *acl_new static int archive_acl_add_entry_len_l(struct archive_acl *acl, int type, int permset, int tag, int id, const char *name, size_t len, struct archive_string_conv *sc); +static int archive_acl_text_want_type(struct archive_acl *acl, int flags); +static ssize_t archive_acl_text_len(struct archive_acl *acl, int want_type, + int flags, int wide, struct archive *a, + struct archive_string_conv *sc); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); +static int is_nfs4_flags_w(const wchar_t *start, const wchar_t *end, + int *result); +static int is_nfs4_perms_w(const wchar_t *start, const wchar_t *end, + int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, const wchar_t **end, wchar_t *sep); -static int prefix_w(const wchar_t *start, const wchar_t *end, - const wchar_t *test); -static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id); +static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, int flags, const wchar_t *wname, int perm, int id); static void append_id_w(wchar_t **wp, int id); static int isint(const char *start, const char *end, int *result); static int ismode(const char *start, const char *end, int *result); +static int is_nfs4_flags(const char *start, const char *end, + int *result); +static int is_nfs4_perms(const char *start, const char *end, + int *result); static void next_field(const char **p, const char **start, const char **end, char *sep); -static int prefix_c(const char *start, const char *end, - const char *test); -static void append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id); +static void append_entry(char **p, const char *prefix, int type, + int tag, int flags, const char *name, int perm, int id); static void append_id(char **p, int id); void @@ -375,8 +384,8 @@ archive_acl_reset(struct archive_acl *ac * standard permissions and include them in the returned list. */ int -archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type, int *type, - int *permset, int *tag, int *id, const char **name) +archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type, + int *type, int *permset, int *tag, int *id, const char **name) { *name = NULL; *id = -1; @@ -441,130 +450,273 @@ archive_acl_next(struct archive *a, stru } /* - * Generate a text version of the ACL. The flags parameter controls - * the style of the generated ACL. + * Determine what type of ACL do we want */ -const wchar_t * -archive_acl_text_w(struct archive *a, struct archive_acl *acl, int flags) +static int +archive_acl_text_want_type(struct archive_acl *acl, int flags) { - int count; - size_t length; - const wchar_t *wname; - const wchar_t *prefix; - wchar_t separator; - struct archive_acl_entry *ap; - int id, r; - wchar_t *wp; + int want_type; - if (acl->acl_text_w != NULL) { - free (acl->acl_text_w); - acl->acl_text_w = NULL; + /* Check if ACL is NFSv4 */ + if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + /* NFSv4 should never mix with POSIX.1e */ + if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) + return (0); + else + return (ARCHIVE_ENTRY_ACL_TYPE_NFS4); } - separator = L','; + /* Now deal with POSIX.1e ACLs */ + + want_type = 0; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) + want_type |= ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + want_type |= ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + + /* By default we want both access and default ACLs */ + if (want_type == 0) + return (ARCHIVE_ENTRY_ACL_TYPE_POSIX1E); + + return (want_type); +} + +/* + * Calculate ACL text string length + */ +static ssize_t +archive_acl_text_len(struct archive_acl *acl, int want_type, int flags, + int wide, struct archive *a, struct archive_string_conv *sc) { + struct archive_acl_entry *ap; + const char *name; + const wchar_t *wname; + int count, idlen, tmp, r; + ssize_t length; + size_t len; + count = 0; length = 0; - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & flags) != 0) { - count++; - if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && - (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) - length += 8; /* "default:" */ - length += 5; /* tag name */ - length += 1; /* colon */ - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0 && wname != NULL) - length += wcslen(wname); - else if (r < 0 && errno == ENOMEM) - return (NULL); - else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + count++; + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0 + && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) + length += 8; /* "default:" */ + switch (ap->tag) { + case ARCHIVE_ENTRY_ACL_USER_OBJ: + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + length += 6; /* "owner@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_USER: + case ARCHIVE_ENTRY_ACL_MASK: + length += 4; /* "user", "mask" */ + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + length += 6; /* "group@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_GROUP: + case ARCHIVE_ENTRY_ACL_OTHER: + length += 5; /* "group", "other" */ + break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + length += 9; /* "everyone@" */ + break; + } + length += 1; /* colon after tag */ + if (ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (wide) { + r = archive_mstring_get_wcs(a, &ap->name, + &wname); + if (r == 0 && wname != NULL) + length += wcslen(wname); + else if (r < 0 && errno == ENOMEM) + return (0); + else + length += sizeof(uid_t) * 3 + 1; + } else { + r = archive_mstring_get_mbs_l(&ap->name, &name, + &len, sc); + if (r != 0) + return (0); + if (len > 0 && name != NULL) + length += len; + else + length += sizeof(uid_t) * 3 + 1; + } + length += 1; /* colon after user or group name */ + } else if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) + length += 1; /* 2nd colon empty user,group or other */ + + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0) + && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) + && (ap->tag == ARCHIVE_ENTRY_ACL_OTHER + || ap->tag == ARCHIVE_ENTRY_ACL_MASK)) { + /* Solaris has no colon after other: and mask: */ + length = length - 1; + } + + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* rwxpdDaARWcCos:fdinSFI:deny */ + length += 27; + if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DENY) == 0) + length += 1; /* allow, alarm, audit */ + } else length += 3; /* rwx */ + + if ((ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) && + (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) != 0) { length += 1; /* colon */ - length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; - length ++; /* newline */ + /* ID digit count */ + idlen = 1; + tmp = ap->id; + while (tmp > 9) { + tmp = tmp / 10; + idlen++; + } + length += idlen; } - ap = ap->next; + length ++; /* entry separator */ } - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { - length += 10; /* "user::rwx\n" */ - length += 11; /* "group::rwx\n" */ - length += 11; /* "other::rwx\n" */ - } + /* Add filemode-mapping access entries to the length */ + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + if ((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0) { + /* "user::rwx\ngroup::rwx\nother:rwx\n" */ + length += 31; + } else { + /* "user::rwx\ngroup::rwx\nother::rwx\n" */ + length += 32; + } + } else if (count == 0) + return (0); + + /* The terminating character is included in count */ + return (length); +} - if (count == 0) +/* + * Generate a wide text version of the ACL. The flags parameter controls + * the type and style of the generated ACL. + */ +wchar_t * +archive_acl_to_text_w(struct archive_acl *acl, ssize_t *text_len, int flags, + struct archive *a) +{ + int count; + ssize_t length; + size_t len; + const wchar_t *wname; + const wchar_t *prefix; + wchar_t separator; + struct archive_acl_entry *ap; + int id, r, want_type; + wchar_t *wp, *ws; + + want_type = archive_acl_text_want_type(acl, flags); + + /* Both NFSv4 and POSIX.1 types found */ + if (want_type == 0) return (NULL); + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) + flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; + + length = archive_acl_text_len(acl, want_type, flags, 1, a, NULL); + + if (length == 0) + return (NULL); + + if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA) + separator = L','; + else + separator = L'\n'; + /* Now, allocate the string and actually populate it. */ - wp = acl->acl_text_w = (wchar_t *)malloc(length * sizeof(wchar_t)); - if (wp == NULL) + wp = ws = (wchar_t *)malloc(length * sizeof(wchar_t)); + if (wp == NULL) { + if (errno == ENOMEM) + __archive_errx(1, "No memory"); return (NULL); + } count = 0; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL, acl->mode & 0700, -1); - *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + *wp++ = separator; + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL, acl->mode & 0070, -1); - *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + *wp++ = separator; + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, flags, NULL, acl->mode & 0007, -1); count += 3; - - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0) { - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry_w(&wp, NULL, ap->tag, wname, - ap->permset, id); - count++; - } else if (r < 0 && errno == ENOMEM) - return (NULL); - } - ap = ap->next; - } } - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT && + (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0) prefix = L"default:"; else prefix = NULL; - ap = acl->acl_head; - count = 0; - while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0) { - if (count > 0) - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry_w(&wp, prefix, ap->tag, - wname, ap->permset, id); - count ++; - } else if (r < 0 && errno == ENOMEM) - return (NULL); - } - ap = ap->next; - } + r = archive_mstring_get_wcs(a, &ap->name, &wname); + if (r == 0) { + if (count > 0) + *wp++ = separator; + if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) + id = ap->id; + else + id = -1; + append_entry_w(&wp, prefix, ap->type, ap->tag, flags, + wname, ap->permset, id); + count++; + } else if (r < 0 && errno == ENOMEM) + return (NULL); } - return (acl->acl_text_w); -} + /* Add terminating character */ + *wp++ = L'\0'; + + len = wcslen(ws); + if ((ssize_t)len > (length - 1)) + __archive_errx(1, "Buffer overrun"); + + if (text_len != NULL) + *text_len = len; + + return (ws); +} static void append_id_w(wchar_t **wp, int id) @@ -577,8 +729,8 @@ append_id_w(wchar_t **wp, int id) } static void -append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id) +append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, int flags, const wchar_t *wname, int perm, int id) { if (prefix != NULL) { wcscpy(*wp, prefix); @@ -588,6 +740,10 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_USER_OBJ: wname = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + wcscpy(*wp, L"owner@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: wcscpy(*wp, L"user"); @@ -595,6 +751,10 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_GROUP_OBJ: wname = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + wcscpy(*wp, L"group@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: wcscpy(*wp, L"group"); @@ -609,154 +769,209 @@ append_entry_w(wchar_t **wp, const wchar wname = NULL; id = -1; break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + wcscpy(*wp, L"everyone@"); + wname = NULL; + id = -1; + break; } *wp += wcslen(*wp); *(*wp)++ = L':'; - if (wname != NULL) { - wcscpy(*wp, wname); + if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (wname != NULL) { + wcscpy(*wp, wname); + *wp += wcslen(*wp); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id_w(wp, id); + id = -1; + } + /* Solaris style has no second colon after other and mask */ + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) + || (tag != ARCHIVE_ENTRY_ACL_OTHER + && tag != ARCHIVE_ENTRY_ACL_MASK)) + *(*wp)++ = L':'; + } + if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + /* POSIX.1e ACL perms */ + *(*wp)++ = (perm & 0444) ? L'r' : L'-'; + *(*wp)++ = (perm & 0222) ? L'w' : L'-'; + *(*wp)++ = (perm & 0111) ? L'x' : L'-'; + } else { + /* NFS4 ACL perms */ + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? L'r' : L'-'; + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? L'w' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? L'x' : L'-'; + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | + ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? L'p' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? L'd' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? L'D' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? L'a' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? L'A' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? L'R' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? L'W' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? L'c' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? L'C' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? L'o' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? L's' : L'-'; + *(*wp)++ = L':'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? L'f' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? L'd' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? L'i' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? L'n' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? L'S' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? L'F' : L'-'; + *(*wp)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? L'I' : L'-'; + *(*wp)++ = L':'; + switch (type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + wcscpy(*wp, L"allow"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + wcscpy(*wp, L"deny"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + wcscpy(*wp, L"audit"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + wcscpy(*wp, L"alarm"); + break; + default: + break; + } *wp += wcslen(*wp); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id_w(wp, id); - id = -1; } - *(*wp)++ = L':'; - *(*wp)++ = (perm & 0444) ? L'r' : L'-'; - *(*wp)++ = (perm & 0222) ? L'w' : L'-'; - *(*wp)++ = (perm & 0111) ? L'x' : L'-'; if (id != -1) { *(*wp)++ = L':'; append_id_w(wp, id); } - **wp = L'\0'; } -int -archive_acl_text_l(struct archive_acl *acl, int flags, - const char **acl_text, size_t *acl_text_len, +/* + * Generate a text version of the ACL. The flags parameter controls + * the type and style of the generated ACL. + */ +char * +archive_acl_to_text_l(struct archive_acl *acl, ssize_t *text_len, int flags, struct archive_string_conv *sc) { int count; - size_t length; + ssize_t length; + size_t len; const char *name; const char *prefix; char separator; struct archive_acl_entry *ap; - size_t len; - int id, r; - char *p; + int id, r, want_type; + char *p, *s; - if (acl->acl_text != NULL) { - free (acl->acl_text); - acl->acl_text = NULL; - } + want_type = archive_acl_text_want_type(acl, flags); - *acl_text = NULL; - if (acl_text_len != NULL) - *acl_text_len = 0; - separator = ','; - count = 0; - length = 0; - ap = acl->acl_head; - while (ap != NULL) { - if ((ap->type & flags) != 0) { - count++; - if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && - (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) - length += 8; /* "default:" */ - length += 5; /* tag name */ - length += 1; /* colon */ - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (len > 0 && name != NULL) - length += len; - else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ - length += 3; /* rwx */ - length += 1; /* colon */ - length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; - length ++; /* newline */ - } - ap = ap->next; - } + /* Both NFSv4 and POSIX.1 types found */ + if (want_type == 0) + return (NULL); - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { - length += 10; /* "user::rwx\n" */ - length += 11; /* "group::rwx\n" */ - length += 11; /* "other::rwx\n" */ - } + if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) + flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; - if (count == 0) - return (0); + length = archive_acl_text_len(acl, want_type, flags, 0, NULL, sc); + + if (length == 0) + return (NULL); + + if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA) + separator = ','; + else + separator = '\n'; /* Now, allocate the string and actually populate it. */ - p = acl->acl_text = (char *)malloc(length); - if (p == NULL) - return (-1); + p = s = (char *)malloc(length * sizeof(char)); + if (p == NULL) { + if (errno == ENOMEM) + __archive_errx(1, "No memory"); + return (NULL); + } count = 0; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + + if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL, acl->mode & 0700, -1); - *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + *p++ = separator; + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL, acl->mode & 0070, -1); - *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + *p++ = separator; + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, flags, NULL, acl->mode & 0007, -1); count += 3; - - for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) == 0) - continue; - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - *p++ = separator; - if (name == NULL || (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { - id = ap->id; - } else { - id = -1; - } - append_entry(&p, NULL, ap->tag, name, - ap->permset, id); - count++; - } } - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { - if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) + for (ap = acl->acl_head; ap != NULL; ap = ap->next) { + if ((ap->type & want_type) == 0) + continue; + /* + * Filemode-mapping ACL entries are stored exclusively in + * ap->mode so they should not be in the list + */ + if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) + && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ + || ap->tag == ARCHIVE_ENTRY_ACL_OTHER)) + continue; + if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT && + (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0) prefix = "default:"; else prefix = NULL; - count = 0; - for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) == 0) - continue; - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (count > 0) - *p++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry(&p, prefix, ap->tag, - name, ap->permset, id); - count ++; + r = archive_mstring_get_mbs_l( + &ap->name, &name, &len, sc); + if (r != 0) + return (NULL); + if (count > 0) + *p++ = separator; + if (name == NULL || + (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { + id = ap->id; + } else { + id = -1; } + append_entry(&p, prefix, ap->type, ap->tag, flags, name, + ap->permset, id); + count++; } - *acl_text = acl->acl_text; - if (acl_text_len != NULL) - *acl_text_len = strlen(acl->acl_text); - return (0); + /* Add terminating character */ + *p++ = '\0'; + + len = strlen(s); + + if ((ssize_t)len > (length - 1)) + __archive_errx(1, "Buffer overrun"); + + if (text_len != NULL) + *text_len = len; + + return (s); } static void @@ -770,8 +985,8 @@ append_id(char **p, int id) } static void -append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id) +append_entry(char **p, const char *prefix, int type, + int tag, int flags, const char *name, int perm, int id) { if (prefix != NULL) { strcpy(*p, prefix); @@ -781,6 +996,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_USER_OBJ: name = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + strcpy(*p, "owner@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: strcpy(*p, "user"); @@ -788,6 +1007,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_GROUP_OBJ: name = NULL; id = -1; + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + strcpy(*p, "group@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: strcpy(*p, "group"); @@ -802,48 +1025,146 @@ append_entry(char **p, const char *prefi name = NULL; id = -1; break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + strcpy(*p, "everyone@"); + name = NULL; + id = -1; + break; } *p += strlen(*p); *(*p)++ = ':'; - if (name != NULL) { - strcpy(*p, name); + if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (name != NULL) { + strcpy(*p, name); + *p += strlen(*p); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id(p, id); + id = -1; + } + /* Solaris style has no second colon after other and mask */ + if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0) + || (tag != ARCHIVE_ENTRY_ACL_OTHER + && tag != ARCHIVE_ENTRY_ACL_MASK)) + *(*p)++ = ':'; + } + if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { + /* POSIX.1e ACL perms */ + *(*p)++ = (perm & 0444) ? 'r' : '-'; + *(*p)++ = (perm & 0222) ? 'w' : '-'; + *(*p)++ = (perm & 0111) ? 'x' : '-'; + } else { + /* NFS4 ACL perms */ + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? 'r' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? 'w' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_EXECUTE)) ? 'x' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | + ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? 'p' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? 'd' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? 'D' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? 'a' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? 'A' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? 'R' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? 'W' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_READ_ACL) ? 'c' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_ACL) ? 'C' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? 'o' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? 's' : '-'; + *(*p)++ = ':'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? 'f' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? 'd' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? 'i' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? 'n' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? 'S' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? 'F' : '-'; + *(*p)++ = (perm & + ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? 'I' : '-'; + *(*p)++ = ':'; + switch (type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + strcpy(*p, "allow"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + strcpy(*p, "deny"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + strcpy(*p, "audit"); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + strcpy(*p, "alarm"); + break; + } *p += strlen(*p); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id(p, id); - id = -1; } - *(*p)++ = ':'; - *(*p)++ = (perm & 0444) ? 'r' : '-'; - *(*p)++ = (perm & 0222) ? 'w' : '-'; - *(*p)++ = (perm & 0111) ? 'x' : '-'; if (id != -1) { *(*p)++ = ':'; append_id(p, id); } - **p = '\0'; } /* - * Parse a textual ACL. This automatically recognizes and supports - * extensions described above. The 'type' argument is used to - * indicate the type that should be used for any entries not - * explicitly marked as "default:". + * Parse a wide ACL text string. + * + * The want_type argument may be one of the following: + * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - text is a POSIX.1e ACL of type ACCESS + * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - text is a POSIX.1e ACL of type DEFAULT + * ARCHIVE_ENTRY_ACL_TYPE_NFS4 - text is as a NFSv4 ACL + * + * POSIX.1e ACL entries prefixed with "default:" are treated as + * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless type is ARCHIVE_ENTRY_ACL_TYPE_NFS4 */ int -archive_acl_parse_w(struct archive_acl *acl, - const wchar_t *text, int default_type) +archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, + int want_type) { struct { const wchar_t *start; const wchar_t *end; - } field[4], name; + } field[6], name; - int fields, n; - int type, tag, permset, id; + const wchar_t *s, *st; + + int numfields, fields, n, r, ret; + int type, types, tag, permset, id; + size_t len; wchar_t sep; - while (text != NULL && *text != L'\0') { + ret = ARCHIVE_OK; + types = 0; + + switch (want_type) { + case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E: + want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS; + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + numfields = 5; + break; + case ARCHIVE_ENTRY_ACL_TYPE_NFS4: + numfields = 6; + break; + default: + return (ARCHIVE_FATAL); + } + + while (text != NULL && *text != L'\0') { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 30 22:24:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00583C97CC9; Fri, 30 Dec 2016 22:24:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBF1714A2; Fri, 30 Dec 2016 22:24:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUMO3pY031422; Fri, 30 Dec 2016 22:24:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUMO1nZ031411; Fri, 30 Dec 2016 22:24:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612302224.uBUMO1nZ031411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 30 Dec 2016 22:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310867 - in head/sys: dev/rtwn dev/rtwn/rtl8812a dev/rtwn/rtl8821a dev/rtwn/rtl8821a/usb modules/rtwn_usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 22:24:04 -0000 Author: avos Date: Fri Dec 30 22:24:01 2016 New Revision: 310867 URL: https://svnweb.freebsd.org/changeset/base/310867 Log: rtwn: add (untested) radar detection support for RTL8821AU (disabled by default). To enable it, dev.rtwn.%d.radar_detection tunable need to be set to a nonzero value. Tested with RTL8821AU, AP mode (no radar events were seen - so, I have no idea if it is really correct / working) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D8903 Added: head/sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c (contents, props changed) Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwn_beacon.c head/sys/dev/rtwn/if_rtwn_beacon.h head/sys/dev/rtwn/if_rtwn_debug.h head/sys/dev/rtwn/if_rtwnvar.h head/sys/dev/rtwn/rtl8812a/r12a_var.h head/sys/dev/rtwn/rtl8821a/r21a_init.c head/sys/dev/rtwn/rtl8821a/usb/r21au.h head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c head/sys/modules/rtwn_usb/Makefile Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/if_rtwn.c Fri Dec 30 22:24:01 2016 (r310867) @@ -580,6 +580,8 @@ rtwn_vap_create(struct ieee80211com *ic, vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_16; vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K; + TIMEOUT_TASK_INIT(taskqueue_thread, &uvp->tx_beacon_csa, 0, + rtwn_tx_beacon_csa, vap); if (opmode == IEEE80211_M_IBSS) { uvp->recv_mgmt = vap->iv_recv_mgmt; vap->iv_recv_mgmt = rtwn_adhoc_recv_mgmt; @@ -1067,9 +1069,26 @@ rtwn_newstate(struct ieee80211vap *vap, } else early_newstate = 0; + if (ostate == IEEE80211_S_CSA) { + taskqueue_cancel_timeout(taskqueue_thread, + &uvp->tx_beacon_csa, NULL); + + /* + * In multi-vap case second counter may not be cleared + * properly. + */ + vap->iv_csa_count = 0; + } IEEE80211_UNLOCK(ic); RTWN_LOCK(sc); - if (ostate == IEEE80211_S_RUN) { + + if (ostate == IEEE80211_S_CSA) { + /* Unblock all queues (multi-vap case). */ + rtwn_write_1(sc, R92C_TXPAUSE, 0); + } + + if ((ostate == IEEE80211_S_RUN && nstate != IEEE80211_S_CSA) || + ostate == IEEE80211_S_CSA) { sc->vaps_running--; /* Set media status to 'No Link'. */ @@ -1141,6 +1160,11 @@ rtwn_newstate(struct ieee80211vap *vap, sc->vaps_running++; break; + case IEEE80211_S_CSA: + /* Block all Tx queues (except beacon queue). */ + rtwn_setbits_1(sc, R92C_TXPAUSE, 0, + R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | R92C_TX_QUEUE_HIGH); + break; default: break; } Modified: head/sys/dev/rtwn/if_rtwn_beacon.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn_beacon.c Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/if_rtwn_beacon.c Fri Dec 30 22:24:01 2016 (r310867) @@ -160,7 +160,8 @@ rtwn_tx_beacon(struct rtwn_softc *sc, st void rtwn_update_beacon(struct ieee80211vap *vap, int item) { - struct rtwn_softc *sc = vap->iv_ic->ic_softc; + struct ieee80211com *ic = vap->iv_ic; + struct rtwn_softc *sc = ic->ic_softc; struct rtwn_vap *uvp = RTWN_VAP(vap); struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; struct ieee80211_node *ni = vap->iv_bss; @@ -176,21 +177,71 @@ rtwn_update_beacon(struct ieee80211vap * return; } } - rtwn_beacon_update_begin(sc, vap); - RTWN_UNLOCK(sc); - if (item == IEEE80211_BEACON_TIM) + RTWN_DPRINTF(sc, RTWN_DEBUG_BEACON, + "%s: vap id %d, iv_csa_count %d, ic_csa_count %d, item %d\n", + __func__, uvp->id, vap->iv_csa_count, ic->ic_csa_count, item); + + switch (item) { + case IEEE80211_BEACON_CSA: + if (vap->iv_csa_count != ic->ic_csa_count) { + /* + * XXX two APs with different beacon intervals + * are not handled properly. + */ + /* XXX check TBTT? */ + taskqueue_enqueue_timeout(taskqueue_thread, + &uvp->tx_beacon_csa, + msecs_to_ticks(ni->ni_intval)); + } + break; + case IEEE80211_BEACON_TIM: mcast = 1; /* XXX */ + break; + default: + break; + } setbit(bo->bo_flags, item); + + rtwn_beacon_update_begin(sc, vap); + RTWN_UNLOCK(sc); + ieee80211_beacon_update(ni, uvp->bcn_mbuf, mcast); + /* XXX clear manually */ + clrbit(bo->bo_flags, IEEE80211_BEACON_CSA); + RTWN_LOCK(sc); rtwn_tx_beacon(sc, uvp); rtwn_beacon_update_end(sc, vap); RTWN_UNLOCK(sc); } +void +rtwn_tx_beacon_csa(void *arg, int npending __unused) +{ + struct ieee80211vap *vap = arg; + struct ieee80211com *ic = vap->iv_ic; + struct rtwn_softc *sc = ic->ic_softc; + struct rtwn_vap *rvp = RTWN_VAP(vap); + + KASSERT (rvp->id == 0 || rvp->id == 1, + ("wrong port id %d\n", rvp->id)); + + IEEE80211_LOCK(ic); + if (ic->ic_flags & IEEE80211_F_CSAPENDING) { + RTWN_DPRINTF(sc, RTWN_DEBUG_BEACON, + "%s: vap id %d, iv_csa_count %d, ic_csa_count %d\n", + __func__, rvp->id, vap->iv_csa_count, ic->ic_csa_count); + + rtwn_update_beacon(vap, IEEE80211_BEACON_CSA); + } + IEEE80211_UNLOCK(ic); + + (void) rvp; +} + int rtwn_tx_beacon_check(struct rtwn_softc *sc, struct rtwn_vap *uvp) { Modified: head/sys/dev/rtwn/if_rtwn_beacon.h ============================================================================== --- head/sys/dev/rtwn/if_rtwn_beacon.h Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/if_rtwn_beacon.h Fri Dec 30 22:24:01 2016 (r310867) @@ -22,6 +22,7 @@ void rtwn_switch_bcnq(struct rtwn_softc *, int); int rtwn_setup_beacon(struct rtwn_softc *, struct ieee80211_node *); void rtwn_update_beacon(struct ieee80211vap *, int); +void rtwn_tx_beacon_csa(void *arg, int); int rtwn_tx_beacon_check(struct rtwn_softc *, struct rtwn_vap *); #endif /* IF_RTWN_BEACON_H */ Modified: head/sys/dev/rtwn/if_rtwn_debug.h ============================================================================== --- head/sys/dev/rtwn/if_rtwn_debug.h Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/if_rtwn_debug.h Fri Dec 30 22:24:01 2016 (r310867) @@ -44,6 +44,7 @@ enum { RTWN_DEBUG_RSSI = 0x00004000, /* dump RSSI lookups */ RTWN_DEBUG_RESET = 0x00008000, /* initialization progress */ RTWN_DEBUG_CALIB = 0x00010000, /* calibration progress */ + RTWN_DEBUG_RADAR = 0x00020000, /* radar detection status */ RTWN_DEBUG_ANY = 0xffffffff }; Modified: head/sys/dev/rtwn/if_rtwnvar.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnvar.h Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/if_rtwnvar.h Fri Dec 30 22:24:01 2016 (r310867) @@ -109,6 +109,7 @@ struct rtwn_vap { struct rtwn_tx_buf bcn_desc; struct mbuf *bcn_mbuf; + struct timeout_task tx_beacon_csa; struct callout tsf_sync_adhoc; struct task tsf_sync_adhoc_task; Modified: head/sys/dev/rtwn/rtl8812a/r12a_var.h ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_var.h Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/rtl8812a/r12a_var.h Fri Dec 30 22:24:01 2016 (r310867) @@ -39,6 +39,10 @@ struct r12a_softc { #define R12A_RXCKSUM_EN 0x01 #define R12A_RXCKSUM6_EN 0x02 #define R12A_IQK_RUNNING 0x04 +#define R12A_RADAR_ENABLED 0x08 + + int rs_radar; + struct timeout_task rs_chan_check; /* ROM variables */ int ext_pa_2g:1, @@ -77,6 +81,11 @@ struct r12a_softc { int sc_ant; + int (*rs_newstate[RTWN_PORT_COUNT])(struct ieee80211vap *, + enum ieee80211_state, int); + void (*rs_scan_start)(struct ieee80211com *); + void (*rs_scan_end)(struct ieee80211com *); + void (*rs_crystalcap_write)(struct rtwn_softc *); void (*rs_fix_spur)(struct rtwn_softc *, struct ieee80211_channel *); Modified: head/sys/dev/rtwn/rtl8821a/r21a_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8821a/r21a_init.c Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/rtl8821a/r21a_init.c Fri Dec 30 22:24:01 2016 (r310867) @@ -280,7 +280,7 @@ r21a_power_off(struct rtwn_softc *sc) /* Enable GPIO9 as EXT WAKEUP. */ rtwn_setbits_1(sc, R92C_GPIO_INTM + 2, 0, 0x01); - rs->rs_flags &= ~R12A_IQK_RUNNING; + rs->rs_flags &= ~(R12A_IQK_RUNNING | R12A_RADAR_ENABLED); } int Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au.h ============================================================================== --- head/sys/dev/rtwn/rtl8821a/usb/r21au.h Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au.h Fri Dec 30 22:24:01 2016 (r310867) @@ -39,4 +39,10 @@ void r21au_init_tx_agg(struct rtwn_softc *); void r21au_init_burstlen(struct rtwn_softc *); +/* r21au_dfs.c */ +void r21au_chan_check(void *, int); +int r21au_newstate(struct ieee80211vap *, enum ieee80211_state, int); +void r21au_scan_start(struct ieee80211com *); +void r21au_scan_end(struct ieee80211com *); + #endif /* RTL8821AU_H */ Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Fri Dec 30 22:24:01 2016 (r310867) @@ -76,6 +76,7 @@ void r21au_attach(struct rtwn_usb_softc static void r21a_postattach(struct rtwn_softc *sc) { + struct ieee80211com *ic = &sc->sc_ic; struct r12a_softc *rs = sc->sc_priv; if (rs->board_type == R92C_BOARD_TYPE_MINICARD || @@ -85,18 +86,52 @@ r21a_postattach(struct rtwn_softc *sc) else sc->sc_set_led = r21a_set_led; - sc->sc_ic.ic_ioctl = r12a_ioctl_net; + TIMEOUT_TASK_INIT(taskqueue_thread, &rs->rs_chan_check, 0, + r21au_chan_check, sc); + + /* RXCKSUM */ + ic->ic_ioctl = r12a_ioctl_net; + /* DFS */ + rs->rs_scan_start = ic->ic_scan_start; + ic->ic_scan_start = r21au_scan_start; + rs->rs_scan_end = ic->ic_scan_end; + ic->ic_scan_end = r21au_scan_end; +} + +static void +r21au_vap_preattach(struct rtwn_softc *sc, struct ieee80211vap *vap) +{ + struct rtwn_vap *rvp = RTWN_VAP(vap); + struct r12a_softc *rs = sc->sc_priv; + + r12a_vap_preattach(sc, vap); + + /* Install DFS newstate handler (non-monitor vaps only). */ + if (rvp->id != RTWN_VAP_ID_INVALID) { + KASSERT(rvp->id >= 0 && rvp->id <= nitems(rs->rs_newstate), + ("%s: wrong vap id %d\n", __func__, rvp->id)); + + rs->rs_newstate[rvp->id] = vap->iv_newstate; + vap->iv_newstate = r21au_newstate; + } } static void r21a_attach_private(struct rtwn_softc *sc) { + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); struct r12a_softc *rs; rs = malloc(sizeof(struct r12a_softc), M_RTWN_PRIV, M_WAITOK | M_ZERO); rs->rs_flags = R12A_RXCKSUM_EN | R12A_RXCKSUM6_EN; + rs->rs_radar = 0; + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "radar_detection", CTLFLAG_RDTUN, &rs->rs_radar, + rs->rs_radar, "Enable radar detection (untested)"); + rs->rs_fix_spur = rtwn_nop_softc_chan; rs->rs_set_band_2ghz = r21a_set_band_2ghz; rs->rs_set_band_5ghz = r21a_set_band_5ghz; @@ -119,7 +154,13 @@ r21a_attach_private(struct rtwn_softc *s static void r21au_adj_devcaps(struct rtwn_softc *sc) { - /* TODO: DFS, LDPC etc */ + struct ieee80211com *ic = &sc->sc_ic; + struct r12a_softc *rs = sc->sc_priv; + + if (rs->rs_radar != 0) + ic->ic_caps |= IEEE80211_C_DFS; + + /* TODO: LDPC etc */ } void @@ -163,7 +204,7 @@ r21au_attach(struct rtwn_usb_softc *uc) sc->sc_iq_calib = r12a_iq_calib; sc->sc_read_chipid_vendor = rtwn_nop_softc_uint32; sc->sc_adj_devcaps = r21au_adj_devcaps; - sc->sc_vap_preattach = r12a_vap_preattach; + sc->sc_vap_preattach = r21au_vap_preattach; sc->sc_postattach = r21a_postattach; sc->sc_detach_private = r12a_detach_private; #ifndef RTWN_WITHOUT_UCODE Added: head/sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c Fri Dec 30 22:24:01 2016 (r310867) @@ -0,0 +1,280 @@ +/*- + * Copyright (c) 2016 Andriy Voskoboinyk + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +#include +#include + + +#define R21AU_RADAR_CHECK_PERIOD (2 * hz) + +static void +r21au_dfs_radar_disable(struct rtwn_softc *sc) +{ + rtwn_bb_setbits(sc, 0x924, 0x00008000, 0); +} + +static int +r21au_dfs_radar_is_enabled(struct rtwn_softc *sc) +{ + return !!(rtwn_bb_read(sc, 0x924) & 0x00008000); +} + +static int +r21au_dfs_radar_reset(struct rtwn_softc *sc) +{ + int error; + + error = rtwn_bb_setbits(sc, 0x924, 0x00008000, 0); + if (error != 0) + return (error); + + return (rtwn_bb_setbits(sc, 0x924, 0, 0x00008000)); +} + +static int +r21au_dfs_radar_enable(struct rtwn_softc *sc) +{ +#define RTWN_CHK(res) do { \ + if (res != 0) \ + return (EIO); \ +} while(0) + + RTWN_ASSERT_LOCKED(sc); + + RTWN_CHK(rtwn_bb_setbits(sc, 0x814, 0x3fffffff, 0x04cc4d10)); + RTWN_CHK(rtwn_bb_setbits(sc, R12A_BW_INDICATION, 0xff, 0x06)); + RTWN_CHK(rtwn_bb_write(sc, 0x918, 0x1c16ecdf)); + RTWN_CHK(rtwn_bb_write(sc, 0x924, 0x0152a400)); + RTWN_CHK(rtwn_bb_write(sc, 0x91c, 0x0fa21a20)); + RTWN_CHK(rtwn_bb_write(sc, 0x920, 0xe0f57204)); + + return (r21au_dfs_radar_reset(sc)); + +#undef RTWN_CHK +} + +static int +r21au_dfs_radar_is_detected(struct rtwn_softc *sc) +{ + return !!(rtwn_bb_read(sc, 0xf98) & 0x00020000); +} + +void +r21au_chan_check(void *arg, int npending __unused) +{ + struct rtwn_softc *sc = arg; + struct r12a_softc *rs = sc->sc_priv; + struct ieee80211com *ic = &sc->sc_ic; + + RTWN_LOCK(sc); +#ifdef DIAGNOSTIC + RTWN_DPRINTF(sc, RTWN_DEBUG_STATE, + "%s: periodical radar detection task\n", __func__); +#endif + + if (!r21au_dfs_radar_is_enabled(sc)) { + if (rs->rs_flags & R12A_RADAR_ENABLED) { + /* should not happen */ + device_printf(sc->sc_dev, + "%s: radar detection was turned off " + "unexpectedly, resetting...\n", __func__); + + /* XXX something more appropriate? */ + ieee80211_restart_all(ic); + } + RTWN_UNLOCK(sc); + return; + } + + if (r21au_dfs_radar_is_detected(sc)) { + r21au_dfs_radar_reset(sc); + + RTWN_DPRINTF(sc, RTWN_DEBUG_RADAR, "%s: got radar event\n", + __func__); + + RTWN_UNLOCK(sc); + IEEE80211_LOCK(ic); + + ieee80211_dfs_notify_radar(ic, ic->ic_curchan); + + IEEE80211_UNLOCK(ic); + RTWN_LOCK(sc); + } + + if (rs->rs_flags & R12A_RADAR_ENABLED) { + taskqueue_enqueue_timeout(taskqueue_thread, + &rs->rs_chan_check, R21AU_RADAR_CHECK_PERIOD); + } + RTWN_UNLOCK(sc); +} + +int +r21au_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) +{ + struct ieee80211com *ic = vap->iv_ic; + struct rtwn_softc *sc = ic->ic_softc; + struct rtwn_vap *rvp = RTWN_VAP(vap); + struct r12a_softc *rs = sc->sc_priv; + int error; + + KASSERT(rvp->id == 0 || rvp->id == 1, + ("%s: unexpected vap id %d\n", __func__, rvp->id)); + + IEEE80211_UNLOCK(ic); + RTWN_LOCK(sc); + + error = 0; + if (nstate == IEEE80211_S_CAC && + !(rs->rs_flags & R12A_RADAR_ENABLED)) { + error = r21au_dfs_radar_enable(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: cannot enable radar detection\n", __func__); + goto fail; + } + rs->rs_flags |= R12A_RADAR_ENABLED; + + RTWN_DPRINTF(sc, RTWN_DEBUG_RADAR, + "%s: radar detection was enabled\n", __func__); + + taskqueue_enqueue_timeout(taskqueue_thread, + &rs->rs_chan_check, R21AU_RADAR_CHECK_PERIOD); + } + + if ((nstate < IEEE80211_S_CAC || nstate == IEEE80211_S_CSA) && + (rs->rs_flags & R12A_RADAR_ENABLED) && + (sc->vaps[!rvp->id] == NULL || + sc->vaps[!rvp->id]->vap.iv_state < IEEE80211_S_CAC || + sc->vaps[!rvp->id]->vap.iv_state == IEEE80211_S_CSA)) { + taskqueue_cancel_timeout(taskqueue_thread, &rs->rs_chan_check, + NULL); + + rs->rs_flags &= ~R12A_RADAR_ENABLED; + r21au_dfs_radar_disable(sc); + + RTWN_DPRINTF(sc, RTWN_DEBUG_RADAR, + "%s: radar detection was disabled\n", __func__); + } + +fail: + RTWN_UNLOCK(sc); + IEEE80211_LOCK(ic); + + if (error != 0) + return (error); + + return (rs->rs_newstate[rvp->id](vap, nstate, arg)); +} + +void +r21au_scan_start(struct ieee80211com *ic) +{ + struct rtwn_softc *sc = ic->ic_softc; + struct r12a_softc *rs = sc->sc_priv; + + RTWN_LOCK(sc); + if (rs->rs_flags & R12A_RADAR_ENABLED) { + RTWN_UNLOCK(sc); + while (taskqueue_cancel_timeout(taskqueue_thread, + &rs->rs_chan_check, NULL) != 0) { + taskqueue_drain_timeout(taskqueue_thread, + &rs->rs_chan_check); + } + RTWN_LOCK(sc); + + r21au_dfs_radar_disable(sc); + RTWN_DPRINTF(sc, RTWN_DEBUG_RADAR, + "%s: radar detection was (temporarily) disabled\n", + __func__); + } + RTWN_UNLOCK(sc); + + rs->rs_scan_start(ic); +} + +void +r21au_scan_end(struct ieee80211com *ic) +{ + struct rtwn_softc *sc = ic->ic_softc; + struct r12a_softc *rs = sc->sc_priv; + int error; + + RTWN_LOCK(sc); + if (rs->rs_flags & R12A_RADAR_ENABLED) { + error = r21au_dfs_radar_enable(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: cannot re-enable radar detection\n", + __func__); + + /* XXX */ + ieee80211_restart_all(ic); + RTWN_UNLOCK(sc); + return; + } + RTWN_DPRINTF(sc, RTWN_DEBUG_RADAR, + "%s: radar detection was re-enabled\n", __func__); + + taskqueue_enqueue_timeout(taskqueue_thread, + &rs->rs_chan_check, R21AU_RADAR_CHECK_PERIOD); + } + RTWN_UNLOCK(sc); + + rs->rs_scan_end(ic); +} Modified: head/sys/modules/rtwn_usb/Makefile ============================================================================== --- head/sys/modules/rtwn_usb/Makefile Fri Dec 30 22:18:22 2016 (r310866) +++ head/sys/modules/rtwn_usb/Makefile Fri Dec 30 22:24:01 2016 (r310867) @@ -25,7 +25,7 @@ SRCS += r12au_attach.c r12au_init.c r12a r12au.h r12au_reg.h r12au_tx_desc.h .PATH: ${.CURDIR}/../../dev/rtwn/rtl8821a/usb -SRCS += r21au_attach.c r21au_init.c \ +SRCS += r21au_attach.c r21au_init.c r21au_dfs.c \ r21au.h r21au_reg.h opt_rtwn.h: From owner-svn-src-all@freebsd.org Fri Dec 30 22:54:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4515BC98575; Fri, 30 Dec 2016 22:54:11 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04B971231; Fri, 30 Dec 2016 22:54:10 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUMsAKO043621; Fri, 30 Dec 2016 22:54:10 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUMs8fc043607; Fri, 30 Dec 2016 22:54:08 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612302254.uBUMs8fc043607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 22:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310868 - in head/contrib/libarchive: cpio libarchive libarchive/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 22:54:11 -0000 Author: mm Date: Fri Dec 30 22:54:08 2016 New Revision: 310868 URL: https://svnweb.freebsd.org/changeset/base/310868 Log: MFV r310798: Sync libarchive with vendor. Vendor bugfixes (relevant to FreeBSD): PR #843: Fix memory leak of struct archive_entry in cpio/cpio.c PR #851: Spelling fixes Fix two protoypes in manual page archive_read_disk.3 MFC after: 2 weeks Modified: head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/libarchive/archive_match.c head/contrib/libarchive/libarchive/archive_rb.c head/contrib/libarchive/libarchive/archive_read_disk.3 head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_warc.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c head/contrib/libarchive/libarchive/test/test_read_format_7zip.c head/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c head/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c head/contrib/libarchive/libarchive/test/test_write_format_iso9660.c head/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/cpio/cpio.c Fri Dec 30 22:54:08 2016 (r310868) @@ -703,6 +703,7 @@ file_to_archive(struct cpio *cpio, const lafe_warnc(0, "%s", archive_error_string(cpio->archive_read_disk)); if (r <= ARCHIVE_FAILED) { + archive_entry_free(entry); cpio->return_value = 1; return (r); } Modified: head/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_match.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_match.c Fri Dec 30 22:54:08 2016 (r310868) @@ -471,7 +471,7 @@ archive_match_path_excluded(struct archi } /* - * Utilty functions to get statistic information for inclusion patterns. + * Utility functions to get statistic information for inclusion patterns. */ int archive_match_path_unmatched_inclusions(struct archive *_a) @@ -1270,7 +1270,7 @@ set_timefilter_pathname_wcs(struct archi #endif /* _WIN32 && !__CYGWIN__ */ /* - * Call back funtions for archive_rb. + * Call back functions for archive_rb. */ static int cmp_node_mbs(const struct archive_rb_node *n1, @@ -1405,7 +1405,7 @@ add_entry(struct archive_match *a, int f &(a->exclusion_tree), pathname); /* - * We always overwrite comparison condision. + * We always overwrite comparison condition. * If you do not want to overwrite it, you should not * call archive_match_exclude_entry(). We cannot know * what behavior you really expect since overwriting @@ -1481,7 +1481,7 @@ time_excluded(struct archive_match *a, s if (nsec == a->older_ctime_nsec && (a->older_ctime_filter & ARCHIVE_MATCH_EQUAL) == 0) - return (1); /* Eeual, skip it. */ + return (1); /* Equal, skip it. */ } } if (a->newer_mtime_filter) { @@ -1513,7 +1513,7 @@ time_excluded(struct archive_match *a, s } } - /* If there is no excluson list, include the file. */ + /* If there is no exclusion list, include the file. */ if (a->exclusion_entry_list.count == 0) return (0); @@ -1700,7 +1700,7 @@ add_owner_id(struct archive_match *a, st break; } - /* Add oowner id. */ + /* Add owner id. */ if (i == ids->count) ids->ids[ids->count++] = id; else if (ids->ids[i] != id) { Modified: head/contrib/libarchive/libarchive/archive_rb.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_rb.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_rb.c Fri Dec 30 22:54:08 2016 (r310868) @@ -312,7 +312,7 @@ __archive_rb_tree_insert_rebalance(struc father = RB_FATHER(self); if (RB_BLACK_P(father)) { /* - * If our greatgrandpa is black, we're done. + * If our great-grandpa is black, we're done. */ return; } Modified: head/contrib/libarchive/libarchive/archive_read_disk.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk.3 Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_read_disk.3 Fri Dec 30 22:54:08 2016 (r310868) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2012 +.Dd December 30, 2016 .Dt ARCHIVE_READ_DISK 3 .Os .Sh NAME @@ -54,9 +54,9 @@ Streaming Archive Library (libarchive, - .Fn archive_read_disk_set_symlink_physical "struct archive *" .Ft int .Fn archive_read_disk_set_symlink_hybrid "struct archive *" -.Ft int +.Ft const char * .Fn archive_read_disk_gname "struct archive *" "gid_t" -.Ft int +.Ft const char * .Fn archive_read_disk_uname "struct archive *" "uid_t" .Ft int .Fo archive_read_disk_set_gname_lookup Modified: head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Fri Dec 30 22:54:08 2016 (r310868) @@ -374,7 +374,7 @@ struct iso9660 { size_t utf16be_path_len; unsigned char *utf16be_previous_path; size_t utf16be_previous_path_len; - /* Null buufer used in bidder to improve its performance. */ + /* Null buffer used in bidder to improve its performance. */ unsigned char null[2048]; }; @@ -1199,7 +1199,7 @@ archive_read_format_iso9660_read_header( archive_string_conversion_from_charset( &(a->archive), "UTF-16BE", 1); if (iso9660->sconv_utf16be == NULL) - /* Coundn't allocate memory */ + /* Couldn't allocate memory */ return (ARCHIVE_FATAL); } if (iso9660->utf16be_path == NULL) { @@ -2407,7 +2407,7 @@ read_CE(struct archive_read *a, struct i return (ARCHIVE_FATAL); } while (heap->cnt && heap->reqs[0].offset == iso9660->current_position); - /* NOTE: Do not move this consume's code to fron of + /* NOTE: Do not move this consume's code to front of * do-while loop. Registration of nested CE extension * might cause error because of current position. */ __archive_read_consume(a, step); @@ -2729,7 +2729,7 @@ next_cache_entry(struct archive_read *a, if (file == NULL) { /* * If directory entries all which are descendant of - * rr_moved are stil remaning, expose their. + * rr_moved are still remaining, expose their. */ if (iso9660->re_files.first != NULL && iso9660->rr_moved != NULL && @@ -2852,7 +2852,7 @@ next_cache_entry(struct archive_read *a, empty_files.last = &empty_files.first; /* Collect files which has the same file serial number. * Peek pending_files so that file which number is different - * is not put bak. */ + * is not put back. */ while (iso9660->pending_files.used > 0 && (iso9660->pending_files.files[0]->number == -1 || iso9660->pending_files.files[0]->number == number)) { @@ -2860,7 +2860,7 @@ next_cache_entry(struct archive_read *a, /* This file has the same offset * but it's wrong offset which empty files * and symlink files have. - * NOTE: This wrong offse was recorded by + * NOTE: This wrong offset was recorded by * old mkisofs utility. If ISO images is * created by latest mkisofs, this does not * happen. Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Fri Dec 30 22:54:08 2016 (r310868) @@ -308,7 +308,7 @@ struct archive_write_disk { #define MAXIMUM_DIR_MODE 0775 /* - * Maxinum uncompressed size of a decmpfs block. + * Maximum uncompressed size of a decmpfs block. */ #define MAX_DECMPFS_BLOCK_SIZE (64 * 1024) /* @@ -323,7 +323,7 @@ struct archive_write_disk { #define RSRC_F_SIZE 50 /* Size of Resource fork footer. */ /* Size to write compressed data to resource fork. */ #define COMPRESSED_W_SIZE (64 * 1024) -/* decmpfs difinitions. */ +/* decmpfs definitions. */ #define MAX_DECMPFS_XATTR_SIZE 3802 #ifndef DECMPFS_XATTR_NAME #define DECMPFS_XATTR_NAME "com.apple.decmpfs" @@ -632,9 +632,9 @@ _archive_write_disk_header(struct archiv /* * NOTE: UF_COMPRESSED is ignored even if the filesystem * supports HFS+ Compression because the file should - * have at least an extended attriute "com.apple.decmpfs" + * have at least an extended attribute "com.apple.decmpfs" * before the flag is set to indicate that the file have - * been compressed. If hte filesystem does not support + * been compressed. If the filesystem does not support * HFS+ Compression the system call will fail. */ if (a->fd < 0 || fchflags(a->fd, UF_COMPRESSED) != 0) @@ -1247,7 +1247,7 @@ hfs_drive_compressor(struct archive_writ ret = hfs_write_compressed_data(a, bytes_used + rsrc_size); a->compressed_buffer_remaining = a->compressed_buffer_size; - /* If the compressed size is not enouph smaller than + /* If the compressed size is not enough smaller than * the uncompressed size. cancel HFS+ compression. * TODO: study a behavior of ditto utility and improve * the condition to fall back into no HFS+ compression. */ @@ -1352,7 +1352,7 @@ hfs_write_decmpfs_block(struct archive_w (uint32_t *)(a->resource_fork + RSRC_H_SIZE); /* Set the block count to the resource fork. */ archive_le32enc(a->decmpfs_block_info++, block_count); - /* Get the position where we are goint to set compressed + /* Get the position where we are going to set compressed * data. */ a->compressed_rsrc_position = RSRC_H_SIZE + 4 + (block_count * 8); @@ -1425,7 +1425,7 @@ hfs_write_data_block(struct archive_writ bytes_to_write = size; /* Seek if necessary to the specified offset. */ if (a->offset < a->fd_offset) { - /* Can't support backword move. */ + /* Can't support backward move. */ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek failed"); return (ARCHIVE_FATAL); Modified: head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Fri Dec 30 22:54:08 2016 (r310868) @@ -161,7 +161,7 @@ struct isofile { /* Used for managing struct isofile list. */ struct isofile *allnext; struct isofile *datanext; - /* Used for managing a hardlined struct isofile list. */ + /* Used for managing a hardlinked struct isofile list. */ struct isofile *hlnext; struct isofile *hardlink_target; @@ -528,7 +528,7 @@ struct iso_option { * - allow more then 8 depths of directory trees; * - disable a version number to a File Name; * - disable a forced period to the tail of a File Name; - * - the maxinum length of files and directories is raised to 193. + * - the maximum length of files and directories is raised to 193. * if rockridge option is disabled, raised to 207. */ unsigned int iso_level:3; @@ -626,7 +626,7 @@ struct iso_option { * : NOTE Our rockridge=useful option does not set a zero * : to uid and gid, you should use application * : option such as --gid,--gname,--uid and --uname - * : badtar options instead. + * : bsdtar options instead. * Type : boolean/string * Default: Enabled as rockridge=useful * COMPAT : mkisofs -r / -R @@ -660,7 +660,7 @@ struct iso_option { * : for making zisofs. * : When the file size is less than one Logical Block * : size, that file will not zisofs'ed since it does - * : reduece an ISO-image size. + * : reduce an ISO-image size. * : * : When you specify option 'boot=', that * : 'boot-image' file won't be converted to zisofs file. @@ -703,7 +703,7 @@ struct iso9660 { } all_file_list; /* A list of struct isofile entries which have its - * contents and are not a directory, a hardlined file + * contents and are not a directory, a hardlinked file * and a symlink file. */ struct { struct isofile *first; @@ -1907,9 +1907,9 @@ iso9660_close(struct archive_write *a) iso9660->primary.rootent); if (ret < 0) return (ret); - /* Make sure we have UTF-16BE convertors. - * if there is no file entry, convertors are still - * uninitilized. */ + /* Make sure we have UTF-16BE converters. + * if there is no file entry, converters are still + * uninitialized. */ if (iso9660->sconv_to_utf16be == NULL) { iso9660->sconv_to_utf16be = archive_string_conversion_to_charset( @@ -2959,7 +2959,7 @@ set_directory_record_rr(unsigned char *b gid = archive_entry_gid(file->entry); if (iso9660->opt.rr == OPT_RR_USEFUL) { /* - * This action is simular mkisofs -r option + * This action is similar to mkisofs -r option * but our rockridge=useful option does not * set a zero to uid and gid. */ @@ -3108,7 +3108,7 @@ set_directory_record_rr(unsigned char *b /* * flg len * +----+----+ - * | 02 | 00 | CURREENT component. + * | 02 | 00 | CURRENT component. * +----+----+ (".") */ if (nc != NULL) { @@ -3947,7 +3947,7 @@ write_VD(struct archive_write *a, struct "Abstract File", 0, D_CHAR); if (r != ARCHIVE_OK) return (r); - /* Bibliongraphic File Identifier */ + /* Bibliographic File Identifier */ r = set_file_identifier(bp, 777, 813, vdc, a, vdd, &(iso9660->bibliographic_file_identifier), "Bibliongraphic File", 0, D_CHAR); @@ -6135,7 +6135,7 @@ isoent_gen_iso9660_identifier(struct arc off = ffmax - extlen; if (off == 0) { /* A dot('.') character - * does't place to the first + * doesn't place to the first * byte of identifier. */ off ++; extlen --; @@ -7149,7 +7149,7 @@ isoent_create_boot_catalog(struct archiv iso9660->el_torito.catalog = isoent; /* - * Get a boot medai type. + * Get a boot media type. */ switch (iso9660->opt.boot_type) { default: Modified: head/contrib/libarchive/libarchive/archive_write_set_format_warc.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_warc.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_write_set_format_warc.c Fri Dec 30 22:54:08 2016 (r310868) @@ -79,7 +79,7 @@ typedef enum { WT_RVIS, /* conversion, unsupported */ WT_CONV, - /* continutation, unsupported at the moment */ + /* continuation, unsupported at the moment */ WT_CONT, /* invalid type */ LAST_WT Modified: head/contrib/libarchive/libarchive/archive_write_set_format_xar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Fri Dec 30 22:54:08 2016 (r310868) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); * - When writing an XML element , * which is a file type a symbolic link is referencing is always marked * as "broken". Xar utility uses stat(2) to get the file type, but, in - * libarcive format writer, we should not use it; if it is needed, we + * libarchive format writer, we should not use it; if it is needed, we * should get about it at archive_read_disk.c. * - It is possible to appear both and elements. * Xar utility generates on BSD platform and on Linux @@ -1227,7 +1227,7 @@ make_file_entry(struct archive_write *a, case AE_IFLNK: /* * xar utility has checked a file type, which - * a symblic-link file has referenced. + * a symbolic-link file has referenced. * For example: * ../ref/ * The symlink target file is "../ref/" and its @@ -1237,8 +1237,8 @@ make_file_entry(struct archive_write *a, * The symlink target file is "../f" and its * file type is a regular file. * - * But our implemention cannot do it, and then we - * always record that a attribute "type" is "borken", + * But our implementation cannot do it, and then we + * always record that a attribute "type" is "broken", * for example: * foo/bar * It means "foo/bar" is not reachable. @@ -1544,7 +1544,7 @@ make_toc(struct archive_write *a) } /* - * Start recoding TOC + * Start recording TOC */ r = xmlTextWriterStartElement(writer, BAD_CAST("xar")); if (r < 0) { @@ -2484,7 +2484,7 @@ file_connect_hardlink_files(struct xar * archive_entry_set_nlink(target->entry, hl->nlink); if (hl->nlink > 1) /* It means this file is a hardlink - * targe itself. */ + * target itself. */ target->hardlink_target = target; for (nf = target->hlnext; nf != NULL; nf = nf->hlnext) { Modified: head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c Fri Dec 30 22:54:08 2016 (r310868) @@ -283,7 +283,7 @@ DEFINE_TEST(test_acl_freebsd_posix1e_res } /* - * Verify ACL reaed-from-disk. This test is FreeBSD-specific. + * Verify ACL read-from-disk. This test is FreeBSD-specific. */ DEFINE_TEST(test_acl_freebsd_posix1e_read) { Modified: head/contrib/libarchive/libarchive/test/test_read_format_7zip.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_7zip.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/test/test_read_format_7zip.c Fri Dec 30 22:54:08 2016 (r310868) @@ -688,7 +688,7 @@ test_symname() assertEqualInt(32, archive_read_data(a, buff, sizeof(buff))); assertEqualMem(buff, "hellohellohello\nhellohellohello\n", 32); - /* Verify symbolic-linke symlinkfile. */ + /* Verify symbolic-link symlinkfile. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt((AE_IFLNK | 0755), archive_entry_mode(ae)); assertEqualString("symlinkfile", archive_entry_pathname(ae)); Modified: head/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c Fri Dec 30 22:54:08 2016 (r310868) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); /* -PLEASE use old cdrtools; mkisofs verion is 2.01. +PLEASE use old cdrtools; mkisofs version is 2.01. This version mkisofs made wrong "SL" System Use Entry of RRIP. Execute the following command to rebuild the data for this program: Modified: head/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c Fri Dec 30 22:54:08 2016 (r310868) @@ -1116,7 +1116,7 @@ cleanup: * - the filename of second file is stored in UTF-8. * * Whenever hdrcharset option is specified, we will correctly read the - * filename of sencod file, which is stored in UTF-8. + * filename of second file, which is stored in UTF-8. */ DEFINE_TEST(test_read_format_zip_filename_KOI8R_UTF8_2) Modified: head/contrib/libarchive/libarchive/test/test_write_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_write_format_iso9660.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/test/test_write_format_iso9660.c Fri Dec 30 22:54:08 2016 (r310868) @@ -719,7 +719,7 @@ DEFINE_TEST(test_write_format_iso9660) assertEqualInt(5, archive_entry_ctime(ae)); assert(archive_entry_mtime_is_set(ae)); assertEqualInt(5, archive_entry_mtime(ae)); - /* Trim lngname to 64 characters. */ + /* Trim longname to 64 characters. */ longname[64] = '\0'; assertEqualString(longname, archive_entry_pathname(ae)); assert((AE_IFREG | 0400) == archive_entry_mode(ae)); Modified: head/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c Fri Dec 30 22:24:01 2016 (r310867) +++ head/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c Fri Dec 30 22:54:08 2016 (r310868) @@ -25,7 +25,7 @@ #include "test.h" /* - * Check that a "zisofs" ISO 9660 imaeg is correctly created. + * Check that a "zisofs" ISO 9660 image is correctly created. */ static const unsigned char primary_id[] = { From owner-svn-src-all@freebsd.org Fri Dec 30 23:00:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 513D9C9860A; Fri, 30 Dec 2016 23:00:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDD521438; Fri, 30 Dec 2016 23:00:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUN015a043923; Fri, 30 Dec 2016 23:00:01 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUN01RI043921; Fri, 30 Dec 2016 23:00:01 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612302300.uBUN01RI043921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 23:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310869 - vendor/libarchive/dist/libarchive X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 23:00:02 -0000 Author: mm Date: Fri Dec 30 23:00:00 2016 New Revision: 310869 URL: https://svnweb.freebsd.org/changeset/base/310869 Log: Update vendor/libarchive to git ab94a813b0f64cbc1bcb952bf55424a2d9c7f1d9 Vendor bugfixes: Use __LA_DEPRECATED macro with functions deprecated in 379867e (r310796) Modified: vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_locale.h Modified: vendor/libarchive/dist/libarchive/archive_entry.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry.h Fri Dec 30 22:54:08 2016 (r310868) +++ vendor/libarchive/dist/libarchive/archive_entry.h Fri Dec 30 23:00:00 2016 (r310869) @@ -105,6 +105,12 @@ typedef int64_t la_int64_t; # define __LA_DECL #endif +#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +# define __LA_DEPRECATED __attribute__((deprecated)) +#else +# define __LA_DEPRECATED +#endif + #ifdef __cplusplus extern "C" { #endif @@ -529,9 +535,9 @@ __LA_DECL int archive_entry_acl_from_tex /* Deprecated functions */ __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *, - int /* flags */) __attribute__ ((deprecated)); + int /* flags */) __LA_DEPRECATED; __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, - int /* flags */) __attribute__ ((deprecated)); + int /* flags */) __LA_DEPRECATED; /* Return bitmask of ACL types in an archive entry */ __LA_DECL int archive_entry_acl_types(struct archive_entry *); Modified: vendor/libarchive/dist/libarchive/archive_entry_locale.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry_locale.h Fri Dec 30 22:54:08 2016 (r310868) +++ vendor/libarchive/dist/libarchive/archive_entry_locale.h Fri Dec 30 23:00:00 2016 (r310869) @@ -63,8 +63,7 @@ int _archive_entry_uname_l(struct archiv const char **, size_t *, struct archive_string_conv *); #define archive_entry_acl_text_l _archive_entry_acl_text_l int _archive_entry_acl_text_l(struct archive_entry *, int, -const char **, size_t *, struct archive_string_conv *) -__attribute__ ((deprecated)); +const char **, size_t *, struct archive_string_conv *) __LA_DEPRECATED; #define archive_entry_acl_to_text_l _archive_entry_acl_to_text_l char *_archive_entry_acl_to_text_l(struct archive_entry *, ssize_t *, int, struct archive_string_conv *); From owner-svn-src-all@freebsd.org Fri Dec 30 23:05:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E19F5C9878A; Fri, 30 Dec 2016 23:05:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DF2218BC; Fri, 30 Dec 2016 23:05:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUN562k047757; Fri, 30 Dec 2016 23:05:06 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUN5640047755; Fri, 30 Dec 2016 23:05:06 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612302305.uBUN5640047755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 30 Dec 2016 23:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310870 - head/contrib/libarchive/libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 23:05:08 -0000 Author: mm Date: Fri Dec 30 23:05:06 2016 New Revision: 310870 URL: https://svnweb.freebsd.org/changeset/base/310870 Log: MFV r310869: Sync libarchive with vendor. Vendor bugfixes: Use __LA_DEPRECATED macro with functions deprecated in 379867e (r310796) MFC after: 2 weeks X-MFC with: r310866 Modified: head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_locale.h Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Fri Dec 30 23:00:00 2016 (r310869) +++ head/contrib/libarchive/libarchive/archive_entry.h Fri Dec 30 23:05:06 2016 (r310870) @@ -105,6 +105,12 @@ typedef int64_t la_int64_t; # define __LA_DECL #endif +#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +# define __LA_DEPRECATED __attribute__((deprecated)) +#else +# define __LA_DEPRECATED +#endif + #ifdef __cplusplus extern "C" { #endif @@ -529,9 +535,9 @@ __LA_DECL int archive_entry_acl_from_tex /* Deprecated functions */ __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *, - int /* flags */) __attribute__ ((deprecated)); + int /* flags */) __LA_DEPRECATED; __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, - int /* flags */) __attribute__ ((deprecated)); + int /* flags */) __LA_DEPRECATED; /* Return bitmask of ACL types in an archive entry */ __LA_DECL int archive_entry_acl_types(struct archive_entry *); Modified: head/contrib/libarchive/libarchive/archive_entry_locale.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_locale.h Fri Dec 30 23:00:00 2016 (r310869) +++ head/contrib/libarchive/libarchive/archive_entry_locale.h Fri Dec 30 23:05:06 2016 (r310870) @@ -63,8 +63,7 @@ int _archive_entry_uname_l(struct archiv const char **, size_t *, struct archive_string_conv *); #define archive_entry_acl_text_l _archive_entry_acl_text_l int _archive_entry_acl_text_l(struct archive_entry *, int, -const char **, size_t *, struct archive_string_conv *) -__attribute__ ((deprecated)); +const char **, size_t *, struct archive_string_conv *) __LA_DEPRECATED; #define archive_entry_acl_to_text_l _archive_entry_acl_to_text_l char *_archive_entry_acl_to_text_l(struct archive_entry *, ssize_t *, int, struct archive_string_conv *); From owner-svn-src-all@freebsd.org Fri Dec 30 23:41:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FEBC9803E; Fri, 30 Dec 2016 23:41:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8B6219D1; Fri, 30 Dec 2016 23:41:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUNfXrO060889; Fri, 30 Dec 2016 23:41:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUNfXJo060888; Fri, 30 Dec 2016 23:41:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612302341.uBUNfXJo060888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 30 Dec 2016 23:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310872 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 23:41:34 -0000 Author: bapt Date: Fri Dec 30 23:41:33 2016 New Revision: 310872 URL: https://svnweb.freebsd.org/changeset/base/310872 Log: Make sdiff --left-column work as expected MFC after: 3 days Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Fri Dec 30 23:14:18 2016 (r310871) +++ head/usr.bin/sdiff/sdiff.c Fri Dec 30 23:41:33 2016 (r310872) @@ -87,7 +87,6 @@ enum { UNIDIR_OPT, STRIPCR_OPT, HORIZ_OPT, - LEFTC_OPT, SUPCL_OPT, LF_OPT, /* the following groupings must be in sequence */ @@ -109,7 +108,6 @@ enum { static struct option longopts[] = { /* options only processed in sdiff */ - { "left-column", no_argument, NULL, LEFTC_OPT }, { "suppress-common-lines", no_argument, NULL, 's' }, { "width", required_argument, NULL, 'w' }, @@ -129,6 +127,7 @@ static struct option longopts[] = { { "ignore-tab-expansion", no_argument, NULL, 'E' }, { "ignore-matching-lines", required_argument, NULL, 'I' }, { "ignore-case", no_argument, NULL, 'i' }, + { "left-column", no_argument, NULL, 'l' }, { "expand-tabs", no_argument, NULL, 't' }, { "speed-large-files", no_argument, NULL, 'H' }, { "ignore-all-space", no_argument, NULL, 'W' }, From owner-svn-src-all@freebsd.org Fri Dec 30 23:44:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71D9FC98260; Fri, 30 Dec 2016 23:44:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 416F41E12; Fri, 30 Dec 2016 23:44:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUNidLv063907; Fri, 30 Dec 2016 23:44:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUNidMT063906; Fri, 30 Dec 2016 23:44:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612302344.uBUNidMT063906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 30 Dec 2016 23:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310873 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 23:44:40 -0000 Author: ngie Date: Fri Dec 30 23:44:39 2016 New Revision: 310873 URL: https://svnweb.freebsd.org/changeset/base/310873 Log: Guard against use-after-free after calling mibif_free(..) Set variables to NULL after calling free. Also, remove unnecessary if (x != NULL) checks before calling free(x) MFC after: 1 week Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Fri Dec 30 23:41:33 2016 (r310872) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Fri Dec 30 23:44:39 2016 (r310873) @@ -707,10 +707,11 @@ mibif_free(struct mibif *ifp) } free(ifp->private); - if (ifp->physaddr != NULL) - free(ifp->physaddr); - if (ifp->specmib != NULL) - free(ifp->specmib); + ifp->private = NULL; + free(ifp->physaddr); + ifp->physaddr = NULL; + free(ifp->specmib); + ifp->specmib = NULL; STAILQ_FOREACH(map, &mibindexmap_list, link) if (map->mibif == ifp) { @@ -745,8 +746,8 @@ mibif_free(struct mibif *ifp) at = at1; } - free(ifp); + ifp = NULL; mib_if_number--; mib_iftable_last_change = this_tick; } From owner-svn-src-all@freebsd.org Fri Dec 30 23:46:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45793C982D7; Fri, 30 Dec 2016 23:46:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 152C41F9B; Fri, 30 Dec 2016 23:46:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUNkB1i064009; Fri, 30 Dec 2016 23:46:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUNkBOC064008; Fri, 30 Dec 2016 23:46:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612302346.uBUNkBOC064008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 30 Dec 2016 23:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310874 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 23:46:12 -0000 Author: bapt Date: Fri Dec 30 23:46:11 2016 New Revision: 310874 URL: https://svnweb.freebsd.org/changeset/base/310874 Log: Remove extra entries from the option enum MFC after: 3 days Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Fri Dec 30 23:44:39 2016 (r310873) +++ head/usr.bin/sdiff/sdiff.c Fri Dec 30 23:46:11 2016 (r310874) @@ -82,28 +82,9 @@ enum { NORMAL_OPT, FCASE_SENSITIVE_OPT, FCASE_IGNORE_OPT, - FROMFILE_OPT, - TOFILE_OPT, - UNIDIR_OPT, STRIPCR_OPT, - HORIZ_OPT, - SUPCL_OPT, - LF_OPT, - /* the following groupings must be in sequence */ - OLDGF_OPT, - NEWGF_OPT, - UNCGF_OPT, - CHGF_OPT, - OLDLF_OPT, - NEWLF_OPT, - UNCLF_OPT, - /* end order-sensitive enums */ TSIZE_OPT, - HLINES_OPT, - LFILES_OPT, DIFFPROG_OPT, - - NOOP_OPT, }; static struct option longopts[] = { From owner-svn-src-all@freebsd.org Fri Dec 30 23:52:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A3E6C98535; Fri, 30 Dec 2016 23:52:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1FCD1497; Fri, 30 Dec 2016 23:52:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUNqKjM067761; Fri, 30 Dec 2016 23:52:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUNqKeD067760; Fri, 30 Dec 2016 23:52:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612302352.uBUNqKeD067760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 30 Dec 2016 23:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310875 - stable/11/etc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 23:52:21 -0000 Author: ngie Date: Fri Dec 30 23:52:19 2016 New Revision: 310875 URL: https://svnweb.freebsd.org/changeset/base/310875 Log: MFC r310458,r310466: r310458: Group all loadable modules in the %default section This will allow new users to uncomment the modules and have things work with less head scratching, in the event they decide to uncomment any of the section separators, e.g. %usm or %vcm, as the module loading is only effective in the %default section. r310466: Don't hardcode $(securityModelUSM) (3) in the authPriv example under the %vacm section Modified: stable/11/etc/snmpd.config Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/snmpd.config ============================================================================== --- stable/11/etc/snmpd.config Fri Dec 30 23:46:11 2016 (r310874) +++ stable/11/etc/snmpd.config Fri Dec 30 23:52:19 2016 (r310875) @@ -112,12 +112,63 @@ sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1 snmpEnableAuthenTraps = 2 +# Uncomment `begemotSnmpdModulePath.".." = ".."' entries below to enable +# modules + +# +# Bridge module +# This requires the mibII module. +# +#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" + +# +# Host resources module +# This requires the mibII module. +# +#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" + +# +# LM75 Sensor module +# +#begemotSnmpdModulePath."lm75" = "/usr/lib/snmp_lm75.so" + +# +# MIB-2 module +# +begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so" + +# +# Netgraph module +# +#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so" + +# +# pf(4) module +# +#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" + +# +# SNMPv3 Notification Targets +# +# begemotSnmpdModulePath."target" = "/usr/lib/snmp_target.so" + # # SNMPv3 User-based security module - must be loaded for SNMPv3 USM # #begemotSnmpdModulePath."usm" = "/usr/lib/snmp_usm.so" # +# SNMPv3 View-based Access Control module +# +#begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" + +# +# Wireless module +# This requires the mibII module. +# +#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so" + +# # SNMPv3 USM User definition. # @@ -147,11 +198,6 @@ snmpEnableAuthenTraps = 2 # # -# SNMPv3 View-based Access Control module -# -#begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" - -# # Definition of view-based access control entries. # #%vacm @@ -210,15 +256,10 @@ snmpEnableAuthenTraps = 2 # #Read-write-notify access to restricted for SNMPv3 USM users with authPriv # -# vacmAccessStatus.$(write)."".3.$(authPriv) = 4 -# vacmAccessReadViewName.$(write)."".3.$(authPriv) = "restricted" -# vacmAccessWriteViewName.$(write)."".3.$(authPriv) = "restricted" -# vacmAccessNotifyViewName.$(write)."".3.$(authPriv) = "restricted" - -# -# SNMPv3 Notification Targets -# -# begemotSnmpdModulePath."target" = "/usr/lib/snmp_target.so" +# vacmAccessStatus.$(write)."".$(securityModelUSM).$(authPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" #%target # Send notifications to target tag "test" @@ -259,49 +300,12 @@ snmpEnableAuthenTraps = 2 # snmpTargetAddrParams.$(tagremote) = $(tag) # snmpTargetAddrRowStatus.$(tagremote) = 1 -# -# Load MIB-2 module -# -begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so" - # Force a polling rate for the 64-bit interface counters in case # the automatic computation is wrong (which may be the case if an interface # announces the wrong bit rate via its MIB). #%mibII #begemotIfForcePoll = 2000 - -# Netgraph module -# -#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so" -# #%netgraph #begemotNgControlNodeName = "snmpd" -# -# LM75 Sensor module -# -#begemotSnmpdModulePath."lm75" = "/usr/lib/snmp_lm75.so" - -# -# pf(4) module -# -#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" - -# -# Host resources module -# This requires the mibII module. -# -#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" - -# -# Bridge module -# This requires the mibII module. -# -#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" - -# -# Wireless module -# This requires the mibII module. -# -#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so" From owner-svn-src-all@freebsd.org Fri Dec 30 23:59:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD9D1C9898F; Fri, 30 Dec 2016 23:59:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 980DE19CE; Fri, 30 Dec 2016 23:59:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUNxhsj068104; Fri, 30 Dec 2016 23:59:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUNxhwQ068103; Fri, 30 Dec 2016 23:59:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612302359.uBUNxhwQ068103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 30 Dec 2016 23:59: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: r310876 - 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 23:59:44 -0000 Author: ngie Date: Fri Dec 30 23:59:43 2016 New Revision: 310876 URL: https://svnweb.freebsd.org/changeset/base/310876 Log: MFstable/11 r310875: MFC r310458,r310466: r310458: Group all loadable modules in the %default section This will allow new users to uncomment the modules and have things work with less head scratching, in the event they decide to uncomment any of the section separators, e.g. %usm or %vcm, as the module loading is only effective in the %default section. r310466: Don't hardcode $(securityModelUSM) (3) in the authPriv example under the %vacm section Modified: stable/10/etc/snmpd.config Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/snmpd.config ============================================================================== --- stable/10/etc/snmpd.config Fri Dec 30 23:52:19 2016 (r310875) +++ stable/10/etc/snmpd.config Fri Dec 30 23:59:43 2016 (r310876) @@ -112,12 +112,58 @@ sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1 snmpEnableAuthenTraps = 2 +# Uncomment `begemotSnmpdModulePath.".." = ".."' entries below to enable +# modules + +# +# Bridge module +# This requires the mibII module. +# +#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" + +# +# Host resources module +# This requires the mibII module. +# +#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" + +# +# MIB-2 module +# +begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so" + +# +# Netgraph module +# +#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so" + +# +# pf(4) module +# +#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" + +# +# SNMPv3 Notification Targets +# +# begemotSnmpdModulePath."target" = "/usr/lib/snmp_target.so" + # # SNMPv3 User-based security module - must be loaded for SNMPv3 USM # #begemotSnmpdModulePath."usm" = "/usr/lib/snmp_usm.so" # +# SNMPv3 View-based Access Control module +# +#begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" + +# +# Wireless module +# This requires the mibII module. +# +#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so" + +# # SNMPv3 USM User definition. # @@ -147,11 +193,6 @@ snmpEnableAuthenTraps = 2 # # -# SNMPv3 View-based Access Control module -# -#begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" - -# # Definition of view-based access control entries. # #%vacm @@ -210,15 +251,10 @@ snmpEnableAuthenTraps = 2 # #Read-write-notify access to restricted for SNMPv3 USM users with authPriv # -# vacmAccessStatus.$(write)."".3.$(authPriv) = 4 -# vacmAccessReadViewName.$(write)."".3.$(authPriv) = "restricted" -# vacmAccessWriteViewName.$(write)."".3.$(authPriv) = "restricted" -# vacmAccessNotifyViewName.$(write)."".3.$(authPriv) = "restricted" - -# -# SNMPv3 Notification Targets -# -# begemotSnmpdModulePath."target" = "/usr/lib/snmp_target.so" +# vacmAccessStatus.$(write)."".$(securityModelUSM).$(authPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" #%target # Send notifications to target tag "test" @@ -259,44 +295,11 @@ snmpEnableAuthenTraps = 2 # snmpTargetAddrParams.$(tagremote) = $(tag) # snmpTargetAddrRowStatus.$(tagremote) = 1 -# -# Load MIB-2 module -# -begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so" - # Force a polling rate for the 64-bit interface counters in case # the automatic computation is wrong (which may be the case if an interface # announces the wrong bit rate via its MIB). #%mibII #begemotIfForcePoll = 2000 - -# Netgraph module -# -#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so" -# #%netgraph #begemotNgControlNodeName = "snmpd" - -# -# pf(4) module -# -#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" - -# -# Host resources module -# This requires the mibII module. -# -#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" - -# -# Bridge module -# This requires the mibII module. -# -#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" - -# -# Wireless module -# This requires the mibII module. -# -#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so" From owner-svn-src-all@freebsd.org Sat Dec 31 00:00:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA25C98A44; Sat, 31 Dec 2016 00:00:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87F651B6A; Sat, 31 Dec 2016 00:00:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV00Cu3068220; Sat, 31 Dec 2016 00:00:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV00CYc068219; Sat, 31 Dec 2016 00:00:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612310000.uBV00CYc068219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 00:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310877 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 00:00:13 -0000 Author: ngie Date: Sat Dec 31 00:00:12 2016 New Revision: 310877 URL: https://svnweb.freebsd.org/changeset/base/310877 Log: MFC r310455: Clarify failure in snmp_output(..) with call to snmp_pdu_decode - Explicitly test snmp_pdu_encode against SNMP_CODE_OK instead of assuming any non-zero value is bad. - Print out the code before calling abort() to give the end-user something actionable to debug without having to recompile the binary, since the core might not have these details. Modified: stable/11/contrib/bsnmp/snmpd/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/main.c Fri Dec 30 23:59:43 2016 (r310876) +++ stable/11/contrib/bsnmp/snmpd/main.c Sat Dec 31 00:00:12 2016 (r310877) @@ -282,12 +282,13 @@ snmp_output(struct snmp_pdu *pdu, u_char const char *dest) { struct asn_buf resp_b; + enum snmp_code code; resp_b.asn_ptr = sndbuf; resp_b.asn_len = snmpd.txbuf; - if (snmp_pdu_encode(pdu, &resp_b) != 0) { - syslog(LOG_ERR, "cannot encode message"); + if ((code = snmp_pdu_encode(pdu, &resp_b)) != SNMP_CODE_OK) { + syslog(LOG_ERR, "cannot encode message (code=%d)", code); abort(); } if (debug.dump_pdus) { From owner-svn-src-all@freebsd.org Sat Dec 31 00:01:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD71C98B41; Sat, 31 Dec 2016 00:01:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D34071D96; Sat, 31 Dec 2016 00:01:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV01MTX069053; Sat, 31 Dec 2016 00:01:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV01MTx069052; Sat, 31 Dec 2016 00:01:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612310001.uBV01MTx069052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 00:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310878 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 00:01:23 -0000 Author: ngie Date: Sat Dec 31 00:01:21 2016 New Revision: 310878 URL: https://svnweb.freebsd.org/changeset/base/310878 Log: MFstable/11 r310877: MFC r310455: Clarify failure in snmp_output(..) with call to snmp_pdu_decode - Explicitly test snmp_pdu_encode against SNMP_CODE_OK instead of assuming any non-zero value is bad. - Print out the code before calling abort() to give the end-user something actionable to debug without having to recompile the binary, since the core might not have these details. Modified: stable/10/contrib/bsnmp/snmpd/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Sat Dec 31 00:00:12 2016 (r310877) +++ stable/10/contrib/bsnmp/snmpd/main.c Sat Dec 31 00:01:21 2016 (r310878) @@ -282,12 +282,13 @@ snmp_output(struct snmp_pdu *pdu, u_char const char *dest) { struct asn_buf resp_b; + enum snmp_code code; resp_b.asn_ptr = sndbuf; resp_b.asn_len = snmpd.txbuf; - if (snmp_pdu_encode(pdu, &resp_b) != 0) { - syslog(LOG_ERR, "cannot encode message"); + if ((code = snmp_pdu_encode(pdu, &resp_b)) != SNMP_CODE_OK) { + syslog(LOG_ERR, "cannot encode message (code=%d)", code); abort(); } if (debug.dump_pdus) { From owner-svn-src-all@freebsd.org Sat Dec 31 00:39:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA664C96563; Sat, 31 Dec 2016 00:39:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A81A01E00; Sat, 31 Dec 2016 00:39:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id n5so23496694pgh.3; Fri, 30 Dec 2016 16:39:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=o4T6MGMla19560tAROQ8tHybV5f3HeNw2DRSklpdTIc=; b=aUG0cacRQ3JH9qolnCKqX6PQnxD77ISdSArkdzQrPbUG8V2BRwsQEvzYPw2f3xlgID vlYVmdi73TTvrOCb4Q+/GO+3mB2sAFnIH6JOSoXpJLtXDct6qhjuTrcL0OKL8Jh5HRIG UMFx8BX0J4TzEQEQtftzyfRVmMW6KzLZ369w7flYL9l2nYe2yGhNKhDbF0nOz+KKO6Zy +RNyEMYezwp3GohvqFAQ7C3mYcLGiTaWHA1SGP70W6S+Tz+klSn95QuUd78lzPHxcfhB M65Cc+d6bNNV5vCsE1zlcV0QSFjEQhYycsxxnHh0BVrQhxS+HsjKnA6hfnxf2xnwQ+i1 AuBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=o4T6MGMla19560tAROQ8tHybV5f3HeNw2DRSklpdTIc=; b=trfsJYi/LohVObONARgd5yEYEdHL08gAc03V4TbQkzRhiaiAjyQP9Q32+EuByNJwU2 4KC86O/DuDR2vfHXhPmHC1tG9g0xUDuChqM59FIKlN6yuyvyUobPFr07JdwgJRK5UEV7 DLtRRtBNoLmKajSJT694m1ptjpb6Dx2kAuehhe5T6zs5vJT+VcbDAFfCeCaQzso0KdjV ML0BmXIeI1BJZt8TvoKAskWsJ+sfx27ipVzYOYPGDlPZXNzIEa7UWY6Jf9SULJztywUX sbki+AGdCYGcN9bGLIrz1lVpMrBy9ZGevB5bTUgcmRV1azvE/Xji7+3pu4xNmTnvtCUg J9mA== X-Gm-Message-State: AIkVDXJY1AS/N44R/ZESxZ5ZsWVX2dXIonMzfJAb0fZuFNmoOAzxbqN9uGrD6k/1HTN6UA== X-Received: by 10.99.22.65 with SMTP id 1mr89247148pgw.70.1483144798029; Fri, 30 Dec 2016 16:39:58 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p64sm115117955pfi.88.2016.12.30.16.39.57 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Dec 2016 16:39:57 -0800 (PST) Subject: Re: svn commit: r310729 - head/contrib/bsnmp/lib Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5578E5E5-03ED-4982-ACDA-6D15CBB48014"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201612290020.uBT0K31s082221@repo.freebsd.org> Date: Fri, 30 Dec 2016 16:39:56 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <711B3082-13F3-4893-917A-F158986F9863@gmail.com> References: <201612290020.uBT0K31s082221@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 00:39:59 -0000 --Apple-Mail=_5578E5E5-03ED-4982-ACDA-6D15CBB48014 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Dec 28, 2016, at 16:20, Ngie Cooper wrote: >=20 > Author: ngie > Date: Thu Dec 29 00:20:03 2016 > New Revision: 310729 > URL: https://svnweb.freebsd.org/changeset/base/310729 >=20 > Log: > Prevent improper memory accesses after calling snmp_pdu_free and = snmp_value_free >=20 > snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that > could happen if a pdu was reused after calling the function, and > as both stack and heap allocation types are used in contrib/bsnmp > and usr.sbin/bsnmpd. >=20 > snmp_value_free: NULL out value->v.octetstring.octets after calling > free on it to prevent a double-free from occurring. This commit identified a bug in the bsnmptools implementation: % bsnmpwalk -s 172.16.45.130:161 sysDescr.0 =3D fbsd12 3045910434 FreeBSD 12.0-CURRENT Bus error (core dumped) --Apple-Mail=_5578E5E5-03ED-4982-ACDA-6D15CBB48014 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYZv5cAAoJEPWDqSZpMIYVDnYQALjA5RX/zVZBGzglX7ZhUyVG PwmpkxqZbhz+FruFScUSUGz8RAqgtIICrB8DNg/1uhMCdx3NGia0pddHU4HpbI5T kiMpiT76QC65jxImMas1LpgGrWUGCOTZACH7f2EKarT71niah6bm4yHo+QP2hDv+ HkpoYcHA9U+3Lfulf8lZ94rBdy6sGEZi16BmI473U3S93/OKDGkScF+2T5oy7143 RL47XC3L/jgrcPl66IwnU4fWp7H+xkCY26LsLaifVnPT7SWiEgy9fkmJNRHQvRow GCfB5AJwxs8mfQeY7+NPzFob8YpG5GO2POlPxNeYciDsRvCpBSolf4No7bQyTW4l mia71KQHw/NEKyfMf/b6twW/grXm10IpkG2F/BUplyQiegaiFQukHJIdf+KAITQH qbrikPQQNB3BUAnPMWqjuUXl5hxnd53qv1hmF8UpzMb4Rzpu7YaGlMhX0xHH5RWC r9X8Jsoxqz2RDZEv+py2J7OdrO4L5zu+3Tq094b3hcxn3+PdX6Md6gzRc3s4Y8fX umE3meO5q+lYBB/qZerS6P5JdyaPARTCBSU5dDsdJAmG1gDgT1SCdCU9dqIFL9Dz kYGMDB0adB3hogbrnYljfJHZnslX9sKJzXg11TzUh1zYiIH7z+ehGd/yG1HSzx4M UAl4Y/aHGu00k61Kl4mF =/sft -----END PGP SIGNATURE----- --Apple-Mail=_5578E5E5-03ED-4982-ACDA-6D15CBB48014-- From owner-svn-src-all@freebsd.org Sat Dec 31 01:51:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDD5C97D15; Sat, 31 Dec 2016 01:51:43 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6255111D; Sat, 31 Dec 2016 01:51:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV1pgWL014152; Sat, 31 Dec 2016 01:51:42 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV1pf8f014148; Sat, 31 Dec 2016 01:51:41 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612310151.uBV1pf8f014148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 31 Dec 2016 01:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310881 - in stable/11/sys: arm/ti/cpsw conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 01:51:43 -0000 Author: loos Date: Sat Dec 31 01:51:41 2016 New Revision: 310881 URL: https://svnweb.freebsd.org/changeset/base/310881 Log: MFC r309113: Add the etherswitch(4) support for TI CPSW. Adds VLAN and port management abilities for etherswitchcfg(8). The code is conditionally enabled for now, because it is not necessary on single ethernet use cases. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c stable/11/sys/arm/ti/cpsw/if_cpswreg.h stable/11/sys/arm/ti/cpsw/if_cpswvar.h stable/11/sys/conf/options.arm Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Sat Dec 31 00:54:12 2016 (r310880) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Sat Dec 31 01:51:41 2016 (r310881) @@ -47,6 +47,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_cpsw.h" + #include #include #include @@ -79,6 +81,11 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#ifdef CPSW_ETHERSWITCH +#include +#include "etherswitch_if.h" +#endif #include "if_cpswreg.h" #include "if_cpswvar.h" @@ -143,6 +150,19 @@ static void cpsw_add_sysctls(struct cpsw static void cpsw_stats_collect(struct cpsw_softc *); static int cpsw_stats_sysctl(SYSCTL_HANDLER_ARGS); +#ifdef CPSW_ETHERSWITCH +static etherswitch_info_t *cpsw_getinfo(device_t); +static int cpsw_getport(device_t, etherswitch_port_t *); +static int cpsw_setport(device_t, etherswitch_port_t *); +static int cpsw_getconf(device_t, etherswitch_conf_t *); +static int cpsw_getvgroup(device_t, etherswitch_vlangroup_t *); +static int cpsw_setvgroup(device_t, etherswitch_vlangroup_t *); +static int cpsw_readreg(device_t, int); +static int cpsw_writereg(device_t, int, int); +static int cpsw_readphy(device_t, int, int); +static int cpsw_writephy(device_t, int, int, int); +#endif + /* * Arbitrary limit on number of segments in an mbuf to be transmitted. * Packets with more segments than this will be defragmented before @@ -159,8 +179,23 @@ static device_method_t cpsw_methods[] = DEVMETHOD(device_shutdown, cpsw_shutdown), DEVMETHOD(device_suspend, cpsw_suspend), DEVMETHOD(device_resume, cpsw_resume), + /* Bus interface */ + DEVMETHOD(bus_add_child, device_add_child_ordered), /* OFW methods */ DEVMETHOD(ofw_bus_get_node, cpsw_get_node), +#ifdef CPSW_ETHERSWITCH + /* etherswitch interface */ + DEVMETHOD(etherswitch_getinfo, cpsw_getinfo), + DEVMETHOD(etherswitch_readreg, cpsw_readreg), + DEVMETHOD(etherswitch_writereg, cpsw_writereg), + DEVMETHOD(etherswitch_readphyreg, cpsw_readphy), + DEVMETHOD(etherswitch_writephyreg, cpsw_writephy), + DEVMETHOD(etherswitch_getport, cpsw_getport), + DEVMETHOD(etherswitch_setport, cpsw_setport), + DEVMETHOD(etherswitch_getvgroup, cpsw_getvgroup), + DEVMETHOD(etherswitch_setvgroup, cpsw_setvgroup), + DEVMETHOD(etherswitch_getconf, cpsw_getconf), +#endif DEVMETHOD_END }; @@ -195,11 +230,20 @@ static driver_t cpswp_driver = { static devclass_t cpswp_devclass; +#ifdef CPSW_ETHERSWITCH +DRIVER_MODULE(etherswitch, cpswss, etherswitch_driver, etherswitch_devclass, 0, 0); +MODULE_DEPEND(cpswss, etherswitch, 1, 1, 1); +#endif + DRIVER_MODULE(cpsw, cpswss, cpswp_driver, cpswp_devclass, 0, 0); DRIVER_MODULE(miibus, cpsw, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(cpsw, ether, 1, 1, 1); MODULE_DEPEND(cpsw, miibus, 1, 1, 1); +#ifdef CPSW_ETHERSWITCH +static struct cpsw_vlangroups cpsw_vgroups[CPSW_VLANS]; +#endif + static uint32_t slave_mdio_addr[] = { 0x4a100200, 0x4a100300 }; static struct resource_spec irq_res_spec[] = { @@ -577,7 +621,8 @@ cpsw_init(struct cpsw_softc *sc) cpsw_write_4(sc, CPSW_PORT_P0_CPDMA_RX_CH_MAP, 0); /* Initialize ALE: set host port to forwarding(3). */ - cpsw_write_4(sc, CPSW_ALE_PORTCTL(0), 3); + cpsw_write_4(sc, CPSW_ALE_PORTCTL(0), + ALE_PORTCTL_INGRESS | ALE_PORTCTL_FORWARD); cpsw_write_4(sc, CPSW_SS_PTYPE, 0); @@ -852,6 +897,11 @@ cpsw_attach(device_t dev) return (ENXIO); } +#ifdef CPSW_ETHERSWITCH + for (i = 0; i < CPSW_VLANS; i++) + cpsw_vgroups[i].vid = -1; +#endif + /* Reset the controller. */ cpsw_reset(sc); cpsw_init(sc); @@ -865,6 +915,7 @@ cpsw_attach(device_t dev) return (ENXIO); } } + bus_generic_probe(dev); bus_generic_attach(dev); return (0); @@ -919,7 +970,12 @@ cpsw_detach(device_t dev) mtx_destroy(&sc->rx.lock); mtx_destroy(&sc->tx.lock); - return (0); + /* Detach the switch device, if present. */ + error = bus_generic_detach(dev); + if (error != 0) + return (error); + + return (device_delete_children(dev)); } static phandle_t @@ -1086,6 +1142,9 @@ cpswp_init(void *arg) static void cpswp_init_locked(void *arg) { +#ifdef CPSW_ETHERSWITCH + int i; +#endif struct cpswp_softc *sc = arg; struct ifnet *ifp; uint32_t reg; @@ -1116,8 +1175,9 @@ cpswp_init_locked(void *arg) reg |= CPSW_SL_MACTL_GMII_ENABLE; cpsw_write_4(sc->swsc, CPSW_SL_MACCONTROL(sc->unit), reg); - /* Initialize ALE: set port to forwarding(3), initialize addrs */ - cpsw_write_4(sc->swsc, CPSW_ALE_PORTCTL(sc->unit + 1), 3); + /* Initialize ALE: set port to forwarding, initialize addrs */ + cpsw_write_4(sc->swsc, CPSW_ALE_PORTCTL(sc->unit + 1), + ALE_PORTCTL_INGRESS | ALE_PORTCTL_FORWARD); cpswp_ale_update_addresses(sc, 1); if (sc->swsc->dualemac) { @@ -1128,6 +1188,14 @@ cpswp_init_locked(void *arg) (1 << (sc->unit + 1)) | (1 << 0), /* Member list */ (1 << (sc->unit + 1)) | (1 << 0), /* Untagged egress */ (1 << (sc->unit + 1)) | (1 << 0), 0); /* mcast reg flood */ +#ifdef CPSW_ETHERSWITCH + for (i = 0; i < CPSW_VLANS; i++) { + if (cpsw_vgroups[i].vid != -1) + continue; + cpsw_vgroups[i].vid = sc->vlan; + break; + } +#endif } mii_mediachg(sc->mii); @@ -2700,3 +2768,229 @@ cpsw_add_sysctls(struct cpsw_softc *sc) CTLFLAG_RD, NULL, "Watchdog Statistics"); cpsw_add_watchdog_sysctls(ctx, node, sc); } + +#ifdef CPSW_ETHERSWITCH +static etherswitch_info_t etherswitch_info = { + .es_nports = CPSW_PORTS + 1, + .es_nvlangroups = CPSW_VLANS, + .es_name = "TI Common Platform Ethernet Switch (CPSW)", + .es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q, +}; + +static etherswitch_info_t * +cpsw_getinfo(device_t dev) +{ + return (ðerswitch_info); +} + +static int +cpsw_getport(device_t dev, etherswitch_port_t *p) +{ + int err; + struct cpsw_softc *sc; + struct cpswp_softc *psc; + struct ifmediareq *ifmr; + uint32_t reg; + + if (p->es_port < 0 || p->es_port > CPSW_PORTS) + return (ENXIO); + + err = 0; + sc = device_get_softc(dev); + if (p->es_port == CPSW_CPU_PORT) { + p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr = &p->es_ifmr; + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_1000_T | IFM_FDX; + ifmr->ifm_mask = 0; + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + ifmr->ifm_count = 0; + } else { + psc = device_get_softc(sc->port[p->es_port - 1].dev); + err = ifmedia_ioctl(psc->ifp, &p->es_ifr, + &psc->mii->mii_media, SIOCGIFMEDIA); + } + reg = cpsw_read_4(sc, CPSW_PORT_P_VLAN(p->es_port)); + p->es_pvid = reg & ETHERSWITCH_VID_MASK; + + reg = cpsw_read_4(sc, CPSW_ALE_PORTCTL(p->es_port)); + if (reg & ALE_PORTCTL_DROP_UNTAGGED) + p->es_flags |= ETHERSWITCH_PORT_DROPUNTAGGED; + if (reg & ALE_PORTCTL_INGRESS) + p->es_flags |= ETHERSWITCH_PORT_INGRESS; + + return (err); +} + +static int +cpsw_setport(device_t dev, etherswitch_port_t *p) +{ + struct cpsw_softc *sc; + struct cpswp_softc *psc; + struct ifmedia *ifm; + uint32_t reg; + + if (p->es_port < 0 || p->es_port > CPSW_PORTS) + return (ENXIO); + + sc = device_get_softc(dev); + if (p->es_pvid != 0) { + cpsw_write_4(sc, CPSW_PORT_P_VLAN(p->es_port), + p->es_pvid & ETHERSWITCH_VID_MASK); + } + + reg = cpsw_read_4(sc, CPSW_ALE_PORTCTL(p->es_port)); + if (p->es_flags & ETHERSWITCH_PORT_DROPUNTAGGED) + reg |= ALE_PORTCTL_DROP_UNTAGGED; + else + reg &= ~ALE_PORTCTL_DROP_UNTAGGED; + if (p->es_flags & ETHERSWITCH_PORT_INGRESS) + reg |= ALE_PORTCTL_INGRESS; + else + reg &= ~ALE_PORTCTL_INGRESS; + cpsw_write_4(sc, CPSW_ALE_PORTCTL(p->es_port), reg); + + /* CPU port does not allow media settings. */ + if (p->es_port == CPSW_CPU_PORT) + return (0); + + psc = device_get_softc(sc->port[p->es_port - 1].dev); + ifm = &psc->mii->mii_media; + + return (ifmedia_ioctl(psc->ifp, &p->es_ifr, ifm, SIOCSIFMEDIA)); +} + +static int +cpsw_getconf(device_t dev, etherswitch_conf_t *conf) +{ + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + + return (0); +} + +static int +cpsw_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + int i, vid; + uint32_t ale_entry[3]; + struct cpsw_softc *sc; + + sc = device_get_softc(dev); + + if (vg->es_vlangroup >= CPSW_VLANS) + return (EINVAL); + + vg->es_vid = 0; + vid = cpsw_vgroups[vg->es_vlangroup].vid; + if (vid == -1) + return (0); + + for (i = 0; i < CPSW_MAX_ALE_ENTRIES; i++) { + cpsw_ale_read_entry(sc, i, ale_entry); + if (ALE_TYPE(ale_entry) != ALE_TYPE_VLAN) + continue; + if (vid != ALE_VLAN(ale_entry)) + continue; + + vg->es_fid = 0; + vg->es_vid = ALE_VLAN(ale_entry) | ETHERSWITCH_VID_VALID; + vg->es_member_ports = ALE_VLAN_MEMBERS(ale_entry); + vg->es_untagged_ports = ALE_VLAN_UNTAG(ale_entry); + } + + return (0); +} + +static void +cpsw_remove_vlan(struct cpsw_softc *sc, int vlan) +{ + int i; + uint32_t ale_entry[3]; + + for (i = 0; i < CPSW_MAX_ALE_ENTRIES; i++) { + cpsw_ale_read_entry(sc, i, ale_entry); + if (ALE_TYPE(ale_entry) != ALE_TYPE_VLAN) + continue; + if (vlan != ALE_VLAN(ale_entry)) + continue; + ale_entry[0] = ale_entry[1] = ale_entry[2] = 0; + cpsw_ale_write_entry(sc, i, ale_entry); + break; + } +} + +static int +cpsw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + int i; + struct cpsw_softc *sc; + + sc = device_get_softc(dev); + + for (i = 0; i < CPSW_VLANS; i++) { + /* Is this Vlan ID in use by another vlangroup ? */ + if (vg->es_vlangroup != i && cpsw_vgroups[i].vid == vg->es_vid) + return (EINVAL); + } + + if (vg->es_vid == 0) { + if (cpsw_vgroups[vg->es_vlangroup].vid == -1) + return (0); + cpsw_remove_vlan(sc, cpsw_vgroups[vg->es_vlangroup].vid); + cpsw_vgroups[vg->es_vlangroup].vid = -1; + vg->es_untagged_ports = 0; + vg->es_member_ports = 0; + vg->es_vid = 0; + return (0); + } + + vg->es_vid &= ETHERSWITCH_VID_MASK; + vg->es_member_ports &= CPSW_PORTS_MASK; + vg->es_untagged_ports &= CPSW_PORTS_MASK; + + if (cpsw_vgroups[vg->es_vlangroup].vid != -1 && + cpsw_vgroups[vg->es_vlangroup].vid != vg->es_vid) + return (EINVAL); + + cpsw_vgroups[vg->es_vlangroup].vid = vg->es_vid; + cpsw_ale_update_vlan_table(sc, vg->es_vid, vg->es_member_ports, + vg->es_untagged_ports, vg->es_member_ports, 0); + + return (0); +} + +static int +cpsw_readreg(device_t dev, int addr) +{ + + /* Not supported. */ + return (0); +} + +static int +cpsw_writereg(device_t dev, int addr, int value) +{ + + /* Not supported. */ + return (0); +} + +static int +cpsw_readphy(device_t dev, int phy, int reg) +{ + + /* Not supported. */ + return (0); +} + +static int +cpsw_writephy(device_t dev, int phy, int reg, int data) +{ + + /* Not supported. */ + return (0); +} +#endif Modified: stable/11/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpswreg.h Sat Dec 31 00:54:12 2016 (r310880) +++ stable/11/sys/arm/ti/cpsw/if_cpswreg.h Sat Dec 31 01:51:41 2016 (r310881) @@ -106,6 +106,14 @@ #define ALE_VLAN_UNTAG(_a) ((_a[0] >> 24) & 7) #define ALE_VLAN_MEMBERS(_a) (_a[0] & 7) #define CPSW_ALE_PORTCTL(p) (CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04)) +#define ALE_PORTCTL_NO_SA_UPDATE (1 << 5) +#define ALE_PORTCTL_NO_LEARN (1 << 4) +#define ALE_PORTCTL_INGRESS (1 << 3) +#define ALE_PORTCTL_DROP_UNTAGGED (1 << 2) +#define ALE_PORTCTL_FORWARD 3 +#define ALE_PORTCTL_LEARN 2 +#define ALE_PORTCTL_BLOCKED 1 +#define ALE_PORTCTL_DISABLED 0 /* SL1 is at 0x0D80, SL2 is at 0x0DC0 */ #define CPSW_SL_OFFSET 0x0D80 Modified: stable/11/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpswvar.h Sat Dec 31 00:54:12 2016 (r310880) +++ stable/11/sys/arm/ti/cpsw/if_cpswvar.h Sat Dec 31 01:51:41 2016 (r310881) @@ -40,6 +40,16 @@ #define CPSW_SYSCTL_COUNT 34 +#ifdef CPSW_ETHERSWITCH +#define CPSW_CPU_PORT 0 +#define CPSW_PORTS_MASK 0x7 +#define CPSW_VLANS 128 /* Arbitrary number. */ + +struct cpsw_vlangroups { + int vid; +}; +#endif + struct cpsw_slot { uint32_t bd_offset; /* Offset of corresponding BD within CPPI RAM. */ bus_dmamap_t dmamap; Modified: stable/11/sys/conf/options.arm ============================================================================== --- stable/11/sys/conf/options.arm Sat Dec 31 00:54:12 2016 (r310880) +++ stable/11/sys/conf/options.arm Sat Dec 31 01:51:41 2016 (r310881) @@ -7,6 +7,7 @@ ARM_MANY_BOARD opt_global.h NKPT2PG opt_pmap.h ARM_WANT_TP_ADDRESS opt_global.h COUNTS_PER_SEC opt_timer.h +CPSW_ETHERSWITCH opt_cpsw.h CPU_ARM9 opt_global.h CPU_ARM9E opt_global.h CPU_ARM1176 opt_global.h From owner-svn-src-all@freebsd.org Sat Dec 31 01:54:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E987CC97DE5; Sat, 31 Dec 2016 01:54:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9646515AE; Sat, 31 Dec 2016 01:54:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV1smav016698; Sat, 31 Dec 2016 01:54:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV1smrt016696; Sat, 31 Dec 2016 01:54:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612310154.uBV1smrt016696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 31 Dec 2016 01:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310882 - stable/11/sys/arm/ti/cpsw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 01:54:50 -0000 Author: loos Date: Sat Dec 31 01:54:48 2016 New Revision: 310882 URL: https://svnweb.freebsd.org/changeset/base/310882 Log: MFC r309345: The RX_FREEBUFFER registers are a write to increment field. Writing the full queue size to it every time was makeing it overflow with a lot of bogus values. This fixes the interrupt storms on irq 40. MFC r309347: MDIO_PHYACCESS_ACK is only valid for read access, remove it from miibus_writereg. Reduce the DELAY() between reads while waiting for MII access. Spotted by: yongari Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c stable/11/sys/arm/ti/cpsw/if_cpswvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Sat Dec 31 01:51:41 2016 (r310881) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Sat Dec 31 01:54:48 2016 (r310882) @@ -1513,9 +1513,6 @@ cpswp_miibus_writereg(device_t dev, int return (0); } - if ((cpsw_read_4(sc->swsc, sc->phyaccess) & MDIO_PHYACCESS_ACK) == 0) - device_printf(dev, "Failed to write to PHY.\n"); - return (0); } @@ -1761,7 +1758,7 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) sc->rx.queue_adds += added; sc->rx.avail_queue_len -= added; sc->rx.active_queue_len += added; - cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), sc->rx.active_queue_len); + cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), added); if (sc->rx.active_queue_len > sc->rx.max_active_queue_len) { sc->rx.max_active_queue_len = sc->rx.active_queue_len; } Modified: stable/11/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpswvar.h Sat Dec 31 01:51:41 2016 (r310881) +++ stable/11/sys/arm/ti/cpsw/if_cpswvar.h Sat Dec 31 01:54:48 2016 (r310882) @@ -33,8 +33,8 @@ #define CPSW_INTR_COUNT 4 /* MII BUS */ -#define CPSW_MIIBUS_RETRIES 5 -#define CPSW_MIIBUS_DELAY 1000 +#define CPSW_MIIBUS_RETRIES 20 +#define CPSW_MIIBUS_DELAY 100 #define CPSW_MAX_ALE_ENTRIES 1024 From owner-svn-src-all@freebsd.org Sat Dec 31 01:58:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31EFAC97E71; Sat, 31 Dec 2016 01:58:06 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01AFD1724; Sat, 31 Dec 2016 01:58:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV1w504016886; Sat, 31 Dec 2016 01:58:05 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV1w5TD016885; Sat, 31 Dec 2016 01:58:05 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612310158.uBV1w5TD016885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 31 Dec 2016 01:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310883 - stable/11/sys/dev/etherswitch X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 01:58:06 -0000 Author: loos Date: Sat Dec 31 01:58:04 2016 New Revision: 310883 URL: https://svnweb.freebsd.org/changeset/base/310883 Log: MFC r309461: Allow simultaneous access to switch device, there is no reason to prevent it. Remove bogus wrappers and use the kernel defaults. While here, use DEVMETHOD_END. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/dev/etherswitch/etherswitch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/etherswitch/etherswitch.c ============================================================================== --- stable/11/sys/dev/etherswitch/etherswitch.c Sat Dec 31 01:54:48 2016 (r310882) +++ stable/11/sys/dev/etherswitch/etherswitch.c Sat Dec 31 01:58:04 2016 (r310883) @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -45,19 +44,11 @@ #include "etherswitch_if.h" -#define BUFSIZE 1024 - struct etherswitch_softc { device_t sc_dev; - int sc_count; - struct cdev *sc_devnode; - struct sx sc_lock; }; -#define SWITCH_LOCK(sc) sx_xlock(&(sc)->sc_lock) -#define SWITCH_UNLOCK(sc) sx_xunlock(&(sc)->sc_lock) - static int etherswitch_probe(device_t); static int etherswitch_attach(device_t); static int etherswitch_detach(device_t); @@ -72,7 +63,7 @@ static device_method_t etherswitch_metho DEVMETHOD(device_attach, etherswitch_attach), DEVMETHOD(device_detach, etherswitch_detach), - { 0, 0 } + DEVMETHOD_END }; driver_t etherswitch_driver = { @@ -81,19 +72,11 @@ driver_t etherswitch_driver = { sizeof(struct etherswitch_softc), }; -static d_open_t etherswitchopen; -static d_close_t etherswitchclose; -static d_write_t etherswitchwrite; -static d_read_t etherswitchread; static d_ioctl_t etherswitchioctl; static struct cdevsw etherswitch_cdevsw = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE, - .d_open = etherswitchopen, - .d_close = etherswitchclose, - .d_read = etherswitchread, - .d_write = etherswitchwrite, .d_ioctl = etherswitchioctl, .d_name = "etherswitch", }; @@ -119,13 +102,11 @@ etherswitch_attach(device_t dev) struct etherswitch_softc *sc = (struct etherswitch_softc *)device_get_softc(dev); sc->sc_dev = dev; - sx_init(&sc->sc_lock, "etherswitch"); sc->sc_devnode = make_dev(ðerswitch_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "etherswitch%d", device_get_unit(dev)); if (sc->sc_devnode == NULL) { device_printf(dev, "failed to create character device\n"); - sx_destroy(&sc->sc_lock); return (ENXIO); } sc->sc_devnode->si_drv1 = sc; @@ -140,61 +121,11 @@ etherswitch_detach(device_t dev) if (sc->sc_devnode) destroy_dev(sc->sc_devnode); - sx_destroy(&sc->sc_lock); - - return (0); -} - -static int -etherswitchopen(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count > 0) { - SWITCH_UNLOCK(sc); - return (EBUSY); - } - - sc->sc_count++; - SWITCH_UNLOCK(sc); - - return (0); -} - -static int -etherswitchclose(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count == 0) { - SWITCH_UNLOCK(sc); - return (EINVAL); - } - - sc->sc_count--; - - if (sc->sc_count < 0) - panic("%s: etherswitch_count < 0!", __func__); - SWITCH_UNLOCK(sc); return (0); } static int -etherswitchwrite(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int -etherswitchread(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int etherswitchioctl(struct cdev *cdev, u_long cmd, caddr_t data, int flags, struct thread *td) { struct etherswitch_softc *sc = cdev->si_drv1; From owner-svn-src-all@freebsd.org Sat Dec 31 02:00:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FD4C97FC0; Sat, 31 Dec 2016 02:00:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2EA41A58; Sat, 31 Dec 2016 02:00:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV20pEk017182; Sat, 31 Dec 2016 02:00:51 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV20pI6017181; Sat, 31 Dec 2016 02:00:51 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612310200.uBV20pI6017181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 31 Dec 2016 02:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310884 - stable/11/sys/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 02:00:53 -0000 Author: loos Date: Sat Dec 31 02:00:51 2016 New Revision: 310884 URL: https://svnweb.freebsd.org/changeset/base/310884 Log: MFC r309717: Fix the typos and style(9) in comment. Modified: stable/11/sys/net/route.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/route.c ============================================================================== --- stable/11/sys/net/route.c Sat Dec 31 01:58:04 2016 (r310883) +++ stable/11/sys/net/route.c Sat Dec 31 02:00:51 2016 (r310884) @@ -467,9 +467,8 @@ rtalloc1_fib(struct sockaddr *dst, int r RIB_RUNLOCK(rh); /* - * Either we hit the root or couldn't find any match, - * Which basically means - * "caint get there frm here" + * Either we hit the root or could not find any match, + * which basically means: "cannot get there from here". */ miss: V_rtstat.rts_unreach++; From owner-svn-src-all@freebsd.org Sat Dec 31 02:02:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECDEC97275; Sat, 31 Dec 2016 02:02:44 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23F81EC8; Sat, 31 Dec 2016 02:02:43 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV22hCA020891; Sat, 31 Dec 2016 02:02:43 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV22h4Q020890; Sat, 31 Dec 2016 02:02:43 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612310202.uBV22h4Q020890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 31 Dec 2016 02:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310885 - stable/11/sys/dev/gpio X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 02:02:44 -0000 Author: loos Date: Sat Dec 31 02:02:42 2016 New Revision: 310885 URL: https://svnweb.freebsd.org/changeset/base/310885 Log: MFC r310000: Remove a too strict test and instead, just filter the passed flags with the supported capabilities. Spotted by: yamori813@yahoo.co.jp (Hiroki Mori) Modified: stable/11/sys/dev/gpio/gpiobus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/gpio/gpiobus.c ============================================================================== --- stable/11/sys/dev/gpio/gpiobus.c Sat Dec 31 02:00:51 2016 (r310884) +++ stable/11/sys/dev/gpio/gpiobus.c Sat Dec 31 02:02:42 2016 (r310885) @@ -120,9 +120,9 @@ int gpio_check_flags(uint32_t caps, uint32_t flags) { - /* Check for unwanted flags. */ - if ((flags & caps) == 0 || (flags & caps) != flags) - return (EINVAL); + /* Filter unwanted flags. */ + flags &= caps; + /* Cannot mix input/output together. */ if (flags & GPIO_PIN_INPUT && flags & GPIO_PIN_OUTPUT) return (EINVAL); From owner-svn-src-all@freebsd.org Sat Dec 31 02:18:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D272C97747; Sat, 31 Dec 2016 02:18:09 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CACC1732; Sat, 31 Dec 2016 02:18:09 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV2I8ke025323; Sat, 31 Dec 2016 02:18:08 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV2I89a025322; Sat, 31 Dec 2016 02:18:08 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612310218.uBV2I89a025322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 31 Dec 2016 02:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310886 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 02:18:09 -0000 Author: loos Date: Sat Dec 31 02:18:08 2016 New Revision: 310886 URL: https://svnweb.freebsd.org/changeset/base/310886 Log: Fixes the sensor initialization, always reset the digital outputs to start. Obtained from: pfSense MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/am335x/am335x_scm.c Modified: head/sys/arm/ti/am335x/am335x_scm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm.c Sat Dec 31 02:02:42 2016 (r310885) +++ head/sys/arm/ti/am335x/am335x_scm.c Sat Dec 31 02:18:08 2016 (r310886) @@ -110,11 +110,14 @@ am335x_scm_attach(device_t dev) struct sysctl_oid_list *tree; uint32_t reg; - /* Set ADC to continous mode, clear output reset. */ - reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV; - ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); - /* Flush write. */ + /* Reset the digital outputs. */ + ti_scm_reg_write_4(SCM_BGAP_CTRL, 0); + ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + DELAY(500); + /* Set continous mode. */ + ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + DELAY(500); /* Start the ADC conversion. */ reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); From owner-svn-src-all@freebsd.org Sat Dec 31 02:23:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E7BC97BF3; Sat, 31 Dec 2016 02:23:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 377BF1DD3; Sat, 31 Dec 2016 02:23:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV2NFad029470; Sat, 31 Dec 2016 02:23:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV2NF25029469; Sat, 31 Dec 2016 02:23:15 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612310223.uBV2NF25029469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 31 Dec 2016 02:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310887 - head/sys/dev/rccgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 02:23:16 -0000 Author: loos Date: Sat Dec 31 02:23:15 2016 New Revision: 310887 URL: https://svnweb.freebsd.org/changeset/base/310887 Log: Fix rcc_gpio_modify_bits(). Obviously (1 << 0) is not the same as 0. Pointy hat to: loos MFC after: 3 days Modified: head/sys/dev/rccgpio/rccgpio.c Modified: head/sys/dev/rccgpio/rccgpio.c ============================================================================== --- head/sys/dev/rccgpio/rccgpio.c Sat Dec 31 02:18:08 2016 (r310886) +++ head/sys/dev/rccgpio/rccgpio.c Sat Dec 31 02:23:15 2016 (r310887) @@ -57,12 +57,12 @@ struct rcc_gpio_pin { }; static struct rcc_gpio_pin rcc_pins[] = { - { .pin = 11, .name = "reset switch", .caps = GPIO_PIN_INPUT }, - { .pin = 15, .name = "red LED", .caps = GPIO_PIN_OUTPUT }, - { .pin = 17, .name = "green LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 11), .name = "reset switch", .caps = GPIO_PIN_INPUT }, + { .pin = (1 << 15), .name = "red LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 17), .name = "green LED", .caps = GPIO_PIN_OUTPUT }, #if 0 - { .pin = 16, .name = "HD1 LED", .caps = GPIO_PIN_OUTPUT }, - { .pin = 18, .name = "HD2 LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 16), .name = "HD1 LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 18), .name = "HD2 LED", .caps = GPIO_PIN_OUTPUT }, #endif }; @@ -87,14 +87,14 @@ struct rcc_gpio_softc { static void rcc_gpio_modify_bits(struct rcc_gpio_softc *sc, uint32_t reg, uint32_t mask, - uint32_t bit) + uint32_t writebits) { uint32_t value; RCC_GPIO_LOCK(sc); value = RCC_READ(sc, reg); - value &= ~(1 << mask); - value |= (1 << bit); + value &= ~mask; + value |= writebits; RCC_WRITE(sc, reg, value); RCC_GPIO_UNLOCK(sc); } From owner-svn-src-all@freebsd.org Sat Dec 31 03:07:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76982C96AE0; Sat, 31 Dec 2016 03:07:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 271C015FE; Sat, 31 Dec 2016 03:07:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV37mKf046768; Sat, 31 Dec 2016 03:07:48 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV37miu046767; Sat, 31 Dec 2016 03:07:48 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201612310307.uBV37miu046767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 31 Dec 2016 03:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310888 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 03:07:49 -0000 Author: hrs Date: Sat Dec 31 03:07:48 2016 New Revision: 310888 URL: https://svnweb.freebsd.org/changeset/base/310888 Log: Retry to open an F_PIPE process when it dies unexpectedly. Reported by: Eugene Grosbein PR: 215335 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Dec 31 02:23:15 2016 (r310887) +++ head/usr.sbin/syslogd/syslogd.c Sat Dec 31 03:07:48 2016 (r310888) @@ -368,9 +368,19 @@ close_filed(struct filed *f) if (f == NULL || f->f_file == -1) return; + switch (f->f_type) { + case F_FILE: + case F_TTY: + case F_CONSOLE: + case F_FORW: + f->f_type = F_UNUSED; + break; + case F_PIPE: + f->fu_pipe_pid = 0; + break; + } (void)close(f->f_file); f->f_file = -1; - f->f_type = F_UNUSED; } static int @@ -1378,18 +1388,15 @@ fprintlog(struct filed *f, int flags, co if (f->fu_pipe_pid == 0) { if ((f->f_file = p_open(f->fu_pipe_pname, &f->fu_pipe_pid)) < 0) { - f->f_type = F_UNUSED; logerror(f->fu_pipe_pname); break; } } if (writev(f->f_file, iov, nitems(iov)) < 0) { int e = errno; + + deadq_enter(f->fu_pipe_pid, f->fu_pipe_pname); close_filed(f); - if (f->fu_pipe_pid > 0) - deadq_enter(f->fu_pipe_pid, - f->fu_pipe_pname); - f->fu_pipe_pid = 0; errno = e; logerror(f->fu_pipe_pname); } @@ -1520,7 +1527,6 @@ reapchild(int signo __unused) if (f->f_type == F_PIPE && f->fu_pipe_pid == pid) { close_filed(f); - f->fu_pipe_pid = 0; log_deadchild(pid, status, f->fu_pipe_pname); break; } @@ -1619,10 +1625,8 @@ die(int signo) /* flush any pending output */ if (f->f_prevcount) fprintlog(f, 0, (char *)NULL); - if (f->f_type == F_PIPE && f->fu_pipe_pid > 0) { + if (f->f_type == F_PIPE && f->fu_pipe_pid > 0) close_filed(f); - f->fu_pipe_pid = 0; - } } Initialized = was_initialized; if (signo) { @@ -1851,12 +1855,8 @@ init(int signo) close_filed(f); break; case F_PIPE: - if (f->fu_pipe_pid > 0) { - close_filed(f); - deadq_enter(f->fu_pipe_pid, - f->fu_pipe_pname); - } - f->fu_pipe_pid = 0; + deadq_enter(f->fu_pipe_pid, f->fu_pipe_pname); + close_filed(f); break; } } @@ -2753,6 +2753,8 @@ deadq_enter(pid_t pid, const char *name) struct deadq_entry *dq; int status; + if (pid == 0) + return; /* * Be paranoid, if we can't signal the process, don't enter it * into the dead queue (perhaps it's already dead). If possible, From owner-svn-src-all@freebsd.org Sat Dec 31 06:07:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5896AC98DD8; Sat, 31 Dec 2016 06:07:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 285A51F5D; Sat, 31 Dec 2016 06:07:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV67mjn019148; Sat, 31 Dec 2016 06:07:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV67mVO019147; Sat, 31 Dec 2016 06:07:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201612310607.uBV67mVO019147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sat, 31 Dec 2016 06:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310889 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 06:07:49 -0000 Author: jkim Date: Sat Dec 31 06:07:48 2016 New Revision: 310889 URL: https://svnweb.freebsd.org/changeset/base/310889 Log: Do not remove llvm-objdump. It is installed by default since r310840. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 03:07:48 2016 (r310888) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 06:07:48 2016 (r310889) @@ -1484,7 +1484,6 @@ OLD_FILES+=usr/bin/llvm-link OLD_FILES+=usr/bin/llvm-lto OLD_FILES+=usr/bin/llvm-mc OLD_FILES+=usr/bin/llvm-nm -OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-pdbdump OLD_FILES+=usr/bin/llvm-rtdyld OLD_FILES+=usr/bin/llvm-symbolizer From owner-svn-src-all@freebsd.org Sat Dec 31 06:23:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44B61C98400; Sat, 31 Dec 2016 06:23:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F4D617D0; Sat, 31 Dec 2016 06:23:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV6N5EH026842; Sat, 31 Dec 2016 06:23:05 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV6N5W6026841; Sat, 31 Dec 2016 06:23:05 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201612310623.uBV6N5W6026841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 31 Dec 2016 06:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310890 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 06:23:06 -0000 Author: hrs Date: Sat Dec 31 06:23:05 2016 New Revision: 310890 URL: https://svnweb.freebsd.org/changeset/base/310890 Log: Replace two fat signal handlers with function calls in the main I/O multiplex loop. select() now watches a pipe which is written by the new skinny signal handlers and the received signals are handled inside the loop sequencially. This eliminates a complex signal mask to guarantee async-signal safety. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Dec 31 06:07:48 2016 (r310889) +++ head/usr.sbin/syslogd/syslogd.c Sat Dec 31 06:23:05 2016 (r310890) @@ -321,8 +321,9 @@ static int LogFacPri; /* Put facility an static int KeepKernFac; /* Keep remotely logged kernel facility */ static int needdofsync = 0; /* Are any file(s) waiting to be fsynced? */ static struct pidfh *pfh; +static int sigp[2]; /* Pipe to catch a signal during select(). */ -static volatile sig_atomic_t MarkSet, WantDie; +static volatile sig_atomic_t MarkSet, WantDie, WantInitialize, WantReapchild; static int allowaddr(char *); static int addfile(struct filed *); @@ -340,6 +341,7 @@ static void dofsync(void); static void domark(int); static void fprintlog(struct filed *, int, const char *); static void init(int); +static void init_sh(int); static void logerror(const char *); static void logmsg(int, const char *, const char *, int); static void log_deadchild(pid_t, int, const char *); @@ -347,11 +349,13 @@ static void markit(void); static int socksetup(struct peer *); static int socklist_recv_file(struct socklist *); static int socklist_recv_sock(struct socklist *); +static int socklist_recv_signal(struct socklist *); static int skip_message(const char *, const char *, int); static void printline(const char *, char *, int); static void printsys(char *); static int p_open(const char *, pid_t *); static void reapchild(int); +static void reapchild_sh(int); static const char *ttymsg_check(struct iovec *, int, char *, int); static void usage(void); static int validate(struct sockaddr *, const char *); @@ -435,7 +439,6 @@ main(int argc, char *argv[]) struct timeval tv, *tvp; struct peer *pe; struct socklist *sl; - sigset_t mask; pid_t ppid = 1, spid; char *p; @@ -578,6 +581,17 @@ main(int argc, char *argv[]) if ((argc -= optind) != 0) usage(); + /* Pipe to catch a signal during select(). */ + s = pipe2(sigp, O_NONBLOCK); + if (s < 0) { + err(1, "cannot open a pipe for signals"); + } else { + addsock(NULL, 0, &(struct socklist){ + .sl_socket = sigp[1], + .sl_recv = socklist_recv_signal + }); + } + /* Listen by default: /dev/klog. */ s = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0); if (s < 0) { @@ -632,19 +646,8 @@ main(int argc, char *argv[]) (void)signal(SIGTERM, dodie); (void)signal(SIGINT, Debug ? dodie : SIG_IGN); (void)signal(SIGQUIT, Debug ? dodie : SIG_IGN); - /* - * We don't want the SIGCHLD and SIGHUP handlers to interfere - * with each other; they are likely candidates for being called - * simultaneously (SIGHUP closes pipe descriptor, process dies, - * SIGCHLD happens). - */ - sigemptyset(&mask); - sigaddset(&mask, SIGHUP); - (void)sigaction(SIGCHLD, &(struct sigaction){ - .sa_handler = reapchild, - .sa_mask = mask, - .sa_flags = SA_RESTART - }, NULL); + (void)signal(SIGHUP, init_sh); + (void)signal(SIGCHLD, reapchild_sh); (void)signal(SIGALRM, domark); (void)signal(SIGPIPE, SIG_IGN); /* We'll catch EPIPE instead. */ (void)alarm(TIMERINTVL); @@ -654,16 +657,6 @@ main(int argc, char *argv[]) dprintf("off & running....\n"); - init(0); - /* prevent SIGHUP and SIGCHLD handlers from running in parallel */ - sigemptyset(&mask); - sigaddset(&mask, SIGCHLD); - (void)sigaction(SIGHUP, &(struct sigaction){ - .sa_handler = init, - .sa_mask = mask, - .sa_flags = SA_RESTART - }, NULL); - tvp = &tv; tv.tv_sec = tv.tv_usec = 0; @@ -677,6 +670,12 @@ main(int argc, char *argv[]) errx(1, "calloc fd_set"); for (;;) { + if (Initialized == 0) + init(0); + else if (WantInitialize) + init(WantInitialize); + if (WantReapchild) + reapchild(WantReapchild); if (MarkSet) markit(); if (WantDie) @@ -716,6 +715,19 @@ main(int argc, char *argv[]) } static int +socklist_recv_signal(struct socklist *sl __unused) +{ + ssize_t len; + static char buf[BUFSIZ]; + + /* Clear an wake-up signal by reading dummy data. */ + while ((len = read(sigp[0], buf, sizeof(buf))) > 0) + ; + + return (0); +} + +static int socklist_recv_sock(struct socklist *sl) { struct sockaddr_storage ss; @@ -987,7 +999,7 @@ static void logmsg(int pri, const char *msg, const char *from, int flags) { struct filed *f; - int i, fac, msglen, omask, prilev; + int i, fac, msglen, prilev; const char *timestamp; char prog[NAME_MAX+1]; char buf[MAXLINE+1]; @@ -995,8 +1007,6 @@ logmsg(int pri, const char *msg, const c dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n", pri, flags, from, msg); - omask = sigblock(sigmask(SIGHUP)|sigmask(SIGALRM)); - /* * Check to see if msg looks non-standard. */ @@ -1027,10 +1037,8 @@ logmsg(int pri, const char *msg, const c fac = LOG_FAC(pri); /* Check maximum facility number. */ - if (fac > LOG_NFACILITIES) { - (void)sigsetmask(omask); + if (fac > LOG_NFACILITIES) return; - } prilev = LOG_PRI(pri); @@ -1067,7 +1075,6 @@ logmsg(int pri, const char *msg, const c close(f->f_file); f->f_file = -1; } - (void)sigsetmask(omask); return; } STAILQ_FOREACH(f, &fhead, next) { @@ -1139,7 +1146,6 @@ logmsg(int pri, const char *msg, const c } } } - (void)sigsetmask(omask); } static void @@ -1507,6 +1513,17 @@ ttymsg_check(struct iovec *iov, int iovc } static void +reapchild_sh(int signo) +{ + static char buf[BUFSIZ]; + + WantReapchild = signo; + /* Send an wake-up signal to the select() loop. */ + read(sigp[0], buf, sizeof(buf)); + write(sigp[1], &signo, sizeof(signo)); +} + +static void reapchild(int signo __unused) { int status; @@ -1514,10 +1531,6 @@ reapchild(int signo __unused) struct filed *f; while ((pid = wait3(&status, WNOHANG, (struct rusage *)NULL)) > 0) { - if (!Initialized) - /* Don't tell while we are initting. */ - continue; - /* First, look if it's a process from the dead queue. */ if (deadq_removebypid(pid)) continue; @@ -1532,6 +1545,7 @@ reapchild(int signo __unused) } } } + WantReapchild = 0; } /* @@ -1541,7 +1555,6 @@ static const char * cvthname(struct sockaddr *f) { int error, hl; - sigset_t omask, nmask; static char hname[NI_MAXHOST], ip[NI_MAXHOST]; dprintf("cvthname(%d) len = %d\n", f->sa_family, f->sa_len); @@ -1556,12 +1569,8 @@ cvthname(struct sockaddr *f) if (!resolve) return (ip); - sigemptyset(&nmask); - sigaddset(&nmask, SIGHUP); - sigprocmask(SIG_BLOCK, &nmask, &omask); error = getnameinfo(f, f->sa_len, hname, sizeof(hname), NULL, 0, NI_NAMEREQD); - sigprocmask(SIG_SETMASK, &omask, NULL); if (error) { dprintf("Host name for your address (%s) unknown\n", ip); return (ip); @@ -1616,11 +1625,8 @@ die(int signo) { struct filed *f; struct socklist *sl; - int was_initialized; char buf[100]; - was_initialized = Initialized; - Initialized = 0; /* Don't log SIGCHLDs. */ STAILQ_FOREACH(f, &fhead, next) { /* flush any pending output */ if (f->f_prevcount) @@ -1628,7 +1634,6 @@ die(int signo) if (f->f_type == F_PIPE && f->fu_pipe_pid > 0) close_filed(f); } - Initialized = was_initialized; if (signo) { dprintf("syslogd: exiting on signal %d\n", signo); (void)snprintf(buf, sizeof(buf), "exiting on signal %d", signo); @@ -1793,6 +1798,17 @@ readconfigfile(FILE *cf, int allow_inclu * INIT -- Initialize syslogd from configuration table */ static void +init_sh(int signo) +{ + static char buf[BUFSIZ]; + + WantInitialize = signo; + /* Send an wake-up signal to the select() loop. */ + read(sigp[0], buf, sizeof(buf)); + write(sigp[1], &signo, sizeof(signo)); +} + +static void init(int signo) { int i; @@ -1804,6 +1820,7 @@ init(int signo) char bootfileMsg[LINE_MAX]; dprintf("init\n"); + WantInitialize = 0; /* * Load hostname (may have changed). @@ -2669,7 +2686,6 @@ p_open(const char *prog, pid_t *rpid) { int pfd[2], nulldesc; pid_t pid; - sigset_t omask, mask; char *argv[4]; /* sh -c cmd NULL */ char errmsg[200]; @@ -2679,17 +2695,13 @@ p_open(const char *prog, pid_t *rpid) /* we are royally screwed anyway */ return (-1); - sigemptyset(&mask); - sigaddset(&mask, SIGALRM); - sigaddset(&mask, SIGHUP); - sigprocmask(SIG_BLOCK, &mask, &omask); switch ((pid = fork())) { case -1: - sigprocmask(SIG_SETMASK, &omask, 0); close(nulldesc); return (-1); case 0: + (void)setsid(); /* Avoid catching SIGHUPs. */ argv[0] = strdup("sh"); argv[1] = strdup("-c"); argv[2] = strdup(prog); @@ -2700,19 +2712,11 @@ p_open(const char *prog, pid_t *rpid) } alarm(0); - (void)setsid(); /* Avoid catching SIGHUPs. */ - /* - * Throw away pending signals, and reset signal - * behaviour to standard values. - */ - signal(SIGALRM, SIG_IGN); - signal(SIGHUP, SIG_IGN); - sigprocmask(SIG_SETMASK, &omask, 0); - signal(SIGPIPE, SIG_DFL); - signal(SIGQUIT, SIG_DFL); - signal(SIGALRM, SIG_DFL); - signal(SIGHUP, SIG_DFL); + /* Restore signals marked as SIG_IGN. */ + (void)signal(SIGINT, SIG_DFL); + (void)signal(SIGQUIT, SIG_DFL); + (void)signal(SIGPIPE, SIG_DFL); dup2(pfd[0], STDIN_FILENO); dup2(nulldesc, STDOUT_FILENO); @@ -2722,8 +2726,6 @@ p_open(const char *prog, pid_t *rpid) (void)execvp(_PATH_BSHELL, argv); _exit(255); } - - sigprocmask(SIG_SETMASK, &omask, 0); close(nulldesc); close(pfd[0]); /* From owner-svn-src-all@freebsd.org Sat Dec 31 07:50:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D10F0C98E05; Sat, 31 Dec 2016 07:50:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91DA0183A; Sat, 31 Dec 2016 07:50:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV7oE1u058861; Sat, 31 Dec 2016 07:50:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV7oEG6058859; Sat, 31 Dec 2016 07:50:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612310750.uBV7oEG6058859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 31 Dec 2016 07:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310891 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 07:50:15 -0000 Author: adrian Date: Sat Dec 31 07:50:14 2016 New Revision: 310891 URL: https://svnweb.freebsd.org/changeset/base/310891 Log: [net80211] add placeholders for the VHT action frame handling. Upcoming vht support will register send/receive action handlers. Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_action.c Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sat Dec 31 06:23:05 2016 (r310890) +++ head/sys/net80211/ieee80211.h Sat Dec 31 07:50:14 2016 (r310891) @@ -382,7 +382,7 @@ struct ieee80211_action { #define IEEE80211_ACTION_CAT_MESH 13 /* Mesh */ #define IEEE80211_ACTION_CAT_SELF_PROT 15 /* Self-protected */ /* 16 - 125 reserved */ -#define IEEE80211_ACTION_VHT 21 +#define IEEE80211_ACTION_CAT_VHT 21 #define IEEE80211_ACTION_CAT_VENDOR 127 /* Vendor Specific */ #define IEEE80211_ACTION_HT_TXCHWIDTH 0 /* recommended xmit chan width*/ Modified: head/sys/net80211/ieee80211_action.c ============================================================================== --- head/sys/net80211/ieee80211_action.c Sat Dec 31 06:23:05 2016 (r310890) +++ head/sys/net80211/ieee80211_action.c Sat Dec 31 07:50:14 2016 (r310891) @@ -79,6 +79,10 @@ static ieee80211_send_action_func *vendo send_inval, send_inval, send_inval, send_inval, }; +static ieee80211_send_action_func *vht_send_action[3] = { + send_inval, send_inval, send_inval, +}; + int ieee80211_send_action_register(int cat, int act, ieee80211_send_action_func *f) { @@ -108,6 +112,11 @@ ieee80211_send_action_register(int cat, break; vendor_send_action[act] = f; return 0; + case IEEE80211_ACTION_CAT_VHT: + if (act >= nitems(vht_send_action)) + break; + vht_send_action[act] = f; + return 0; } return EINVAL; } @@ -144,6 +153,10 @@ ieee80211_send_action(struct ieee80211_n if (act < nitems(vendor_send_action)) f = vendor_send_action[act]; break; + case IEEE80211_ACTION_CAT_VHT: + if (act < nitems(vht_send_action)) + f = vht_send_action[act]; + break; } return f(ni, cat, act, sa); } @@ -177,6 +190,10 @@ static ieee80211_recv_action_func *vendo recv_inval, recv_inval, recv_inval, recv_inval, }; +static ieee80211_recv_action_func *vht_recv_action[3] = { + recv_inval, recv_inval, recv_inval +}; + int ieee80211_recv_action_register(int cat, int act, ieee80211_recv_action_func *f) { @@ -206,6 +223,11 @@ ieee80211_recv_action_register(int cat, break; vendor_recv_action[act] = f; return 0; + case IEEE80211_ACTION_CAT_VHT: + if (act >= nitems(vht_recv_action)) + break; + vht_recv_action[act] = f; + return 0; } return EINVAL; } @@ -256,6 +278,10 @@ ieee80211_recv_action(struct ieee80211_n if (ia->ia_action < nitems(vendor_recv_action)) f = vendor_recv_action[ia->ia_action]; break; + case IEEE80211_ACTION_CAT_VHT: + if (ia->ia_action < nitems(vht_recv_action)) + f = vht_recv_action[ia->ia_action]; + break; } return f(ni, wh, frm, efrm); } From owner-svn-src-all@freebsd.org Sat Dec 31 09:24:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D90C988A5; Sat, 31 Dec 2016 09:24:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9989E1C38; Sat, 31 Dec 2016 09:24:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBV9OCOh031977 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 31 Dec 2016 11:24:12 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBV9OCOh031977 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBV9OBCx031976; Sat, 31 Dec 2016 11:24:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 31 Dec 2016 11:24:11 +0200 From: Konstantin Belousov To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r310883 - stable/11/sys/dev/etherswitch Message-ID: <20161231092411.GR1923@kib.kiev.ua> References: <201612310158.uBV1w5TD016885@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612310158.uBV1w5TD016885@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 09:24:23 -0000 On Sat, Dec 31, 2016 at 01:58:05AM +0000, Luiz Otavio O Souza wrote: > -static int > etherswitchioctl(struct cdev *cdev, u_long cmd, caddr_t data, int flags, struct thread *td) > { > struct etherswitch_softc *sc = cdev->si_drv1; Since si_drv1 is dereferenced in the cdevsw methods, please consider converting the driver to use make_dev_s(9) KPI. This would fix a race with a thread accessing not yet initialized si_drv1 in parallel with the makedev thread. From owner-svn-src-all@freebsd.org Sat Dec 31 09:43:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0180BC98C54; Sat, 31 Dec 2016 09:43:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C21271348; Sat, 31 Dec 2016 09:43:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV9hZWS007050; Sat, 31 Dec 2016 09:43:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV9hZNk007049; Sat, 31 Dec 2016 09:43:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612310943.uBV9hZNk007049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 09:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310892 - head/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 09:43:37 -0000 Author: ngie Date: Sat Dec 31 09:43:35 2016 New Revision: 310892 URL: https://svnweb.freebsd.org/changeset/base/310892 Log: Don't call snmp_pdu_free(..) until finished with the pdu and when ready to allocate a new one via snmp_pdu_create(..) This fixes bsnmpwalk, so it no longer crashes after r310729 X-MFC with: r310729 MFC after: 12 days Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Sat Dec 31 07:50:14 2016 (r310891) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Sat Dec 31 09:43:35 2016 (r310892) @@ -498,7 +498,6 @@ snmptool_walk(struct snmp_toolinfo *snmp } outputs += rc; - snmp_pdu_free(&resp); if ((u_int)rc < resp.nbindings) break; @@ -518,8 +517,6 @@ snmptool_walk(struct snmp_toolinfo *snmp snmp_output_err_resp(snmptoolctx, &resp); else snmp_output_resp(snmptoolctx, &(resp), NULL); - - snmp_pdu_free(&resp); } else warn("Snmp dialog"); } @@ -529,6 +526,8 @@ snmptool_walk(struct snmp_toolinfo *snmp break; } + snmp_pdu_free(&resp); + snmp_pdu_create(&req, op); } From owner-svn-src-all@freebsd.org Sat Dec 31 09:52:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61245C98E53; Sat, 31 Dec 2016 09:52:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2846D168A; Sat, 31 Dec 2016 09:52:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBV9q0qD010866; Sat, 31 Dec 2016 09:52:00 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBV9q05k010865; Sat, 31 Dec 2016 09:52:00 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201612310952.uBV9q05k010865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 31 Dec 2016 09:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310893 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 09:52:01 -0000 Author: hrs Date: Sat Dec 31 09:52:00 2016 New Revision: 310893 URL: https://svnweb.freebsd.org/changeset/base/310893 Log: Remove extra NULL-check before free(3). Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Dec 31 09:43:35 2016 (r310892) +++ head/usr.sbin/syslogd/syslogd.c Sat Dec 31 09:52:00 2016 (r310893) @@ -710,8 +710,7 @@ main(int argc, char *argv[]) (*sl->sl_recv)(sl); } } - if (fdsr) - free(fdsr); + free(fdsr); } static int From owner-svn-src-all@freebsd.org Sat Dec 31 10:01:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB053C96072; Sat, 31 Dec 2016 10:01:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 648B71AFA; Sat, 31 Dec 2016 10:01:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVA1PiD012648; Sat, 31 Dec 2016 10:01:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVA1P8Y012647; Sat, 31 Dec 2016 10:01:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311001.uBVA1P8Y012647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310894 - head/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:01:26 -0000 Author: ngie Date: Sat Dec 31 10:01:25 2016 New Revision: 310894 URL: https://svnweb.freebsd.org/changeset/base/310894 Log: snmp_pdu_free the right object at the right time in snmptool_walk r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the process. - Call snmp_pdu_free on req before calling snmp_pdu_create on it at the bottom of the outer while loop - Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create in the inner loop MFC after: 12 days X-MFC with: r310729, r310892 Reported by: valgrind Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Sat Dec 31 09:52:00 2016 (r310893) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Sat Dec 31 10:01:25 2016 (r310894) @@ -422,6 +422,7 @@ snmptool_get(struct snmp_toolinfo *snmpt snmp_pdu_create(&req, GET_PDUTYPE(snmptoolctx)); } + snmp_pdu_free(&req); snmp_pdu_free(&resp); return (0); @@ -507,6 +508,7 @@ snmptool_walk(struct snmp_toolinfo *snmp if (op == SNMP_PDU_GETBULK) snmpget_fix_getbulk(&req, GET_MAXREP(snmptoolctx), GET_NONREP(snmptoolctx)); + snmp_pdu_free(&resp); } /* Just in case our root was a leaf. */ @@ -517,6 +519,7 @@ snmptool_walk(struct snmp_toolinfo *snmp snmp_output_err_resp(snmptoolctx, &resp); else snmp_output_resp(snmptoolctx, &(resp), NULL); + snmp_pdu_free(&resp); } else warn("Snmp dialog"); } @@ -526,11 +529,13 @@ snmptool_walk(struct snmp_toolinfo *snmp break; } - snmp_pdu_free(&resp); - + snmp_pdu_free(&req); snmp_pdu_create(&req, op); } + snmp_pdu_free(&req); + snmp_pdu_free(&resp); + if (rc == 0) return (0); else From owner-svn-src-all@freebsd.org Sat Dec 31 10:08:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01755C96287; Sat, 31 Dec 2016 10:08:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7B491E97; Sat, 31 Dec 2016 10:08:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVA8iZO015007; Sat, 31 Dec 2016 10:08:44 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVA8i9o015006; Sat, 31 Dec 2016 10:08:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612311008.uBVA8i9o015006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 31 Dec 2016 10:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310895 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:08:46 -0000 Author: tuexen Date: Sat Dec 31 10:08:44 2016 New Revision: 310895 URL: https://svnweb.freebsd.org/changeset/base/310895 Log: MFC r310642: Consistent handling of errors reported from the lower layer. Modified: stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Dec 31 10:01:25 2016 (r310894) +++ stable/11/sys/netinet/sctp_output.c Sat Dec 31 10:08:44 2016 (r310895) @@ -4678,7 +4678,7 @@ sctp_send_initiate(struct sctp_inpcb *in struct sctp_supported_chunk_types_param *pr_supported; struct sctp_paramhdr *ph; int cnt_inits_to = 0; - int ret; + int error; uint16_t num_ext, chunk_len, padding_len, parameter_len; /* INIT's always go to the primary (and usually ONLY address) */ @@ -4927,14 +4927,21 @@ sctp_send_initiate(struct sctp_inpcb *in } } SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - calls lowlevel_output\n"); - ret = sctp_lowlevel_chunk_output(inp, stcb, net, + if ((error = sctp_lowlevel_chunk_output(inp, stcb, net, (struct sockaddr *)&net->ro._l_addr, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, stcb->rport, htonl(0), net->port, NULL, 0, 0, - so_locked); - SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret); + so_locked))) { + SCTPDBG(SCTP_DEBUG_OUTPUT4, "Gak send error %d\n", error); + if (error == ENOBUFS) { + stcb->asoc.ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + stcb->asoc.ifp_had_enobuf = 0; + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); } @@ -5502,6 +5509,7 @@ sctp_send_initiate_ack(struct sctp_inpcb uint16_t his_limit, i_want; int abort_flag; int nat_friendly = 0; + int error; struct socket *so; uint16_t num_ext, chunk_len, padding_len, parameter_len; @@ -6116,12 +6124,24 @@ do_a_abort: over_addr = NULL; } - (void)sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, + if ((error = sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, sh->src_port, init_chk->init.initiate_tag, port, over_addr, mflowtype, mflowid, - SCTP_SO_NOT_LOCKED); + SCTP_SO_NOT_LOCKED))) { + SCTPDBG(SCTP_DEBUG_OUTPUT4, "Gak send error %d\n", error); + if (error == ENOBUFS) { + if (asoc != NULL) { + asoc->ifp_had_enobuf = 1; + } + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + if (asoc != NULL) { + asoc->ifp_had_enobuf = 0; + } + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -8821,8 +8841,8 @@ no_data_fill: SCTP_STAT_INCR(sctps_lowlevelerrusr); } if (error == ENOBUFS) { - SCTP_STAT_INCR(sctps_lowlevelerr); asoc->ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); } if (error == EHOSTUNREACH) { /* @@ -9509,8 +9529,14 @@ sctp_chunk_retransmission(struct sctp_in chk->whoTo->port, NULL, 0, 0, so_locked))) { - SCTP_STAT_INCR(sctps_lowlevelerr); + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + asoc->ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } return (error); + } else { + asoc->ifp_had_enobuf = 0; } endofchain = NULL; auth = NULL; @@ -9781,8 +9807,14 @@ one_chunk_around: 0, 0, so_locked))) { /* error, we could not output */ - SCTP_STAT_INCR(sctps_lowlevelerr); + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + asoc->ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } return (error); + } else { + asoc->ifp_had_enobuf = 0; } endofchain = NULL; auth = NULL; @@ -10872,6 +10904,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc struct sctp_nets *net; uint32_t vtag; uint32_t auth_offset = 0; + int error; uint16_t cause_len, chunk_len, padding_len; SCTP_TCB_LOCK_ASSERT(stcb); @@ -10943,13 +10976,21 @@ sctp_send_abort_tcb(struct sctp_tcb *stc return; } } - (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, + if ((error = sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), stcb->asoc.primary_destination->port, NULL, 0, 0, - so_locked); + so_locked))) { + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + stcb->asoc.ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + stcb->asoc.ifp_had_enobuf = 0; + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -10962,6 +11003,7 @@ sctp_send_shutdown_complete(struct sctp_ struct mbuf *m_shutdown_comp; struct sctp_shutdown_complete_chunk *shutdown_complete; uint32_t vtag; + int error; uint8_t flags; m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); @@ -10981,14 +11023,22 @@ sctp_send_shutdown_complete(struct sctp_ shutdown_complete->ch.chunk_flags = flags; shutdown_complete->ch.chunk_length = htons(sizeof(struct sctp_shutdown_complete_chunk)); SCTP_BUF_LEN(m_shutdown_comp) = sizeof(struct sctp_shutdown_complete_chunk); - (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, + if ((error = sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_shutdown_comp, 0, NULL, 0, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), net->port, NULL, 0, 0, - SCTP_SO_NOT_LOCKED); + SCTP_SO_NOT_LOCKED))) { + SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error); + if (error == ENOBUFS) { + stcb->asoc.ifp_had_enobuf = 1; + SCTP_STAT_INCR(sctps_lowlevelerr); + } + } else { + stcb->asoc.ifp_had_enobuf = 0; + } SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; } From owner-svn-src-all@freebsd.org Sat Dec 31 10:23:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B544AC96673; Sat, 31 Dec 2016 10:23:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C7B2161B; Sat, 31 Dec 2016 10:23:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVANqs2023121; Sat, 31 Dec 2016 10:23:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVANqWt023119; Sat, 31 Dec 2016 10:23:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311023.uBVANqWt023119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310896 - in stable/11: tools/build/mk usr.sbin/bsnmpd/bsnmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:23:53 -0000 Author: ngie Date: Sat Dec 31 10:23:52 2016 New Revision: 310896 URL: https://svnweb.freebsd.org/changeset/base/310896 Log: MFC r310654: Install snmpmod.3 as all of the bsnmpd APIs it documents Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc stable/11/usr.sbin/bsnmpd/bsnmpd/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:08:44 2016 (r310895) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:23:52 2016 (r310896) @@ -786,22 +786,119 @@ OLD_FILES+=usr/share/man/man1/bsnmpget.1 OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz OLD_FILES+=usr/share/man/man1/bsnmpwalk.1.gz OLD_FILES+=usr/share/man/man1/gensnmptree.1.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK_INDEX.3.gz OLD_FILES+=usr/share/man/man3/asn1.3.gz OLD_FILES+=usr/share/man/man3/bsnmpagent.3.gz OLD_FILES+=usr/share/man/man3/bsnmpclient.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_get_target_stats.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_get_usm_stats.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_reset_usm_stats.3.gz OLD_FILES+=usr/share/man/man3/bsnmplib.3.gz +OLD_FILES+=usr/share/man/man3/buf_alloc.3.gz +OLD_FILES+=usr/share/man/man3/buf_size.3.gz +OLD_FILES+=usr/share/man/man3/comm_define.3.gz +OLD_FILES+=usr/share/man/man3/community.3.gz +OLD_FILES+=usr/share/man/man3/fd_deselect.3.gz +OLD_FILES+=usr/share/man/man3/fd_resume.3.gz +OLD_FILES+=usr/share/man/man3/fd_select.3.gz +OLD_FILES+=usr/share/man/man3/fd_suspend.3.gz +OLD_FILES+=usr/share/man/man3/get_ticks.3.gz +OLD_FILES+=usr/share/man/man3/index_append.3.gz +OLD_FILES+=usr/share/man/man3/index_append_off.3.gz +OLD_FILES+=usr/share/man/man3/index_compare.3.gz +OLD_FILES+=usr/share/man/man3/index_compare_off.3.gz +OLD_FILES+=usr/share/man/man3/index_decode.3.gz +OLD_FILES+=usr/share/man/man3/ip_commit.3.gz +OLD_FILES+=usr/share/man/man3/ip_get.3.gz +OLD_FILES+=usr/share/man/man3/ip_rollback.3.gz +OLD_FILES+=usr/share/man/man3/ip_save.3.gz +OLD_FILES+=usr/share/man/man3/or_register.3.gz +OLD_FILES+=usr/share/man/man3/or_unregister.3.gz +OLD_FILES+=usr/share/man/man3/oid_commit.3.gz +OLD_FILES+=usr/share/man/man3/oid_get.3.gz +OLD_FILES+=usr/share/man/man3/oid_rollback.3.gz +OLD_FILES+=usr/share/man/man3/oid_save.3.gz +OLD_FILES+=usr/share/man/man3/oid_usmNotInTimeWindows.3.gz +OLD_FILES+=usr/share/man/man3/oid_usmUnknownEngineIDs.3.gz +OLD_FILES+=usr/share/man/man3/oid_zeroDotZero.3.gz +OLD_FILES+=usr/share/man/man3/reqid_allocate.3.gz +OLD_FILES+=usr/share/man/man3/reqid_base.3.gz +OLD_FILES+=usr/share/man/man3/reqid_istype.3.gz +OLD_FILES+=usr/share/man/man3/reqid_next.3.gz +OLD_FILES+=usr/share/man/man3/reqid_type.3.gz OLD_FILES+=usr/share/man/man3/snmp_atm.3.gz OLD_FILES+=usr/share/man/man3/snmp_bridge.3.gz OLD_FILES+=usr/share/man/man3/snmp_hast.3.gz OLD_FILES+=usr/share/man/man3/snmp_hostres.3.gz +OLD_FILES+=usr/share/man/man3/snmp_input_finish.3.gz +OLD_FILES+=usr/share/man/man3/snmp_input_start.3.gz OLD_FILES+=usr/share/man/man3/snmp_lm75.3.gz OLD_FILES+=usr/share/man/man3/snmp_mibII.3.gz OLD_FILES+=usr/share/man/man3/snmp_netgraph.3.gz +OLD_FILES+=usr/share/man/man3/snmp_output.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_auth_access.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_port.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_trap.3.gz OLD_FILES+=usr/share/man/man3/snmp_target.3.gz OLD_FILES+=usr/share/man/man3/snmp_usm.3.gz OLD_FILES+=usr/share/man/man3/snmp_vacm.3.gz OLD_FILES+=usr/share/man/man3/snmp_wlan.3.gz +OLD_FILES+=usr/share/man/man3/snmpd_target_stat.3.gz +OLD_FILES+=usr/share/man/man3/snmpd_usmstats.3.gz OLD_FILES+=usr/share/man/man3/snmpmod.3.gz +OLD_FILES+=usr/share/man/man3/start_tick.3.gz +OLD_FILES+=usr/share/man/man3/string_commit.3.gz +OLD_FILES+=usr/share/man/man3/string_free.3.gz +OLD_FILES+=usr/share/man/man3/string_get.3.gz +OLD_FILES+=usr/share/man/man3/string_get_max.3.gz +OLD_FILES+=usr/share/man/man3/string_rollback.3.gz +OLD_FILES+=usr/share/man/man3/string_save.3.gz +OLD_FILES+=usr/share/man/man3/systemg.3.gz +OLD_FILES+=usr/share/man/man3/this_tick.3.gz +OLD_FILES+=usr/share/man/man3/timer_start.3.gz +OLD_FILES+=usr/share/man/man3/timer_start_repeat.3.gz +OLD_FILES+=usr/share/man/man3/timer_stop.3.gz +OLD_FILES+=usr/share/man/man3/target_activate_address.3.gz +OLD_FILES+=usr/share/man/man3/target_address.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_address.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_param.3.gz +OLD_FILES+=usr/share/man/man3/target_first_address.3.gz +OLD_FILES+=usr/share/man/man3/target_first_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_first_param.3.gz +OLD_FILES+=usr/share/man/man3/target_flush_all.3.gz +OLD_FILES+=usr/share/man/man3/target_next_address.3.gz +OLD_FILES+=usr/share/man/man3/target_next_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_next_param.3.gz +OLD_FILES+=usr/share/man/man3/target_new_address.3.gz +OLD_FILES+=usr/share/man/man3/target_new_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_new_param.3.gz +OLD_FILES+=usr/share/man/man3/target_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_param.3.gz +OLD_FILES+=usr/share/man/man3/usm_delete_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_find_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_first_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_flush_users.3.gz +OLD_FILES+=usr/share/man/man3/usm_next_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_new_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_user.3.gz OLD_FILES+=usr/share/snmp/defs/atm_freebsd.def OLD_FILES+=usr/share/snmp/defs/atm_tree.def OLD_FILES+=usr/share/snmp/defs/bridge_tree.def Modified: stable/11/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Dec 31 10:08:44 2016 (r310895) +++ stable/11/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Dec 31 10:23:52 2016 (r310896) @@ -15,8 +15,107 @@ XSYM= snmpMIB begemotSnmpdModuleTable be begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable \ freeBSD freeBSDVersion CLEANFILES= oid.h tree.c tree.h + MAN= bsnmpd.1 snmpmod.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 bsnmpd_get_target_stats.3 +MLINKS+= snmpmod.3 bsnmpd_get_usm_stats.3 +MLINKS+= snmpmod.3 bsnmpd_reset_usm_stats.3 +MLINKS+= snmpmod.3 buf_alloc.3 +MLINKS+= snmpmod.3 buf_size.3 +MLINKS+= snmpmod.3 comm_define.3 +MLINKS+= snmpmod.3 community.3 +MLINKS+= snmpmod.3 fd_deselect.3 +MLINKS+= snmpmod.3 fd_resume.3 +MLINKS+= snmpmod.3 fd_select.3 +MLINKS+= snmpmod.3 fd_suspend.3 +MLINKS+= snmpmod.3 get_ticks.3 +MLINKS+= snmpmod.3 index_append.3 +MLINKS+= snmpmod.3 index_append_off.3 +MLINKS+= snmpmod.3 index_compare.3 +MLINKS+= snmpmod.3 index_compare_off.3 +MLINKS+= snmpmod.3 index_decode.3 +MLINKS+= snmpmod.3 ip_commit.3 +MLINKS+= snmpmod.3 ip_get.3 +MLINKS+= snmpmod.3 ip_rollback.3 +MLINKS+= snmpmod.3 ip_save.3 +MLINKS+= snmpmod.3 or_register.3 +MLINKS+= snmpmod.3 or_unregister.3 +MLINKS+= snmpmod.3 oid_commit.3 +MLINKS+= snmpmod.3 oid_get.3 +MLINKS+= snmpmod.3 oid_rollback.3 +MLINKS+= snmpmod.3 oid_save.3 +MLINKS+= snmpmod.3 oid_usmNotInTimeWindows.3 +MLINKS+= snmpmod.3 oid_usmUnknownEngineIDs.3 +MLINKS+= snmpmod.3 oid_zeroDotZero.3 +MLINKS+= snmpmod.3 reqid_allocate.3 +MLINKS+= snmpmod.3 reqid_base.3 +MLINKS+= snmpmod.3 reqid_istype.3 +MLINKS+= snmpmod.3 reqid_next.3 +MLINKS+= snmpmod.3 reqid_type.3 +MLINKS+= snmpmod.3 snmp_input_finish.3 +MLINKS+= snmpmod.3 snmp_input_start.3 +MLINKS+= snmpmod.3 snmp_output.3 +MLINKS+= snmpmod.3 snmp_pdu_auth_access.3 +MLINKS+= snmpmod.3 snmp_send_port.3 +MLINKS+= snmpmod.3 snmp_send_trap.3 +MLINKS+= snmpmod.3 snmpd_target_stat.3 +MLINKS+= snmpmod.3 snmpd_usmstats.3 +MLINKS+= snmpmod.3 start_tick.3 +MLINKS+= snmpmod.3 string_commit.3 +MLINKS+= snmpmod.3 string_free.3 +MLINKS+= snmpmod.3 string_get.3 +MLINKS+= snmpmod.3 string_get_max.3 +MLINKS+= snmpmod.3 string_rollback.3 +MLINKS+= snmpmod.3 string_save.3 +MLINKS+= snmpmod.3 systemg.3 +MLINKS+= snmpmod.3 this_tick.3 +MLINKS+= snmpmod.3 timer_start.3 +MLINKS+= snmpmod.3 timer_start_repeat.3 +MLINKS+= snmpmod.3 timer_stop.3 +MLINKS+= snmpmod.3 target_activate_address.3 +MLINKS+= snmpmod.3 target_address.3 +MLINKS+= snmpmod.3 target_delete_address.3 +MLINKS+= snmpmod.3 target_delete_notify.3 +MLINKS+= snmpmod.3 target_delete_param.3 +MLINKS+= snmpmod.3 target_first_address.3 +MLINKS+= snmpmod.3 target_first_notify.3 +MLINKS+= snmpmod.3 target_first_param.3 +MLINKS+= snmpmod.3 target_flush_all.3 +MLINKS+= snmpmod.3 target_next_address.3 +MLINKS+= snmpmod.3 target_next_notify.3 +MLINKS+= snmpmod.3 target_next_param.3 +MLINKS+= snmpmod.3 target_new_address.3 +MLINKS+= snmpmod.3 target_new_notify.3 +MLINKS+= snmpmod.3 target_new_param.3 +MLINKS+= snmpmod.3 target_notify.3 +MLINKS+= snmpmod.3 target_param.3 +MLINKS+= snmpmod.3 usm_delete_user.3 +MLINKS+= snmpmod.3 usm_find_user.3 +MLINKS+= snmpmod.3 usm_first_user.3 +MLINKS+= snmpmod.3 usm_flush_users.3 +MLINKS+= snmpmod.3 usm_next_user.3 +MLINKS+= snmpmod.3 usm_new_user.3 +MLINKS+= snmpmod.3 usm_user.3 + FILESGROUPS= BMIBS DEFS BMIBS= FOKUS-MIB.txt BEGEMOT-MIB.txt BEGEMOT-SNMPD.txt From owner-svn-src-all@freebsd.org Sat Dec 31 10:25:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 901B8C967E1; Sat, 31 Dec 2016 10:25:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A54318FC; Sat, 31 Dec 2016 10:25:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAPt3G023413; Sat, 31 Dec 2016 10:25:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAPt3m023411; Sat, 31 Dec 2016 10:25:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311025.uBVAPt3m023411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310897 - in stable/11: lib/libbsnmp/libbsnmp tools/build/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:25:56 -0000 Author: ngie Date: Sat Dec 31 10:25:55 2016 New Revision: 310897 URL: https://svnweb.freebsd.org/changeset/base/310897 Log: MFC r310728: Install {asn1,bsnmpagent,bsnmpclient,bsnmplib}.3 as all of the APIs they document Also, alphabetically sort MAN Modified: stable/11/lib/libbsnmp/libbsnmp/Makefile stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- stable/11/lib/libbsnmp/libbsnmp/Makefile Sat Dec 31 10:23:52 2016 (r310896) +++ stable/11/lib/libbsnmp/libbsnmp/Makefile Sat Dec 31 10:25:55 2016 (r310897) @@ -20,7 +20,97 @@ LIBADD= crypto .endif SRCS= asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c -INCS= asn1.h snmp.h snmpagent.h snmpclient.h -MAN= asn1.3 bsnmplib.3 bsnmpclient.3 bsnmpagent.3 +INCS= asn1.h snmp.h snmpagent.h snmpclient.h +MAN= asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3 + +MLINKS+= asn1.3 asn_append_oid.3 +MLINKS+= asn1.3 asn_commit_header.3 +MLINKS+= asn1.3 asn_compare_oid.3 +MLINKS+= asn1.3 asn_get_counter64_raw.3 +MLINKS+= asn1.3 asn_get_header.3 +MLINKS+= asn1.3 asn_get_integer.3 +MLINKS+= asn1.3 asn_get_integer_raw.3 +MLINKS+= asn1.3 asn_get_ipaddress.3 +MLINKS+= asn1.3 asn_get_ipaddress_raw.3 +MLINKS+= asn1.3 asn_get_null.3 +MLINKS+= asn1.3 asn_get_null_raw.3 +MLINKS+= asn1.3 asn_get_objid.3 +MLINKS+= asn1.3 asn_get_objid_raw.3 +MLINKS+= asn1.3 asn_get_octetstring.3 +MLINKS+= asn1.3 asn_get_octetstring_raw.3 +MLINKS+= asn1.3 asn_get_sequence.3 +MLINKS+= asn1.3 asn_get_timeticks.3 +MLINKS+= asn1.3 asn_get_uint32_raw.3 +MLINKS+= asn1.3 asn_is_suboid.3 +MLINKS+= asn1.3 asn_oid2str.3 +MLINKS+= asn1.3 asn_oid2str_r.3 +MLINKS+= asn1.3 asn_put_counter64.3 +MLINKS+= asn1.3 asn_put_exception.3 +MLINKS+= asn1.3 asn_put_header.3 +MLINKS+= asn1.3 asn_put_integer.3 +MLINKS+= asn1.3 asn_put_ipaddress.3 +MLINKS+= asn1.3 asn_put_null.3 +MLINKS+= asn1.3 asn_put_objid.3 +MLINKS+= asn1.3 asn_put_octetstring.3 +MLINKS+= asn1.3 asn_put_temp_header.3 +MLINKS+= asn1.3 asn_put_timeticks.3 +MLINKS+= asn1.3 asn_put_uint32.3 +MLINKS+= asn1.3 asn_skip.3 +MLINKS+= asn1.3 asn_slice_oid.3 + +MLINKS+= bsnmpagent.3 snmp_debug.3 +MLINKS+= bsnmpagent.3 snmp_dep_commit.3 +MLINKS+= bsnmpagent.3 snmp_dep_finish.3 +MLINKS+= bsnmpagent.3 snmp_dep_lookup.3 +MLINKS+= bsnmpagent.3 snmp_dep_rollback.3 +MLINKS+= bsnmpagent.3 snmp_depop_t.3 +MLINKS+= bsnmpagent.3 snmp_get.3 +MLINKS+= bsnmpagent.3 snmp_getbulk.3 +MLINKS+= bsnmpagent.3 snmp_getnext.3 +MLINKS+= bsnmpagent.3 snmp_init_context.3 +MLINKS+= bsnmpagent.3 snmp_make_errresp.3 +MLINKS+= bsnmpagent.3 snmp_op_t.3 +MLINKS+= bsnmpagent.3 snmp_set.3 +MLINKS+= bsnmpagent.3 snmp_trace.3 +MLINKS+= bsnmpagent.3 tree.3 +MLINKS+= bsnmpagent.3 tree_size.3 + +MLINKS+= bsnmpclient.3 snmp_add_binding.3 +MLINKS+= bsnmpclient.3 snmp_client.3 +MLINKS+= bsnmpclient.3 snmp_close.3 +MLINKS+= bsnmpclient.3 snmp_dialog.3 +MLINKS+= bsnmpclient.3 snmp_discover_engine.3 +MLINKS+= bsnmpclient.3 snmp_oid_append.3 +MLINKS+= bsnmpclient.3 snmp_open.3 +MLINKS+= bsnmpclient.3 snmp_parse_server.3 +MLINKS+= bsnmpclient.3 snmp_pdu_check.3 +MLINKS+= bsnmpclient.3 snmp_pdu_create.3 +MLINKS+= bsnmpclient.3 snmp_pdu_send.3 +MLINKS+= bsnmpclient.3 snmp_receive.3 +MLINKS+= bsnmpclient.3 snmp_send_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_table_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_table_fetch.3 +MLINKS+= bsnmpclient.3 snmp_table_fetch_async.3 +MLINKS+= bsnmpclient.3 snmp_timeout_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_timeout_start_f.3 +MLINKS+= bsnmpclient.3 snmp_timeout_stop_f.3 + +MLINKS+= bsnmplib.3 TRUTH_GET.3 +MLINKS+= bsnmplib.3 TRUTH_MK.3 +MLINKS+= bsnmplib.3 TRUTH_OK.3 +MLINKS+= bsnmplib.3 snmp_calc_keychange.3 +MLINKS+= bsnmplib.3 snmp_get_local_keys.3 +MLINKS+= bsnmplib.3 snmp_passwd_to_keys.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_header.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_scoped.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_secmode.3 +MLINKS+= bsnmplib.3 snmp_pdu_dump.3 +MLINKS+= bsnmplib.3 snmp_pdu_encode.3 +MLINKS+= bsnmplib.3 snmp_pdu_free.3 +MLINKS+= bsnmplib.3 snmp_pdu_init_secparams.3 +MLINKS+= bsnmplib.3 snmp_value_copy.3 +MLINKS+= bsnmplib.3 snmp_value_free.3 +MLINKS+= bsnmplib.3 snmp_value_parse.3 .include Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:23:52 2016 (r310896) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:25:55 2016 (r310897) @@ -786,6 +786,95 @@ OLD_FILES+=usr/share/man/man1/bsnmpget.1 OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz OLD_FILES+=usr/share/man/man1/bsnmpwalk.1.gz OLD_FILES+=usr/share/man/man1/gensnmptree.1.gz +# lib/libbsnmp/libbsnmp +OLD_FILES+=usr/share/man/man3/TRUTH_GET.3.gz +OLD_FILES+=usr/share/man/man3/TRUTH_MK.3.gz +OLD_FILES+=usr/share/man/man3/TRUTH_OK.3.gz +OLD_FILES+=usr/share/man/man3/asn1.3.gz +OLD_FILES+=usr/share/man/man3/asn_append_oid.3.gz +OLD_FILES+=usr/share/man/man3/asn_commit_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_compare_oid.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_counter64_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_integer.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_integer_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_ipaddress.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_ipaddress_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_null.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_null_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_objid.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_objid_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_octetstring.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_octetstring_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_sequence.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_timeticks.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_uint32_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_is_suboid.3.gz +OLD_FILES+=usr/share/man/man3/asn_oid2str.3.gz +OLD_FILES+=usr/share/man/man3/asn_oid2str_r.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_counter64.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_exception.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_integer.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_ipaddress.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_null.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_objid.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_octetstring.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_temp_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_timeticks.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_uint32.3.gz +OLD_FILES+=usr/share/man/man3/asn_skip.3.gz +OLD_FILES+=usr/share/man/man3/asn_slice_oid.3.gz +OLD_FILES+=usr/share/man/man3/snmp_add_binding.3.gz +OLD_FILES+=usr/share/man/man3/snmp_calc_keychange.3.gz +OLD_FILES+=usr/share/man/man3/snmp_client.3.gz +OLD_FILES+=usr/share/man/man3/snmp_close.3.gz +OLD_FILES+=usr/share/man/man3/snmp_debug.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_commit.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_finish.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_lookup.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_rollback.3.gz +OLD_FILES+=usr/share/man/man3/snmp_depop_t.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dialog.3.gz +OLD_FILES+=usr/share/man/man3/snmp_discover_engine.3.gz +OLD_FILES+=usr/share/man/man3/snmp_get.3.gz +OLD_FILES+=usr/share/man/man3/snmp_get_local_keys.3.gz +OLD_FILES+=usr/share/man/man3/snmp_getbulk.3.gz +OLD_FILES+=usr/share/man/man3/snmp_getnext.3.gz +OLD_FILES+=usr/share/man/man3/snmp_init_context.3.gz +OLD_FILES+=usr/share/man/man3/snmp_make_errresp.3.gz +OLD_FILES+=usr/share/man/man3/snmp_oid_append.3.gz +OLD_FILES+=usr/share/man/man3/snmp_op_t.3.gz +OLD_FILES+=usr/share/man/man3/snmp_open.3.gz +OLD_FILES+=usr/share/man/man3/snmp_parse_server.3.gz +OLD_FILES+=usr/share/man/man3/snmp_passwd_to_keys.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_check.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_create.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_header.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_scoped.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_secmode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_dump.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_encode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_free.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_init_secparams.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_send.3.gz +OLD_FILES+=usr/share/man/man3/snmp_receive.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_set.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_fetch.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_fetch_async.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_start_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_stop_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_trace.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_copy.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_free.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_parse.3.gz +OLD_FILES+=usr/share/man/man3/tree.3.gz +OLD_FILES+=usr/share/man/man3/tree_size.3.gz +# usr.sbin/bsnmpd/bsnmpd OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT.3.gz OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK.3.gz OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK_INDEX.3.gz From owner-svn-src-all@freebsd.org Sat Dec 31 10:27:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8757DC96923; Sat, 31 Dec 2016 10:27:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 569491AFD; Sat, 31 Dec 2016 10:27:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVARAKS023529; Sat, 31 Dec 2016 10:27:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVARAsv023528; Sat, 31 Dec 2016 10:27:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311027.uBVARAsv023528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310898 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:27:11 -0000 Author: ngie Date: Sat Dec 31 10:27:10 2016 New Revision: 310898 URL: https://svnweb.freebsd.org/changeset/base/310898 Log: MFC r310662: style(9): snmp_send_packet(..): fix whitespace Modified: stable/11/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:25:55 2016 (r310897) +++ stable/11/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:27:10 2016 (r310898) @@ -1227,9 +1227,9 @@ snmp_next_reqid(struct snmp_client * c) static int32_t snmp_send_packet(struct snmp_pdu * pdu) { - u_char *buf; - struct asn_buf b; - ssize_t ret; + u_char *buf; + struct asn_buf b; + ssize_t ret; if ((buf = malloc(snmp_client.txbuflen)) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); From owner-svn-src-all@freebsd.org Sat Dec 31 10:29:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AE96C969D5; Sat, 31 Dec 2016 10:29:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B90D1CA5; Sat, 31 Dec 2016 10:29:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAT0Uj023672; Sat, 31 Dec 2016 10:29:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVASxmn023661; Sat, 31 Dec 2016 10:28:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311028.uBVASxmn023661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310899 - stable/11/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:29:01 -0000 Author: ngie Date: Sat Dec 31 10:28:59 2016 New Revision: 310899 URL: https://svnweb.freebsd.org/changeset/base/310899 Log: MFC r310666,r310675: r310666: style(9) fixes - Clean up trailing whitespace - Fix variable type alignment in storage_OS_get_swap(..) r310675: Fix the build by moving the initializers for len/nswapdev down below the declarations Pointyhat to: ngie Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -123,7 +123,7 @@ device_entry_create(const char *name, co if (map == NULL) { /* new object - get a new index */ if (next_device_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrDeviceTable index wrap", __func__); /* There isn't much we can do here. * If the next_swins_index is consumed Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -131,7 +131,7 @@ static const struct { const struct asn_oid *oid; /* the OID to return */ } fs_type_map[] = { { "ufs", &OIDX_hrFSBerkeleyFFS_c }, - { "zfs", &OIDX_hrFSOther_c }, + { "zfs", &OIDX_hrFSOther_c }, { "cd9660", &OIDX_hrFSiso9660_c }, { "nfs", &OIDX_hrFSNFS_c }, { "ext2fs", &OIDX_hrFSLinuxExt2_c }, @@ -167,7 +167,7 @@ fs_entry_create(const char *name) /* new object - get a new index */ if (next_fs_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); + syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); errx(EX_SOFTWARE, "hrFSTable index wrap"); } Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -177,7 +177,7 @@ partition_entry_create(int32_t ds_index, if (next_partition_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrPartitionTable index wrap", + syslog(LOG_ERR, "%s: hrPartitionTable index wrap", __func__); errx(EX_SOFTWARE, "hrPartitionTable index wrap"); } Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Sat Dec 31 10:28:59 2016 (r310899) @@ -193,7 +193,7 @@ OS_getSystemInitialLoadParameters(u_char syslog(LOG_ERR, "malloc failed"); return (SNMP_ERR_GENERR); } - if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { + if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { syslog(LOG_ERR, "sysctl({CTL_KERN,KERN_BOOTFILE}) failed: %m"); free(buf); @@ -296,7 +296,7 @@ OS_getMemorySize(uint32_t *ms) *ms = UINT32_MAX; else *ms = phys_mem_size; - return (SNMP_ERR_NOERROR); + return (SNMP_ERR_NOERROR); } /* @@ -360,7 +360,7 @@ OS_setSystemDate(const struct timeval *t if (settimeofday(timeval_to_set, NULL) == -1) { syslog(LOG_ERR, "settimeofday failed: %m"); return (SNMP_ERR_GENERR); - } + } return (SNMP_ERR_NOERROR); } @@ -378,7 +378,7 @@ op_hrSystem(struct snmp_context *ctx, st switch (curr_op) { - case SNMP_OP_GET: + case SNMP_OP_GET: switch (value->var.subs[sub - 1]) { case LEAF_hrSystemUptime: Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Dec 31 10:28:59 2016 (r310899) @@ -163,7 +163,7 @@ hostres_start(void) start_processor_tbl(hostres_module); start_network_tbl(); - HRDBG("done."); + HRDBG("done."); } /* this identifies the HOST RESOURCES mib module */ @@ -175,8 +175,8 @@ const struct snmp_module config = { NULL, NULL, hostres_start, - NULL, /* proxy a PDU */ - hostres_ctree, /* see the generated hostres_tree.h */ + NULL, /* proxy a PDU */ + hostres_ctree, /* see the generated hostres_tree.h */ hostres_CTREE_SIZE, /* see the generated hostres_tree.h */ NULL }; Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -153,7 +153,7 @@ storage_entry_create(const char *name) if (map == NULL) { /* new object - get a new index */ if (next_storage_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrStorageTable index wrap", __func__); errx(EX_SOFTWARE, "hrStorageTable index wrap"); } @@ -188,7 +188,7 @@ storage_entry_create(const char *name) syslog(LOG_WARNING, "%s: %m", __func__); return (NULL); } - memset(entry, 0, sizeof(*entry)); + memset(entry, 0, sizeof(*entry)); entry->index = map->hrIndex; @@ -374,10 +374,13 @@ storage_OS_get_memstat(void) static void storage_OS_get_swap(void) { - int nswapdev = 0; - size_t len = sizeof(nswapdev); struct storage_entry *entry; char swap_w_prefix[SE_DESC_MLEN]; + size_t len; + int nswapdev; + + len = sizeof(nswapdev); + nswapdev = 0; if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) { syslog(LOG_ERR, Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -50,7 +50,7 @@ #include "hostres_oid.h" #include "hostres_tree.h" -#define CONTENTS_FNAME "+CONTENTS" +#define CONTENTS_FNAME "+CONTENTS" enum SWInstalledType { SWI_UNKNOWN = 1, @@ -136,7 +136,7 @@ swins_entry_create(const char *name) size_t name_len; /* new object - get a new index */ if (next_swins_index > INT_MAX) { - syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", + syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", __func__ ); /* There isn't much we can do here. * If the next_swins_index is consumed @@ -292,7 +292,7 @@ swins_get_packages(void) struct stat sb; DIR *p_dir; struct dirent *ent; - struct tm k_ts; + struct tm k_ts; char *pkg_file; struct swins_entry *entry; int ret = 0; @@ -327,7 +327,7 @@ swins_get_packages(void) return (-1); } - while (errno = 0, (ent = readdir(p_dir)) != NULL) { + while (errno = 0, (ent = readdir(p_dir)) != NULL) { HRDBG(" pkg file: %s", ent->d_name); /* check that the contents file is a regular file */ @@ -371,7 +371,7 @@ swins_get_packages(void) entry->type = (int32_t)SWI_APPLICATION; entry->date_len = make_date_time(entry->date, &k_ts, 0); - } + } if (errno != 0) { syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:" From owner-svn-src-all@freebsd.org Sat Dec 31 10:30:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BEF6C96A76; Sat, 31 Dec 2016 10:30:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E13231E55; Sat, 31 Dec 2016 10:30:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAUvCd023865; Sat, 31 Dec 2016 10:30:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAUuCx023856; Sat, 31 Dec 2016 10:30:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311030.uBVAUuCx023856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:30: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: r310900 - stable/10/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:30:58 -0000 Author: ngie Date: Sat Dec 31 10:30:56 2016 New Revision: 310900 URL: https://svnweb.freebsd.org/changeset/base/310900 Log: MFstable/11 r310899: MFC r310666,r310675: r310666: style(9) fixes - Clean up trailing whitespace - Fix variable type alignment in storage_OS_get_swap(..) r310675: Fix the build by moving the initializers for len/nswapdev down below the declarations Pointyhat to: ngie Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 31 10:28:59 2016 (r310899) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 31 10:30:56 2016 (r310900) @@ -123,7 +123,7 @@ device_entry_create(const char *name, co if (map == NULL) { /* new object - get a new index */ if (next_device_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrDeviceTable index wrap", __func__); /* There isn't much we can do here. * If the next_swins_index is consumed Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 31 10:28:59 2016 (r310899) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 31 10:30:56 2016 (r310900) @@ -131,7 +131,7 @@ static const struct { const struct asn_oid *oid; /* the OID to return */ } fs_type_map[] = { { "ufs", &OIDX_hrFSBerkeleyFFS_c }, - { "zfs", &OIDX_hrFSOther_c }, + { "zfs", &OIDX_hrFSOther_c }, { "cd9660", &OIDX_hrFSiso9660_c }, { "nfs", &OIDX_hrFSNFS_c }, { "ext2fs", &OIDX_hrFSLinuxExt2_c }, @@ -167,7 +167,7 @@ fs_entry_create(const char *name) /* new object - get a new index */ if (next_fs_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); + syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); errx(EX_SOFTWARE, "hrFSTable index wrap"); } Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Sat Dec 31 10:28:59 2016 (r310899) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Sat Dec 31 10:30:56 2016 (r310900) @@ -177,7 +177,7 @@ partition_entry_create(int32_t ds_index, if (next_partition_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrPartitionTable index wrap", + syslog(LOG_ERR, "%s: hrPartitionTable index wrap", __func__); errx(EX_SOFTWARE, "hrPartitionTable index wrap"); } Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Sat Dec 31 10:28:59 2016 (r310899) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Sat Dec 31 10:30:56 2016 (r310900) @@ -193,7 +193,7 @@ OS_getSystemInitialLoadParameters(u_char syslog(LOG_ERR, "malloc failed"); return (SNMP_ERR_GENERR); } - if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { + if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { syslog(LOG_ERR, "sysctl({CTL_KERN,KERN_BOOTFILE}) failed: %m"); free(buf); @@ -296,7 +296,7 @@ OS_getMemorySize(uint32_t *ms) *ms = UINT32_MAX; else *ms = phys_mem_size; - return (SNMP_ERR_NOERROR); + return (SNMP_ERR_NOERROR); } /* @@ -360,7 +360,7 @@ OS_setSystemDate(const struct timeval *t if (settimeofday(timeval_to_set, NULL) == -1) { syslog(LOG_ERR, "settimeofday failed: %m"); return (SNMP_ERR_GENERR); - } + } return (SNMP_ERR_NOERROR); } @@ -378,7 +378,7 @@ op_hrSystem(struct snmp_context *ctx, st switch (curr_op) { - case SNMP_OP_GET: + case SNMP_OP_GET: switch (value->var.subs[sub - 1]) { case LEAF_hrSystemUptime: Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Dec 31 10:28:59 2016 (r310899) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Dec 31 10:30:56 2016 (r310900) @@ -163,7 +163,7 @@ hostres_start(void) start_processor_tbl(hostres_module); start_network_tbl(); - HRDBG("done."); + HRDBG("done."); } /* this identifies the HOST RESOURCES mib module */ @@ -175,8 +175,8 @@ const struct snmp_module config = { NULL, NULL, hostres_start, - NULL, /* proxy a PDU */ - hostres_ctree, /* see the generated hostres_tree.h */ + NULL, /* proxy a PDU */ + hostres_ctree, /* see the generated hostres_tree.h */ hostres_CTREE_SIZE, /* see the generated hostres_tree.h */ NULL }; Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Sat Dec 31 10:28:59 2016 (r310899) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Sat Dec 31 10:30:56 2016 (r310900) @@ -153,7 +153,7 @@ storage_entry_create(const char *name) if (map == NULL) { /* new object - get a new index */ if (next_storage_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrStorageTable index wrap", __func__); errx(EX_SOFTWARE, "hrStorageTable index wrap"); } @@ -188,7 +188,7 @@ storage_entry_create(const char *name) syslog(LOG_WARNING, "%s: %m", __func__); return (NULL); } - memset(entry, 0, sizeof(*entry)); + memset(entry, 0, sizeof(*entry)); entry->index = map->hrIndex; @@ -374,10 +374,13 @@ storage_OS_get_memstat(void) static void storage_OS_get_swap(void) { - int nswapdev = 0; - size_t len = sizeof(nswapdev); struct storage_entry *entry; char swap_w_prefix[SE_DESC_MLEN]; + size_t len; + int nswapdev; + + len = sizeof(nswapdev); + nswapdev = 0; if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) { syslog(LOG_ERR, Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Sat Dec 31 10:28:59 2016 (r310899) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Sat Dec 31 10:30:56 2016 (r310900) @@ -50,7 +50,7 @@ #include "hostres_oid.h" #include "hostres_tree.h" -#define CONTENTS_FNAME "+CONTENTS" +#define CONTENTS_FNAME "+CONTENTS" enum SWInstalledType { SWI_UNKNOWN = 1, @@ -136,7 +136,7 @@ swins_entry_create(const char *name) size_t name_len; /* new object - get a new index */ if (next_swins_index > INT_MAX) { - syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", + syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", __func__ ); /* There isn't much we can do here. * If the next_swins_index is consumed @@ -292,7 +292,7 @@ swins_get_packages(void) struct stat sb; DIR *p_dir; struct dirent *ent; - struct tm k_ts; + struct tm k_ts; char *pkg_file; struct swins_entry *entry; int ret = 0; @@ -327,7 +327,7 @@ swins_get_packages(void) return (-1); } - while (errno = 0, (ent = readdir(p_dir)) != NULL) { + while (errno = 0, (ent = readdir(p_dir)) != NULL) { HRDBG(" pkg file: %s", ent->d_name); /* check that the contents file is a regular file */ @@ -371,7 +371,7 @@ swins_get_packages(void) entry->type = (int32_t)SWI_APPLICATION; entry->date_len = make_date_time(entry->date, &k_ts, 0); - } + } if (errno != 0) { syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:" From owner-svn-src-all@freebsd.org Sat Dec 31 10:32:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D149C96C43; Sat, 31 Dec 2016 10:32:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 434E411D5; Sat, 31 Dec 2016 10:32:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAWrNp027508; Sat, 31 Dec 2016 10:32:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAWnr8027470; Sat, 31 Dec 2016 10:32:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311032.uBVAWnr8027470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310901 - in stable/11: contrib/bsnmp/gensnmpdef contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmp_mibII contrib/bsnmp/snmp_ntp contrib/bsnmp/snmp_target contrib/bsnmp/snmp... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:32:54 -0000 Author: ngie Date: Sat Dec 31 10:32:49 2016 New Revision: 310901 URL: https://svnweb.freebsd.org/changeset/base/310901 Log: MFC r310648: style(9): clean up trailing whitespace Modified: stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1 stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c stable/11/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/11/contrib/bsnmp/gensnmptree/gensnmptree.c stable/11/contrib/bsnmp/lib/asn1.3 stable/11/contrib/bsnmp/lib/asn1.c stable/11/contrib/bsnmp/lib/asn1.h stable/11/contrib/bsnmp/lib/bsnmpagent.3 stable/11/contrib/bsnmp/lib/bsnmpclient.3 stable/11/contrib/bsnmp/lib/bsnmplib.3 stable/11/contrib/bsnmp/lib/snmp.c stable/11/contrib/bsnmp/lib/snmp.h stable/11/contrib/bsnmp/lib/snmpagent.c stable/11/contrib/bsnmp/lib/snmpagent.h stable/11/contrib/bsnmp/lib/snmpclient.c stable/11/contrib/bsnmp/lib/snmpclient.h stable/11/contrib/bsnmp/lib/snmpcrypto.c stable/11/contrib/bsnmp/lib/snmppriv.h stable/11/contrib/bsnmp/lib/support.c stable/11/contrib/bsnmp/lib/support.h stable/11/contrib/bsnmp/snmp_mibII/mibII.c stable/11/contrib/bsnmp/snmp_mibII/mibII.h stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c stable/11/contrib/bsnmp/snmp_mibII/mibII_ifmib.c stable/11/contrib/bsnmp/snmp_mibII/mibII_ifstack.c stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c stable/11/contrib/bsnmp/snmp_mibII/mibII_ip.c stable/11/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c stable/11/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c stable/11/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c stable/11/contrib/bsnmp/snmp_mibII/mibII_route.c stable/11/contrib/bsnmp/snmp_mibII/mibII_tcp.c stable/11/contrib/bsnmp/snmp_mibII/mibII_tree.def stable/11/contrib/bsnmp/snmp_mibII/mibII_udp.c stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.h stable/11/contrib/bsnmp/snmp_ntp/NTP-MIB.txt stable/11/contrib/bsnmp/snmp_ntp/NTP-PROXY-MIB.txt stable/11/contrib/bsnmp/snmp_target/snmp_target.3 stable/11/contrib/bsnmp/snmp_usm/snmp_usm.3 stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c stable/11/contrib/bsnmp/snmp_vacm/snmp_vacm.3 stable/11/contrib/bsnmp/snmp_vacm/vacm_snmp.c stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt stable/11/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt stable/11/contrib/bsnmp/snmpd/action.c stable/11/contrib/bsnmp/snmpd/config.c stable/11/contrib/bsnmp/snmpd/export.c stable/11/contrib/bsnmp/snmpd/main.c stable/11/contrib/bsnmp/snmpd/snmpd.config stable/11/contrib/bsnmp/snmpd/snmpd.h stable/11/contrib/bsnmp/snmpd/snmpd.sh stable/11/contrib/bsnmp/snmpd/snmpmod.3 stable/11/contrib/bsnmp/snmpd/snmpmod.h stable/11/contrib/bsnmp/snmpd/trans_lsock.c stable/11/contrib/bsnmp/snmpd/trans_lsock.h stable/11/contrib/bsnmp/snmpd/trans_udp.c stable/11/contrib/bsnmp/snmpd/trans_udp.h stable/11/contrib/bsnmp/snmpd/trap.c stable/11/contrib/bsnmp/snmpd/tree.def stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt stable/11/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c stable/11/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt stable/11/usr.sbin/bsnmpd/modules/snmp_pf/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c stable/11/usr.sbin/bsnmpd/modules/snmp_target/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_usm/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c stable/11/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h stable/11/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1 ============================================================================== --- stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -13,7 +13,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Dec 31 10:32:49 2016 (r310901) @@ -1,10 +1,10 @@ -/* +/* * Copyright (C) 2004-2006 * Hartmut Brandt. * All rights reserved. - * + * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -233,7 +233,7 @@ print_scalar(SmiNode *n, u_int level) printf(" op_%s", p->name); print_access(n->access); - + printf(")\n"); } @@ -422,7 +422,7 @@ static void print_enum_typedef(SmiType *t) { SmiNamedNumber *nnum; - + for (nnum = smiGetFirstNamedNumber(t); nnum != NULL; nnum = smiGetNextNamedNumber(nnum)) { printf("\t%ld %s\n" , nnum->value.value.integer32, nnum->name); @@ -434,10 +434,10 @@ print_stype(SmiNode *n) { SmiType *type; struct tdef *t = NULL; - + type = smiGetNodeType(n); assert(type != NULL); - + if (type->basetype == SMI_BASETYPE_ENUM) { if (do_typedef == 'e' && type->name != NULL) { SLIST_FOREACH(t, &tdefs, link) { @@ -450,7 +450,7 @@ print_stype(SmiNode *n) printf("typedef %sType ENUM (\n", n->name); else return; - + print_enum_typedef(type); printf(")\n\n"); @@ -476,7 +476,7 @@ static void print_typdefs(SmiNode *n) { SmiNode *p; - + p = n; n = smiGetFirstChildNode(n); while (n != NULL) { Modified: stable/11/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- stable/11/contrib/bsnmp/gensnmptree/gensnmptree.1 Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/gensnmptree/gensnmptree.1 Sat Dec 31 10:32:49 2016 (r310901) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- stable/11/contrib/bsnmp/gensnmptree/gensnmptree.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/gensnmptree/gensnmptree.c Sat Dec 31 10:32:49 2016 (r310901) @@ -8,7 +8,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,7 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -738,7 +738,7 @@ parse_type(enum tok *tok, struct type *t e->value = -(long)val; } else e->value = val; - + if (*tok != TOK_NUM) report("need value for ENUM/BITS"); if (gettoken() != TOK_STR) Modified: stable/11/contrib/bsnmp/lib/asn1.3 ============================================================================== --- stable/11/contrib/bsnmp/lib/asn1.3 Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/asn1.3 Sat Dec 31 10:32:49 2016 (r310901) @@ -5,9 +5,9 @@ .\" Copyright (c) 2001-2003 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. -.\" +.\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/asn1.c ============================================================================== --- stable/11/contrib/bsnmp/lib/asn1.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/asn1.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -285,7 +285,7 @@ asn_put_real_integer(struct asn_buf *b, enum asn_err ret; if (ival < 0) { - /* this may fail if |INT64_MIN| > |INT64_MAX| and + /* this may fail if |INT64_MIN| > |INT64_MAX| and * the value is between * INT64_MIN <= ival < -(INT64_MAX+1) */ val = (uint64_t)-(ival + 1); neg = 1; @@ -890,7 +890,7 @@ asn_slice_oid(struct asn_oid *dest, cons memcpy(dest->subs, &src->subs[from], dest->len * sizeof(dest->subs[0])); } -/* +/* * Append from to to */ void Modified: stable/11/contrib/bsnmp/lib/asn1.h ============================================================================== --- stable/11/contrib/bsnmp/lib/asn1.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/asn1.h Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/bsnmpagent.3 ============================================================================== --- stable/11/contrib/bsnmp/lib/bsnmpagent.3 Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/bsnmpagent.3 Sat Dec 31 10:32:49 2016 (r310901) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/bsnmpclient.3 ============================================================================== --- stable/11/contrib/bsnmp/lib/bsnmpclient.3 Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/bsnmpclient.3 Sat Dec 31 10:32:49 2016 (r310901) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- stable/11/contrib/bsnmp/lib/bsnmplib.3 Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/bsnmplib.3 Sat Dec 31 10:32:49 2016 (r310901) @@ -13,7 +13,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -22,7 +22,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -19,7 +19,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -682,7 +682,7 @@ snmp_pdu_snoop(const struct asn_buf *b0) struct asn_buf b = *b0; /* <0x10|0x20> */ - + if (b.asn_len == 0) return (0); if (b.asn_cptr[0] != (ASN_TYPE_SEQUENCE | ASN_TYPE_CONSTRUCTED)) { @@ -757,7 +757,7 @@ snmp_pdu_encode_header(struct asn_buf *b if (asn_put_temp_header(b, (ASN_TYPE_SEQUENCE | ASN_TYPE_CONSTRUCTED), &v3_hdr_ptr) != ASN_ERR_OK) return (SNMP_CODE_FAILED); - + if (asn_put_integer(b, pdu->identifier) != ASN_ERR_OK) return (SNMP_CODE_FAILED); Modified: stable/11/contrib/bsnmp/lib/snmp.h ============================================================================== --- stable/11/contrib/bsnmp/lib/snmp.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmp.h Sat Dec 31 10:32:49 2016 (r310901) @@ -4,14 +4,14 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Shteryana Sotirova Shopova * under sponsorship from the FreeBSD Foundation. * - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -20,7 +20,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpagent.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmpagent.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -515,7 +515,7 @@ snmp_getbulk(struct snmp_pdu *pdu, struc /* PDU is full */ goto done; - if (cnt == 0) + if (cnt == 0) result = do_getnext(&context, &pdu->bindings[i], &resp->bindings[resp->nbindings], pdu); else @@ -689,7 +689,7 @@ snmp_set(struct snmp_pdu *pdu, struct as if (snmp_pdu_encode_header(resp_b, resp)) return (SNMP_RET_IGN); - /* + /* * 1. Find all nodes, check that they are writeable and * that the syntax is ok, copy over the binding to the response. */ @@ -967,7 +967,7 @@ snmp_dep_lookup(struct snmp_context *ctx /* * Make an error response from a PDU. We do this without decoding the * variable bindings. This means we can sent the junk back to a caller - * that has sent us junk in the first place. + * that has sent us junk in the first place. */ enum snmp_ret snmp_make_errresp(const struct snmp_pdu *pdu, struct asn_buf *pdu_b, Modified: stable/11/contrib/bsnmp/lib/snmpagent.h ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpagent.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmpagent.h Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:32:49 2016 (r310901) @@ -68,7 +68,7 @@ struct snmp_client snmp_client; /* List of all outstanding requests */ -struct sent_pdu { +struct sent_pdu { int reqid; struct snmp_pdu *pdu; struct timeval time; @@ -510,7 +510,7 @@ table_check_response(struct tabwork *wor table_free(work, 1); return (-2); } - + continue; } if (!asn_is_suboid(&work->descr->table, &b->var) || @@ -754,7 +754,7 @@ snmp_oid_append(struct asn_oid *oid, con ret = 0; while (*fmt != '\0') { switch (*fmt++) { - case 'i': + case 'i': /* just an integer more */ if (oid->len + 1 > ASN_MAXOIDLEN) { warnx("%s: OID too long for integer", __func__); @@ -804,7 +804,7 @@ snmp_oid_append(struct asn_oid *oid, con break; case 'b': - /* append `size` characters */ + /* append `size` characters */ str = (const u_char *)va_arg(va, const char *); if (oid->len + size > ASN_MAXOIDLEN) { warnx("%s: OID too long for string", __func__); @@ -852,7 +852,7 @@ snmp_client_init(struct snmp_client *c) strcpy(c->read_community, "public"); strcpy(c->write_community, "private"); - + c->security_model = SNMP_SECMODEL_USM; strcpy(c->cname, ""); @@ -863,7 +863,7 @@ snmp_client_init(struct snmp_client *c) c->txbuflen = c->rxbuflen = 10000; c->fd = -1; - + c->max_reqid = INT32_MAX; c->min_reqid = 0; c->next_reqid = 0; Modified: stable/11/contrib/bsnmp/lib/snmpclient.h ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpclient.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmpclient.h Sat Dec 31 10:32:49 2016 (r310901) @@ -5,7 +5,7 @@ * * Author: Harti Brandt * Kendy Kutzner - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -14,7 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -59,7 +59,7 @@ typedef void (*snmp_send_cb_f)(struct sn typedef void (*snmp_timeout_cb_f)(void * ); /* timeout start function */ -typedef void *(*snmp_timeout_start_f)(struct timeval *timeout, +typedef void *(*snmp_timeout_start_f)(struct timeval *timeout, snmp_timeout_cb_f callback, void *); /* timeout stop function */ Modified: stable/11/contrib/bsnmp/lib/snmpcrypto.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpcrypto.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmpcrypto.c Sat Dec 31 10:32:49 2016 (r310901) @@ -322,7 +322,7 @@ snmp_calc_keychange(struct snmp_user *us for (i = 0; i < keylen / 4; i++) rvalue[i] = random(); - + memcpy(keychange, user->auth_key, keylen); memcpy(keychange + keylen, rvalue, keylen); Modified: stable/11/contrib/bsnmp/lib/snmppriv.h ============================================================================== --- stable/11/contrib/bsnmp/lib/snmppriv.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/snmppriv.h Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/support.c ============================================================================== --- stable/11/contrib/bsnmp/lib/support.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/support.c Sat Dec 31 10:32:49 2016 (r310901) @@ -1,10 +1,10 @@ -/* +/* * Copyright (C) 2004 * Hartmut Brandt. * All rights reserved. - * + * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/lib/support.h ============================================================================== --- stable/11/contrib/bsnmp/lib/support.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/lib/support.h Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -1228,7 +1228,7 @@ mib_fetch_rtab(int af, int info, int arg return (NULL); } buf = newbuf; - + if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) break; @@ -1329,7 +1329,7 @@ mib_arp_update(void) in_update_arp = 0; return; } - + next = buf; while (next < buf + needed) { rtm = (struct rt_msghdr *)(void *)next; @@ -1521,7 +1521,7 @@ mib_unmodify_ifa(struct mibifa *ifa) } /* - * Modify an IFA. + * Modify an IFA. */ int mib_modify_ifa(struct mibifa *ifa) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII.h Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_ifmib.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_ifmib.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_ifmib.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_ifstack.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_ifstack.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_ifstack.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_ip.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_ip.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_ip.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_route.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_route.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_route.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -257,7 +257,7 @@ mib_fetch_route(void) continue; mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); - + mib_sroute_process(rtm, addrs[RTAX_GATEWAY], addrs[RTAX_DST], addrs[RTAX_NETMASK]); } Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_tcp.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_tcp.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_tcp.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_tree.def ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_tree.def Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_tree.def Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ # All rights reserved. # # Author: Harti Brandt -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -13,7 +13,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_udp.c Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_udp.c Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Sat Dec 31 10:32:49 2016 (r310901) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.h ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.h Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.h Sat Dec 31 10:32:49 2016 (r310901) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/11/contrib/bsnmp/snmp_ntp/NTP-MIB.txt ============================================================================== --- stable/11/contrib/bsnmp/snmp_ntp/NTP-MIB.txt Sat Dec 31 10:30:56 2016 (r310900) +++ stable/11/contrib/bsnmp/snmp_ntp/NTP-MIB.txt Sat Dec 31 10:32:49 2016 (r310901) @@ -5,7 +5,7 @@ NTP-MIB DEFINITIONS ::= BEGIN IMPORTS - Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, + Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, enterprises FROM SNMPv2-SMI @@ -14,9 +14,9 @@ IMPORTS ntpMIB MODULE-IDENTITY LAST-UPDATED "199707251530Z" - ORGANIZATION + ORGANIZATION "University of Delaware" - CONTACT-INFO + CONTACT-INFO "Adarsh Sethi Department of Computer & Information Sciences University of Delaware @@ -30,7 +30,7 @@ ntpMIB MODULE-IDENTITY Newark, DE 19716 Tel: +1 302 831 ???? E-mail: mills@ee.udel.edu" - DESCRIPTION + DESCRIPTION "This MIB module defines a MIB which provides mechanisms to monitor and control an NTP server." ::= { udel 3 } @@ -60,18 +60,18 @@ ntpFilter OBJECT IDENTIFIER NTPTimeStamp ::= TEXTUAL-CONVENTION DISPLAY-HINT "4x.4x" STATUS current - DESCRIPTION + DESCRIPTION "" SYNTAX OCTET STRING (SIZE(8)) NTPLeapIndicator ::= TEXTUAL-CONVENTION STATUS current - DESCRIPTION + DESCRIPTION "" SYNTAX INTEGER { noWarning(0), addSecond(1), - subtractSecond(2), + subtractSecond(2), alarm(3) } -- @@ -82,7 +82,7 @@ ntpSysLeap OBJECT-TYPE SYNTAX NTPLeapIndicator MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION " two-bit code warning of an impending leap second to be inserted in the NTP timescale." ::= { ntpSystem 1 } @@ -91,7 +91,7 @@ ntpSysStratum OBJECT-TYPE SYNTAX Integer32 (0..255) MAX-ACCESS read-only *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 31 10:34:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BA3DC96CCE; Sat, 31 Dec 2016 10:34:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEF1F1356; Sat, 31 Dec 2016 10:34:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAY5dm027650; Sat, 31 Dec 2016 10:34:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAY5eQ027649; Sat, 31 Dec 2016 10:34:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311034.uBVAY5eQ027649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310902 - stable/11/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:34:06 -0000 Author: ngie Date: Sat Dec 31 10:34:04 2016 New Revision: 310902 URL: https://svnweb.freebsd.org/changeset/base/310902 Log: MFC r310669: style(9): clean up whitespace Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:32:49 2016 (r310901) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:34:04 2016 (r310902) @@ -1640,20 +1640,20 @@ err: static int altq_is_enabled(int pfdev) { - struct pfioc_altq pa; + struct pfioc_altq pa; errno = 0; - if (ioctl(pfdev, DIOCGETALTQS, &pa)) { - if (errno == ENODEV) { + if (ioctl(pfdev, DIOCGETALTQS, &pa)) { + if (errno == ENODEV) { syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); - return (0); - } else - syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", + return (0); + } else + syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); - } - return (1); + } + return (1); } /* From owner-svn-src-all@freebsd.org Sat Dec 31 10:34:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45612C96D40; Sat, 31 Dec 2016 10:34:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF980139F; Sat, 31 Dec 2016 10:34:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAYDE5027739; Sat, 31 Dec 2016 10:34:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAY9bi027699; Sat, 31 Dec 2016 10:34:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311034.uBVAY9bi027699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:34: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: r310903 - in stable/10: contrib/bsnmp/gensnmpdef contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmp_mibII contrib/bsnmp/snmp_ntp contrib/bsnmp/snmp_target contrib/bsnmp/snmp... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:34:14 -0000 Author: ngie Date: Sat Dec 31 10:34:09 2016 New Revision: 310903 URL: https://svnweb.freebsd.org/changeset/base/310903 Log: MFstable/11 r310901: MFC r310648: style(9): clean up trailing whitespace Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1 stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c stable/10/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c stable/10/contrib/bsnmp/lib/asn1.3 stable/10/contrib/bsnmp/lib/asn1.c stable/10/contrib/bsnmp/lib/asn1.h stable/10/contrib/bsnmp/lib/bsnmpagent.3 stable/10/contrib/bsnmp/lib/bsnmpclient.3 stable/10/contrib/bsnmp/lib/bsnmplib.3 stable/10/contrib/bsnmp/lib/snmp.c stable/10/contrib/bsnmp/lib/snmp.h stable/10/contrib/bsnmp/lib/snmpagent.c stable/10/contrib/bsnmp/lib/snmpagent.h stable/10/contrib/bsnmp/lib/snmpclient.c stable/10/contrib/bsnmp/lib/snmpclient.h stable/10/contrib/bsnmp/lib/snmpcrypto.c stable/10/contrib/bsnmp/lib/snmppriv.h stable/10/contrib/bsnmp/lib/support.c stable/10/contrib/bsnmp/lib/support.h stable/10/contrib/bsnmp/snmp_mibII/mibII.c stable/10/contrib/bsnmp/snmp_mibII/mibII.h stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c stable/10/contrib/bsnmp/snmp_mibII/mibII_ifmib.c stable/10/contrib/bsnmp/snmp_mibII/mibII_ifstack.c stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c stable/10/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c stable/10/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c stable/10/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c stable/10/contrib/bsnmp/snmp_mibII/mibII_route.c stable/10/contrib/bsnmp/snmp_mibII/mibII_tcp.c stable/10/contrib/bsnmp/snmp_mibII/mibII_tree.def stable/10/contrib/bsnmp/snmp_mibII/mibII_udp.c stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.h stable/10/contrib/bsnmp/snmp_ntp/NTP-MIB.txt stable/10/contrib/bsnmp/snmp_ntp/NTP-PROXY-MIB.txt stable/10/contrib/bsnmp/snmp_target/snmp_target.3 stable/10/contrib/bsnmp/snmp_usm/snmp_usm.3 stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c stable/10/contrib/bsnmp/snmp_vacm/snmp_vacm.3 stable/10/contrib/bsnmp/snmp_vacm/vacm_snmp.c stable/10/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt stable/10/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt stable/10/contrib/bsnmp/snmpd/FOKUS-MIB.txt stable/10/contrib/bsnmp/snmpd/action.c stable/10/contrib/bsnmp/snmpd/config.c stable/10/contrib/bsnmp/snmpd/export.c stable/10/contrib/bsnmp/snmpd/main.c stable/10/contrib/bsnmp/snmpd/snmpd.config stable/10/contrib/bsnmp/snmpd/snmpd.h stable/10/contrib/bsnmp/snmpd/snmpd.sh stable/10/contrib/bsnmp/snmpd/snmpmod.3 stable/10/contrib/bsnmp/snmpd/snmpmod.h stable/10/contrib/bsnmp/snmpd/trans_lsock.c stable/10/contrib/bsnmp/snmpd/trans_lsock.h stable/10/contrib/bsnmp/snmpd/trans_udp.c stable/10/contrib/bsnmp/snmpd/trans_udp.h stable/10/contrib/bsnmp/snmpd/trap.c stable/10/contrib/bsnmp/snmpd/tree.def stable/10/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt stable/10/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 stable/10/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c stable/10/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt stable/10/usr.sbin/bsnmpd/modules/snmp_pf/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c stable/10/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h stable/10/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1 ============================================================================== --- stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -13,7 +13,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c ============================================================================== --- stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c Sat Dec 31 10:34:09 2016 (r310903) @@ -1,10 +1,10 @@ -/* +/* * Copyright (C) 2004-2006 * Hartmut Brandt. * All rights reserved. - * + * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -233,7 +233,7 @@ print_scalar(SmiNode *n, u_int level) printf(" op_%s", p->name); print_access(n->access); - + printf(")\n"); } @@ -422,7 +422,7 @@ static void print_enum_typedef(SmiType *t) { SmiNamedNumber *nnum; - + for (nnum = smiGetFirstNamedNumber(t); nnum != NULL; nnum = smiGetNextNamedNumber(nnum)) { printf("\t%ld %s\n" , nnum->value.value.integer32, nnum->name); @@ -434,10 +434,10 @@ print_stype(SmiNode *n) { SmiType *type; struct tdef *t = NULL; - + type = smiGetNodeType(n); assert(type != NULL); - + if (type->basetype == SMI_BASETYPE_ENUM) { if (do_typedef == 'e' && type->name != NULL) { SLIST_FOREACH(t, &tdefs, link) { @@ -450,7 +450,7 @@ print_stype(SmiNode *n) printf("typedef %sType ENUM (\n", n->name); else return; - + print_enum_typedef(type); printf(")\n\n"); @@ -476,7 +476,7 @@ static void print_typdefs(SmiNode *n) { SmiNode *p; - + p = n; n = smiGetFirstChildNode(n); while (n != NULL) { Modified: stable/10/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- stable/10/contrib/bsnmp/gensnmptree/gensnmptree.1 Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/gensnmptree/gensnmptree.1 Sat Dec 31 10:34:09 2016 (r310903) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c Sat Dec 31 10:34:09 2016 (r310903) @@ -8,7 +8,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,7 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -738,7 +738,7 @@ parse_type(enum tok *tok, struct type *t e->value = -(long)val; } else e->value = val; - + if (*tok != TOK_NUM) report("need value for ENUM/BITS"); if (gettoken() != TOK_STR) Modified: stable/10/contrib/bsnmp/lib/asn1.3 ============================================================================== --- stable/10/contrib/bsnmp/lib/asn1.3 Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/asn1.3 Sat Dec 31 10:34:09 2016 (r310903) @@ -5,9 +5,9 @@ .\" Copyright (c) 2001-2003 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. -.\" +.\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/asn1.c ============================================================================== --- stable/10/contrib/bsnmp/lib/asn1.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/asn1.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -285,7 +285,7 @@ asn_put_real_integer(struct asn_buf *b, enum asn_err ret; if (ival < 0) { - /* this may fail if |INT64_MIN| > |INT64_MAX| and + /* this may fail if |INT64_MIN| > |INT64_MAX| and * the value is between * INT64_MIN <= ival < -(INT64_MAX+1) */ val = (uint64_t)-(ival + 1); neg = 1; @@ -890,7 +890,7 @@ asn_slice_oid(struct asn_oid *dest, cons memcpy(dest->subs, &src->subs[from], dest->len * sizeof(dest->subs[0])); } -/* +/* * Append from to to */ void Modified: stable/10/contrib/bsnmp/lib/asn1.h ============================================================================== --- stable/10/contrib/bsnmp/lib/asn1.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/asn1.h Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/bsnmpagent.3 ============================================================================== --- stable/10/contrib/bsnmp/lib/bsnmpagent.3 Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/bsnmpagent.3 Sat Dec 31 10:34:09 2016 (r310903) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/bsnmpclient.3 ============================================================================== --- stable/10/contrib/bsnmp/lib/bsnmpclient.3 Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/bsnmpclient.3 Sat Dec 31 10:34:09 2016 (r310903) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/bsnmplib.3 ============================================================================== --- stable/10/contrib/bsnmp/lib/bsnmplib.3 Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/bsnmplib.3 Sat Dec 31 10:34:09 2016 (r310903) @@ -13,7 +13,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -22,7 +22,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -19,7 +19,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -682,7 +682,7 @@ snmp_pdu_snoop(const struct asn_buf *b0) struct asn_buf b = *b0; /* <0x10|0x20> */ - + if (b.asn_len == 0) return (0); if (b.asn_cptr[0] != (ASN_TYPE_SEQUENCE | ASN_TYPE_CONSTRUCTED)) { @@ -757,7 +757,7 @@ snmp_pdu_encode_header(struct asn_buf *b if (asn_put_temp_header(b, (ASN_TYPE_SEQUENCE | ASN_TYPE_CONSTRUCTED), &v3_hdr_ptr) != ASN_ERR_OK) return (SNMP_CODE_FAILED); - + if (asn_put_integer(b, pdu->identifier) != ASN_ERR_OK) return (SNMP_CODE_FAILED); Modified: stable/10/contrib/bsnmp/lib/snmp.h ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmp.h Sat Dec 31 10:34:09 2016 (r310903) @@ -4,14 +4,14 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Shteryana Sotirova Shopova * under sponsorship from the FreeBSD Foundation. * - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -20,7 +20,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpagent.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmpagent.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -515,7 +515,7 @@ snmp_getbulk(struct snmp_pdu *pdu, struc /* PDU is full */ goto done; - if (cnt == 0) + if (cnt == 0) result = do_getnext(&context, &pdu->bindings[i], &resp->bindings[resp->nbindings], pdu); else @@ -689,7 +689,7 @@ snmp_set(struct snmp_pdu *pdu, struct as if (snmp_pdu_encode_header(resp_b, resp)) return (SNMP_RET_IGN); - /* + /* * 1. Find all nodes, check that they are writeable and * that the syntax is ok, copy over the binding to the response. */ @@ -967,7 +967,7 @@ snmp_dep_lookup(struct snmp_context *ctx /* * Make an error response from a PDU. We do this without decoding the * variable bindings. This means we can sent the junk back to a caller - * that has sent us junk in the first place. + * that has sent us junk in the first place. */ enum snmp_ret snmp_make_errresp(const struct snmp_pdu *pdu, struct asn_buf *pdu_b, Modified: stable/10/contrib/bsnmp/lib/snmpagent.h ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpagent.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmpagent.h Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:34:09 2016 (r310903) @@ -68,7 +68,7 @@ struct snmp_client snmp_client; /* List of all outstanding requests */ -struct sent_pdu { +struct sent_pdu { int reqid; struct snmp_pdu *pdu; struct timeval time; @@ -510,7 +510,7 @@ table_check_response(struct tabwork *wor table_free(work, 1); return (-2); } - + continue; } if (!asn_is_suboid(&work->descr->table, &b->var) || @@ -754,7 +754,7 @@ snmp_oid_append(struct asn_oid *oid, con ret = 0; while (*fmt != '\0') { switch (*fmt++) { - case 'i': + case 'i': /* just an integer more */ if (oid->len + 1 > ASN_MAXOIDLEN) { warnx("%s: OID too long for integer", __func__); @@ -804,7 +804,7 @@ snmp_oid_append(struct asn_oid *oid, con break; case 'b': - /* append `size` characters */ + /* append `size` characters */ str = (const u_char *)va_arg(va, const char *); if (oid->len + size > ASN_MAXOIDLEN) { warnx("%s: OID too long for string", __func__); @@ -852,7 +852,7 @@ snmp_client_init(struct snmp_client *c) strcpy(c->read_community, "public"); strcpy(c->write_community, "private"); - + c->security_model = SNMP_SECMODEL_USM; strcpy(c->cname, ""); @@ -863,7 +863,7 @@ snmp_client_init(struct snmp_client *c) c->txbuflen = c->rxbuflen = 10000; c->fd = -1; - + c->max_reqid = INT32_MAX; c->min_reqid = 0; c->next_reqid = 0; Modified: stable/10/contrib/bsnmp/lib/snmpclient.h ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmpclient.h Sat Dec 31 10:34:09 2016 (r310903) @@ -5,7 +5,7 @@ * * Author: Harti Brandt * Kendy Kutzner - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -14,7 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -59,7 +59,7 @@ typedef void (*snmp_send_cb_f)(struct sn typedef void (*snmp_timeout_cb_f)(void * ); /* timeout start function */ -typedef void *(*snmp_timeout_start_f)(struct timeval *timeout, +typedef void *(*snmp_timeout_start_f)(struct timeval *timeout, snmp_timeout_cb_f callback, void *); /* timeout stop function */ Modified: stable/10/contrib/bsnmp/lib/snmpcrypto.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpcrypto.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmpcrypto.c Sat Dec 31 10:34:09 2016 (r310903) @@ -322,7 +322,7 @@ snmp_calc_keychange(struct snmp_user *us for (i = 0; i < keylen / 4; i++) rvalue[i] = random(); - + memcpy(keychange, user->auth_key, keylen); memcpy(keychange + keylen, rvalue, keylen); Modified: stable/10/contrib/bsnmp/lib/snmppriv.h ============================================================================== --- stable/10/contrib/bsnmp/lib/snmppriv.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/snmppriv.h Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/support.c ============================================================================== --- stable/10/contrib/bsnmp/lib/support.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/support.c Sat Dec 31 10:34:09 2016 (r310903) @@ -1,10 +1,10 @@ -/* +/* * Copyright (C) 2004 * Hartmut Brandt. * All rights reserved. - * + * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/lib/support.h ============================================================================== --- stable/10/contrib/bsnmp/lib/support.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/lib/support.h Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -1228,7 +1228,7 @@ mib_fetch_rtab(int af, int info, int arg return (NULL); } buf = newbuf; - + if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) break; @@ -1329,7 +1329,7 @@ mib_arp_update(void) in_update_arp = 0; return; } - + next = buf; while (next < buf + needed) { rtm = (struct rt_msghdr *)(void *)next; @@ -1521,7 +1521,7 @@ mib_unmodify_ifa(struct mibifa *ifa) } /* - * Modify an IFA. + * Modify an IFA. */ int mib_modify_ifa(struct mibifa *ifa) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.h Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_ifmib.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_ifmib.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_ifmib.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_ifstack.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_ifstack.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_ifstack.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_route.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_route.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_route.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -257,7 +257,7 @@ mib_fetch_route(void) continue; mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); - + mib_sroute_process(rtm, addrs[RTAX_GATEWAY], addrs[RTAX_DST], addrs[RTAX_NETMASK]); } Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_tcp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_tcp.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_tcp.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_tree.def ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_tree.def Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_tree.def Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ # All rights reserved. # # Author: Harti Brandt -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -13,7 +13,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_udp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_udp.c Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_udp.c Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3 Sat Dec 31 10:34:09 2016 (r310903) @@ -7,7 +7,7 @@ .\" All rights reserved. .\" .\" Author: Harti Brandt -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -16,7 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.h ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.h Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.h Sat Dec 31 10:34:09 2016 (r310903) @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: stable/10/contrib/bsnmp/snmp_ntp/NTP-MIB.txt ============================================================================== --- stable/10/contrib/bsnmp/snmp_ntp/NTP-MIB.txt Sat Dec 31 10:34:04 2016 (r310902) +++ stable/10/contrib/bsnmp/snmp_ntp/NTP-MIB.txt Sat Dec 31 10:34:09 2016 (r310903) @@ -5,7 +5,7 @@ NTP-MIB DEFINITIONS ::= BEGIN IMPORTS - Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, + Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, enterprises FROM SNMPv2-SMI @@ -14,9 +14,9 @@ IMPORTS ntpMIB MODULE-IDENTITY LAST-UPDATED "199707251530Z" - ORGANIZATION + ORGANIZATION "University of Delaware" - CONTACT-INFO + CONTACT-INFO "Adarsh Sethi Department of Computer & Information Sciences University of Delaware @@ -30,7 +30,7 @@ ntpMIB MODULE-IDENTITY Newark, DE 19716 Tel: +1 302 831 ???? E-mail: mills@ee.udel.edu" - DESCRIPTION + DESCRIPTION "This MIB module defines a MIB which provides mechanisms to monitor and control an NTP server." ::= { udel 3 } @@ -60,18 +60,18 @@ ntpFilter OBJECT IDENTIFIER NTPTimeStamp ::= TEXTUAL-CONVENTION DISPLAY-HINT "4x.4x" STATUS current - DESCRIPTION + DESCRIPTION "" SYNTAX OCTET STRING (SIZE(8)) NTPLeapIndicator ::= TEXTUAL-CONVENTION STATUS current - DESCRIPTION + DESCRIPTION "" SYNTAX INTEGER { noWarning(0), addSecond(1), - subtractSecond(2), + subtractSecond(2), alarm(3) } -- @@ -82,7 +82,7 @@ ntpSysLeap OBJECT-TYPE SYNTAX NTPLeapIndicator MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION " two-bit code warning of an impending leap second to be inserted in the NTP timescale." ::= { ntpSystem 1 } @@ -91,7 +91,7 @@ ntpSysStratum OBJECT-TYPE SYNTAX Integer32 (0..255) MAX-ACCESS read-only *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 31 10:36:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9637C96E39; Sat, 31 Dec 2016 10:36:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A899A16AE; Sat, 31 Dec 2016 10:36:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAa7lT027906; Sat, 31 Dec 2016 10:36:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAa7aC027905; Sat, 31 Dec 2016 10:36:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311036.uBVAa7aC027905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310904 - stable/11/contrib/bsnmp/snmpd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:36:09 -0000 Author: ngie Date: Sat Dec 31 10:36:07 2016 New Revision: 310904 URL: https://svnweb.freebsd.org/changeset/base/310904 Log: MFC r310662,r310663: r310662: style(9): snmp_send_packet(..): fix whitespace r310663: style(9): ip_get(..): clean up whitespace Modified: stable/11/contrib/bsnmp/snmpd/export.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/export.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/export.c Sat Dec 31 10:34:09 2016 (r310903) +++ stable/11/contrib/bsnmp/snmpd/export.c Sat Dec 31 10:36:07 2016 (r310904) @@ -194,6 +194,7 @@ ip_get(struct snmp_value *value, u_char value->v.ipaddress[1] = valp[1]; value->v.ipaddress[2] = valp[2]; value->v.ipaddress[3] = valp[3]; + return (SNMP_ERR_NOERROR); } From owner-svn-src-all@freebsd.org Sat Dec 31 10:37:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DC7C96ED1; Sat, 31 Dec 2016 10:37:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 359301847; Sat, 31 Dec 2016 10:37:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAbd8b028043; Sat, 31 Dec 2016 10:37:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAbdHH028042; Sat, 31 Dec 2016 10:37:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311037.uBVAbdHH028042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310905 - stable/11/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:37:40 -0000 Author: ngie Date: Sat Dec 31 10:37:39 2016 New Revision: 310905 URL: https://svnweb.freebsd.org/changeset/base/310905 Log: MFC r310667: style(9) fixes: clean up leading whitespace Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Sat Dec 31 10:36:07 2016 (r310904) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Sat Dec 31 10:37:39 2016 (r310905) @@ -1472,7 +1472,7 @@ bridge_do_pfctl(int32_t bridge_ctl, enum } else s_len = 0; - len = sizeof(i); + len = sizeof(i); strcpy(mib_name, bridge_sysctl); From owner-svn-src-all@freebsd.org Sat Dec 31 10:37:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ECB8C96F21; Sat, 31 Dec 2016 10:37:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B5D418E6; Sat, 31 Dec 2016 10:37:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAbpXj028096; Sat, 31 Dec 2016 10:37:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAbp3T028095; Sat, 31 Dec 2016 10:37:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311037.uBVAbp3T028095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310906 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:37:52 -0000 Author: ngie Date: Sat Dec 31 10:37:50 2016 New Revision: 310906 URL: https://svnweb.freebsd.org/changeset/base/310906 Log: MFstable/11 r310904: MFC r310662,r310663: r310662: style(9): snmp_send_packet(..): fix whitespace r310663: style(9): ip_get(..): clean up whitespace Modified: stable/10/contrib/bsnmp/snmpd/export.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/export.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/export.c Sat Dec 31 10:37:39 2016 (r310905) +++ stable/10/contrib/bsnmp/snmpd/export.c Sat Dec 31 10:37:50 2016 (r310906) @@ -194,6 +194,7 @@ ip_get(struct snmp_value *value, u_char value->v.ipaddress[1] = valp[1]; value->v.ipaddress[2] = valp[2]; value->v.ipaddress[3] = valp[3]; + return (SNMP_ERR_NOERROR); } From owner-svn-src-all@freebsd.org Sat Dec 31 10:37:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02458C96F7D; Sat, 31 Dec 2016 10:37:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2FAF1977; Sat, 31 Dec 2016 10:37:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAbuSl028144; Sat, 31 Dec 2016 10:37:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAbuCB028143; Sat, 31 Dec 2016 10:37:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311037.uBVAbuCB028143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 10:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310907 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:37:58 -0000 Author: mjg Date: Sat Dec 31 10:37:56 2016 New Revision: 310907 URL: https://svnweb.freebsd.org/changeset/base/310907 Log: Use vrefact in vnode_pager_alloc. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sat Dec 31 10:37:50 2016 (r310906) +++ head/sys/vm/vnode_pager.c Sat Dec 31 10:37:56 2016 (r310907) @@ -265,7 +265,7 @@ retry: #endif VM_OBJECT_WUNLOCK(object); } - vref(vp); + vrefact(vp); return (object); } From owner-svn-src-all@freebsd.org Sat Dec 31 10:38:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A000C97033; Sat, 31 Dec 2016 10:38:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 592F41CA8; Sat, 31 Dec 2016 10:38:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAcw78028245; Sat, 31 Dec 2016 10:38:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAcwpT028244; Sat, 31 Dec 2016 10:38:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311038.uBVAcwpT028244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:38: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: r310908 - stable/10/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:38:59 -0000 Author: ngie Date: Sat Dec 31 10:38:58 2016 New Revision: 310908 URL: https://svnweb.freebsd.org/changeset/base/310908 Log: MFstable/11 r310905: MFC r310667: style(9) fixes: clean up leading whitespace Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Sat Dec 31 10:37:56 2016 (r310907) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c Sat Dec 31 10:38:58 2016 (r310908) @@ -1472,7 +1472,7 @@ bridge_do_pfctl(int32_t bridge_ctl, enum } else s_len = 0; - len = sizeof(i); + len = sizeof(i); strcpy(mib_name, bridge_sysctl); From owner-svn-src-all@freebsd.org Sat Dec 31 10:40:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E59CC970B1; Sat, 31 Dec 2016 10:40:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7DAA1E09; Sat, 31 Dec 2016 10:40:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAe2WP028386; Sat, 31 Dec 2016 10:40:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAe21H028384; Sat, 31 Dec 2016 10:40:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311040.uBVAe21H028384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310909 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:40:04 -0000 Author: ngie Date: Sat Dec 31 10:40:02 2016 New Revision: 310909 URL: https://svnweb.freebsd.org/changeset/base/310909 Log: MFC r310500,r310660: r310500: Minor style(9) fixes - Trailing whitespace cleanup - Sort variables in snmp_dialog(..) by alignment No functional change r310660: style(9): fix whitespace in pdu_encode_secparams(..) Modified: stable/11/contrib/bsnmp/lib/snmp.c stable/11/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:38:58 2016 (r310908) +++ stable/11/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:40:02 2016 (r310909) @@ -355,8 +355,8 @@ static enum snmp_code pdu_encode_secparams(struct asn_buf *b, struct snmp_pdu *pdu) { u_char buf[256], *sptr; - struct asn_buf tb; - size_t auth_off, moved = 0; + struct asn_buf tb; + size_t auth_off, moved = 0; auth_off = 0; memset(buf, 0, 256); Modified: stable/11/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:38:58 2016 (r310908) +++ stable/11/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:40:02 2016 (r310909) @@ -1214,7 +1214,7 @@ snmp_next_reqid(struct snmp_client * c) int32_t i; i = c->next_reqid; - if (c->next_reqid >= c->max_reqid) + if (c->next_reqid >= c->max_reqid) c->next_reqid = c->min_reqid; else c->next_reqid++; @@ -1230,7 +1230,7 @@ snmp_send_packet(struct snmp_pdu * pdu) u_char *buf; struct asn_buf b; ssize_t ret; - + if ((buf = malloc(snmp_client.txbuflen)) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); return (-1); @@ -1684,9 +1684,9 @@ snmp_dialog(struct snmp_v1_pdu *req, str struct timeval tv = snmp_client.timeout; struct timeval end; struct snmp_pdu pdu; - u_int i; - int32_t reqid; int ret; + int32_t reqid; + u_int i; /* * Make a copy of the request and replace the syntaxes by NULL From owner-svn-src-all@freebsd.org Sat Dec 31 10:41:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3259CC9714C; Sat, 31 Dec 2016 10:41:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBE0A10C6; Sat, 31 Dec 2016 10:41:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAf0SZ028479; Sat, 31 Dec 2016 10:41:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAexvF028473; Sat, 31 Dec 2016 10:40:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311040.uBVAexvF028473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:40: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: r310910 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:41:01 -0000 Author: ngie Date: Sat Dec 31 10:40:59 2016 New Revision: 310910 URL: https://svnweb.freebsd.org/changeset/base/310910 Log: MFstable/11 r310909: MFC r310500,r310660: r310500: Minor style(9) fixes - Trailing whitespace cleanup - Sort variables in snmp_dialog(..) by alignment No functional change r310660: style(9): fix whitespace in pdu_encode_secparams(..) Modified: stable/10/contrib/bsnmp/lib/snmp.c stable/10/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:40:02 2016 (r310909) +++ stable/10/contrib/bsnmp/lib/snmp.c Sat Dec 31 10:40:59 2016 (r310910) @@ -355,8 +355,8 @@ static enum snmp_code pdu_encode_secparams(struct asn_buf *b, struct snmp_pdu *pdu) { u_char buf[256], *sptr; - struct asn_buf tb; - size_t auth_off, moved = 0; + struct asn_buf tb; + size_t auth_off, moved = 0; auth_off = 0; memset(buf, 0, 256); Modified: stable/10/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:40:02 2016 (r310909) +++ stable/10/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 10:40:59 2016 (r310910) @@ -1214,7 +1214,7 @@ snmp_next_reqid(struct snmp_client * c) int32_t i; i = c->next_reqid; - if (c->next_reqid >= c->max_reqid) + if (c->next_reqid >= c->max_reqid) c->next_reqid = c->min_reqid; else c->next_reqid++; @@ -1230,7 +1230,7 @@ snmp_send_packet(struct snmp_pdu * pdu) u_char *buf; struct asn_buf b; ssize_t ret; - + if ((buf = malloc(snmp_client.txbuflen)) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); return (-1); @@ -1684,9 +1684,9 @@ snmp_dialog(struct snmp_v1_pdu *req, str struct timeval tv = snmp_client.timeout; struct timeval end; struct snmp_pdu pdu; - u_int i; - int32_t reqid; int ret; + int32_t reqid; + u_int i; /* * Make a copy of the request and replace the syntaxes by NULL From owner-svn-src-all@freebsd.org Sat Dec 31 10:41:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3BF0C972F3; Sat, 31 Dec 2016 10:41:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2F4512D5; Sat, 31 Dec 2016 10:41:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAfpa8030649; Sat, 31 Dec 2016 10:41:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAfp9Z030648; Sat, 31 Dec 2016 10:41:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311041.uBVAfp9Z030648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310911 - stable/11/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:41:53 -0000 Author: ngie Date: Sat Dec 31 10:41:51 2016 New Revision: 310911 URL: https://svnweb.freebsd.org/changeset/base/310911 Log: MFC r310668: style(9) fixes: clean up leading whitespace Modified: stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 10:40:59 2016 (r310910) +++ stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 10:41:51 2016 (r310911) @@ -1093,6 +1093,7 @@ snmp_ip2asn_oid(char *str, struct asn_oi char *endptr, *ptr; ptr = str; + for (i = 0; i < 4; i++) { v = strtoul(ptr, &endptr, 10); if (v > 0xff) From owner-svn-src-all@freebsd.org Sat Dec 31 10:43:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C95E2C97399; Sat, 31 Dec 2016 10:43:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 986471528; Sat, 31 Dec 2016 10:43:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAhWKf032365; Sat, 31 Dec 2016 10:43:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAhWFi032364; Sat, 31 Dec 2016 10:43:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311043.uBVAhWFi032364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310912 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:43:33 -0000 Author: ngie Date: Sat Dec 31 10:43:32 2016 New Revision: 310912 URL: https://svnweb.freebsd.org/changeset/base/310912 Log: MFstable/11 r310911: MFC r310668: style(9) fixes: clean up leading whitespace Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 10:41:51 2016 (r310911) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 10:43:32 2016 (r310912) @@ -1093,6 +1093,7 @@ snmp_ip2asn_oid(char *str, struct asn_oi char *endptr, *ptr; ptr = str; + for (i = 0; i < 4; i++) { v = strtoul(ptr, &endptr, 10); if (v > 0xff) From owner-svn-src-all@freebsd.org Sat Dec 31 10:45:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D5EAC9742D; Sat, 31 Dec 2016 10:45:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C87C16A4; Sat, 31 Dec 2016 10:45:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAj1Sf032506; Sat, 31 Dec 2016 10:45:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAj13j032505; Sat, 31 Dec 2016 10:45:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311045.uBVAj13j032505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:45: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: r310913 - stable/10/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:45:02 -0000 Author: ngie Date: Sat Dec 31 10:45:01 2016 New Revision: 310913 URL: https://svnweb.freebsd.org/changeset/base/310913 Log: MFstable/11 r310902: MFC r310669: style(9): clean up whitespace Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:43:32 2016 (r310912) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:45:01 2016 (r310913) @@ -1640,20 +1640,20 @@ err: static int altq_is_enabled(int pfdev) { - struct pfioc_altq pa; + struct pfioc_altq pa; errno = 0; - if (ioctl(pfdev, DIOCGETALTQS, &pa)) { - if (errno == ENODEV) { + if (ioctl(pfdev, DIOCGETALTQS, &pa)) { + if (errno == ENODEV) { syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); - return (0); - } else - syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", + return (0); + } else + syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); - } - return (1); + } + return (1); } /* From owner-svn-src-all@freebsd.org Sat Dec 31 10:47:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3CCC974E4; Sat, 31 Dec 2016 10:47:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ED9E1837; Sat, 31 Dec 2016 10:47:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAlLNN032646; Sat, 31 Dec 2016 10:47:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAlL2j032644; Sat, 31 Dec 2016 10:47:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311047.uBVAlL2j032644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310914 - in stable/10: tools/build/mk usr.sbin/bsnmpd/bsnmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:47:22 -0000 Author: ngie Date: Sat Dec 31 10:47:21 2016 New Revision: 310914 URL: https://svnweb.freebsd.org/changeset/base/310914 Log: MFstable/11 r310896: MFC r310654: Install snmpmod.3 as all of the bsnmpd APIs it documents Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/bsnmpd/bsnmpd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:45:01 2016 (r310913) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:47:21 2016 (r310914) @@ -406,22 +406,119 @@ OLD_FILES+=usr/share/man/man1/bsnmpget.1 OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz OLD_FILES+=usr/share/man/man1/bsnmpwalk.1.gz OLD_FILES+=usr/share/man/man1/gensnmptree.1.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK_INDEX.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK.3.gz +OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK_INDEX.3.gz OLD_FILES+=usr/share/man/man3/asn1.3.gz OLD_FILES+=usr/share/man/man3/bsnmpagent.3.gz OLD_FILES+=usr/share/man/man3/bsnmpclient.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_get_target_stats.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_get_usm_stats.3.gz +OLD_FILES+=usr/share/man/man3/bsnmpd_reset_usm_stats.3.gz OLD_FILES+=usr/share/man/man3/bsnmplib.3.gz +OLD_FILES+=usr/share/man/man3/buf_alloc.3.gz +OLD_FILES+=usr/share/man/man3/buf_size.3.gz +OLD_FILES+=usr/share/man/man3/comm_define.3.gz +OLD_FILES+=usr/share/man/man3/community.3.gz +OLD_FILES+=usr/share/man/man3/fd_deselect.3.gz +OLD_FILES+=usr/share/man/man3/fd_resume.3.gz +OLD_FILES+=usr/share/man/man3/fd_select.3.gz +OLD_FILES+=usr/share/man/man3/fd_suspend.3.gz +OLD_FILES+=usr/share/man/man3/get_ticks.3.gz +OLD_FILES+=usr/share/man/man3/index_append.3.gz +OLD_FILES+=usr/share/man/man3/index_append_off.3.gz +OLD_FILES+=usr/share/man/man3/index_compare.3.gz +OLD_FILES+=usr/share/man/man3/index_compare_off.3.gz +OLD_FILES+=usr/share/man/man3/index_decode.3.gz +OLD_FILES+=usr/share/man/man3/ip_commit.3.gz +OLD_FILES+=usr/share/man/man3/ip_get.3.gz +OLD_FILES+=usr/share/man/man3/ip_rollback.3.gz +OLD_FILES+=usr/share/man/man3/ip_save.3.gz +OLD_FILES+=usr/share/man/man3/or_register.3.gz +OLD_FILES+=usr/share/man/man3/or_unregister.3.gz +OLD_FILES+=usr/share/man/man3/oid_commit.3.gz +OLD_FILES+=usr/share/man/man3/oid_get.3.gz +OLD_FILES+=usr/share/man/man3/oid_rollback.3.gz +OLD_FILES+=usr/share/man/man3/oid_save.3.gz +OLD_FILES+=usr/share/man/man3/oid_usmNotInTimeWindows.3.gz +OLD_FILES+=usr/share/man/man3/oid_usmUnknownEngineIDs.3.gz +OLD_FILES+=usr/share/man/man3/oid_zeroDotZero.3.gz +OLD_FILES+=usr/share/man/man3/reqid_allocate.3.gz +OLD_FILES+=usr/share/man/man3/reqid_base.3.gz +OLD_FILES+=usr/share/man/man3/reqid_istype.3.gz +OLD_FILES+=usr/share/man/man3/reqid_next.3.gz +OLD_FILES+=usr/share/man/man3/reqid_type.3.gz OLD_FILES+=usr/share/man/man3/snmp_atm.3.gz OLD_FILES+=usr/share/man/man3/snmp_bridge.3.gz OLD_FILES+=usr/share/man/man3/snmp_hast.3.gz OLD_FILES+=usr/share/man/man3/snmp_hostres.3.gz +OLD_FILES+=usr/share/man/man3/snmp_input_finish.3.gz +OLD_FILES+=usr/share/man/man3/snmp_input_start.3.gz OLD_FILES+=usr/share/man/man3/snmp_lm75.3.gz OLD_FILES+=usr/share/man/man3/snmp_mibII.3.gz OLD_FILES+=usr/share/man/man3/snmp_netgraph.3.gz +OLD_FILES+=usr/share/man/man3/snmp_output.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_auth_access.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_port.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_trap.3.gz OLD_FILES+=usr/share/man/man3/snmp_target.3.gz OLD_FILES+=usr/share/man/man3/snmp_usm.3.gz OLD_FILES+=usr/share/man/man3/snmp_vacm.3.gz OLD_FILES+=usr/share/man/man3/snmp_wlan.3.gz +OLD_FILES+=usr/share/man/man3/snmpd_target_stat.3.gz +OLD_FILES+=usr/share/man/man3/snmpd_usmstats.3.gz OLD_FILES+=usr/share/man/man3/snmpmod.3.gz +OLD_FILES+=usr/share/man/man3/start_tick.3.gz +OLD_FILES+=usr/share/man/man3/string_commit.3.gz +OLD_FILES+=usr/share/man/man3/string_free.3.gz +OLD_FILES+=usr/share/man/man3/string_get.3.gz +OLD_FILES+=usr/share/man/man3/string_get_max.3.gz +OLD_FILES+=usr/share/man/man3/string_rollback.3.gz +OLD_FILES+=usr/share/man/man3/string_save.3.gz +OLD_FILES+=usr/share/man/man3/systemg.3.gz +OLD_FILES+=usr/share/man/man3/this_tick.3.gz +OLD_FILES+=usr/share/man/man3/timer_start.3.gz +OLD_FILES+=usr/share/man/man3/timer_start_repeat.3.gz +OLD_FILES+=usr/share/man/man3/timer_stop.3.gz +OLD_FILES+=usr/share/man/man3/target_activate_address.3.gz +OLD_FILES+=usr/share/man/man3/target_address.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_address.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_delete_param.3.gz +OLD_FILES+=usr/share/man/man3/target_first_address.3.gz +OLD_FILES+=usr/share/man/man3/target_first_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_first_param.3.gz +OLD_FILES+=usr/share/man/man3/target_flush_all.3.gz +OLD_FILES+=usr/share/man/man3/target_next_address.3.gz +OLD_FILES+=usr/share/man/man3/target_next_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_next_param.3.gz +OLD_FILES+=usr/share/man/man3/target_new_address.3.gz +OLD_FILES+=usr/share/man/man3/target_new_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_new_param.3.gz +OLD_FILES+=usr/share/man/man3/target_notify.3.gz +OLD_FILES+=usr/share/man/man3/target_param.3.gz +OLD_FILES+=usr/share/man/man3/usm_delete_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_find_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_first_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_flush_users.3.gz +OLD_FILES+=usr/share/man/man3/usm_next_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_new_user.3.gz +OLD_FILES+=usr/share/man/man3/usm_user.3.gz OLD_FILES+=usr/share/snmp/defs/atm_freebsd.def OLD_FILES+=usr/share/snmp/defs/atm_tree.def OLD_FILES+=usr/share/snmp/defs/bridge_tree.def Modified: stable/10/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Dec 31 10:45:01 2016 (r310913) +++ stable/10/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Dec 31 10:47:21 2016 (r310914) @@ -15,8 +15,107 @@ XSYM= snmpMIB begemotSnmpdModuleTable be begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable \ freeBSD freeBSDVersion CLEANFILES= oid.h tree.c tree.h + MAN= bsnmpd.1 snmpmod.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 bsnmpd_get_target_stats.3 +MLINKS+= snmpmod.3 bsnmpd_get_usm_stats.3 +MLINKS+= snmpmod.3 bsnmpd_reset_usm_stats.3 +MLINKS+= snmpmod.3 buf_alloc.3 +MLINKS+= snmpmod.3 buf_size.3 +MLINKS+= snmpmod.3 comm_define.3 +MLINKS+= snmpmod.3 community.3 +MLINKS+= snmpmod.3 fd_deselect.3 +MLINKS+= snmpmod.3 fd_resume.3 +MLINKS+= snmpmod.3 fd_select.3 +MLINKS+= snmpmod.3 fd_suspend.3 +MLINKS+= snmpmod.3 get_ticks.3 +MLINKS+= snmpmod.3 index_append.3 +MLINKS+= snmpmod.3 index_append_off.3 +MLINKS+= snmpmod.3 index_compare.3 +MLINKS+= snmpmod.3 index_compare_off.3 +MLINKS+= snmpmod.3 index_decode.3 +MLINKS+= snmpmod.3 ip_commit.3 +MLINKS+= snmpmod.3 ip_get.3 +MLINKS+= snmpmod.3 ip_rollback.3 +MLINKS+= snmpmod.3 ip_save.3 +MLINKS+= snmpmod.3 or_register.3 +MLINKS+= snmpmod.3 or_unregister.3 +MLINKS+= snmpmod.3 oid_commit.3 +MLINKS+= snmpmod.3 oid_get.3 +MLINKS+= snmpmod.3 oid_rollback.3 +MLINKS+= snmpmod.3 oid_save.3 +MLINKS+= snmpmod.3 oid_usmNotInTimeWindows.3 +MLINKS+= snmpmod.3 oid_usmUnknownEngineIDs.3 +MLINKS+= snmpmod.3 oid_zeroDotZero.3 +MLINKS+= snmpmod.3 reqid_allocate.3 +MLINKS+= snmpmod.3 reqid_base.3 +MLINKS+= snmpmod.3 reqid_istype.3 +MLINKS+= snmpmod.3 reqid_next.3 +MLINKS+= snmpmod.3 reqid_type.3 +MLINKS+= snmpmod.3 snmp_input_finish.3 +MLINKS+= snmpmod.3 snmp_input_start.3 +MLINKS+= snmpmod.3 snmp_output.3 +MLINKS+= snmpmod.3 snmp_pdu_auth_access.3 +MLINKS+= snmpmod.3 snmp_send_port.3 +MLINKS+= snmpmod.3 snmp_send_trap.3 +MLINKS+= snmpmod.3 snmpd_target_stat.3 +MLINKS+= snmpmod.3 snmpd_usmstats.3 +MLINKS+= snmpmod.3 start_tick.3 +MLINKS+= snmpmod.3 string_commit.3 +MLINKS+= snmpmod.3 string_free.3 +MLINKS+= snmpmod.3 string_get.3 +MLINKS+= snmpmod.3 string_get_max.3 +MLINKS+= snmpmod.3 string_rollback.3 +MLINKS+= snmpmod.3 string_save.3 +MLINKS+= snmpmod.3 systemg.3 +MLINKS+= snmpmod.3 this_tick.3 +MLINKS+= snmpmod.3 timer_start.3 +MLINKS+= snmpmod.3 timer_start_repeat.3 +MLINKS+= snmpmod.3 timer_stop.3 +MLINKS+= snmpmod.3 target_activate_address.3 +MLINKS+= snmpmod.3 target_address.3 +MLINKS+= snmpmod.3 target_delete_address.3 +MLINKS+= snmpmod.3 target_delete_notify.3 +MLINKS+= snmpmod.3 target_delete_param.3 +MLINKS+= snmpmod.3 target_first_address.3 +MLINKS+= snmpmod.3 target_first_notify.3 +MLINKS+= snmpmod.3 target_first_param.3 +MLINKS+= snmpmod.3 target_flush_all.3 +MLINKS+= snmpmod.3 target_next_address.3 +MLINKS+= snmpmod.3 target_next_notify.3 +MLINKS+= snmpmod.3 target_next_param.3 +MLINKS+= snmpmod.3 target_new_address.3 +MLINKS+= snmpmod.3 target_new_notify.3 +MLINKS+= snmpmod.3 target_new_param.3 +MLINKS+= snmpmod.3 target_notify.3 +MLINKS+= snmpmod.3 target_param.3 +MLINKS+= snmpmod.3 usm_delete_user.3 +MLINKS+= snmpmod.3 usm_find_user.3 +MLINKS+= snmpmod.3 usm_first_user.3 +MLINKS+= snmpmod.3 usm_flush_users.3 +MLINKS+= snmpmod.3 usm_next_user.3 +MLINKS+= snmpmod.3 usm_new_user.3 +MLINKS+= snmpmod.3 usm_user.3 + FILESGROUPS= BMIBS DEFS BMIBS= FOKUS-MIB.txt BEGEMOT-MIB.txt BEGEMOT-SNMPD.txt From owner-svn-src-all@freebsd.org Sat Dec 31 10:48:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F5EAC97584; Sat, 31 Dec 2016 10:48:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32B6119B1; Sat, 31 Dec 2016 10:48:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAmJwa032746; Sat, 31 Dec 2016 10:48:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAmJPg032744; Sat, 31 Dec 2016 10:48:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311048.uBVAmJPg032744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310915 - in stable/10: lib/libbsnmp/libbsnmp tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:48:20 -0000 Author: ngie Date: Sat Dec 31 10:48:19 2016 New Revision: 310915 URL: https://svnweb.freebsd.org/changeset/base/310915 Log: MFstable/11 r310897: MFC r310728: Install {asn1,bsnmpagent,bsnmpclient,bsnmplib}.3 as all of the APIs they document Also, alphabetically sort MAN Modified: stable/10/lib/libbsnmp/libbsnmp/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- stable/10/lib/libbsnmp/libbsnmp/Makefile Sat Dec 31 10:47:21 2016 (r310914) +++ stable/10/lib/libbsnmp/libbsnmp/Makefile Sat Dec 31 10:48:19 2016 (r310915) @@ -20,7 +20,97 @@ LDADD+= -lcrypto .endif SRCS= asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c -INCS= asn1.h snmp.h snmpagent.h snmpclient.h -MAN= asn1.3 bsnmplib.3 bsnmpclient.3 bsnmpagent.3 +INCS= asn1.h snmp.h snmpagent.h snmpclient.h +MAN= asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3 + +MLINKS+= asn1.3 asn_append_oid.3 +MLINKS+= asn1.3 asn_commit_header.3 +MLINKS+= asn1.3 asn_compare_oid.3 +MLINKS+= asn1.3 asn_get_counter64_raw.3 +MLINKS+= asn1.3 asn_get_header.3 +MLINKS+= asn1.3 asn_get_integer.3 +MLINKS+= asn1.3 asn_get_integer_raw.3 +MLINKS+= asn1.3 asn_get_ipaddress.3 +MLINKS+= asn1.3 asn_get_ipaddress_raw.3 +MLINKS+= asn1.3 asn_get_null.3 +MLINKS+= asn1.3 asn_get_null_raw.3 +MLINKS+= asn1.3 asn_get_objid.3 +MLINKS+= asn1.3 asn_get_objid_raw.3 +MLINKS+= asn1.3 asn_get_octetstring.3 +MLINKS+= asn1.3 asn_get_octetstring_raw.3 +MLINKS+= asn1.3 asn_get_sequence.3 +MLINKS+= asn1.3 asn_get_timeticks.3 +MLINKS+= asn1.3 asn_get_uint32_raw.3 +MLINKS+= asn1.3 asn_is_suboid.3 +MLINKS+= asn1.3 asn_oid2str.3 +MLINKS+= asn1.3 asn_oid2str_r.3 +MLINKS+= asn1.3 asn_put_counter64.3 +MLINKS+= asn1.3 asn_put_exception.3 +MLINKS+= asn1.3 asn_put_header.3 +MLINKS+= asn1.3 asn_put_integer.3 +MLINKS+= asn1.3 asn_put_ipaddress.3 +MLINKS+= asn1.3 asn_put_null.3 +MLINKS+= asn1.3 asn_put_objid.3 +MLINKS+= asn1.3 asn_put_octetstring.3 +MLINKS+= asn1.3 asn_put_temp_header.3 +MLINKS+= asn1.3 asn_put_timeticks.3 +MLINKS+= asn1.3 asn_put_uint32.3 +MLINKS+= asn1.3 asn_skip.3 +MLINKS+= asn1.3 asn_slice_oid.3 + +MLINKS+= bsnmpagent.3 snmp_debug.3 +MLINKS+= bsnmpagent.3 snmp_dep_commit.3 +MLINKS+= bsnmpagent.3 snmp_dep_finish.3 +MLINKS+= bsnmpagent.3 snmp_dep_lookup.3 +MLINKS+= bsnmpagent.3 snmp_dep_rollback.3 +MLINKS+= bsnmpagent.3 snmp_depop_t.3 +MLINKS+= bsnmpagent.3 snmp_get.3 +MLINKS+= bsnmpagent.3 snmp_getbulk.3 +MLINKS+= bsnmpagent.3 snmp_getnext.3 +MLINKS+= bsnmpagent.3 snmp_init_context.3 +MLINKS+= bsnmpagent.3 snmp_make_errresp.3 +MLINKS+= bsnmpagent.3 snmp_op_t.3 +MLINKS+= bsnmpagent.3 snmp_set.3 +MLINKS+= bsnmpagent.3 snmp_trace.3 +MLINKS+= bsnmpagent.3 tree.3 +MLINKS+= bsnmpagent.3 tree_size.3 + +MLINKS+= bsnmpclient.3 snmp_add_binding.3 +MLINKS+= bsnmpclient.3 snmp_client.3 +MLINKS+= bsnmpclient.3 snmp_close.3 +MLINKS+= bsnmpclient.3 snmp_dialog.3 +MLINKS+= bsnmpclient.3 snmp_discover_engine.3 +MLINKS+= bsnmpclient.3 snmp_oid_append.3 +MLINKS+= bsnmpclient.3 snmp_open.3 +MLINKS+= bsnmpclient.3 snmp_parse_server.3 +MLINKS+= bsnmpclient.3 snmp_pdu_check.3 +MLINKS+= bsnmpclient.3 snmp_pdu_create.3 +MLINKS+= bsnmpclient.3 snmp_pdu_send.3 +MLINKS+= bsnmpclient.3 snmp_receive.3 +MLINKS+= bsnmpclient.3 snmp_send_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_table_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_table_fetch.3 +MLINKS+= bsnmpclient.3 snmp_table_fetch_async.3 +MLINKS+= bsnmpclient.3 snmp_timeout_cb_f.3 +MLINKS+= bsnmpclient.3 snmp_timeout_start_f.3 +MLINKS+= bsnmpclient.3 snmp_timeout_stop_f.3 + +MLINKS+= bsnmplib.3 TRUTH_GET.3 +MLINKS+= bsnmplib.3 TRUTH_MK.3 +MLINKS+= bsnmplib.3 TRUTH_OK.3 +MLINKS+= bsnmplib.3 snmp_calc_keychange.3 +MLINKS+= bsnmplib.3 snmp_get_local_keys.3 +MLINKS+= bsnmplib.3 snmp_passwd_to_keys.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_header.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_scoped.3 +MLINKS+= bsnmplib.3 snmp_pdu_decode_secmode.3 +MLINKS+= bsnmplib.3 snmp_pdu_dump.3 +MLINKS+= bsnmplib.3 snmp_pdu_encode.3 +MLINKS+= bsnmplib.3 snmp_pdu_free.3 +MLINKS+= bsnmplib.3 snmp_pdu_init_secparams.3 +MLINKS+= bsnmplib.3 snmp_value_copy.3 +MLINKS+= bsnmplib.3 snmp_value_free.3 +MLINKS+= bsnmplib.3 snmp_value_parse.3 .include Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:47:21 2016 (r310914) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 31 10:48:19 2016 (r310915) @@ -406,6 +406,95 @@ OLD_FILES+=usr/share/man/man1/bsnmpget.1 OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz OLD_FILES+=usr/share/man/man1/bsnmpwalk.1.gz OLD_FILES+=usr/share/man/man1/gensnmptree.1.gz +# lib/libbsnmp/libbsnmp +OLD_FILES+=usr/share/man/man3/TRUTH_GET.3.gz +OLD_FILES+=usr/share/man/man3/TRUTH_MK.3.gz +OLD_FILES+=usr/share/man/man3/TRUTH_OK.3.gz +OLD_FILES+=usr/share/man/man3/asn1.3.gz +OLD_FILES+=usr/share/man/man3/asn_append_oid.3.gz +OLD_FILES+=usr/share/man/man3/asn_commit_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_compare_oid.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_counter64_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_integer.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_integer_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_ipaddress.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_ipaddress_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_null.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_null_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_objid.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_objid_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_octetstring.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_octetstring_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_sequence.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_timeticks.3.gz +OLD_FILES+=usr/share/man/man3/asn_get_uint32_raw.3.gz +OLD_FILES+=usr/share/man/man3/asn_is_suboid.3.gz +OLD_FILES+=usr/share/man/man3/asn_oid2str.3.gz +OLD_FILES+=usr/share/man/man3/asn_oid2str_r.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_counter64.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_exception.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_integer.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_ipaddress.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_null.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_objid.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_octetstring.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_temp_header.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_timeticks.3.gz +OLD_FILES+=usr/share/man/man3/asn_put_uint32.3.gz +OLD_FILES+=usr/share/man/man3/asn_skip.3.gz +OLD_FILES+=usr/share/man/man3/asn_slice_oid.3.gz +OLD_FILES+=usr/share/man/man3/snmp_add_binding.3.gz +OLD_FILES+=usr/share/man/man3/snmp_calc_keychange.3.gz +OLD_FILES+=usr/share/man/man3/snmp_client.3.gz +OLD_FILES+=usr/share/man/man3/snmp_close.3.gz +OLD_FILES+=usr/share/man/man3/snmp_debug.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_commit.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_finish.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_lookup.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dep_rollback.3.gz +OLD_FILES+=usr/share/man/man3/snmp_depop_t.3.gz +OLD_FILES+=usr/share/man/man3/snmp_dialog.3.gz +OLD_FILES+=usr/share/man/man3/snmp_discover_engine.3.gz +OLD_FILES+=usr/share/man/man3/snmp_get.3.gz +OLD_FILES+=usr/share/man/man3/snmp_get_local_keys.3.gz +OLD_FILES+=usr/share/man/man3/snmp_getbulk.3.gz +OLD_FILES+=usr/share/man/man3/snmp_getnext.3.gz +OLD_FILES+=usr/share/man/man3/snmp_init_context.3.gz +OLD_FILES+=usr/share/man/man3/snmp_make_errresp.3.gz +OLD_FILES+=usr/share/man/man3/snmp_oid_append.3.gz +OLD_FILES+=usr/share/man/man3/snmp_op_t.3.gz +OLD_FILES+=usr/share/man/man3/snmp_open.3.gz +OLD_FILES+=usr/share/man/man3/snmp_parse_server.3.gz +OLD_FILES+=usr/share/man/man3/snmp_passwd_to_keys.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_check.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_create.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_header.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_scoped.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_decode_secmode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_dump.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_encode.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_free.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_init_secparams.3.gz +OLD_FILES+=usr/share/man/man3/snmp_pdu_send.3.gz +OLD_FILES+=usr/share/man/man3/snmp_receive.3.gz +OLD_FILES+=usr/share/man/man3/snmp_send_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_set.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_fetch.3.gz +OLD_FILES+=usr/share/man/man3/snmp_table_fetch_async.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_cb_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_start_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_timeout_stop_f.3.gz +OLD_FILES+=usr/share/man/man3/snmp_trace.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_copy.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_free.3.gz +OLD_FILES+=usr/share/man/man3/snmp_value_parse.3.gz +OLD_FILES+=usr/share/man/man3/tree.3.gz +OLD_FILES+=usr/share/man/man3/tree_size.3.gz +# usr.sbin/bsnmpd/bsnmpd OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT.3.gz OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK.3.gz OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK_INDEX.3.gz From owner-svn-src-all@freebsd.org Sat Dec 31 10:57:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7B48C977FC; Sat, 31 Dec 2016 10:57:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84F561E4D; Sat, 31 Dec 2016 10:57:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAvOZV036916; Sat, 31 Dec 2016 10:57:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAvOhK036913; Sat, 31 Dec 2016 10:57:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311057.uBVAvOhK036913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 10:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310916 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:57:25 -0000 Author: arybchik Date: Sat Dec 31 10:57:24 2016 New Revision: 310916 URL: https://svnweb.freebsd.org/changeset/base/310916 Log: MFC r310682 sfxge(4): cleanup: avoid C99 // comments Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c stable/11/sys/dev/sfxge/common/ef10_nvram.c stable/11/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_ev.c Sat Dec 31 10:48:19 2016 (r310915) +++ stable/11/sys/dev/sfxge/common/ef10_ev.c Sat Dec 31 10:57:24 2016 (r310916) @@ -800,7 +800,7 @@ ef10_ev_rx( * or headers that are too long for the parser. * Headers and checksums must be validated by the host. */ - // TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE); + /* TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE); */ goto deliver; } Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 10:48:19 2016 (r310915) +++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 10:57:24 2016 (r310916) @@ -852,7 +852,7 @@ ef10_nvram_buffer_find_item_start( __in size_t buffer_size, __out uint32_t *startp) { - // Read past partition header to find start address of the first key + /* Read past partition header to find start address of the first key */ tlv_cursor_t cursor; efx_rc_t rc; @@ -898,7 +898,7 @@ ef10_nvram_buffer_find_end( __in uint32_t offset, __out uint32_t *endp) { - // Read to end of partition + /* Read to end of partition */ tlv_cursor_t cursor; efx_rc_t rc; uint32_t *segment_used; @@ -956,7 +956,7 @@ ef10_nvram_buffer_find_item( __out uint32_t *startp, __out uint32_t *lengthp) { - // Find TLV at offset and return key start and length + /* Find TLV at offset and return key start and length */ tlv_cursor_t cursor; uint8_t *key; uint32_t tag; Modified: stable/11/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_lic.c Sat Dec 31 10:48:19 2016 (r310915) +++ stable/11/sys/dev/sfxge/common/efx_lic.c Sat Dec 31 10:57:24 2016 (r310916) @@ -625,7 +625,7 @@ efx_lic_v1v2_write_key( EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX + EFX_LICENSE_V1V2_HEADER_LENGTH)); - // Ensure space for terminator remains + /* Ensure space for terminator remains */ if ((offset + length) > (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) { rc = ENOSPC; @@ -662,7 +662,7 @@ efx_lic_v1v2_delete_key( _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(end <= buffer_size); - // Shift everything after the key down + /* Shift everything after the key down */ memmove(bufferp + offset, bufferp + move_start, move_length); *deltap = length; @@ -681,7 +681,7 @@ efx_lic_v1v2_create_partition( _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); - // Write terminator + /* Write terminator */ memset(bufferp, '\0', EFX_LICENSE_V1V2_HEADER_LENGTH); return (0); } @@ -1155,7 +1155,7 @@ efx_lic_v3_validate_key( __in uint32_t length ) { - // Check key is a valid V3 key + /* Check key is a valid V3 key */ uint8_t key_type; uint8_t key_length; @@ -1272,7 +1272,7 @@ efx_lic_v3_create_partition( { efx_rc_t rc; - // Construct empty partition + /* Construct empty partition */ if ((rc = ef10_nvram_buffer_create(enp, NVRAM_PARTITION_TYPE_LICENSE, bufferp, buffer_size)) != 0) { @@ -1303,7 +1303,7 @@ efx_lic_v3_finish_partition( goto fail1; } - // Validate completed partition + /* Validate completed partition */ if ((rc = ef10_nvram_buffer_validate(enp, NVRAM_PARTITION_TYPE_LICENSE, bufferp, buffer_size)) != 0) { goto fail2; From owner-svn-src-all@freebsd.org Sat Dec 31 10:59:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1BAC97890; Sat, 31 Dec 2016 10:59:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA4BB1FB8; Sat, 31 Dec 2016 10:59:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAxMaf037040; Sat, 31 Dec 2016 10:59:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVAxMSK037039; Sat, 31 Dec 2016 10:59:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311059.uBVAxMSK037039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 10:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310917 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:59:24 -0000 Author: arybchik Date: Sat Dec 31 10:59:22 2016 New Revision: 310917 URL: https://svnweb.freebsd.org/changeset/base/310917 Log: MFC r310683 sfxge(4): cleanup: pointer symbol should go together with struct member name Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 10:57:24 2016 (r310916) +++ stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 10:59:22 2016 (r310917) @@ -950,7 +950,7 @@ typedef struct ef10_filter_entry_s { typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; - efx_rxq_t * eft_default_rxq; + efx_rxq_t *eft_default_rxq; boolean_t eft_using_rss; uint32_t eft_unicst_filter_indexes[ EFX_EF10_FILTER_UNICAST_FILTERS_MAX]; From owner-svn-src-all@freebsd.org Sat Dec 31 11:00:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6FEBC97951; Sat, 31 Dec 2016 11:00:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A54DD1235; Sat, 31 Dec 2016 11:00:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB0ZVF037180; Sat, 31 Dec 2016 11:00:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB0ZhA037179; Sat, 31 Dec 2016 11:00:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311100.uBVB0ZhA037179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310918 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:00:36 -0000 Author: arybchik Date: Sat Dec 31 11:00:35 2016 New Revision: 310918 URL: https://svnweb.freebsd.org/changeset/base/310918 Log: MFC r310684 sfxge(4): cleanup: remove trailing whitespaces Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_types.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 10:59:22 2016 (r310917) +++ stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 11:00:35 2016 (r310918) @@ -238,7 +238,7 @@ typedef union efx_oword_u { #endif #if EFSYS_HAS_UINT64 uint64_t eo_u64[2]; -#endif +#endif uint32_t eo_u32[4]; uint16_t eo_u16[8]; uint8_t eo_u8[16]; From owner-svn-src-all@freebsd.org Sat Dec 31 11:01:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFACCC97B3E; Sat, 31 Dec 2016 11:01:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 282671457; Sat, 31 Dec 2016 11:01:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB1Cvw040005; Sat, 31 Dec 2016 11:01:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB1CIZ040003; Sat, 31 Dec 2016 11:01:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311101.uBVB1CIZ040003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310919 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:01:14 -0000 Author: arybchik Date: Sat Dec 31 11:01:11 2016 New Revision: 310919 URL: https://svnweb.freebsd.org/changeset/base/310919 Log: MFC r310681 sfxge(4): cleanup: remove unnecessary spaces Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_impl.h stable/11/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:00:35 2016 (r310918) +++ stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:01:11 2016 (r310919) @@ -564,7 +564,7 @@ typedef struct efx_lic_ops_s { efx_rc_t (*elo_find_start) (efx_nic_t *, caddr_t, size_t, uint32_t *); efx_rc_t (*elo_find_end)(efx_nic_t *, caddr_t, size_t, - uint32_t , uint32_t *); + uint32_t, uint32_t *); boolean_t (*elo_find_key)(efx_nic_t *, caddr_t, size_t, uint32_t, uint32_t *, uint32_t *); boolean_t (*elo_validate_key)(efx_nic_t *, Modified: stable/11/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_lic.c Sat Dec 31 11:00:35 2016 (r310918) +++ stable/11/sys/dev/sfxge/common/efx_lic.c Sat Dec 31 11:01:11 2016 (r310919) @@ -627,7 +627,7 @@ efx_lic_v1v2_write_key( /* Ensure space for terminator remains */ if ((offset + length) > - (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) { + (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH)) { rc = ENOSPC; goto fail1; } From owner-svn-src-all@freebsd.org Sat Dec 31 11:02:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6550C97C23; Sat, 31 Dec 2016 11:02:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B55BE16DD; Sat, 31 Dec 2016 11:02:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB2XHU040832; Sat, 31 Dec 2016 11:02:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB2X4l040830; Sat, 31 Dec 2016 11:02:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311102.uBVB2X4l040830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310920 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:02:35 -0000 Author: arybchik Date: Sat Dec 31 11:02:33 2016 New Revision: 310920 URL: https://svnweb.freebsd.org/changeset/base/310920 Log: MFC r310685 sfxge(4): cleanup: open brace should be on a type name line Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_mcdi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:01:11 2016 (r310919) +++ stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:02:33 2016 (r310920) @@ -212,8 +212,7 @@ typedef enum efx_mcdi_exception_e { } efx_mcdi_exception_t; #if EFSYS_OPT_MCDI_LOGGING -typedef enum efx_log_msg_e -{ +typedef enum efx_log_msg_e { EFX_LOG_INVALID, EFX_LOG_MCDI_REQUEST, EFX_LOG_MCDI_RESPONSE, @@ -1172,8 +1171,7 @@ efx_nic_cfg_get( __in efx_nic_t *enp); /* Driver resource limits (minimum required/maximum usable). */ -typedef struct efx_drv_limits_s -{ +typedef struct efx_drv_limits_s { uint32_t edl_min_evq_count; uint32_t edl_max_evq_count; Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Dec 31 11:01:11 2016 (r310919) +++ stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Dec 31 11:02:33 2016 (r310920) @@ -1728,8 +1728,7 @@ fail1: #if EFSYS_OPT_MAC_STATS -typedef enum efx_stats_action_e -{ +typedef enum efx_stats_action_e { EFX_STATS_CLEAR, EFX_STATS_UPLOAD, EFX_STATS_ENABLE_NOEVENTS, From owner-svn-src-all@freebsd.org Sat Dec 31 11:03:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5266C97C94; Sat, 31 Dec 2016 11:03:35 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC981893; Sat, 31 Dec 2016 11:03:35 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB3Yak040927; Sat, 31 Dec 2016 11:03:34 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB3Yb7040923; Sat, 31 Dec 2016 11:03:34 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201612311103.uBVB3Yb7040923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 31 Dec 2016 11:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310921 - head/usr.sbin/inetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:03:35 -0000 Author: hrs Date: Sat Dec 31 11:03:34 2016 New Revision: 310921 URL: https://svnweb.freebsd.org/changeset/base/310921 Log: - Add static for symbols which need not to be exported. - Clean up warnings to the WARNS=6 level. Modified: head/usr.sbin/inetd/builtins.c head/usr.sbin/inetd/inetd.c head/usr.sbin/inetd/inetd.h Modified: head/usr.sbin/inetd/builtins.c ============================================================================== --- head/usr.sbin/inetd/builtins.c Sat Dec 31 11:02:33 2016 (r310920) +++ head/usr.sbin/inetd/builtins.c Sat Dec 31 11:03:34 2016 (r310921) @@ -52,25 +52,24 @@ __FBSDID("$FreeBSD$"); #include "inetd.h" -void chargen_dg(int, struct servtab *); -void chargen_stream(int, struct servtab *); -void daytime_dg(int, struct servtab *); -void daytime_stream(int, struct servtab *); -void discard_dg(int, struct servtab *); -void discard_stream(int, struct servtab *); -void echo_dg(int, struct servtab *); -void echo_stream(int, struct servtab *); +static void chargen_dg(int, struct servtab *); +static void chargen_stream(int, struct servtab *); +static void daytime_dg(int, struct servtab *); +static void daytime_stream(int, struct servtab *); +static void discard_dg(int, struct servtab *); +static void discard_stream(int, struct servtab *); +static void echo_dg(int, struct servtab *); +static void echo_stream(int, struct servtab *); static int get_line(int, char *, int); -void iderror(int, int, int, const char *); -void ident_stream(int, struct servtab *); -void initring(void); -uint32_t machtime(void); -void machtime_dg(int, struct servtab *); -void machtime_stream(int, struct servtab *); - -char ring[128]; -char *endring; +static void iderror(int, int, int, const char *); +static void ident_stream(int, struct servtab *); +static void initring(void); +static uint32_t machtime(void); +static void machtime_dg(int, struct servtab *); +static void machtime_stream(int, struct servtab *); +static char ring[128]; +static char *endring; struct biltin biltins[] = { /* Echo received data */ @@ -105,7 +104,7 @@ struct biltin biltins[] = { * any regard for input. */ -void +static void initring(void) { int i; @@ -122,7 +121,7 @@ initring(void) * characters chosen from the range 0 to 512. We send LINESIZ+2. */ /* ARGSUSED */ -void +static void chargen_dg(int s, struct servtab *sep) { struct sockaddr_storage ss; @@ -159,7 +158,7 @@ chargen_dg(int s, struct servtab *sep) /* Character generator */ /* ARGSUSED */ -void +static void chargen_stream(int s, struct servtab *sep) { int len; @@ -196,7 +195,7 @@ chargen_stream(int s, struct servtab *se /* Return human-readable time of day */ /* ARGSUSED */ -void +static void daytime_dg(int s, struct servtab *sep) { char buffer[256]; @@ -221,7 +220,7 @@ daytime_dg(int s, struct servtab *sep) /* Return human-readable time of day */ /* ARGSUSED */ -void +static void daytime_stream(int s, struct servtab *sep __unused) { char buffer[256]; @@ -240,7 +239,7 @@ daytime_stream(int s, struct servtab *se /* Discard service -- ignore data */ /* ARGSUSED */ -void +static void discard_dg(int s, struct servtab *sep __unused) { char buffer[BUFSIZE]; @@ -250,7 +249,7 @@ discard_dg(int s, struct servtab *sep __ /* Discard service -- ignore data */ /* ARGSUSED */ -void +static void discard_stream(int s, struct servtab *sep) { int ret; @@ -273,7 +272,7 @@ discard_stream(int s, struct servtab *se /* Echo service -- echo data back */ /* ARGSUSED */ -void +static void echo_dg(int s, struct servtab *sep) { char buffer[65536]; /* Should be sizeof(max datagram). */ @@ -294,7 +293,7 @@ echo_dg(int s, struct servtab *sep) /* Echo service -- echo data back */ /* ARGSUSED */ -void +static void echo_stream(int s, struct servtab *sep) { char buffer[BUFSIZE]; @@ -322,7 +321,7 @@ echo_stream(int s, struct servtab *sep) /* Generic ident_stream error-sending func */ /* ARGSUSED */ -void +static void iderror(int lport, int fport, int s, const char *er) { char *p; @@ -340,7 +339,7 @@ iderror(int lport, int fport, int s, con /* Ident service (AKA "auth") */ /* ARGSUSED */ -void +static void ident_stream(int s, struct servtab *sep) { struct utsname un; @@ -688,7 +687,7 @@ printit: * some seventy years Bell Labs was asleep. */ -uint32_t +static uint32_t machtime(void) { @@ -698,7 +697,7 @@ machtime(void) } /* ARGSUSED */ -void +static void machtime_dg(int s, struct servtab *sep) { uint32_t result; @@ -719,7 +718,7 @@ machtime_dg(int s, struct servtab *sep) } /* ARGSUSED */ -void +static void machtime_stream(int s, struct servtab *sep __unused) { uint32_t result; Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Sat Dec 31 11:02:33 2016 (r310920) +++ head/usr.sbin/inetd/inetd.c Sat Dec 31 11:03:34 2016 (r310921) @@ -204,30 +204,36 @@ __FBSDID("$FreeBSD$"); #define SIGBLOCK (sigmask(SIGCHLD)|sigmask(SIGHUP)|sigmask(SIGALRM)) -void close_sep(struct servtab *); -void flag_signal(int); -void flag_config(int); -void config(void); -int cpmip(const struct servtab *, int); -void endconfig(void); -struct servtab *enter(struct servtab *); -void freeconfig(struct servtab *); -struct servtab *getconfigent(void); -int matchservent(const char *, const char *, const char *); -char *nextline(FILE *); -void addchild(struct servtab *, int); -void flag_reapchild(int); -void reapchild(void); -void enable(struct servtab *); -void disable(struct servtab *); -void flag_retry(int); -void retry(void); -int setconfig(void); -void setup(struct servtab *); +#define satosin(sa) ((struct sockaddr_in *)(void *)sa) +#define csatosin(sa) ((const struct sockaddr_in *)(const void *)sa) +#ifdef INET6 +#define satosin6(sa) ((struct sockaddr_in6 *)(void *)sa) +#define csatosin6(sa) ((const struct sockaddr_in6 *)(const void *)sa) +#endif +static void close_sep(struct servtab *); +static void flag_signal(int); +static void flag_config(int); +static void config(void); +static int cpmip(const struct servtab *, int); +static void endconfig(void); +static struct servtab *enter(struct servtab *); +static void freeconfig(struct servtab *); +static struct servtab *getconfigent(void); +static int matchservent(const char *, const char *, const char *); +static char *nextline(FILE *); +static void addchild(struct servtab *, int); +static void flag_reapchild(int); +static void reapchild(void); +static void enable(struct servtab *); +static void disable(struct servtab *); +static void flag_retry(int); +static void retry(void); +static int setconfig(void); +static void setup(struct servtab *); #ifdef IPSEC -void ipsecsetup(struct servtab *); +static void ipsecsetup(struct servtab *); #endif -void unregisterrpc(register struct servtab *sep); +static void unregisterrpc(register struct servtab *sep); static struct conninfo *search_conn(struct servtab *sep, int ctrl); static int room_conn(struct servtab *sep, struct conninfo *conn); static void addchild_conn(struct conninfo *conn, pid_t pid); @@ -238,51 +244,55 @@ static void free_connlist(struct servtab static void free_proc(struct procinfo *); static struct procinfo *search_proc(pid_t pid, int add); static int hashval(char *p, int len); +static char *skip(char **); +static char *sskip(char **); +static char *newstr(const char *); +static void print_service(const char *, const struct servtab *); +/* tcpd.h */ int allow_severity; int deny_severity; -int wrap_ex = 0; -int wrap_bi = 0; + +static int wrap_ex = 0; +static int wrap_bi = 0; int debug = 0; -int dolog = 0; -int maxsock; /* highest-numbered descriptor */ -fd_set allsock; -int options; -int timingout; -int toomany = TOOMANY; -int maxchild = MAXCHILD; -int maxcpm = MAXCPM; -int maxperip = MAXPERIP; -struct servent *sp; -struct rpcent *rpc; -char *hostname = NULL; -struct sockaddr_in *bind_sa4; -int v4bind_ok = 0; +static int dolog = 0; +static int maxsock; /* highest-numbered descriptor */ +static fd_set allsock; +static int options; +static int timingout; +static int toomany = TOOMANY; +static int maxchild = MAXCHILD; +static int maxcpm = MAXCPM; +static int maxperip = MAXPERIP; +static struct servent *sp; +static struct rpcent *rpc; +static char *hostname = NULL; +static struct sockaddr_in *bind_sa4; +static int v4bind_ok = 0; #ifdef INET6 -struct sockaddr_in6 *bind_sa6; -int v6bind_ok = 0; +static struct sockaddr_in6 *bind_sa6; +static int v6bind_ok = 0; #endif -int signalpipe[2]; +static int signalpipe[2]; #ifdef SANITY_CHECK -int nsock; +static int nsock; #endif -uid_t euid; -gid_t egid; -mode_t mask; +static uid_t euid; +static gid_t egid; +static mode_t mask; -struct servtab *servtab; +struct servtab *servtab; -extern struct biltin biltins[]; +static const char *CONFIG = _PATH_INETDCONF; +static const char *pid_file = _PATH_INETDPID; +static struct pidfh *pfh = NULL; -const char *CONFIG = _PATH_INETDCONF; -const char *pid_file = _PATH_INETDPID; -struct pidfh *pfh = NULL; - -struct netconfig *udpconf, *tcpconf, *udp6conf, *tcp6conf; +static struct netconfig *udpconf, *tcpconf, *udp6conf, *tcp6conf; static LIST_HEAD(, procinfo) proctable[PERIPSIZE]; -int +static int getvalue(const char *arg, int *value, const char *whine) { int tmp; @@ -306,7 +316,7 @@ whichaf(struct request_info *req) if (sa == NULL) return AF_UNSPEC; if (sa->sa_family == AF_INET6 && - IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)sa)->sin6_addr)) + IN6_IS_ADDR_V4MAPPED(&satosin6(sa)->sin6_addr)) return AF_INET; return sa->sa_family; } @@ -413,7 +423,7 @@ main(int argc, char **argv) case AF_INET: if (v4bind_ok) continue; - bind_sa4 = (struct sockaddr_in *)res->ai_addr; + bind_sa4 = satosin(res->ai_addr); /* init port num in case servname is dummy */ bind_sa4->sin_port = 0; v4bind_ok = 1; @@ -422,7 +432,7 @@ main(int argc, char **argv) case AF_INET6: if (v6bind_ok) continue; - bind_sa6 = (struct sockaddr_in6 *)res->ai_addr; + bind_sa6 = satosin6(res->ai_addr); /* init port num in case servname is dummy */ bind_sa6->sin6_port = 0; v6bind_ok = 1; @@ -879,7 +889,7 @@ main(int argc, char **argv) * Add a signal flag to the signal flag queue for later handling */ -void +static void flag_signal(int c) { char ch = c; @@ -895,7 +905,7 @@ flag_signal(int c) * limit on children, then stop accepting incoming requests. */ -void +static void addchild(struct servtab *sep, pid_t pid) { if (sep->se_maxchild <= 0) @@ -916,13 +926,13 @@ addchild(struct servtab *sep, pid_t pid) * Some child process has exited. See if it's on somebody's list. */ -void +static void flag_reapchild(int signo __unused) { flag_signal('C'); } -void +static void reapchild(void) { int k, status; @@ -960,13 +970,13 @@ reapchild(void) } } -void +static void flag_config(int signo __unused) { flag_signal('H'); } -void +static void config(void) { struct servtab *sep, *new, **sepp; @@ -1174,7 +1184,7 @@ config(void) (void) sigsetmask(omask); } -void +static void unregisterrpc(struct servtab *sep) { u_int i; @@ -1229,13 +1239,13 @@ unregisterrpc(struct servtab *sep) (void) sigsetmask(omask); } -void +static void flag_retry(int signo __unused) { flag_signal('A'); } -void +static void retry(void) { struct servtab *sep; @@ -1246,7 +1256,7 @@ retry(void) setup(sep); } -void +static void setup(struct servtab *sep) { int on = 1; @@ -1369,7 +1379,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) } #ifdef IPSEC -void +static void ipsecsetup(struct servtab *sep) { char *buf; @@ -1443,7 +1453,7 @@ ipsecsetup(struct servtab *sep) /* * Finish with a service and its socket. */ -void +static void close_sep(struct servtab *sep) { if (sep->se_fd >= 0) { @@ -1456,7 +1466,7 @@ close_sep(struct servtab *sep) sep->se_numchild = 0; /* forget about any existing children */ } -int +static int matchservent(const char *name1, const char *name2, const char *proto) { char **alias, *p; @@ -1480,7 +1490,7 @@ matchservent(const char *name1, const ch return(0); } -struct servtab * +static struct servtab * enter(struct servtab *cp) { struct servtab *sep; @@ -1500,7 +1510,7 @@ enter(struct servtab *cp) return (sep); } -void +static void enable(struct servtab *sep) { if (debug) @@ -1529,7 +1539,7 @@ enable(struct servtab *sep) maxsock = sep->se_fd; } -void +static void disable(struct servtab *sep) { if (debug) @@ -1562,11 +1572,11 @@ disable(struct servtab *sep) maxsock--; } -FILE *fconfig = NULL; -struct servtab serv; -char line[LINE_MAX]; +static FILE *fconfig = NULL; +static struct servtab serv; +static char line[LINE_MAX]; -int +static int setconfig(void) { @@ -1578,7 +1588,7 @@ setconfig(void) return (fconfig != NULL); } -void +static void endconfig(void) { if (fconfig) { @@ -1587,7 +1597,7 @@ endconfig(void) } } -struct servtab * +static struct servtab * getconfigent(void) { struct servtab *sep = &serv; @@ -1965,7 +1975,7 @@ more: return (sep); } -void +static void freeconfig(struct servtab *cp) { int i; @@ -2001,7 +2011,7 @@ freeconfig(struct servtab *cp) * Safe skip - if skip returns null, log a syntax error in the * configuration file and exit. */ -char * +static char * sskip(char **cpp) { char *cp; @@ -2014,7 +2024,7 @@ sskip(char **cpp) return (cp); } -char * +static char * skip(char **cpp) { char *cp = *cpp; @@ -2050,7 +2060,7 @@ again: return (start); } -char * +static char * nextline(FILE *fd) { char *cp; @@ -2063,7 +2073,7 @@ nextline(FILE *fd) return (line); } -char * +static char * newstr(const char *cp) { char *cr; @@ -2103,13 +2113,13 @@ check_loop(const struct sockaddr *sa, co switch (se2->se_family) { case AF_INET: - if (((const struct sockaddr_in *)sa)->sin_port == + if (csatosin(sa)->sin_port == se2->se_ctrladdr4.sin_port) goto isloop; continue; #ifdef INET6 case AF_INET6: - if (((const struct sockaddr_in6 *)sa)->sin6_port == + if (csatosin6(sa)->sin6_port == se2->se_ctrladdr6.sin6_port) goto isloop; continue; @@ -2133,7 +2143,7 @@ check_loop(const struct sockaddr *sa, co * print_service: * Dump relevant information to stderr */ -void +static void print_service(const char *action, const struct servtab *sep) { fprintf(stderr, @@ -2181,9 +2191,9 @@ typedef struct CHash { CTime ch_Times[CHTSIZE]; } CHash; -CHash CHashAry[CPMHSIZE]; +static CHash CHashAry[CPMHSIZE]; -int +static int cpmip(const struct servtab *sep, int ctrl) { struct sockaddr_storage rss; Modified: head/usr.sbin/inetd/inetd.h ============================================================================== --- head/usr.sbin/inetd/inetd.h Sat Dec 31 11:02:33 2016 (r310920) +++ head/usr.sbin/inetd/inetd.h Sat Dec 31 11:03:34 2016 (r310921) @@ -123,12 +123,7 @@ struct servtab { #define se_reset se_flags.se_reset int check_loop(const struct sockaddr *, const struct servtab *sep); -int getvalue(const char *, int *, const char *); -char *newstr(const char *); void inetd_setproctitle(const char *, int); -void print_service(const char *, const struct servtab *); -char *sskip(char **); -char *skip(char **); struct servtab *tcpmux(int); extern int debug; @@ -143,3 +138,4 @@ struct biltin { int bi_maxchild; /* max number of children, -1=default */ bi_fn_t *bi_fn; /* function which performs it */ }; +extern struct biltin biltins[]; From owner-svn-src-all@freebsd.org Sat Dec 31 11:03:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59938C97CF2; Sat, 31 Dec 2016 11:03:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED5E1A05; Sat, 31 Dec 2016 11:03:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB3tq0040985; Sat, 31 Dec 2016 11:03:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB3tJT040983; Sat, 31 Dec 2016 11:03:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311103.uBVB3tJT040983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310922 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:03:56 -0000 Author: arybchik Date: Sat Dec 31 11:03:54 2016 New Revision: 310922 URL: https://svnweb.freebsd.org/changeset/base/310922 Log: MFC r310686 sfxge(4): cleanup: add missing space between type and pointer symbol Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:03:34 2016 (r310921) +++ stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:03:54 2016 (r310922) @@ -435,7 +435,7 @@ typedef enum efx_link_mode_e { #define EFX_MAC_ADDR_LEN 6 -#define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t*)_address)[0] & 0x01) +#define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t *)_address)[0] & 0x01) #define EFX_MAC_MULTICAST_LIST_MAX 256 Modified: stable/11/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_lic.c Sat Dec 31 11:03:34 2016 (r310921) +++ stable/11/sys/dev/sfxge/common/efx_lic.c Sat Dec 31 11:03:54 2016 (r310922) @@ -509,8 +509,8 @@ efx_lic_v1v2_find_key( if ((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH) goto fail1; - tlv_type = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[0]); - tlv_length = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[1]); + tlv_type = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[0]); + tlv_length = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[1]); if ((tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) || (tlv_type == 0 && tlv_length == 0)) { found = B_FALSE; @@ -543,8 +543,8 @@ efx_lic_v1v2_validate_key( goto fail1; } - tlv_type = __LE_TO_CPU_16(((uint16_t*)keyp)[0]); - tlv_length = __LE_TO_CPU_16(((uint16_t*)keyp)[1]); + tlv_type = __LE_TO_CPU_16(((uint16_t *)keyp)[0]); + tlv_length = __LE_TO_CPU_16(((uint16_t *)keyp)[1]); if (tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) { goto fail2; @@ -1169,8 +1169,8 @@ efx_lic_v3_validate_key( goto fail2; } - key_type = ((uint8_t*)keyp)[0]; - key_length = ((uint8_t*)keyp)[1]; + key_type = ((uint8_t *)keyp)[0]; + key_length = ((uint8_t *)keyp)[1]; if (key_type < 3) { goto fail3; From owner-svn-src-all@freebsd.org Sat Dec 31 11:05:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B734C97DAC; Sat, 31 Dec 2016 11:05:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D9631BA0; Sat, 31 Dec 2016 11:05:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB550R041120; Sat, 31 Dec 2016 11:05:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB54BS041112; Sat, 31 Dec 2016 11:05:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311105.uBVB54BS041112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310923 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:05:06 -0000 Author: arybchik Date: Sat Dec 31 11:05:04 2016 New Revision: 310923 URL: https://svnweb.freebsd.org/changeset/base/310923 Log: MFC r310687 sfxge(4): cleanup: use TAB to indent Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_impl.h stable/11/sys/dev/sfxge/common/efx_phy.c stable/11/sys/dev/sfxge/common/hunt_nic.c stable/11/sys/dev/sfxge/common/mcdi_mon.c stable/11/sys/dev/sfxge/common/medford_nic.c stable/11/sys/dev/sfxge/common/siena_flash.h stable/11/sys/dev/sfxge/common/siena_impl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:05:04 2016 (r310923) @@ -847,7 +847,7 @@ typedef enum efx_phy_cap_type_e { extern void efx_phy_adv_cap_get( __in efx_nic_t *enp, - __in uint32_t flag, + __in uint32_t flag, __out uint32_t *maskp); extern __checkReturn efx_rc_t @@ -1132,20 +1132,20 @@ typedef struct efx_nic_cfg_s { boolean_t enc_rx_batching_enabled; /* Maximum number of descriptors completed in an rx event. */ uint32_t enc_rx_batch_max; - /* Number of rx descriptors the hardware requires for a push. */ - uint32_t enc_rx_push_align; + /* Number of rx descriptors the hardware requires for a push. */ + uint32_t enc_rx_push_align; /* * Maximum number of bytes into the packet the TCP header can start for * the hardware to apply TSO packet edits. */ - uint32_t enc_tx_tso_tcp_header_offset_limit; - boolean_t enc_fw_assisted_tso_enabled; - boolean_t enc_fw_assisted_tso_v2_enabled; - boolean_t enc_hw_tx_insert_vlan_enabled; + uint32_t enc_tx_tso_tcp_header_offset_limit; + boolean_t enc_fw_assisted_tso_enabled; + boolean_t enc_fw_assisted_tso_v2_enabled; + boolean_t enc_hw_tx_insert_vlan_enabled; /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; - boolean_t enc_rx_disable_scatter_supported; - boolean_t enc_allow_set_mac_with_installed_filters; + boolean_t enc_rx_disable_scatter_supported; + boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; boolean_t enc_init_evq_v2_supported; /* External port identifier */ @@ -1846,8 +1846,8 @@ typedef enum efx_rx_hash_support_e { } efx_rx_hash_support_t; #define EFX_RSS_TBL_SIZE 128 /* Rows in RX indirection table */ -#define EFX_MAXRSS 64 /* RX indirection entry range */ -#define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ +#define EFX_MAXRSS 64 /* RX indirection entry range */ +#define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ typedef enum efx_rx_scale_support_e { EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */ @@ -2059,7 +2059,7 @@ efx_tx_qpio_write( __in efx_txq_t *etp, __in_ecount(buf_length) uint8_t *buffer, __in size_t buf_length, - __in size_t pio_buf_offset); + __in size_t pio_buf_offset); extern __checkReturn efx_rc_t efx_tx_qpio_post( Modified: stable/11/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:05:04 2016 (r310923) @@ -252,7 +252,7 @@ efx_filter_reconfigure( typedef struct efx_port_s { efx_mac_type_t ep_mac_type; - uint32_t ep_phy_type; + uint32_t ep_phy_type; uint8_t ep_port; uint32_t ep_mac_pdu; uint8_t ep_mac_addr[6]; @@ -600,7 +600,7 @@ struct efx_nic_s { uint32_t en_features; efsys_identifier_t *en_esip; efsys_lock_t *en_eslp; - efsys_bar_t *en_esbp; + efsys_bar_t *en_esbp; unsigned int en_mod_flags; unsigned int en_reset_flags; efx_nic_cfg_t en_nic_cfg; Modified: stable/11/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_phy.c Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/efx_phy.c Sat Dec 31 11:05:04 2016 (r310923) @@ -47,7 +47,7 @@ static const efx_phy_ops_t __efx_phy_sie #endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_BIST NULL, /* epo_bist_enable_offline */ - siena_phy_bist_start, /* epo_bist_start */ + siena_phy_bist_start, /* epo_bist_start */ siena_phy_bist_poll, /* epo_bist_poll */ siena_phy_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ Modified: stable/11/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/hunt_nic.c Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/hunt_nic.c Sat Dec 31 11:05:04 2016 (r310923) @@ -83,7 +83,7 @@ hunt_nic_get_required_pcie_bandwidth( if ((rc = ef10_nic_get_port_mode_bandwidth(max_port_mode, &bandwidth)) != 0) - goto fail2; + goto fail2; } out: @@ -295,7 +295,7 @@ hunt_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail12; + goto fail12; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; Modified: stable/11/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- stable/11/sys/dev/sfxge/common/mcdi_mon.c Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/mcdi_mon.c Sat Dec 31 11:05:04 2016 (r310923) @@ -155,8 +155,8 @@ static const struct mcdi_sensor_map_s { STAT(Px, PHY0_VCC), /* 0x4c PHY0_VCC */ STAT(Px, PHY1_VCC), /* 0x4d PHY1_VCC */ STAT(Px, CONTROLLER_TDIODE_TEMP), /* 0x4e CONTROLLER_TDIODE_TEMP */ - STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ - STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ + STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ + STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ }; #define MCDI_STATIC_SENSOR_ASSERT(_field) \ Modified: stable/11/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/medford_nic.c Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/medford_nic.c Sat Dec 31 11:05:04 2016 (r310923) @@ -283,7 +283,7 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail10; + goto fail10; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; Modified: stable/11/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_flash.h Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/siena_flash.h Sat Dec 31 11:05:04 2016 (r310923) @@ -127,7 +127,7 @@ typedef struct siena_mc_boot_hdr_s { /* } siena_mc_boot_hdr_t; #define SIENA_MC_BOOT_HDR_PADDING \ - (SIENA_MC_BOOT_HDR_LEN - sizeof(siena_mc_boot_hdr_t)) + (SIENA_MC_BOOT_HDR_LEN - sizeof(siena_mc_boot_hdr_t)) #define SIENA_MC_STATIC_CONFIG_MAGIC (0xBDCF5555) #define SIENA_MC_STATIC_CONFIG_VERSION (0) Modified: stable/11/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_impl.h Sat Dec 31 11:03:54 2016 (r310922) +++ stable/11/sys/dev/sfxge/common/siena_impl.h Sat Dec 31 11:05:04 2016 (r310923) @@ -294,7 +294,7 @@ siena_vpd_fini( typedef struct siena_link_state_s { uint32_t sls_adv_cap_mask; uint32_t sls_lp_cap_mask; - unsigned int sls_fcntl; + unsigned int sls_fcntl; efx_link_mode_t sls_link_mode; #if EFSYS_OPT_LOOPBACK efx_loopback_type_t sls_loopback; @@ -362,7 +362,7 @@ siena_phy_bist_poll( __in efx_bist_type_t type, __out efx_bist_result_t *resultp, __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, + uint32_t *value_maskp, __out_ecount_opt(count) __drv_when(count > 0, __notnull) unsigned long *valuesp, __in size_t count); From owner-svn-src-all@freebsd.org Sat Dec 31 11:06:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0D60C97E83; Sat, 31 Dec 2016 11:06:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9671D40; Sat, 31 Dec 2016 11:06:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB6Je2041219; Sat, 31 Dec 2016 11:06:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB6J3w041218; Sat, 31 Dec 2016 11:06:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311106.uBVB6J3w041218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310924 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:06:20 -0000 Author: arybchik Date: Sat Dec 31 11:06:19 2016 New Revision: 310924 URL: https://svnweb.freebsd.org/changeset/base/310924 Log: MFC r310688 sfxge(4): cleanup: avoid space just before TAB in efx_types.h Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_types.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 11:05:04 2016 (r310923) +++ stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 11:06:19 2016 (r310924) @@ -688,21 +688,21 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] = EFX_INSERT_FIELDS64(0, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[1] = EFX_INSERT_FIELDS64(64, 127, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_OWORD32(_oword, \ @@ -711,35 +711,35 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] = EFX_INSERT_FIELDS32(0, 31, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[1] = EFX_INSERT_FIELDS32(32, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[2] = EFX_INSERT_FIELDS32(64, 95, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[3] = EFX_INSERT_FIELDS32(96, 127, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_QWORD64(_qword, \ @@ -748,14 +748,14 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] = EFX_INSERT_FIELDS64(0, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_QWORD32(_qword, \ @@ -764,21 +764,21 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] = EFX_INSERT_FIELDS32(0, 31, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[1] = EFX_INSERT_FIELDS32(32, 63, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ _field5, _value5, _field6, _value6, \ _field7, _value7, _field8, _value8, \ _field9, _value9, _field10, _value10); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_POPULATE_DWORD(_dword, \ @@ -787,7 +787,7 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_dword).ed_u32[0] = EFX_INSERT_FIELDS32(0, 31, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ @@ -803,7 +803,7 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_word).ew_u16[0] = EFX_INSERT_FIELDS16(0, 15, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ @@ -819,7 +819,7 @@ extern int fix_lint; _field7, _value7, _field8, _value8, _field9, _value9, \ _field10, _value10) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_byte).eb_u8[0] = EFX_INSERT_FIELDS8(0, 7, \ _field1, _value1, _field2, _value2, \ _field3, _value3, _field4, _value4, \ @@ -1226,85 +1226,85 @@ extern int fix_lint; #define EFX_SET_OWORD_FIELD64(_oword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] = (((_oword).eo_u64[0] & \ ~EFX_INPLACE_MASK64(0, 63, _field)) | \ EFX_INSERT_FIELD64(0, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[1] = (((_oword).eo_u64[1] & \ ~EFX_INPLACE_MASK64(64, 127, _field)) | \ EFX_INSERT_FIELD64(64, 127, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_OWORD_FIELD32(_oword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] = (((_oword).eo_u32[0] & \ ~EFX_INPLACE_MASK32(0, 31, _field)) | \ EFX_INSERT_FIELD32(0, 31, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[1] = (((_oword).eo_u32[1] & \ ~EFX_INPLACE_MASK32(32, 63, _field)) | \ EFX_INSERT_FIELD32(32, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[2] = (((_oword).eo_u32[2] & \ ~EFX_INPLACE_MASK32(64, 95, _field)) | \ EFX_INSERT_FIELD32(64, 95, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[3] = (((_oword).eo_u32[3] & \ ~EFX_INPLACE_MASK32(96, 127, _field)) | \ EFX_INSERT_FIELD32(96, 127, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_QWORD_FIELD64(_qword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] = (((_qword).eq_u64[0] & \ ~EFX_INPLACE_MASK64(0, 63, _field)) | \ EFX_INSERT_FIELD64(0, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_QWORD_FIELD32(_qword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] = (((_qword).eq_u32[0] & \ ~EFX_INPLACE_MASK32(0, 31, _field)) | \ EFX_INSERT_FIELD32(0, 31, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[1] = (((_qword).eq_u32[1] & \ ~EFX_INPLACE_MASK32(32, 63, _field)) | \ EFX_INSERT_FIELD32(32, 63, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_DWORD_FIELD(_dword, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_dword).ed_u32[0] = (((_dword).ed_u32[0] & \ ~EFX_INPLACE_MASK32(0, 31, _field)) | \ EFX_INSERT_FIELD32(0, 31, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_WORD_FIELD(_word, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_word).ew_u16[0] = (((_word).ew_u16[0] & \ ~EFX_INPLACE_MASK16(0, 15, _field)) | \ EFX_INSERT_FIELD16(0, 15, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_BYTE_FIELD(_byte, _field, _value) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_byte).eb_u8[0] = (((_byte).eb_u8[0] & \ ~EFX_INPLACE_MASK8(0, 7, _field)) | \ EFX_INSERT_FIELD8(0, 7, _field, _value)); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) /* @@ -1333,17 +1333,17 @@ extern int fix_lint; #define EFX_SET_OWORD_BIT64(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] |= \ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(0))); \ (_oword).eo_u64[1] |= \ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(64))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_OWORD_BIT32(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_oword).eo_u32[1] |= \ @@ -1352,22 +1352,22 @@ extern int fix_lint; __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(64))); \ (_oword).eo_u32[3] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(96))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_OWORD_BIT64(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u64[0] &= \ __CPU_TO_LE_64(~EFX_SHIFT64(_bit, FIX_LINT(0))); \ (_oword).eo_u64[1] &= \ __CPU_TO_LE_64(~EFX_SHIFT64(_bit, FIX_LINT(64))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_OWORD_BIT32(_oword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_oword).eo_u32[0] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_oword).eo_u32[1] &= \ @@ -1376,7 +1376,7 @@ extern int fix_lint; __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(64))); \ (_oword).eo_u32[3] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(96))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_OWORD_BIT64(_oword, _bit) \ @@ -1398,38 +1398,38 @@ extern int fix_lint; #define EFX_SET_QWORD_BIT64(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] |= \ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_SET_QWORD_BIT32(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_qword).eq_u32[1] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(32))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_QWORD_BIT64(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u64[0] &= \ __CPU_TO_LE_64(~EFX_SHIFT64(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_QWORD_BIT32(_qword, _bit) \ do { \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ (_qword).eq_u32[0] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(0))); \ (_qword).eq_u32[1] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(32))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_QWORD_BIT64(_qword, _bit) \ @@ -1447,14 +1447,14 @@ extern int fix_lint; do { \ (_dword).ed_u32[0] |= \ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_DWORD_BIT(_dword, _bit) \ do { \ (_dword).ed_u32[0] &= \ __CPU_TO_LE_32(~EFX_SHIFT32(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_DWORD_BIT(_dword, _bit) \ @@ -1466,14 +1466,14 @@ extern int fix_lint; do { \ (_word).ew_u16[0] |= \ __CPU_TO_LE_16(EFX_SHIFT16(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_WORD_BIT(_word, _bit) \ do { \ (_word).ew_u32[0] &= \ __CPU_TO_LE_16(~EFX_SHIFT16(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_WORD_BIT(_word, _bit) \ @@ -1485,14 +1485,14 @@ extern int fix_lint; do { \ (_byte).eb_u8[0] |= \ __NATIVE_8(EFX_SHIFT8(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_CLEAR_BYTE_BIT(_byte, _bit) \ do { \ (_byte).eb_u8[0] &= \ __NATIVE_8(~EFX_SHIFT8(_bit, FIX_LINT(0))); \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_TEST_BYTE_BIT(_byte, _bit) \ @@ -1504,7 +1504,7 @@ extern int fix_lint; do { \ (_oword1).eo_u64[0] |= (_oword2).eo_u64[0]; \ (_oword1).eo_u64[1] |= (_oword2).eo_u64[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_OWORD32(_oword1, _oword2) \ @@ -1513,14 +1513,14 @@ extern int fix_lint; (_oword1).eo_u32[1] |= (_oword2).eo_u32[1]; \ (_oword1).eo_u32[2] |= (_oword2).eo_u32[2]; \ (_oword1).eo_u32[3] |= (_oword2).eo_u32[3]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_OWORD64(_oword1, _oword2) \ do { \ (_oword1).eo_u64[0] &= (_oword2).eo_u64[0]; \ (_oword1).eo_u64[1] &= (_oword2).eo_u64[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_OWORD32(_oword1, _oword2) \ @@ -1529,69 +1529,69 @@ extern int fix_lint; (_oword1).eo_u32[1] &= (_oword2).eo_u32[1]; \ (_oword1).eo_u32[2] &= (_oword2).eo_u32[2]; \ (_oword1).eo_u32[3] &= (_oword2).eo_u32[3]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_QWORD64(_qword1, _qword2) \ do { \ (_qword1).eq_u64[0] |= (_qword2).eq_u64[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_QWORD32(_qword1, _qword2) \ do { \ (_qword1).eq_u32[0] |= (_qword2).eq_u32[0]; \ (_qword1).eq_u32[1] |= (_qword2).eq_u32[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_QWORD64(_qword1, _qword2) \ do { \ (_qword1).eq_u64[0] &= (_qword2).eq_u64[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_QWORD32(_qword1, _qword2) \ do { \ (_qword1).eq_u32[0] &= (_qword2).eq_u32[0]; \ (_qword1).eq_u32[1] &= (_qword2).eq_u32[1]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_DWORD(_dword1, _dword2) \ do { \ (_dword1).ed_u32[0] |= (_dword2).ed_u32[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_DWORD(_dword1, _dword2) \ do { \ (_dword1).ed_u32[0] &= (_dword2).ed_u32[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_WORD(_word1, _word2) \ do { \ (_word1).ew_u16[0] |= (_word2).ew_u16[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_WORD(_word1, _word2) \ do { \ (_word1).ew_u16[0] &= (_word2).ew_u16[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_OR_BYTE(_byte1, _byte2) \ do { \ (_byte1).eb_u8[0] |= (_byte2).eb_u8[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #define EFX_AND_BYTE(_byte1, _byte2) \ do { \ (_byte1).eb_u8[0] &= (_byte2).eb_u8[0]; \ - _NOTE(CONSTANTCONDITION) \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #if EFSYS_USE_UINT64 From owner-svn-src-all@freebsd.org Sat Dec 31 11:07:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98194C97F20; Sat, 31 Dec 2016 11:07:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67A9E1ECA; Sat, 31 Dec 2016 11:07:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB7XCT041317; Sat, 31 Dec 2016 11:07:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB7Xl8041316; Sat, 31 Dec 2016 11:07:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612311107.uBVB7Xl8041316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 31 Dec 2016 11:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310925 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:07:34 -0000 Author: kib Date: Sat Dec 31 11:07:33 2016 New Revision: 310925 URL: https://svnweb.freebsd.org/changeset/base/310925 Log: Remove unused declaration. The setconf() implementation was removed by r52778 Nov 1 1999. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/sys/conf.h Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Sat Dec 31 11:06:19 2016 (r310924) +++ head/sys/sys/conf.h Sat Dec 31 11:07:33 2016 (r310925) @@ -285,7 +285,6 @@ int make_dev_physpath_alias(int _flags, const char *_physpath); void dev_lock(void); void dev_unlock(void); -void setconf(void); #ifdef KLD_MODULE #define MAKEDEV_ETERNAL_KLD 0 From owner-svn-src-all@freebsd.org Sat Dec 31 11:07:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA24C97F7A; Sat, 31 Dec 2016 11:07:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF2C1F87; Sat, 31 Dec 2016 11:07:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB7iVC041371; Sat, 31 Dec 2016 11:07:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB7iK2041367; Sat, 31 Dec 2016 11:07:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311107.uBVB7iK2041367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310926 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:07:46 -0000 Author: arybchik Date: Sat Dec 31 11:07:44 2016 New Revision: 310926 URL: https://svnweb.freebsd.org/changeset/base/310926 Log: MFC r310689 sfxge(4): cleanup: avoid spaces before TAB Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_impl.h stable/11/sys/dev/sfxge/common/efx_types.h stable/11/sys/dev/sfxge/common/siena_phy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:07:33 2016 (r310925) +++ stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:07:44 2016 (r310926) @@ -169,7 +169,7 @@ extern void efx_nic_unprobe( __in efx_nic_t *enp); -extern void +extern void efx_nic_destroy( __in efx_nic_t *enp); @@ -286,21 +286,21 @@ efx_intr_init( __in efx_intr_type_t type, __in efsys_mem_t *esmp); -extern void +extern void efx_intr_enable( __in efx_nic_t *enp); -extern void +extern void efx_intr_disable( __in efx_nic_t *enp); -extern void +extern void efx_intr_disable_unlocked( __in efx_nic_t *enp); #define EFX_INTR_NEVQS 32 -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_intr_trigger( __in efx_nic_t *enp, __in unsigned int level); @@ -819,7 +819,7 @@ efx_port_poll( __in efx_nic_t *enp, __out_opt efx_link_mode_t *link_modep); -extern void +extern void efx_port_fini( __in efx_nic_t *enp); @@ -1253,7 +1253,7 @@ efx_vpd_verify( __in_bcount(size) caddr_t data, __in size_t size); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_vpd_reinit( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, @@ -1281,7 +1281,7 @@ efx_vpd_next( __out efx_vpd_value_t *evvp, __inout unsigned int *contp); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_vpd_write( __in efx_nic_t *enp, __in_bcount(size) caddr_t data, @@ -1499,7 +1499,7 @@ typedef enum efx_pattern_type_t { EFX_PATTERN_NTYPES } efx_pattern_type_t; -typedef void +typedef void (*efx_sram_pattern_fn_t)( __in size_t row, __in boolean_t negate, Modified: stable/11/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:07:33 2016 (r310925) +++ stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:07:44 2016 (r310926) @@ -913,7 +913,7 @@ struct efx_txq_s { uint32_t, (_edp)->ed_u32[0]); \ EFSYS_BAR_WRITED((_enp)->en_esbp, \ (_reg ## _OFST + \ - (2 * sizeof (efx_dword_t)) + \ + (2 * sizeof (efx_dword_t)) + \ ((_index) * _reg ## _STEP)), \ (_edp), (_lock)); \ _NOTE(CONSTANTCONDITION) \ @@ -928,7 +928,7 @@ struct efx_txq_s { uint32_t, (_edp)->ed_u32[0]); \ EFSYS_BAR_WRITED((_enp)->en_esbp, \ (_reg ## _OFST + \ - (3 * sizeof (efx_dword_t)) + \ + (3 * sizeof (efx_dword_t)) + \ ((_index) * _reg ## _STEP)), \ (_edp), (_lock)); \ _NOTE(CONSTANTCONDITION) \ Modified: stable/11/sys/dev/sfxge/common/efx_types.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 11:07:33 2016 (r310925) +++ stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 11:07:44 2016 (r310926) @@ -246,7 +246,7 @@ typedef union efx_oword_u { #pragma pack() -#define __SWAP16(_x) \ +#define __SWAP16(_x) \ ((((_x) & 0xff) << 8) | \ (((_x) >> 8) & 0xff)) @@ -1212,16 +1212,16 @@ extern int fix_lint; #define EFX_INSERT_FIELD8(_min, _max, _field, _value) \ __NATIVE_8(EFX_INSERT_FIELD_NATIVE8(_min, _max, _field, _value)) -#define EFX_INPLACE_MASK64(_min, _max, _field) \ +#define EFX_INPLACE_MASK64(_min, _max, _field) \ EFX_INSERT_FIELD64(_min, _max, _field, EFX_MASK64(_field)) -#define EFX_INPLACE_MASK32(_min, _max, _field) \ +#define EFX_INPLACE_MASK32(_min, _max, _field) \ EFX_INSERT_FIELD32(_min, _max, _field, EFX_MASK32(_field)) -#define EFX_INPLACE_MASK16(_min, _max, _field) \ +#define EFX_INPLACE_MASK16(_min, _max, _field) \ EFX_INSERT_FIELD16(_min, _max, _field, EFX_MASK16(_field)) -#define EFX_INPLACE_MASK8(_min, _max, _field) \ +#define EFX_INPLACE_MASK8(_min, _max, _field) \ EFX_INSERT_FIELD8(_min, _max, _field, EFX_MASK8(_field)) #define EFX_SET_OWORD_FIELD64(_oword, _field, _value) \ Modified: stable/11/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_phy.c Sat Dec 31 11:07:33 2016 (r310925) +++ stable/11/sys/dev/sfxge/common/siena_phy.c Sat Dec 31 11:07:44 2016 (r310926) @@ -455,7 +455,7 @@ siena_phy_oui_get( } #define SIENA_SIMPLE_STAT_SET2(_vmask, _esmp, _smask, _stat, _record) \ - SIENA_SIMPLE_STAT_SET(_vmask, _esmp, _smask, _stat, \ + SIENA_SIMPLE_STAT_SET(_vmask, _esmp, _smask, _stat, \ MC_CMD_ ## _record, \ EFX_PHY_STAT_ ## _record) From owner-svn-src-all@freebsd.org Sat Dec 31 11:09:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC01CC9903A; Sat, 31 Dec 2016 11:09:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A281A11B3; Sat, 31 Dec 2016 11:09:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVB91cX041478; Sat, 31 Dec 2016 11:09:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVB915s041474; Sat, 31 Dec 2016 11:09:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311109.uBVB915s041474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310927 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:09:02 -0000 Author: arybchik Date: Sat Dec 31 11:09:01 2016 New Revision: 310927 URL: https://svnweb.freebsd.org/changeset/base/310927 Log: MFC r310690 sfxge(4): cleanup: add const qualifier to const array pointer Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_ev.c stable/11/sys/dev/sfxge/common/efx_mac.c stable/11/sys/dev/sfxge/common/efx_mon.c stable/11/sys/dev/sfxge/common/efx_phy.c stable/11/sys/dev/sfxge/common/efx_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:07:44 2016 (r310926) +++ stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:09:01 2016 (r310927) @@ -1357,8 +1357,8 @@ fail1: #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock b693ddf85aee1bfd */ -static const char *__efx_ev_qstat_name[] = { +/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock c0f3bc5083b40532 */ +static const char * const __efx_ev_qstat_name[] = { "all", "rx", "rx_ok", Modified: stable/11/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mac.c Sat Dec 31 11:07:44 2016 (r310926) +++ stable/11/sys/dev/sfxge/common/efx_mac.c Sat Dec 31 11:09:01 2016 (r310927) @@ -515,8 +515,8 @@ efx_mac_filter_default_rxq_clear( #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxMacStatNamesBlock 054d43a31d2d7a45 */ -static const char *__efx_mac_stat_name[] = { +/* START MKCONFIG GENERATED EfxMacStatNamesBlock c11b91b42f922516 */ +static const char * const __efx_mac_stat_name[] = { "rx_octets", "rx_pkts", "rx_unicst_pkts", Modified: stable/11/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mon.c Sat Dec 31 11:07:44 2016 (r310926) +++ stable/11/sys/dev/sfxge/common/efx_mon.c Sat Dec 31 11:09:01 2016 (r310927) @@ -126,8 +126,8 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 31f437eafb0b0437 */ -static const char *__mon_stat_name[] = { +/* START MKCONFIG GENERATED MonitorStatNamesBlock 5daa2a5725ba734b */ +static const char * const __mon_stat_name[] = { "value_2_5v", "value_vccp1", "value_vcc", Modified: stable/11/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_phy.c Sat Dec 31 11:07:44 2016 (r310926) +++ stable/11/sys/dev/sfxge/common/efx_phy.c Sat Dec 31 11:09:01 2016 (r310927) @@ -336,8 +336,8 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED PhyStatNamesBlock d5f79b4bc2c050fe */ -static const char *__efx_phy_stat_name[] = { +/* START MKCONFIG GENERATED PhyStatNamesBlock af9ffa24da3bc100 */ +static const char * const __efx_phy_stat_name[] = { "oui", "pma_pmd_link_up", "pma_pmd_rx_fault", Modified: stable/11/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_tx.c Sat Dec 31 11:07:44 2016 (r310926) +++ stable/11/sys/dev/sfxge/common/efx_tx.c Sat Dec 31 11:09:01 2016 (r310927) @@ -1029,8 +1029,8 @@ siena_tx_qdesc_dma_create( #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 9d8d26a0a5e2c453 */ -static const char *__efx_tx_qstat_name[] = { +/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 2866874ecd7a363b */ +static const char * const __efx_tx_qstat_name[] = { "post", "post_pio", }; From owner-svn-src-all@freebsd.org Sat Dec 31 11:10:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1508C99190; Sat, 31 Dec 2016 11:10:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7015F13B9; Sat, 31 Dec 2016 11:10:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBA1U0041597; Sat, 31 Dec 2016 11:10:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBA1jL041595; Sat, 31 Dec 2016 11:10:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311110.uBVBA1jL041595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310928 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:10:02 -0000 Author: arybchik Date: Sat Dec 31 11:10:01 2016 New Revision: 310928 URL: https://svnweb.freebsd.org/changeset/base/310928 Log: MFC r310691 sfxge(4): make strings array pointer itself immutable Found by DPDK checkpatches.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_mon.c stable/11/sys/dev/sfxge/common/efx_port.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mon.c Sat Dec 31 11:09:01 2016 (r310927) +++ stable/11/sys/dev/sfxge/common/efx_mon.c Sat Dec 31 11:10:01 2016 (r310928) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_NAMES -static const char *__efx_mon_name[] = { +static const char * const __efx_mon_name[] = { "", "sfx90x0", "sfx91x0", Modified: stable/11/sys/dev/sfxge/common/efx_port.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_port.c Sat Dec 31 11:09:01 2016 (r310927) +++ stable/11/sys/dev/sfxge/common/efx_port.c Sat Dec 31 11:10:01 2016 (r310928) @@ -172,7 +172,7 @@ fail1: #if EFSYS_OPT_NAMES -static const char *__efx_loopback_type_name[] = { +static const char * const __efx_loopback_type_name[] = { "OFF", "DATA", "GMAC", From owner-svn-src-all@freebsd.org Sat Dec 31 11:11:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6525AC992CE; Sat, 31 Dec 2016 11:11:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 279901640; Sat, 31 Dec 2016 11:11:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBB5eu041719; Sat, 31 Dec 2016 11:11:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBB5G9041716; Sat, 31 Dec 2016 11:11:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311111.uBVBB5G9041716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310929 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:11:06 -0000 Author: arybchik Date: Sat Dec 31 11:11:04 2016 New Revision: 310929 URL: https://svnweb.freebsd.org/changeset/base/310929 Log: MFC r310692 sfxge(4): enclose macro complex value in parenthesis Found by DPDK checkpatches.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c stable/11/sys/dev/sfxge/common/efx_types.h stable/11/sys/dev/sfxge/common/mcdi_mon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_bootcfg.c Sat Dec 31 11:10:01 2016 (r310928) +++ stable/11/sys/dev/sfxge/common/efx_bootcfg.c Sat Dec 31 11:11:04 2016 (r310929) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); */ #define BOOTCFG_MAX_SIZE 0x1000 -#define DHCP_END (uint8_t)0xff -#define DHCP_PAD (uint8_t)0 +#define DHCP_END ((uint8_t)0xff) +#define DHCP_PAD ((uint8_t)0) static __checkReturn uint8_t efx_bootcfg_csum( Modified: stable/11/sys/dev/sfxge/common/efx_types.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 11:10:01 2016 (r310928) +++ stable/11/sys/dev/sfxge/common/efx_types.h Sat Dec 31 11:11:04 2016 (r310929) @@ -264,37 +264,37 @@ typedef union efx_oword_u { #if EFSYS_IS_BIG_ENDIAN -#define __CPU_TO_LE_16(_x) (uint16_t)__SWAP16(_x) -#define __LE_TO_CPU_16(_x) (uint16_t)__SWAP16(_x) -#define __CPU_TO_BE_16(_x) (uint16_t)__NOSWAP16(_x) -#define __BE_TO_CPU_16(_x) (uint16_t)__NOSWAP16(_x) - -#define __CPU_TO_LE_32(_x) (uint32_t)__SWAP32(_x) -#define __LE_TO_CPU_32(_x) (uint32_t)__SWAP32(_x) -#define __CPU_TO_BE_32(_x) (uint32_t)__NOSWAP32(_x) -#define __BE_TO_CPU_32(_x) (uint32_t)__NOSWAP32(_x) - -#define __CPU_TO_LE_64(_x) (uint64_t)__SWAP64(_x) -#define __LE_TO_CPU_64(_x) (uint64_t)__SWAP64(_x) -#define __CPU_TO_BE_64(_x) (uint64_t)__NOSWAP64(_x) -#define __BE_TO_CPU_64(_x) (uint64_t)__NOSWAP64(_x) +#define __CPU_TO_LE_16(_x) ((uint16_t)__SWAP16(_x)) +#define __LE_TO_CPU_16(_x) ((uint16_t)__SWAP16(_x)) +#define __CPU_TO_BE_16(_x) ((uint16_t)__NOSWAP16(_x)) +#define __BE_TO_CPU_16(_x) ((uint16_t)__NOSWAP16(_x)) + +#define __CPU_TO_LE_32(_x) ((uint32_t)__SWAP32(_x)) +#define __LE_TO_CPU_32(_x) ((uint32_t)__SWAP32(_x)) +#define __CPU_TO_BE_32(_x) ((uint32_t)__NOSWAP32(_x)) +#define __BE_TO_CPU_32(_x) ((uint32_t)__NOSWAP32(_x)) + +#define __CPU_TO_LE_64(_x) ((uint64_t)__SWAP64(_x)) +#define __LE_TO_CPU_64(_x) ((uint64_t)__SWAP64(_x)) +#define __CPU_TO_BE_64(_x) ((uint64_t)__NOSWAP64(_x)) +#define __BE_TO_CPU_64(_x) ((uint64_t)__NOSWAP64(_x)) #elif EFSYS_IS_LITTLE_ENDIAN -#define __CPU_TO_LE_16(_x) (uint16_t)__NOSWAP16(_x) -#define __LE_TO_CPU_16(_x) (uint16_t)__NOSWAP16(_x) -#define __CPU_TO_BE_16(_x) (uint16_t)__SWAP16(_x) -#define __BE_TO_CPU_16(_x) (uint16_t)__SWAP16(_x) - -#define __CPU_TO_LE_32(_x) (uint32_t)__NOSWAP32(_x) -#define __LE_TO_CPU_32(_x) (uint32_t)__NOSWAP32(_x) -#define __CPU_TO_BE_32(_x) (uint32_t)__SWAP32(_x) -#define __BE_TO_CPU_32(_x) (uint32_t)__SWAP32(_x) - -#define __CPU_TO_LE_64(_x) (uint64_t)__NOSWAP64(_x) -#define __LE_TO_CPU_64(_x) (uint64_t)__NOSWAP64(_x) -#define __CPU_TO_BE_64(_x) (uint64_t)__SWAP64(_x) -#define __BE_TO_CPU_64(_x) (uint64_t)__SWAP64(_x) +#define __CPU_TO_LE_16(_x) ((uint16_t)__NOSWAP16(_x)) +#define __LE_TO_CPU_16(_x) ((uint16_t)__NOSWAP16(_x)) +#define __CPU_TO_BE_16(_x) ((uint16_t)__SWAP16(_x)) +#define __BE_TO_CPU_16(_x) ((uint16_t)__SWAP16(_x)) + +#define __CPU_TO_LE_32(_x) ((uint32_t)__NOSWAP32(_x)) +#define __LE_TO_CPU_32(_x) ((uint32_t)__NOSWAP32(_x)) +#define __CPU_TO_BE_32(_x) ((uint32_t)__SWAP32(_x)) +#define __BE_TO_CPU_32(_x) ((uint32_t)__SWAP32(_x)) + +#define __CPU_TO_LE_64(_x) ((uint64_t)__NOSWAP64(_x)) +#define __LE_TO_CPU_64(_x) ((uint64_t)__NOSWAP64(_x)) +#define __CPU_TO_BE_64(_x) ((uint64_t)__SWAP64(_x)) +#define __BE_TO_CPU_64(_x) ((uint64_t)__SWAP64(_x)) #else Modified: stable/11/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- stable/11/sys/dev/sfxge/common/mcdi_mon.c Sat Dec 31 11:10:01 2016 (r310928) +++ stable/11/sys/dev/sfxge/common/mcdi_mon.c Sat Dec 31 11:11:04 2016 (r310929) @@ -38,8 +38,8 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MON_STATS -#define MCDI_MON_NEXT_PAGE (uint16_t)0xfffe -#define MCDI_MON_INVALID_SENSOR (uint16_t)0xfffd +#define MCDI_MON_NEXT_PAGE ((uint16_t)0xfffe) +#define MCDI_MON_INVALID_SENSOR ((uint16_t)0xfffd) #define MCDI_MON_PAGE_SIZE 0x20 /* Bitmasks of valid port(s) for each sensor */ From owner-svn-src-all@freebsd.org Sat Dec 31 11:12:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1160C99438; Sat, 31 Dec 2016 11:12:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBD5619D2; Sat, 31 Dec 2016 11:12:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBCQTw045310; Sat, 31 Dec 2016 11:12:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBCQEf045304; Sat, 31 Dec 2016 11:12:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311112.uBVBCQEf045304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310930 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:12:28 -0000 Author: arybchik Date: Sat Dec 31 11:12:26 2016 New Revision: 310930 URL: https://svnweb.freebsd.org/changeset/base/310930 Log: MFC r310693 sfxge(4): cleanup: avoid unspecified unsigned Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c stable/11/sys/dev/sfxge/common/ef10_filter.c stable/11/sys/dev/sfxge/common/ef10_nvram.c stable/11/sys/dev/sfxge/common/efx_ev.c stable/11/sys/dev/sfxge/common/efx_filter.c stable/11/sys/dev/sfxge/common/siena_vpd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_ev.c Sat Dec 31 11:11:04 2016 (r310929) +++ stable/11/sys/dev/sfxge/common/ef10_ev.c Sat Dec 31 11:12:26 2016 (r310930) @@ -990,7 +990,7 @@ ef10_ev_mcdi( __in_opt void *arg) { efx_nic_t *enp = eep->ee_enp; - unsigned code; + unsigned int code; boolean_t should_abort = B_FALSE; EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE); Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_filter.c Sat Dec 31 11:11:04 2016 (r310929) +++ stable/11/sys/dev/sfxge/common/ef10_filter.c Sat Dec 31 11:12:26 2016 (r310930) @@ -1246,7 +1246,7 @@ ef10_filter_reconfigure( efx_nic_cfg_t *encp = &enp->en_nic_cfg; ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_flag_t filter_flags; - unsigned i; + unsigned int i; efx_rc_t all_unicst_rc = 0; efx_rc_t all_mulcst_rc = 0; efx_rc_t rc; Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:11:04 2016 (r310929) +++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:12:26 2016 (r310930) @@ -772,7 +772,7 @@ ef10_nvram_buffer_create( struct tlv_partition_header header; struct tlv_partition_trailer trailer; - unsigned min_buf_size = sizeof (struct tlv_partition_header) + + unsigned int min_buf_size = sizeof (struct tlv_partition_header) + sizeof (struct tlv_partition_trailer); if (partn_size < min_buf_size) { rc = EINVAL; Modified: stable/11/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:11:04 2016 (r310929) +++ stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:12:26 2016 (r310930) @@ -953,7 +953,7 @@ siena_ev_mcdi( __in_opt void *arg) { efx_nic_t *enp = eep->ee_enp; - unsigned code; + unsigned int code; boolean_t should_abort = B_FALSE; EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); Modified: stable/11/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:11:04 2016 (r310929) +++ stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:12:26 2016 (r310930) @@ -970,7 +970,7 @@ siena_filter_search( __out int *filter_index, __out unsigned int *depth_required) { - unsigned hash, incr, filter_idx, depth; + unsigned int hash, incr, filter_idx, depth; hash = siena_filter_tbl_hash(key); incr = siena_filter_tbl_increment(key); Modified: stable/11/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_vpd.c Sat Dec 31 11:11:04 2016 (r310929) +++ stable/11/sys/dev/sfxge/common/siena_vpd.c Sat Dec 31 11:12:26 2016 (r310930) @@ -160,7 +160,7 @@ siena_vpd_init( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); caddr_t svpd = NULL; - unsigned partn; + unsigned int partn; size_t size = 0; efx_rc_t rc; From owner-svn-src-all@freebsd.org Sat Dec 31 11:13:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8E9AC99494; Sat, 31 Dec 2016 11:13:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83DBB1B35; Sat, 31 Dec 2016 11:13:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBD0EH045389; Sat, 31 Dec 2016 11:13:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBD0i9045388; Sat, 31 Dec 2016 11:13:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311113.uBVBD0i9045388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 11:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310931 - head/contrib/bsnmp/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:13:01 -0000 Author: ngie Date: Sat Dec 31 11:13:00 2016 New Revision: 310931 URL: https://svnweb.freebsd.org/changeset/base/310931 Log: Use strdup in snmp_parse_server(..) when possible instead of malloc+strcpy This simplifies the code and mutes a Coverity warning about sc->cport being improperly allocated Reported by: Coverity CID: 1018247 MFC after: 1 week Modified: head/contrib/bsnmp/lib/snmpclient.c Modified: head/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:12:26 2016 (r310930) +++ head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:13:00 2016 (r310931) @@ -1937,20 +1937,18 @@ snmp_parse_server(struct snmp_client *sc } /* port */ free(sc->cport); - if ((sc->cport = malloc(strlen(p + 1) + 1)) == NULL) { + if ((sc->cport = strdup(p + 1)) == NULL) { seterr(sc, "%s", strerror(errno)); return (-1); } - strcpy(sc->cport, p + 1); } else if (p > s) { /* host */ free(sc->chost); - if ((sc->chost = malloc(strlen(s) + 1)) == NULL) { + if ((sc->chost = strdup(strlen(s))) == NULL) { seterr(sc, "%s", strerror(errno)); return (-1); } - strcpy(sc->chost, s); } return (0); } From owner-svn-src-all@freebsd.org Sat Dec 31 11:13:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28EB6C994D7; Sat, 31 Dec 2016 11:13:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB5081C41; Sat, 31 Dec 2016 11:13:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBDNCo045449; Sat, 31 Dec 2016 11:13:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBDNAd045446; Sat, 31 Dec 2016 11:13:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311113.uBVBDNAd045446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310932 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:13:25 -0000 Author: arybchik Date: Sat Dec 31 11:13:23 2016 New Revision: 310932 URL: https://svnweb.freebsd.org/changeset/base/310932 Log: MFC r310694 sfxge(4): cleanup: add missing spaces Found by DPDK checkpatch.sh Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_impl.h stable/11/sys/dev/sfxge/common/efx_mcdi.c stable/11/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:13:00 2016 (r310931) +++ stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:13:23 2016 (r310932) @@ -124,7 +124,7 @@ typedef struct efx_tx_ops_s { void (*etxo_qenable)(efx_txq_t *); efx_rc_t (*etxo_qpio_enable)(efx_txq_t *); void (*etxo_qpio_disable)(efx_txq_t *); - efx_rc_t (*etxo_qpio_write)(efx_txq_t *,uint8_t *, size_t, + efx_rc_t (*etxo_qpio_write)(efx_txq_t *, uint8_t *, size_t, size_t); efx_rc_t (*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int, unsigned int *); @@ -801,7 +801,7 @@ struct efx_txq_s { #else #define EFX_CHECK_REG(_enp, _reg) do { \ _NOTE(CONSTANTCONDITION) \ - } while(B_FALSE) + } while (B_FALSE) #endif #define EFX_BAR_READD(_enp, _reg, _edp, _lock) \ Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Dec 31 11:13:00 2016 (r310931) +++ stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Dec 31 11:13:23 2016 (r310932) @@ -1765,7 +1765,7 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable, MAC_STATS_IN_PERIODIC_ENABLE, enable | events, MAC_STATS_IN_PERIODIC_NOEVENT, !events, - MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000: 0); + MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0); if (esmp != NULL) { int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); Modified: stable/11/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/medford_nic.c Sat Dec 31 11:13:00 2016 (r310931) +++ stable/11/sys/dev/sfxge/common/medford_nic.c Sat Dec 31 11:13:23 2016 (r310932) @@ -66,7 +66,7 @@ efx_mcdi_get_rxdp_config( /* RX DMA end padding is disabled */ end_padding = 0; } else { - switch(MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: end_padding = 64; From owner-svn-src-all@freebsd.org Sat Dec 31 11:14:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88B8C9955A; Sat, 31 Dec 2016 11:14:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7783B1E29; Sat, 31 Dec 2016 11:14:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBE3nZ045542; Sat, 31 Dec 2016 11:14:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBE3ba045541; Sat, 31 Dec 2016 11:14:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311114.uBVBE3ba045541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310933 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:14:04 -0000 Author: arybchik Date: Sat Dec 31 11:14:03 2016 New Revision: 310933 URL: https://svnweb.freebsd.org/changeset/base/310933 Log: MFC r310695 sfxge(4): fix defined-but-not-used warning if neither VPD nor NVRAM opt enabled Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/siena_nic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_nic.c Sat Dec 31 11:13:23 2016 (r310932) +++ stable/11/sys/dev/sfxge/common/siena_nic.c Sat Dec 31 11:14:03 2016 (r310933) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA +#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM + static __checkReturn efx_rc_t siena_nic_get_partn_mask( __in efx_nic_t *enp, @@ -78,6 +80,8 @@ fail1: return (rc); } +#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */ + static __checkReturn efx_rc_t siena_board_cfg( __in efx_nic_t *enp) From owner-svn-src-all@freebsd.org Sat Dec 31 11:15:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF5B2C995DC; Sat, 31 Dec 2016 11:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0B61FA4; Sat, 31 Dec 2016 11:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBFPh4045650; Sat, 31 Dec 2016 11:15:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBFPuD045646; Sat, 31 Dec 2016 11:15:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311115.uBVBFPuD045646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310934 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:15:26 -0000 Author: arybchik Date: Sat Dec 31 11:15:25 2016 New Revision: 310934 URL: https://svnweb.freebsd.org/changeset/base/310934 Log: MFC r310696 sfxge(4): cleanup: improve prefast annotations Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h stable/11/sys/dev/sfxge/common/ef10_mcdi.c stable/11/sys/dev/sfxge/common/siena_impl.h stable/11/sys/dev/sfxge/common/siena_mcdi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:14:03 2016 (r310933) +++ stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:15:25 2016 (r310934) @@ -296,11 +296,11 @@ ef10_mcdi_fini( extern void ef10_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len); + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t ef10_mcdi_poll_response( Modified: stable/11/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_mcdi.c Sat Dec 31 11:14:03 2016 (r310933) +++ stable/11/sys/dev/sfxge/common/ef10_mcdi.c Sat Dec 31 11:15:25 2016 (r310934) @@ -110,11 +110,11 @@ ef10_mcdi_fini( void ef10_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len) + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len) { const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efsys_mem_t *esmp = emtp->emt_dma_mem; Modified: stable/11/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_impl.h Sat Dec 31 11:14:03 2016 (r310933) +++ stable/11/sys/dev/sfxge/common/siena_impl.h Sat Dec 31 11:15:25 2016 (r310934) @@ -96,11 +96,11 @@ siena_mcdi_init( extern void siena_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len); + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len); extern __checkReturn boolean_t siena_mcdi_poll_response( Modified: stable/11/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- stable/11/sys/dev/sfxge/common/siena_mcdi.c Sat Dec 31 11:14:03 2016 (r310933) +++ stable/11/sys/dev/sfxge/common/siena_mcdi.c Sat Dec 31 11:15:25 2016 (r310934) @@ -54,11 +54,11 @@ __FBSDID("$FreeBSD$"); void siena_mcdi_send_request( - __in efx_nic_t *enp, - __in void *hdrp, - __in size_t hdr_len, - __in void *sdup, - __in size_t sdu_len) + __in efx_nic_t *enp, + __in_bcount(hdr_len) void *hdrp, + __in size_t hdr_len, + __in_bcount(sdu_len) void *sdup, + __in size_t sdu_len) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_dword_t dword; From owner-svn-src-all@freebsd.org Sat Dec 31 11:16:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73561C99647; Sat, 31 Dec 2016 11:16:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E0361107; Sat, 31 Dec 2016 11:16:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBGZJw045752; Sat, 31 Dec 2016 11:16:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBGZV2045749; Sat, 31 Dec 2016 11:16:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311116.uBVBGZV2045749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310935 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:16:36 -0000 Author: arybchik Date: Sat Dec 31 11:16:35 2016 New Revision: 310935 URL: https://svnweb.freebsd.org/changeset/base/310935 Log: MFC r310699 sfxge(4): rename hunt_bist_* methods to ef10_bist_* Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_phy.c stable/11/sys/dev/sfxge/common/hunt_impl.h stable/11/sys/dev/sfxge/common/hunt_phy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_phy.c Sat Dec 31 11:15:25 2016 (r310934) +++ stable/11/sys/dev/sfxge/common/efx_phy.c Sat Dec 31 11:16:35 2016 (r310935) @@ -65,11 +65,10 @@ static const efx_phy_ops_t __efx_phy_ef1 ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_BIST - /* FIXME: Are these BIST methods appropriate for Medford? */ - hunt_bist_enable_offline, /* epo_bist_enable_offline */ - hunt_bist_start, /* epo_bist_start */ - hunt_bist_poll, /* epo_bist_poll */ - hunt_bist_stop, /* epo_bist_stop */ + ef10_bist_enable_offline, /* epo_bist_enable_offline */ + ef10_bist_start, /* epo_bist_start */ + ef10_bist_poll, /* epo_bist_poll */ + ef10_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: stable/11/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/hunt_impl.h Sat Dec 31 11:15:25 2016 (r310934) +++ stable/11/sys/dev/sfxge/common/hunt_impl.h Sat Dec 31 11:16:35 2016 (r310935) @@ -75,16 +75,16 @@ hunt_board_cfg( #if EFSYS_OPT_BIST extern __checkReturn efx_rc_t -hunt_bist_enable_offline( +ef10_bist_enable_offline( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_bist_start( +ef10_bist_start( __in efx_nic_t *enp, __in efx_bist_type_t type); extern __checkReturn efx_rc_t -hunt_bist_poll( +ef10_bist_poll( __in efx_nic_t *enp, __in efx_bist_type_t type, __out efx_bist_result_t *resultp, @@ -95,7 +95,7 @@ hunt_bist_poll( __in size_t count); extern void -hunt_bist_stop( +ef10_bist_stop( __in efx_nic_t *enp, __in efx_bist_type_t type); Modified: stable/11/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/hunt_phy.c Sat Dec 31 11:15:25 2016 (r310934) +++ stable/11/sys/dev/sfxge/common/hunt_phy.c Sat Dec 31 11:16:35 2016 (r310935) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_BIST __checkReturn efx_rc_t -hunt_bist_enable_offline( +ef10_bist_enable_offline( __in efx_nic_t *enp) { efx_rc_t rc; @@ -56,7 +56,7 @@ fail1: } __checkReturn efx_rc_t -hunt_bist_start( +ef10_bist_start( __in efx_nic_t *enp, __in efx_bist_type_t type) { @@ -74,7 +74,7 @@ fail1: } __checkReturn efx_rc_t -hunt_bist_poll( +ef10_bist_poll( __in efx_nic_t *enp, __in efx_bist_type_t type, __out efx_bist_result_t *resultp, @@ -179,11 +179,11 @@ fail1: } void -hunt_bist_stop( +ef10_bist_stop( __in efx_nic_t *enp, __in efx_bist_type_t type) { - /* There is no way to stop BIST on Huntinton. */ + /* There is no way to stop BIST on EF10. */ _NOTE(ARGUNUSED(enp, type)) } From owner-svn-src-all@freebsd.org Sat Dec 31 11:17:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FB8C996B6; Sat, 31 Dec 2016 11:17:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CABB7127F; Sat, 31 Dec 2016 11:17:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBHhM0045866; Sat, 31 Dec 2016 11:17:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBHhYu045865; Sat, 31 Dec 2016 11:17:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311117.uBVBHhYu045865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310936 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:17:45 -0000 Author: arybchik Date: Sat Dec 31 11:17:43 2016 New Revision: 310936 URL: https://svnweb.freebsd.org/changeset/base/310936 Log: MFC r310704 sfxge(4): translate MC_CMD_ERR_ERANGE to host errno value This is needed because MCDI command MC_CMD_REKEY can return MC_CMD_ERR_ERANGE. Submitted by: Tom Millington Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Dec 31 11:16:35 2016 (r310935) +++ stable/11/sys/dev/sfxge/common/efx_mcdi.c Sat Dec 31 11:17:43 2016 (r310936) @@ -646,6 +646,8 @@ efx_mcdi_request_errcode( case MC_CMD_ERR_ENOSPC: return (ENOSPC); #endif + case MC_CMD_ERR_ERANGE: + return (ERANGE); case MC_CMD_ERR_ALLOC_FAIL: return (ENOMEM); From owner-svn-src-all@freebsd.org Sat Dec 31 11:18:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61655C9973C; Sat, 31 Dec 2016 11:18:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 307781439; Sat, 31 Dec 2016 11:18:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBIMvV045950; Sat, 31 Dec 2016 11:18:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBIMqF045949; Sat, 31 Dec 2016 11:18:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311118.uBVBIMqF045949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310937 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:18:23 -0000 Author: arybchik Date: Sat Dec 31 11:18:22 2016 New Revision: 310937 URL: https://svnweb.freebsd.org/changeset/base/310937 Log: MFC r310708 sfxge(4): do not initialize enumerated type variable to another type Fix build warning generated by ICC. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_nic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_nic.c Sat Dec 31 11:17:43 2016 (r310936) +++ stable/11/sys/dev/sfxge/common/efx_nic.c Sat Dec 31 11:18:22 2016 (r310937) @@ -556,7 +556,7 @@ efx_nic_destroy( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0); - enp->en_family = 0; + enp->en_family = EFX_FAMILY_INVALID; enp->en_esip = NULL; enp->en_esbp = NULL; enp->en_eslp = NULL; From owner-svn-src-all@freebsd.org Sat Dec 31 11:19:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E3FC99856; Sat, 31 Dec 2016 11:19:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 528B216C2; Sat, 31 Dec 2016 11:19:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBJe7R046056; Sat, 31 Dec 2016 11:19:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBJeIv046055; Sat, 31 Dec 2016 11:19:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311119.uBVBJeIv046055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310938 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:19:41 -0000 Author: arybchik Date: Sat Dec 31 11:19:40 2016 New Revision: 310938 URL: https://svnweb.freebsd.org/changeset/base/310938 Log: MFC r310709 sfxge(4): fix invalid type of eft_unicst_filter_count Found by clang when boolean_t is defined as bool for DPDK PMD. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:18:22 2016 (r310937) +++ stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:19:40 2016 (r310938) @@ -954,7 +954,7 @@ typedef struct ef10_filter_table_s { boolean_t eft_using_rss; uint32_t eft_unicst_filter_indexes[ EFX_EF10_FILTER_UNICAST_FILTERS_MAX]; - boolean_t eft_unicst_filter_count; + uint32_t eft_unicst_filter_count; uint32_t eft_mulcst_filter_indexes[ EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; uint32_t eft_mulcst_filter_count; From owner-svn-src-all@freebsd.org Sat Dec 31 11:21:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 833F0C99A36; Sat, 31 Dec 2016 11:21:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 442BE1A6F; Sat, 31 Dec 2016 11:21:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBLoIC049162; Sat, 31 Dec 2016 11:21:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBLnKw049156; Sat, 31 Dec 2016 11:21:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311121.uBVBLnKw049156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310939 - in stable/11/sys/dev/sfxge: . common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:21:51 -0000 Author: arybchik Date: Sat Dec 31 11:21:49 2016 New Revision: 310939 URL: https://svnweb.freebsd.org/changeset/base/310939 Log: MFC r310713 sfxge(4): add possibility to control event queue performance profile It is ignored on SFN5xxx/6xxx (aka Siena). Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c stable/11/sys/dev/sfxge/common/ef10_impl.h stable/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_ev.c stable/11/sys/dev/sfxge/common/efx_impl.h stable/11/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_ev.c Sat Dec 31 11:19:40 2016 (r310938) +++ stable/11/sys/dev/sfxge/common/ef10_ev.c Sat Dec 31 11:21:49 2016 (r310939) @@ -140,6 +140,7 @@ efx_mcdi_init_evq( __in size_t nevs, __in uint32_t irq, __in uint32_t us, + __in uint32_t flags, __in boolean_t low_latency) { efx_mcdi_req_t req; @@ -178,7 +179,20 @@ efx_mcdi_init_evq( * So always enable RX and TX event batching, and enable event cut * through if we want low latency operation. */ - ev_cut_through = low_latency ? 1 : 0; + switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) { + case EFX_EVQ_FLAGS_TYPE_AUTO: + ev_cut_through = low_latency ? 1 : 0; + break; + case EFX_EVQ_FLAGS_TYPE_THROUGHPUT: + ev_cut_through = 0; + break; + case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY: + ev_cut_through = 1; + break; + default: + rc = EINVAL; + goto fail2; + } MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS, INIT_EVQ_IN_FLAG_INTERRUPTING, 1, INIT_EVQ_IN_FLAG_RPTR_DOS, 0, @@ -197,7 +211,7 @@ efx_mcdi_init_evq( unsigned int ticks; if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) - goto fail2; + goto fail3; MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF); @@ -225,18 +239,20 @@ efx_mcdi_init_evq( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail3; + goto fail4; } if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) { rc = EMSGSIZE; - goto fail4; + goto fail5; } /* NOTE: ignore the returned IRQ param as firmware does not set it. */ return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: @@ -257,12 +273,14 @@ efx_mcdi_init_evq_v2( __in efsys_mem_t *esmp, __in size_t nevs, __in uint32_t irq, - __in uint32_t us) + __in uint32_t us, + __in uint32_t flags) { efx_mcdi_req_t req; uint8_t payload[ MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), MC_CMD_INIT_EVQ_V2_OUT_LEN)]; + unsigned int evq_type; efx_qword_t *dma_addr; uint64_t addr; int npages; @@ -286,11 +304,25 @@ efx_mcdi_init_evq_v2( MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance); MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq); + switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) { + case EFX_EVQ_FLAGS_TYPE_AUTO: + evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO; + break; + case EFX_EVQ_FLAGS_TYPE_THROUGHPUT: + evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT; + break; + case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY: + evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY; + break; + default: + rc = EINVAL; + goto fail2; + } MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS, INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1, INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0, INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0, - INIT_EVQ_V2_IN_FLAG_TYPE, MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO); + INIT_EVQ_V2_IN_FLAG_TYPE, evq_type); /* If the value is zero then disable the timer */ if (us == 0) { @@ -302,7 +334,7 @@ efx_mcdi_init_evq_v2( unsigned int ticks; if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) - goto fail2; + goto fail3; MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE, MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF); @@ -330,12 +362,12 @@ efx_mcdi_init_evq_v2( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail3; + goto fail4; } if (req.emr_out_length_used < MC_CMD_INIT_EVQ_V2_OUT_LEN) { rc = EMSGSIZE; - goto fail4; + goto fail5; } /* NOTE: ignore the returned IRQ param as firmware does not set it. */ @@ -345,6 +377,8 @@ efx_mcdi_init_evq_v2( return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: @@ -416,6 +450,7 @@ ef10_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -459,29 +494,30 @@ ef10_ev_qcreate( if (encp->enc_init_evq_v2_supported) { /* * On Medford the low latency license is required to enable RX - * and event cut through and to disable RX batching. We let the - * firmware decide the settings to use. If the adapter has a low - * latency license, it will choose the best settings for low - * latency, otherwise it choose the best settings for - * throughput. + * and event cut through and to disable RX batching. If event + * queue type in flags is auto, we let the firmware decide the + * settings to use. If the adapter has a low latency license, + * it will choose the best settings for low latency, otherwise + * it will choose the best settings for throughput. */ - rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us); + rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us, flags); if (rc != 0) goto fail4; } else { /* - * On Huntington we need to specify the settings to use. We - * favour latency if the adapter is running low-latency firmware - * and throughput otherwise, and assume not support RX batching - * implies the adapter is running low-latency firmware. (This - * is how it's been done since Huntington GA. It doesn't make - * much sense with hindsight as the 'low-latency' firmware - * variant is also best for throughput, and does now support RX - * batching). + * On Huntington we need to specify the settings to use. + * If event queue type in flags is auto, we favour throughput + * if the adapter is running virtualization supporting firmware + * (i.e. the full featured firmware variant) + * and latency otherwise. The Ethernet Virtual Bridging + * capability is used to make this decision. (Note though that + * the low latency firmware variant is also best for + * throughput and corresponding type should be specified + * to choose it.) */ - boolean_t low_latency = encp->enc_rx_batching_enabled ? 0 : 1; - rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, - low_latency); + boolean_t low_latency = encp->enc_datapath_cap_evb ? 0 : 1; + rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, flags, + low_latency); if (rc != 0) goto fail5; } Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:19:40 2016 (r310938) +++ stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:21:49 2016 (r310939) @@ -85,6 +85,7 @@ ef10_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep); void Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:19:40 2016 (r310938) +++ stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:21:49 2016 (r310939) @@ -1595,6 +1595,11 @@ efx_ev_fini( #define EFX_EVQ_SIZE(_nevs) ((_nevs) * sizeof (efx_qword_t)) #define EFX_EVQ_NBUFS(_nevs) (EFX_EVQ_SIZE(_nevs) / EFX_BUF_SIZE) +#define EFX_EVQ_FLAGS_TYPE_MASK (0x3) +#define EFX_EVQ_FLAGS_TYPE_AUTO (0x0) +#define EFX_EVQ_FLAGS_TYPE_THROUGHPUT (0x1) +#define EFX_EVQ_FLAGS_TYPE_LOW_LATENCY (0x2) + extern __checkReturn efx_rc_t efx_ev_qcreate( __in efx_nic_t *enp, @@ -1603,6 +1608,7 @@ efx_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __deref_out efx_evq_t **eepp); extern void Modified: stable/11/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:19:40 2016 (r310938) +++ stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:21:49 2016 (r310939) @@ -71,6 +71,7 @@ siena_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep); static void @@ -228,6 +229,7 @@ efx_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __deref_out efx_evq_t **eepp) { const efx_ev_ops_t *eevop = enp->en_eevop; @@ -264,7 +266,8 @@ efx_ev_qcreate( enp->en_ev_qcount++; *eepp = eep; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, eep)) != 0) + if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, flags, + eep)) != 0) goto fail2; return (0); @@ -1279,6 +1282,7 @@ siena_ev_qcreate( __in size_t n, __in uint32_t id, __in uint32_t us, + __in uint32_t flags, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); Modified: stable/11/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:19:40 2016 (r310938) +++ stable/11/sys/dev/sfxge/common/efx_impl.h Sat Dec 31 11:21:49 2016 (r310939) @@ -95,7 +95,7 @@ typedef struct efx_ev_ops_s { void (*eevo_fini)(efx_nic_t *); efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int, efsys_mem_t *, size_t, uint32_t, - uint32_t, efx_evq_t *); + uint32_t, uint32_t, efx_evq_t *); void (*eevo_qdestroy)(efx_evq_t *); efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int); void (*eevo_qpost)(efx_evq_t *, uint16_t); Modified: stable/11/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_ev.c Sat Dec 31 11:19:40 2016 (r310938) +++ stable/11/sys/dev/sfxge/sfxge_ev.c Sat Dec 31 11:21:49 2016 (r310939) @@ -703,7 +703,8 @@ sfxge_ev_qstart(struct sfxge_softc *sc, /* Create the common code event queue. */ if ((rc = efx_ev_qcreate(sc->enp, index, esmp, evq->entries, - evq->buf_base_id, sc->ev_moderation, &evq->common)) != 0) + evq->buf_base_id, sc->ev_moderation, EFX_EVQ_FLAGS_TYPE_AUTO, + &evq->common)) != 0) goto fail; SFXGE_EVQ_LOCK(evq); From owner-svn-src-all@freebsd.org Sat Dec 31 11:23:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CC6CC99AAD; Sat, 31 Dec 2016 11:23:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76B471C71; Sat, 31 Dec 2016 11:23:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBN3a8050126; Sat, 31 Dec 2016 11:23:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBN3Fh050125; Sat, 31 Dec 2016 11:23:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311123.uBVBN3Fh050125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310940 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:23:04 -0000 Author: arybchik Date: Sat Dec 31 11:23:03 2016 New Revision: 310940 URL: https://svnweb.freebsd.org/changeset/base/310940 Log: MFC r310714 sfxge(4): support Medford bootcfg partition layout in common code For Siena and Huntington, the per-port bootcfg (aka expcfg) is stored in a dedicated 4Kbyte partition for each port. For Medford, the per-PF bootcfg is stored in a 2Kbyte sector within a single shared partition. Update the common code to support the new bootcfg layout. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_bootcfg.c Sat Dec 31 11:21:49 2016 (r310939) +++ stable/11/sys/dev/sfxge/common/efx_bootcfg.c Sat Dec 31 11:23:03 2016 (r310940) @@ -38,14 +38,69 @@ __FBSDID("$FreeBSD$"); /* * Maximum size of BOOTCFG block across all nics as understood by SFCgPXE. - * A multiple of 0x100 so trailing 0xff characters don't contrinbute to the - * checksum. + * NOTE: This is larger than the Medford per-PF bootcfg sector. */ #define BOOTCFG_MAX_SIZE 0x1000 #define DHCP_END ((uint8_t)0xff) #define DHCP_PAD ((uint8_t)0) + +/* Report size and offset of bootcfg sector in NVRAM partition. */ +static __checkReturn efx_rc_t +efx_bootcfg_sector( + __in efx_nic_t *enp, + __out size_t *offsetp, + __out size_t *max_sizep) +{ + size_t max_size; + size_t offset; + int rc; + + switch (enp->en_family) { +#if EFSYS_OPT_SIENA + case EFX_FAMILY_SIENA: + max_size = BOOTCFG_MAX_SIZE; + offset = 0; + break; +#endif /* EFSYS_OPT_SIENA */ + +#if EFSYS_OPT_HUNTINGTON + case EFX_FAMILY_HUNTINGTON: + max_size = BOOTCFG_MAX_SIZE; + offset = 0; + break; +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: { + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + + /* Shared partition (array indexed by PF) */ + max_size = 0x0800; + offset = max_size * encp->enc_pf; + break; + } +#endif /* EFSYS_OPT_MEDFORD */ + + default: + EFSYS_ASSERT(0); + rc = ENOTSUP; + goto fail1; + } + EFSYS_ASSERT3U(max_size, <=, BOOTCFG_MAX_SIZE); + + *offsetp = offset; + *max_sizep = max_size; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} + + static __checkReturn uint8_t efx_bootcfg_csum( __in efx_nic_t *enp, @@ -136,40 +191,54 @@ efx_bootcfg_read( { uint8_t *payload = NULL; size_t used_bytes; + size_t partn_length; size_t sector_length; + size_t sector_offset; efx_rc_t rc; - rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, §or_length); + rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length); if (rc != 0) goto fail1; + /* The bootcfg sector may be stored in a (larger) shared partition */ + rc = efx_bootcfg_sector(enp, §or_offset, §or_length); + if (rc != 0) + goto fail2; + + if (sector_length > BOOTCFG_MAX_SIZE) + sector_length = BOOTCFG_MAX_SIZE; + + if (sector_offset + sector_length > partn_length) { + /* Partition is too small */ + rc = EFBIG; + goto fail3; + } + /* - * We need to read the entire BOOTCFG area to ensure we read all the + * We need to read the entire BOOTCFG sector to ensure we read all the * tags, because legacy bootcfg sectors are not guaranteed to end with * a DHCP_END character. If the user hasn't supplied a sufficiently * large buffer then use our own buffer. */ - if (sector_length > BOOTCFG_MAX_SIZE) - sector_length = BOOTCFG_MAX_SIZE; if (sector_length > size) { EFSYS_KMEM_ALLOC(enp->en_esip, sector_length, payload); if (payload == NULL) { rc = ENOMEM; - goto fail2; + goto fail4; } } else payload = (uint8_t *)data; if ((rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) - goto fail3; + goto fail5; - rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, 0, + rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset, (caddr_t)payload, sector_length); efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); if (rc != 0) - goto fail4; + goto fail6; /* Verify that the area is correctly formatted and checksummed */ rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, @@ -205,7 +274,7 @@ efx_bootcfg_read( */ if (used_bytes > size) { rc = ENOSPC; - goto fail5; + goto fail7; } if (sector_length > size) { memcpy(data, payload, used_bytes); @@ -224,15 +293,18 @@ efx_bootcfg_read( return (0); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); + if (sector_length > size) + EFSYS_KMEM_FREE(enp->en_esip, sector_length, payload); fail4: EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); - - if (sector_length > size) - EFSYS_KMEM_FREE(enp->en_esip, sector_length, payload); fail2: EFSYS_PROBE(fail2); fail1: @@ -247,90 +319,109 @@ efx_bootcfg_write( __in_bcount(size) caddr_t data, __in size_t size) { - uint8_t *chunk; + uint8_t *partn_data; uint8_t checksum; + size_t partn_length; size_t sector_length; - size_t chunk_length; + size_t sector_offset; size_t used_bytes; - size_t offset; - size_t remaining; efx_rc_t rc; - rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, §or_length); + rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length); if (rc != 0) goto fail1; + /* The bootcfg sector may be stored in a (larger) shared partition */ + rc = efx_bootcfg_sector(enp, §or_offset, §or_length); + if (rc != 0) + goto fail2; + if (sector_length > BOOTCFG_MAX_SIZE) sector_length = BOOTCFG_MAX_SIZE; + if (sector_offset + sector_length > partn_length) { + /* Partition is too small */ + rc = EFBIG; + goto fail3; + } + if ((rc = efx_bootcfg_verify(enp, data, size, &used_bytes)) != 0) - goto fail2; + goto fail4; /* The caller *must* terminate their block with a DHCP_END character */ - EFSYS_ASSERT(used_bytes >= 2); /* checksum and DHCP_END */ - if ((uint8_t)data[used_bytes - 1] != DHCP_END) { + if ((used_bytes < 2) || ((uint8_t)data[used_bytes - 1] != DHCP_END)) { + /* Block too short or DHCP_END missing */ rc = ENOENT; - goto fail3; + goto fail5; } /* Check that the hardware has support for this much data */ if (used_bytes > MIN(sector_length, BOOTCFG_MAX_SIZE)) { rc = ENOSPC; - goto fail4; + goto fail6; } - rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, &chunk_length); - if (rc != 0) - goto fail5; - - EFSYS_KMEM_ALLOC(enp->en_esip, chunk_length, chunk); - if (chunk == NULL) { + /* + * If the BOOTCFG sector is stored in a shared partition, then we must + * read the whole partition and insert the updated bootcfg sector at the + * correct offset. + */ + EFSYS_KMEM_ALLOC(enp->en_esip, partn_length, partn_data); + if (partn_data == NULL) { rc = ENOMEM; - goto fail6; + goto fail7; } - if ((rc = efx_nvram_erase(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) - goto fail7; + rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL); + if (rc != 0) + goto fail8; + + /* Read the entire partition */ + rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, 0, + (caddr_t)partn_data, partn_length); + if (rc != 0) + goto fail9; /* - * Write the entire sector_length bytes of data in chunks. Zero out - * all data following the DHCP_END, and adjust the checksum + * Insert the BOOTCFG sector into the partition, Zero out all data after + * the DHCP_END tag, and adjust the checksum. */ + (void) memset(partn_data + sector_offset, 0x0, sector_length); + (void) memcpy(partn_data + sector_offset, data, used_bytes); + checksum = efx_bootcfg_csum(enp, data, used_bytes); - for (offset = 0; offset < sector_length; offset += remaining) { - remaining = MIN(chunk_length, sector_length - offset); + partn_data[sector_offset] -= checksum; - /* Fill chunk */ - (void) memset(chunk, 0x0, chunk_length); - if (offset < used_bytes) - memcpy(chunk, data + offset, - MIN(remaining, used_bytes - offset)); - - /* Adjust checksum */ - if (offset == 0) - chunk[0] -= checksum; - - if ((rc = efx_nvram_write_chunk(enp, EFX_NVRAM_BOOTROM_CFG, - offset, (caddr_t)chunk, remaining)) != 0) - goto fail8; + if ((rc = efx_nvram_erase(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + goto fail10; + + if ((rc = efx_nvram_write_chunk(enp, EFX_NVRAM_BOOTROM_CFG, + 0, partn_data, partn_length)) != 0) { + goto fail11; } efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); - EFSYS_KMEM_FREE(enp->en_esip, chunk_length, chunk); + EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); return (0); +fail11: + EFSYS_PROBE(fail11); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); + + efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); fail8: EFSYS_PROBE(fail8); + + EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); fail7: EFSYS_PROBE(fail7); - - EFSYS_KMEM_FREE(enp->en_esip, chunk_length, chunk); fail6: EFSYS_PROBE(fail6); - - efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); fail5: EFSYS_PROBE(fail5); fail4: From owner-svn-src-all@freebsd.org Sat Dec 31 11:23:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D62F3C99B0D; Sat, 31 Dec 2016 11:23:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A52C91DD6; Sat, 31 Dec 2016 11:23:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBNh7O050213; Sat, 31 Dec 2016 11:23:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBNhAZ050212; Sat, 31 Dec 2016 11:23:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311123.uBVBNhAZ050212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310941 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:23:44 -0000 Author: arybchik Date: Sat Dec 31 11:23:43 2016 New Revision: 310941 URL: https://svnweb.freebsd.org/changeset/base/310941 Log: MFC r310715 sfxge(4): fix GET_RXDP_CONFIG usage for multi-PF on Medford On Medford, using MC_CMD_GET_RXDP_CONFIG to query the RX end padding setting is in the ADMIN group, and so fails for unprivileged functions. In that case, assume the largest size supported by Medford hardware (256bytes) to prevent overrun. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/11/sys/dev/sfxge/common/medford_nic.c Sat Dec 31 11:23:03 2016 (r310940) +++ stable/11/sys/dev/sfxge/common/medford_nic.c Sat Dec 31 11:23:43 2016 (r310941) @@ -289,8 +289,13 @@ medford_board_cfg( encp->enc_rx_buf_align_start = 1; /* Get the RX DMA end padding alignment configuration */ - if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) - goto fail11; + if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { + if (rc != EACCES) + goto fail11; + + /* Assume largest tail padding size supported by hardware */ + end_padding = 256; + } encp->enc_rx_buf_align_end = end_padding; /* Alignment for WPTR updates */ From owner-svn-src-all@freebsd.org Sat Dec 31 11:24:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6511FC99BA3; Sat, 31 Dec 2016 11:24:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34C971F4F; Sat, 31 Dec 2016 11:24:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBOCGn050300; Sat, 31 Dec 2016 11:24:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBOCBe050299; Sat, 31 Dec 2016 11:24:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311124.uBVBOCBe050299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 11:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310942 - head/contrib/bsnmp/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:24:13 -0000 Author: ngie Date: Sat Dec 31 11:24:12 2016 New Revision: 310942 URL: https://svnweb.freebsd.org/changeset/base/310942 Log: Unbreak the build by passing the string to strdup, not its length MFC after: 1 week X-MFC with: r310931 Pointyhat to: ngie Modified: head/contrib/bsnmp/lib/snmpclient.c Modified: head/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:23:43 2016 (r310941) +++ head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:24:12 2016 (r310942) @@ -1945,7 +1945,7 @@ snmp_parse_server(struct snmp_client *sc } else if (p > s) { /* host */ free(sc->chost); - if ((sc->chost = strdup(strlen(s))) == NULL) { + if ((sc->chost = strdup(s)) == NULL) { seterr(sc, "%s", strerror(errno)); return (-1); } From owner-svn-src-all@freebsd.org Sat Dec 31 11:25:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 171AFC99C09; Sat, 31 Dec 2016 11:25:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C06D210CF; Sat, 31 Dec 2016 11:25:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBOx92050374; Sat, 31 Dec 2016 11:24:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBOxnU050371; Sat, 31 Dec 2016 11:24:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311124.uBVBOxnU050371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310943 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:25:01 -0000 Author: arybchik Date: Sat Dec 31 11:24:59 2016 New Revision: 310943 URL: https://svnweb.freebsd.org/changeset/base/310943 Log: MFC r310716 sfxge(4): add UEFI ROM support to the common code Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c stable/11/sys/dev/sfxge/common/efx.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:24:12 2016 (r310942) +++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:24:59 2016 (r310943) @@ -2175,7 +2175,11 @@ static ef10_parttbl_entry_t medford_part {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} + {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 1, EFX_NVRAM_UEFIROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 2, EFX_NVRAM_UEFIROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 3, EFX_NVRAM_UEFIROM}, + {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 4, EFX_NVRAM_UEFIROM} }; static __checkReturn efx_rc_t Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:24:12 2016 (r310942) +++ stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:24:59 2016 (r310943) @@ -1311,6 +1311,7 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_FPGA_BACKUP, EFX_NVRAM_DYNAMIC_CFG, EFX_NVRAM_LICENSE, + EFX_NVRAM_UEFIROM, EFX_NVRAM_NTYPES, } efx_nvram_type_t; From owner-svn-src-all@freebsd.org Sat Dec 31 11:26:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A217C99CA9; Sat, 31 Dec 2016 11:26:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AED4126C; Sat, 31 Dec 2016 11:26:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBQTSl050493; Sat, 31 Dec 2016 11:26:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBQTo7050489; Sat, 31 Dec 2016 11:26:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311126.uBVBQTo7050489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310944 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:26:30 -0000 Author: arybchik Date: Sat Dec 31 11:26:29 2016 New Revision: 310944 URL: https://svnweb.freebsd.org/changeset/base/310944 Log: MFC r310717 sfxge(4): move BIST methods from hunt_phy.c to ef10_phy.c Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h stable/11/sys/dev/sfxge/common/ef10_phy.c stable/11/sys/dev/sfxge/common/hunt_impl.h stable/11/sys/dev/sfxge/common/hunt_phy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:24:59 2016 (r310943) +++ stable/11/sys/dev/sfxge/common/ef10_impl.h Sat Dec 31 11:26:29 2016 (r310944) @@ -602,6 +602,34 @@ ef10_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ +#if EFSYS_OPT_BIST + +extern __checkReturn efx_rc_t +ef10_bist_enable_offline( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_bist_start( + __in efx_nic_t *enp, + __in efx_bist_type_t type); + +extern __checkReturn efx_rc_t +ef10_bist_poll( + __in efx_nic_t *enp, + __in efx_bist_type_t type, + __out efx_bist_result_t *resultp, + __out_opt __drv_when(count > 0, __notnull) + uint32_t *value_maskp, + __out_ecount_opt(count) __drv_when(count > 0, __notnull) + unsigned long *valuesp, + __in size_t count); + +extern void +ef10_bist_stop( + __in efx_nic_t *enp, + __in efx_bist_type_t type); + +#endif /* EFSYS_OPT_BIST */ /* TX */ Modified: stable/11/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_phy.c Sat Dec 31 11:24:59 2016 (r310943) +++ stable/11/sys/dev/sfxge/common/ef10_phy.c Sat Dec 31 11:26:29 2016 (r310944) @@ -474,4 +474,157 @@ ef10_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ +#if EFSYS_OPT_BIST + + __checkReturn efx_rc_t +ef10_bist_enable_offline( + __in efx_nic_t *enp) +{ + efx_rc_t rc; + + if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_bist_start( + __in efx_nic_t *enp, + __in efx_bist_type_t type) +{ + efx_rc_t rc; + + if ((rc = efx_mcdi_bist_start(enp, type)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_bist_poll( + __in efx_nic_t *enp, + __in efx_bist_type_t type, + __out efx_bist_result_t *resultp, + __out_opt __drv_when(count > 0, __notnull) + uint32_t *value_maskp, + __out_ecount_opt(count) __drv_when(count > 0, __notnull) + unsigned long *valuesp, + __in size_t count) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, + MCDI_CTL_SDU_LEN_MAX)]; + uint32_t value_mask = 0; + uint32_t result; + efx_rc_t rc; + + _NOTE(ARGUNUSED(type)) + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_POLL_BIST; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) { + rc = EMSGSIZE; + goto fail2; + } + + if (count > 0) + (void) memset(valuesp, '\0', count * sizeof (unsigned long)); + + result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT); + + if (result == MC_CMD_POLL_BIST_FAILED && + req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN && + count > EFX_BIST_MEM_ECC_FATAL) { + if (valuesp != NULL) { + valuesp[EFX_BIST_MEM_TEST] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST); + valuesp[EFX_BIST_MEM_ADDR] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR); + valuesp[EFX_BIST_MEM_BUS] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_BUS); + valuesp[EFX_BIST_MEM_EXPECT] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_EXPECT); + valuesp[EFX_BIST_MEM_ACTUAL] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ACTUAL); + valuesp[EFX_BIST_MEM_ECC] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC); + valuesp[EFX_BIST_MEM_ECC_PARITY] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_PARITY); + valuesp[EFX_BIST_MEM_ECC_FATAL] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_FATAL); + } + value_mask |= (1 << EFX_BIST_MEM_TEST) | + (1 << EFX_BIST_MEM_ADDR) | + (1 << EFX_BIST_MEM_BUS) | + (1 << EFX_BIST_MEM_EXPECT) | + (1 << EFX_BIST_MEM_ACTUAL) | + (1 << EFX_BIST_MEM_ECC) | + (1 << EFX_BIST_MEM_ECC_PARITY) | + (1 << EFX_BIST_MEM_ECC_FATAL); + } else if (result == MC_CMD_POLL_BIST_FAILED && + encp->enc_phy_type == EFX_PHY_XFI_FARMI && + req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MRSFP_LEN && + count > EFX_BIST_FAULT_CODE) { + if (valuesp != NULL) + valuesp[EFX_BIST_FAULT_CODE] = + MCDI_OUT_DWORD(req, POLL_BIST_OUT_MRSFP_TEST); + value_mask |= 1 << EFX_BIST_FAULT_CODE; + } + + if (value_maskp != NULL) + *value_maskp = value_mask; + + EFSYS_ASSERT(resultp != NULL); + if (result == MC_CMD_POLL_BIST_RUNNING) + *resultp = EFX_BIST_RESULT_RUNNING; + else if (result == MC_CMD_POLL_BIST_PASSED) + *resultp = EFX_BIST_RESULT_PASSED; + else + *resultp = EFX_BIST_RESULT_FAILED; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + void +ef10_bist_stop( + __in efx_nic_t *enp, + __in efx_bist_type_t type) +{ + /* There is no way to stop BIST on EF10. */ + _NOTE(ARGUNUSED(enp, type)) +} + +#endif /* EFSYS_OPT_BIST */ + #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: stable/11/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- stable/11/sys/dev/sfxge/common/hunt_impl.h Sat Dec 31 11:24:59 2016 (r310943) +++ stable/11/sys/dev/sfxge/common/hunt_impl.h Sat Dec 31 11:26:29 2016 (r310944) @@ -69,39 +69,6 @@ extern __checkReturn efx_rc_t hunt_board_cfg( __in efx_nic_t *enp); - -/* PHY */ - -#if EFSYS_OPT_BIST - -extern __checkReturn efx_rc_t -ef10_bist_enable_offline( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t -ef10_bist_start( - __in efx_nic_t *enp, - __in efx_bist_type_t type); - -extern __checkReturn efx_rc_t -ef10_bist_poll( - __in efx_nic_t *enp, - __in efx_bist_type_t type, - __out efx_bist_result_t *resultp, - __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, - __out_ecount_opt(count) __drv_when(count > 0, __notnull) - unsigned long *valuesp, - __in size_t count); - -extern void -ef10_bist_stop( - __in efx_nic_t *enp, - __in efx_bist_type_t type); - -#endif /* EFSYS_OPT_BIST */ - - #ifdef __cplusplus } #endif Modified: stable/11/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/hunt_phy.c Sat Dec 31 11:24:59 2016 (r310943) +++ stable/11/sys/dev/sfxge/common/hunt_phy.c Sat Dec 31 11:26:29 2016 (r310944) @@ -36,157 +36,4 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON -#if EFSYS_OPT_BIST - - __checkReturn efx_rc_t -ef10_bist_enable_offline( - __in efx_nic_t *enp) -{ - efx_rc_t rc; - - if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_bist_start( - __in efx_nic_t *enp, - __in efx_bist_type_t type) -{ - efx_rc_t rc; - - if ((rc = efx_mcdi_bist_start(enp, type)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_bist_poll( - __in efx_nic_t *enp, - __in efx_bist_type_t type, - __out efx_bist_result_t *resultp, - __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, - __out_ecount_opt(count) __drv_when(count > 0, __notnull) - unsigned long *valuesp, - __in size_t count) -{ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, - MCDI_CTL_SDU_LEN_MAX)]; - uint32_t value_mask = 0; - uint32_t result; - efx_rc_t rc; - - _NOTE(ARGUNUSED(type)) - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_POLL_BIST; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) { - rc = EMSGSIZE; - goto fail2; - } - - if (count > 0) - (void) memset(valuesp, '\0', count * sizeof (unsigned long)); - - result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT); - - if (result == MC_CMD_POLL_BIST_FAILED && - req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN && - count > EFX_BIST_MEM_ECC_FATAL) { - if (valuesp != NULL) { - valuesp[EFX_BIST_MEM_TEST] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST); - valuesp[EFX_BIST_MEM_ADDR] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR); - valuesp[EFX_BIST_MEM_BUS] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_BUS); - valuesp[EFX_BIST_MEM_EXPECT] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_EXPECT); - valuesp[EFX_BIST_MEM_ACTUAL] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ACTUAL); - valuesp[EFX_BIST_MEM_ECC] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC); - valuesp[EFX_BIST_MEM_ECC_PARITY] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_PARITY); - valuesp[EFX_BIST_MEM_ECC_FATAL] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_FATAL); - } - value_mask |= (1 << EFX_BIST_MEM_TEST) | - (1 << EFX_BIST_MEM_ADDR) | - (1 << EFX_BIST_MEM_BUS) | - (1 << EFX_BIST_MEM_EXPECT) | - (1 << EFX_BIST_MEM_ACTUAL) | - (1 << EFX_BIST_MEM_ECC) | - (1 << EFX_BIST_MEM_ECC_PARITY) | - (1 << EFX_BIST_MEM_ECC_FATAL); - } else if (result == MC_CMD_POLL_BIST_FAILED && - encp->enc_phy_type == EFX_PHY_XFI_FARMI && - req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MRSFP_LEN && - count > EFX_BIST_FAULT_CODE) { - if (valuesp != NULL) - valuesp[EFX_BIST_FAULT_CODE] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MRSFP_TEST); - value_mask |= 1 << EFX_BIST_FAULT_CODE; - } - - if (value_maskp != NULL) - *value_maskp = value_mask; - - EFSYS_ASSERT(resultp != NULL); - if (result == MC_CMD_POLL_BIST_RUNNING) - *resultp = EFX_BIST_RESULT_RUNNING; - else if (result == MC_CMD_POLL_BIST_PASSED) - *resultp = EFX_BIST_RESULT_PASSED; - else - *resultp = EFX_BIST_RESULT_FAILED; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - void -ef10_bist_stop( - __in efx_nic_t *enp, - __in efx_bist_type_t type) -{ - /* There is no way to stop BIST on EF10. */ - _NOTE(ARGUNUSED(enp, type)) -} - -#endif /* EFSYS_OPT_BIST */ - #endif /* EFSYS_OPT_HUNTINGTON */ From owner-svn-src-all@freebsd.org Sat Dec 31 11:27:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5CF8C99D12; Sat, 31 Dec 2016 11:27:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9471513C8; Sat, 31 Dec 2016 11:27:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBRwdM050613; Sat, 31 Dec 2016 11:27:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBRwtj050612; Sat, 31 Dec 2016 11:27:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311127.uBVBRwtj050612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310945 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:27:59 -0000 Author: arybchik Date: Sat Dec 31 11:27:58 2016 New Revision: 310945 URL: https://svnweb.freebsd.org/changeset/base/310945 Log: MFC r310719 sfxge(4): cleanup: remove last use of deprecated function flags with privilege check The function flags were changed to mirror the privileges, but the privileges are preferred. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_phy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_phy.c Sat Dec 31 11:26:29 2016 (r310944) +++ stable/11/sys/dev/sfxge/common/ef10_phy.c Sat Dec 31 11:27:58 2016 (r310945) @@ -278,7 +278,6 @@ fail1: ef10_phy_reconfigure( __in efx_nic_t *enp) { - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, @@ -286,9 +285,12 @@ ef10_phy_reconfigure( uint32_t cap_mask; unsigned int led_mode; unsigned int speed; + boolean_t supported; efx_rc_t rc; - if (~encp->enc_func_flags & EFX_NIC_FUNC_LINKCTRL) + if ((rc = efx_mcdi_link_control_supported(enp, &supported)) != 0) + goto fail1; + if (supported == B_FALSE) goto out; (void) memset(payload, 0, sizeof (payload)); @@ -349,7 +351,7 @@ ef10_phy_reconfigure( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail2; } /* And set the blink mode */ @@ -385,11 +387,13 @@ ef10_phy_reconfigure( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } out: return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-all@freebsd.org Sat Dec 31 11:28:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162C5C99D86; Sat, 31 Dec 2016 11:28:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D91AB15B3; Sat, 31 Dec 2016 11:28:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBSmQ9050706; Sat, 31 Dec 2016 11:28:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBSmvf050705; Sat, 31 Dec 2016 11:28:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311128.uBVBSmvf050705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310946 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:28:49 -0000 Author: arybchik Date: Sat Dec 31 11:28:47 2016 New Revision: 310946 URL: https://svnweb.freebsd.org/changeset/base/310946 Log: MFC r310741 sfxge(4): fix misuse of siena_build_filter in common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx_filter.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:27:58 2016 (r310945) +++ stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:28:47 2016 (r310946) @@ -1179,6 +1179,7 @@ siena_filter_restore( efx_oword_t filter; int filter_idx; int state; + uint32_t key; efx_rc_t rc; EFSYS_LOCK(enp->en_eslp, state); @@ -1192,8 +1193,10 @@ siena_filter_restore( continue; spec = &sftp->sft_spec[filter_idx]; - if ((rc = siena_filter_build(&filter, spec)) != 0) + if ((key = siena_filter_build(&filter, spec)) == 0) { + rc = EINVAL; goto fail1; + } if ((rc = siena_filter_push_entry(enp, spec->sfs_type, filter_idx, &filter)) != 0) goto fail2; From owner-svn-src-all@freebsd.org Sat Dec 31 11:30:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA798C99DFE; Sat, 31 Dec 2016 11:30:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9980C170A; Sat, 31 Dec 2016 11:30:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBUIqR050842; Sat, 31 Dec 2016 11:30:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBUInL050841; Sat, 31 Dec 2016 11:30:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612311130.uBVBUInL050841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 31 Dec 2016 11:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310947 - stable/11/sys/dev/sfxge/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:30:19 -0000 Author: arybchik Date: Sat Dec 31 11:30:18 2016 New Revision: 310947 URL: https://svnweb.freebsd.org/changeset/base/310947 Log: MFC r310742 sfxge(4): fix common code for non-Siena builds Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/efx.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:28:47 2016 (r310946) +++ stable/11/sys/dev/sfxge/common/efx.h Sat Dec 31 11:30:18 2016 (r310947) @@ -1105,18 +1105,16 @@ typedef struct efx_nic_cfg_s { #if EFSYS_OPT_PHY_STATS uint64_t enc_phy_stat_mask; #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_SIENA +#if EFSYS_OPT_MCDI uint8_t enc_mcdi_mdio_channel; #if EFSYS_OPT_PHY_STATS uint32_t enc_mcdi_phy_stat_mask; #endif /* EFSYS_OPT_PHY_STATS */ -#endif /* EFSYS_OPT_SIENA */ -#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) #if EFSYS_OPT_MON_STATS uint32_t *enc_mcdi_sensor_maskp; uint32_t enc_mcdi_sensor_mask_size; #endif /* EFSYS_OPT_MON_STATS */ -#endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ +#endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_BIST uint32_t enc_bist_mask; #endif /* EFSYS_OPT_BIST */ From owner-svn-src-all@freebsd.org Sat Dec 31 11:50:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF717C9941A; Sat, 31 Dec 2016 11:50:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89C861252; Sat, 31 Dec 2016 11:50:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVBoaTx058858; Sat, 31 Dec 2016 11:50:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVBoaCj058856; Sat, 31 Dec 2016 11:50:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311150.uBVBoaCj058856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 11:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310950 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 11:50:37 -0000 Author: ngie Date: Sat Dec 31 11:50:36 2016 New Revision: 310950 URL: https://svnweb.freebsd.org/changeset/base/310950 Log: MIB-II: use strlcpy when copying interface names to .ifr_name .ifra_name is assumed to be NUL terminated; using strlcpy(3) ensures that it's indeed NUL terminated whereas strncpy does not. Tested and verified as follows with a combination of ifconfig, snmpget, and snmpset: % ifconfig create lo1 127.0.0.2/8 % SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X bsnmptest localhost" % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: down(2) % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4 IF-MIB::ifAdminStatus.4 = INTEGER: up(1) MFC after: 2 weeks Reported by: Coverity CID: 1009652-1009656, 1349850 Modified: head/contrib/bsnmp/snmp_mibII/mibII.c head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 11:42:57 2016 (r310949) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 11:50:36 2016 (r310950) @@ -265,7 +265,7 @@ mib_if_admin(struct mibif *ifp, int up) { struct ifreq ifr; - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIOCGIFFLAGS(%s): %m", ifp->name); return (-1); @@ -515,7 +515,7 @@ mib_fetch_ifmib(struct mibif *ifp) } out: - strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); + strlcpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { @@ -1384,7 +1384,7 @@ siocaifaddr(char *ifname, struct in_addr struct sockaddr_in *sa; memset(&addreq, 0, sizeof(addreq)); - strncpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); + strlcpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name)); sa = (struct sockaddr_in *)(void *)&addreq.ifra_addr; sa->sin_family = AF_INET; @@ -1414,7 +1414,7 @@ siocdifaddr(const char *ifname, struct i struct sockaddr_in *sa; memset(&delreq, 0, sizeof(delreq)); - strncpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); + strlcpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name)); sa = (struct sockaddr_in *)(void *)&delreq.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); @@ -1433,7 +1433,7 @@ verify_ifa(const char *name, struct mibi struct sockaddr_in *sa; memset(&req, 0, sizeof(req)); - strncpy(req.ifr_name, name, sizeof(req.ifr_name)); + strlcpy(req.ifr_name, name, sizeof(req.ifr_name)); sa = (struct sockaddr_in *)(void *)&req.ifr_addr; sa->sin_family = AF_INET; sa->sin_len = sizeof(*sa); Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Dec 31 11:42:57 2016 (r310949) +++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Dec 31 11:50:36 2016 (r310950) @@ -77,7 +77,7 @@ ifchange_func(struct snmp_context *ctx _ switch (op) { case SNMP_DEPOP_COMMIT: - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -95,7 +95,7 @@ ifchange_func(struct snmp_context *ctx _ ifc->rb |= IFRB_FLAGS; } if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); + strlcpy(ifr1.ifr_name, ifp->name, sizeof(ifr1.ifr_name)); if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr1) == -1) { syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name); return (SNMP_ERR_GENERR); @@ -116,7 +116,7 @@ ifchange_func(struct snmp_context *ctx _ case SNMP_DEPOP_ROLLBACK: if (ifc->rb & IFRB_FLAGS) { - strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); ifr.ifr_flags = ifc->rb_flags; if (ioctl(mib_netsock, SIOCSIFFLAGS, &ifr) == -1) { syslog(LOG_ERR, "SIFFLAGS(%s): %m", ifp->name); From owner-svn-src-all@freebsd.org Sat Dec 31 12:03:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23B3AC99D91; Sat, 31 Dec 2016 12:03:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E76FC13AB; Sat, 31 Dec 2016 12:03:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVC3Qv5067500; Sat, 31 Dec 2016 12:03:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVC3Q8M067499; Sat, 31 Dec 2016 12:03:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311203.uBVC3Q8M067499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 12:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310952 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:03:27 -0000 Author: ngie Date: Sat Dec 31 12:03:25 2016 New Revision: 310952 URL: https://svnweb.freebsd.org/changeset/base/310952 Log: MIB-II: use strlcpy instead of strcpy when copying {descr,name} This is of course to avoid buffer overruns The remaining strcpy instance in the module needs to be audited for correctness MFC after: 1 week Reported by: Coverity CID: 1006827, 1006828 Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 11:57:37 2016 (r310951) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Sat Dec 31 12:03:25 2016 (r310952) @@ -204,7 +204,7 @@ mib_if_set_dyn(const char *name) return; if ((d = malloc(sizeof(*d))) == NULL) err(1, NULL); - strcpy(d->name, name); + strlcpy(d->name, name, sizeof(d->name)); SLIST_INSERT_HEAD(&mibdynif_list, d, link); } @@ -774,8 +774,8 @@ mibif_create(u_int sysindex, const char memset(ifp->private, 0, sizeof(struct mibif_private)); ifp->sysindex = sysindex; - strcpy(ifp->name, name); - strcpy(ifp->descr, name); + strlcpy(ifp->name, name, sizeof(ifp->name)); + strlcpy(ifp->descr, name, sizeof(ifp->descr)); ifp->spec_oid = oid_zeroDotZero; map = NULL; From owner-svn-src-all@freebsd.org Sat Dec 31 12:06:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07538C99EA0; Sat, 31 Dec 2016 12:06:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5DAE15D5; Sat, 31 Dec 2016 12:06:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVC6Sua067651; Sat, 31 Dec 2016 12:06:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVC6RVU067643; Sat, 31 Dec 2016 12:06:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311206.uBVC6RVU067643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 12:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310953 - in stable/11/sys: kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:06:29 -0000 Author: mjg Date: Sat Dec 31 12:06:27 2016 New Revision: 310953 URL: https://svnweb.freebsd.org/changeset/base/310953 Log: MFC r309893,r309929: vfs: add vrefact, to be used when the vnode has to be already active This allows blind increment of relevant counters which under contention is cheaper than inc-not-zero loops at least on amd64. Use it in some of the places which are guaranteed to see already active vnodes. == vfs: use vrefact in getcwd and fchdir Modified: stable/11/sys/kern/kern_descrip.c stable/11/sys/kern/kern_fork.c stable/11/sys/kern/vfs_cache.c stable/11/sys/kern/vfs_lookup.c stable/11/sys/kern/vfs_subr.c stable/11/sys/kern/vfs_syscalls.c stable/11/sys/sys/vnode.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_descrip.c ============================================================================== --- stable/11/sys/kern/kern_descrip.c Sat Dec 31 12:03:25 2016 (r310952) +++ stable/11/sys/kern/kern_descrip.c Sat Dec 31 12:06:27 2016 (r310953) @@ -318,11 +318,11 @@ pwd_ensure_dirs(void) FILEDESC_XLOCK(fdp); if (fdp->fd_cdir == NULL) { fdp->fd_cdir = rootvnode; - VREF(rootvnode); + vrefact(rootvnode); } if (fdp->fd_rdir == NULL) { fdp->fd_rdir = rootvnode; - VREF(rootvnode); + vrefact(rootvnode); } FILEDESC_XUNLOCK(fdp); } @@ -1855,13 +1855,13 @@ fdinit(struct filedesc *fdp, bool prepfi FILEDESC_SLOCK(fdp); newfdp->fd_cdir = fdp->fd_cdir; if (newfdp->fd_cdir) - VREF(newfdp->fd_cdir); + vrefact(newfdp->fd_cdir); newfdp->fd_rdir = fdp->fd_rdir; if (newfdp->fd_rdir) - VREF(newfdp->fd_rdir); + vrefact(newfdp->fd_rdir); newfdp->fd_jdir = fdp->fd_jdir; if (newfdp->fd_jdir) - VREF(newfdp->fd_jdir); + vrefact(newfdp->fd_jdir); if (!prepfiles) { FILEDESC_SUNLOCK(fdp); @@ -2688,7 +2688,7 @@ _fgetvp(struct thread *td, int fd, int f error = EINVAL; } else { *vpp = fp->f_vnode; - vref(*vpp); + vrefact(*vpp); } fdrop(fp, td); @@ -2727,7 +2727,7 @@ fgetvp_rights(struct thread *td, int fd, return (EINVAL); *vpp = fp->f_vnode; - vref(*vpp); + vrefact(*vpp); filecaps_copy(&fdp->fd_ofiles[fd].fde_caps, havecaps, true); return (0); @@ -3033,10 +3033,10 @@ pwd_chroot(struct thread *td, struct vno } } oldvp = fdp->fd_rdir; - VREF(vp); + vrefact(vp); fdp->fd_rdir = vp; if (fdp->fd_jdir == NULL) { - VREF(vp); + vrefact(vp); fdp->fd_jdir = vp; } FILEDESC_XUNLOCK(fdp); @@ -3084,17 +3084,17 @@ mountcheckdirs(struct vnode *olddp, stru continue; FILEDESC_XLOCK(fdp); if (fdp->fd_cdir == olddp) { - vref(newdp); + vrefact(newdp); fdp->fd_cdir = newdp; nrele++; } if (fdp->fd_rdir == olddp) { - vref(newdp); + vrefact(newdp); fdp->fd_rdir = newdp; nrele++; } if (fdp->fd_jdir == olddp) { - vref(newdp); + vrefact(newdp); fdp->fd_jdir = newdp; nrele++; } @@ -3103,13 +3103,13 @@ mountcheckdirs(struct vnode *olddp, stru } sx_sunlock(&allproc_lock); if (rootvnode == olddp) { - vref(newdp); + vrefact(newdp); rootvnode = newdp; nrele++; } mtx_lock(&prison0.pr_mtx); if (prison0.pr_root == olddp) { - vref(newdp); + vrefact(newdp); prison0.pr_root = newdp; nrele++; } @@ -3118,7 +3118,7 @@ mountcheckdirs(struct vnode *olddp, stru TAILQ_FOREACH(pr, &allprison, pr_list) { mtx_lock(&pr->pr_mtx); if (pr->pr_root == olddp) { - vref(newdp); + vrefact(newdp); pr->pr_root = newdp; nrele++; } @@ -3445,17 +3445,17 @@ kern_proc_filedesc_out(struct proc *p, /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) - vref(tracevp); + vrefact(tracevp); /* text vnode */ textvp = p->p_textvp; if (textvp != NULL) - vref(textvp); + vrefact(textvp); /* Controlling tty. */ cttyvp = NULL; if (p->p_pgrp != NULL && p->p_pgrp->pg_session != NULL) { cttyvp = p->p_pgrp->pg_session->s_ttyvp; if (cttyvp != NULL) - vref(cttyvp); + vrefact(cttyvp); } fdp = fdhold(p); PROC_UNLOCK(p); @@ -3479,17 +3479,17 @@ kern_proc_filedesc_out(struct proc *p, FILEDESC_SLOCK(fdp); /* working directory */ if (fdp->fd_cdir != NULL) { - vref(fdp->fd_cdir); + vrefact(fdp->fd_cdir); export_vnode_to_sb(fdp->fd_cdir, KF_FD_TYPE_CWD, FREAD, efbuf); } /* root directory */ if (fdp->fd_rdir != NULL) { - vref(fdp->fd_rdir); + vrefact(fdp->fd_rdir); export_vnode_to_sb(fdp->fd_rdir, KF_FD_TYPE_ROOT, FREAD, efbuf); } /* jail directory */ if (fdp->fd_jdir != NULL) { - vref(fdp->fd_jdir); + vrefact(fdp->fd_jdir); export_vnode_to_sb(fdp->fd_jdir, KF_FD_TYPE_JAIL, FREAD, efbuf); } for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) { @@ -3579,7 +3579,7 @@ export_vnode_for_osysctl(struct vnode *v { int error; - vref(vp); + vrefact(vp); FILEDESC_SUNLOCK(fdp); export_vnode_to_kinfo(vp, type, 0, kif, KERN_FILEDESC_PACK_KINFO); kinfo_to_okinfo(kif, okif); @@ -3706,7 +3706,7 @@ kern_proc_cwd_out(struct proc *p, struc if (fdp->fd_cdir == NULL) error = EINVAL; else { - vref(fdp->fd_cdir); + vrefact(fdp->fd_cdir); error = export_vnode_to_sb(fdp->fd_cdir, KF_FD_TYPE_CWD, FREAD, efbuf); } Modified: stable/11/sys/kern/kern_fork.c ============================================================================== --- stable/11/sys/kern/kern_fork.c Sat Dec 31 12:03:25 2016 (r310952) +++ stable/11/sys/kern/kern_fork.c Sat Dec 31 12:06:27 2016 (r310953) @@ -549,7 +549,7 @@ do_fork(struct thread *td, struct fork_r /* Bump references to the text vnode (for procfs). */ if (p2->p_textvp) - vref(p2->p_textvp); + vrefact(p2->p_textvp); /* * Set up linkage for kernel based threading. Modified: stable/11/sys/kern/vfs_cache.c ============================================================================== --- stable/11/sys/kern/vfs_cache.c Sat Dec 31 12:03:25 2016 (r310952) +++ stable/11/sys/kern/vfs_cache.c Sat Dec 31 12:06:27 2016 (r310953) @@ -1122,9 +1122,9 @@ kern___getcwd(struct thread *td, char *b fdp = td->td_proc->p_fd; FILEDESC_SLOCK(fdp); cdir = fdp->fd_cdir; - VREF(cdir); + vrefact(cdir); rdir = fdp->fd_rdir; - VREF(rdir); + vrefact(rdir); FILEDESC_SUNLOCK(fdp); error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, buflen); vrele(rdir); Modified: stable/11/sys/kern/vfs_lookup.c ============================================================================== --- stable/11/sys/kern/vfs_lookup.c Sat Dec 31 12:03:25 2016 (r310952) +++ stable/11/sys/kern/vfs_lookup.c Sat Dec 31 12:06:27 2016 (r310953) @@ -200,7 +200,7 @@ namei_handle_root(struct nameidata *ndp, ndp->ni_pathlen--; } *dpp = ndp->ni_rootdir; - VREF(*dpp); + vrefact(*dpp); return (0); } @@ -321,7 +321,7 @@ namei(struct nameidata *ndp) */ FILEDESC_SLOCK(fdp); ndp->ni_rootdir = fdp->fd_rdir; - VREF(ndp->ni_rootdir); + vrefact(ndp->ni_rootdir); ndp->ni_topdir = fdp->fd_jdir; /* @@ -343,7 +343,7 @@ namei(struct nameidata *ndp) startdir_used = 1; } else if (ndp->ni_dirfd == AT_FDCWD) { dp = fdp->fd_cdir; - VREF(dp); + vrefact(dp); } else { rights = ndp->ni_rightsneeded; cap_rights_set(&rights, CAP_LOOKUP); @@ -910,7 +910,7 @@ good: vput(ndp->ni_dvp); else vrele(ndp->ni_dvp); - vref(vp_crossmp); + vrefact(vp_crossmp); ndp->ni_dvp = vp_crossmp; error = VFS_ROOT(mp, compute_cn_lkflags(mp, cnp->cn_lkflags, cnp->cn_flags), &tdp); Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Sat Dec 31 12:03:25 2016 (r310952) +++ stable/11/sys/kern/vfs_subr.c Sat Dec 31 12:06:27 2016 (r310953) @@ -2576,6 +2576,28 @@ vrefl(struct vnode *vp) v_incr_usecount_locked(vp); } +void +vrefact(struct vnode *vp) +{ + + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + if (__predict_false(vp->v_type == VCHR)) { + VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp, + ("%s: wrong ref counts", __func__)); + vref(vp); + return; + } +#ifdef INVARIANTS + int old = atomic_fetchadd_int(&vp->v_holdcnt, 1); + VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__)); + old = atomic_fetchadd_int(&vp->v_usecount, 1); + VNASSERT(old > 0, vp, ("%s: wrong use count", __func__)); +#else + refcount_acquire(&vp->v_holdcnt); + refcount_acquire(&vp->v_usecount); +#endif +} + /* * Return reference count of a vnode. * Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Sat Dec 31 12:03:25 2016 (r310952) +++ stable/11/sys/kern/vfs_syscalls.c Sat Dec 31 12:06:27 2016 (r310953) @@ -754,7 +754,7 @@ sys_fchdir(td, uap) if (error != 0) return (error); vp = fp->f_vnode; - VREF(vp); + vrefact(vp); fdrop(fp, td); vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); Modified: stable/11/sys/sys/vnode.h ============================================================================== --- stable/11/sys/sys/vnode.h Sat Dec 31 12:03:25 2016 (r310952) +++ stable/11/sys/sys/vnode.h Sat Dec 31 12:06:27 2016 (r310953) @@ -841,6 +841,7 @@ void vput(struct vnode *vp); void vrele(struct vnode *vp); void vref(struct vnode *vp); void vrefl(struct vnode *vp); +void vrefact(struct vnode *vp); int vrefcnt(struct vnode *vp); void v_addpollinfo(struct vnode *vp); From owner-svn-src-all@freebsd.org Sat Dec 31 12:14:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9466DC983EE; Sat, 31 Dec 2016 12:14:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63E981C6D; Sat, 31 Dec 2016 12:14:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCEPsb071710; Sat, 31 Dec 2016 12:14:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCEPIY071709; Sat, 31 Dec 2016 12:14:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311214.uBVCEPIY071709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 12:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310954 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:14:26 -0000 Author: ngie Date: Sat Dec 31 12:14:25 2016 New Revision: 310954 URL: https://svnweb.freebsd.org/changeset/base/310954 Log: Set value->v.octetstring.len to a correct value on malloc success/failure The previous code always set value->v.octetstring.len to len, regardless of the result from the malloc call. This misleads the caller on malloc failure. Set .len to len on success and 0 on failure. MFC after: 1 week Reported by: Coverity CID: 1007590 Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat Dec 31 12:06:27 2016 (r310953) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat Dec 31 12:14:25 2016 (r310954) @@ -266,13 +266,13 @@ parse_octetstring(struct snmp_value *val return (-1); } - value->v.octetstring.len = len; - - if((value->v.octetstring.octets = malloc(len)) == NULL) { + if ((value->v.octetstring.octets = malloc(len)) == NULL) { + value->v.octetstring.len = 0; syslog(LOG_ERR, "malloc failed: %s", strerror(errno)); return (-1); } + value->v.octetstring.len = len; memcpy(value->v.octetstring.octets, val, len); value->syntax = SNMP_SYNTAX_OCTETSTRING; From owner-svn-src-all@freebsd.org Sat Dec 31 12:18:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C438EC985BC; Sat, 31 Dec 2016 12:18:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93F1E1037; Sat, 31 Dec 2016 12:18:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCIHwf072043; Sat, 31 Dec 2016 12:18:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCIHlm072042; Sat, 31 Dec 2016 12:18:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311218.uBVCIHlm072042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 12:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310957 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:18:18 -0000 Author: ngie Date: Sat Dec 31 12:18:17 2016 New Revision: 310957 URL: https://svnweb.freebsd.org/changeset/base/310957 Log: Use strlcpy when copying `com` to pdu->community to avoid potential buffer overruns MFC after: 1 week Reported by: Coverity CID: 1006823, 1006824 Modified: head/contrib/bsnmp/snmpd/trap.c Modified: head/contrib/bsnmp/snmpd/trap.c ============================================================================== --- head/contrib/bsnmp/snmpd/trap.c Sat Dec 31 12:16:21 2016 (r310956) +++ head/contrib/bsnmp/snmpd/trap.c Sat Dec 31 12:18:17 2016 (r310957) @@ -422,7 +422,7 @@ snmp_create_v1_trap(struct snmp_pdu *pdu const struct asn_oid *trap_oid) { memset(pdu, 0, sizeof(*pdu)); - strcpy(pdu->community, com); + strlcpy(pdu->community, com, sizeof(pdu->community)); pdu->version = SNMP_V1; pdu->type = SNMP_PDU_TRAP; @@ -439,7 +439,7 @@ snmp_create_v2_trap(struct snmp_pdu *pdu const struct asn_oid *trap_oid) { memset(pdu, 0, sizeof(*pdu)); - strcpy(pdu->community, com); + strlcpy(pdu->community, com, sizeof(pdu->community)); pdu->version = SNMP_V2c; pdu->type = SNMP_PDU_TRAP2; From owner-svn-src-all@freebsd.org Sat Dec 31 12:30:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D73C98DF8; Sat, 31 Dec 2016 12:30:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0F071A70; Sat, 31 Dec 2016 12:30:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCUE2Q076017; Sat, 31 Dec 2016 12:30:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCUE3g076016; Sat, 31 Dec 2016 12:30:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311230.uBVCUE3g076016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 12:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310958 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:30:16 -0000 Author: ngie Date: Sat Dec 31 12:30:14 2016 New Revision: 310958 URL: https://svnweb.freebsd.org/changeset/base/310958 Log: Initialize ret to SNMPD_INPUT_OK at the top of snmp_input_start(..) to avoid returning an uninitialized value There are some really complicated, snakey if-statements combined with switch statements that could result in an invalid value being returned as `ret` MFC after: 1 week Reported by: Coverity CID: 1006551 Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Sat Dec 31 12:18:17 2016 (r310957) +++ head/contrib/bsnmp/snmpd/main.c Sat Dec 31 12:30:14 2016 (r310958) @@ -492,6 +492,8 @@ snmp_input_start(const u_char *buf, size b.asn_cptr = buf; b.asn_len = len; + ret = SNMPD_INPUT_OK; + /* look whether we have enough bytes for the entire PDU. */ switch (sret = snmp_pdu_snoop(&b)) { @@ -520,8 +522,6 @@ snmp_input_start(const u_char *buf, size } code = snmp_pdu_decode_scoped(&b, pdu, ip); - ret = SNMPD_INPUT_OK; - decoded: snmpd_stats.inPkts++; From owner-svn-src-all@freebsd.org Sat Dec 31 12:32:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6C9BC98F88; Sat, 31 Dec 2016 12:32:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF0321E6A; Sat, 31 Dec 2016 12:32:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCWoKw079815; Sat, 31 Dec 2016 12:32:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCWoiu079811; Sat, 31 Dec 2016 12:32:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311232.uBVCWoiu079811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 12:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310959 - in stable/11/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:32:52 -0000 Author: mjg Date: Sat Dec 31 12:32:50 2016 New Revision: 310959 URL: https://svnweb.freebsd.org/changeset/base/310959 Log: MFC r305378,r305379,r305386,r305684,r306224,r306608,r306803,r307650,r307685, r308407,r308665,r308667,r309067: cache: put all negative entry management code into dedicated functions == cache: manage negative entry list with a dedicated lock Since negative entries are managed with a LRU list, a hit requires a modificaton. Currently the code tries to upgrade the global lock if needed and is forced to retry the lookup if it fails. Provide a dedicated lock for use when the cache is only shared-locked. == cache: defer freeing entries until after the global lock is dropped This also defers vdrop for held vnodes. == cache: improve scalability by introducing bucket locks An array of bucket locks is added. All modifications still require the global cache_lock to be held for writing. However, most readers only need the relevant bucket lock and in effect can run concurrently to the writer as long as they use a different lock. See the added comment for more details. This is an intermediate step towards removal of the global lock. == cache: get rid of the global lock Add a table of vnode locks and use them along with bucketlocks to provide concurrent modification support. The approach taken is to preserve the current behaviour of the namecache and just lock all relevant parts before any changes are made. Lookups still require the relevant bucket to be locked. == cache: ignore purgevfs requests for filesystems with few vnodes purgevfs is purely optional and induces lock contention in workloads which frequently mount and unmount filesystems. In particular, poudriere will do this for filesystems with 4 vnodes or less. Full cache scan is clearly wasteful. Since there is no explicit counter for namecache entries, the number of vnodes used by the target fs is checked. The default limit is the number of bucket locks. == (by kib) Limit scope of the optimization in r306608 to dounmount() caller only. Other uses of cache_purgevfs() do rely on the cache purge for correct operations, when paths are invalidated without unmount. == cache: split negative entry LRU into multiple lists This splits the ncneg_mtx lock while preserving the hit ratio at least during buildworld. Create N dedicated lists for new negative entries. Entries with at least one hit get promoted to the hot list, where they get requeued every M hits. Shrinking demotes one hot entry and performs a round-robin shrinking of regular lists. == cache: fix up a corner case in r307650 If no negative entry is found on the last list, the ncp pointer will be left uninitialized and a non-null value will make the function assume an entry was found. Fix the problem by initializing to NULL on entry. == (by kib) vn_fullpath1() checked VV_ROOT and then unreferenced vp->v_mount->mnt_vnodecovered unlocked. This allowed unmount to race. Lock vnode after we noticed the VV_ROOT flag. See comments for explanation why unlocked check for the flag is considered safe. == cache: fix a race between entry removal and demotion The negative list shrinker can demote an entry with only hotlist + neglist locks held. On the other hand entry removal possibly sets the NCF_DVDROP without aformentioned locks held prior to detaching it from the respective netlist., which can lose the update made by the shrinker. == cache: plug a write-only variable in cache_negative_zap_one == cache: ensure that the number of bucket locks does not exceed hash size The size can be changed by side effect of modifying kern.maxvnodes. Since numbucketlocks was not modified, setting a sufficiently low value would give more locks than actual buckets, which would then lead to corruption. Force the number of buckets to be not smaller. Note this should not matter for real world cases. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/11/sys/kern/subr_witness.c stable/11/sys/kern/vfs_cache.c stable/11/sys/kern/vfs_mount.c stable/11/sys/kern/vfs_mountroot.c stable/11/sys/sys/vnode.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Dec 31 12:30:14 2016 (r310958) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Dec 31 12:32:50 2016 (r310959) @@ -1843,7 +1843,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea */ (void) dnlc_purge_vfsp(zfsvfs->z_parent->z_vfs, 0); #ifdef FREEBSD_NAMECACHE - cache_purgevfs(zfsvfs->z_parent->z_vfs); + cache_purgevfs(zfsvfs->z_parent->z_vfs, true); #endif } Modified: stable/11/sys/kern/subr_witness.c ============================================================================== --- stable/11/sys/kern/subr_witness.c Sat Dec 31 12:30:14 2016 (r310958) +++ stable/11/sys/kern/subr_witness.c Sat Dec 31 12:32:50 2016 (r310959) @@ -623,6 +623,14 @@ static struct witness_order_list_entry o { "vnode interlock", &lock_class_mtx_sleep }, { NULL, NULL }, /* + * VFS namecache + */ + { "ncvn", &lock_class_mtx_sleep }, + { "ncbuc", &lock_class_rw }, + { "vnode interlock", &lock_class_mtx_sleep }, + { "ncneg", &lock_class_mtx_sleep }, + { NULL, NULL }, + /* * ZFS locking */ { "dn->dn_mtx", &lock_class_sx }, Modified: stable/11/sys/kern/vfs_cache.c ============================================================================== --- stable/11/sys/kern/vfs_cache.c Sat Dec 31 12:30:14 2016 (r310958) +++ stable/11/sys/kern/vfs_cache.c Sat Dec 31 12:32:50 2016 (r310959) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -83,8 +84,10 @@ SDT_PROBE_DEFINE1(vfs, namecache, purge_ SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", - "char *"); +SDT_PROBE_DEFINE3(vfs, namecache, zap_negative, done, "struct vnode *", + "char *", "int"); +SDT_PROBE_DEFINE3(vfs, namecache, shrink_negative, done, "struct vnode *", + "char *", "int"); /* * This structure describes the elements in the cache of recent @@ -96,7 +99,10 @@ struct namecache { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ - struct vnode *nc_vp; /* vnode the name refers to */ + union { + struct vnode *nu_vp; /* vnode the name refers to */ + u_int nu_neghits; /* negative entry hits */ + } n_un; u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ char nc_name[0]; /* segment name + nul */ @@ -115,7 +121,10 @@ struct namecache_ts { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ - struct vnode *nc_vp; /* vnode the name refers to */ + union { + struct vnode *nu_vp; /* vnode the name refers to */ + u_int nu_neghits; /* negative entry hits */ + } n_un; u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ struct timespec nc_time; /* timespec provided by fs */ @@ -124,6 +133,9 @@ struct namecache_ts { char nc_name[0]; /* segment name + nul */ }; +#define nc_vp n_un.nu_vp +#define nc_neghits n_un.nu_neghits + /* * Flags in namecache.nc_flag */ @@ -131,6 +143,9 @@ struct namecache_ts { #define NCF_ISDOTDOT 0x02 #define NCF_TS 0x04 #define NCF_DTS 0x08 +#define NCF_DVDROP 0x10 +#define NCF_NEGATIVE 0x20 +#define NCF_HOTNEGATIVE 0x40 /* * Name caching works as follows: @@ -147,6 +162,37 @@ struct namecache_ts { * Upon reaching the last segment of a path, if the reference * is for DELETE, or NOCACHE is set (rewrite), and the * name is located in the cache, it will be dropped. + * + * These locks are used (in the order in which they can be taken): + * NAME TYPE ROLE + * vnodelock mtx vnode lists and v_cache_dd field protection + * bucketlock rwlock for access to given set of hash buckets + * neglist mtx negative entry LRU management + * + * Additionally, ncneg_shrink_lock mtx is used to have at most one thread + * shrinking the LRU list. + * + * It is legal to take multiple vnodelock and bucketlock locks. The locking + * order is lower address first. Both are recursive. + * + * "." lookups are lockless. + * + * ".." and vnode -> name lookups require vnodelock. + * + * name -> vnode lookup requires the relevant bucketlock to be held for reading. + * + * Insertions and removals of entries require involved vnodes and bucketlocks + * to be write-locked to prevent other threads from seeing the entry. + * + * Some lookups result in removal of the found entry (e.g. getting rid of a + * negative entry with the intent to create a positive one), which poses a + * problem when multiple threads reach the state. Similarly, two different + * threads can purge two different vnodes and try to remove the same name. + * + * If the already held vnode lock is lower than the second required lock, we + * can just take the other lock. However, in the opposite case, this could + * deadlock. As such, this is resolved by trylocking and if that fails unlocking + * the first node, locking everything in order and revalidating the state. */ /* @@ -155,7 +201,6 @@ struct namecache_ts { #define NCHHASH(hash) \ (&nchashtbl[(hash) & nchash]) static LIST_HEAD(nchashhead, namecache) *nchashtbl; /* Hash Table */ -static TAILQ_HEAD(, namecache) ncneg; /* Hash Table */ static u_long nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "Size of namecache hash table"); @@ -174,17 +219,54 @@ SYSCTL_ULONG(_debug, OID_AUTO, numcacheh u_int ncsizefactor = 2; SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, "Size factor for namecache"); +static u_int ncpurgeminvnodes; +SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_RW, &ncpurgeminvnodes, 0, + "Number of vnodes below which purgevfs ignores the request"); +static u_int ncneghitsrequeue = 8; +SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_RW, &ncneghitsrequeue, 0, + "Number of hits to requeue a negative entry in the LRU list"); struct nchstats nchstats; /* cache effectiveness statistics */ -static struct rwlock cache_lock; -RW_SYSINIT(vfscache, &cache_lock, "Name Cache"); +static struct mtx ncneg_shrink_lock; +MTX_SYSINIT(vfscache_shrink_neg, &ncneg_shrink_lock, "Name Cache shrink neg", + MTX_DEF); + +struct neglist { + struct mtx nl_lock; + TAILQ_HEAD(, namecache) nl_list; +} __aligned(CACHE_LINE_SIZE); + +static struct neglist *neglists; +static struct neglist ncneg_hot; -#define CACHE_UPGRADE_LOCK() rw_try_upgrade(&cache_lock) -#define CACHE_RLOCK() rw_rlock(&cache_lock) -#define CACHE_RUNLOCK() rw_runlock(&cache_lock) -#define CACHE_WLOCK() rw_wlock(&cache_lock) -#define CACHE_WUNLOCK() rw_wunlock(&cache_lock) +static int shrink_list_turn; + +static u_int numneglists; +static inline struct neglist * +NCP2NEGLIST(struct namecache *ncp) +{ + + return (&neglists[(((uintptr_t)(ncp) >> 8) % numneglists)]); +} + +static u_int numbucketlocks; +static struct rwlock_padalign *bucketlocks; +#define HASH2BUCKETLOCK(hash) \ + ((struct rwlock *)(&bucketlocks[((hash) % numbucketlocks)])) + +static u_int numvnodelocks; +static struct mtx *vnodelocks; +static inline struct mtx * +VP2VNODELOCK(struct vnode *vp) +{ + struct mtx *vlp; + + if (vp == NULL) + return (NULL); + vlp = &vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]; + return (vlp); +} /* * UMA zones for the VFS cache. @@ -224,6 +306,8 @@ cache_free(struct namecache *ncp) if (ncp == NULL) return; ts = ncp->nc_flag & NCF_TS; + if ((ncp->nc_flag & NCF_DVDROP) != 0) + vdrop(ncp->nc_dvp); if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) { if (ts) uma_zfree(cache_zone_small_ts, ncp); @@ -299,17 +383,49 @@ STATNODE_COUNTER(numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); -static long numupgrades; STATNODE_ULONG(numupgrades, - "Number of updates of the cache after lookup (write lock + retry)"); +static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, + "Number of times zap_and_exit failed to lock"); +static long cache_lock_vnodes_cel_3_failures; +STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, + "Number of times 3-way vnode locking failed"); -static void cache_zap(struct namecache *ncp); -static int vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, - u_int *buflen); +static void cache_zap_locked(struct namecache *ncp, bool neg_locked); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, u_int buflen); static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); +static int cache_yield; +SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, + "Number of times cache called yield"); + +static void +cache_maybe_yield(void) +{ + + if (should_yield()) { + cache_yield++; + kern_yield(PRI_USER); + } +} + +static inline void +cache_assert_vlp_locked(struct mtx *vlp) +{ + + if (vlp != NULL) + mtx_assert(vlp, MA_OWNED); +} + +static inline void +cache_assert_vnode_locked(struct vnode *vp) +{ + struct mtx *vlp; + + vlp = VP2VNODELOCK(vp); + cache_assert_vlp_locked(vlp); +} + static uint32_t cache_get_hash(char *name, u_char len, struct vnode *dvp) { @@ -320,6 +436,109 @@ cache_get_hash(char *name, u_char len, s return (hash); } +static inline struct rwlock * +NCP2BUCKETLOCK(struct namecache *ncp) +{ + uint32_t hash; + + hash = cache_get_hash(nc_get_name(ncp), ncp->nc_nlen, ncp->nc_dvp); + return (HASH2BUCKETLOCK(hash)); +} + +#ifdef INVARIANTS +static void +cache_assert_bucket_locked(struct namecache *ncp, int mode) +{ + struct rwlock *blp; + + blp = NCP2BUCKETLOCK(ncp); + rw_assert(blp, mode); +} +#else +#define cache_assert_bucket_locked(x, y) do { } while (0) +#endif + +#define cache_sort(x, y) _cache_sort((void **)(x), (void **)(y)) +static void +_cache_sort(void **p1, void **p2) +{ + void *tmp; + + if (*p1 > *p2) { + tmp = *p2; + *p2 = *p1; + *p1 = tmp; + } +} + +static void +cache_lock_all_buckets(void) +{ + u_int i; + + for (i = 0; i < numbucketlocks; i++) + rw_wlock(&bucketlocks[i]); +} + +static void +cache_unlock_all_buckets(void) +{ + u_int i; + + for (i = 0; i < numbucketlocks; i++) + rw_wunlock(&bucketlocks[i]); +} + +static void +cache_lock_all_vnodes(void) +{ + u_int i; + + for (i = 0; i < numvnodelocks; i++) + mtx_lock(&vnodelocks[i]); +} + +static void +cache_unlock_all_vnodes(void) +{ + u_int i; + + for (i = 0; i < numvnodelocks; i++) + mtx_unlock(&vnodelocks[i]); +} + +static int +cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp2) +{ + + cache_sort(&vlp1, &vlp2); + MPASS(vlp2 != NULL); + + if (vlp1 != NULL) { + if (!mtx_trylock(vlp1)) + return (EAGAIN); + } + if (!mtx_trylock(vlp2)) { + if (vlp1 != NULL) + mtx_unlock(vlp1); + return (EAGAIN); + } + + return (0); +} + +static void +cache_unlock_vnodes(struct mtx *vlp1, struct mtx *vlp2) +{ + + MPASS(vlp1 != NULL || vlp2 != NULL); + + if (vlp1 != NULL) + mtx_unlock(vlp1); + if (vlp2 != NULL) + mtx_unlock(vlp2); +} + static int sysctl_nchstats(SYSCTL_HANDLER_ARGS) { @@ -361,9 +580,9 @@ retry: if (req->oldptr == NULL) return SYSCTL_OUT(req, 0, n_nchash * sizeof(int)); cntbuf = malloc(n_nchash * sizeof(int), M_TEMP, M_ZERO | M_WAITOK); - CACHE_RLOCK(); + cache_lock_all_buckets(); if (n_nchash != nchash + 1) { - CACHE_RUNLOCK(); + cache_unlock_all_buckets(); free(cntbuf, M_TEMP); goto retry; } @@ -371,7 +590,7 @@ retry: for (ncpp = nchashtbl, i = 0; i < n_nchash; ncpp++, i++) LIST_FOREACH(ncp, ncpp, nc_hash) cntbuf[i]++; - CACHE_RUNLOCK(); + cache_unlock_all_buckets(); for (error = 0, i = 0; i < n_nchash; i++) if ((error = SYSCTL_OUT(req, &cntbuf[i], sizeof(int))) != 0) break; @@ -394,7 +613,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND if (!req->oldptr) return SYSCTL_OUT(req, 0, 4 * sizeof(int)); - CACHE_RLOCK(); + cache_lock_all_buckets(); n_nchash = nchash + 1; /* nchash is max index, not count */ used = 0; maxlength = 0; @@ -411,7 +630,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND maxlength = count; } n_nchash = nchash + 1; - CACHE_RUNLOCK(); + cache_unlock_all_buckets(); pct = (used * 100) / (n_nchash / 100); error = SYSCTL_OUT(req, &n_nchash, sizeof(n_nchash)); if (error) @@ -433,49 +652,432 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, n #endif /* - * cache_zap(): + * Negative entries management + * + * A variation of LRU scheme is used. New entries are hashed into one of + * numneglists cold lists. Entries get promoted to the hot list on first hit. + * Partial LRU for the hot list is maintained by requeueing them every + * ncneghitsrequeue hits. + * + * The shrinker will demote hot list head and evict from the cold list in a + * round-robin manner. + */ +static void +cache_negative_hit(struct namecache *ncp) +{ + struct neglist *neglist; + u_int hits; + + MPASS(ncp->nc_flag & NCF_NEGATIVE); + hits = atomic_fetchadd_int(&ncp->nc_neghits, 1); + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + if ((hits % ncneghitsrequeue) != 0) + return; + mtx_lock(&ncneg_hot.nl_lock); + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); + mtx_unlock(&ncneg_hot.nl_lock); + return; + } + /* + * The shrinker cleared the flag and removed the entry from + * the hot list. Put it back. + */ + } else { + mtx_lock(&ncneg_hot.nl_lock); + } + neglist = NCP2NEGLIST(ncp); + mtx_lock(&neglist->nl_lock); + if (!(ncp->nc_flag & NCF_HOTNEGATIVE)) { + TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); + ncp->nc_flag |= NCF_HOTNEGATIVE; + } + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); +} + +static void +cache_negative_insert(struct namecache *ncp, bool neg_locked) +{ + struct neglist *neglist; + + MPASS(ncp->nc_flag & NCF_NEGATIVE); + cache_assert_bucket_locked(ncp, RA_WLOCKED); + neglist = NCP2NEGLIST(ncp); + if (!neg_locked) { + mtx_lock(&neglist->nl_lock); + } else { + mtx_assert(&neglist->nl_lock, MA_OWNED); + } + TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); + if (!neg_locked) + mtx_unlock(&neglist->nl_lock); + atomic_add_rel_long(&numneg, 1); +} + +static void +cache_negative_remove(struct namecache *ncp, bool neg_locked) +{ + struct neglist *neglist; + bool hot_locked = false; + bool list_locked = false; + + MPASS(ncp->nc_flag & NCF_NEGATIVE); + cache_assert_bucket_locked(ncp, RA_WLOCKED); + neglist = NCP2NEGLIST(ncp); + if (!neg_locked) { + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + hot_locked = true; + mtx_lock(&ncneg_hot.nl_lock); + if (!(ncp->nc_flag & NCF_HOTNEGATIVE)) { + list_locked = true; + mtx_lock(&neglist->nl_lock); + } + } else { + list_locked = true; + mtx_lock(&neglist->nl_lock); + } + } else { + mtx_assert(&neglist->nl_lock, MA_OWNED); + mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); + } + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + } else { + TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); + } + if (list_locked) + mtx_unlock(&neglist->nl_lock); + if (hot_locked) + mtx_unlock(&ncneg_hot.nl_lock); + atomic_subtract_rel_long(&numneg, 1); +} + +static void +cache_negative_shrink_select(int start, struct namecache **ncpp, + struct neglist **neglistpp) +{ + struct neglist *neglist; + struct namecache *ncp; + int i; + + *ncpp = ncp = NULL; + + for (i = start; i < numneglists; i++) { + neglist = &neglists[i]; + if (TAILQ_FIRST(&neglist->nl_list) == NULL) + continue; + mtx_lock(&neglist->nl_lock); + ncp = TAILQ_FIRST(&neglist->nl_list); + if (ncp != NULL) + break; + mtx_unlock(&neglist->nl_lock); + } + + *neglistpp = neglist; + *ncpp = ncp; +} + +static void +cache_negative_zap_one(void) +{ + struct namecache *ncp, *ncp2; + struct neglist *neglist; + struct mtx *dvlp; + struct rwlock *blp; + + if (!mtx_trylock(&ncneg_shrink_lock)) + return; + + mtx_lock(&ncneg_hot.nl_lock); + ncp = TAILQ_FIRST(&ncneg_hot.nl_list); + if (ncp != NULL) { + neglist = NCP2NEGLIST(ncp); + mtx_lock(&neglist->nl_lock); + TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); + ncp->nc_flag &= ~NCF_HOTNEGATIVE; + mtx_unlock(&neglist->nl_lock); + } + + cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); + shrink_list_turn++; + if (shrink_list_turn == numneglists) + shrink_list_turn = 0; + if (ncp == NULL && shrink_list_turn == 0) + cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); + if (ncp == NULL) { + mtx_unlock(&ncneg_hot.nl_lock); + goto out; + } + + MPASS(ncp->nc_flag & NCF_NEGATIVE); + dvlp = VP2VNODELOCK(ncp->nc_dvp); + blp = NCP2BUCKETLOCK(ncp); + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); + mtx_lock(dvlp); + rw_wlock(blp); + mtx_lock(&ncneg_hot.nl_lock); + mtx_lock(&neglist->nl_lock); + ncp2 = TAILQ_FIRST(&neglist->nl_list); + if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || + blp != NCP2BUCKETLOCK(ncp2) || !(ncp2->nc_flag & NCF_NEGATIVE)) { + ncp = NULL; + goto out_unlock_all; + } + SDT_PROBE3(vfs, namecache, shrink_negative, done, ncp->nc_dvp, + nc_get_name(ncp), ncp->nc_neghits); + + cache_zap_locked(ncp, true); +out_unlock_all: + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); + rw_wunlock(blp); + mtx_unlock(dvlp); +out: + mtx_unlock(&ncneg_shrink_lock); + cache_free(ncp); +} + +/* + * cache_zap_locked(): * * Removes a namecache entry from cache, whether it contains an actual * pointer to a vnode or if it is just a negative cache entry. */ static void -cache_zap(struct namecache *ncp) +cache_zap_locked(struct namecache *ncp, bool neg_locked) { - struct vnode *vp; - rw_assert(&cache_lock, RA_WLOCKED); - CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); - if (ncp->nc_vp != NULL) { + if (!(ncp->nc_flag & NCF_NEGATIVE)) + cache_assert_vnode_locked(ncp->nc_vp); + cache_assert_vnode_locked(ncp->nc_dvp); + cache_assert_bucket_locked(ncp, RA_WLOCKED); + + CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, + (ncp->nc_flag & NCF_NEGATIVE) ? NULL : ncp->nc_vp); + if (!(ncp->nc_flag & NCF_NEGATIVE)) { SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, nc_get_name(ncp), ncp->nc_vp); } else { - SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, - nc_get_name(ncp)); + SDT_PROBE3(vfs, namecache, zap_negative, done, ncp->nc_dvp, + nc_get_name(ncp), ncp->nc_neghits); } - vp = NULL; LIST_REMOVE(ncp, nc_hash); + if (!(ncp->nc_flag & NCF_NEGATIVE)) { + TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); + if (ncp == ncp->nc_vp->v_cache_dd) + ncp->nc_vp->v_cache_dd = NULL; + } else { + cache_negative_remove(ncp, neg_locked); + } if (ncp->nc_flag & NCF_ISDOTDOT) { if (ncp == ncp->nc_dvp->v_cache_dd) ncp->nc_dvp->v_cache_dd = NULL; } else { LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { - vp = ncp->nc_dvp; - numcachehv--; + ncp->nc_flag |= NCF_DVDROP; + atomic_subtract_rel_long(&numcachehv, 1); } } - if (ncp->nc_vp) { - TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - if (ncp == ncp->nc_vp->v_cache_dd) - ncp->nc_vp->v_cache_dd = NULL; + atomic_subtract_rel_long(&numcache, 1); +} + +static void +cache_zap_negative_locked_vnode_kl(struct namecache *ncp, struct vnode *vp) +{ + struct rwlock *blp; + + MPASS(ncp->nc_dvp == vp); + MPASS(ncp->nc_flag & NCF_NEGATIVE); + cache_assert_vnode_locked(vp); + + blp = NCP2BUCKETLOCK(ncp); + rw_wlock(blp); + cache_zap_locked(ncp, false); + rw_wunlock(blp); +} + +static bool +cache_zap_locked_vnode_kl2(struct namecache *ncp, struct vnode *vp, + struct mtx **vlpp) +{ + struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; + struct rwlock *blp; + + MPASS(vp == ncp->nc_dvp || vp == ncp->nc_vp); + cache_assert_vnode_locked(vp); + + if (ncp->nc_flag & NCF_NEGATIVE) { + if (*vlpp != NULL) { + mtx_unlock(*vlpp); + *vlpp = NULL; + } + cache_zap_negative_locked_vnode_kl(ncp, vp); + return (true); + } + + pvlp = VP2VNODELOCK(vp); + blp = NCP2BUCKETLOCK(ncp); + vlp1 = VP2VNODELOCK(ncp->nc_dvp); + vlp2 = VP2VNODELOCK(ncp->nc_vp); + + if (*vlpp == vlp1 || *vlpp == vlp2) { + to_unlock = *vlpp; + *vlpp = NULL; } else { - TAILQ_REMOVE(&ncneg, ncp, nc_dst); - numneg--; + if (*vlpp != NULL) { + mtx_unlock(*vlpp); + *vlpp = NULL; + } + cache_sort(&vlp1, &vlp2); + if (vlp1 == pvlp) { + mtx_lock(vlp2); + to_unlock = vlp2; + } else { + if (!mtx_trylock(vlp1)) + goto out_relock; + to_unlock = vlp1; + } + } + rw_wlock(blp); + cache_zap_locked(ncp, false); + rw_wunlock(blp); + if (to_unlock != NULL) + mtx_unlock(to_unlock); + return (true); + +out_relock: + mtx_unlock(vlp2); + mtx_lock(vlp1); + mtx_lock(vlp2); + MPASS(*vlpp == NULL); + *vlpp = vlp1; + return (false); +} + +static int +cache_zap_locked_vnode(struct namecache *ncp, struct vnode *vp) +{ + struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; + struct rwlock *blp; + int error = 0; + + MPASS(vp == ncp->nc_dvp || vp == ncp->nc_vp); + cache_assert_vnode_locked(vp); + + pvlp = VP2VNODELOCK(vp); + if (ncp->nc_flag & NCF_NEGATIVE) { + cache_zap_negative_locked_vnode_kl(ncp, vp); + goto out; + } + + blp = NCP2BUCKETLOCK(ncp); + vlp1 = VP2VNODELOCK(ncp->nc_dvp); + vlp2 = VP2VNODELOCK(ncp->nc_vp); + cache_sort(&vlp1, &vlp2); + if (vlp1 == pvlp) { + mtx_lock(vlp2); + to_unlock = vlp2; + } else { + if (!mtx_trylock(vlp1)) { + error = EAGAIN; + goto out; + } + to_unlock = vlp1; + } + rw_wlock(blp); + cache_zap_locked(ncp, false); + rw_wunlock(blp); + mtx_unlock(to_unlock); +out: + mtx_unlock(pvlp); + return (error); +} + +static int +cache_zap_rlocked_bucket(struct namecache *ncp, struct rwlock *blp) +{ + struct mtx *dvlp, *vlp; + + cache_assert_bucket_locked(ncp, RA_RLOCKED); + + dvlp = VP2VNODELOCK(ncp->nc_dvp); + vlp = NULL; + if (!(ncp->nc_flag & NCF_NEGATIVE)) + vlp = VP2VNODELOCK(ncp->nc_vp); + if (cache_trylock_vnodes(dvlp, vlp) == 0) { + rw_runlock(blp); + rw_wlock(blp); + cache_zap_locked(ncp, false); + rw_wunlock(blp); + cache_unlock_vnodes(dvlp, vlp); + return (0); + } + + rw_runlock(blp); + return (EAGAIN); +} + +static int +cache_zap_wlocked_bucket_kl(struct namecache *ncp, struct rwlock *blp, + struct mtx **vlpp1, struct mtx **vlpp2) +{ + struct mtx *dvlp, *vlp; + + cache_assert_bucket_locked(ncp, RA_WLOCKED); + + dvlp = VP2VNODELOCK(ncp->nc_dvp); + vlp = NULL; + if (!(ncp->nc_flag & NCF_NEGATIVE)) + vlp = VP2VNODELOCK(ncp->nc_vp); + cache_sort(&dvlp, &vlp); + + if (*vlpp1 == dvlp && *vlpp2 == vlp) { + cache_zap_locked(ncp, false); + cache_unlock_vnodes(dvlp, vlp); + *vlpp1 = NULL; + *vlpp2 = NULL; + return (0); + } + + if (*vlpp1 != NULL) + mtx_unlock(*vlpp1); + if (*vlpp2 != NULL) + mtx_unlock(*vlpp2); + *vlpp1 = NULL; + *vlpp2 = NULL; + + if (cache_trylock_vnodes(dvlp, vlp) == 0) { + cache_zap_locked(ncp, false); + cache_unlock_vnodes(dvlp, vlp); + return (0); + } + + rw_wunlock(blp); + *vlpp1 = dvlp; + *vlpp2 = vlp; + if (*vlpp1 != NULL) + mtx_lock(*vlpp1); + mtx_lock(*vlpp2); + rw_wlock(blp); + return (EAGAIN); +} + +static void +cache_lookup_unlock(struct rwlock *blp, struct mtx *vlp) +{ + + if (blp != NULL) { + rw_runlock(blp); + mtx_assert(vlp, MA_NOTOWNED); + } else { + mtx_unlock(vlp); } - numcache--; - cache_free(ncp); - if (vp != NULL) - vdrop(vp); } /* @@ -500,19 +1102,21 @@ cache_lookup(struct vnode *dvp, struct v struct timespec *tsp, int *ticksp) { struct namecache *ncp; + struct rwlock *blp; + struct mtx *dvlp, *dvlp2; uint32_t hash; - int error, ltype, wlocked; + int error, ltype; if (!doingcache) { cnp->cn_flags &= ~MAKEENTRY; return (0); } retry: - wlocked = 0; - counter_u64_add(numcalls, 1); + blp = NULL; + dvlp = VP2VNODELOCK(dvp); error = 0; + counter_u64_add(numcalls, 1); -retry_wlocked: if (cnp->cn_nameptr[0] == '.') { if (cnp->cn_namelen == 1) { *vpp = dvp; @@ -544,28 +1148,44 @@ retry_wlocked: } return (-1); } - if (!wlocked) - CACHE_RLOCK(); if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { counter_u64_add(dotdothits, 1); - if (dvp->v_cache_dd == NULL) { + dvlp2 = NULL; + mtx_lock(dvlp); +retry_dotdot: + ncp = dvp->v_cache_dd; + if (ncp == NULL) { SDT_PROBE3(vfs, namecache, lookup, miss, dvp, "..", NULL); - goto unlock; + mtx_unlock(dvlp); + return (0); } if ((cnp->cn_flags & MAKEENTRY) == 0) { - if (!wlocked && !CACHE_UPGRADE_LOCK()) - goto wlock; - if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) - cache_zap(dvp->v_cache_dd); - dvp->v_cache_dd = NULL; - CACHE_WUNLOCK(); + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { + if (ncp->nc_dvp != dvp) + panic("dvp %p v_cache_dd %p\n", dvp, ncp); + if (!cache_zap_locked_vnode_kl2(ncp, + dvp, &dvlp2)) + goto retry_dotdot; + MPASS(dvp->v_cache_dd == NULL); + mtx_unlock(dvlp); + if (dvlp2 != NULL) + mtx_unlock(dvlp2); + cache_free(ncp); + } else { + dvp->v_cache_dd = NULL; + mtx_unlock(dvlp); + if (dvlp2 != NULL) + mtx_unlock(dvlp2); + } return (0); } - ncp = dvp->v_cache_dd; - if (ncp->nc_flag & NCF_ISDOTDOT) - *vpp = ncp->nc_vp; - else + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { + if (ncp->nc_flag & NCF_NEGATIVE) + *vpp = NULL; + else + *vpp = ncp->nc_vp; + } else *vpp = ncp->nc_dvp; /* Return failure if negative entry was found. */ if (*vpp == NULL) @@ -581,10 +1201,12 @@ retry_wlocked: nc_dotdottime; goto success; } - } else if (!wlocked) - CACHE_RLOCK(); + } hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); + blp = HASH2BUCKETLOCK(hash); + rw_rlock(blp); + LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { counter_u64_add(numchecks, 1); if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && @@ -607,15 +1229,11 @@ retry_wlocked: /* We don't want to have an entry, so dump it */ if ((cnp->cn_flags & MAKEENTRY) == 0) { counter_u64_add(numposzaps, 1); - if (!wlocked && !CACHE_UPGRADE_LOCK()) - goto wlock; - cache_zap(ncp); - CACHE_WUNLOCK(); - return (0); + goto zap_and_exit; } /* We found a "positive" match, return the vnode */ - if (ncp->nc_vp) { + if (!(ncp->nc_flag & NCF_NEGATIVE)) { counter_u64_add(numposhits, 1); *vpp = ncp->nc_vp; CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", @@ -630,43 +1248,19 @@ negative_success: /* We found a negative match, and want to create it, so purge */ if (cnp->cn_nameiop == CREATE) { counter_u64_add(numnegzaps, 1); - if (!wlocked && !CACHE_UPGRADE_LOCK()) - goto wlock; - cache_zap(ncp); - CACHE_WUNLOCK(); - return (0); + goto zap_and_exit; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 31 12:37:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1AE4C9802B; Sat, 31 Dec 2016 12:37:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B13FE1FED; Sat, 31 Dec 2016 12:37:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCbrH5080042; Sat, 31 Dec 2016 12:37:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCbrd6080041; Sat, 31 Dec 2016 12:37:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311237.uBVCbrd6080041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 12:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310960 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:37:55 -0000 Author: ngie Date: Sat Dec 31 12:37:53 2016 New Revision: 310960 URL: https://svnweb.freebsd.org/changeset/base/310960 Log: Similar to r310954, set .len to 0 on malloc failure and to `len` only on success MFC after: 1 week Modified: head/contrib/bsnmp/snmpd/export.c Modified: head/contrib/bsnmp/snmpd/export.c ============================================================================== --- head/contrib/bsnmp/snmpd/export.c Sat Dec 31 12:32:50 2016 (r310959) +++ head/contrib/bsnmp/snmpd/export.c Sat Dec 31 12:37:53 2016 (r310960) @@ -114,9 +114,11 @@ string_get(struct snmp_value *value, con } if (len == -1) len = strlen(ptr); - value->v.octetstring.len = (u_long)len; - if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL) + if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL) { + value->v.octetstring.len = 0; return (SNMP_ERR_RES_UNAVAIL); + } + value->v.octetstring.len = (u_long)len; memcpy(value->v.octetstring.octets, ptr, (size_t)len); return (SNMP_ERR_NOERROR); } @@ -138,9 +140,11 @@ string_get_max(struct snmp_value *value, len = strlen(ptr); if ((size_t)len > maxlen) len = maxlen; - value->v.octetstring.len = (u_long)len; - if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL) + if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL) { + value->v.octetstring.len = 0; return (SNMP_ERR_RES_UNAVAIL); + } + value->v.octetstring.len = (u_long)len; memcpy(value->v.octetstring.octets, ptr, (size_t)len); return (SNMP_ERR_NOERROR); } From owner-svn-src-all@freebsd.org Sat Dec 31 12:39:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356F4C98108; Sat, 31 Dec 2016 12:39:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05131116F; Sat, 31 Dec 2016 12:39:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCdGej080150; Sat, 31 Dec 2016 12:39:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCdG1V080149; Sat, 31 Dec 2016 12:39:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612311239.uBVCdG1V080149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 31 Dec 2016 12:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310961 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:39:17 -0000 Author: avos Date: Sat Dec 31 12:39:15 2016 New Revision: 310961 URL: https://svnweb.freebsd.org/changeset/base/310961 Log: sysctl(8): fix typename for uint32_t. MFC after: 5 days. Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Sat Dec 31 12:37:53 2016 (r310960) +++ head/sbin/sysctl/sysctl.c Sat Dec 31 12:39:15 2016 (r310961) @@ -114,7 +114,7 @@ static const char *ctl_typename[CTLTYPE+ [CTLTYPE_ULONG] = "unsigned long", [CTLTYPE_U8] = "uint8_t", [CTLTYPE_U16] = "uint16_t", - [CTLTYPE_U32] = "uint16_t", + [CTLTYPE_U32] = "uint32_t", [CTLTYPE_U64] = "uint64_t", [CTLTYPE_S8] = "int8_t", [CTLTYPE_S16] = "int16_t", From owner-svn-src-all@freebsd.org Sat Dec 31 12:39:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39D02C981AC; Sat, 31 Dec 2016 12:39:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0982E12B0; Sat, 31 Dec 2016 12:39:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCdZl7080207; Sat, 31 Dec 2016 12:39:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCdZ1s080206; Sat, 31 Dec 2016 12:39:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311239.uBVCdZ1s080206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 12:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310962 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:39:36 -0000 Author: mjg Date: Sat Dec 31 12:39:34 2016 New Revision: 310962 URL: https://svnweb.freebsd.org/changeset/base/310962 Log: MFC r305482: cv: do a lockless check for no waiters in cv_signal and cv_broadcastpri In case of some consumers like zfs there are no waiters vast majority of the time Modified: stable/11/sys/kern/kern_condvar.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_condvar.c ============================================================================== --- stable/11/sys/kern/kern_condvar.c Sat Dec 31 12:39:15 2016 (r310961) +++ stable/11/sys/kern/kern_condvar.c Sat Dec 31 12:39:34 2016 (r310962) @@ -397,6 +397,8 @@ cv_signal(struct cv *cvp) { int wakeup_swapper; + if (cvp->cv_waiters == 0) + return; wakeup_swapper = 0; sleepq_lock(cvp); if (cvp->cv_waiters > 0) { @@ -424,6 +426,8 @@ cv_broadcastpri(struct cv *cvp, int pri) { int wakeup_swapper; + if (cvp->cv_waiters == 0) + return; /* * XXX sleepq_broadcast pri argument changed from -1 meaning * no pri to 0 meaning no pri. From owner-svn-src-all@freebsd.org Sat Dec 31 12:41:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B400C98318; Sat, 31 Dec 2016 12:41:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF4216F9; Sat, 31 Dec 2016 12:41:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCfhI5083258; Sat, 31 Dec 2016 12:41:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCfhCT083256; Sat, 31 Dec 2016 12:41:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612311241.uBVCfhCT083256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 31 Dec 2016 12:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310963 - in head: . sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:41:44 -0000 Author: bapt Date: Sat Dec 31 12:41:42 2016 New Revision: 310963 URL: https://svnweb.freebsd.org/changeset/base/310963 Log: Bump copyright year. Happy New Year 2017! Modified: head/COPYRIGHT head/sys/sys/copyright.h Modified: head/COPYRIGHT ============================================================================== --- head/COPYRIGHT Sat Dec 31 12:39:34 2016 (r310962) +++ head/COPYRIGHT Sat Dec 31 12:41:42 2016 (r310963) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2016 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2017 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/sys/sys/copyright.h ============================================================================== --- head/sys/sys/copyright.h Sat Dec 31 12:39:34 2016 (r310962) +++ head/sys/sys/copyright.h Sat Dec 31 12:41:42 2016 (r310963) @@ -34,7 +34,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2016 The FreeBSD Project.\n" + "Copyright (c) 1992-2017 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@freebsd.org Sat Dec 31 12:47:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3CF8C98577; Sat, 31 Dec 2016 12:47:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 933131A42; Sat, 31 Dec 2016 12:47:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVClfck084295; Sat, 31 Dec 2016 12:47:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVClfZZ084294; Sat, 31 Dec 2016 12:47:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311247.uBVClfZZ084294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 12:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310964 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:47:42 -0000 Author: mjg Date: Sat Dec 31 12:47:41 2016 New Revision: 310964 URL: https://svnweb.freebsd.org/changeset/base/310964 Log: MFC r303921: sigio: do a lockless check in funsetownlist There is no need to grab the lock first to see if sigio is used, and it typically is not. Modified: stable/11/sys/kern/kern_descrip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_descrip.c ============================================================================== --- stable/11/sys/kern/kern_descrip.c Sat Dec 31 12:41:42 2016 (r310963) +++ stable/11/sys/kern/kern_descrip.c Sat Dec 31 12:47:41 2016 (r310964) @@ -939,6 +939,8 @@ funsetown(struct sigio **sigiop) { struct sigio *sigio; + if (*sigiop == NULL) + return; SIGIO_LOCK(); sigio = *sigiop; if (sigio == NULL) { From owner-svn-src-all@freebsd.org Sat Dec 31 12:49:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97970C9864F; Sat, 31 Dec 2016 12:49:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66F151C33; Sat, 31 Dec 2016 12:49:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCnKkd084452; Sat, 31 Dec 2016 12:49:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCnKTd084451; Sat, 31 Dec 2016 12:49:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311249.uBVCnKTd084451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 12:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310965 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:49:21 -0000 Author: mjg Date: Sat Dec 31 12:49:20 2016 New Revision: 310965 URL: https://svnweb.freebsd.org/changeset/base/310965 Log: MFC r303921: ktrace: do a lockless check on fork to see if tracing is enabled This saves 2 lock acquisitions in the common case. Modified: stable/11/sys/kern/kern_ktrace.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_ktrace.c ============================================================================== --- stable/11/sys/kern/kern_ktrace.c Sat Dec 31 12:47:41 2016 (r310964) +++ stable/11/sys/kern/kern_ktrace.c Sat Dec 31 12:49:20 2016 (r310965) @@ -572,9 +572,14 @@ void ktrprocfork(struct proc *p1, struct proc *p2) { + MPASS(p2->p_tracevp == NULL); + MPASS(p2->p_traceflag == 0); + + if (p1->p_traceflag == 0) + return; + PROC_LOCK(p1); mtx_lock(&ktrace_mtx); - KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); if (p1->p_traceflag & KTRFAC_INHERIT) { p2->p_traceflag = p1->p_traceflag; if ((p2->p_tracevp = p1->p_tracevp) != NULL) { From owner-svn-src-all@freebsd.org Sat Dec 31 12:52:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0399C98816; Sat, 31 Dec 2016 12:52:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF4B51011; Sat, 31 Dec 2016 12:52:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCqNkq088291; Sat, 31 Dec 2016 12:52:23 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCqNTZ088289; Sat, 31 Dec 2016 12:52:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612311252.uBVCqNTZ088289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 31 Dec 2016 12:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310966 - in stable/11: . sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:52:25 -0000 Author: bapt Date: Sat Dec 31 12:52:23 2016 New Revision: 310966 URL: https://svnweb.freebsd.org/changeset/base/310966 Log: Bump copyright year. Happy New Year 2017! Modified: stable/11/COPYRIGHT stable/11/sys/sys/copyright.h Directory Properties: stable/11/ (props changed) Modified: stable/11/COPYRIGHT ============================================================================== --- stable/11/COPYRIGHT Sat Dec 31 12:49:20 2016 (r310965) +++ stable/11/COPYRIGHT Sat Dec 31 12:52:23 2016 (r310966) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2016 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2017 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/11/sys/sys/copyright.h ============================================================================== --- stable/11/sys/sys/copyright.h Sat Dec 31 12:49:20 2016 (r310965) +++ stable/11/sys/sys/copyright.h Sat Dec 31 12:52:23 2016 (r310966) @@ -34,7 +34,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2016 The FreeBSD Project.\n" + "Copyright (c) 1992-2017 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@freebsd.org Sat Dec 31 12:53:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E14C98883; Sat, 31 Dec 2016 12:53:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 032461191; Sat, 31 Dec 2016 12:52:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCqxXh088349; Sat, 31 Dec 2016 12:52:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCqxqd088347; Sat, 31 Dec 2016 12:52:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612311252.uBVCqxqd088347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 31 Dec 2016 12:52: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: r310967 - in stable/10: . sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:53:00 -0000 Author: bapt Date: Sat Dec 31 12:52:58 2016 New Revision: 310967 URL: https://svnweb.freebsd.org/changeset/base/310967 Log: Bump copyright year. Happy New Year 2017! Modified: stable/10/COPYRIGHT stable/10/sys/sys/copyright.h Directory Properties: stable/10/ (props changed) Modified: stable/10/COPYRIGHT ============================================================================== --- stable/10/COPYRIGHT Sat Dec 31 12:52:23 2016 (r310966) +++ stable/10/COPYRIGHT Sat Dec 31 12:52:58 2016 (r310967) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2016 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2017 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/10/sys/sys/copyright.h ============================================================================== --- stable/10/sys/sys/copyright.h Sat Dec 31 12:52:23 2016 (r310966) +++ stable/10/sys/sys/copyright.h Sat Dec 31 12:52:58 2016 (r310967) @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2016 The FreeBSD Project.\n" + "Copyright (c) 1992-2017 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@freebsd.org Sat Dec 31 12:58:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CF39C98BB6; Sat, 31 Dec 2016 12:58:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E936C13CE; Sat, 31 Dec 2016 12:58:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVCwR7Z088595; Sat, 31 Dec 2016 12:58:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVCwRbs088594; Sat, 31 Dec 2016 12:58:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311258.uBVCwRbs088594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 12:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310968 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 12:58:28 -0000 Author: mjg Date: Sat Dec 31 12:58:26 2016 New Revision: 310968 URL: https://svnweb.freebsd.org/changeset/base/310968 Log: MFC r304927: vfs: provide a common exit point in namei for error cases This shortens the function, adds the SDT_PROBE use for error cases and consistenly unrefs rootdir last. Modified: stable/11/sys/kern/vfs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_lookup.c ============================================================================== --- stable/11/sys/kern/vfs_lookup.c Sat Dec 31 12:52:58 2016 (r310967) +++ stable/11/sys/kern/vfs_lookup.c Sat Dec 31 12:58:26 2016 (r310968) @@ -380,9 +380,7 @@ namei(struct nameidata *ndp) if (error != 0) { if (dp != NULL) vrele(dp); - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); - return (error); + goto out; } if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && lookup_cap_dotdot != 0) @@ -392,12 +390,8 @@ namei(struct nameidata *ndp) for (;;) { ndp->ni_startdir = dp; error = lookup(ndp); - if (error != 0) { - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); - SDT_PROBE2(vfs, namei, lookup, return, error, NULL); - return (error); - } + if (error != 0) + goto out; /* * If not a symbolic link, we're done. */ @@ -471,18 +465,16 @@ namei(struct nameidata *ndp) if (*(cnp->cn_nameptr) == '/') { vrele(dp); error = namei_handle_root(ndp, &dp); - if (error != 0) { - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); - return (error); - } + if (error != 0) + goto out; } } - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); vput(ndp->ni_vp); ndp->ni_vp = NULL; vrele(ndp->ni_dvp); +out: + vrele(ndp->ni_rootdir); + namei_cleanup_cnp(cnp); nameicap_cleanup(ndp); SDT_PROBE2(vfs, namei, lookup, return, error, NULL); return (error); From owner-svn-src-all@freebsd.org Sat Dec 31 13:04:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3B56C98D93; Sat, 31 Dec 2016 13:04:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E5BE1849; Sat, 31 Dec 2016 13:04:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVD4ClZ092365; Sat, 31 Dec 2016 13:04:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVD4Cg9092364; Sat, 31 Dec 2016 13:04:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311304.uBVD4Cg9092364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 13:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310969 - stable/11/sys/compat/linprocfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 13:04:14 -0000 Author: mjg Date: Sat Dec 31 13:04:12 2016 New Revision: 310969 URL: https://svnweb.freebsd.org/changeset/base/310969 Log: MFC r305856: linprocfs: garbage collect meminfo fields not present in linux In particular memshared not only does not exist in linux, it was extremely expensive to calculate. Modified: stable/11/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/11/sys/compat/linprocfs/linprocfs.c Sat Dec 31 12:58:26 2016 (r310968) +++ stable/11/sys/compat/linprocfs/linprocfs.c Sat Dec 31 13:04:12 2016 (r310969) @@ -144,12 +144,10 @@ linprocfs_domeminfo(PFS_FILL_ARGS) unsigned long memtotal; /* total memory in bytes */ unsigned long memused; /* used memory in bytes */ unsigned long memfree; /* free memory in bytes */ - unsigned long memshared; /* shared memory ??? */ unsigned long buffers, cached; /* buffer / cache memory ??? */ unsigned long long swaptotal; /* total swap space in bytes */ unsigned long long swapused; /* used swap space in bytes */ unsigned long long swapfree; /* free swap space in bytes */ - vm_object_t object; int i, j; memtotal = physmem * PAGE_SIZE; @@ -169,13 +167,6 @@ linprocfs_domeminfo(PFS_FILL_ARGS) swaptotal = (unsigned long long)i * PAGE_SIZE; swapused = (unsigned long long)j * PAGE_SIZE; swapfree = swaptotal - swapused; - memshared = 0; - mtx_lock(&vm_object_list_mtx); - TAILQ_FOREACH(object, &vm_object_list, object_list) - if (object->shadow_count > 1) - memshared += object->resident_page_count; - mtx_unlock(&vm_object_list_mtx); - memshared *= PAGE_SIZE; /* * We'd love to be able to write: * @@ -188,21 +179,14 @@ linprocfs_domeminfo(PFS_FILL_ARGS) cached = vm_cnt.v_cache_count * PAGE_SIZE; sbuf_printf(sb, - " total: used: free: shared: buffers: cached:\n" - "Mem: %lu %lu %lu %lu %lu %lu\n" - "Swap: %llu %llu %llu\n" "MemTotal: %9lu kB\n" "MemFree: %9lu kB\n" - "MemShared:%9lu kB\n" "Buffers: %9lu kB\n" "Cached: %9lu kB\n" "SwapTotal:%9llu kB\n" "SwapFree: %9llu kB\n", - memtotal, memused, memfree, memshared, buffers, cached, - swaptotal, swapused, swapfree, - B2K(memtotal), B2K(memfree), - B2K(memshared), B2K(buffers), B2K(cached), - B2K(swaptotal), B2K(swapfree)); + B2K(memtotal), B2K(memfree), B2K(buffers), + B2K(cached), B2K(swaptotal), B2K(swapfree)); return (0); } From owner-svn-src-all@freebsd.org Sat Dec 31 13:05:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5ED5C98E12; Sat, 31 Dec 2016 13:05:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A085919B5; Sat, 31 Dec 2016 13:05:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVD5mjU092483; Sat, 31 Dec 2016 13:05:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVD5mw6092479; Sat, 31 Dec 2016 13:05:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311305.uBVD5mw6092479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 13:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310970 - in stable/11/sys: kern x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 13:05:49 -0000 Author: mjg Date: Sat Dec 31 13:05:48 2016 New Revision: 310970 URL: https://svnweb.freebsd.org/changeset/base/310970 Log: MFC r307653: Mark a bunch of mpsafe sysctls as such. This gives me a sysctl Giant-free buildworld. Modified: stable/11/sys/kern/kern_exec.c stable/11/sys/kern/kern_mib.c stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Sat Dec 31 13:04:12 2016 (r310969) +++ stable/11/sys/kern/kern_exec.c Sat Dec 31 13:05:48 2016 (r310970) @@ -118,14 +118,14 @@ static int do_execve(struct thread *td, struct mac *mac_p); /* XXX This should be vm_size_t. */ -SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD, - NULL, 0, sysctl_kern_ps_strings, "LU", ""); +SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD| + CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU", ""); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD| - CTLFLAG_CAPRD, NULL, 0, sysctl_kern_usrstack, "LU", ""); + CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU", ""); -SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD, +SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_stackprot, "I", ""); u_long ps_arg_cache_limit = PAGE_SIZE / 16; Modified: stable/11/sys/kern/kern_mib.c ============================================================================== --- stable/11/sys/kern/kern_mib.c Sat Dec 31 13:04:12 2016 (r310969) +++ stable/11/sys/kern/kern_mib.c Sat Dec 31 13:05:48 2016 (r310970) @@ -135,7 +135,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE, kernelname, sizeof kernelname, "Name of kernel file booted"); SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD, @@ -254,8 +254,9 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR return (error); } -SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine_arch, "A", + "System architecture"); SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, #ifdef COMPAT_FREEBSD32 @@ -383,8 +384,8 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, secur /* Actual kernel configuration options. */ extern char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0, - "Kernel configuration file"); +SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD | CTLFLAG_MPSAFE, + kernconfstring, 0, "Kernel configuration file"); #endif static int Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Sat Dec 31 13:04:12 2016 (r310969) +++ stable/11/sys/x86/x86/identcpu.c Sat Dec 31 13:05:48 2016 (r310970) @@ -148,15 +148,15 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_hw_machine, "A", "Machine class"); +SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); #else SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); #endif static char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE, cpu_model, 0, "Machine model"); static int hw_clockrate; @@ -165,8 +165,8 @@ SYSCTL_INT(_hw, OID_AUTO, clockrate, CTL u_int hv_high; char hv_vendor[16]; -SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0, - "Hypervisor vendor"); +SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD | CTLFLAG_MPSAFE, hv_vendor, + 0, "Hypervisor vendor"); static eventhandler_tag tsc_post_tag; From owner-svn-src-all@freebsd.org Sat Dec 31 13:07:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83641C98EB0; Sat, 31 Dec 2016 13:07:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52BEF1B1B; Sat, 31 Dec 2016 13:07:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVD79Tp092591; Sat, 31 Dec 2016 13:07:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVD79GB092590; Sat, 31 Dec 2016 13:07:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311307.uBVD79GB092590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 13:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310971 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 13:07:10 -0000 Author: mjg Date: Sat Dec 31 13:07:09 2016 New Revision: 310971 URL: https://svnweb.freebsd.org/changeset/base/310971 Log: MFC r309111: wait: avoid relocking the child if proc_to_reap returns 1 proc_to_reap would always unlock. However, if it returned 1, kern_wait6 would immediately lock it again. Save the dance. Modified: stable/11/sys/kern/kern_exit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exit.c ============================================================================== --- stable/11/sys/kern/kern_exit.c Sat Dec 31 13:05:48 2016 (r310970) +++ stable/11/sys/kern/kern_exit.c Sat Dec 31 13:07:09 2016 (r310971) @@ -1066,7 +1066,6 @@ proc_to_reap(struct thread *td, struct p proc_reap(td, p, status, options); return (-1); } - PROC_UNLOCK(p); return (1); } @@ -1199,7 +1198,7 @@ loop: return (0); } - PROC_LOCK(p); + PROC_LOCK_ASSERT(p, MA_OWNED); if ((options & (WTRAPPED | WUNTRACED)) != 0) PROC_SLOCK(p); @@ -1259,6 +1258,7 @@ loop: if (ret != 0) { KASSERT(ret != -1, ("reaped an orphan (pid %d)", (int)td->td_retval[0])); + PROC_UNLOCK(p); nfound++; break; } From owner-svn-src-all@freebsd.org Sat Dec 31 13:10:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C00FC98F75; Sat, 31 Dec 2016 13:10:08 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3DA51CB1; Sat, 31 Dec 2016 13:10:07 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVDA71a092781; Sat, 31 Dec 2016 13:10:07 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVDA7Ah092780; Sat, 31 Dec 2016 13:10:07 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201612311310.uBVDA7Ah092780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 31 Dec 2016 13:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310972 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 13:10:08 -0000 Author: jmcneill Date: Sat Dec 31 13:10:06 2016 New Revision: 310972 URL: https://svnweb.freebsd.org/changeset/base/310972 Log: Fix a typo in the third address of the reg property for the usbphy node. MFC after: 1 week Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/a83t.dtsi Sat Dec 31 13:07:09 2016 (r310971) +++ head/sys/boot/fdt/dts/arm/a83t.dtsi Sat Dec 31 13:10:06 2016 (r310972) @@ -178,7 +178,7 @@ compatible = "allwinner,sun8i-a83t-usb-phy"; reg = <0x01c19400 0x2c>, <0x01c1a800 0x4>, - <0x01c1a800 0x4>; + <0x01c1b800 0x4>; clocks = <&usb_clk 8>, <&usb_clk 9>, <&usb_clk 10>, From owner-svn-src-all@freebsd.org Sat Dec 31 13:10:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A253C98F7A; Sat, 31 Dec 2016 13:10:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 697361CB2; Sat, 31 Dec 2016 13:10:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVDA8aG092827; Sat, 31 Dec 2016 13:10:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVDA8iI092826; Sat, 31 Dec 2016 13:10:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311310.uBVDA8iI092826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 13:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310973 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 13:10:09 -0000 Author: mjg Date: Sat Dec 31 13:10:08 2016 New Revision: 310973 URL: https://svnweb.freebsd.org/changeset/base/310973 Log: MFC r309307,r309308: vfs: avoid VOP_ISLOCKED in the common case in lookup == vfs: fix a whitespace nit in r309307 Modified: stable/11/sys/kern/vfs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_lookup.c ============================================================================== --- stable/11/sys/kern/vfs_lookup.c Sat Dec 31 13:10:06 2016 (r310972) +++ stable/11/sys/kern/vfs_lookup.c Sat Dec 31 13:10:08 2016 (r310973) @@ -802,9 +802,8 @@ unionlookup: * If we have a shared lock we may need to upgrade the lock for the * last operation. */ - if (dp != vp_crossmp && - VOP_ISLOCKED(dp) == LK_SHARED && - (cnp->cn_flags & ISLASTCN) && (cnp->cn_flags & LOCKPARENT)) + if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) && + dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED) vn_lock(dp, LK_UPGRADE|LK_RETRY); if ((dp->v_iflag & VI_DOOMED) != 0) { error = ENOENT; From owner-svn-src-all@freebsd.org Sat Dec 31 13:15:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48859C99228; Sat, 31 Dec 2016 13:15:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09405134D; Sat, 31 Dec 2016 13:15:52 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVDFqIi096849; Sat, 31 Dec 2016 13:15:52 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVDFqYl096848; Sat, 31 Dec 2016 13:15:52 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201612311315.uBVDFqYl096848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 31 Dec 2016 13:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310974 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 13:15:53 -0000 Author: hrs Date: Sat Dec 31 13:15:52 2016 New Revision: 310974 URL: https://svnweb.freebsd.org/changeset/base/310974 Log: - Use more descriptive names for variables. - Set O_CLOEXEC to the signal pipe and /dev/klog. - Use a single signal handler to catch both SIGHUP and SIGCHLD. - Fix a bug which did FD_SET() the writer-end of the pipe. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Dec 31 13:10:08 2016 (r310973) +++ head/usr.sbin/syslogd/syslogd.c Sat Dec 31 13:15:52 2016 (r310974) @@ -321,7 +321,7 @@ static int LogFacPri; /* Put facility an static int KeepKernFac; /* Keep remotely logged kernel facility */ static int needdofsync = 0; /* Are any file(s) waiting to be fsynced? */ static struct pidfh *pfh; -static int sigp[2]; /* Pipe to catch a signal during select(). */ +static int sigpipe[2]; /* Pipe to catch a signal during select(). */ static volatile sig_atomic_t MarkSet, WantDie, WantInitialize, WantReapchild; @@ -341,7 +341,6 @@ static void dofsync(void); static void domark(int); static void fprintlog(struct filed *, int, const char *); static void init(int); -static void init_sh(int); static void logerror(const char *); static void logmsg(int, const char *, const char *, int); static void log_deadchild(pid_t, int, const char *); @@ -350,12 +349,12 @@ static int socksetup(struct peer *); static int socklist_recv_file(struct socklist *); static int socklist_recv_sock(struct socklist *); static int socklist_recv_signal(struct socklist *); +static void sighandler(int); static int skip_message(const char *, const char *, int); static void printline(const char *, char *, int); static void printsys(char *); static int p_open(const char *, pid_t *); static void reapchild(int); -static void reapchild_sh(int); static const char *ttymsg_check(struct iovec *, int, char *, int); static void usage(void); static int validate(struct sockaddr *, const char *); @@ -582,18 +581,18 @@ main(int argc, char *argv[]) usage(); /* Pipe to catch a signal during select(). */ - s = pipe2(sigp, O_NONBLOCK); + s = pipe2(sigpipe, O_CLOEXEC); if (s < 0) { err(1, "cannot open a pipe for signals"); } else { addsock(NULL, 0, &(struct socklist){ - .sl_socket = sigp[1], + .sl_socket = sigpipe[0], .sl_recv = socklist_recv_signal }); } /* Listen by default: /dev/klog. */ - s = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0); + s = open(_PATH_KLOG, O_RDONLY | O_NONBLOCK | O_CLOEXEC, 0); if (s < 0) { dprintf("can't open %s (%d)\n", _PATH_KLOG, errno); } else { @@ -646,8 +645,8 @@ main(int argc, char *argv[]) (void)signal(SIGTERM, dodie); (void)signal(SIGINT, Debug ? dodie : SIG_IGN); (void)signal(SIGQUIT, Debug ? dodie : SIG_IGN); - (void)signal(SIGHUP, init_sh); - (void)signal(SIGCHLD, reapchild_sh); + (void)signal(SIGHUP, sighandler); + (void)signal(SIGCHLD, sighandler); (void)signal(SIGALRM, domark); (void)signal(SIGPIPE, SIG_IGN); /* We'll catch EPIPE instead. */ (void)alarm(TIMERINTVL); @@ -717,12 +716,31 @@ static int socklist_recv_signal(struct socklist *sl __unused) { ssize_t len; - static char buf[BUFSIZ]; - - /* Clear an wake-up signal by reading dummy data. */ - while ((len = read(sigp[0], buf, sizeof(buf))) > 0) - ; + int i, nsig, signo; + if (ioctl(sigpipe[0], FIONREAD, &i) != 0) { + logerror("ioctl(FIONREAD)"); + err(1, "signal pipe read failed"); + } + nsig = i / sizeof(signo); + dprintf("# of received signals = %d\n", nsig); + for (i = 0; i < nsig; i++) { + len = read(sigpipe[0], &signo, sizeof(signo)); + if (len != sizeof(signo)) { + logerror("signal pipe read failed"); + err(1, "signal pipe read failed"); + } + dprintf("Received signal: %d from fd=%d\n", signo, + sigpipe[0]); + switch (signo) { + case SIGHUP: + WantInitialize = 1; + break; + case SIGCHLD: + WantReapchild = 1; + break; + } + } return (0); } @@ -1512,17 +1530,6 @@ ttymsg_check(struct iovec *iov, int iovc } static void -reapchild_sh(int signo) -{ - static char buf[BUFSIZ]; - - WantReapchild = signo; - /* Send an wake-up signal to the select() loop. */ - read(sigp[0], buf, sizeof(buf)); - write(sigp[1], &signo, sizeof(signo)); -} - -static void reapchild(int signo __unused) { int status; @@ -1793,20 +1800,17 @@ readconfigfile(FILE *cf, int allow_inclu } } -/* - * INIT -- Initialize syslogd from configuration table - */ static void -init_sh(int signo) +sighandler(int signo) { - static char buf[BUFSIZ]; - WantInitialize = signo; /* Send an wake-up signal to the select() loop. */ - read(sigp[0], buf, sizeof(buf)); - write(sigp[1], &signo, sizeof(signo)); + write(sigpipe[1], &signo, sizeof(signo)); } +/* + * INIT -- Initialize syslogd from configuration table + */ static void init(int signo) { From owner-svn-src-all@freebsd.org Sat Dec 31 13:23:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 777E6C994B1; Sat, 31 Dec 2016 13:23:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46A5E190F; Sat, 31 Dec 2016 13:23:29 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVDNSdA000880; Sat, 31 Dec 2016 13:23:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVDNSD2000879; Sat, 31 Dec 2016 13:23:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311323.uBVDNSD2000879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 13:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310975 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 13:23:29 -0000 Author: mjg Date: Sat Dec 31 13:23:28 2016 New Revision: 310975 URL: https://svnweb.freebsd.org/changeset/base/310975 Log: MFC r303583: amd64: implement pagezero using rep stos The current implementation uses non-temporal writes. This turns out to be detrimental to performance if the page is used shortly after, which is the typical case with page faults. Switch to rep stos. Modified: stable/10/sys/amd64/amd64/support.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/support.S ============================================================================== --- stable/10/sys/amd64/amd64/support.S Sat Dec 31 13:15:52 2016 (r310974) +++ stable/10/sys/amd64/amd64/support.S Sat Dec 31 13:23:28 2016 (r310975) @@ -65,17 +65,10 @@ END(bzero) /* Address: %rdi */ ENTRY(pagezero) PUSH_FRAME_POINTER - movq $-PAGE_SIZE,%rdx - subq %rdx,%rdi + movq $PAGE_SIZE/8,%rcx xorl %eax,%eax -1: - movnti %rax,(%rdi,%rdx) - movnti %rax,8(%rdi,%rdx) - movnti %rax,16(%rdi,%rdx) - movnti %rax,24(%rdi,%rdx) - addq $32,%rdx - jne 1b - sfence + rep + stosq POP_FRAME_POINTER ret END(pagezero) From owner-svn-src-all@freebsd.org Sat Dec 31 15:30:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B7EC98727; Sat, 31 Dec 2016 15:30:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4B321D96; Sat, 31 Dec 2016 15:30:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVFU1xA052270; Sat, 31 Dec 2016 15:30:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVFU1ST052269; Sat, 31 Dec 2016 15:30:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612311530.uBVFU1ST052269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 31 Dec 2016 15:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310976 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 15:30:02 -0000 Author: pfg Date: Sat Dec 31 15:30:00 2016 New Revision: 310976 URL: https://svnweb.freebsd.org/changeset/base/310976 Log: Move __hidden attribute towards the end of the declaration. Apple had them at the start but moving them to the end is better for faster reading and fits better what is done in other FreeBSD headers. MFC after: 5 days Modified: head/lib/libc/locale/mblocal.h Modified: head/lib/libc/locale/mblocal.h ============================================================================== --- head/lib/libc/locale/mblocal.h Sat Dec 31 13:23:28 2016 (r310975) +++ head/lib/libc/locale/mblocal.h Sat Dec 31 15:30:00 2016 (r310976) @@ -65,18 +65,18 @@ extern struct xlocale_ctype __xlocale_gl /* * Rune initialization function prototypes. */ -__hidden int _none_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _ascii_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _UTF8_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _EUC_CN_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _EUC_JP_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _EUC_KR_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _EUC_TW_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _GB18030_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _GB2312_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _GBK_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _BIG5_init(struct xlocale_ctype *, _RuneLocale *); -__hidden int _MSKanji_init(struct xlocale_ctype *, _RuneLocale *); +int _none_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _UTF8_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _EUC_CN_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _EUC_JP_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _EUC_KR_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _EUC_TW_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _GB18030_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _GB2312_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _GBK_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _BIG5_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _MSKanji_init(struct xlocale_ctype *, _RuneLocale *) __hidden; +int _ascii_init(struct xlocale_ctype *, _RuneLocale *) __hidden; typedef size_t (*mbrtowc_pfn_t)(wchar_t * __restrict, const char * __restrict, size_t, mbstate_t * __restrict); From owner-svn-src-all@freebsd.org Sat Dec 31 15:58:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0DD2C99147; Sat, 31 Dec 2016 15:58:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB211BC6; Sat, 31 Dec 2016 15:58:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVFwF4T064429; Sat, 31 Dec 2016 15:58:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVFwFN2064428; Sat, 31 Dec 2016 15:58:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612311558.uBVFwFN2064428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 31 Dec 2016 15:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310977 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 15:58:16 -0000 Author: pfg Date: Sat Dec 31 15:58:15 2016 New Revision: 310977 URL: https://svnweb.freebsd.org/changeset/base/310977 Log: Addition of clang nullability qualifiers. Add two new qualifiers for use by the static checkers: _Nonnull The _Nonnull nullability qualifier indicates that null is not a meaningful value for a value of the _Nonnull pointer type. _Nullable The _Nullable nullability qualifier indicates that a value of the _Nullable pointer type can be null. These were introduced in Clang 3.7. For more information, see: http://clang.llvm.org/docs/AttributeReference.html#nonnull We add these now without using them so that the GCC ports have time to pick up the header change. Hinted by: Android Bionic libc [1] Also seen in: Apple's Libc-1158.20.4 [1] https://github.com/android/platform_bionic/commit/baa2a973bd776a51bb05a8590ab05d86eea7b321 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Dec 31 15:30:00 2016 (r310976) +++ head/sys/sys/cdefs.h Sat Dec 31 15:58:15 2016 (r310977) @@ -804,6 +804,14 @@ #endif /* + * Nullability qualifiers: currently only supported by Clang. + */ +#if !(defined(__clang__) && __has_feature(nullability)) +#define _Nonnull +#define _Nullable +#endif + +/* * Type Safety Checking * * Clang provides additional attributes to enable checking type safety From owner-svn-src-all@freebsd.org Sat Dec 31 16:37:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10DAEC99DD9; Sat, 31 Dec 2016 16:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BADCE13DE; Sat, 31 Dec 2016 16:37:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVGbljm081510; Sat, 31 Dec 2016 16:37:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVGblbG081502; Sat, 31 Dec 2016 16:37:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311637.uBVGblbG081502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 16:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310979 - in stable/10/sys: kern 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 16:37:49 -0000 Author: mjg Date: Sat Dec 31 16:37:47 2016 New Revision: 310979 URL: https://svnweb.freebsd.org/changeset/base/310979 Log: MFC r301157: Microoptimize locking primitives by avoiding unnecessary atomic ops. Inline version of primitives do an atomic op and if it fails they fallback to actual primitives, which immediately retry the atomic op. The obvious optimisation is to check if the lock is free and only then proceed to do an atomic op. Modified: stable/10/sys/kern/kern_lock.c stable/10/sys/kern/kern_mutex.c stable/10/sys/kern/kern_rwlock.c stable/10/sys/kern/kern_sx.c stable/10/sys/sys/mutex.h stable/10/sys/sys/rwlock.h stable/10/sys/sys/sx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_lock.c ============================================================================== --- stable/10/sys/kern/kern_lock.c Sat Dec 31 16:02:27 2016 (r310978) +++ stable/10/sys/kern/kern_lock.c Sat Dec 31 16:37:47 2016 (r310979) @@ -792,8 +792,10 @@ __lockmgr_args(struct lock *lk, u_int fl break; } - while (!atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, - tid)) { + for (;;) { + if (lk->lk_lock == LK_UNLOCKED && + atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) + break; #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -1129,7 +1131,11 @@ __lockmgr_args(struct lock *lk, u_int fl __func__, iwmesg, file, line); } - while (!atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) { + for (;;) { + if (lk->lk_lock == LK_UNLOCKED && + atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) + break; + #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif Modified: stable/10/sys/kern/kern_mutex.c ============================================================================== --- stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:02:27 2016 (r310978) +++ stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:37:47 2016 (r310979) @@ -451,7 +451,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, all_time -= lockstat_nsecs(&m->lock_object); #endif - while (!_mtx_obtain_lock(m, tid)) { + for (;;) { + if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) + break; #ifdef KDTRACE_HOOKS spin_cnt++; #endif @@ -634,8 +636,9 @@ _mtx_lock_spin_cookie(volatile uintptr_t #ifdef KDTRACE_HOOKS spin_time -= lockstat_nsecs(&m->lock_object); #endif - while (!_mtx_obtain_lock(m, tid)) { - + for (;;) { + if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) + break; /* Give interrupts a chance while we spin. */ spinlock_exit(); while (m->mtx_lock != MTX_UNOWNED) { @@ -714,7 +717,9 @@ retry: m->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); - while (!_mtx_obtain_lock(m, tid)) { + for (;;) { + if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) + break; if (m->mtx_lock == tid) { m->mtx_recurse++; break; Modified: stable/10/sys/kern/kern_rwlock.c ============================================================================== --- stable/10/sys/kern/kern_rwlock.c Sat Dec 31 16:02:27 2016 (r310978) +++ stable/10/sys/kern/kern_rwlock.c Sat Dec 31 16:37:47 2016 (r310979) @@ -768,7 +768,9 @@ __rw_wlock_hard(volatile uintptr_t *c, u all_time -= lockstat_nsecs(&rw->lock_object); state = rw->rw_lock; #endif - while (!_rw_write_lock(rw, tid)) { + for (;;) { + if (rw->rw_lock == RW_UNLOCKED && _rw_write_lock(rw, tid)) + break; #ifdef KDTRACE_HOOKS spin_cnt++; #endif Modified: stable/10/sys/kern/kern_sx.c ============================================================================== --- stable/10/sys/kern/kern_sx.c Sat Dec 31 16:02:27 2016 (r310978) +++ stable/10/sys/kern/kern_sx.c Sat Dec 31 16:37:47 2016 (r310979) @@ -547,7 +547,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t all_time -= lockstat_nsecs(&sx->lock_object); state = sx->sx_lock; #endif - while (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) { + for (;;) { + if (sx->sx_lock == SX_LOCK_UNLOCKED && + atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) + break; #ifdef KDTRACE_HOOKS spin_cnt++; #endif Modified: stable/10/sys/sys/mutex.h ============================================================================== --- stable/10/sys/sys/mutex.h Sat Dec 31 16:02:27 2016 (r310978) +++ stable/10/sys/sys/mutex.h Sat Dec 31 16:37:47 2016 (r310979) @@ -188,7 +188,7 @@ void thread_lock_flags_(struct thread *, #define __mtx_lock(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ \ - if (!_mtx_obtain_lock((mp), _tid)) \ + if (((mp)->mtx_lock != MTX_UNOWNED || !_mtx_obtain_lock((mp), _tid)))\ _mtx_lock_sleep((mp), _tid, (opts), (file), (line)); \ else \ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_LOCK_ACQUIRE, \ @@ -206,7 +206,7 @@ void thread_lock_flags_(struct thread *, uintptr_t _tid = (uintptr_t)(tid); \ \ spinlock_enter(); \ - if (!_mtx_obtain_lock((mp), _tid)) { \ + if (((mp)->mtx_lock != MTX_UNOWNED || !_mtx_obtain_lock((mp), _tid))) {\ if ((mp)->mtx_lock == _tid) \ (mp)->mtx_recurse++; \ else \ @@ -262,7 +262,7 @@ void thread_lock_flags_(struct thread *, #define __mtx_unlock(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ \ - if (!_mtx_release_lock((mp), _tid)) \ + if ((mp)->mtx_lock != _tid || !_mtx_release_lock((mp), _tid)) \ _mtx_unlock_sleep((mp), (opts), (file), (line)); \ } while (0) Modified: stable/10/sys/sys/rwlock.h ============================================================================== --- stable/10/sys/sys/rwlock.h Sat Dec 31 16:02:27 2016 (r310978) +++ stable/10/sys/sys/rwlock.h Sat Dec 31 16:37:47 2016 (r310979) @@ -96,7 +96,7 @@ #define __rw_wlock(rw, tid, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ \ - if (!_rw_write_lock((rw), _tid)) \ + if ((rw)->rw_lock != RW_UNLOCKED || !_rw_write_lock((rw), _tid))\ _rw_wlock_hard((rw), _tid, (file), (line)); \ else \ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE, \ @@ -109,7 +109,7 @@ \ if ((rw)->rw_recurse) \ (rw)->rw_recurse--; \ - else if (!_rw_write_unlock((rw), _tid)) \ + else if ((rw)->rw_lock != _tid || !_rw_write_unlock((rw), _tid))\ _rw_wunlock_hard((rw), _tid, (file), (line)); \ } while (0) Modified: stable/10/sys/sys/sx.h ============================================================================== --- stable/10/sys/sys/sx.h Sat Dec 31 16:02:27 2016 (r310978) +++ stable/10/sys/sys/sx.h Sat Dec 31 16:37:47 2016 (r310979) @@ -148,7 +148,8 @@ __sx_xlock(struct sx *sx, struct thread uintptr_t tid = (uintptr_t)td; int error = 0; - if (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) + if (sx->sx_lock != SX_LOCK_UNLOCKED || + !atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) error = _sx_xlock_hard(sx, tid, opts, file, line); else LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE, @@ -163,7 +164,8 @@ __sx_xunlock(struct sx *sx, struct threa { uintptr_t tid = (uintptr_t)td; - if (!atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) + if (sx->sx_lock != tid || + !atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) _sx_xunlock_hard(sx, tid, file, line); } From owner-svn-src-all@freebsd.org Sat Dec 31 16:57:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC1AC991C4; Sat, 31 Dec 2016 16:57:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB50C1D73; Sat, 31 Dec 2016 16:57:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVGv6tO089691; Sat, 31 Dec 2016 16:57:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVGv5Oe089686; Sat, 31 Dec 2016 16:57:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311657.uBVGv5Oe089686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 16:57: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: r310980 - in stable/10/sys: kern 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 16:57:07 -0000 Author: mjg Date: Sat Dec 31 16:57:05 2016 New Revision: 310980 URL: https://svnweb.freebsd.org/changeset/base/310980 Log: MFC r285706,r303562,r303563,r303584,r303643,r303652,r303655,r303707: (by markj) Don't increment the spin count until after the first attempt to acquire a rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire spuriously. == rwlock: s/READER/WRITER/ in wlock lockstat annotation == sx: increment spin_cnt before cpu_spinwait in xlock The change is a no-op only done for consistency with the rest of the file. == locks: change sleep_cnt and spin_cnt types to u_int Both variables are uint64_t, but they only count spins or sleeps. All reasonable values which we can get here comfortably hit in 32-bit range. == Implement trivial backoff for locking primitives. All current spinning loops retry an atomic op the first chance they get, which leads to performance degradation under load. One classic solution to the problem consists of delaying the test to an extent. This implementation has a trivial linear increment and a random factor for each attempt. For simplicity, this first thouch implementation only modifies spinning loops where the lock owner is running. spin mutexes and thread lock were not modified. Current parameters are autotuned on boot based on mp_cpus. Autotune factors are very conservative and are subject to change later. == locks: fix up ifdef guards introduced in r303643 Both sx and rwlocks had copy-pasted ADAPTIVE_MUTEXES instead of the correct define. == locks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case == locks: fix sx compilation on mips after r303643 The kernel.h header is required for the SYSINIT macro, which apparently was present on amd64 by accident. Modified: stable/10/sys/kern/kern_mutex.c stable/10/sys/kern/kern_rwlock.c stable/10/sys/kern/kern_sx.c stable/10/sys/kern/subr_lock.c stable/10/sys/sys/lock.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_mutex.c ============================================================================== --- stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:37:47 2016 (r310979) +++ stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:57:05 2016 (r310980) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -140,6 +141,37 @@ struct lock_class lock_class_mtx_spin = #endif }; +#ifdef ADAPTIVE_MUTEXES +static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging"); + +static struct lock_delay_config mtx_delay = { + .initial = 1000, + .step = 500, + .min = 100, + .max = 5000, +}; + +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_initial, CTLFLAG_RW, &mtx_delay.initial, + 0, ""); +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_step, CTLFLAG_RW, &mtx_delay.step, + 0, ""); +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_min, CTLFLAG_RW, &mtx_delay.min, + 0, ""); +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW, &mtx_delay.max, + 0, ""); + +static void +mtx_delay_sysinit(void *dummy) +{ + + mtx_delay.initial = mp_ncpus * 25; + mtx_delay.step = (mp_ncpus * 25) / 2; + mtx_delay.min = mp_ncpus * 5; + mtx_delay.max = mp_ncpus * 25 * 10; +} +LOCK_DELAY_SYSINIT(mtx_delay_sysinit); +#endif + /* * System-wide mutexes */ @@ -412,9 +444,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, int contested = 0; uint64_t waittime = 0; #endif +#if defined(ADAPTIVE_MUTEXES) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS - uint64_t spin_cnt = 0; - uint64_t sleep_cnt = 0; + u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif @@ -422,6 +456,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, if (SCHEDULER_STOPPED()) return; +#if defined(ADAPTIVE_MUTEXES) + lock_delay_arg_init(&lda, &mtx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); +#endif m = mtxlock2mtx(c); if (mtx_owned(m)) { @@ -455,7 +494,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) break; #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif #ifdef ADAPTIVE_MUTEXES /* @@ -475,12 +514,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, "spinning", "lockname:\"%s\"", m->lock_object.lo_name); while (mtx_owner(m) == owner && - TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname((struct thread *)tid), "running"); @@ -574,7 +609,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, /* * Only record the loops spinning and not sleeping. */ - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD1(LS_MTX_LOCK_SPIN, m, (all_time - sleep_time)); #endif } Modified: stable/10/sys/kern/kern_rwlock.c ============================================================================== --- stable/10/sys/kern/kern_rwlock.c Sat Dec 31 16:37:47 2016 (r310979) +++ stable/10/sys/kern/kern_rwlock.c Sat Dec 31 16:57:05 2016 (r310980) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -66,15 +67,6 @@ PMC_SOFT_DECLARE( , , lock, failed); */ #define rwlock2rw(c) (__containerof(c, struct rwlock, rw_lock)) -#ifdef ADAPTIVE_RWLOCKS -static int rowner_retries = 10; -static int rowner_loops = 10000; -static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, - "rwlock debugging"); -SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); -SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); -#endif - #ifdef DDB #include @@ -101,6 +93,42 @@ struct lock_class lock_class_rw = { #endif }; +#ifdef ADAPTIVE_RWLOCKS +static int rowner_retries = 10; +static int rowner_loops = 10000; +static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, + "rwlock debugging"); +SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); + +static struct lock_delay_config rw_delay = { + .initial = 1000, + .step = 500, + .min = 100, + .max = 5000, +}; + +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_initial, CTLFLAG_RW, &rw_delay.initial, + 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_step, CTLFLAG_RW, &rw_delay.step, + 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_min, CTLFLAG_RW, &rw_delay.min, + 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_max, CTLFLAG_RW, &rw_delay.max, + 0, ""); + +static void +rw_delay_sysinit(void *dummy) +{ + + rw_delay.initial = mp_ncpus * 25; + rw_delay.step = (mp_ncpus * 25) / 2; + rw_delay.min = mp_ncpus * 5; + rw_delay.max = mp_ncpus * 25 * 10; +} +LOCK_DELAY_SYSINIT(rw_delay_sysinit); +#endif + /* * Return a pointer to the owning thread if the lock is write-locked or * NULL if the lock is unlocked or read-locked. @@ -355,10 +383,12 @@ __rw_rlock(volatile uintptr_t *c, const int contested = 0; #endif uintptr_t v; +#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - uint64_t spin_cnt = 0; - uint64_t sleep_cnt = 0; + u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif @@ -366,6 +396,11 @@ __rw_rlock(volatile uintptr_t *c, const if (SCHEDULER_STOPPED()) return; +#if defined(ADAPTIVE_RWLOCKS) + lock_delay_arg_init(&lda, &rw_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); +#endif rw = rwlock2rw(c); KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), @@ -383,9 +418,6 @@ __rw_rlock(volatile uintptr_t *c, const state = rw->rw_lock; #endif for (;;) { -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif /* * Handle the easy case. If no other thread has a write * lock, then try to bump up the count of read locks. Note @@ -414,6 +446,9 @@ __rw_rlock(volatile uintptr_t *c, const } continue; } +#ifdef KDTRACE_HOOKS + lda.spin_cnt++; +#endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -437,12 +472,8 @@ __rw_rlock(volatile uintptr_t *c, const sched_tdname(curthread), "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); while ((struct thread*)RW_OWNER(rw->rw_lock) == - owner && TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + owner && TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -458,6 +489,9 @@ __rw_rlock(volatile uintptr_t *c, const break; cpu_spinwait(); } +#ifdef KDTRACE_HOOKS + lda.spin_cnt += rowner_loops - i; +#endif KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); if (i != rowner_loops) @@ -549,7 +583,7 @@ __rw_rlock(volatile uintptr_t *c, const (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); /* Record only the loops spinning and not sleeping. */ - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(LS_RW_RLOCK_SPIN, rw, all_time - sleep_time, LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); @@ -737,10 +771,12 @@ __rw_wlock_hard(volatile uintptr_t *c, u uint64_t waittime = 0; int contested = 0; #endif +#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - uint64_t spin_cnt = 0; - uint64_t sleep_cnt = 0; + u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif @@ -748,6 +784,11 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (SCHEDULER_STOPPED()) return; +#if defined(ADAPTIVE_RWLOCKS) + lock_delay_arg_init(&lda, &rw_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); +#endif rw = rwlock2rw(c); if (rw_wlocked(rw)) { @@ -772,7 +813,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (rw->rw_lock == RW_UNLOCKED && _rw_write_lock(rw, tid)) break; #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -795,12 +836,8 @@ __rw_wlock_hard(volatile uintptr_t *c, u "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); while ((struct thread*)RW_OWNER(rw->rw_lock) == owner && - TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -825,7 +862,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); #ifdef KDTRACE_HOOKS - spin_cnt += rowner_loops - i; + lda.spin_cnt += rowner_loops - i; #endif if (i != rowner_loops) continue; @@ -915,9 +952,9 @@ __rw_wlock_hard(volatile uintptr_t *c, u (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); /* Record only the loops spinning and not sleeping. */ - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(LS_RW_WLOCK_SPIN, rw, all_time - sleep_time, - LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, + LOCKSTAT_WRITER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); #endif LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE, rw, contested, Modified: stable/10/sys/kern/kern_sx.c ============================================================================== --- stable/10/sys/kern/kern_sx.c Sat Dec 31 16:37:47 2016 (r310979) +++ stable/10/sys/kern/kern_sx.c Sat Dec 31 16:57:05 2016 (r310980) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #if defined(SMP) && !defined(NO_ADAPTIVE_SX) @@ -147,6 +149,33 @@ static u_int asx_loops = 10000; static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging"); SYSCTL_UINT(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, ""); SYSCTL_UINT(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, ""); + +static struct lock_delay_config sx_delay = { + .initial = 1000, + .step = 500, + .min = 100, + .max = 5000, +}; + +SYSCTL_INT(_debug_sx, OID_AUTO, delay_initial, CTLFLAG_RW, &sx_delay.initial, + 0, ""); +SYSCTL_INT(_debug_sx, OID_AUTO, delay_step, CTLFLAG_RW, &sx_delay.step, + 0, ""); +SYSCTL_INT(_debug_sx, OID_AUTO, delay_min, CTLFLAG_RW, &sx_delay.min, + 0, ""); +SYSCTL_INT(_debug_sx, OID_AUTO, delay_max, CTLFLAG_RW, &sx_delay.max, + 0, ""); + +static void +sx_delay_sysinit(void *dummy) +{ + + sx_delay.initial = mp_ncpus * 25; + sx_delay.step = (mp_ncpus * 25) / 2; + sx_delay.min = mp_ncpus * 5; + sx_delay.max = mp_ncpus * 25 * 10; +} +LOCK_DELAY_SYSINIT(sx_delay_sysinit); #endif void @@ -516,10 +545,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t int contested = 0; #endif int error = 0; +#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - uint64_t spin_cnt = 0; - uint64_t sleep_cnt = 0; + u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif @@ -527,6 +558,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t if (SCHEDULER_STOPPED()) return (0); +#if defined(ADAPTIVE_SX) + lock_delay_arg_init(&lda, &sx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); +#endif + /* If we already hold an exclusive lock, then recurse. */ if (sx_xlocked(sx)) { KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0, @@ -552,7 +589,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) break; #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -581,12 +618,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t sx->lock_object.lo_name); GIANT_SAVE(); while (SX_OWNER(sx->sx_lock) == x && - TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -608,7 +641,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t break; cpu_spinwait(); #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif } KTR_STATE0(KTR_SCHED, "thread", @@ -728,7 +761,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t LOCKSTAT_RECORD4(LS_SX_XLOCK_BLOCK, sx, sleep_time, LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(LS_SX_XLOCK_SPIN, sx, all_time - sleep_time, LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); @@ -821,10 +854,12 @@ _sx_slock_hard(struct sx *sx, int opts, #endif uintptr_t x; int error = 0; +#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - uint64_t spin_cnt = 0; - uint64_t sleep_cnt = 0; + u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif @@ -832,6 +867,11 @@ _sx_slock_hard(struct sx *sx, int opts, if (SCHEDULER_STOPPED()) return (0); +#if defined(ADAPTIVE_SX) + lock_delay_arg_init(&lda, &sx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); +#endif #ifdef KDTRACE_HOOKS state = sx->sx_lock; all_time -= lockstat_nsecs(&sx->lock_object); @@ -843,7 +883,7 @@ _sx_slock_hard(struct sx *sx, int opts, */ for (;;) { #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif x = sx->sx_lock; @@ -891,12 +931,8 @@ _sx_slock_hard(struct sx *sx, int opts, "lockname:\"%s\"", sx->lock_object.lo_name); GIANT_SAVE(); while (SX_OWNER(sx->sx_lock) == x && - TD_IS_RUNNING(owner)) { -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - cpu_spinwait(); - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -992,7 +1028,7 @@ _sx_slock_hard(struct sx *sx, int opts, LOCKSTAT_RECORD4(LS_SX_SLOCK_BLOCK, sx, sleep_time, LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(LS_SX_SLOCK_SPIN, sx, all_time - sleep_time, LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); Modified: stable/10/sys/kern/subr_lock.c ============================================================================== --- stable/10/sys/kern/subr_lock.c Sat Dec 31 16:37:47 2016 (r310979) +++ stable/10/sys/kern/subr_lock.c Sat Dec 31 16:57:05 2016 (r310980) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include CTASSERT(LOCK_CLASS_MAX == 15); @@ -103,6 +104,34 @@ lock_destroy(struct lock_object *lock) lock->lo_flags &= ~LO_INITIALIZED; } +void +lock_delay(struct lock_delay_arg *la) +{ + u_int i, delay, backoff, min, max; + struct lock_delay_config *lc = la->config; + + delay = la->delay; + + if (delay == 0) + delay = lc->initial; + else { + delay += lc->step; + max = lc->max; + if (delay > max) + delay = max; + } + + backoff = cpu_ticks() % delay; + min = lc->min; + if (backoff < min) + backoff = min; + for (i = 0; i < backoff; i++) + cpu_spinwait(); + + la->delay = delay; + la->spin_cnt += backoff; +} + #ifdef DDB DB_SHOW_COMMAND(lock, db_show_lock) { Modified: stable/10/sys/sys/lock.h ============================================================================== --- stable/10/sys/sys/lock.h Sat Dec 31 16:37:47 2016 (r310979) +++ stable/10/sys/sys/lock.h Sat Dec 31 16:57:05 2016 (r310980) @@ -199,9 +199,33 @@ extern struct lock_class lock_class_lock extern struct lock_class *lock_classes[]; +struct lock_delay_config { + u_int initial; + u_int step; + u_int min; + u_int max; +}; + +struct lock_delay_arg { + struct lock_delay_config *config; + u_int delay; + u_int spin_cnt; +}; + +static inline void +lock_delay_arg_init(struct lock_delay_arg *la, struct lock_delay_config *lc) { + la->config = lc; + la->delay = 0; + la->spin_cnt = 0; +} + +#define LOCK_DELAY_SYSINIT(func) \ + SYSINIT(func##_ld, SI_SUB_LOCK, SI_ORDER_ANY, func, NULL) + void lock_init(struct lock_object *, struct lock_class *, const char *, const char *, int); void lock_destroy(struct lock_object *); +void lock_delay(struct lock_delay_arg *); void spinlock_enter(void); void spinlock_exit(void); void witness_init(struct lock_object *, const char *); From owner-svn-src-all@freebsd.org Sat Dec 31 17:05:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAEE3C997F8; Sat, 31 Dec 2016 17:05:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A479156B; Sat, 31 Dec 2016 17:05:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVH59Rh093721; Sat, 31 Dec 2016 17:05:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVH59Nh093720; Sat, 31 Dec 2016 17:05:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612311705.uBVH59Nh093720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 31 Dec 2016 17:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310981 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 17:05:10 -0000 Author: jhb Date: Sat Dec 31 17:05:09 2016 New Revision: 310981 URL: https://svnweb.freebsd.org/changeset/base/310981 Log: MFC 310336: Don't spin in pause() during early boot for kthreads other than thread0. pause() uses a spin loop to simulate a sleep during early boot. However, we only need this for thread0 to get far enough in the boot process to enable timers (at which point pause() can sleep). For other kthreads, sleeping in pause() is ok as the callout will be scheduled and will eventually fire once thread0 initializes timers. Modified: stable/11/sys/kern/kern_synch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_synch.c ============================================================================== --- stable/11/sys/kern/kern_synch.c Sat Dec 31 16:57:05 2016 (r310980) +++ stable/11/sys/kern/kern_synch.c Sat Dec 31 17:05:09 2016 (r310981) @@ -321,7 +321,8 @@ pause_sbt(const char *wmesg, sbintime_t if (sbt == 0) sbt = tick_sbt; - if (cold || kdb_active || SCHEDULER_STOPPED()) { + if ((cold && curthread == &thread0) || kdb_active || + SCHEDULER_STOPPED()) { /* * We delay one second at a time to avoid overflowing the * system specific DELAY() function(s): From owner-svn-src-all@freebsd.org Sat Dec 31 19:30:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA5DC990CC; Sat, 31 Dec 2016 19:30:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5727E17B3; Sat, 31 Dec 2016 19:30:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVJUMml053330; Sat, 31 Dec 2016 19:30:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVJUM9g053329; Sat, 31 Dec 2016 19:30:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612311930.uBVJUM9g053329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 31 Dec 2016 19:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310982 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 19:30:23 -0000 Author: kib Date: Sat Dec 31 19:30:22 2016 New Revision: 310982 URL: https://svnweb.freebsd.org/changeset/base/310982 Log: Ansify vm/vm_pager.c. Style. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_pager.c Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Sat Dec 31 17:05:09 2016 (r310981) +++ head/sys/vm/vm_pager.c Sat Dec 31 19:30:22 2016 (r310982) @@ -109,43 +109,35 @@ static vm_object_t dead_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t off, struct ucred *cred) { - return NULL; + + return (NULL); } static void -dead_pager_putpages(object, m, count, flags, rtvals) - vm_object_t object; - vm_page_t *m; - int count; - int flags; - int *rtvals; +dead_pager_putpages(vm_object_t object, vm_page_t *m, int count, + int flags, int *rtvals) { int i; - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) rtvals[i] = VM_PAGER_AGAIN; - } } static int -dead_pager_haspage(object, pindex, prev, next) - vm_object_t object; - vm_pindex_t pindex; - int *prev; - int *next; +dead_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *prev, int *next) { - if (prev) + + if (prev != NULL) *prev = 0; - if (next) + if (next != NULL) *next = 0; - return FALSE; + return (FALSE); } static void -dead_pager_dealloc(object) - vm_object_t object; +dead_pager_dealloc(vm_object_t object) { - return; + } static struct pagerops deadpagerops = { @@ -181,7 +173,7 @@ static int bswneeded; vm_offset_t swapbkva; /* swap buffers kva */ void -vm_pager_init() +vm_pager_init(void) { struct pagerops **pgops; @@ -191,11 +183,11 @@ vm_pager_init() */ for (pgops = pagertab; pgops < &pagertab[nitems(pagertab)]; pgops++) if ((*pgops)->pgo_init != NULL) - (*(*pgops)->pgo_init) (); + (*(*pgops)->pgo_init)(); } void -vm_pager_bufferinit() +vm_pager_bufferinit(void) { struct buf *bp; int i; @@ -232,7 +224,7 @@ vm_pager_allocate(objtype_t type, void * ops = pagertab[type]; if (ops) - ret = (*ops->pgo_alloc) (handle, size, prot, off, cred); + ret = (*ops->pgo_alloc)(handle, size, prot, off, cred); else ret = NULL; return (ret); @@ -242,8 +234,7 @@ vm_pager_allocate(objtype_t type, void * * The object must be locked. */ void -vm_pager_deallocate(object) - vm_object_t object; +vm_pager_deallocate(vm_object_t object) { VM_OBJECT_ASSERT_WLOCKED(object); @@ -366,12 +357,13 @@ vm_pager_object_lookup(struct pagerlst * static void initpbuf(struct buf *bp) { + KASSERT(bp->b_bufobj == NULL, ("initpbuf with bufobj")); KASSERT(bp->b_vp == NULL, ("initpbuf with vp")); bp->b_rcred = NOCRED; bp->b_wcred = NOCRED; bp->b_qindex = 0; /* On no queue (QUEUE_NONE) */ - bp->b_kvabase = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva; + bp->b_kvabase = (caddr_t)(MAXPHYS * (bp - swbuf)) + swapbkva; bp->b_data = bp->b_kvabase; bp->b_kvasize = MAXPHYS; bp->b_flags = 0; @@ -404,9 +396,8 @@ getpbuf(int *pfreecnt) struct buf *bp; mtx_lock(&pbuf_mtx); - for (;;) { - if (pfreecnt) { + if (pfreecnt != NULL) { while (*pfreecnt == 0) { msleep(pfreecnt, &pbuf_mtx, PVM, "wswbuf0", 0); } @@ -424,9 +415,8 @@ getpbuf(int *pfreecnt) if (pfreecnt) --*pfreecnt; mtx_unlock(&pbuf_mtx); - initpbuf(bp); - return bp; + return (bp); } /* @@ -446,14 +436,10 @@ trypbuf(int *pfreecnt) return NULL; } TAILQ_REMOVE(&bswlist, bp, b_freelist); - --*pfreecnt; - mtx_unlock(&pbuf_mtx); - initpbuf(bp); - - return bp; + return (bp); } /* From owner-svn-src-all@freebsd.org Sat Dec 31 19:59:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1176BC99819; Sat, 31 Dec 2016 19:59:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E049F1757; Sat, 31 Dec 2016 19:59:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVJxW6e066431; Sat, 31 Dec 2016 19:59:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVJxW5Z066430; Sat, 31 Dec 2016 19:59:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612311959.uBVJxW5Z066430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Dec 2016 19:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310983 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 19:59:33 -0000 Author: mjg Date: Sat Dec 31 19:59:31 2016 New Revision: 310983 URL: https://svnweb.freebsd.org/changeset/base/310983 Log: vfs: switch nodes_created, recycles_count and free_owe_inact to counter(9) Reviewed by: kib Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Dec 31 19:30:22 2016 (r310982) +++ head/sys/kern/vfs_subr.c Sat Dec 31 19:59:31 2016 (r310983) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -124,9 +125,9 @@ static unsigned long numvnodes; SYSCTL_ULONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, "Number of vnodes in existence"); -static u_long vnodes_created; -SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created, - 0, "Number of vnodes created by getnewvnode"); +static counter_u64_t vnodes_created; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created, + "Number of vnodes created by getnewvnode"); static u_long mnt_free_list_batch = 128; SYSCTL_ULONG(_vfs, OID_AUTO, mnt_free_list_batch, CTLFLAG_RW, @@ -180,8 +181,8 @@ static u_long freevnodes; SYSCTL_ULONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0, "Number of \"free\" vnodes"); -static u_long recycles_count; -SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0, +static counter_u64_t recycles_count; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, "Number of vnodes recycled to meet vnode cache targets"); /* @@ -193,8 +194,8 @@ static int reassignbufcalls; SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW, &reassignbufcalls, 0, "Number of calls to reassignbuf"); -static u_long free_owe_inact; -SYSCTL_ULONG(_vfs, OID_AUTO, free_owe_inact, CTLFLAG_RD, &free_owe_inact, 0, +static counter_u64_t free_owe_inact; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, free_owe_inact, CTLFLAG_RD, &free_owe_inact, "Number of times free vnodes kept on active list due to VFS " "owing inactivation"); @@ -476,6 +477,11 @@ vntblinit(void *dummy __unused) NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); uma_prealloc(buf_trie_zone, nbuf); + + vnodes_created = counter_u64_alloc(M_WAITOK); + recycles_count = counter_u64_alloc(M_WAITOK); + free_owe_inact = counter_u64_alloc(M_WAITOK); + /* * Initialize the filesystem syncer. */ @@ -922,7 +928,7 @@ vlrureclaim(struct mount *mp, int reclai } KASSERT((vp->v_iflag & VI_DOOMED) == 0, ("VI_DOOMED unexpectedly detected in vlrureclaim()")); - atomic_add_long(&recycles_count, 1); + counter_u64_add(recycles_count, 1); vgonel(vp); VOP_UNLOCK(vp, 0); vdropl(vp); @@ -1287,7 +1293,7 @@ vtryrecycle(struct vnode *vp) return (EBUSY); } if ((vp->v_iflag & VI_DOOMED) == 0) { - atomic_add_long(&recycles_count, 1); + counter_u64_add(recycles_count, 1); vgonel(vp); } VOP_UNLOCK(vp, LK_INTERLOCK); @@ -1446,7 +1452,7 @@ getnewvnode(const char *tag, struct moun atomic_add_long(&numvnodes, 1); mtx_unlock(&vnode_free_list_mtx); alloc: - atomic_add_long(&vnodes_created, 1); + counter_u64_add(vnodes_created, 1); vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK); /* * Locks are given the generic name "vnode" when created. @@ -2938,7 +2944,7 @@ _vdrop(struct vnode *vp, bool locked) mtx_unlock(&mp->mnt_listmtx); } else { VI_UNLOCK(vp); - atomic_add_long(&free_owe_inact, 1); + counter_u64_add(free_owe_inact, 1); } return; } From owner-svn-src-all@freebsd.org Sat Dec 31 21:00:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D9A4C99F63; Sat, 31 Dec 2016 21:00:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7AF71BBE; Sat, 31 Dec 2016 21:00:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVL09ea092356; Sat, 31 Dec 2016 21:00:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVL09RR092355; Sat, 31 Dec 2016 21:00:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612312100.uBVL09RR092355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 21:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310984 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 21:00:10 -0000 Author: ngie Date: Sat Dec 31 21:00:08 2016 New Revision: 310984 URL: https://svnweb.freebsd.org/changeset/base/310984 Log: Use calloc instead of malloc + memset(.., 0, ..) MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sat Dec 31 19:59:31 2016 (r310983) +++ head/lib/libc/net/getaddrinfo.c Sat Dec 31 21:00:08 2016 (r310984) @@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel) return(n); /* allocate a temporary array for sort and initialization of it. */ - if ((aio = malloc(sizeof(*aio) * n)) == NULL) + if ((aio = calloc(1, sizeof(*aio) * n)) == NULL) return(n); /* give up reordering */ - memset(aio, 0, sizeof(*aio) * n); /* retrieve address selection policy from the kernel */ TAILQ_INIT(&policyhead); @@ -1449,9 +1448,8 @@ copy_ai(const struct addrinfo *pai) size_t l; l = sizeof(*ai) + pai->ai_addrlen; - if ((ai = (struct addrinfo *)malloc(l)) == NULL) + if ((ai = calloc(1, l)) == NULL) return NULL; - memset(ai, 0, l); memcpy(ai, pai, sizeof(*ai)); ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); @@ -1874,8 +1872,7 @@ addrinfo_unmarshal_func(char *buffer, si size = new_ai.ai_addrlen + sizeof(struct addrinfo) + _ALIGNBYTES; - sentinel = (struct addrinfo *)malloc(size); - memset(sentinel, 0, size); + sentinel = calloc(1, size); memcpy(sentinel, &new_ai, sizeof(struct addrinfo)); sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel + @@ -1888,8 +1885,7 @@ addrinfo_unmarshal_func(char *buffer, si memcpy(&size, p, sizeof(size_t)); p += sizeof(size_t); - sentinel->ai_canonname = (char *)malloc(size + 1); - memset(sentinel->ai_canonname, 0, size + 1); + sentinel->ai_canonname = calloc(1, size + 1); memcpy(sentinel->ai_canonname, p, size); p += size; From owner-svn-src-all@freebsd.org Sat Dec 31 21:32:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 426A6C98B85; Sat, 31 Dec 2016 21:32:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0474A1FFD; Sat, 31 Dec 2016 21:31:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVLVx1h006464; Sat, 31 Dec 2016 21:31:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVLVxm1006463; Sat, 31 Dec 2016 21:31:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201612312131.uBVLVxm1006463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 31 Dec 2016 21:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310985 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 21:32:00 -0000 Author: asomers Date: Sat Dec 31 21:31:58 2016 New Revision: 310985 URL: https://svnweb.freebsd.org/changeset/base/310985 Log: Update ObsoleteFiles.inc for r310803 MFC after: 26 days X-MFC-with: 310803 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Dec 31 21:00:08 2016 (r310984) +++ head/ObsoleteFiles.inc Sat Dec 31 21:31:58 2016 (r310985) @@ -40,6 +40,10 @@ # 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu +# 20161229: Three files from gnop tests consolidated into one +OLD_FILES+=usr/tests/sys/geom/class/nop/1_test.sh +OLD_FILES+=usr/tests/sys/geom/class/nop/2_test.sh +OLD_FILES+=usr/tests/sys/geom/class/nop/conf.sh # 20161217: new clang import which bumps version from 3.9.0 to 3.9.1. OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/asan_interface.h From owner-svn-src-all@freebsd.org Sat Dec 31 21:53:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E2CAC991D8 for ; Sat, 31 Dec 2016 21:53:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm18-vm4.bullet.mail.ne1.yahoo.com (nm18-vm4.bullet.mail.ne1.yahoo.com [98.138.91.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA991A58 for ; Sat, 31 Dec 2016 21:53:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1483220854; bh=qXwSUOenAlZFXP6FC3OdnBIxW7YqJun8RvJxGNR+sVw=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=Vku45nlNjTK7NRJE+d483mQMPHekd/4ECpA/V9qdswWTH16Jd04AjLlsRUPZWOJDQUNotD3654qKJyto1dfB1w7T3tbsUqG2hjLsn+OnY9K9g+uBziQVFq3zKwO6Tf3zkTrfh5frjbeQBf/3huWr4EFtasIfVcXRxpglWFhBqZTeRIwxE1QIx0CHPPkeRXetUyN1XqMsAuxECovNkfi3fFiL4rovnE6KLv3lo60/N+4YF44pNoK5TTO8saAyCi0G7nxBOrdraYU0zF5eDUMYo4G69XuUz8EoRJ/x+ehYCq32E9ZpyVH06uvukVi91ZtCJwAl9iMEEWn+B9amGEjFJQ== Received: from [98.138.101.132] by nm18.bullet.mail.ne1.yahoo.com with NNFMP; 31 Dec 2016 21:47:34 -0000 Received: from [98.138.226.60] by tm20.bullet.mail.ne1.yahoo.com with NNFMP; 31 Dec 2016 21:47:34 -0000 Received: from [127.0.0.1] by smtp211.mail.ne1.yahoo.com with NNFMP; 31 Dec 2016 21:47:34 -0000 X-Yahoo-Newman-Id: 781880.51902.bm@smtp211.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: V5qqPpgVM1ldGjN9zesSHKC.eeFKehDvS9kI7EwbId5jnpN 8BwfBGxdJ3gcTmeTGjtI9ennozgGvmhZrKKvxq52kG7kmFhhHN5UJHd_bUCN mB69gmB6wXFnKz82ZrangKWHiCyz1fM93N8PplGn2h2OwaWhQY.R9nozKtOi r41h3MVT9enrpe.TW0gZWV5Yj0rtk2V6Ni37qI7GlToAdtBcztuZLzjih27G _N2LHcrCg2Ud4OljWWiMCPbfgyOyRBg78k3FVSLDocWa0Nax12REMd_YXXay h7BV7cXFl13oo.AXw7B4_x4LwBmONChWJ0fV1TvO0fytyvh.Ts5tpOxE_dgv xr5ueoJEfmAwZUtOsUN0DYXt4GxxsANvE0b6PVZ5995Hg_MyzSahvtKBW9FD fnruSge_d6HjIUlQkJ4yHCx4EbOLu8bcx_vsTAPtSSkk3_xQXTuaVDkPOOCH Fm6bD1b1XidP3sNwInNnlLPMyAzUP3XVAaFpMfYvTMI1a6f7Lkg5RoXuk38S xKnGoQ1WgRSx7MLgNE2wTPruJDPSYfN50XzsercibajE5Fgc- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r310984 - head/lib/libc/net To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201612312100.uBVL09RR092355@repo.freebsd.org> From: Pedro Giffuni Message-ID: <7914bb49-6bef-6bbd-5574-ceb29f318c01@FreeBSD.org> Date: Sat, 31 Dec 2016 16:49:10 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <201612312100.uBVL09RR092355@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 21:53:28 -0000 On 12/31/16 16:00, Ngie Cooper wrote: > Author: ngie > Date: Sat Dec 31 21:00:08 2016 > New Revision: 310984 > URL: https://svnweb.freebsd.org/changeset/base/310984 > > Log: > Use calloc instead of malloc + memset(.., 0, ..) > > MFC after: 1 week > > Modified: > head/lib/libc/net/getaddrinfo.c > > Modified: head/lib/libc/net/getaddrinfo.c > ============================================================================== > --- head/lib/libc/net/getaddrinfo.c Sat Dec 31 19:59:31 2016 (r310983) > +++ head/lib/libc/net/getaddrinfo.c Sat Dec 31 21:00:08 2016 (r310984) > @@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel) > return(n); > > /* allocate a temporary array for sort and initialization of it. */ > - if ((aio = malloc(sizeof(*aio) * n)) == NULL) > + if ((aio = calloc(1, sizeof(*aio) * n)) == NULL) > return(n); /* give up reordering */ This should be calloc(n, sizeof(*aio))) FWIW, the other cases are not very useful. Generally, replacing any malloc(x) with a calloc(1, x) doesn't bring any advantage as it won't catch any overflow. Pedro. From owner-svn-src-all@freebsd.org Sat Dec 31 21:55:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE466C99275; Sat, 31 Dec 2016 21:55:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B2B91BF2; Sat, 31 Dec 2016 21:55:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id b1so26068446pgc.1; Sat, 31 Dec 2016 13:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=wsWAGr4eBsz7wc2bE2N2dknFL63WapGdi5S6yr9O+o0=; b=S5nPI5uyH3NsscTvdsPjO0TP2s7t7KZqqKmKpwFeXOYWdhINPSedWDZK6rNKPMiZqM zXAly3JW6w1G+rFUuGTWD8hsK7P2V+t7I1zoYcYb1M43xdVf0jTBS+56BLldEo+WG0dM 77sQzZEmUhpKmO/PYIYOB/u61wmD1jL/ZDc2WkkufyKyV5Uyypcf50EaCCqTfJo79KW+ 0YcA5s1nltjLe0molgKHitwTOBZQEgUQJtbnzl+ZrnD2bBwTyTTpf80OescoziByxcoa jStpJ+QtIP75aPWrIXdRuPWVTv91NUJWgkaM8nVl5E6HEJLGUC5NuC8Yx+ws2XIEV256 Q72g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=wsWAGr4eBsz7wc2bE2N2dknFL63WapGdi5S6yr9O+o0=; b=PLxFLX+DSpj96efZfLTr8KjkJZZXctIYwmk+s6mEPetio1oVh6jRX8VV2Ol6L+ABDw DmHcsAtAO2v+5RlODCNCb46CVPBNtsV43wxXv2ObRY1U0PgcRMFr3xb42apP0a9aDlM/ RS785b7woLEoNYPaQywGxnlMcd8E7KTmKUSlXrNJ2bwKCU/G5HktygPu/xsr9f/vC/mv 1R+mX0n+cc2tiwo9MJZMIyvjTrrGHpZbqlEl/JzIbeMRMcSPISx/jaJNjGXojKGr/BeF a3a5GkodUVLQJXAZAcyuiDqI1WK0y3FJj/62z4dQk6KlGzyaTlcaaC/3kL6kOYNR4P2n LRtg== X-Gm-Message-State: AIkVDXKDw8AlUsYmn+O4FpVcIUtNNgs6h+lzJs2LqVjyhI+n7K8Dw4vIDcx6Kc/gKtv/XQ== X-Received: by 10.98.36.134 with SMTP id k6mr40691007pfk.3.1483221319507; Sat, 31 Dec 2016 13:55:19 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 65sm121744263pfn.12.2016.12.31.13.55.18 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 31 Dec 2016 13:55:18 -0800 (PST) Subject: Re: svn commit: r310984 - head/lib/libc/net Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_867E2280-4CAE-477F-8AD1-C825FC4B1A12"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <7914bb49-6bef-6bbd-5574-ceb29f318c01@FreeBSD.org> Date: Sat, 31 Dec 2016 13:55:18 -0800 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <371A5B4E-0766-49F4-9115-13598B3E74FF@gmail.com> References: <201612312100.uBVL09RR092355@repo.freebsd.org> <7914bb49-6bef-6bbd-5574-ceb29f318c01@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 21:55:20 -0000 --Apple-Mail=_867E2280-4CAE-477F-8AD1-C825FC4B1A12 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 31, 2016, at 13:49, Pedro Giffuni wrote: >=20 >=20 >=20 > On 12/31/16 16:00, Ngie Cooper wrote: >> Author: ngie >> Date: Sat Dec 31 21:00:08 2016 >> New Revision: 310984 >> URL: https://svnweb.freebsd.org/changeset/base/310984 >>=20 >> Log: >> Use calloc instead of malloc + memset(.., 0, ..) >>=20 >> MFC after: 1 week >>=20 >> Modified: >> head/lib/libc/net/getaddrinfo.c >>=20 >> Modified: head/lib/libc/net/getaddrinfo.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libc/net/getaddrinfo.c Sat Dec 31 19:59:31 2016 = (r310983) >> +++ head/lib/libc/net/getaddrinfo.c Sat Dec 31 21:00:08 2016 = (r310984) >> @@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel) >> return(n); >>=20 >> /* allocate a temporary array for sort and initialization of it. = */ >> - if ((aio =3D malloc(sizeof(*aio) * n)) =3D=3D NULL) >> + if ((aio =3D calloc(1, sizeof(*aio) * n)) =3D=3D NULL) >> return(n); /* give up reordering */ >=20 > This should be calloc(n, sizeof(*aio))) >=20 > FWIW, the other cases are not very useful. > Generally, replacing any malloc(x) with a calloc(1, x) doesn't bring = any advantage as it won't catch any overflow. Yeah, that would have been better. The goal was to reduce complexity. I found some memory leaks with = valgrind with bsnmp* last night involving getaddrinfo that I=E2=80=99m = trying to chase down, and I noticed these while =E2=80=9Cin the = neighborhood=E2=80=9D. Thanks! -Ngie --Apple-Mail=_867E2280-4CAE-477F-8AD1-C825FC4B1A12 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYaClGAAoJEPWDqSZpMIYV1E8QAKvomvKcUWo7fD1sF5t4YU7N jX6jwiOgzgr9y1Ur34xETJTaHaFCjV5+xa5mQCdKQv4E2LPbwjUfH1qHH9P0DDFX KgP34vgYiahrBJcUwpeYhNPXhl+i2gLQ1Tnu2G8gbOzGnf0nWKTgoZ56c0ZAE3zW OEdn4AU9KBeeNliuEc8j54Z6HxGq8biqm6ymS6ZHHGBRjlIHdT5FFIXscIKQW1eD 3H6pX+8ZNfu+OkWQMJbT2lkMswJRBFYC8hYrqUqZbk8etaj9gABaZ2szIyNbTq+x LYtK3qEirXyfcHEYmlrzBuItI73J3hymyGyWRog3M7Pfw2jZ151ACmwtDWcbT4er tBoooYqHRSLB67GB2MI1tWXYDQUnBnuYgm4oKxwxyGo5zHp+UdLWGE9ChPx5LjwF /hQeUF43EpUnT21Pgq/qWuFNHyOd+TeOT0kgch/pvkUD8L5/Q0/jYpexDvcKmJQr ndxYov/KY4IVkmCwiih0POVd44VaPqTUlIal7POIGWgfR9HK/izSX3Lx+5GnY5Qr 7gepw4gxLROuDEK+r834XeNY8zcfV7eGie10P6enB0zfZ3Qh2a9YNSZZSfZZkNaZ KB0DUDqWtBnBaKRsI8tU6tuXNZTlpYP1AN/PklBzj6gCnyFlHAEU96tAY+KBdj4K 3C75vbRrfti5cHoIBoRi =IcFw -----END PGP SIGNATURE----- --Apple-Mail=_867E2280-4CAE-477F-8AD1-C825FC4B1A12-- From owner-svn-src-all@freebsd.org Sat Dec 31 22:18:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD4DCC99957; Sat, 31 Dec 2016 22:18:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81AF0171E; Sat, 31 Dec 2016 22:18:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVMIXtD024992; Sat, 31 Dec 2016 22:18:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVMIXQo024991; Sat, 31 Dec 2016 22:18:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612312218.uBVMIXQo024991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 22:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310986 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 22:18:34 -0000 Author: ngie Date: Sat Dec 31 22:18:33 2016 New Revision: 310986 URL: https://svnweb.freebsd.org/changeset/base/310986 Log: snmp_output_resp: style(9): sort variables by alignment MFC after: 3 days Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 21:31:58 2016 (r310985) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 22:18:33 2016 (r310986) @@ -2034,10 +2034,10 @@ int32_t snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu, struct asn_oid *root) { - int32_t error; + struct snmp_object object; char p[ASN_OIDSTRLEN]; + int32_t error; uint32_t i; - struct snmp_object object; i = error = 0; while (i < pdu->nbindings) { From owner-svn-src-all@freebsd.org Sat Dec 31 22:46:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62D40C9912D; Sat, 31 Dec 2016 22:46:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D588149A; Sat, 31 Dec 2016 22:46:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVMkH7a037026; Sat, 31 Dec 2016 22:46:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVMkHff037025; Sat, 31 Dec 2016 22:46:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612312246.uBVMkHff037025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 22:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310987 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 22:46:18 -0000 Author: ngie Date: Sat Dec 31 22:46:17 2016 New Revision: 310987 URL: https://svnweb.freebsd.org/changeset/base/310987 Log: snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not on the stack Some of the callers try to determine whether or not `object` is valid by testing the value for NULL, which will never be true if it's a stack value, so in order to be clear and correct down the call stack, use a heap allocated object. This also addresses a Coverity issue by initializing all of `object` via calloc MFC after: 1 week Reported by: Coverity CID: 1006392 Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 22:18:33 2016 (r310986) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat Dec 31 22:46:17 2016 (r310987) @@ -2003,20 +2003,25 @@ snmp_output_object(struct snmp_toolinfo void snmp_output_err_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu) { + struct snmp_object *object; char buf[ASN_OIDSTRLEN]; - struct snmp_object object; if (pdu == NULL || (pdu->error_index > (int32_t) pdu->nbindings)) { - fprintf(stdout,"Invalid error index in PDU\n"); + fprintf(stdout, "Invalid error index in PDU\n"); + return; + } + + if ((object = calloc(1, sizeof(struct snmp_object))) != NULL) { + fprintf(stdout, "calloc: %s", strerror(errno)); return; } fprintf(stdout, "Agent %s:%s returned error \n", snmp_client.chost, snmp_client.cport); - if (!ISSET_NUMERIC(snmptoolctx) && (snmp_fill_object(snmptoolctx, &object, + if (!ISSET_NUMERIC(snmptoolctx) && (snmp_fill_object(snmptoolctx, object, &(pdu->bindings[pdu->error_index - 1])) > 0)) - snmp_output_object(snmptoolctx, &object); + snmp_output_object(snmptoolctx, object); else { asn_oid2str_r(&(pdu->bindings[pdu->error_index - 1].var), buf); fprintf(stdout,"%s", buf); @@ -2028,17 +2033,23 @@ snmp_output_err_resp(struct snmp_toolinf fprintf(stdout, "%s\n", error_strings[pdu->error_status].str); else fprintf(stdout,"%s\n", error_strings[SNMP_ERR_UNKNOWN].str); + + free(object); + object = NULL; } int32_t snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu, struct asn_oid *root) { - struct snmp_object object; + struct snmp_object *object; char p[ASN_OIDSTRLEN]; int32_t error; uint32_t i; + if ((object = calloc(1, sizeof(struct snmp_object))) == NULL) + return (-1); + i = error = 0; while (i < pdu->nbindings) { if (root != NULL && !(asn_is_suboid(root, @@ -2047,18 +2058,22 @@ snmp_output_resp(struct snmp_toolinfo *s if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) { if (!ISSET_NUMERIC(snmptoolctx) && - (snmp_fill_object(snmptoolctx, &object, + (snmp_fill_object(snmptoolctx, object, &(pdu->bindings[i])) > 0)) - snmp_output_object(snmptoolctx, &object); + snmp_output_object(snmptoolctx, object); else { asn_oid2str_r(&(pdu->bindings[i].var), p); fprintf(stdout, "%s", p); } } - error |= snmp_output_numval(snmptoolctx, &(pdu->bindings[i]), object.info); + error |= snmp_output_numval(snmptoolctx, &(pdu->bindings[i]), + object->info); i++; } + free(object); + object = NULL; + if (error) return (-1); From owner-svn-src-all@freebsd.org Sat Dec 31 23:20:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A882FC99B06; Sat, 31 Dec 2016 23:20:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 750441282; Sat, 31 Dec 2016 23:20:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVNKvZe049457; Sat, 31 Dec 2016 23:20:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVNKvTF049456; Sat, 31 Dec 2016 23:20:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612312320.uBVNKvTF049456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 23:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310988 - head/contrib/bsnmp/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 23:20:58 -0000 Author: ngie Date: Sat Dec 31 23:20:57 2016 New Revision: 310988 URL: https://svnweb.freebsd.org/changeset/base/310988 Log: snmp_discover_engine: fix up req/resp (PDU object) handling a bit - Call snmp_pdu_free on req and resp when done with the objects - Call snmp_pdu_free on req before calling snmp_pdu_create on it again MFC after: 1 week Modified: head/contrib/bsnmp/lib/snmpclient.c Modified: head/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 22:46:17 2016 (r310987) +++ head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 23:20:57 2016 (r310988) @@ -1793,12 +1793,14 @@ snmp_discover_engine(char *passwd) return (0); } + snmp_pdu_free(&req); + snmp_pdu_create(&req, SNMP_PDU_GET); req.engine.engine_boots = 0; req.engine.engine_time = 0; if (snmp_dialog(&req, &resp) == -1) - return (-1); + return (-1); if (resp.version != req.version) { seterr(&snmp_client, "wrong version"); @@ -1813,6 +1815,9 @@ snmp_discover_engine(char *passwd) snmp_client.engine.engine_boots = resp.engine.engine_boots; snmp_client.engine.engine_time = resp.engine.engine_time; + snmp_pdu_free(&req); + snmp_pdu_free(&resp); + return (0); }