svn commit: r267496 - head/sys/cam/ctl
Author: mav Date: Sun Jun 15 06:56:10 2014 New Revision: 267496 URL: http://svnweb.freebsd.org/changeset/base/267496 Log: Add vendor, product and revision options to control inquiry data. 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 Jun 15 05:17:40 2014(r267495) +++ head/sys/cam/ctl/ctl.c Sun Jun 15 06:56:10 2014(r267496) @@ -9634,6 +9634,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio struct scsi_inquiry *cdb; struct ctl_softc *ctl_softc; struct ctl_lun *lun; + char *val; uint32_t alloc_len; int is_fc; @@ -9778,10 +9779,16 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * We have 8 bytes for the vendor name, and 16 bytes for the device * name and 4 bytes for the revision. */ - strncpy(inq_ptr-vendor, CTL_VENDOR, sizeof(inq_ptr-vendor)); + if (lun == NULL || (val = ctl_get_opt(lun-be_lun, vendor)) == NULL) { + strcpy(inq_ptr-vendor, CTL_VENDOR); + } else { + memset(inq_ptr-vendor, ' ', sizeof(inq_ptr-vendor)); + strncpy(inq_ptr-vendor, val, + min(sizeof(inq_ptr-vendor), strlen(val))); + } if (lun == NULL) { strcpy(inq_ptr-product, CTL_DIRECT_PRODUCT); - } else { + } else if ((val = ctl_get_opt(lun-be_lun, product)) == NULL) { switch (lun-be_lun-lun_type) { case T_DIRECT: strcpy(inq_ptr-product, CTL_DIRECT_PRODUCT); @@ -9793,13 +9800,23 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio strcpy(inq_ptr-product, CTL_UNKNOWN_PRODUCT); break; } + } else { + memset(inq_ptr-product, ' ', sizeof(inq_ptr-product)); + strncpy(inq_ptr-product, val, + min(sizeof(inq_ptr-product), strlen(val))); } /* * XXX make this a macro somewhere so it automatically gets * incremented when we make changes. */ - strncpy(inq_ptr-revision, 0001, sizeof(inq_ptr-revision)); + if (lun == NULL || (val = ctl_get_opt(lun-be_lun, revision)) == NULL) { + strncpy(inq_ptr-revision, 0001, sizeof(inq_ptr-revision)); + } else { + memset(inq_ptr-revision, ' ', sizeof(inq_ptr-revision)); + strncpy(inq_ptr-revision, val, + min(sizeof(inq_ptr-revision), strlen(val))); + } /* * For parallel SCSI, we support double transition and single ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267497 - head/sys/vm
Author: alc Date: Sun Jun 15 07:52:59 2014 New Revision: 267497 URL: http://svnweb.freebsd.org/changeset/base/267497 Log: One of the intentions behind r267254 was that the global variable sgrowsiz would be read once and cached in a local variable so that the resource limit check and map entry insertion would be guaranteed to use the same value. However, the value being passed to vm_map_insert() is still from sgrowsiz and not the local variable. Correct this oversight. Reviewed by: kib Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c == --- head/sys/vm/vm_map.cSun Jun 15 06:56:10 2014(r267496) +++ head/sys/vm/vm_map.cSun Jun 15 07:52:59 2014(r267497) @@ -3388,7 +3388,7 @@ vm_map_stack(vm_map_t map, vm_offset_t a rv = KERN_NO_SPACE; goto out; } - rv = vm_map_stack_locked(map, addrbos, max_ssize, sgrowsiz, prot, + rv = vm_map_stack_locked(map, addrbos, max_ssize, growsize, prot, max, cow); out: vm_map_unlock(map); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267498 - head/sys/cam/ctl
Author: mav Date: Sun Jun 15 08:43:52 2014 New Revision: 267498 URL: http://svnweb.freebsd.org/changeset/base/267498 Log: Respect vendor option in all places. MFC after:2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sun Jun 15 07:52:59 2014(r267497) +++ head/sys/cam/ctl/ctl.c Sun Jun 15 08:43:52 2014(r267498) @@ -9303,6 +9303,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio struct ctl_softc *ctl_softc; struct ctl_lun *lun; struct ctl_frontend *fe; + char *val; #ifndef CTL_USE_BACKEND_SN char tmpstr[32]; #endif /* CTL_USE_BACKEND_SN */ @@ -9396,7 +9397,13 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio */ desc-id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; desc-length = sizeof(*t10id) + CTL_DEVID_LEN; - strncpy((char *)t10id-vendor, CTL_VENDOR, sizeof(t10id-vendor)); + if (lun == NULL || (val = ctl_get_opt(lun-be_lun, vendor)) == NULL) { + strncpy((char *)t10id-vendor, CTL_VENDOR, sizeof(t10id-vendor)); + } else { + memset(t10id-vendor, ' ', sizeof(t10id-vendor)); + strncpy(t10id-vendor, val, + min(sizeof(t10id-vendor), strlen(val))); + } /* * desc1 is for the WWPN which is a port asscociation. Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c == --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Jun 15 07:52:59 2014 (r267497) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Jun 15 08:43:52 2014 (r267498) @@ -2038,6 +2038,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, struct scsi_vpd_id_t10 *t10id; struct ctl_lun *lun; const struct icl_pdu *request; + char *val; size_t devid_len, wwpn_len; lun = (struct ctl_lun *)ctsio-io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -2102,7 +2103,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc-proto_codeset = (SCSI_PROTO_ISCSI 4) | SVPD_ID_CODESET_ASCII; desc-id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; desc-length = sizeof(*t10id) + CTL_DEVID_LEN; - strncpy((char *)t10id-vendor, CTL_VENDOR, sizeof(t10id-vendor)); + if (lun == NULL || (val = ctl_get_opt(lun-be_lun, vendor)) == NULL) { + strncpy((char *)t10id-vendor, CTL_VENDOR, sizeof(t10id-vendor)); + } else { + memset(t10id-vendor, ' ', sizeof(t10id-vendor)); + strncpy(t10id-vendor, val, + min(sizeof(t10id-vendor), strlen(val))); + } /* * If we've actually got a backend, copy the device id from the ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267499 - head/sys/cam/ctl
Author: mav Date: Sun Jun 15 09:37:06 2014 New Revision: 267499 URL: http://svnweb.freebsd.org/changeset/base/267499 Log: Remove custom processing for file option. Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c == --- head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 08:43:52 2014 (r267498) +++ head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 09:37:06 2014 (r267499) @@ -1821,12 +1821,10 @@ ctl_be_block_create(struct ctl_be_block_ { struct ctl_be_block_lun *be_lun; struct ctl_lun_create_params *params; - struct ctl_be_arg *file_arg; char num_thread_str[16]; char tmpstr[32]; char *value; int retval, num_threads, unmap; - int i; int tmp_num_threads; params = req-reqdata.create; @@ -1834,8 +1832,6 @@ ctl_be_block_create(struct ctl_be_block_ num_threads = cbb_num_threads; - file_arg = NULL; - be_lun = malloc(sizeof(*be_lun), M_CTLBLK, M_ZERO | M_WAITOK); be_lun-softc = softc; @@ -1861,24 +1857,13 @@ ctl_be_block_create(struct ctl_be_block_ be_lun-ctl_be_lun.lun_type = T_DIRECT; if (be_lun-ctl_be_lun.lun_type == T_DIRECT) { - for (i = 0; i req-num_be_args; i++) { - if (strcmp(req-kern_be_args[i].kname, file) == 0) { - file_arg = req-kern_be_args[i]; - break; - } - } - - if (file_arg == NULL) { + value = ctl_get_opt(be_lun-ctl_be_lun, file); + if (value == NULL) { snprintf(req-error_str, sizeof(req-error_str), %s: no file argument specified, __func__); goto bailout_error; } - - be_lun-dev_path = malloc(file_arg-vallen, M_CTLBLK, - M_WAITOK | M_ZERO); - - strlcpy(be_lun-dev_path, (char *)file_arg-kvalue, - file_arg-vallen); + be_lun-dev_path = strdup(value, M_CTLBLK); retval = ctl_be_block_open(softc, be_lun, req); if (retval != 0) { @@ -2516,25 +2501,6 @@ ctl_be_block_lun_info(void *be_lun, stru retval = sbuf_printf(sb, /num_threads); - /* -* For processor devices, we don't have a path variable. -*/ - if ((retval != 0) -|| (lun-dev_path == NULL)) - goto bailout; - - retval = sbuf_printf(sb, file); - - if (retval != 0) - goto bailout; - - retval = ctl_sbuf_printf_esc(sb, lun-dev_path); - - if (retval != 0) - goto bailout; - - retval = sbuf_printf(sb, /file\n); - bailout: return (retval); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267500 - head/sys/cam/ctl
Author: mav Date: Sun Jun 15 10:04:44 2014 New Revision: 267500 URL: http://svnweb.freebsd.org/changeset/base/267500 Log: Format Portal Group Tag same as istgt does -- %4.4x instead of %x. SPC-4 spec tells it should be two or more hexadecimal digits. RFC3720 tells it is 16-bit value. MFC after:2 weeks Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c == --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Jun 15 09:37:06 2014 (r267499) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Jun 15 10:04:44 2014 (r267500) @@ -2046,7 +2046,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, cs = PDU_SESSION(request); wwpn_len = strlen(cs-cs_target-ct_name); - wwpn_len += strlen(,t,0x01); + wwpn_len += strlen(,t,0x0001); wwpn_len += 1; /* '\0' */ if ((wwpn_len % 4) != 0) wwpn_len += (4 - (wwpn_len % 4)); @@ -2135,7 +2135,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc1-id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_SCSI_NAME; desc1-length = wwpn_len; - snprintf(desc1-identifier, wwpn_len, %s,t,0x%x, + snprintf(desc1-identifier, wwpn_len, %s,t,0x%4.4x, cs-cs_target-ct_name, cs-cs_portal_group_tag); /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267501 - head/usr.bin/ssh-copy-id
Author: joel (doc committer) Date: Sun Jun 15 10:18:57 2014 New Revision: 267501 URL: http://svnweb.freebsd.org/changeset/base/267501 Log: Fix date. Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.1 Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.1 == --- head/usr.bin/ssh-copy-id/ssh-copy-id.1 Sun Jun 15 10:04:44 2014 (r267500) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.1 Sun Jun 15 10:18:57 2014 (r267501) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd Feburary 28, 2014 +.Dd February 28, 2014 .Dt SSH-COPY-ID 1 .Os .Sh NAME ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267502 - head/usr.sbin/binmiscctl
Author: joel (doc committer) Date: Sun Jun 15 10:31:50 2014 New Revision: 267502 URL: http://svnweb.freebsd.org/changeset/base/267502 Log: mdoc: use display block in the beginning of the EXAMPLES section. Modified: head/usr.sbin/binmiscctl/binmiscctl.8 Modified: head/usr.sbin/binmiscctl/binmiscctl.8 == --- head/usr.sbin/binmiscctl/binmiscctl.8 Sun Jun 15 10:18:57 2014 (r267501) +++ head/usr.sbin/binmiscctl/binmiscctl.8 Sun Jun 15 10:31:50 2014 (r267502) @@ -146,10 +146,10 @@ Look up and print out the activator entr Take a snapshot and print all the activator entries currently configured. .El .Sh EXAMPLES -.Bl -# binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' \\ - --magic ''BC\\xc0\\xde'' --size 4 --set-enabled -.El +.Bd -ragged -offset indent +# binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' +--magic ''BC\\xc0\\xde'' --size 4 --set-enabled +.Ed .Pp Add an image activator to run the LLVM interpreter (lli) on bitcode compiled files. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267503 - head/share/man/man5
Author: joel (doc committer) Date: Sun Jun 15 10:34:35 2014 New Revision: 267503 URL: http://svnweb.freebsd.org/changeset/base/267503 Log: mdoc: remove superfluous paragraph macros. Modified: head/share/man/man5/pf.conf.5 head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/pf.conf.5 == --- head/share/man/man5/pf.conf.5 Sun Jun 15 10:31:50 2014 (r267502) +++ head/share/man/man5/pf.conf.5 Sun Jun 15 10:34:35 2014 (r267503) @@ -342,7 +342,6 @@ set limit states 1 .Pp With 9000 state table entries, the timeout values are scaled to 50% (tcp.first 60, tcp.established 43200). -.Pp .It Ar set loginterface Enable collection of packet and byte count statistics for the given interface or interface group. @@ -362,7 +361,6 @@ One can disable the loginterface using: .Bd -literal -offset indent set loginterface none .Ed -.Pp .It Ar set limit Sets hard limits on the memory pools used by the packet filter. See @@ -415,7 +413,6 @@ Various limits can be combined on a sing .Bd -literal -offset indent set limit { states 2, frags 2, src-nodes 2000 } .Ed -.Pp .It Ar set ruleset-optimization .Bl -tag -width -compact .It Ar none @@ -481,7 +478,6 @@ For example: .Bd -literal -offset indent set optimization aggressive .Ed -.Pp .It Ar set block-policy The .Ar block-policy @@ -573,7 +569,6 @@ ruleset finishes loading. For example: .Pp .Dl set fingerprints \/etc/pf.os.devel\ -.Pp .It Ar set skip on Aq Ar ifspec List interfaces for which packets should not be filtered. Packets passing in or out on such interfaces are passed as if pf was @@ -583,7 +578,6 @@ packet filtering is not desired and can For example: .Pp .Dl set skip on lo0 -.Pp .It Ar set debug Set the debug .Ar level @@ -693,7 +687,6 @@ are received. The .Ar fragment crop reassembly mechanism does not yet work with NAT. -.Pp .It Ar fragment drop-ovl This option is similar to the .Ar fragment crop Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5 Sun Jun 15 10:31:50 2014 (r267502) +++ head/share/man/man5/rc.conf.5 Sun Jun 15 10:34:35 2014 (r267503) @@ -1498,7 +1498,6 @@ interface as described in RFC 4941. This is the IPv6 equivalent of .Va network_interfaces . Normally manual configuration of this variable is not needed. -.Pp .It Va ipv6_cpe_wanif .Pq Vt str If the variable is set to an interface name, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267504 - head/share/man/man4
Author: joel (doc committer) Date: Sun Jun 15 10:40:54 2014 New Revision: 267504 URL: http://svnweb.freebsd.org/changeset/base/267504 Log: mdoc: add missing width argument to Bl -tag. Modified: head/share/man/man4/mrsas.4 Modified: head/share/man/man4/mrsas.4 == --- head/share/man/man4/mrsas.4 Sun Jun 15 10:34:35 2014(r267503) +++ head/share/man/man4/mrsas.4 Sun Jun 15 10:40:54 2014(r267504) @@ -207,7 +207,7 @@ variable, where X is the adapter number, or via .Xr sysctl 8 . The following bits have the described effects: -.Bl -tag -offset indent +.Bl -tag -width indent -offset indent .It 0x01 Enable informational prints. .It 0x02 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267505 - in head/bin: chio rm
Author: joel (doc committer) Date: Sun Jun 15 10:43:12 2014 New Revision: 267505 URL: http://svnweb.freebsd.org/changeset/base/267505 Log: mdoc: remove superfluous paragraph macros. Modified: head/bin/chio/chio.1 head/bin/rm/rm.1 Modified: head/bin/chio/chio.1 == --- head/bin/chio/chio.1Sun Jun 15 10:40:54 2014(r267504) +++ head/bin/chio/chio.1Sun Jun 15 10:43:12 2014(r267505) @@ -151,7 +151,6 @@ This command will query the status of th will move it to the element specified in its source attribute. This is a convenient way to return media from a drive or portal to its previous element in the changer. -.Pp .It Ic position Xo .Ar to ET to EU .Op Cm inv @@ -173,7 +172,6 @@ Report which picker unit the changer is .Xc Configure the changer to use picker .Ar unit . -.Pp .It Ic ielem Xo .Op Ar timeout .Xc Modified: head/bin/rm/rm.1 == --- head/bin/rm/rm.1Sun Jun 15 10:40:54 2014(r267504) +++ head/bin/rm/rm.1Sun Jun 15 10:43:12 2014(r267505) @@ -121,7 +121,6 @@ each directory's contents are processed is made to remove the directory). If the user does not respond affirmatively, the file hierarchy rooted in that directory is skipped. -.Pp .It Fl r Equivalent to .Fl R . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267506 - head/usr.sbin/ctladm
Author: mav Date: Sun Jun 15 11:21:44 2014 New Revision: 267506 URL: http://svnweb.freebsd.org/changeset/base/267506 Log: Document additional LUN/backend options. Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 == --- head/usr.sbin/ctladm/ctladm.8 Sun Jun 15 10:43:12 2014 (r267505) +++ head/usr.sbin/ctladm/ctladm.8 Sun Jun 15 11:21:44 2014 (r267506) @@ -34,7 +34,7 @@ .\ $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\ $FreeBSD$ .\ -.Dd October 30, 2013 +.Dd June 15, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -933,6 +933,29 @@ Display .Nm usage information. .El +.Sh OPTIONS +Number of additional configuration options may be specified for LUNs. +Some options are global, others are backend-specific. +.Pp +Global options: +.Bl -tag +.It Va vendor +Specifies LUN vendor string up to 8 chars. +.It Va product +Specifies LUN product string up to 16 chars. +.It Va revision +Specifies LUN revision string up to 4 chars. +.It Va unmap +Set to on, enables UNMAP support for the LUN. +.El +.Pp +Options specific for block backend: +.Bl -tag +.It Va file +Specifies file or device name to use for backing store. +.It Va num_threads +Specifies number of backend threads to use for this LUN. +.El .Sh EXAMPLES .Dl ctladm tur 0:1 .Pp ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267507 - head/sys/arm/freescale/vybrid
Author: br Date: Sun Jun 15 12:08:33 2014 New Revision: 267507 URL: http://svnweb.freebsd.org/changeset/base/267507 Log: Add very basic driver for 12-bit Analog to Digital Converter (ADC). Added: head/sys/arm/freescale/vybrid/vf_adc.c (contents, props changed) head/sys/arm/freescale/vybrid/vf_adc.h (contents, props changed) Modified: head/sys/arm/freescale/vybrid/files.vybrid Modified: head/sys/arm/freescale/vybrid/files.vybrid == --- head/sys/arm/freescale/vybrid/files.vybrid Sun Jun 15 11:21:44 2014 (r267506) +++ head/sys/arm/freescale/vybrid/files.vybrid Sun Jun 15 12:08:33 2014 (r267507) @@ -23,6 +23,7 @@ arm/freescale/vybrid/vf_src.c standard arm/freescale/vybrid/vf_edma.c standard arm/freescale/vybrid/vf_dmamux.c standard arm/freescale/vybrid/vf_port.c standard +arm/freescale/vybrid/vf_adc.c standard arm/freescale/vybrid/vf_i2c.c optionaliicbus arm/freescale/vybrid/vf_tcon.c optionalvt arm/freescale/vybrid/vf_dcu4.c optionalvt Added: head/sys/arm/freescale/vybrid/vf_adc.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_adc.c Sun Jun 15 12:08:33 2014 (r267507) @@ -0,0 +1,245 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin b...@bsdpad.com + * 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. + */ + +/* + * Vybrid Family 12-bit Analog to Digital Converter (ADC) + * Chapter 37, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include sys/param.h +#include sys/systm.h +#include sys/bus.h +#include sys/kernel.h +#include sys/module.h +#include sys/malloc.h +#include sys/rman.h +#include sys/timeet.h +#include sys/timetc.h + +#include dev/fdt/fdt_common.h +#include dev/ofw/openfirm.h +#include dev/ofw/ofw_bus.h +#include dev/ofw/ofw_bus_subr.h + +#include machine/bus.h +#include machine/fdt.h +#include machine/cpu.h +#include machine/intr.h + +#include arm/freescale/vybrid/vf_common.h +#include arm/freescale/vybrid/vf_adc.h + +#defineADC_HC0 0x00/* Ctrl reg for hardware triggers */ +#defineADC_HC1 0x04/* Ctrl reg for hardware triggers */ +#define HC_AIEN(1 7)/* Conversion Complete Int Control */ +#define HC_ADCH_M 0x1f/* Input Channel Select Mask */ +#define HC_ADCH_S 0 /* Input Channel Select Shift */ +#defineADC_HS 0x08/* Status register for HW triggers */ +#define HS_COCO0 (1 0)/* Conversion Complete Flag */ +#define HS_COCO1 (1 1)/* Conversion Complete Flag */ +#defineADC_R0 0x0C/* Data result reg for HW triggers */ +#defineADC_R1 0x10/* Data result reg for HW triggers */ +#defineADC_CFG 0x14/* Configuration register */ +#define CFG_OVWREN (1 16) /* Data Overwrite Enable */ +#define CFG_AVGS_M 0x3 /* Hardware Average select Mask */ +#define CFG_AVGS_S 14 /* Hardware Average select Shift */ +#define CFG_ADTRG (1 13) /* Conversion Trigger Select */ +#define CFG_REFSEL_M 0x3 /* Voltage Reference Select Mask */ +#define CFG_REFSEL_S 11 /* Voltage Reference Select Shift */
svn commit: r267511 - in head: lib share/mk
Author: ian Date: Sun Jun 15 13:45:37 2014 New Revision: 267511 URL: http://svnweb.freebsd.org/changeset/base/267511 Log: Create a mechanism for providing fine-grained build order dependencies during SUBDIR_PARALLEL builds. This augments the coarse .WAIT mechanism, which is still useful if you've got a situation such as almost everything depends on A and B. Because the parallel subdir mechanism uses non-obvious mangling of target names, which should probably remain a private detail of the implementation, it's not easy to do things like libfoo: libbar, so instead the new mechanism lets you set a variable that lists dependencies: SUBDIR_DEPEND_libfoo= libgroodah libpouet Note that while I'm using libraries as an example here, it really has nothing to do with the generated library files. This is really saying build in directory libfoo after building in the libgroodah and libpouet directories. This updates lib/Makefile with dependency information based on the old almost-accurate comment block and by combing through lib/* makefiles looking for LDADD dependencies to other libraries within lib/*. Reviewed by: Jia-Shiun Li jiash...@gmail.com Modified: head/lib/Makefile head/share/mk/bsd.subdir.mk Modified: head/lib/Makefile == --- head/lib/Makefile Sun Jun 15 13:43:44 2014(r267510) +++ head/lib/Makefile Sun Jun 15 13:45:37 2014(r267511) @@ -3,82 +3,43 @@ .include src.opts.mk -# To satisfy shared library or ELF linkage when only the libraries being -# built are visible: -# -# csu must be built before all shared libaries for ELF. -# libc must be built before all other shared libraries. -# libbsm must be built before libauditd. -# libcom_err must be built before libpam. -# libcrypt must be built before libpam. -# libkvm must be built before libdevstat. -# libldns must be built before libunbound. -# msun must be built before libg++ and libstdc++. -# libmd must be built before libatm, libopie, libradius, and libtacplus. -# ncurses must be built before libdialog, libedit and libreadline. -# libnetgraph must be built before libbsnmp/modules/snmp_netgraph. -# libopie must be built before libpam. -# libradius must be built before libpam. -# librpcsvc must be built before libpam. -# libsbuf must be built before libcam. -# libtacplus must be built before libpam. -# libutil must be built before libpam. -# libypclnt must be built before libpam. -# libgssapi must be built before librpcsec_gss -# -# Otherwise, the SUBDIR list should be in alphabetical order. -# -# Except it appears bind needs to be compiled last +# The SUBDIR_ORDERED list is a small set of libraries which are used by many +# of the other libraries. These are built first with a .WAIT between them +# and the main list to avoid needing a SUBDIR_DEPEND line on every library +# naming just these few items. SUBDIR_ORDERED=${_csu} \ .WAIT \ libc \ libc_nonshared \ - .WAIT \ - msun \ - .WAIT \ - libbsm \ - libauditd \ - libutil \ - libpjdlog \ - libnv \ - ${_libcapsicum} \ libcompiler_rt \ - libcrypt \ - libelf \ - ${_libiconv_modules} \ - libkvm \ - ${_libldns} \ - libmd \ - ncurses \ - ${_libnetgraph} \ - libradius \ - librpcsvc \ - libsbuf \ - libtacplus \ - ${_libypclnt} \ + ${_libcplusplus} \ ${_libcxxrt} \ - ${_libcplusplus} + libelf \ + msun -.if ${MK_KERBEROS_SUPPORT} != no -SUBDIR_ORDERED+= libcom_err -.endif +# The main list; please keep these sorted alphabetically. SUBDIR=${SUBDIR_ORDERED} \ .WAIT \ libalias \ libarchive \ ${_libatm} \ + libauditd \ libbegemot \ libblocksruntime \ ${_libbluetooth} \ ${_libbsnmp} \ libbsdstat \ + libbsm \ libbz2 \ libcalendar \ libcam \ + ${_libcapsicum} \ ${_libcasper} \ + ${_libcom_err} \ libcompat \ + libcrypt \ libdevinfo \ libdevstat \ libdwarf \ @@ -91,26 +52,36 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libgpib} \ ${_libgssapi} \ ${_librpcsec_gss} \ + ${_libiconv_modules} \ libipsec \ libjail \ libkiconv \ + libkvm \ + ${_libldns} \ liblzma \ libmagic \ libmandoc \ libmemstat \ + libmd \ ${_libmilter} \ ${_libmp} \ ${_libnandfs} \ libnetbsd \ + ${_libnetgraph} \ ${_libngatm} \ + libnv \ libopie \ libpam \ libpcap \ + libpjdlog \ ${_libpmc} \ ${_libproc} \ libprocstat \ + libradius \ + librpcsvc \ librt \ ${_librtld_db} \ + libsbuf \
Re: svn commit: r266083 - in head/sys/arm: arm include
On 30 May 2014, at 09:42, Michael Tuexen tue...@fh-muenster.de wrote: On 29 May 2014, at 21:21, Mark R V Murray ma...@freebsd.org wrote: On 29 May 2014, at 19:27, Michael Tuexen tue...@fh-muenster.de wrote: On 29 May 2014, at 20:15, Mark R V Murray ma...@freebsd.org wrote: On 29 May 2014, at 19:13, Michael Tuexen tue...@fh-muenster.de wrote: I can make it work on RPI, but trying to find what else it will/won’t work on is more problematic. Wouldn't it require to use different registers on the RPI? This would mean you would need more #ifdefs… Thats the problem; too many #ifdefs. So you could just keep the code for now, but reduce the #ifdefs to the ones you know that work. Later on, you can replace it by the driver stuff… That’s what I was thinking, yes. Great. Let me know if you need testing support on the RPI… I’ve come to the conclusion that my RPI-B is hosed. It doesn’t even boot Raspian properly. Sorry about how long this has taken. Please could someone with a working RPI please check that the following patch works (may need to apply by hand due to cut/paste). Thanks, with repeated apologies. M -- Mark R V Murray --- include/cpu.h (revision 267507) +++ include/cpu.h (working copy) @@ -25,7 +25,16 @@ * Read PMCCNTR. Curses! Its only 32 bits. * TODO: Fix this by catching overflow with interrupt? */ +/* The ARMv6 vs ARMv7 divide is going to need a better way of + * distinguishing between them. + */ +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) + /* ARMv6 - Earlier model SCCs */ + __asm __volatile(mrc p15, 0, %0, c15, c12, 1: =r (ccnt)); +#else + /* ARMv7 - Later model SCCs */ __asm __volatile(mrc p15, 0, %0, c9, c13, 0: =r (ccnt)); +#endif ccnt64 = (uint64_t)ccnt; return (ccnt64); #else /* No performance counters, so use binuptime(9). This is slow */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r266083 - in head/sys/arm: arm include
On 15 Jun 2014, at 17:13, Mark R V Murray ma...@freebsd.org wrote: On 30 May 2014, at 09:42, Michael Tuexen tue...@fh-muenster.de wrote: On 29 May 2014, at 21:21, Mark R V Murray ma...@freebsd.org wrote: On 29 May 2014, at 19:27, Michael Tuexen tue...@fh-muenster.de wrote: On 29 May 2014, at 20:15, Mark R V Murray ma...@freebsd.org wrote: On 29 May 2014, at 19:13, Michael Tuexen tue...@fh-muenster.de wrote: I can make it work on RPI, but trying to find what else it will/won’t work on is more problematic. Wouldn't it require to use different registers on the RPI? This would mean you would need more #ifdefs… Thats the problem; too many #ifdefs. So you could just keep the code for now, but reduce the #ifdefs to the ones you know that work. Later on, you can replace it by the driver stuff… That’s what I was thinking, yes. Great. Let me know if you need testing support on the RPI… I’ve come to the conclusion that my RPI-B is hosed. It doesn’t even boot Raspian properly. Sorry about how long this has taken. Please could someone with a working RPI please check that the following patch works (may need to apply by hand due to cut/paste). Thanks, with repeated apologies. I can test it and report if it works. It might take until tomorrow... Thanks for working on a fix! Best regards Michael M -- Mark R V Murray --- include/cpu.h (revision 267507) +++ include/cpu.h (working copy) @@ -25,7 +25,16 @@ * Read PMCCNTR. Curses! Its only 32 bits. * TODO: Fix this by catching overflow with interrupt? */ +/* The ARMv6 vs ARMv7 divide is going to need a better way of + * distinguishing between them. + */ +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) + /* ARMv6 - Earlier model SCCs */ + __asm __volatile(mrc p15, 0, %0, c15, c12, 1: =r (ccnt)); +#else + /* ARMv7 - Later model SCCs */ __asm __volatile(mrc p15, 0, %0, c9, c13, 0: =r (ccnt)); +#endif ccnt64 = (uint64_t)ccnt; return (ccnt64); #else /* No performance counters, so use binuptime(9). This is slow */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267512 - head/usr.bin/patch
Author: pfg Date: Sun Jun 15 16:38:17 2014 New Revision: 267512 URL: http://svnweb.freebsd.org/changeset/base/267512 Log: patch: add dry-run alias for compatibility with other implementations. Other implementations of patch(1), including GNU patch and svn patch have a --dry-run option which does the same as our -C or --check option. Add a new alias to make our implementation more compatible. MFC after:1 week Modified: head/usr.bin/patch/patch.1 head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.1 == --- head/usr.bin/patch/patch.1 Sun Jun 15 13:45:37 2014(r267511) +++ head/usr.bin/patch/patch.1 Sun Jun 15 16:38:17 2014(r267512) @@ -21,7 +21,7 @@ .\ .\ $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $ .\ $FreeBSD$ -.Dd June 12, 2014 +.Dd June 15, 2014 .Dt PATCH 1 .Os .Sh NAME @@ -107,7 +107,7 @@ This is equivalent to specifying This option is currently the default, unless .Fl -posix is specified. -.It Fl C , Fl Fl check +.It Fl C , Fl Fl check , Fl Fl dry-run Checks that the patch would apply cleanly, but does not modify anything. .It Fl c , Fl Fl context Forces Modified: head/usr.bin/patch/patch.c == --- head/usr.bin/patch/patch.c Sun Jun 15 13:45:37 2014(r267511) +++ head/usr.bin/patch/patch.c Sun Jun 15 16:38:17 2014(r267512) @@ -469,6 +469,7 @@ get_some_switches(void) {context, no_argument,0, 'c'}, {debug, required_argument, 0, 'x'}, {directory, required_argument, 0, 'd'}, + {dry-run, no_argument,0, 'C'}, {ed, no_argument,0, 'e'}, {force, no_argument,0, 'f'}, {forward, no_argument,0, 'N'}, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267513 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt
Author: pfg Date: Sun Jun 15 16:54:26 2014 New Revision: 267513 URL: http://svnweb.freebsd.org/changeset/base/267513 Log: MFV r266988: Merge from r258379 missed the tests. 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included Illumos Revision: 54a20ab41aadcb81c53e72fc65886e964e9add59 MFC after:5 days Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh - copied unchanged from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out - copied unchanged from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh - copied unchanged from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh (from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh Sun Jun 15 16:54:26 2014(r267513, copy of r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh) @@ -0,0 +1,106 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2013, Joyent, Inc. All rights reserved. +# + +if [ $# != 1 ]; then + echo expected one argument: ''dtrace-path'' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +echo '#pragma D option quiet' test.d +echo '#pragma D option aggsortkey' test.d + +cat test.c EOF +#include unistd.h + +void +main() +{ +EOF + +objs= + +for oogle in doogle bagnoogle; do + cat $oogle.c EOF +#include sys/sdt.h + +void +$oogle() +{ + DTRACE_PROBE($oogle, knows); +} +EOF + + cat $oogle.d EOF +provider $oogle { + probe knows(); +}; +EOF + + cc -c $oogle.c + + if [ $? -ne 0 ]; then + print -u2 failed to compile $oogle.c + exit 1 + fi + + $dtrace -G -32 -s $oogle.d $oogle.o -o $oogle.d.o + + if [ $? -ne 0 ]; then + print -u2 failed to process $oogle.d + exit 1 + fi + + objs=$objs $oogle.o $oogle.d.o + echo $oogle'();' test.c + echo $oogle'$target:::{@[probefunc] = count()}' test.d +done + +echo } test.c + +echo 'END{printa(%-10s %@d\\n, @)}' test.d + +cc -o test test.c $objs + +if [ $? -ne 0 ]; then + print -u2 failed to compile test.c + exit 1 +fi + +$dtrace -s ./test.d -Zc ./test + +if [ $? -ne 0 ]; then + print -u2 failed to execute test + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR +exit 0 Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out (from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out Sun Jun 15 16:54:26 2014(r267513, copy of r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out) @@ -0,0 +1,3 @@ +bagnoogle 1 +doogle 1 + Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh (from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh Sun Jun 15 16:54:26 2014(r267513, copy of r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh) @@ -0,0 +1,59 @@ +# +# CDDL HEADER START +# +# The
svn commit: r267514 - head/sys/cam/ctl
Author: mav Date: Sun Jun 15 17:14:52 2014 New Revision: 267514 URL: http://svnweb.freebsd.org/changeset/base/267514 Log: Move kern_total_len setting from backend to core code. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sun Jun 15 16:54:26 2014(r267513) +++ head/sys/cam/ctl/ctl.c Sun Jun 15 17:14:52 2014(r267514) @@ -8800,6 +8800,9 @@ ctl_read_write(struct ctl_scsiio *ctsio) memcpy(ctsio-io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, lbalen, sizeof(lbalen)); + ctsio-kern_total_len = num_blocks * lun-be_lun-blocksize; + ctsio-kern_rel_offset = 0; + CTL_DEBUG_PRINT((ctl_read_write: calling data_submit()\n)); retval = lun-backend-data_submit((union ctl_io *)ctsio); Modified: head/sys/cam/ctl/ctl_backend_block.c == --- head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 16:54:26 2014 (r267513) +++ head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 17:14:52 2014 (r267514) @@ -1383,15 +1383,11 @@ ctl_be_block_worker(void *context, int p static int ctl_be_block_submit(union ctl_io *io) { - struct ctl_lba_len lbalen; struct ctl_be_block_lun *be_lun; struct ctl_be_lun *ctl_be_lun; - int retval; DPRINTF(entered\n); - retval = CTL_RETVAL_COMPLETE; - ctl_be_lun = (struct ctl_be_lun *)io-io_hdr.ctl_private[ CTL_PRIV_BACKEND_LUN].ptr; be_lun = (struct ctl_be_block_lun *)ctl_be_lun-be_lun; @@ -1402,11 +1398,6 @@ ctl_be_block_submit(union ctl_io *io) KASSERT(io-io_hdr.io_type == CTL_IO_SCSI, (Non-SCSI I/O (type %#x) encountered, io-io_hdr.io_type)); - memcpy(lbalen, io-io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); - io-scsiio.kern_total_len = lbalen.len * be_lun-blocksize; - io-scsiio.kern_rel_offset = 0; - mtx_lock(be_lun-lock); /* * XXX KDM make sure that links is okay to use at this point. @@ -1415,10 +1406,9 @@ ctl_be_block_submit(union ctl_io *io) */ STAILQ_INSERT_TAIL(be_lun-input_queue, io-io_hdr, links); mtx_unlock(be_lun-lock); - taskqueue_enqueue(be_lun-io_taskqueue, be_lun-io_task); - return (retval); + return (CTL_RETVAL_COMPLETE); } static int Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c == --- head/sys/cam/ctl/ctl_backend_ramdisk.c Sun Jun 15 16:54:26 2014 (r267513) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Sun Jun 15 17:14:52 2014 (r267514) @@ -274,20 +274,8 @@ ctl_backend_ramdisk_move_done(union ctl_ static int ctl_backend_ramdisk_submit(union ctl_io *io) { - struct ctl_lba_len lbalen; - struct ctl_be_lun *ctl_be_lun; - ctl_be_lun = (struct ctl_be_lun *)io-io_hdr.ctl_private[ - CTL_PRIV_BACKEND_LUN].ptr; - - memcpy(lbalen, io-io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); - io-scsiio.be_move_done = ctl_backend_ramdisk_move_done; - io-scsiio.kern_total_len = lbalen.len * ctl_be_lun-blocksize; - io-scsiio.kern_rel_offset = 0; - io-scsiio.kern_data_resid = 0; ctl_backend_ramdisk_continue(io); - return (CTL_RETVAL_COMPLETE); } @@ -328,6 +316,8 @@ ctl_backend_ramdisk_continue(union ctl_i io-scsiio.kern_data_ptr = softc-ramdisk_buffer; #endif /* CTL_RAMDISK_PAGES */ + io-scsiio.be_move_done = ctl_backend_ramdisk_move_done; + io-scsiio.kern_data_resid = 0; io-scsiio.kern_data_len = len_filled; io-scsiio.kern_sg_entries = sg_filled; io-io_hdr.flags |= CTL_FLAG_ALLOCATED; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267515 - head/sys/cam/ctl
Author: mav Date: Sun Jun 15 18:16:51 2014 New Revision: 267515 URL: http://svnweb.freebsd.org/changeset/base/267515 Log: Remove memcpy() from ctl_private[] accesses. That union is aligned enough to access data directly. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sun Jun 15 17:14:52 2014(r267514) +++ head/sys/cam/ctl/ctl.c Sun Jun 15 18:16:51 2014(r267515) @@ -5779,7 +5779,7 @@ int ctl_write_same(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; - struct ctl_lba_len_flags lbalen; + struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; int len, retval; @@ -5872,11 +5872,10 @@ ctl_write_same(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } - lbalen.lba = lba; - lbalen.len = num_blocks; - lbalen.flags = byte2; - memcpy(ctsio-io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, lbalen, - sizeof(lbalen)); + lbalen = (struct ctl_lba_len_flags *)ctsio-io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen-lba = lba; + lbalen-len = num_blocks; + lbalen-flags = byte2; retval = lun-backend-config_write((union ctl_io *)ctsio); return (retval); @@ -5887,7 +5886,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; struct scsi_unmap *cdb; - struct ctl_ptr_len_flags ptrlen; + struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_header *hdr; struct scsi_unmap_desc *buf, *end; uint64_t lba; @@ -5942,11 +5941,10 @@ ctl_unmap(struct ctl_scsiio *ctsio) buf = (struct scsi_unmap_desc *)(hdr + 1); end = buf + len / sizeof(*buf); - ptrlen.ptr = (void *)buf; - ptrlen.len = len; - ptrlen.flags = byte2; - memcpy(ctsio-io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, ptrlen, - sizeof(ptrlen)); + ptrlen = (struct ctl_ptr_len_flags *)ctsio-io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + ptrlen-ptr = (void *)buf; + ptrlen-len = len; + ptrlen-flags = byte2; for (; buf end; buf++) { lba = scsi_8btou64(buf-lba); @@ -12755,7 +12753,7 @@ ctl_process_done(union ctl_io *io, int h switch (io-io_hdr.io_type) { case CTL_IO_SCSI: { int isread; - struct ctl_lba_len lbalen; + struct ctl_lba_len *lbalen; isread = 0; switch (io-scsiio.cdb[0]) { @@ -12772,12 +12770,12 @@ ctl_process_done(union ctl_io *io, int h case WRITE_VERIFY_10: case WRITE_VERIFY_12: case WRITE_VERIFY_16: - memcpy(lbalen, io-io_hdr.ctl_private[ - CTL_PRIV_LBA_LEN].bytes, sizeof(lbalen)); + lbalen = (struct ctl_lba_len *) + io-io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; if (isread) { lun-stats.ports[targ_port].bytes[CTL_STATS_READ] += - lbalen.len * blocksize; + lbalen-len * blocksize; lun-stats.ports[targ_port].operations[CTL_STATS_READ]++; #ifdef CTL_TIME_IO @@ -12807,7 +12805,7 @@ ctl_process_done(union ctl_io *io, int h #endif /* CTL_TIME_IO */ } else { lun-stats.ports[targ_port].bytes[CTL_STATS_WRITE] += - lbalen.len * blocksize; + lbalen-len * blocksize; lun-stats.ports[targ_port].operations[ CTL_STATS_WRITE]++; Modified: head/sys/cam/ctl/ctl_backend_block.c == --- head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 17:14:52 2014 (r267514) +++ head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 18:16:51 2014 (r267515) @@ -786,7 +786,7 @@ ctl_be_block_unmap_dev(struct ctl_be_blo { union ctl_io *io; struct ctl_be_block_devdata *dev_data; - struct ctl_ptr_len_flags ptrlen; + struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_desc *buf, *end; uint64_t len; @@ -800,10 +800,9 @@ ctl_be_block_unmap_dev(struct ctl_be_blo if (beio-io_offset == -1) { beio-io_len = 0; - memcpy(ptrlen, io-io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(ptrlen)); - buf = (struct
svn commit: r267516 - head/usr.sbin/ctladm
Author: joel (doc committer) Date: Sun Jun 15 18:30:26 2014 New Revision: 267516 URL: http://svnweb.freebsd.org/changeset/base/267516 Log: mdoc: add missing width to Bl -tag. Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 == --- head/usr.sbin/ctladm/ctladm.8 Sun Jun 15 18:16:51 2014 (r267515) +++ head/usr.sbin/ctladm/ctladm.8 Sun Jun 15 18:30:26 2014 (r267516) @@ -938,7 +938,7 @@ Number of additional configuration optio Some options are global, others are backend-specific. .Pp Global options: -.Bl -tag +.Bl -tag -width 12n .It Va vendor Specifies LUN vendor string up to 8 chars. .It Va product @@ -950,7 +950,7 @@ Set to on, enables UNMAP support for t .El .Pp Options specific for block backend: -.Bl -tag +.Bl -tag -width 12n .It Va file Specifies file or device name to use for backing store. .It Va num_threads ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267517 - stable/10/sys/ofed/include/linux
Author: hselasky Date: Sun Jun 15 18:32:02 2014 New Revision: 267517 URL: http://svnweb.freebsd.org/changeset/base/267517 Log: MFC r267395: - Fix out of range shifting bug in bitops.h. - Make code a bit easier to read by adding parenthesis. Modified: stable/10/sys/ofed/include/linux/bitops.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/bitops.h == --- stable/10/sys/ofed/include/linux/bitops.h Sun Jun 15 18:30:26 2014 (r267516) +++ stable/10/sys/ofed/include/linux/bitops.h Sun Jun 15 18:32:02 2014 (r267517) @@ -286,14 +286,14 @@ bitmap_empty(unsigned long *addr, int si #defineNBLONG (NBBY * sizeof(long)) #defineset_bit(i, a) \ -atomic_set_long(((volatile long *)(a))[(i)/NBLONG], 1UL (i) % NBLONG) +atomic_set_long(((volatile long *)(a))[(i)/NBLONG], 1UL ((i) % NBLONG)) #defineclear_bit(i, a) \ -atomic_clear_long(((volatile long *)(a))[(i)/NBLONG], 1UL (i) % NBLONG) +atomic_clear_long(((volatile long *)(a))[(i)/NBLONG], 1UL ((i) % NBLONG)) #definetest_bit(i, a) \ !!(atomic_load_acq_long(((volatile long *)(a))[(i)/NBLONG]) \ -1UL ((i) % NBLONG)) +(1UL ((i) % NBLONG))) static inline long test_and_clear_bit(long bit, long *var) @@ -302,7 +302,7 @@ test_and_clear_bit(long bit, long *var) var += bit / (sizeof(long) * NBBY); bit %= sizeof(long) * NBBY; - bit = 1 bit; + bit = (1UL bit); do { val = *(volatile long *)var; } while (atomic_cmpset_long(var, val, val ~bit) == 0); @@ -317,7 +317,7 @@ test_and_set_bit(long bit, long *var) var += bit / (sizeof(long) * NBBY); bit %= sizeof(long) * NBBY; - bit = 1 bit; + bit = (1UL bit); do { val = *(volatile long *)var; } while (atomic_cmpset_long(var, val, val | bit) == 0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267518 - head/share/man/man4
Author: joel (doc committer) Date: Sun Jun 15 18:39:10 2014 New Revision: 267518 URL: http://svnweb.freebsd.org/changeset/base/267518 Log: Minor mdoc improvements. Modified: head/share/man/man4/proto.4 Modified: head/share/man/man4/proto.4 == --- head/share/man/man4/proto.4 Sun Jun 15 18:32:02 2014(r267517) +++ head/share/man/man4/proto.4 Sun Jun 15 18:39:10 2014(r267518) @@ -76,6 +76,7 @@ with .Pa pcid:b:s:f representing the location of the PCI device in the PCI hierarchy. A location includes: +.Pp .Bl -tag -width XX -compact .It d The PCI domain number @@ -101,11 +102,17 @@ representing I/O port or memory mapped I .Sh EXAMPLES A single function PCI device in domain 0, on bus 1, in slot 2 and having a single memory mapped I/O region will have the following device special files: -.Bl -tag -compact +.Pp +.Bl -tag -width XX -compact .It Pa /dev/proto/pci0:1:2:0/10.mem .It Pa /dev/proto/pci0:1:2:0/pcicfg .El -.\ +.\ +.Sh AUTHORS +The +.Nm +device driver and this manual page were written by +.An Marcel Moolenaar Aq mar...@xcllnt.net . .Sh SECURITY CONSIDERATIONS Because programs have direct access to the hardware, the .Nm @@ -126,9 +133,3 @@ The details of how a program can set up initiate DMA still need to be fleshed out. .Pp Support for non-PCI devices has not been implemented yet. -.\ -.Sh AUTHORS -The -.Nm -device driver and this manual page were written by -.An Marcel Moolenaar Aq mar...@xcllnt.net . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267519 - head/sys/cam/ctl
Author: mav Date: Sun Jun 15 20:14:11 2014 New Revision: 267519 URL: http://svnweb.freebsd.org/changeset/base/267519 Log: Make backends track completion by processed number of sectors instead of total transfer size. Commands such as VERIFY or COMPARE AND WRITE may have transfer size not matching directly to number of sectors. Modified: head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_block.c == --- head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 18:39:10 2014 (r267518) +++ head/sys/cam/ctl/ctl_backend_block.cSun Jun 15 20:14:11 2014 (r267519) @@ -103,6 +103,9 @@ __FBSDID($FreeBSD$); #define DPRINTF(fmt, args...) do {} while(0) #endif +#define PRIV(io) \ +((struct ctl_ptr_len_flags *)(io)-io_hdr.ctl_private[CTL_PRIV_BACKEND]) + SDT_PROVIDER_DEFINE(cbb); typedef enum { @@ -356,9 +359,7 @@ ctl_be_block_move_done(union ctl_io *io) struct bintime cur_bt; #endif - beio = (struct ctl_be_block_io *) - io-io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; - + beio = (struct ctl_be_block_io *)PRIV(io)-ptr; be_lun = beio-lun; DPRINTF(entered\n); @@ -932,7 +933,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b DPRINTF(entered\n); - beio = io-io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + beio = (struct ctl_be_block_io *)PRIV(io)-ptr; softc = be_lun-softc; lbalen = (struct ctl_lba_len_flags *)io-io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; @@ -1039,7 +1040,7 @@ ctl_be_block_cw_dispatch_unmap(struct ct DPRINTF(entered\n); - beio = io-io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + beio = (struct ctl_be_block_io *)PRIV(io)-ptr; softc = be_lun-softc; ptrlen = (struct ctl_ptr_len_flags *)io-io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; @@ -1114,7 +1115,7 @@ ctl_be_block_cw_dispatch(struct ctl_be_b beio-io = io; beio-lun = be_lun; beio-beio_cont = ctl_be_block_cw_done; - io-io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; + PRIV(io)-ptr = (void *)beio; switch (io-scsiio.cdb[0]) { case SYNCHRONIZE_CACHE: @@ -1181,7 +1182,8 @@ ctl_be_block_dispatch(struct ctl_be_bloc struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; struct ctl_lba_len *lbalen; - uint64_t len_left, lbaoff; + struct ctl_ptr_len_flags *bptrlen; + uint64_t len_left, lbas; int i; softc = be_lun-softc; @@ -1197,7 +1199,8 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio = ctl_alloc_beio(softc); beio-io = io; beio-lun = be_lun; - io-io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; + bptrlen = PRIV(io); + bptrlen-ptr = (void *)beio; /* * If the I/O came down with an ordered or head of queue tag, set @@ -1243,12 +1246,12 @@ ctl_be_block_dispatch(struct ctl_be_bloc lbalen = (struct ctl_lba_len *)io-io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; DPRINTF(%s at LBA %jx len %u @%ju\n, (beio-bio_cmd == BIO_READ) ? READ : WRITE, - (uintmax_t)lbalen-lba, lbalen-len, lbaoff); - lbaoff = io-scsiio.kern_rel_offset / be_lun-blocksize; - beio-io_offset = (lbalen-lba + lbaoff) * be_lun-blocksize; - beio-io_len = MIN((lbalen-len - lbaoff) * be_lun-blocksize, - CTLBLK_MAX_IO_SIZE); - beio-io_len -= beio-io_len % be_lun-blocksize; + (uintmax_t)lbalen-lba, lbalen-len, bptrlen-len); + lbas = MIN(lbalen-len - bptrlen-len, + CTLBLK_MAX_IO_SIZE / be_lun-blocksize); + beio-io_offset = (lbalen-lba + bptrlen-len) * be_lun-blocksize; + beio-io_len = lbas * be_lun-blocksize; + bptrlen-len += lbas; for (i = 0, len_left = beio-io_len; len_left 0; i++) { KASSERT(i CTLBLK_MAX_SEGS, (Too many segs (%d = %d), @@ -1266,8 +1269,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio-num_segs++; len_left -= beio-sg_segs[i].len; } - if (io-scsiio.kern_rel_offset + beio-io_len - io-scsiio.kern_total_len) + if (bptrlen-len lbalen-len) beio-beio_cont = ctl_be_block_next; io-scsiio.be_move_done = ctl_be_block_move_done; io-scsiio.kern_data_ptr = (uint8_t *)beio-sg_segs; @@ -1318,8 +1320,7 @@ ctl_be_block_worker(void *context, int p mtx_unlock(be_lun-lock); - beio = (struct ctl_be_block_io *) - io-io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + beio = (struct ctl_be_block_io *)PRIV(io)-ptr; be_lun-dispatch(be_lun, beio); @@ -1391,6 +1392,8 @@ ctl_be_block_submit(union ctl_io *io) KASSERT(io-io_hdr.io_type == CTL_IO_SCSI, (Non-SCSI I/O (type
svn commit: r267520 - head/sys/dev/virtio/network
Author: bryanv Date: Mon Jun 16 04:12:33 2014 New Revision: 267520 URL: http://svnweb.freebsd.org/changeset/base/267520 Log: - Remove two write-only local variables - Remove unused element in the vtnet_rxq structure MFC after:1 week Modified: head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/virtio/network/if_vtnet.c == --- head/sys/dev/virtio/network/if_vtnet.c Sun Jun 15 20:14:11 2014 (r267519) +++ head/sys/dev/virtio/network/if_vtnet.c Mon Jun 16 04:12:33 2014 (r267520) @@ -2113,13 +2113,11 @@ fail: static int vtnet_txq_encap(struct vtnet_txq *txq, struct mbuf **m_head) { - struct vtnet_softc *sc; struct vtnet_tx_header *txhdr; struct virtio_net_hdr *hdr; struct mbuf *m; int error; - sc = txq-vtntx_sc; m = *m_head; M_ASSERTPKTHDR(m); @@ -2946,11 +2944,9 @@ vtnet_set_active_vq_pairs(struct vtnet_s static int vtnet_reinit(struct vtnet_softc *sc) { - device_t dev; struct ifnet *ifp; int error; - dev = sc-vtnet_dev; ifp = sc-vtnet_ifp; /* Use the current MAC address. */ Modified: head/sys/dev/virtio/network/if_vtnetvar.h == --- head/sys/dev/virtio/network/if_vtnetvar.h Sun Jun 15 20:14:11 2014 (r267519) +++ head/sys/dev/virtio/network/if_vtnetvar.h Mon Jun 16 04:12:33 2014 (r267520) @@ -74,7 +74,6 @@ struct vtnet_rxq { struct virtqueue*vtnrx_vq; struct sglist *vtnrx_sg; int vtnrx_id; - int vtnrx_process_limit; struct vtnet_rxq_stats vtnrx_stats; struct taskqueue*vtnrx_tq; struct task vtnrx_intrtask; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267521 - head/sys/dev/virtio/pci
Author: bryanv Date: Mon Jun 16 04:16:31 2014 New Revision: 267521 URL: http://svnweb.freebsd.org/changeset/base/267521 Log: Remove kernel specific macro out of the VirtIO PCI header file The eventual goal is to share this file with userland, so remove the macro that is only specific for virtio_pci(4). Instead, add the VIRTIO_PCI_CONFIG_OFF macro from Linux to get the config size whether MSIX is enabled or not. MFC after:1 week Modified: head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/pci/virtio_pci.h Modified: head/sys/dev/virtio/pci/virtio_pci.c == --- head/sys/dev/virtio/pci/virtio_pci.cMon Jun 16 04:12:33 2014 (r267520) +++ head/sys/dev/virtio/pci/virtio_pci.cMon Jun 16 04:16:31 2014 (r267521) @@ -170,6 +170,9 @@ static void vtpci_config_intr(void *); #define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt +#define VIRTIO_PCI_CONFIG(_sc) \ +VIRTIO_PCI_CONFIG_OFF_sc)-vtpci_flags VTPCI_FLAG_MSIX)) != 0) + /* * I/O port read/write wrappers. */ Modified: head/sys/dev/virtio/pci/virtio_pci.h == --- head/sys/dev/virtio/pci/virtio_pci.hMon Jun 16 04:12:33 2014 (r267520) +++ head/sys/dev/virtio/pci/virtio_pci.hMon Jun 16 04:16:31 2014 (r267521) @@ -72,8 +72,7 @@ * The remaining space is defined by each driver as the per-driver * configuration space. */ -#define VIRTIO_PCI_CONFIG(sc) \ -(((sc)-vtpci_flags VTPCI_FLAG_MSIX) ? 24 : 20) +#define VIRTIO_PCI_CONFIG_OFF(msix_enabled) ((msix_enabled) ? 24 : 20) /* * How many bits to shift physical queue address written to QUEUE_PFN. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267522 - in head/sys/dev/virtio: . pci
Author: bryanv Date: Mon Jun 16 04:25:04 2014 New Revision: 267522 URL: http://svnweb.freebsd.org/changeset/base/267522 Log: Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h These defines are applicable to userland too, but virtqueue.h contains the kernel virtqueue interface, and is therefore not usable in userland. Note that Linux places these defines in virtio_ring.h, but I don't want the drivers including this header file to keep the VirtIO ring opaque to everything but the virtqueue. MFC after:1 week Modified: head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtio_config.h head/sys/dev/virtio/virtqueue.c head/sys/dev/virtio/virtqueue.h Modified: head/sys/dev/virtio/pci/virtio_pci.c == --- head/sys/dev/virtio/pci/virtio_pci.cMon Jun 16 04:16:31 2014 (r267521) +++ head/sys/dev/virtio/pci/virtio_pci.cMon Jun 16 04:25:04 2014 (r267522) @@ -45,7 +45,6 @@ __FBSDID($FreeBSD$); #include dev/pci/pcireg.h #include dev/virtio/virtio.h -#include dev/virtio/virtio_config.h #include dev/virtio/virtqueue.h #include dev/virtio/pci/virtio_pci.h Modified: head/sys/dev/virtio/virtio.h == --- head/sys/dev/virtio/virtio.hMon Jun 16 04:16:31 2014 (r267521) +++ head/sys/dev/virtio/virtio.hMon Jun 16 04:25:04 2014 (r267522) @@ -30,6 +30,7 @@ #define _VIRTIO_H_ #include dev/virtio/virtio_ids.h +#include dev/virtio/virtio_config.h struct vq_alloc_info; Modified: head/sys/dev/virtio/virtio_config.h == --- head/sys/dev/virtio/virtio_config.h Mon Jun 16 04:16:31 2014 (r267521) +++ head/sys/dev/virtio/virtio_config.h Mon Jun 16 04:25:04 2014 (r267522) @@ -44,6 +44,12 @@ */ #define VIRTIO_F_NOTIFY_ON_EMPTY (1 24) +/* Support for indirect buffer descriptors. */ +#define VIRTIO_RING_F_INDIRECT_DESC(1 28) + +/* Support to suppress interrupt until specific index is reached. */ +#define VIRTIO_RING_F_EVENT_IDX(1 29) + /* * The guest should never negotiate this feature; it * is used to detect faulty drivers. Modified: head/sys/dev/virtio/virtqueue.c == --- head/sys/dev/virtio/virtqueue.c Mon Jun 16 04:16:31 2014 (r267521) +++ head/sys/dev/virtio/virtqueue.c Mon Jun 16 04:25:04 2014 (r267522) @@ -48,7 +48,6 @@ __FBSDID($FreeBSD$); #include sys/rman.h #include dev/virtio/virtio.h -#include dev/virtio/virtio_config.h #include dev/virtio/virtqueue.h #include dev/virtio/virtio_ring.h Modified: head/sys/dev/virtio/virtqueue.h == --- head/sys/dev/virtio/virtqueue.h Mon Jun 16 04:16:31 2014 (r267521) +++ head/sys/dev/virtio/virtqueue.h Mon Jun 16 04:25:04 2014 (r267522) @@ -32,12 +32,6 @@ struct virtqueue; struct sglist; -/* Support for indirect buffer descriptors. */ -#define VIRTIO_RING_F_INDIRECT_DESC(1 28) - -/* Support to suppress interrupt until specific index is reached. */ -#define VIRTIO_RING_F_EVENT_IDX(1 29) - /* Device callback for a virtqueue interrupt. */ typedef void virtqueue_intr_t(void *); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267523 - head/sys/dev/virtio/network
Author: bryanv Date: Mon Jun 16 04:29:28 2014 New Revision: 267523 URL: http://svnweb.freebsd.org/changeset/base/267523 Log: Make the feature negotiation code easier to follow MFC after:1 week Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c == --- head/sys/dev/virtio/network/if_vtnet.c Mon Jun 16 04:25:04 2014 (r267522) +++ head/sys/dev/virtio/network/if_vtnet.c Mon Jun 16 04:29:28 2014 (r267523) @@ -552,37 +552,38 @@ vtnet_negotiate_features(struct vtnet_so mask |= VTNET_TSO_FEATURES; if (vtnet_tunable_int(sc, lro_disable, vtnet_lro_disable)) mask |= VTNET_LRO_FEATURES; +#ifndef VTNET_LEGACY_TX if (vtnet_tunable_int(sc, mq_disable, vtnet_mq_disable)) mask |= VIRTIO_NET_F_MQ; -#ifdef VTNET_LEGACY_TX +#else mask |= VIRTIO_NET_F_MQ; #endif features = VTNET_FEATURES ~mask; sc-vtnet_features = virtio_negotiate_features(dev, features); - if (virtio_with_feature(dev, VTNET_LRO_FEATURES) == 0) - return; - if (virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF)) - return; - - /* -* LRO without mergeable buffers requires special care. This is not -* ideal because every receive buffer must be large enough to hold -* the maximum TCP packet, the Ethernet header, and the header. This -* requires up to 34 descriptors with MCLBYTES clusters. If we do -* not have indirect descriptors, LRO is disabled since the virtqueue -* will not contain very many receive buffers. -*/ - if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC) == 0) { - device_printf(dev, - LRO disabled due to both mergeable buffers and indirect - descriptors not negotiated\n); + if (virtio_with_feature(dev, VTNET_LRO_FEATURES) + virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF) == 0) { + /* +* LRO without mergeable buffers requires special care. This +* is not ideal because every receive buffer must be large +* enough to hold the maximum TCP packet, the Ethernet header, +* and the header. This requires up to 34 descriptors with +* MCLBYTES clusters. If we do not have indirect descriptors, +* LRO is disabled since the virtqueue will not contain very +* many receive buffers. +*/ + if (!virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) { + device_printf(dev, + LRO disabled due to both mergeable buffers and + indirect descriptors not negotiated\n); - features = ~VTNET_LRO_FEATURES; - sc-vtnet_features = virtio_negotiate_features(dev, features); - } else - sc-vtnet_flags |= VTNET_FLAG_LRO_NOMRG; + features = ~VTNET_LRO_FEATURES; + sc-vtnet_features = + virtio_negotiate_features(dev, features); + } else + sc-vtnet_flags |= VTNET_FLAG_LRO_NOMRG; + } } static void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267524 - head/sys/dev/virtio/network
Author: bryanv Date: Mon Jun 16 04:32:27 2014 New Revision: 267524 URL: http://svnweb.freebsd.org/changeset/base/267524 Log: Force two byte alignment for all control message headers The header structure consists of two 1-byte elements, but it must always be describable by a single SG entry. Note for consistency, specify the alignment everywhere, even if the structure has the appropriate natural alignment since it contains a uint16_t. Obtained from:DragonFlyBSD MFC after:1 week Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c == --- head/sys/dev/virtio/network/if_vtnet.c Mon Jun 16 04:29:28 2014 (r267523) +++ head/sys/dev/virtio/network/if_vtnet.c Mon Jun 16 04:32:27 2014 (r267524) @@ -3068,7 +3068,7 @@ vtnet_exec_ctrl_cmd(struct vtnet_softc * static int vtnet_ctrl_mac_cmd(struct vtnet_softc *sc, uint8_t *hwaddr) { - struct virtio_net_ctrl_hdr hdr; + struct virtio_net_ctrl_hdr hdr __aligned(2); struct sglist_seg segs[3]; struct sglist sg; uint8_t ack; @@ -3102,7 +3102,7 @@ vtnet_ctrl_mq_cmd(struct vtnet_softc *sc struct virtio_net_ctrl_mq mq; uint8_t pad2; uint8_t ack; - } s; + } s __aligned(2); int error; s.hdr.class = VIRTIO_NET_CTRL_MQ; @@ -3134,7 +3134,7 @@ vtnet_ctrl_rx_cmd(struct vtnet_softc *sc uint8_t onoff; uint8_t pad2; uint8_t ack; - } s; + } s __aligned(2); int error; KASSERT(sc-vtnet_flags VTNET_FLAG_CTRL_RX, @@ -3217,7 +3217,7 @@ vtnet_rx_filter(struct vtnet_softc *sc) static void vtnet_rx_filter_mac(struct vtnet_softc *sc) { - struct virtio_net_ctrl_hdr hdr; + struct virtio_net_ctrl_hdr hdr __aligned(2); struct vtnet_mac_filter *filter; struct sglist_seg segs[4]; struct sglist sg; @@ -3330,7 +3330,7 @@ vtnet_exec_vlan_filter(struct vtnet_soft uint16_t tag; uint8_t pad2; uint8_t ack; - } s; + } s __aligned(2); int error; s.hdr.class = VIRTIO_NET_CTRL_VLAN; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org