Re: svn commit: r269964 - head/sys/kern
Xin Li wrote this message on Sat, Sep 13, 2014 at 14:05 +0800: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On 9/13/14 1:22 PM, John-Mark Gurney wrote: > > Xin Li wrote this message on Sat, Sep 13, 2014 at 12:23 +0800: > >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 > >> > >> On 9/13/14 3:41 AM, Adrian Chadd wrote: > >>> Hi guys, > >>> > >>> Both r269963 and r269964 have broken the MIPS platforms with > >>> smaller amounts of RAM (< 64MB.) > >>> > >>> Sean noticed it and filed a bug: > >>> > >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193465 > >>> > >>> Can we please figure out what changed? Otherwise I'm going to > >>> revert these two changes until we figure out what happened. > >> > >> Could you please try if this would mitigate the issue? > >> > >> Index: sys/kern/kern_malloc.c > >> === > >> > >> > - - --- sys/kern/kern_malloc.c (revision 271494) > >> +++ sys/kern/kern_malloc.c (working copy) @@ -717,6 +717,8 > >> @@ kmeminit(void) * a given architecture. */ mem_size = > >> vm_cnt.v_page_count; + if (mem_size <= 32768) /* delphij > >> XXX 128MB */ + kmem_zmax = PAGE_SIZE; > >> > >> if (vm_kmem_size_scale < 1) vm_kmem_size_scale = > >> VM_KMEM_SIZE_SCALE; > >> > > > > Has more research been done on this? My 64MB AVILA board boots > > fine, and ath attaches fine... > > It's theoretically possible that my change brings a regression for > small system, as the larger allocation units now "caches" the > allocation instead of returning them immediately. Sean also confirms > that reverting the two changes only would fix the issue, so I think we > should use some autotune here. I agree that it could possibly bring a regression for small memory systems, but I'm not seeing that w/ mine... and it looks like we have zone draining in the case of low memory, though it looks like we don't have a "target" for how much memory to free, nor do we order which zones we should free from (like remembering where we stopped, so we don't flush all memory, or target zones/buckets)... I'm also concerned that your patch prevents people from using a larger max if they'd like by setting a tunable... Your patch just hard sets it, preventing the tunable to doing anything useful on these smaller systems, so if someone wants the additional zones, they'd need to modify the source... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271503 - head/sys/cam/ctl
Author: mav Date: Sat Sep 13 07:45:03 2014 New Revision: 271503 URL: http://svnweb.freebsd.org/changeset/base/271503 Log: Implement range checks between UNMAP and READ/WRITE commands. Before this change UNMAP completely blocked other I/Os while running. Now it blocks only colliding ones, slowing down others only due to ZFS locks collisions. Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_ser_table.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sat Sep 13 06:51:19 2014(r271502) +++ head/sys/cam/ctl/ctl.c Sat Sep 13 07:45:03 2014(r271503) @@ -390,7 +390,7 @@ static int ctl_inquiry_evpd_bdc(struct c static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); static int ctl_inquiry_std(struct ctl_scsiio *ctsio); -static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint32_t *len); +static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len); static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2); static ctl_action ctl_check_for_blockage(union ctl_io *pending_io, union ctl_io *ooa_io); @@ -5259,6 +5259,8 @@ ctl_data_submit_done(union ctl_io *io) void ctl_config_write_done(union ctl_io *io) { + uint8_t *buf; + /* * If the IO_CONT flag is set, we need to call the supplied * function to continue processing the I/O, instead of completing @@ -5278,9 +5280,13 @@ ctl_config_write_done(union ctl_io *io) * have data allocated, like write buffer, and commands that have * no data, like start/stop unit, we need to check here. */ - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT) - free(io->scsiio.kern_data_ptr, M_CTL); + if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) + buf = io->scsiio.kern_data_ptr; + else + buf = NULL; ctl_done(io); + if (buf) + free(buf, M_CTL); } /* @@ -6041,7 +6047,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) struct scsi_unmap *cdb; struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_header *hdr; - struct scsi_unmap_desc *buf, *end; + struct scsi_unmap_desc *buf, *end, *range; uint64_t lba; uint32_t num_blocks; int len, retval; @@ -6094,14 +6100,9 @@ ctl_unmap(struct ctl_scsiio *ctsio) buf = (struct scsi_unmap_desc *)(hdr + 1); end = buf + len / sizeof(*buf); - 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); - num_blocks = scsi_4btoul(buf->length); + for (range = buf; range < end; range++) { + lba = scsi_8btou64(range->lba); + num_blocks = scsi_4btoul(range->length); if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) || ((lba + num_blocks) < lba)) { ctl_set_lba_out_of_range(ctsio); @@ -6110,8 +6111,16 @@ ctl_unmap(struct ctl_scsiio *ctsio) } } - retval = lun->backend->config_write((union ctl_io *)ctsio); + mtx_lock(&lun->lun_lock); + 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; + ctl_check_blocked(lun); + mtx_unlock(&lun->lun_lock); + retval = lun->backend->config_write((union ctl_io *)ctsio); return (retval); } @@ -10795,7 +10804,7 @@ ctl_inquiry(struct ctl_scsiio *ctsio) * For known CDB types, parse the LBA and length. */ static int -ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint32_t *len) +ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len) { if (io->io_hdr.io_type != CTL_IO_SCSI) return (1); @@ -10925,6 +10934,11 @@ ctl_get_lba_len(union ctl_io *io, uint64 *len = scsi_4btoul(cdb->length); break; } + case UNMAP: { + *lba = 0; + *len = UINT64_MAX; + break; + } default: return (1); break; /* NOTREACHED */ @@ -10934,7 +10948,7 @@ ctl_get_lba_len(union ctl_io *io, uint64 } static ctl_action -ctl_extent_check_lba(uint64_t lba1, uint32_t len1, uint64_t lba2, uint32_t len2) +ctl_extent_check_lba(uint64_t lba1, uint64_t len1, uint64_t lba2, uint64_t len2) { uint64_t endlba1, endlba2; @@ -10948,19 +10962,53 @@ ctl_extent_check_lba(uint64_t lba1, uint return (CTL_ACTION_BLOCK); } +static int +ctl
svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Author: hselasky Date: Sat Sep 13 08:26:09 2014 New Revision: 271504 URL: http://svnweb.freebsd.org/changeset/base/271504 Log: Improve transmit sending offload, TSO, algorithm in general. The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. MFC after:1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxvar.h head/sys/dev/xen/netfront/netfront.c head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_var.h head/sys/net/if_vlan.c head/sys/netinet/tcp_output.c head/sys/ofed/drivers/net/mlx4/en_netdev.c Modified: head/sys/dev/oce/oce_if.c == --- head/sys/dev/oce/oce_if.c Sat Sep 13 07:45:03 2014(r271503) +++ head/sys/dev/oce/oce_if.c Sat Sep 13 08:26:09 2014(r271504) @@ -1731,7 +1731,10 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_baudrate = IF_Gbps(10); #if __FreeBSD_version >= 100 - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; + sc->ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( + 65535 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* bytes */, + OCE_MAX_TX_ELEMENTS /* maximum frag count */, + 12 /* 4K frag size */); #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); Modified: head/sys/dev/oce/oce_if.h == --- head/sys/dev/oce/oce_if.h Sat Sep 13 07:45:03 2014(r271503) +++ head/sys/dev/oce/oce_if.h Sat Sep 13 08:26:09 2014(r271504) @@ -152,7 +152,6 @@ extern int mp_ncpus;/* system's total #define OCE_MAX_TX_ELEMENTS29 #define OCE_MAX_TX_DESC1024 #define OCE_MAX_TX_SIZE65535 -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS0 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c == --- head/sys/dev/vmware/vmxnet3/if_vmx.cSat Sep 13 07:45:03 2014 (r271503) +++ head/sys/dev/vmware/vmxnet3/if_vmx.cSat Sep 13 08:26:09 2014 (r271504) @@ -1722,7 +1722,11 @@ vmxnet3_setup_interface(struct vmxnet3_s ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; - ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; + + ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( + 65535 - sizeof(struct ether_vlan_header) /* bytes */, + VMXNET3_TX_MAXSEGS /* maximum frag count */, + VMXNET3_TX_MAXSEGSHIFT /* frag size */); #ifdef VMXNET3_LEGACY_TX ifp->if_start = vmxnet3_start; Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h == --- head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Sep 13 07:45:03 2014 (r271503) +++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Sep 13 08:26:09 2014 (r271504) @@ -277,14 +277,13 @@ struct vmxnet3_softc { */ #define VMXNET3_TX_MAXSEGS 32 #define VMXNET3_TX_MAXSIZE (VMXNET3_TX_MAXSEGS * MCLBYTES) -#define VMXNET3_TSO_MAXSIZE \ -(VMXNET3_TX_MAXSIZE - sizeof(struct ether_vlan_header)) /* * Maximum support Tx segments size. The length field in the * Tx descriptor is 14 bits. */ -#define VMXNET3_TX_MAXSEGSIZE (1 << 14) +#define VMXNET3_TX_MAXSEGSHIFT 14 +#define VMXNET3_TX_MAXSEGSIZE (1 << VMXNET3_TX_MAXSEGSHIFT) /* * The maximum number of Rx segments we accept. When LRO is enabled, Modified: head/sys/dev/xen/netfront/netfront.c == --- head/sys/dev/xen/netfront/netfront.cSat Sep 13 07:45:03 2014 (r271503) +++ head/sys/dev/xen/netfront/netfront.cSat Sep 13 08:26:09 2014 (r271504) @@ -134,7 +134,6 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #defineMAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) -#defineNF_TSO_MAXBURST ((
svn commit: r271505 - in head: sys/cam/ctl usr.sbin/ctladm
Author: mav Date: Sat Sep 13 08:55:22 2014 New Revision: 271505 URL: http://svnweb.freebsd.org/changeset/base/271505 Log: Add "readcache" and "writecache" LUN options to control default behavior. Default values are "on". Disabling requires backend to support IO_DIRECT and IO_SYNC flags respectively, or some alternatives. Modified: head/sys/cam/ctl/ctl.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sat Sep 13 08:26:09 2014(r271504) +++ head/sys/cam/ctl/ctl.c Sat Sep 13 08:55:22 2014(r271505) @@ -4095,6 +4095,7 @@ ctl_init_page_index(struct ctl_lun *lun) int i; struct ctl_page_index *page_index; struct ctl_softc *softc; + const char *value; memcpy(&lun->mode_pages.index, page_index_template, sizeof(page_index_template)); @@ -4244,26 +4245,31 @@ ctl_init_page_index(struct ctl_lun *lun) break; } case SMS_CACHING_PAGE: { + struct scsi_caching_page *caching_page; if (page_index->subpage != SMS_SUBPAGE_PAGE_0) panic("invalid subpage value %d", page_index->subpage); - /* -* Defaults should be okay here, no calculations -* needed. -*/ - memcpy(&lun->mode_pages.caching_page[CTL_PAGE_CURRENT], + memcpy(&lun->mode_pages.caching_page[CTL_PAGE_DEFAULT], &caching_page_default, sizeof(caching_page_default)); memcpy(&lun->mode_pages.caching_page[ CTL_PAGE_CHANGEABLE], &caching_page_changeable, sizeof(caching_page_changeable)); - memcpy(&lun->mode_pages.caching_page[CTL_PAGE_DEFAULT], - &caching_page_default, - sizeof(caching_page_default)); memcpy(&lun->mode_pages.caching_page[CTL_PAGE_SAVED], &caching_page_default, sizeof(caching_page_default)); + caching_page = &lun->mode_pages.caching_page[ + CTL_PAGE_SAVED]; + value = ctl_get_opt(&lun->be_lun->options, "writecache"); + if (value != NULL && strcmp(value, "off") == 0) + caching_page->flags1 &= ~SCP_WCE; + value = ctl_get_opt(&lun->be_lun->options, "readcache"); + if (value != NULL && strcmp(value, "off") == 0) + caching_page->flags1 |= SCP_RCD; + memcpy(&lun->mode_pages.caching_page[CTL_PAGE_CURRENT], + &lun->mode_pages.caching_page[CTL_PAGE_SAVED], + sizeof(caching_page_default)); page_index->page_data = (uint8_t *)lun->mode_pages.caching_page; break; Modified: head/usr.sbin/ctladm/ctladm.8 == --- head/usr.sbin/ctladm/ctladm.8 Sat Sep 13 08:26:09 2014 (r271504) +++ head/usr.sbin/ctladm/ctladm.8 Sat Sep 13 08:55:22 2014 (r271505) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd July 9, 2014 +.Dd September 13, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -959,8 +959,12 @@ Setting to "on" allows EXTENDED COPY com other LUNs on this host, not accessible otherwise. This allows to offload copying between different iSCSI targets residing on the same host in trusted environments. +.It Va readcache +Set to "off", disables read caching for the LUN, if supported by the backend. .It Va unmap -Set to "on", enables UNMAP support for the LUN. +Set to "on", enables UNMAP support for the LUN, if supported by the backend. +.It Va writecache +Set to "off", disables write caching for the LUN, if supported by the backend. .El .Pp Options specific for block backend: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271506 - head/sys/dev/vt
Author: dumbbell Date: Sat Sep 13 09:33:37 2014 New Revision: 271506 URL: http://svnweb.freebsd.org/changeset/base/271506 Log: vt(4): Enclose vt_mouse_paste() prototype inside #ifndef SC_NO_CUTPASTE/#endif This fixes the build with sparc64 LINT for instance. Reported by: bz@ MFC after:3 days Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c == --- head/sys/dev/vt/vt_core.c Sat Sep 13 08:55:22 2014(r271505) +++ head/sys/dev/vt/vt_core.c Sat Sep 13 09:33:37 2014(r271506) @@ -162,7 +162,9 @@ static int vt_late_window_switch(struct static int vt_proc_alive(struct vt_window *); static void vt_resize(struct vt_device *); static void vt_update_static(void *); +#ifndef SC_NO_CUTPASTE static void vt_mouse_paste(void); +#endif SET_DECLARE(vt_drv_set, struct vt_driver); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271507 - in head: sys/cam/ctl usr.sbin/ctladm
Author: mav Date: Sat Sep 13 10:34:23 2014 New Revision: 271507 URL: http://svnweb.freebsd.org/changeset/base/271507 Log: Implement control over command reordering via options and control mode page. It allows to bypass range checks between UNMAP and READ/WRITE commands, which may introduce additional delays while waiting for UNMAP parameters. READ and WRITE commands are always processed in safe order since their range checks are almost free. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_ser_table.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sat Sep 13 09:33:37 2014(r271506) +++ head/sys/cam/ctl/ctl.c Sat Sep 13 10:34:23 2014(r271507) @@ -280,7 +280,7 @@ static struct scsi_control_page control_ /*page_code*/SMS_CONTROL_MODE_PAGE, /*page_length*/sizeof(struct scsi_control_page) - 2, /*rlec*/0, - /*queue_flags*/0, + /*queue_flags*/SCP_QUEUE_ALG_RESTRICTED, /*eca_and_aen*/0, /*flags4*/SCP_TAS, /*aen_holdoff_period*/{0, 0}, @@ -292,7 +292,7 @@ static struct scsi_control_page control_ /*page_code*/SMS_CONTROL_MODE_PAGE, /*page_length*/sizeof(struct scsi_control_page) - 2, /*rlec*/SCP_DSENSE, - /*queue_flags*/0, + /*queue_flags*/SCP_QUEUE_ALG_MASK, /*eca_and_aen*/0, /*flags4*/0, /*aen_holdoff_period*/{0, 0}, @@ -392,8 +392,8 @@ static int ctl_inquiry_evpd(struct ctl_s static int ctl_inquiry_std(struct ctl_scsiio *ctsio); static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len); static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2); -static ctl_action ctl_check_for_blockage(union ctl_io *pending_io, -union ctl_io *ooa_io); +static ctl_action ctl_check_for_blockage(struct ctl_lun *lun, +union ctl_io *pending_io, union ctl_io *ooa_io); static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io *starting_io); static int ctl_check_blocked(struct ctl_lun *lun); @@ -4275,27 +4275,31 @@ ctl_init_page_index(struct ctl_lun *lun) break; } case SMS_CONTROL_MODE_PAGE: { + struct scsi_control_page *control_page; if (page_index->subpage != SMS_SUBPAGE_PAGE_0) panic("invalid subpage value %d", page_index->subpage); - /* -* Defaults should be okay here, no calculations -* needed. -*/ - memcpy(&lun->mode_pages.control_page[CTL_PAGE_CURRENT], + memcpy(&lun->mode_pages.control_page[CTL_PAGE_DEFAULT], &control_page_default, sizeof(control_page_default)); memcpy(&lun->mode_pages.control_page[ CTL_PAGE_CHANGEABLE], &control_page_changeable, sizeof(control_page_changeable)); - memcpy(&lun->mode_pages.control_page[CTL_PAGE_DEFAULT], - &control_page_default, - sizeof(control_page_default)); memcpy(&lun->mode_pages.control_page[CTL_PAGE_SAVED], &control_page_default, sizeof(control_page_default)); + control_page = &lun->mode_pages.control_page[ + CTL_PAGE_SAVED]; + value = ctl_get_opt(&lun->be_lun->options, "reordering"); + if (value != NULL && strcmp(value, "unrestricted") == 0) { + control_page->queue_flags &= ~SCP_QUEUE_ALG_MASK; + control_page->queue_flags |= SCP_QUEUE_ALG_UNRESTRICTED; + } + memcpy(&lun->mode_pages.control_page[CTL_PAGE_CURRENT], + &lun->mode_pages.control_page[CTL_PAGE_SAVED], + sizeof(control_page_default)); page_index->page_data = (uint8_t *)lun->mode_pages.control_page; break; @@ -6189,65 +6193,13 @@ ctl_control_page_handler(struct ctl_scsi lun->flags &= ~CTL_LUN_SENSE_DESC; set_ua = 1; } - if (current_cp->queue_flags & SCP_QUEUE_DQUE) { - if (user_cp->queue_flags & SCP_QUEUE_DQUE) { -#ifdef NEEDTOPORT - csevent_log(CSC_CTL | CSC_SHELF_SW | - CTL_UNTAG_TO_UNTAG, -
svn commit: r271509 - head/sys/kern
Author: melifaro Date: Sat Sep 13 13:46:16 2014 New Revision: 271509 URL: http://svnweb.freebsd.org/changeset/base/271509 Log: Fix error handling in cpuset_setithread() introduced in r267716. Noted by: kib MFC after:1 week Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c == --- head/sys/kern/kern_cpuset.c Sat Sep 13 13:36:17 2014(r271508) +++ head/sys/kern/kern_cpuset.c Sat Sep 13 13:46:16 2014(r271509) @@ -731,6 +731,7 @@ cpuset_setithread(lwpid_t id, u_char cpu nset = uma_zalloc(cpuset_zone, M_WAITOK); rset = uma_zalloc(cpuset_zone, M_WAITOK); + cs_id = CPUSET_INVALID; CPU_ZERO(&mask); if (cpu == NOCPU) @@ -739,13 +740,14 @@ cpuset_setithread(lwpid_t id, u_char cpu CPU_SET(cpu, &mask); error = cpuset_which(CPU_WHICH_TID, id, &p, &td, &old_set); - if (((cs_id = alloc_unr(cpuset_unr)) == CPUSET_INVALID) || error != 0) + if (error != 0 || ((cs_id = alloc_unr(cpuset_unr)) == CPUSET_INVALID)) goto out; - thread_lock(td); + /* cpuset_which() returns with PROC_LOCK held. */ old_set = td->td_cpuset; if (cpu == NOCPU) { + /* * roll back to default set. We're not using cpuset_shadow() * here because we can fail CPU_SUBSET() check. This can happen @@ -759,7 +761,14 @@ cpuset_setithread(lwpid_t id, u_char cpu if (old_set->cs_id == 1 || (old_set->cs_id == CPUSET_INVALID && old_set->cs_parent->cs_id == 1)) { - /* Default mask, we need to use new root set */ + + /* +* Current set is either default (1) or +* shadowed version of default set. +* +* Allocate new root set to be able to shadow it +* with any mask. +*/ error = _cpuset_create(rset, cpuset_zero, &cpuset_zero->cs_mask, cs_id); if (error != 0) { @@ -772,18 +781,20 @@ cpuset_setithread(lwpid_t id, u_char cpu cs_id = CPUSET_INVALID; } else { /* Assume existing set was already allocated by previous call */ - parent = td->td_cpuset; + parent = old_set; old_set = NULL; } error = cpuset_shadow(parent, nset, &mask); applyset: if (error == 0) { + thread_lock(td); td->td_cpuset = nset; sched_affinity(td); + thread_unlock(td); nset = NULL; - } - thread_unlock(td); + } else + old_set = NULL; PROC_UNLOCK(p); if (old_set != NULL) cpuset_rel(old_set); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271524 - head/sbin/ifconfig
Author: melifaro Date: Sat Sep 13 16:04:55 2014 New Revision: 271524 URL: http://svnweb.freebsd.org/changeset/base/271524 Log: Do not try to read i2c info when no transceiver is present. MFC with: r270064 Sponsored by: Yandex LLC Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c == --- head/sbin/ifconfig/sfp.cSat Sep 13 16:02:43 2014(r271523) +++ head/sbin/ifconfig/sfp.cSat Sep 13 16:04:55 2014(r271524) @@ -764,11 +764,13 @@ sfp_status(int s, struct ifreq *ifr, int /* * Try to read byte 0 from i2c: * Both SFF-8472 and SFF-8436 use it as -* 'identification byte' +* 'identification byte'. +* Stop reading status on zero as value - +* this might happen in case of empty transceiver slot. */ id_byte = 0; ii.f(&ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&id_byte); - if (ii.error != 0) + if (ii.error != 0 || id_byte == 0) return; switch (id_byte) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271526 - in head/sys/cddl: boot/zfs contrib/opensolaris/uts/common/fs/zfs/sys
Author: delphij Date: Sat Sep 13 16:26:14 2014 New Revision: 271526 URL: http://svnweb.freebsd.org/changeset/base/271526 Log: MFV r271510: Enforce 4K as smallest indirect block size (previously the smallest indirect block size was 1K but that was never used). This makes some space estimates more accurate and uses less memory for some data structures. Illumos issue: 5141 zfs minimum indirect block size is 4K MFC after:2 weeks Modified: head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/boot/zfs/zfsimpl.h == --- head/sys/cddl/boot/zfs/zfsimpl.hSat Sep 13 16:07:43 2014 (r271525) +++ head/sys/cddl/boot/zfs/zfsimpl.hSat Sep 13 16:26:14 2014 (r271526) @@ -840,7 +840,7 @@ struct uberblock { * Fixed constants. */ #defineDNODE_SHIFT 9 /* 512 bytes */ -#defineDN_MIN_INDBLKSHIFT 10 /* 1k */ +#defineDN_MIN_INDBLKSHIFT 12 /* 4k */ #defineDN_MAX_INDBLKSHIFT 14 /* 16k */ #defineDNODE_BLOCK_SHIFT 14 /* 16k */ #defineDNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sat Sep 13 16:07:43 2014(r271525) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sat Sep 13 16:26:14 2014(r271526) @@ -56,7 +56,7 @@ extern "C" { * Fixed constants. */ #defineDNODE_SHIFT 9 /* 512 bytes */ -#defineDN_MIN_INDBLKSHIFT 10 /* 1k */ +#defineDN_MIN_INDBLKSHIFT 12 /* 4k */ #defineDN_MAX_INDBLKSHIFT 14 /* 16k */ #defineDNODE_BLOCK_SHIFT 14 /* 16k */ #defineDNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271527 - head/cddl/contrib/opensolaris/lib/libzfs/common
Author: delphij Date: Sat Sep 13 16:41:39 2014 New Revision: 271527 URL: http://svnweb.freebsd.org/changeset/base/271527 Log: MFV r271511: Use fnvlist_* to make code more readable. Illumos issue: 5135 zpool_find_import_cached() can use fnvlist_* MFC after:2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c == --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Sat Sep 13 16:26:14 2014(r271526) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Sat Sep 13 16:41:39 2014(r271527) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ @@ -1426,21 +1426,15 @@ zpool_find_import_cached(libzfs_handle_t elem = NULL; while ((elem = nvlist_next_nvpair(raw, elem)) != NULL) { - verify(nvpair_value_nvlist(elem, &src) == 0); + src = fnvpair_value_nvlist(elem); - verify(nvlist_lookup_string(src, ZPOOL_CONFIG_POOL_NAME, - &name) == 0); + name = fnvlist_lookup_string(src, ZPOOL_CONFIG_POOL_NAME); if (poolname != NULL && strcmp(poolname, name) != 0) continue; - verify(nvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID, - &this_guid) == 0); - if (guid != 0) { - verify(nvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID, - &this_guid) == 0); - if (guid != this_guid) - continue; - } + this_guid = fnvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID); + if (guid != 0 && guid != this_guid) + continue; if (pool_active(hdl, name, this_guid, &active) != 0) { nvlist_free(raw); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271528 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Sat Sep 13 16:51:23 2014 New Revision: 271528 URL: http://svnweb.freebsd.org/changeset/base/271528 Log: MFV r271512: Illumos issue: 5136 fix write throttle comment in dsl_pool.c MFC after:2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Sep 13 16:41:39 2014(r271527) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Sep 13 16:51:23 2014(r271528) @@ -116,8 +116,8 @@ int zfs_delay_min_dirty_percent = 60; /* * This controls how quickly the delay approaches infinity. - * Larger values cause it to delay less for a given amount of dirty data. - * Therefore larger values will cause there to be more dirty data for a + * Larger values cause it to delay more for a given amount of dirty data. + * Therefore larger values will cause there to be less dirty data for a * given throughput. * * For the smoothest delay, this value should be about 1 billion divided @@ -130,11 +130,6 @@ int zfs_delay_min_dirty_percent = 60; uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000; -/* - * XXX someday maybe turn these into #defines, and you have to tune it on a - * per-pool basis using zfs.conf. - */ - #ifdef __FreeBSD__ extern int zfs_vdev_async_write_active_max_dirty_percent; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Hi, Just for the record: * I'm glad you're tackling the TSO config stuff; * I'm not glad you're trying to pack it into a u_int rather than creating a new structure and adding fields for it. I appreciate that you're trying to rush this in before 10.1, but this is exactly why things shouldn't be rushed in before release deadlines. :) I'd really like to see this be broken out as a structure and the bit shifting games for what really shouldn't be packed into a u_int fixed. Otherwise this is going to be deadweight that has to persist past 11.0. Thanks, -a On 13 September 2014 01:26, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Sep 13 08:26:09 2014 > New Revision: 271504 > URL: http://svnweb.freebsd.org/changeset/base/271504 > > Log: > Improve transmit sending offload, TSO, algorithm in general. > > The current TSO limitation feature only takes the total number of > bytes in an mbuf chain into account and does not limit by the number > of mbufs in a chain. Some kinds of hardware is limited by two > factors. One is the fragment length and the second is the fragment > count. Both of these limits need to be taken into account when doing > TSO. Else some kinds of hardware might have to drop completely valid > mbuf chains because they cannot loaded into the given hardware's DMA > engine. The new way of doing TSO limitation has been made backwards > compatible as input from other FreeBSD developers and will use > defaults for values not set. > > MFC after:1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/dev/oce/oce_if.c > head/sys/dev/oce/oce_if.h > head/sys/dev/vmware/vmxnet3/if_vmx.c > head/sys/dev/vmware/vmxnet3/if_vmxvar.h > head/sys/dev/xen/netfront/netfront.c > head/sys/net/if.c > head/sys/net/if_lagg.c > head/sys/net/if_var.h > head/sys/net/if_vlan.c > head/sys/netinet/tcp_output.c > head/sys/ofed/drivers/net/mlx4/en_netdev.c > > Modified: head/sys/dev/oce/oce_if.c > == > --- head/sys/dev/oce/oce_if.c Sat Sep 13 07:45:03 2014(r271503) > +++ head/sys/dev/oce/oce_if.c Sat Sep 13 08:26:09 2014(r271504) > @@ -1731,7 +1731,10 @@ oce_attach_ifp(POCE_SOFTC sc) > sc->ifp->if_baudrate = IF_Gbps(10); > > #if __FreeBSD_version >= 100 > - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; > + sc->ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( > + 65535 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* bytes */, > + OCE_MAX_TX_ELEMENTS /* maximum frag count */, > + 12 /* 4K frag size */); > #endif > > ether_ifattach(sc->ifp, sc->macaddr.mac_addr); > > Modified: head/sys/dev/oce/oce_if.h > == > --- head/sys/dev/oce/oce_if.h Sat Sep 13 07:45:03 2014(r271503) > +++ head/sys/dev/oce/oce_if.h Sat Sep 13 08:26:09 2014(r271504) > @@ -152,7 +152,6 @@ extern int mp_ncpus;/* system's > total > #define OCE_MAX_TX_ELEMENTS29 > #define OCE_MAX_TX_DESC1024 > #define OCE_MAX_TX_SIZE65535 > -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) > #define OCE_MAX_RX_SIZE4096 > #define OCE_MAX_RQ_POSTS 255 > #define OCE_DEFAULT_PROMISCUOUS0 > > Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c > == > --- head/sys/dev/vmware/vmxnet3/if_vmx.cSat Sep 13 07:45:03 2014 > (r271503) > +++ head/sys/dev/vmware/vmxnet3/if_vmx.cSat Sep 13 08:26:09 2014 > (r271504) > @@ -1722,7 +1722,11 @@ vmxnet3_setup_interface(struct vmxnet3_s > ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; > ifp->if_init = vmxnet3_init; > ifp->if_ioctl = vmxnet3_ioctl; > - ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; > + > + ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( > + 65535 - sizeof(struct ether_vlan_header) /* bytes */, > + VMXNET3_TX_MAXSEGS /* maximum frag count */, > + VMXNET3_TX_MAXSEGSHIFT /* frag size */); > > #ifdef VMXNET3_LEGACY_TX > ifp->if_start = vmxnet3_start; > > Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h > == > --- head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Sep 13 07:45:03 2014 > (r271503) > +++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Sep 13 08:26:09 2014 > (r271504) > @@ -277,14 +277,13 @@ struct vmxnet3_softc { > */ > #define VMXNET3_TX_MAXSEGS 32 > #define VMXNET3_TX_MAXSIZE (VMXNET3_TX_MAXSEGS * MCLBYTES) > -#define VMXNET3_TSO_MAXSIZE \ > -(VMXNET3_TX_MAXSIZE - sizeof(struct ether_vlan_header)) > > /* > * Maximum support Tx segments size. The l
svn commit: r271532 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Sat Sep 13 17:24:56 2014 New Revision: 271532 URL: http://svnweb.freebsd.org/changeset/base/271532 Log: MFV r271515: Add a new tunable/sysctl, vfs.zfs.free_max_blocks, which can be used to limit how many blocks can be free'ed before a new transaction group is created. The default is no limit (infinite), but we should probably have a lower default, e.g. 100,000. With this limit, we can guard against the case where ZFS could run out of memory when destroying large numbers of blocks in a single transaction group, as the entire DDT needs to be brought into memory. Illumos issue: 5138 add tunable for maximum number of blocks freed in one txg MFC after:2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Sep 13 17:14:01 2014(r271531) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Sep 13 17:24:56 2014(r271532) @@ -90,6 +90,11 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_ &zfs_no_scrub_prefetch, 0, "Disable scrub prefetching"); enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE; +/* max number of blocks to free in a single TXG */ +uint64_t zfs_free_max_blocks = UINT64_MAX; +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, free_max_blocks, CTLFLAG_RWTUN, +&zfs_free_max_blocks, 0, "Maximum number of blocks to free in one TXG"); + #defineDSL_SCAN_IS_SCRUB_RESILVER(scn) \ ((scn)->scn_phys.scn_func == POOL_SCAN_SCRUB || \ @@ -1341,6 +1346,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s if (zfs_recover) return (B_FALSE); + if (scn->scn_visited_this_txg >= zfs_free_max_blocks) + return (B_TRUE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271533 - head/cddl/contrib/opensolaris/lib/libzpool/common
Author: delphij Date: Sat Sep 13 17:30:46 2014 New Revision: 271533 URL: http://svnweb.freebsd.org/changeset/base/271533 Log: MFV r271516: Enable debug printf's when ZFS_DEBUG or debug= is set. Illumos issue: 5134 if ZFS_DEBUG or debug= is set, libzpool should enable debug prints MFC after:2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c == --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Sat Sep 13 17:24:56 2014(r271532) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Sat Sep 13 17:30:46 2014(r271533) @@ -650,6 +650,9 @@ dprintf_setup(int *argc, char **argv) */ if (dprintf_find_string("on")) dprintf_print_all = 1; + + if (dprintf_string != NULL) + zfs_flags |= ZFS_DEBUG_DPRINTF; } int ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271534 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Sat Sep 13 17:36:34 2014 New Revision: 271534 URL: http://svnweb.freebsd.org/changeset/base/271534 Log: MFV r271517: In zil_claim, don't issue warning if we get EBUSY (inconsistent) when opening an objset, instead, ignore it silently. Illumos issue: 5140 message about "%recv could not be opened" is printed when booting after crash MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Sep 13 17:30:46 2014(r271533) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Sep 13 17:36:34 2014(r271534) @@ -644,7 +644,14 @@ zil_claim(const char *osname, void *txar error = dmu_objset_own(osname, DMU_OST_ANY, B_FALSE, FTAG, &os); if (error != 0) { - cmn_err(CE_WARN, "can't open objset for %s", osname); + /* +* EBUSY indicates that the objset is inconsistent, in which +* case it can not have a ZIL. +*/ + if (error != EBUSY) { + cmn_err(CE_WARN, "can't open objset for %s, error %u", + osname, error); + } return (0); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271535 - head/sys/conf
Author: ian Date: Sat Sep 13 17:38:26 2014 New Revision: 271535 URL: http://svnweb.freebsd.org/changeset/base/271535 Log: Make inclusion of fdt clock support conditional on fdt_clock, not just fdt. There are plenty of platforms that use fdt without needing the overhead of the new clock support routines. Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Sat Sep 13 17:36:34 2014(r271534) +++ head/sys/conf/files Sat Sep 13 17:38:26 2014(r271535) @@ -1377,8 +1377,8 @@ dev/fatm/if_fatm.coptional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.coptional sc splash -dev/fdt/fdt_clock.coptional fdt -dev/fdt/fdt_clock_if.m optional fdt +dev/fdt/fdt_clock.coptional fdt_clock +dev/fdt/fdt_clock_if.m optional fdt_clock dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271536 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Sat Sep 13 17:48:44 2014 New Revision: 271536 URL: http://svnweb.freebsd.org/changeset/base/271536 Log: MFV r271518: Correctly report hole at end of file. When asked to find a hole, the DMU sees that there are no holes in the object, and returns ESRCH. The ZPL interprets this as "no holes before the end of the file", and therefore inserts the "virtual hole" at the end of the file. Because DMU and ZPL have different ideas of where the end of an object/file is, we will end up returning the end of file, which is generally larger, instead of returning the end of object. The fix is to handle the "virtual hole" in the DMU. If no hole is found, the DMU will return a hole at the end of the file, rather than an error. Illumos issue: 5139 SEEK_HOLE failed to report a hole at end of file MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Sep 13 17:38:26 2014(r271535) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Sep 13 17:48:44 2014(r271536) @@ -1948,6 +1948,15 @@ dnode_next_offset(dnode_t *dn, int flags flags, offset, lvl, blkfill, txg); } + /* +* There's always a "virtual hole" at the end of the object, even +* if all BP's which physically exist are non-holes. +*/ + if ((flags & DNODE_FIND_HOLE) && error == ESRCH && txg == 0 && + minlvl == 1 && blkfill == 1 && !(flags & DNODE_FIND_BACKWARDS)) { + error = 0; + } + if (error == 0 && (flags & DNODE_FIND_BACKWARDS ? initial_offset < *offset : initial_offset > *offset)) error = SET_ERROR(ESRCH); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 13 17:38:26 2014(r271535) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 13 17:48:44 2014(r271536) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ @@ -266,16 +266,19 @@ zfs_holey(vnode_t *vp, u_long cmd, offse error = dmu_offset_next(zp->z_zfsvfs->z_os, zp->z_id, hole, &noff); - /* end of file? */ - if ((error == ESRCH) || (noff > file_sz)) { - /* -* Handle the virtual hole at the end of file. -*/ - if (hole) { - *off = file_sz; - return (0); - } + if (error == ESRCH) return (SET_ERROR(ENXIO)); + + /* +* We could find a hole that begins after the logical end-of-file, +* because dmu_offset_next() only works on whole blocks. If the +* EOF falls mid-block, then indicate that the "virtual hole" +* at the end of the file begins at the logical EOF, rather than +* at the end of the last block. +*/ + if (noff > file_sz) { + ASSERT(hole); + noff = file_sz; } if (noff < *off) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271538 - head/sys/net
Author: melifaro Date: Sat Sep 13 18:13:08 2014 New Revision: 271538 URL: http://svnweb.freebsd.org/changeset/base/271538 Log: Switch if_vlan(4) to use counter(9) using new if_get_counter api. Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c == --- head/sys/net/if_vlan.c Sat Sep 13 17:58:34 2014(r271537) +++ head/sys/net/if_vlan.c Sat Sep 13 18:13:08 2014(r271538) @@ -105,6 +105,11 @@ struct ifvlan { struct ifvlantrunk *ifv_trunk; struct ifnet *ifv_ifp; void*ifv_cookie; + counter_u64_t ifv_ipackets; + counter_u64_t ifv_ibytes; + counter_u64_t ifv_opackets; + counter_u64_t ifv_obytes; + counter_u64_t ifv_omcasts; #defineTRUNK(ifv) ((ifv)->ifv_trunk) #definePARENT(ifv) ((ifv)->ifv_trunk->parent) int ifv_pflags; /* special flags we have set on parent */ @@ -194,6 +199,7 @@ static void vlan_init(void *foo); static void vlan_input(struct ifnet *ifp, struct mbuf *m); static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr); static void vlan_qflush(struct ifnet *ifp); +static uint64_t vlan_get_counter(struct ifnet *ifp, ifnet_counter cnt); static int vlan_setflag(struct ifnet *ifp, int flag, int status, int (*func)(struct ifnet *, int)); static int vlan_setflags(struct ifnet *ifp, int status); @@ -945,6 +951,12 @@ vlan_clone_create(struct if_clone *ifc, return (ENOSPC); } SLIST_INIT(&ifv->vlan_mc_listhead); + /* Prepare pcpu counters */ + ifv->ifv_ipackets = counter_u64_alloc(M_WAITOK); + ifv->ifv_opackets = counter_u64_alloc(M_WAITOK); + ifv->ifv_ibytes = counter_u64_alloc(M_WAITOK); + ifv->ifv_obytes = counter_u64_alloc(M_WAITOK); + ifv->ifv_omcasts = counter_u64_alloc(M_WAITOK); ifp->if_softc = ifv; /* @@ -964,6 +976,7 @@ vlan_clone_create(struct if_clone *ifc, ifp->if_qflush = vlan_qflush; ifp->if_ioctl = vlan_ioctl; ifp->if_flags = VLAN_IFFLAGS; + ifp->if_get_counter = vlan_get_counter; ether_ifattach(ifp, eaddr); /* Now undo some of the damage... */ ifp->if_baudrate = 0; @@ -1006,6 +1019,11 @@ vlan_clone_destroy(struct if_clone *ifc, ether_ifdetach(ifp);/* first, remove it from system-wide lists */ vlan_unconfig(ifp); /* now it can be unconfigured and freed */ if_free(ifp); + counter_u64_free(ifv->ifv_ipackets); + counter_u64_free(ifv->ifv_opackets); + counter_u64_free(ifv->ifv_ibytes); + counter_u64_free(ifv->ifv_obytes); + counter_u64_free(ifv->ifv_omcasts); free(ifv, M_VLAN); ifc_free_unit(ifc, unit); @@ -1099,15 +1117,39 @@ vlan_transmit(struct ifnet *ifp, struct * Send it, precisely as ether_output() would have. */ error = (p->if_transmit)(p, m); - if (!error) { - ifp->if_opackets++; - ifp->if_omcasts += mcast; - ifp->if_obytes += len; + if (error == 0) { + counter_u64_add(ifv->ifv_opackets, 1); + counter_u64_add(ifv->ifv_obytes, len); + counter_u64_add(ifv->ifv_omcasts, 1); } else ifp->if_oerrors++; return (error); } +static uint64_t +vlan_get_counter(struct ifnet *ifp, ifnet_counter cnt) +{ + struct ifvlan *ifv; + + ifv = ifp->if_softc; + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (counter_u64_fetch(ifv->ifv_ipackets)); + case IFCOUNTER_OPACKETS: + return (counter_u64_fetch(ifv->ifv_opackets)); + case IFCOUNTER_IBYTES: + return (counter_u64_fetch(ifv->ifv_ibytes)); + case IFCOUNTER_OBYTES: + return (counter_u64_fetch(ifv->ifv_obytes)); + case IFCOUNTER_OMCASTS: + return (counter_u64_fetch(ifv->ifv_omcasts)); + default: + return (if_get_counter_compat(ifp, cnt)); + } + /* NOTREACHED */ +} + /* * The ifp->if_qflush entry point for vlan(4) is a no-op. */ @@ -1181,7 +1223,8 @@ vlan_input(struct ifnet *ifp, struct mbu TRUNK_RUNLOCK(trunk); m->m_pkthdr.rcvif = ifv->ifv_ifp; - ifv->ifv_ifp->if_ipackets++; + counter_u64_add(ifv->ifv_ipackets, 1); + counter_u64_add(ifv->ifv_ibytes, m->m_pkthdr.len); /* Pass it back through the parent's input routine. */ (*ifp->if_input)(ifv->ifv_ifp, m); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271539 - in head/usr.sbin/bsdinstall: partedit scripts
Author: nwhitehorn Date: Sat Sep 13 18:24:54 2014 New Revision: 271539 URL: http://svnweb.freebsd.org/changeset/base/271539 Log: Add ZFS support to the bsdinstall partition editor and sade. Submitted by: Kurt Lidl (original version) MFC after:6 weeks Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c head/usr.sbin/bsdinstall/partedit/part_wizard.c head/usr.sbin/bsdinstall/partedit/partedit.c head/usr.sbin/bsdinstall/partedit/partedit.h head/usr.sbin/bsdinstall/partedit/partedit_generic.c head/usr.sbin/bsdinstall/partedit/partedit_pc98.c head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c head/usr.sbin/bsdinstall/partedit/partedit_x86.c head/usr.sbin/bsdinstall/partedit/sade.8 head/usr.sbin/bsdinstall/partedit/scripted.c head/usr.sbin/bsdinstall/scripts/config head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c == --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sat Sep 13 18:13:08 2014(r271538) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sat Sep 13 18:24:54 2014(r271539) @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -119,6 +120,53 @@ newfs_command(const char *fstype, char * else if (strcmp(items[i].name, "TRIM") == 0) strcat(command, "-t "); } + } else if (strcmp(fstype, "freebsd-zfs") == 0) { + int i; + DIALOG_LISTITEM items[] = { + {"fletcher4", "checksum algorithm: fletcher4", + "Use fletcher4 for data integrity checking. " + "(default)", 1 }, + {"fletcher2", "checksum algorithm: fletcher2", + "Use fletcher2 for data integrity checking. " + "(not recommended)", 0 }, + {"sha256", "checksum algorithm: sha256", + "Use sha256 for data integrity checking. " + "(not recommended)", 0 }, + {"atime", "Update atimes for files", + "Disable atime update", 0 }, + }; + + if (!use_default) { + int choice; + choice = dlg_checklist("ZFS Options", "", 0, 0, 0, + sizeof(items)/sizeof(items[0]), items, NULL, + FLAG_CHECK, &i); + if (choice == 1) /* Cancel */ + return; + } + + strcpy(command, "zpool create -f -m none "); + if (getenv("BSDINSTALL_TMPBOOT") != NULL) { + char zfsboot_path[MAXPATHLEN]; + sprintf(zfsboot_path, "%s/zfs", + getenv("BSDINSTALL_TMPBOOT")); + mkdir(zfsboot_path, S_IRWXU | S_IRGRP | S_IXGRP | + S_IROTH | S_IXOTH); + sprintf(command, "%s -o cachefile=%s/zpool.cache ", + command, zfsboot_path); + } + for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) { + if (items[i].state == 0) + continue; + if (strcmp(items[i].name, "fletcher4") == 0) + strcat(command, "-O checksum=fletcher4 "); + else if (strcmp(items[i].name, "fletcher2") == 0) + strcat(command, "-O checksum=fletcher2 "); + else if (strcmp(items[i].name, "sha256") == 0) + strcat(command, "-O checksum=sha256 "); + else if (strcmp(items[i].name, "atime") == 0) + strcat(command, "-O atime=off "); + } } else if (strcmp(fstype, "fat32") == 0 || strcmp(fstype, "efi") == 0) { int i; DIALOG_LISTITEM items[] = { @@ -329,7 +377,7 @@ gpart_bootcode(struct ggeom *gp) } static void -gpart_partcode(struct gprovider *pp) +gpart_partcode(struct gprovider *pp, const char *fstype) { struct gconfig *gc; const char *scheme; @@ -344,7 +392,7 @@ gpart_partcode(struct gprovider *pp) } /* Make sure this partition scheme needs partcode on this platform */ - if (partcode_path(scheme) == NULL) + if (partcode_path(scheme, fstype) == NULL) return; LIST_FOREACH(gc, &pp->lg_config, lg_config) { @@ -356,7 +404,7 @@ gpart_partcode(struct gprovider *pp) /* Shell out to gpart for partcode for now */ sprintf(command, "gpart bootcode -p %s -i %s %s", - partcode_path(scheme), indexstr, pp->lg_geom->lg_na
svn commit: r271540 - in head/sys: fs/ext2fs ufs/ffs
Author: alc Date: Sat Sep 13 18:26:13 2014 New Revision: 271540 URL: http://svnweb.freebsd.org/changeset/base/271540 Log: We don't need an exclusive object lock on the expected execution path through {ext2,ffs}_getpages(). Reviewed by: kib, pfg MFC after:6 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/fs/ext2fs/ext2_vnops.c head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c == --- head/sys/fs/ext2fs/ext2_vnops.c Sat Sep 13 18:24:54 2014 (r271539) +++ head/sys/fs/ext2fs/ext2_vnops.c Sat Sep 13 18:26:13 2014 (r271540) @@ -2074,19 +2074,25 @@ ext2_getpages(struct vop_getpages_args * vm_page_t mreq; int pcount; - pcount = round_page(ap->a_count) / PAGE_SIZE; mreq = ap->a_m[ap->a_reqpage]; /* +* Since the caller has busied the requested page, that page's valid +* field will not be changed by other threads. +*/ + vm_page_assert_xbusied(mreq); + + /* * if ANY DEV_BSIZE blocks are valid on a large filesystem block, * then the entire page is valid. Since the page may be mapped, * user programs might reference data beyond the actual end of file * occuring within the page. We have to zero that data. */ - VM_OBJECT_WLOCK(mreq->object); if (mreq->valid) { + VM_OBJECT_WLOCK(mreq->object); if (mreq->valid != VM_PAGE_BITS_ALL) vm_page_zero_invalid(mreq, TRUE); + pcount = round_page(ap->a_count) / PAGE_SIZE; for (i = 0; i < pcount; i++) { if (i != ap->a_reqpage) { vm_page_lock(ap->a_m[i]); @@ -2097,7 +2103,6 @@ ext2_getpages(struct vop_getpages_args * VM_OBJECT_WUNLOCK(mreq->object); return VM_PAGER_OK; } - VM_OBJECT_WUNLOCK(mreq->object); return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, Modified: head/sys/ufs/ffs/ffs_vnops.c == --- head/sys/ufs/ffs/ffs_vnops.cSat Sep 13 18:24:54 2014 (r271539) +++ head/sys/ufs/ffs/ffs_vnops.cSat Sep 13 18:26:13 2014 (r271540) @@ -857,19 +857,25 @@ ffs_getpages(ap) vm_page_t mreq; int pcount; - pcount = round_page(ap->a_count) / PAGE_SIZE; mreq = ap->a_m[ap->a_reqpage]; /* +* Since the caller has busied the requested page, that page's valid +* field will not be changed by other threads. +*/ + vm_page_assert_xbusied(mreq); + + /* * if ANY DEV_BSIZE blocks are valid on a large filesystem block, * then the entire page is valid. Since the page may be mapped, * user programs might reference data beyond the actual end of file * occuring within the page. We have to zero that data. */ - VM_OBJECT_WLOCK(mreq->object); if (mreq->valid) { + VM_OBJECT_WLOCK(mreq->object); if (mreq->valid != VM_PAGE_BITS_ALL) vm_page_zero_invalid(mreq, TRUE); + pcount = round_page(ap->a_count) / PAGE_SIZE; for (i = 0; i < pcount; i++) { if (i != ap->a_reqpage) { vm_page_lock(ap->a_m[i]); @@ -880,7 +886,6 @@ ffs_getpages(ap) VM_OBJECT_WUNLOCK(mreq->object); return VM_PAGER_OK; } - VM_OBJECT_WUNLOCK(mreq->object); return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271543 - in head: share/man/man4 usr.bin/iscsictl usr.sbin/iscsid
Author: allanjude (doc committer) Date: Sat Sep 13 18:40:12 2014 New Revision: 271543 URL: http://svnweb.freebsd.org/changeset/base/271543 Log: Add the new iscsi(4) man page Cross reference it from iscsid(8) and iscsictl(8) Reviewed by: trasz Approved by: bcr (mentor), wblock (mentor) Sponsored by: ScaleEngine Inc. CR: https://reviews.freebsd.org/D741 Added: head/share/man/man4/iscsi.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/usr.bin/iscsictl/iscsictl.8 head/usr.sbin/iscsid/iscsid.8 Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileSat Sep 13 18:34:56 2014 (r271542) +++ head/share/man/man4/MakefileSat Sep 13 18:40:12 2014 (r271543) @@ -206,6 +206,7 @@ MAN=aac.4 \ ipw.4 \ ipwfw.4 \ isci.4 \ + iscsi.4 \ iscsi_initiator.4 \ ismt.4 \ isp.4 \ Added: head/share/man/man4/iscsi.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/iscsi.4 Sat Sep 13 18:40:12 2014(r271543) @@ -0,0 +1,111 @@ +.\" Copyright (c) 2014 Edward Tomasz Napierala +.\" 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 September 11, 2014 +.Dt ISCSI 4 +.Os +.Sh NAME +.Nm iscsi +.Nd iSCSI initiator +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iscsi" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +iscsi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +subsystem provides the kernel component of an iSCSI initiator. +The initiator is the iSCSI client, which connects to an iSCSI target, +providing local access to a remote block device. +The userland component is provided by +.Xr iscsid 8 +and both the kernel and userland are configured using +.Xr iscsictl 8 . +The +.Nm +subsystem is responsible for implementing the +.Qq Full Feature Phase +of the iSCSI protocol. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va kern.iscsi.ping_timeout +The number of seconds to wait for the target to respond to a NOP-Out +PDU. +In the event that there is no response within that time the session gets +forcibly restarted. +.It Va kern.iscsi.iscsid_timeout +The number of seconds to wait for +.Xr ctld 8 +to establish a session. +After that time +.Nm +will abort and retry. +.It Va kern.iscsi.login_timeout +The number of seconds to wait for a login attempt to succeed. +After that time +.Nm +will abort and retry. +.It Va kern.iscsi.maxtags +The maximum number of outstanding IO requests. +.It Va kern.iscsi.fail_on_disconnection +Controls the behavior after an iSCSI connection has been dropped due to +network problems. +When set to 1, a dropped connection causes the iSCSI device nodes +to be destroyed. +After reconnecting, they will be created again. +By default, the device nodes are left intact. +While the connection is down all input/output operations are suspended, to be +retried after the connection is reestablished. +.El +.Sh SEE ALSO +.Xr iscsi.conf 5 , +.Xr iscsictl 8 , +.Xr iscsid 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +subsystem was developed by +.An Edward Tomasz Napierala Aq Mt tr...@freebsd.org +under sponsorship from the
svn commit: r271544 - head/sys/net
Author: melifaro Date: Sat Sep 13 18:41:24 2014 New Revision: 271544 URL: http://svnweb.freebsd.org/changeset/base/271544 Log: Switch if_vlan(4) to rmlock. MFC after:2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c == --- head/sys/net/if_vlan.c Sat Sep 13 18:40:12 2014(r271543) +++ head/sys/net/if_vlan.c Sat Sep 13 18:41:24 2014(r271544) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -84,7 +84,7 @@ LIST_HEAD(ifvlanhead, ifvlan); struct ifvlantrunk { struct ifnet *parent;/* parent interface of this trunk */ - struct rwlock rw; + struct rmlock lock; #ifdef VLAN_ARRAY #defineVLAN_ARRAY_SIZE (EVL_VLID_MASK + 1) struct ifvlan *vlans[VLAN_ARRAY_SIZE]; /* static table */ @@ -175,14 +175,15 @@ static struct sx ifv_lock; #defineVLAN_LOCK_ASSERT() sx_assert(&ifv_lock, SA_LOCKED) #defineVLAN_LOCK() sx_xlock(&ifv_lock) #defineVLAN_UNLOCK() sx_xunlock(&ifv_lock) -#defineTRUNK_LOCK_INIT(trunk) rw_init(&(trunk)->rw, vlanname) -#defineTRUNK_LOCK_DESTROY(trunk) rw_destroy(&(trunk)->rw) -#defineTRUNK_LOCK(trunk) rw_wlock(&(trunk)->rw) -#defineTRUNK_UNLOCK(trunk) rw_wunlock(&(trunk)->rw) -#defineTRUNK_LOCK_ASSERT(trunk) rw_assert(&(trunk)->rw, RA_WLOCKED) -#defineTRUNK_RLOCK(trunk) rw_rlock(&(trunk)->rw) -#defineTRUNK_RUNLOCK(trunk)rw_runlock(&(trunk)->rw) -#defineTRUNK_LOCK_RASSERT(trunk) rw_assert(&(trunk)->rw, RA_RLOCKED) +#defineTRUNK_LOCK_INIT(trunk) rm_init(&(trunk)->lock, vlanname) +#defineTRUNK_LOCK_DESTROY(trunk) rm_destroy(&(trunk)->lock) +#defineTRUNK_LOCK(trunk) rm_wlock(&(trunk)->lock) +#defineTRUNK_UNLOCK(trunk) rm_wunlock(&(trunk)->lock) +#defineTRUNK_LOCK_ASSERT(trunk) rm_assert(&(trunk)->lock, RA_WLOCKED) +#defineTRUNK_RLOCK(trunk) rm_rlock(&(trunk)->lock, &tracker) +#defineTRUNK_RUNLOCK(trunk)rm_runlock(&(trunk)->lock, &tracker) +#defineTRUNK_LOCK_RASSERT(trunk) rm_assert(&(trunk)->lock, RA_RLOCKED) +#defineTRUNK_LOCK_READER struct rm_priotracker tracker #ifndef VLAN_ARRAY static void vlan_inithash(struct ifvlantrunk *trunk); @@ -687,6 +688,7 @@ vlan_devat(struct ifnet *ifp, uint16_t v { struct ifvlantrunk *trunk; struct ifvlan *ifv; + TRUNK_LOCK_READER; trunk = ifp->if_vlantrunk; if (trunk == NULL) @@ -1163,6 +1165,7 @@ vlan_input(struct ifnet *ifp, struct mbu { struct ifvlantrunk *trunk = ifp->if_vlantrunk; struct ifvlan *ifv; + TRUNK_LOCK_READER; uint16_t vid; KASSERT(trunk != NULL, ("%s: no trunk", __func__)); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271545 - in head/etc: . rc.d
Author: hrs Date: Sat Sep 13 18:54:15 2014 New Revision: 271545 URL: http://svnweb.freebsd.org/changeset/base/271545 Log: Do not set net.inet.ip.{sourceroute,accept_sourceroute} in a vnet jail. The following warnings were displayed: sysctl: net.inet.ip.sourceroute=0: Operation not permitted sysctl: net.inet.ip.accept_sourceroute=0: Operation not permitted Modified: head/etc/rc.d/routing head/etc/rc.subr Modified: head/etc/rc.d/routing == --- head/etc/rc.d/routing Sat Sep 13 18:41:24 2014(r271544) +++ head/etc/rc.d/routing Sat Sep 13 18:54:15 2014(r271545) @@ -326,20 +326,22 @@ options_inet() ${SYSCTL} net.inet.ip.forwarding=0 > /dev/null fi - if checkyesno forward_sourceroute; then - ropts_init inet - echo -n ' do source routing=YES' - ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null - else - ${SYSCTL} net.inet.ip.sourceroute=0 > /dev/null - fi - - if checkyesno accept_sourceroute; then - ropts_init inet - echo -n ' accept source routing=YES' - ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null - else - ${SYSCTL} net.inet.ip.accept_sourceroute=0 > /dev/null + if ! check_jail vnet; then + if checkyesno forward_sourceroute; then + ropts_init inet + echo -n ' do source routing=YES' + ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null + else + ${SYSCTL} net.inet.ip.sourceroute=0 > /dev/null + fi + + if checkyesno accept_sourceroute; then + ropts_init inet + echo -n ' accept source routing=YES' + ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null + else + ${SYSCTL} net.inet.ip.accept_sourceroute=0 > /dev/null + fi fi if checkyesno arpproxy_all; then Modified: head/etc/rc.subr == --- head/etc/rc.subrSat Sep 13 18:41:24 2014(r271544) +++ head/etc/rc.subrSat Sep 13 18:54:15 2014(r271545) @@ -1966,6 +1966,22 @@ check_required_after() return 0 } +# check_jail mib +# Return true if security.jail.$mib exists and set to 1. + +check_jail() +{ + local _mib _v + + _mib=$1 + if _v=$(${SYSCTL_N} "security.jail.$_mib" 2> /dev/null); then + case $_v in + 1) return 0;; + esac + fi + return 1 +} + # check_kern_features mib # Return existence of kern.features.* sysctl MIB as true or # false. The result will be cached in $_rc_cache_kern_features_ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271546 - in head/sys: conf dev/fdt
Author: ian Date: Sat Sep 13 19:03:32 2014 New Revision: 271546 URL: http://svnweb.freebsd.org/changeset/base/271546 Log: Create an interface and support routines for drivers that handle IO pin multiplexing and configuration based on FDT data. Reviewed by: imp Added: head/sys/dev/fdt/fdt_pinctrl.c (contents, props changed) head/sys/dev/fdt/fdt_pinctrl.h (contents, props changed) head/sys/dev/fdt/fdt_pinctrl_if.m (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Sat Sep 13 18:54:15 2014(r271545) +++ head/sys/conf/files Sat Sep 13 19:03:32 2014(r271546) @@ -1377,9 +1377,11 @@ dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.coptional sc splash -dev/fdt/fdt_clock.coptional fdt_clock -dev/fdt/fdt_clock_if.m optional fdt_clock +dev/fdt/fdt_clock.coptional fdt fdt_clock +dev/fdt/fdt_clock_if.m optional fdt fdt_clock dev/fdt/fdt_common.c optional fdt +dev/fdt/fdt_pinctrl.c optional fdt fdt_pinctrl +dev/fdt/fdt_pinctrl_if.m optional fdt fdt_pinctrl dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "$S/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE}" Added: head/sys/dev/fdt/fdt_pinctrl.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_pinctrl.c Sat Sep 13 19:03:32 2014 (r271546) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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$ + */ + +#include +#include + +#include +#include + +#include "fdt_pinctrl_if.h" + +#include +#include + +int +fdt_pinctrl_configure(device_t client, u_int index) +{ + device_t pinctrl; + phandle_t *configs; + int i, nconfigs; + char name[16]; + + snprintf(name, sizeof(name), "pinctrl-%u", index); + nconfigs = OF_getprop_alloc(ofw_bus_get_node(client), name, + sizeof(*configs), (void **)&configs); + if (nconfigs < 0) + return (ENOENT); + if (nconfigs == 0) + return (0); /* Empty property is documented as valid. */ + for (i = 0; i < nconfigs; i++) { + if ((pinctrl = OF_device_from_xref(configs[i])) != NULL) + FDT_PINCTRL_CONFIGURE(pinctrl, configs[i]); + } + free(configs, M_OFWPROP); + return (0); +} + +int +fdt_pinctrl_configure_by_name(device_t client, const char * name) +{ + char * names; + int i, offset, nameslen; + + nameslen = OF_getprop_alloc(ofw_bus_get_node(client), "pinctrl-names", + sizeof(*names), (void **)&names); + if (nameslen <= 0) + return (ENOENT); + for (i = 0, offset = 0; offset < nameslen; i++) { + if (strcmp(name, &names[offset]) == 0) + break; + offset += strlen(&names[offset]) + 1; + } + free(names, M_OFWPROP); + if (offset < nameslen) + return (fdt_pinctrl_configure(client, i)); + else + return (ENOENT); +} + +static int +pinctrl_register_children(device_t pinctrl, phandle_t parent, +const char *pinprop) +{ + phandle_t node; + + /* +* Recursively descend from parent, looking for nodes that have the +* given
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
On 09/13/14 18:54, Adrian Chadd wrote: Hi, Just for the record: * I'm glad you're tackling the TSO config stuff; * I'm not glad you're trying to pack it into a u_int rather than creating a new structure and adding fields for it. I appreciate that you're trying to rush this in before 10.1, but this is exactly why things shouldn't be rushed in before release deadlines. :) I'd really like to see this be broken out as a structure and the bit shifting games for what really shouldn't be packed into a u_int fixed. Otherwise this is going to be deadweight that has to persist past 11.0. Hi Adrian, I can make that change for -current, making the new structure and such. This change was intended for 10 where there is only one u_int for this information. Or do you want me to change that in 10 too? --HPS ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271548 - head/sys/arm/at91
Author: ian Date: Sat Sep 13 19:59:16 2014 New Revision: 271548 URL: http://svnweb.freebsd.org/changeset/base/271548 Log: Convert the at91_pinctrl driver to use the new fdt_pinctrl interface. Modified: head/sys/arm/at91/at91_pinctrl.c head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/at91_pinctrl.c == --- head/sys/arm/at91/at91_pinctrl.cSat Sep 13 19:37:11 2014 (r271547) +++ head/sys/arm/at91/at91_pinctrl.cSat Sep 13 19:59:16 2014 (r271548) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -250,6 +251,8 @@ at91_pinctrl_attach(device_t dev) device_set_ivars(cdev, di); } + fdt_pinctrl_register(dev, "atmel,pins"); + return (bus_generic_attach(dev)); } @@ -370,93 +373,70 @@ pinctrl_print_child(device_t bus, device const char *periphs[] = {"gpio", "periph A", "periph B", "periph C", "periph D", "periph E" }; -static void -pinctrl_walk_tree(device_t bus, phandle_t node) +struct pincfg { + uint32_t unit; + uint32_t pin; + uint32_t periph; + uint32_t flags; +}; + +static int +pinctrl_configure_pins(device_t bus, phandle_t cfgxref) { struct pinctrl_softc *sc; - char status[10]; + struct pincfg *cfg, *cfgdata; char name[32]; - phandle_t pinctrl[32], pins[32 * 4], scratch; - ssize_t len, npins; - int i, j; + phandle_t node; + ssize_t npins; + int i; sc = device_get_softc(bus); - for (node = OF_child(node); node > 0; node = OF_peer(node)) { - pinctrl_walk_tree(bus, node); - memset(status, 0, sizeof(status)); - memset(name, 0, sizeof(name)); - OF_getprop(node, "status", status, sizeof(status)); - OF_getprop(node, "name", name, sizeof(name)); - if (strcmp(status, "okay") != 0) { -// printf("pinctrl: skipping node %s status %s\n", name, -// status); - continue; - } - len = OF_getencprop(node, "pinctrl-0", pinctrl, sizeof(pinctrl)); - if (len <= 0) { -// printf("pinctrl: skipping node %s no pinctrl-0\n", -// name, status); - continue; - } - len /= sizeof(phandle_t); - printf("pinctrl: Found active node %s\n", name); - for (i = 0; i < len; i++) { - scratch = OF_node_from_xref(pinctrl[i]); - npins = OF_getencprop(scratch, "atmel,pins", pins, - sizeof(pins)); - if (npins <= 0) { - printf("We're doing it wrong %s\n", name); - continue; - } - memset(name, 0, sizeof(name)); - OF_getprop(scratch, "name", name, sizeof(name)); - npins /= (4 * 4); - printf("> need to cope with %d more pins for %s\n", - npins, name); - for (j = 0; j < npins; j++) { - uint32_t unit = pins[j * 4]; - uint32_t pin = pins[j * 4 + 1]; - uint32_t periph = pins[j * 4 + 2]; - uint32_t flags = pins[j * 4 + 3]; - uint32_t pio; - - pio = (0xfff & sc->ranges[0].bus) + - 0x200 * unit; - printf("P%c%d %s %#x\n", unit + 'A', pin, - periphs[periph], flags); - switch (periph) { - case 0: - at91_pio_use_gpio(pio, 1u << pin); - at91_pio_gpio_pullup(pio, 1u << pin, - !!(flags & 1)); - at91_pio_gpio_high_z(pio, 1u << pin, - !!(flags & 2)); - at91_pio_gpio_set_deglitch(pio, - 1u << pin, !!(flags & 4)); -// at91_pio_gpio_pulldown(pio, 1u << pin, -// !!(flags & 8)); -// at91_pio_gpio_dis_schmidt(pio, -// 1u << pin, !!(flags & 16)); - break; - case 1: - at91_pio_use_periph_a(pio, 1u << pin, - flags); -
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Hans Petter Selasky wrote: > On 09/13/14 18:54, Adrian Chadd wrote: > > Hi, > > > > Just for the record: > > > > * I'm glad you're tackling the TSO config stuff; > > * I'm not glad you're trying to pack it into a u_int rather than > > creating a new structure and adding fields for it. > > > > I appreciate that you're trying to rush this in before 10.1, but > > this > > is exactly why things shouldn't be rushed in before release > > deadlines. > > :) > > > > I'd really like to see this be broken out as a structure and the > > bit > > shifting games for what really shouldn't be packed into a u_int > > fixed. > > Otherwise this is going to be deadweight that has to persist past > > 11.0. > > > > Hi Adrian, > > I can make that change for -current, making the new structure and > such. > This change was intended for 10 where there is only one u_int for > this > information. Or do you want me to change that in 10 too? > Well, there are spare fields (if_ispare[4]) in struct ifnet that I believe can be used for new u_ints when MFC'ng a patch that adds fields to struct ifnet in head. (If I have this wrong, someone please correct me.) I'll admit I don't really see an advantage to defining a structure vs just defining a couple of additional u_ints, but so long as the structure doesn't cause alignment issues for any arch, I don't see a problem with a structure. I tend to agree with Adrian that this shouldn't be rushed. (I, personally, think that if_hw_tsomax was poorly chosen, but that is already in use, so I think we need to add to that and not replace it.) I also hope that your testing has included quite a bit of activity on an NFS mount using TSO and the default 64K rsize, wsize, since that is going to generate a bunch of 35 mbuf transmit fragment lists and there is an edge case where the total data length excluding ethernet header is just under 64K (by less than the ethernet header length) where the list must be split by tcp_output() to avoid disaster. rick > --HPS > > > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
On Sat, 13 Sep 2014, Rick Macklem wrote: Well, there are spare fields (if_ispare[4]) in struct ifnet that I believe can be used for new u_ints when MFC'ng a patch that adds fields to struct ifnet in head. (If I have this wrong, someone please correct me.) In my notes from a few years ago on KBIs, it looked like we could potentially convert ifnet from "only use spares" to "OK to append to the structure in a stable branch". It used to be that ifnet was embedded in driver softcs, and so ifnet changes broke compiled driver modules, but this is no longer the case. A careful review might suggest to us that it's OK to simply add the new fields we want to the end, but need to do that review before assuming it. Robert ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271549 - head/release
Author: nwhitehorn Date: Sat Sep 13 20:09:02 2014 New Revision: 271549 URL: http://svnweb.freebsd.org/changeset/base/271549 Log: Create /tmp/bsdinstall_etc even if we aren't starting the installer so that dhclient can write resolv.conf when used from the live environment. PR: 176078 MFC after:3 days Modified: head/release/rc.local Modified: head/release/rc.local == --- head/release/rc.local Sat Sep 13 19:59:16 2014(r271548) +++ head/release/rc.local Sat Sep 13 20:09:02 2014(r271549) @@ -10,6 +10,9 @@ MACHINE=`uname -m` +# resolv.conf from DHCP ends up in here, so make sure the directory exists +mkdir /tmp/bsdinstall_etc + kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271550 - head/sys/arm/freescale/imx
Author: ian Date: Sat Sep 13 20:09:34 2014 New Revision: 271550 URL: http://svnweb.freebsd.org/changeset/base/271550 Log: Replace the imx5 and imx6 iomux drivers with a single common driver that uses the new fdt_pinctrl interface. Added: head/sys/arm/freescale/imx/imx_iomux.c (contents, props changed) Deleted: head/sys/arm/freescale/imx/imx51_iomux.c head/sys/arm/freescale/imx/imx51_iomuxreg.h head/sys/arm/freescale/imx/imx6_iomux.c head/sys/arm/freescale/imx/imx6_iomuxreg.h Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/std.imx51 head/sys/arm/freescale/imx/std.imx53 head/sys/arm/freescale/imx/std.imx6 Modified: head/sys/arm/freescale/imx/files.imx51 == --- head/sys/arm/freescale/imx/files.imx51 Sat Sep 13 20:09:02 2014 (r271549) +++ head/sys/arm/freescale/imx/files.imx51 Sat Sep 13 20:09:34 2014 (r271550) @@ -19,7 +19,7 @@ arm/arm/bus_space-v6.cstandard arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.cstandard +arm/freescale/imx/imx_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: head/sys/arm/freescale/imx/files.imx53 == --- head/sys/arm/freescale/imx/files.imx53 Sat Sep 13 20:09:02 2014 (r271549) +++ head/sys/arm/freescale/imx/files.imx53 Sat Sep 13 20:09:34 2014 (r271550) @@ -22,7 +22,7 @@ dev/uart/uart_dev_imx.c optional uart arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.cstandard +arm/freescale/imx/imx_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: head/sys/arm/freescale/imx/files.imx6 == --- head/sys/arm/freescale/imx/files.imx6 Sat Sep 13 20:09:02 2014 (r271549) +++ head/sys/arm/freescale/imx/files.imx6 Sat Sep 13 20:09:34 2014 (r271550) @@ -20,11 +20,11 @@ arm/arm/mpcore_timer.c standard arm/freescale/fsl_ocotp.c standard arm/freescale/imx/imx6_anatop.cstandard arm/freescale/imx/imx6_ccm.c standard -arm/freescale/imx/imx6_iomux.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.coptional smp arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_common.c standard +arm/freescale/imx/imx_iomux.c standard arm/freescale/imx/imx_machdep.cstandard arm/freescale/imx/imx_gpt.cstandard arm/freescale/imx/imx_gpio.c optional gpio Added: head/sys/arm/freescale/imx/imx_iomux.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_iomux.c Sat Sep 13 20:09:34 2014 (r271550) @@ -0,0 +1,266 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +struct iomux_softc { + device_tdev; + struct resource *mem_res; +
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
On 09/13/14 22:04, Rick Macklem wrote: Hans Petter Selasky wrote: On 09/13/14 18:54, Adrian Chadd wrote: Hi, Just for the record: * I'm glad you're tackling the TSO config stuff; * I'm not glad you're trying to pack it into a u_int rather than creating a new structure and adding fields for it. I appreciate that you're trying to rush this in before 10.1, but this is exactly why things shouldn't be rushed in before release deadlines. :) I'd really like to see this be broken out as a structure and the bit shifting games for what really shouldn't be packed into a u_int fixed. Otherwise this is going to be deadweight that has to persist past 11.0. Hi Adrian, I can make that change for -current, making the new structure and such. This change was intended for 10 where there is only one u_int for this information. Or do you want me to change that in 10 too? Well, there are spare fields (if_ispare[4]) in struct ifnet that I believe can be used for new u_ints when MFC'ng a patch that adds fields to struct ifnet in head. (If I have this wrong, someone please correct me.) I'll admit I don't really see an advantage to defining a structure vs just defining a couple of additional u_ints, but so long as the structure doesn't cause alignment issues for any arch, I don't see a problem with a structure. I tend to agree with Adrian that this shouldn't be rushed. (I, personally, think that if_hw_tsomax was poorly chosen, but that is already in use, so I think we need to add to that and not replace it.) I also hope that your testing has included quite a bit of activity on an NFS mount using TSO and the default 64K rsize, wsize, since that is going to generate a bunch of 35 mbuf transmit fragment lists and there is an edge case where the total data length excluding ethernet header is just under 64K (by less than the ethernet header length) where the list must be split by tcp_output() to avoid disaster. Hi, The ethernet and VLAN headers are still subtracted. --HPS ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Hans Petter Selasky wrote: > On 09/13/14 22:04, Rick Macklem wrote: > > Hans Petter Selasky wrote: > >> On 09/13/14 18:54, Adrian Chadd wrote: > >>> Hi, > >>> > >>> Just for the record: > >>> > >>> * I'm glad you're tackling the TSO config stuff; > >>> * I'm not glad you're trying to pack it into a u_int rather than > >>> creating a new structure and adding fields for it. > >>> > >>> I appreciate that you're trying to rush this in before 10.1, but > >>> this > >>> is exactly why things shouldn't be rushed in before release > >>> deadlines. > >>> :) > >>> > >>> I'd really like to see this be broken out as a structure and the > >>> bit > >>> shifting games for what really shouldn't be packed into a u_int > >>> fixed. > >>> Otherwise this is going to be deadweight that has to persist past > >>> 11.0. > >>> > >> > >> Hi Adrian, > >> > >> I can make that change for -current, making the new structure and > >> such. > >> This change was intended for 10 where there is only one u_int for > >> this > >> information. Or do you want me to change that in 10 too? > >> > > Well, there are spare fields (if_ispare[4]) in struct ifnet that I > > believe can be used for new u_ints when MFC'ng a patch that adds > > fields to struct ifnet in head. (If I have this wrong, someone > > please > > correct me.) > > > > I'll admit I don't really see an advantage to defining a structure > > vs > > just defining a couple of additional u_ints, but so long as the > > structure > > doesn't cause alignment issues for any arch, I don't see a problem > > with > > a structure. > > > > I tend to agree with Adrian that this shouldn't be rushed. (I, > > personally, > > think that if_hw_tsomax was poorly chosen, but that is already in > > use, so > > I think we need to add to that and not replace it.) > > > > I also hope that your testing has included quite a bit of activity > > on > > an NFS mount using TSO and the default 64K rsize, wsize, since that > > is > > going to generate a bunch of 35 mbuf transmit fragment lists and > > there > > is an edge case where the total data length excluding ethernet > > header > > is just under 64K (by less than the ethernet header length) where > > the > > list must be split by tcp_output() to avoid disaster. > > Hi, > > The ethernet and VLAN headers are still subtracted. > Where? I couldn't see it when I glanced at the patch. (hdrlen in tcp_output() does not include ethernet header length and that is the only thing I see subtracted from the max_len.) I see the default set to (65536 - 4). I don't know why you subtracted 4 but I would have expected the max ethernet header length to be subtracted here? Note that this must be subtracted before use by tcp_output() because there are several network device drivers that support 32 transmit segments and this means that the TSO segment including ethernet headers must fit in 65536bytes (32 * MCLBYTES). If it does not, then NFS over these devices is busted because even m_defrag() can`t make them fit. rick rick > --HPS > > > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
On 09/13/14 22:14, Hans Petter Selasky wrote: On 09/13/14 22:04, Rick Macklem wrote: Hans Petter Selasky wrote: On 09/13/14 18:54, Adrian Chadd wrote: Hi, Hi, The ethernet and VLAN headers are still subtracted. --HPS Hi, Adrian @ and I have agreed that we will work out a new patch during the next 5 days, which correctly adds the new TSO fields in a more appropriate manner with regard to the conventions around in the network stack. For now I will revert the current TSO patch, if there are no big objections? --HPS ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
On 09/13/14 22:28, Rick Macklem wrote: Hans Petter Selasky wrote: On 09/13/14 22:04, Rick Macklem wrote: Hans Petter Selasky wrote: On 09/13/14 18:54, Adrian Chadd wrote: Hi, Just for the record: * I'm glad you're tackling the TSO config stuff; * I'm not glad you're trying to pack it into a u_int rather than creating a new structure and adding fields for it. I appreciate that you're trying to rush this in before 10.1, but this is exactly why things shouldn't be rushed in before release deadlines. :) I'd really like to see this be broken out as a structure and the bit shifting games for what really shouldn't be packed into a u_int fixed. Otherwise this is going to be deadweight that has to persist past 11.0. Hi Adrian, I can make that change for -current, making the new structure and such. This change was intended for 10 where there is only one u_int for this information. Or do you want me to change that in 10 too? Well, there are spare fields (if_ispare[4]) in struct ifnet that I believe can be used for new u_ints when MFC'ng a patch that adds fields to struct ifnet in head. (If I have this wrong, someone please correct me.) I'll admit I don't really see an advantage to defining a structure vs just defining a couple of additional u_ints, but so long as the structure doesn't cause alignment issues for any arch, I don't see a problem with a structure. I tend to agree with Adrian that this shouldn't be rushed. (I, personally, think that if_hw_tsomax was poorly chosen, but that is already in use, so I think we need to add to that and not replace it.) I also hope that your testing has included quite a bit of activity on an NFS mount using TSO and the default 64K rsize, wsize, since that is going to generate a bunch of 35 mbuf transmit fragment lists and there is an edge case where the total data length excluding ethernet header is just under 64K (by less than the ethernet header length) where the list must be split by tcp_output() to avoid disaster. Hi, The ethernet and VLAN headers are still subtracted. Where? I couldn't see it when I glanced at the patch. (hdrlen in tcp_output() does not include ethernet header length and that is the only thing I see subtracted from the max_len.) Hi Rick, When the drivers setup the "if_hw_tsomax" field, they need to subtract the ethernet and vlan headers from the maximum TSO payload. For example here: + sc->ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( + 65535 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* bytes */, + OCE_MAX_TX_ELEMENTS /* maximum frag count */, + 12 /* 4K frag size */); I see the default set to (65536 - 4). I don't know why you subtracted 4 but I would have expected the max ethernet header length to be subtracted here? That is another technical point. If you have a bunch of data to transfer you want the start and stop physical addresses to be aligned to some boundary, like cache line or 32-bit or 64-bit, because then the hardware doesn't have to do the byte shifting when it starts reading the data payload - right? Note that this must be subtracted before use by tcp_output() because there are several network device drivers that support 32 transmit segments and this means that the TSO segment including ethernet headers must fit in 65536 bytes (32 * MCLBYTES). If it does not, then NFS over these devices is busted because even m_defrag() can`t make them fit. I only found a few network drivers which actually set the TSO limit, and for the rest: The default limit is 255 frags of MAX 65536 bytes, which should not be reached in the cases you are describing. --HPS ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
On 09/13/14 22:35, Hans Petter Selasky wrote: I see the default set to (65536 - 4). I don't know why you subtracted 4 but I would have expected the max ethernet header length to be subtracted here? You mean to say that the default should be 65535 - ethernet header - vlan header ? --HPS ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Hans Petter Selasky wrote: > On 09/13/14 22:28, Rick Macklem wrote: > > Hans Petter Selasky wrote: > >> On 09/13/14 22:04, Rick Macklem wrote: > >>> Hans Petter Selasky wrote: > On 09/13/14 18:54, Adrian Chadd wrote: > > Hi, > > > > Just for the record: > > > > * I'm glad you're tackling the TSO config stuff; > > * I'm not glad you're trying to pack it into a u_int rather > > than > > creating a new structure and adding fields for it. > > > > I appreciate that you're trying to rush this in before 10.1, > > but > > this > > is exactly why things shouldn't be rushed in before release > > deadlines. > > :) > > > > I'd really like to see this be broken out as a structure and > > the > > bit > > shifting games for what really shouldn't be packed into a u_int > > fixed. > > Otherwise this is going to be deadweight that has to persist > > past > > 11.0. > > > > Hi Adrian, > > I can make that change for -current, making the new structure > and > such. > This change was intended for 10 where there is only one u_int > for > this > information. Or do you want me to change that in 10 too? > > >>> Well, there are spare fields (if_ispare[4]) in struct ifnet that > >>> I > >>> believe can be used for new u_ints when MFC'ng a patch that adds > >>> fields to struct ifnet in head. (If I have this wrong, someone > >>> please > >>> correct me.) > >>> > >>> I'll admit I don't really see an advantage to defining a > >>> structure > >>> vs > >>> just defining a couple of additional u_ints, but so long as the > >>> structure > >>> doesn't cause alignment issues for any arch, I don't see a > >>> problem > >>> with > >>> a structure. > >>> > >>> I tend to agree with Adrian that this shouldn't be rushed. (I, > >>> personally, > >>> think that if_hw_tsomax was poorly chosen, but that is already in > >>> use, so > >>> I think we need to add to that and not replace it.) > >>> > >>> I also hope that your testing has included quite a bit of > >>> activity > >>> on > >>> an NFS mount using TSO and the default 64K rsize, wsize, since > >>> that > >>> is > >>> going to generate a bunch of 35 mbuf transmit fragment lists and > >>> there > >>> is an edge case where the total data length excluding ethernet > >>> header > >>> is just under 64K (by less than the ethernet header length) where > >>> the > >>> list must be split by tcp_output() to avoid disaster. > >> > >> Hi, > >> > >> The ethernet and VLAN headers are still subtracted. > >> > > Where? I couldn't see it when I glanced at the patch. > > (hdrlen in tcp_output() does not include ethernet header length and > > that is the only thing I see subtracted from the max_len.) > > Hi Rick, > > When the drivers setup the "if_hw_tsomax" field, they need to > subtract > the ethernet and vlan headers from the maximum TSO payload. > > For example here: > > + sc->ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( > + 65535 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* bytes */, > + OCE_MAX_TX_ELEMENTS /* maximum frag count */, > + 12 /* 4K frag size */); > > > > > I see the default set to (65536 - 4). I don't know why you > > subtracted 4 > > but I would have expected the max ethernet header length to be > > subtracted > > here? > > That is another technical point. If you have a bunch of data to > transfer > you want the start and stop physical addresses to be aligned to some > boundary, like cache line or 32-bit or 64-bit, because then the > hardware > doesn't have to do the byte shifting when it starts reading the data > payload - right? > > > > > Note that this must be subtracted before use by tcp_output() > > because there > > are several network device drivers that support 32 transmit > > segments and this > > means that the TSO segment including ethernet headers must fit in > > 65536 bytes > > (32 * MCLBYTES). If it does not, then NFS over these devices is > > busted because > > even m_defrag() can`t make them fit. > > I only found a few network drivers which actually set the TSO limit, > and > for the rest: The default limit is 255 frags of MAX 65536 bytes, > which > should not be reached in the cases you are describing. > The problem is that almost no driver (last I looked xen/netfront was the only one) sets if_hw_tsomax. However many of these driver do need the maximum TSO segment size to be 64K - max_ethernet_header_len, so they can pack the TSO segment (including ethernet header) into 32 mbuf clusters via m_defrag(). So, the default needs to handle this case, because the drivers may never get fixed. rick > --HPS > > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271551 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Author: hselasky Date: Sat Sep 13 20:52:01 2014 New Revision: 271551 URL: http://svnweb.freebsd.org/changeset/base/271551 Log: Revert r271504. A new patch to solve this issue will be made. Suggested by: adrian @ Modified: head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxvar.h head/sys/dev/xen/netfront/netfront.c head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_var.h head/sys/net/if_vlan.c head/sys/netinet/tcp_output.c head/sys/ofed/drivers/net/mlx4/en_netdev.c Modified: head/sys/dev/oce/oce_if.c == --- head/sys/dev/oce/oce_if.c Sat Sep 13 20:09:34 2014(r271550) +++ head/sys/dev/oce/oce_if.c Sat Sep 13 20:52:01 2014(r271551) @@ -1731,10 +1731,7 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_baudrate = IF_Gbps(10); #if __FreeBSD_version >= 100 - sc->ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( - 65535 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* bytes */, - OCE_MAX_TX_ELEMENTS /* maximum frag count */, - 12 /* 4K frag size */); + sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); Modified: head/sys/dev/oce/oce_if.h == --- head/sys/dev/oce/oce_if.h Sat Sep 13 20:09:34 2014(r271550) +++ head/sys/dev/oce/oce_if.h Sat Sep 13 20:52:01 2014(r271551) @@ -152,6 +152,7 @@ extern int mp_ncpus;/* system's total #define OCE_MAX_TX_ELEMENTS29 #define OCE_MAX_TX_DESC1024 #define OCE_MAX_TX_SIZE65535 +#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS0 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c == --- head/sys/dev/vmware/vmxnet3/if_vmx.cSat Sep 13 20:09:34 2014 (r271550) +++ head/sys/dev/vmware/vmxnet3/if_vmx.cSat Sep 13 20:52:01 2014 (r271551) @@ -1722,11 +1722,7 @@ vmxnet3_setup_interface(struct vmxnet3_s ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; - - ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( - 65535 - sizeof(struct ether_vlan_header) /* bytes */, - VMXNET3_TX_MAXSEGS /* maximum frag count */, - VMXNET3_TX_MAXSEGSHIFT /* frag size */); + ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; #ifdef VMXNET3_LEGACY_TX ifp->if_start = vmxnet3_start; Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h == --- head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Sep 13 20:09:34 2014 (r271550) +++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Sep 13 20:52:01 2014 (r271551) @@ -277,13 +277,14 @@ struct vmxnet3_softc { */ #define VMXNET3_TX_MAXSEGS 32 #define VMXNET3_TX_MAXSIZE (VMXNET3_TX_MAXSEGS * MCLBYTES) +#define VMXNET3_TSO_MAXSIZE \ +(VMXNET3_TX_MAXSIZE - sizeof(struct ether_vlan_header)) /* * Maximum support Tx segments size. The length field in the * Tx descriptor is 14 bits. */ -#define VMXNET3_TX_MAXSEGSHIFT 14 -#define VMXNET3_TX_MAXSEGSIZE (1 << VMXNET3_TX_MAXSEGSHIFT) +#define VMXNET3_TX_MAXSEGSIZE (1 << 14) /* * The maximum number of Rx segments we accept. When LRO is enabled, Modified: head/sys/dev/xen/netfront/netfront.c == --- head/sys/dev/xen/netfront/netfront.cSat Sep 13 20:09:34 2014 (r271550) +++ head/sys/dev/xen/netfront/netfront.cSat Sep 13 20:52:01 2014 (r271551) @@ -134,6 +134,7 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #defineMAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) +#defineNF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2101,10 +2102,7 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hw_tsomax = IF_HW_TSOMAX_BUILD_VALUE( - 65535 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* bytes */, - MAX_TX_REQ_FRAGS /* maximum frag count */, - PAGE_SHIFT /* PAGE_SIZE frag size */); + ifp->if_hw_tsomax = NF_TSO_MAXBURST; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: head/sys/net/if.c ==
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Hans Petter Selasky wrote: > On 09/13/14 22:35, Hans Petter Selasky wrote: > > > > I see the default set to (65536 - 4). I don't know why you > > subtracted 4 > > but I would have expected the max ethernet header length to be > > subtracted > > here? > > You mean to say that the default should be > > 65535 - ethernet header - vlan header ? > Almost. It is actually: 65536 - ethernet header - vlan header (or the min of IP_MAXPACKET vs 32*MCLBYTES - ethernet header - vlan header if you want to cover your butt for the case where the value of MCLBYTES is changed) IP_MAXPACKET (65535) comes from the fact that some devices use the iplen field of the ip header in the TSO segment for its length, I think? (Some do not and can support TSO segments greater than IP_MAXPACKET in length, but again, the default shouldn't assume this nor should it assume the device does the vlan header in hardware --> "- vlan header" to be safe for default.) This is because there are lots of broken drivers (basically any one that has a limit of 32 transmit segments) and this at least makes them work correctly. Unfortunately they still do a lot of m_defrag() calls for this case, but with a patch like yours, the drivers may eventually get patched to use the max_frags setting and then avoid the need to do m_defrag() calls. rick > --HPS > > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
On 09/13/14 22:54, Rick Macklem wrote: Hans Petter Selasky wrote: On 09/13/14 22:35, Hans Petter Selasky wrote: I see the default set to (65536 - 4). I don't know why you subtracted 4 but I would have expected the max ethernet header length to be subtracted here? You mean to say that the default should be 65535 - ethernet header - vlan header ? Almost. It is actually: 65536 - ethernet header - vlan header (or the min of IP_MAXPACKET vs 32*MCLBYTES - ethernet header - vlan header if you want to cover your butt for the case where the value of MCLBYTES is changed) IP_MAXPACKET (65535) comes from the fact that some devices use the iplen field of the ip header in the TSO segment for its length, I think? (Some do not and can support TSO segments greater than IP_MAXPACKET in length, but again, the default shouldn't assume this nor should it assume the device does the vlan header in hardware --> "- vlan header" to be safe for default.) This is because there are lots of broken drivers (basically any one that has a limit of 32 transmit segments) and this at least makes them work correctly. Unfortunately they still do a lot of m_defrag() calls for this case, but with a patch like yours, the drivers may eventually get patched to use the max_frags setting and then avoid the need to do m_defrag() calls. rick Hi Rick, Thanks for shedding light into existing practices. --HPS ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4
Hans Petter Selasky wrote: > On 09/13/14 18:54, Adrian Chadd wrote: > > Hi, > > > > Just for the record: > > > > * I'm glad you're tackling the TSO config stuff; > > * I'm not glad you're trying to pack it into a u_int rather than > > creating a new structure and adding fields for it. > > > > I appreciate that you're trying to rush this in before 10.1, but > > this > > is exactly why things shouldn't be rushed in before release > > deadlines. > > :) > > > > I'd really like to see this be broken out as a structure and the > > bit > > shifting games for what really shouldn't be packed into a u_int > > fixed. > > Otherwise this is going to be deadweight that has to persist past > > 11.0. > > > > Hi Adrian, > > I can make that change for -current, making the new structure and > such. > This change was intended for 10 where there is only one u_int for > this > information. Or do you want me to change that in 10 too? > > --HPS > > > Btw, your patch calls sbsndptr() in tcp_output(), which advances sb_sndptroff and sb_sndptr by the length. Then it loops around and reduces the length for the case where there are too many mbufs in the chain. I don't know this algorithm well enough to know if advancing sb_sndptroff and sb_sndptr by too much for this case will cause a problem? I avoided the question by implementing sbsndmbuf() that was cloned from sbsndptr() to avoid this when I did my draft patch. It is in the attached patch, in case it is useful. (It avoids updating sb_sndptroff and sb_sndptr.) rick --- kern/uipc_sockbuf.c.sav 2014-01-30 20:27:17.0 -0500 +++ kern/uipc_sockbuf.c 2014-01-30 22:12:08.0 -0500 @@ -965,6 +965,39 @@ sbsndptr(struct sockbuf *sb, u_int off, } /* + * Return the first mbuf for the provided offset. + */ +struct mbuf * +sbsndmbuf(struct sockbuf *sb, u_int off, long *first_len) +{ + struct mbuf *m; + + KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); + + *first_len = 0; + /* + * Is off below stored offset? Happens on retransmits. + * If so, just use sb_mb. + */ + if (sb->sb_sndptr == NULL || sb->sb_sndptroff > off) + m = sb->sb_mb; + else { + m = sb->sb_sndptr; + off -= sb->sb_sndptroff; + } + while (off > 0 && m != NULL) { + if (off < m->m_len) + break; + off -= m->m_len; + m = m->m_next; + } + if (m != NULL) + *first_len = m->m_len - off; + + return (m); +} + +/* * Drop a record off the front of a sockbuf and move the next record to the * front. */ --- sys/sockbuf.h.sav 2014-01-30 20:42:28.0 -0500 +++ sys/sockbuf.h 2014-01-30 22:08:43.0 -0500 @@ -153,6 +153,8 @@ int sbreserve_locked(struct sockbuf *sb, struct thread *td); struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); +struct mbuf * + sbsndmbuf(struct sockbuf *sb, u_int off, long *first_len); void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); --- netinet/tcp_input.c.sav 2014-01-30 19:37:52.0 -0500 +++ netinet/tcp_input.c 2014-01-30 19:39:07.0 -0500 @@ -3627,6 +3627,7 @@ tcp_mss(struct tcpcb *tp, int offer) if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; tp->t_tsomax = cap.tsomax; + tp->t_tsomaxsegs = cap.tsomaxsegs; } } --- netinet/tcp_output.c.sav 2014-01-30 18:55:15.0 -0500 +++ netinet/tcp_output.c 2014-01-30 22:18:56.0 -0500 @@ -166,8 +166,8 @@ int tcp_output(struct tcpcb *tp) { struct socket *so = tp->t_inpcb->inp_socket; - long len, recwin, sendwin; - int off, flags, error = 0; /* Keep compiler happy */ + long len, recwin, sendwin, tso_tlen; + int cnt, off, flags, error = 0; /* Keep compiler happy */ struct mbuf *m; struct ip *ip = NULL; struct ipovly *ipov = NULL; @@ -780,6 +780,24 @@ send: } /* + * Limit the number of TSO transmit segments (mbufs + * in mbuf list) to tp->t_tsomaxsegs. + */ + cnt = 0; + m = sbsndmbuf(&so->so_snd, off, &tso_tlen); + while (m != NULL && cnt < tp->t_tsomaxsegs && + tso_tlen < len) { +if (cnt > 0) + tso_tlen += m->m_len; +cnt++; +m = m->m_next; + } + if (m != NULL && tso_tlen < len) { +len = tso_tlen; +sendalot = 1; + } + + /* * Prevent the last segment from being * fractional unless the send sockbuf can * be emptied. --- netinet/tcp_subr.c.sav 2014-01-30 19:44:35.0 -0500 +++ netinet/tcp_subr.c 2014-01-30 20:56:12.0 -0500 @@ -1800,6 +1800,12 @@ tcp_maxmtu(struct in_conninfo *inc, stru ifp->if_hwassist & CSUM_TSO) cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; +#ifdef notyet +cap->tsomaxsegs = ifp->if_hw_tsomaxsegs; +#endif +if (cap->tsomaxsegs == 0) + cap->tsomaxsegs = + TCPTSO_MAX_TX_SEGS_DEFAULT; } RTFREE(sro.ro_rt); } --- netinet/tcp_var.h.sav 2014-01-30 19:39:22.0 -0500 +++ netinet/tcp_var.h 2014-01-30 20:52:57.0 -0500 @@ -209,6 +209,7 @@ struct tcpcb { u_int t_keepcnt; /* numbe
svn commit: r271552 - head/usr.sbin/bsdinstall/scripts
Author: nwhitehorn Date: Sat Sep 13 22:03:51 2014 New Revision: 271552 URL: http://svnweb.freebsd.org/changeset/base/271552 Log: Make the default choice for the chroot shell at the end be "No". This allows just pressing enter repeatedly to successfully install a reasonable system. Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto == --- head/usr.sbin/bsdinstall/scripts/auto Sat Sep 13 20:52:01 2014 (r271551) +++ head/usr.sbin/bsdinstall/scripts/auto Sat Sep 13 22:03:51 2014 (r271552) @@ -252,7 +252,8 @@ if [ ! -z "$BSDINSTALL_FETCHDEST" ]; the fi dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \ ---yesno "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 +--default-button no --yesno \ + "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 if [ $? -eq 0 ]; then clear mount -t devfs devfs "$BSDINSTALL_CHROOT/dev" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r271552 - head/usr.sbin/bsdinstall/scripts
On Sat, Sep 13, 2014 at 10:03:52PM +, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Sep 13 22:03:51 2014 > New Revision: 271552 > URL: http://svnweb.freebsd.org/changeset/base/271552 > > Log: > Make the default choice for the chroot shell at the end be "No". This allows > just pressing enter repeatedly to successfully install a reasonable system. > Thank you! Glen pgpWET8L9GucM.pgp Description: PGP signature
svn commit: r271553 - head/usr.sbin/bsdinstall/scripts
Author: nwhitehorn Date: Sat Sep 13 22:14:19 2014 New Revision: 271553 URL: http://svnweb.freebsd.org/changeset/base/271553 Log: Rename the choices in the partitioning methods dialog to reflect current reality. In particular, draw a connection between the auto ZFS script and the auto UFS one, since they fulfill similar functions. I'm not sure the auto ZFS code is actually experimental anymore, so it might be worth changing that label still. Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto == --- head/usr.sbin/bsdinstall/scripts/auto Sat Sep 13 22:03:51 2014 (r271552) +++ head/usr.sbin/bsdinstall/scripts/auto Sat Sep 13 22:14:19 2014 (r271553) @@ -107,14 +107,14 @@ rm -f $PATH_FSTAB touch $PATH_FSTAB PMODES="\ -Guided \"Partitioning Tool (Recommended for Beginners)\" \ -Manual \"Manually Configure Partitions (Expert)\" \ +\"Auto (UFS)\" \"Guided Disk Setup\" \ +Manual \"Manual Disk Setup (experts)\" \ Shell \"Open a shell and partition by hand\"" CURARCH=$( uname -m ) case $CURARCH in amd64|i386) # Booting ZFS Supported - PMODES="$PMODES ZFS \"Automatic Root-on-ZFS (Experimental)\"" + PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS (Experimental)\"" ;; *) # Booting ZFS Unspported ;; @@ -128,7 +128,7 @@ PARTMODE=`echo $PMODES | xargs dialog -- exec 3>&- case "$PARTMODE" in -"Guided") # Guided +"Auto (UFS)") # Guided bsdinstall autopart || error "Partitioning error" bsdinstall mount || error "Failed to mount filesystem" ;; @@ -146,7 +146,7 @@ case "$PARTMODE" in fi bsdinstall mount || error "Failed to mount filesystem" ;; -"ZFS") # ZFS +"Auto (ZFS)") # ZFS bsdinstall zfsboot || error "ZFS setup failed" bsdinstall mount || error "Failed to mount filesystem" ;; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271560 - head/usr.sbin/ctld
Author: allanjude (doc committer) Date: Sat Sep 13 23:50:51 2014 New Revision: 271560 URL: http://svnweb.freebsd.org/changeset/base/271560 Log: Resolve an ambiguity with the definition of a new auth-group Resolve a markup mistake Reviewed by: trasz Approved by: bcr (mentor), wblock (mentor) Sponsored by: ScaleEngine Inc. CR: https://reviews.freebsd.org/D735 Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 == --- head/usr.sbin/ctld/ctl.conf.5 Sat Sep 13 23:48:43 2014 (r271559) +++ head/usr.sbin/ctld/ctl.conf.5 Sat Sep 13 23:50:51 2014 (r271560) @@ -75,6 +75,7 @@ file is: Create an .Sy auth-group configuration context, +defining a new auth-group, which can then be assigned to any number of targets. .It Ic debug Ar level The debug verbosity level. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271562 - head/sys/mips/cavium
Author: kan Date: Sun Sep 14 00:02:40 2014 New Revision: 271562 URL: http://svnweb.freebsd.org/changeset/base/271562 Log: Fix RTC clock writes on many Octeon boards. The struct clocktime uses 0-based week day number, so back out part of r229161 by gonzo, which actually broke the RTC clock writes on Sundays. Modified: head/sys/mips/cavium/octeon_ds1337.c Modified: head/sys/mips/cavium/octeon_ds1337.c == --- head/sys/mips/cavium/octeon_ds1337.cSun Sep 14 00:02:37 2014 (r271561) +++ head/sys/mips/cavium/octeon_ds1337.cSun Sep 14 00:02:40 2014 (r271562) @@ -81,7 +81,7 @@ static int validate_ct_struct(struct clo CT_CHECK(ct->min < 0 || ct->min > 59, "minute"); CT_CHECK(ct->hour < 0 || ct->hour > 23, "hour"); CT_CHECK(ct->day < 1 || ct->day > 31, "day"); -CT_CHECK(ct->dow < 1 || ct->dow > 7, "day of week"); +CT_CHECK(ct->dow < 0 || ct->dow > 6, "day of week"); CT_CHECK(ct->mon < 1 || ct->mon > 12, "month"); CT_CHECK(ct->year > 2037,"year"); @@ -124,7 +124,7 @@ uint32_t cvmx_rtc_ds1337_read(void) { ct.hour = (ct.hour + 12) % 24; } -ct.dow = (reg[3] & 0x7); /* Day of week field is 1..7 */ +ct.dow = (reg[3] & 0x7) - 1; /* Day of week field is 0..6 */ ct.day = bcd2bin(reg[4] & 0x3f); ct.mon = bcd2bin(reg[5] & 0x1f); /* Month field is 1..12 */ #if defined(OCTEON_BOARD_CAPK_0100ND) @@ -136,7 +136,6 @@ uint32_t cvmx_rtc_ds1337_read(void) ct.year = ((reg[5] & 0x80) ? 2000 : 1900) + bcd2bin(reg[6]); #endif - if (validate_ct_struct(&ct)) cvmx_dprintf("Warning: RTC calendar is not configured properly\n"); @@ -174,13 +173,15 @@ int cvmx_rtc_ds1337_write(uint32_t time) reg[0] = bin2bcd(ct.sec); reg[1] = bin2bcd(ct.min); reg[2] = bin2bcd(ct.hour); /* Force 0..23 format even if using AM/PM */ -reg[3] = bin2bcd(ct.dow); +reg[3] = bin2bcd(ct.dow + 1); reg[4] = bin2bcd(ct.day); reg[5] = bin2bcd(ct.mon); +#if !defined(OCTEON_BOARD_CAPK_0100ND) if (ct.year >= 2000) /* Set century bit*/ { reg[5] |= 0x80; } +#endif reg[6] = bin2bcd(ct.year % 100); /* Lockless write: detects the infrequent roll-over and retries */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271561 - head/sys/mips/cavium/octe
Author: kan Date: Sun Sep 14 00:02:37 2014 New Revision: 271561 URL: http://svnweb.freebsd.org/changeset/base/271561 Log: Add delay to Octeon MDIO access routines. Prevent saturattion of the bus by constant polling which in extreme cases can cause interface lockup. This makes FreeBSD match similar case in the executive. Modified: head/sys/mips/cavium/octe/ethernet-mdio.c Modified: head/sys/mips/cavium/octe/ethernet-mdio.c == --- head/sys/mips/cavium/octe/ethernet-mdio.c Sat Sep 13 23:50:51 2014 (r271560) +++ head/sys/mips/cavium/octe/ethernet-mdio.c Sun Sep 14 00:02:37 2014 (r271561) @@ -71,6 +71,7 @@ int cvm_oct_mdio_read(struct ifnet *ifp, cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { + cvmx_wait(1000); smi_rd.u64 = cvmx_read_csr(CVMX_SMI_RD_DAT); } while (smi_rd.s.pending); @@ -108,6 +109,7 @@ void cvm_oct_mdio_write(struct ifnet *if cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { + cvmx_wait(1000); smi_wr.u64 = cvmx_read_csr(CVMX_SMI_WR_DAT); } while (smi_wr.s.pending); MDIO_UNLOCK(); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271563 - head/usr.sbin/bsdinstall/scripts
Author: allanjude (doc committer) Date: Sun Sep 14 01:57:22 2014 New Revision: 271563 URL: http://svnweb.freebsd.org/changeset/base/271563 Log: Make the root-on-zfs part of the installer warn a user who booted the installer via UEFI that we do not support booting ZFS via UEFI yet PR: 193595 Approved by: nwhitehorn MFC after:5 days Sponsored by: ScaleEngine Inc. CR: https://reviews.freebsd.org/D782 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot == --- head/usr.sbin/bsdinstall/scripts/zfsbootSun Sep 14 00:02:40 2014 (r271562) +++ head/usr.sbin/bsdinstall/scripts/zfsbootSun Sep 14 01:57:22 2014 (r271563) @@ -293,6 +293,7 @@ msg_swap_mirror_help="Mirror swap partit msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." @@ -687,6 +688,48 @@ dialog_menu_layout() return $DIALOG_OK } +# dialog_uefi_prompt +# +# Confirm that the user wants to continue with the installation on a BIOS +# system when they have booted with UEFI +# +dialog_uefi_prompt() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt # Calculated below + local hline="$hline_arrows_tab_enter" + + local height=8 width=50 prefix=" " + local plen=${#prefix} list= line= + local max_width=$(( $width - 3 - $plen )) + + local yes no defaultno extra_args format + if [ "$USE_XDIALOG" ]; then + yes=ok no=cancel defaultno=default-no + extra_args="--wrap --left" + format="$msg_uefi_not_supported" + else + yes=yes no=no defaultno=defaultno + extra_args="--cr-wrap" + format="$msg_uefi_not_supported" + fi + + # Add height for Xdialog(1) + [ "$USE_XDIALOG" ] && height=$(( $height + $height / 5 + 3 )) + + prompt=$( printf "$format" ) + f_dprintf "%s: UEFI prompt" "$0" + $DIALOG \ + --title "$title"\ + --backtitle "$btitle" \ + --hline "$hline"\ + --$yes-label "$msg_yes" \ + --$no-label "$msg_no" \ + $extra_args \ + --yesno "$prompt" $height $width +} + # zfs_create_diskpart $disk $index # # For each block device to be used in the zpool, rather than just create the @@ -1384,6 +1427,21 @@ f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSD f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # +# If the system was booted with UEFI, warn the user that FreeBSD can't do +# ZFS with UEFI yet +# +if f_interactive; then +bootmethod=$(sysctl -n machdep.bootmethod) +f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" +if [ "$bootmethod" != "BIOS" ]; then + dialog_uefi_prompt + retval=$? + f_dprintf "uefi_prompt=[%s]" "$retval" + [ $retval -eq $DIALOG_OK ] || f_die +fi +fi + +# # Loop over the main menu until we've accomplished what we came here to do # while :; do ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271567 - head/usr.sbin/bsdinstall/scripts
Author: nwhitehorn Date: Sun Sep 14 02:31:53 2014 New Revision: 271567 URL: http://svnweb.freebsd.org/changeset/base/271567 Log: ZFS support isn't actually experimental anymore, so no need to scare people. Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto == --- head/usr.sbin/bsdinstall/scripts/auto Sun Sep 14 02:31:15 2014 (r271566) +++ head/usr.sbin/bsdinstall/scripts/auto Sun Sep 14 02:31:53 2014 (r271567) @@ -114,7 +114,7 @@ Shell \"Open a shell and partition by ha CURARCH=$( uname -m ) case $CURARCH in amd64|i386) # Booting ZFS Supported - PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS (Experimental)\"" + PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS\"" ;; *) # Booting ZFS Unspported ;; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"