svn commit: r220878 - in head/sys/netinet: . ipfw
Author: bz Date: Wed Apr 20 07:55:33 2011 New Revision: 220878 URL: http://svn.freebsd.org/changeset/base/220878 Log: MFp4 CH=191466: Move fw_one_pass to where it belongs: it is a property of ipfw, not of ip_input. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after:3 days Modified: head/sys/netinet/ip_input.c head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ip_input.c == --- head/sys/netinet/ip_input.c Wed Apr 20 01:15:22 2011(r220877) +++ head/sys/netinet/ip_input.c Wed Apr 20 07:55:33 2011(r220878) @@ -218,8 +218,6 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, "number of entries in the per-cpu output flow caches"); #endif -VNET_DEFINE(int, fw_one_pass) = 1; - static voidip_freef(struct ipqhead *, struct ipq *); /* Modified: head/sys/netinet/ipfw/ip_fw2.c == --- head/sys/netinet/ipfw/ip_fw2.c Wed Apr 20 01:15:22 2011 (r220877) +++ head/sys/netinet/ipfw/ip_fw2.c Wed Apr 20 07:55:33 2011 (r220878) @@ -113,6 +113,7 @@ static int default_to_accept; #endif VNET_DEFINE(int, autoinc_step); +VNET_DEFINE(int, fw_one_pass) = 1; /* * Each rule belongs to one of 32 different sets (0..31). ___ 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: r220879 - head/sys/netinet
Author: bz Date: Wed Apr 20 08:00:29 2011 New Revision: 220879 URL: http://svn.freebsd.org/changeset/base/220879 Log: MFp4 CH=191470: Move the ipport_tick_callout and related functions from ip_input.c to in_pcb.c. The random source port allocation code has been merged and is now local to in_pcb.c only. Use a SYSINIT to get the callout started and no longer depend on initialization from the inet code, which would not work in an IPv6 only setup. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after:4 days Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h Modified: head/sys/netinet/in_pcb.c == --- head/sys/netinet/in_pcb.c Wed Apr 20 07:55:33 2011(r220878) +++ head/sys/netinet/in_pcb.c Wed Apr 20 08:00:29 2011(r220879) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -85,6 +86,8 @@ __FBSDID("$FreeBSD$"); #include +static struct callout ipport_tick_callout; + /* * These configure the range of local port addresses assigned to * "unspecified" outgoing connections/packets/whatever. @@ -1668,7 +1671,7 @@ in_pcbsosetlabel(struct socket *so) * allocation. We return to random allocation only once we drop below * ipport_randomcps for at least ipport_randomtime seconds. */ -void +static void ipport_tick(void *xtp) { VNET_ITERATOR_DECL(vnet_iter); @@ -1689,6 +1692,30 @@ ipport_tick(void *xtp) callout_reset(&ipport_tick_callout, hz, ipport_tick, NULL); } +static void +ip_fini(void *xtp) +{ + + callout_stop(&ipport_tick_callout); +} + +/* + * The ipport_callout should start running at about the time we attach the + * inet or inet6 domains. + */ +static void +ipport_tick_init(const void *unused __unused) +{ + + /* Start ipport_tick. */ + callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); + callout_reset(&ipport_tick_callout, 1, ipport_tick, NULL); + EVENTHANDLER_REGISTER(shutdown_pre_sync, ip_fini, NULL, + SHUTDOWN_PRI_DEFAULT); +} +SYSINIT(ipport_tick_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, +ipport_tick_init, NULL); + void inp_wlock(struct inpcb *inp) { Modified: head/sys/netinet/in_pcb.h == --- head/sys/netinet/in_pcb.h Wed Apr 20 07:55:33 2011(r220878) +++ head/sys/netinet/in_pcb.h Wed Apr 20 08:00:29 2011(r220879) @@ -482,8 +482,6 @@ VNET_DECLARE(int, ipport_tcpallocs); #defineV_ipport_stoprandom VNET(ipport_stoprandom) #defineV_ipport_tcpallocs VNET(ipport_tcpallocs) -extern struct callout ipport_tick_callout; - void in_pcbinfo_destroy(struct inpcbinfo *); void in_pcbinfo_init(struct inpcbinfo *, const char *, struct inpcbhead *, int, int, char *, uma_init, uma_fini, uint32_t); @@ -521,7 +519,6 @@ int in_getsockaddr(struct socket *so, st struct sockaddr * in_sockaddr(in_port_t port, struct in_addr *addr); void in_pcbsosetlabel(struct socket *so); -void ipport_tick(void *xtp); #endif /* _KERNEL */ #endif /* !_NETINET_IN_PCB_H_ */ Modified: head/sys/netinet/ip_input.c == --- head/sys/netinet/ip_input.c Wed Apr 20 07:55:33 2011(r220878) +++ head/sys/netinet/ip_input.c Wed Apr 20 08:00:29 2011(r220879) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -194,8 +193,6 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, &VNET_NAME(maxfragsperpacket), 0, "Maximum number of IPv4 fragments allowed per packet"); -struct callout ipport_tick_callout; - #ifdef IPCTL_DEFMTU SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, &ip_mtu, 0, "Default MTU"); @@ -352,11 +349,6 @@ ip_init(void) ip_protox[pr->pr_protocol] = pr - inetsw; } - /* Start ipport_tick. */ - callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); - callout_reset(&ipport_tick_callout, 1, ipport_tick, NULL); - EVENTHANDLER_REGISTER(shutdown_pre_sync, ip_fini, NULL, - SHUTDOWN_PRI_DEFAULT); EVENTHANDLER_REGISTER(nmbclusters_change, ipq_zone_change, NULL, EVENTHANDLER_PRI_ANY); @@ -381,13 +373,6 @@ ip_destroy(void) } #endif -void -ip_fini(void *xtp) -{ - - callout_stop(&ipport_tick_callout); -} - /* * Ip input routine. Checksum and byte swap header. If fragmented * try to reassemble. Process options. Pass to next level. Modified: head/sys/netinet/ip_var.h == --- head/sys/netinet/ip_var.h Wed Apr 20 07:55:33 2011(r220878) +++ head/s
svn commit: r220880 - head/sys/netinet
Author: bz Date: Wed Apr 20 08:03:22 2011 New Revision: 220880 URL: http://svn.freebsd.org/changeset/base/220880 Log: MFp4 CH=191760: When compiling out INET we still need the initialization routines as well as the tuning and montoring sysctls shared with IPv6. Move the two send/recvspace variables up from the middle of the file to ease compiling out the INET only code. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after:3 days Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c == --- head/sys/netinet/raw_ip.c Wed Apr 20 08:00:29 2011(r220879) +++ head/sys/netinet/raw_ip.c Wed Apr 20 08:03:22 2011(r220880) @@ -33,6 +33,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" @@ -93,6 +94,7 @@ void (*ip_divert_ptr)(struct mbuf *, int int(*ng_ipfw_input_p)(struct mbuf **, int, struct ip_fw_args *, int); +#ifdef INET /* * Hooks for multicast routing. They all default to NULL, so leave them not * initialized and rely on BSS being set to 0. @@ -118,6 +120,15 @@ u_long (*ip_mcast_src)(int); void (*rsvp_input_p)(struct mbuf *m, int off); int (*ip_rsvp_vif)(struct socket *, struct sockopt *); void (*ip_rsvp_force_done)(struct socket *); +#endif /* INET */ + +u_long rip_sendspace = 9216; +SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW, +&rip_sendspace, 0, "Maximum outgoing raw IP datagram size"); + +u_long rip_recvspace = 9216; +SYSCTL_ULONG(_net_inet_raw, OID_AUTO, recvspace, CTLFLAG_RW, +&rip_recvspace, 0, "Maximum space for incoming raw IP datagrams"); /* * Hash functions @@ -127,6 +138,7 @@ void (*ip_rsvp_force_done)(struct socket #define INP_PCBHASH_RAW(proto, laddr, faddr, mask) \ (((proto) + (laddr) + (faddr)) % (mask) + 1) +#ifdef INET static void rip_inshash(struct inpcb *inp) { @@ -157,6 +169,7 @@ rip_delhash(struct inpcb *inp) LIST_REMOVE(inp, inp_hash); } +#endif /* INET */ /* * Raw interface to IP protocol. @@ -200,6 +213,7 @@ rip_destroy(void) } #endif +#ifdef INET static int rip_append(struct inpcb *last, struct ip *ip, struct mbuf *n, struct sockaddr_in *ripsrc) @@ -748,14 +762,6 @@ rip_ctlinput(int cmd, struct sockaddr *s } } -u_long rip_sendspace = 9216; -u_long rip_recvspace = 9216; - -SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW, -&rip_sendspace, 0, "Maximum outgoing raw IP datagram size"); -SYSCTL_ULONG(_net_inet_raw, OID_AUTO, recvspace, CTLFLAG_RW, -&rip_recvspace, 0, "Maximum space for incoming raw IP datagrams"); - static int rip_attach(struct socket *so, int proto, struct thread *td) { @@ -980,6 +986,7 @@ rip_send(struct socket *so, int flags, s } return (rip_output(m, so, dst)); } +#endif /* INET */ static int rip_pcblist(SYSCTL_HANDLER_ARGS) @@ -1086,6 +1093,7 @@ SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, rip_pcblist, "S,xinpcb", "List of active raw IP sockets"); +#ifdef INET struct pr_usrreqs rip_usrreqs = { .pru_abort =rip_abort, .pru_attach = rip_attach, @@ -1101,3 +1109,4 @@ struct pr_usrreqs rip_usrreqs = { .pru_sosetlabel = in_pcbsosetlabel, .pru_close =rip_close, }; +#endif /* INET */ ___ 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: r220881 - head/sys/netinet6
Author: bz Date: Wed Apr 20 08:05:23 2011 New Revision: 220881 URL: http://svn.freebsd.org/changeset/base/220881 Log: MFp4 CH=191760,191770: Not compiling in and not initializing from inetsw from in_proto.c for IPv6 only, we need to initialize upper layer protocols from inet6sw. Make sure to not initialize them twice in a Dual-Stack environment but only conditionally on no INET as we have done for TCP for a long time. Otherwise we would leak resources. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after:3 days Modified: head/sys/netinet6/in6_proto.c Modified: head/sys/netinet6/in6_proto.c == --- head/sys/netinet6/in6_proto.c Wed Apr 20 08:03:22 2011 (r220880) +++ head/sys/netinet6/in6_proto.c Wed Apr 20 08:05:23 2011 (r220881) @@ -169,6 +169,9 @@ struct ip6protosw inet6sw[] = { .pr_input = udp6_input, .pr_ctlinput = udp6_ctlinput, .pr_ctloutput = ip6_ctloutput, +#ifndef INET /* Do not call initialization twice. */ + .pr_init = udp_init, +#endif .pr_usrreqs = &udp6_usrreqs, }, { @@ -196,6 +199,9 @@ struct ip6protosw inet6sw[] = { .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain =sctp_drain, +#ifndef INET /* Do not call initialization twice. */ + .pr_init = sctp_init, +#endif .pr_usrreqs = &sctp6_usrreqs }, { @@ -231,6 +237,9 @@ struct ip6protosw inet6sw[] = { .pr_output =rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, +#ifndef INET /* Do not call initialization twice. */ + .pr_init = rip_init, +#endif .pr_usrreqs = &rip6_usrreqs }, { ___ 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: r220882 - head/contrib/bsnmp/snmpd
Author: ru Date: Wed Apr 20 08:38:25 2011 New Revision: 220882 URL: http://svn.freebsd.org/changeset/base/220882 Log: Don't spam syslog with "inet_ntop(): Address family not supported by protocol family" when processing requests received from the UNIX domain socket. MFC after:3 days Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c == --- head/contrib/bsnmp/snmpd/main.c Wed Apr 20 08:05:23 2011 (r220881) +++ head/contrib/bsnmp/snmpd/main.c Wed Apr 20 08:38:25 2011 (r220882) @@ -1214,7 +1214,8 @@ snmpd_input(struct port_input *pi, struc /* * In case of AF_INET{6} peer, do hosts_access(5) check. */ - if (inet_ntop(pi->peer->sa_family, + if (pi->peer->sa_family != AF_LOCAL && + inet_ntop(pi->peer->sa_family, &((const struct sockaddr_in *)(const void *)pi->peer)->sin_addr, client, sizeof(client)) != NULL) { request_set(&req, RQ_CLIENT_ADDR, client, 0); @@ -1223,7 +1224,7 @@ snmpd_input(struct port_input *pi, struc eval_client(&req)); return (-1); } - } else + } else if (pi->peer->sa_family != AF_LOCAL) syslog(LOG_ERR, "inet_ntop(): %m"); #endif ___ 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: r220877 - head/sys/fs/nfsclient
> > + tmp_off = uio->uio_offset + uio->uio_resid; > > + mtx_lock(&nmp->nm_mtx); > > + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) { > > + mtx_unlock(&nmp->nm_mtx); > > return (EFBIG); > > + } > > + mtx_unlock(&nmp->nm_mtx); > > I don't think you need the lock to protect nm_maxfilesize. Can it > change > from under us? My guess is that it is set on mount time and is not > modified afterwards. > Good question. For NFSv3 - it is only modified by the first fsinfo RPC and that normally happens at mount time, as you guessed above. (This is consistent with RFC1813, which defines the fsinfo RPC as getting non-volatile information.) For NFSv4 - it gets it each time VFS_STATFS() happens. I am not sure that this is correct, but I don't know of anywhere in RFC3530 where it states that this attribute will not change. In practice, I suspect that servers seldom, if ever, change it. So, it is unlikely to change and I'd be comfortable taking the mutex lock off the check for it, if others are? (As you might be aware, I started a thread on hackers-freebsd@ where my question was basically "do you need to mutex lock when you read a global variable". My main concern there was a case that I'm working on w.r.t. forced dismounts. jhb@ suggested that he thinks it is good practice to always lock, to play it safe. At least that was my interpretation?) rick ___ 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: r220885 - head/sys/conf
Author: bz Date: Wed Apr 20 12:58:30 2011 New Revision: 220885 URL: http://svn.freebsd.org/changeset/base/220885 Log: Compile in in_cksum* implementations for both IPv6 and IPv6. While in_pseudo() etc. is often used in offloading feature support, in_cksum() is mostly used to fix some broken hardware. Keeping both around for the moment allows us to compile NIC drivers even in an IPv6 only environment without the need to mangle them with #ifdef INETs in a way they are not prepared for. This will leave some dead code paths that will not be exercised for IPv6. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after:3 days Modified: head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.ia64 head/sys/conf/files.mips head/sys/conf/files.pc98 head/sys/conf/files.powerpc head/sys/conf/files.sparc64 head/sys/conf/files.sun4v Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Wed Apr 20 11:17:21 2011(r220884) +++ head/sys/conf/files.amd64 Wed Apr 20 12:58:30 2011(r220885) @@ -106,7 +106,7 @@ amd64/amd64/exception.S standard amd64/amd64/fpu.c standard amd64/amd64/gdb_machdep.c optionalgdb amd64/amd64/identcpu.c standard -amd64/amd64/in_cksum.c optionalinet +amd64/amd64/in_cksum.c optionalinet | inet6 amd64/amd64/initcpu.c standard amd64/amd64/intr_machdep.c standard amd64/amd64/io.c optionalio Modified: head/sys/conf/files.arm == --- head/sys/conf/files.arm Wed Apr 20 11:17:21 2011(r220884) +++ head/sys/conf/files.arm Wed Apr 20 12:58:30 2011(r220885) @@ -24,8 +24,8 @@ arm/arm/fiq_subr.Sstandard arm/arm/fusu.S standard arm/arm/gdb_machdep.c optionalgdb arm/arm/identcpu.c standard -arm/arm/in_cksum.c optionalinet -arm/arm/in_cksum_arm.S optionalinet +arm/arm/in_cksum.c optionalinet | inet6 +arm/arm/in_cksum_arm.S optionalinet | inet6 arm/arm/intr.c standard arm/arm/locore.S standardno-obj arm/arm/machdep.c standard Modified: head/sys/conf/files.i386 == --- head/sys/conf/files.i386Wed Apr 20 11:17:21 2011(r220884) +++ head/sys/conf/files.i386Wed Apr 20 12:58:30 2011(r220885) @@ -283,7 +283,7 @@ i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode i386/i386/i686_mem.c optional mem i386/i386/identcpu.c standard -i386/i386/in_cksum.c optional inet +i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.cstandard i386/i386/intr_machdep.c standard i386/i386/io.c optional io Modified: head/sys/conf/files.ia64 == --- head/sys/conf/files.ia64Wed Apr 20 11:17:21 2011(r220884) +++ head/sys/conf/files.ia64Wed Apr 20 12:58:30 2011(r220885) @@ -85,7 +85,7 @@ ia64/ia64/emulate.c standard ia64/ia64/exception.S standard ia64/ia64/gdb_machdep.coptionalgdb ia64/ia64/highfp.c standard -ia64/ia64/in_cksum.c optionalinet +ia64/ia64/in_cksum.c optionalinet | inet6 ia64/ia64/interrupt.c standard ia64/ia64/iodev_machdep.c optionalio ia64/ia64/locore.S standardno-obj Modified: head/sys/conf/files.mips == --- head/sys/conf/files.mipsWed Apr 20 11:17:21 2011(r220884) +++ head/sys/conf/files.mipsWed Apr 20 12:58:30 2011(r220885) @@ -53,7 +53,7 @@ mips/mips/db_disasm.c optionalddb mips/mips/db_interface.c optionalddb mips/mips/db_trace.c optionalddb mips/mips/dump_machdep.c standard -mips/mips/in_cksum.c optionalinet +mips/mips/in_cksum.c optionalinet | inet6 mips/mips/locore.S standardno-obj mips/mips/minidump_machdep.c standard mips/mips/mem.coptionalmem Modified: head/sys/conf/files.pc98 == --- head/sys/conf/files.pc98Wed Apr 20 11:17:21 2011(r220884) +++ head/sys/conf/files.pc98Wed Apr 20 12:58:30 2011(r220885) @@ -142,7 +142,7 @@ i386/i386/exception.s standard i386/i386/gdb_machdep.c
Re: svn commit: r220885 - head/sys/conf
On Wed, 20 Apr 2011, Bjoern A. Zeeb wrote: Author: bz Date: Wed Apr 20 12:58:30 2011 New Revision: 220885 URL: http://svn.freebsd.org/changeset/base/220885 Log: Compile in in_cksum* implementations for both IPv6 and IPv6. IPv4 and IPv6 as Erwin noticed. While in_pseudo() etc. is often used in offloading feature support, in_cksum() is mostly used to fix some broken hardware. Keeping both around for the moment allows us to compile NIC drivers even in an IPv6 only environment without the need to mangle them with #ifdef INETs in a way they are not prepared for. This will leave some dead code paths that will not be exercised for IPv6. Note that the changes coming soon removing the inet dependency from drivers will break no-INET && no-INET6 (no-IP) kernels when those drivers are included which is kind of a step backwards but we don't have many people compiling no-IP kernels with the NIC drivers these days (apart from my universe builds) I guess. Sam had concerns about the inet dependency on drivers months back when I added them and he was right. The real fix is really to add the proper #ifdefs to the drivers in my view, in which cases i.e. TSO4 would not be announced or processed, etc. when there is no INET in the kernel, etc. But for all that to work and happen we'll need a better plan on how to handle all these features rightish in the future. We have way too much copy and paste in our drivers for all that. I'll defer this discussion though for a bit later in the year. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 3 days Modified: head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.ia64 head/sys/conf/files.mips head/sys/conf/files.pc98 head/sys/conf/files.powerpc head/sys/conf/files.sparc64 head/sys/conf/files.sun4v -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. ___ 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: r220886 - head/sys/cam/ata
Author: mav Date: Wed Apr 20 13:27:50 2011 New Revision: 220886 URL: http://svn.freebsd.org/changeset/base/220886 Log: Add basic support for DMA-capable ATA disks on DMA-incapable controller. This is really rare situation these days, but still may happen in embedded. Modified: head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_all.h == --- head/sys/cam/ata/ata_all.h Wed Apr 20 12:58:30 2011(r220885) +++ head/sys/cam/ata/ata_all.h Wed Apr 20 13:27:50 2011(r220886) @@ -35,6 +35,8 @@ struct ccb_ataio; struct cam_periph; union ccb; +#defineSID_DMA 0x10/* Abuse inq_flags bit to track enabled DMA. */ + struct ata_cmd { u_int8_tflags; /* ATA command flags */ #defineCAM_ATAIO_48BIT 0x01/* Command has 48-bit format */ Modified: head/sys/cam/ata/ata_da.c == --- head/sys/cam/ata/ata_da.c Wed Apr 20 12:58:30 2011(r220885) +++ head/sys/cam/ata/ata_da.c Wed Apr 20 13:27:50 2011(r220886) @@ -751,7 +751,8 @@ adaregister(struct cam_periph *periph, v bioq_init(&softc->bio_queue); bioq_init(&softc->trim_queue); - if (cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA) + if (cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA && + (cgd->inq_flags & SID_DMA)) softc->flags |= ADA_FLAG_CAN_DMA; if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) softc->flags |= ADA_FLAG_CAN_48BIT; @@ -760,7 +761,7 @@ adaregister(struct cam_periph *periph, v if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT) softc->flags |= ADA_FLAG_CAN_POWERMGT; if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ && - cgd->inq_flags & SID_CmdQue) + (cgd->inq_flags & SID_DMA) && (cgd->inq_flags & SID_CmdQue)) softc->flags |= ADA_FLAG_CAN_NCQ; if (cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) { softc->flags |= ADA_FLAG_CAN_TRIM; Modified: head/sys/cam/ata/ata_xpt.c == --- head/sys/cam/ata/ata_xpt.c Wed Apr 20 12:58:30 2011(r220885) +++ head/sys/cam/ata/ata_xpt.c Wed Apr 20 13:27:50 2011(r220886) @@ -388,6 +388,11 @@ negotiate: /* If SIM disagree - renegotiate. */ if (mode != wantmode) goto negotiate; + /* Remember what transport thinks about DMA. */ + if (mode < ATA_DMA) + path->device->inq_flags &= ~SID_DMA; + else + path->device->inq_flags |= SID_DMA; cam_fill_ataio(ataio, 1, probedone, ___ 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: r220887 - head/sbin/camcontrol
Author: mav Date: Wed Apr 20 14:16:22 2011 New Revision: 220887 URL: http://svn.freebsd.org/changeset/base/220887 Log: When calling XPT_REL_SIMQ to ajust number of openings, do not try to really release device. We haven't frozen the device before and attempt to release it will at least cause warning message from kernel. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c == --- head/sbin/camcontrol/camcontrol.c Wed Apr 20 13:27:50 2011 (r220886) +++ head/sbin/camcontrol/camcontrol.c Wed Apr 20 14:16:22 2011 (r220887) @@ -2755,6 +2755,7 @@ tagcontrol(struct cam_device *device, in bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_relsim) - sizeof(struct ccb_hdr)); ccb->ccb_h.func_code = XPT_REL_SIMQ; + ccb->ccb_h.flags = CAM_DEV_QFREEZE; ccb->crs.release_flags = RELSIM_ADJUST_OPENINGS; ccb->crs.openings = numtags; ___ 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: r220888 - head/lib/libthr/thread
Author: rstone Date: Wed Apr 20 14:19:34 2011 New Revision: 220888 URL: http://svn.freebsd.org/changeset/base/220888 Log: r179417 introduced a bug into pthread_once(). Previously pthread_once() used a global pthread_mutex_t for synchronization. r179417 replaced that with an implementation that directly used atomic instructions and thr_* syscalls to synchronize callers to pthread_once. However, calling pthread_mutex_lock on the global mutex implicitly ensured that _thr_check_init() had been called but with r179417 this was no longer guaranteed. This meant that if you were unlucky enough to have your first call into libthr be a call to pthread_once(), you would segfault when trying to access the pointer returned by _get_curthread(). The fix is to explicitly call _thr_check_init() from pthread_once(). Reviewed by: davidxu Approved by: emaste (mentor) MFC after:1 week Modified: head/lib/libthr/thread/thr_once.c Modified: head/lib/libthr/thread/thr_once.c == --- head/lib/libthr/thread/thr_once.c Wed Apr 20 14:16:22 2011 (r220887) +++ head/lib/libthr/thread/thr_once.c Wed Apr 20 14:19:34 2011 (r220888) @@ -64,6 +64,8 @@ _pthread_once(pthread_once_t *once_contr struct pthread *curthread; int state; + _thr_check_init(); + for (;;) { state = once_control->state; if (state == ONCE_DONE) ___ 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: r220877 - head/sys/fs/nfsclient
On Wed, Apr 20, 2011 at 08:09:32AM -0400, Rick Macklem wrote: > > > + tmp_off = uio->uio_offset + uio->uio_resid; > > > + mtx_lock(&nmp->nm_mtx); > > > + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) { > > > + mtx_unlock(&nmp->nm_mtx); > > > return (EFBIG); > > > + } > > > + mtx_unlock(&nmp->nm_mtx); > > > > I don't think you need the lock to protect nm_maxfilesize. Can it > > change > > from under us? My guess is that it is set on mount time and is not > > modified afterwards. > > > Good question. > For NFSv3 - it is only modified by the first fsinfo RPC and that normally > happens at mount time, as you guessed above. (This is consistent with > RFC1813, which defines the fsinfo RPC as getting non-volatile > information.) > For NFSv4 - it gets it each time VFS_STATFS() happens. I am not sure that > this is correct, but I don't know of anywhere in RFC3530 where it states > that this attribute will not change. In practice, I suspect that servers > seldom, if ever, change it. > > So, it is unlikely to change and I'd be comfortable taking the mutex lock > off the check for it, if others are? (As you might be aware, I started a > thread on hackers-freebsd@ where my question was basically "do you need to > mutex lock when you read a global variable". My main concern there was a > case that I'm working on w.r.t. forced dismounts. jhb@ suggested that he > thinks it is good practice to always lock, to play it safe. At least that > was my interpretation?) This is not that easy, I'm afraid. You need to ask yourself a question what you are trying to protect from. Here, the mutex only guarantees to have consistent view of the nm_maxfilesize field. For example if this field modification wouldn't be atomic you would need the mutex to ensure that the value is correct. Imagine a situation where it is modifed not by simple 'a = b', but by something like this: mtx_lock(&nmp->nm_mtx); nmp->nm_maxfilesize = some_32bit_array[0]; nmp->nm_maxfilesize |= some_32bit_array[1] << 32; mtx_unlock(&nmp->nm_mtx); To read that properly you need a mutex to ensure you won't read the value between those two operations. If it is not the case - its modification is atomic and reading it is atomic then you don't need mutex to read the value as it will always be consistent. The question is what will happen if it changes after you read it. thread0 thread1 --- --- mtx_lock(&nmp->nm_mtx); nmp->nm_maxfilesize = 8192; mtx_unlock(&nmp->nm_mtx); mtx_lock(&nmp->nm_mtx); if (tmp_off > nmp->nm_maxfilesize) { mtx_unlock(&nmp->nm_mtx); return (EFBIG); } mtx_unlock(&nmp->nm_mtx); mtx_lock(&nmp->nm_mtx); nmp->nm_maxfilesize = 2048; mtx_unlock(&nmp->nm_mtx); Now, if tmp_off is 4096 what will happen if you have a race like the above? Is it critical? Then you need to protect with this mutex as well. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com pgpPHsUbiyFY3.pgp Description: PGP signature
svn commit: r220889 - head/sbin/hastd
Author: pjd Date: Wed Apr 20 16:36:59 2011 New Revision: 220889 URL: http://svn.freebsd.org/changeset/base/220889 Log: Timeout must be positive. MFC after:1 week Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y == --- head/sbin/hastd/parse.y Wed Apr 20 14:19:34 2011(r220888) +++ head/sbin/hastd/parse.y Wed Apr 20 16:36:59 2011(r220889) @@ -461,6 +461,10 @@ compression_type: timeout_statement: TIMEOUT NUM { + if ($2 <= 0) { + pjdlog_error("Negative or zero timeout."); + return (1); + } switch (depth) { case 0: depth0_timeout = $2; ___ 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: r220890 - head/sbin/hastd
Author: pjd Date: Wed Apr 20 16:38:05 2011 New Revision: 220890 URL: http://svn.freebsd.org/changeset/base/220890 Log: If we act in different role than requested by the remote node, log it as a warning and not an error. MFC after:1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c == --- head/sbin/hastd/hastd.c Wed Apr 20 16:36:59 2011(r220889) +++ head/sbin/hastd/hastd.c Wed Apr 20 16:38:05 2011(r220890) @@ -730,7 +730,7 @@ listen_accept(void) } /* Is the resource marked as secondary? */ if (res->hr_role != HAST_ROLE_SECONDARY) { - pjdlog_error("We act as %s for the resource and not as %s as requested by %s.", + pjdlog_warning("We act as %s for the resource and not as %s as requested by %s.", role2str(res->hr_role), role2str(HAST_ROLE_SECONDARY), raddr); nv_add_stringf(nverr, "errmsg", ___ 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: r220891 - head/sys/dev/iwn
Author: bschmidt Date: Wed Apr 20 16:59:27 2011 New Revision: 220891 URL: http://svn.freebsd.org/changeset/base/220891 Log: Add basic support for advanced bluetooth coexistence required for 6005 gen2b (1030/6030) adapters. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Wed Apr 20 16:38:05 2011(r220890) +++ head/sys/dev/iwn/if_iwn.c Wed Apr 20 16:59:27 2011(r220891) @@ -253,6 +253,7 @@ static void iwn_tune_sensitivity(struct static int iwn_send_sensitivity(struct iwn_softc *); static int iwn_set_pslevel(struct iwn_softc *, int, int, int); static int iwn_send_btcoex(struct iwn_softc *); +static int iwn_send_advanced_btcoex(struct iwn_softc *); static int iwn_config(struct iwn_softc *); static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *); @@ -816,6 +817,8 @@ iwn5000_attach(struct iwn_softc *sc, uin case IWN_HW_REV_TYPE_6005: sc->limits = &iwn6000_sensitivity_limits; sc->fwname = "iwn6005fw"; + if (pid != 0x0082 && pid != 0x0085) + sc->sc_flags |= IWN_FLAG_ADV_BTCOEX; break; default: device_printf(sc->sc_dev, "adapter type %d not supported\n", @@ -4721,6 +4724,63 @@ iwn_send_btcoex(struct iwn_softc *sc) } static int +iwn_send_advanced_btcoex(struct iwn_softc *sc) +{ + static const uint32_t btcoex_3wire[12] = { + 0x, 0x, 0xaeaa, 0x, + 0xcc00ff28, 0x, 0xcc00, 0x, + 0xc0004000, 0x4000, 0xf0005000, 0xf0005000, + }; + struct iwn6000_btcoex_config btconfig; + struct iwn_btcoex_priotable btprio; + struct iwn_btcoex_prot btprot; + int error, i; + + memset(&btconfig, 0, sizeof btconfig); + btconfig.flags = 145; + btconfig.max_kill = 5; + btconfig.bt3_t7_timer = 1; + btconfig.kill_ack = htole32(0x); + btconfig.kill_cts = htole32(0x); + btconfig.sample_time = 2; + btconfig.bt3_t2_timer = 0xc; + for (i = 0; i < 12; i++) + btconfig.lookup_table[i] = htole32(btcoex_3wire[i]); + btconfig.valid = htole16(0xff); + btconfig.prio_boost = 0xf0; + DPRINTF(sc, IWN_DEBUG_RESET, + "%s: configuring advanced bluetooth coexistence\n", __func__); + error = iwn_cmd(sc, IWN_CMD_BT_COEX, &btconfig, sizeof(btconfig), 1); + if (error != 0) + return error; + + memset(&btprio, 0, sizeof btprio); + btprio.calib_init1 = 0x6; + btprio.calib_init2 = 0x7; + btprio.calib_periodic_low1 = 0x2; + btprio.calib_periodic_low2 = 0x3; + btprio.calib_periodic_high1 = 0x4; + btprio.calib_periodic_high2 = 0x5; + btprio.dtim = 0x6; + btprio.scan52 = 0x8; + btprio.scan24 = 0xa; + error = iwn_cmd(sc, IWN_CMD_BT_COEX_PRIOTABLE, &btprio, sizeof(btprio), + 1); + if (error != 0) + return error; + + /* Force BT state machine change. */ + memset(&btprot, 0, sizeof btprio); + btprot.open = 1; + btprot.type = 1; + error = iwn_cmd(sc, IWN_CMD_BT_COEX_PROT, &btprot, sizeof(btprot), 1); + if (error != 0) + return error; + btprot.open = 0; + return iwn_cmd(sc, IWN_CMD_BT_COEX_PROT, &btprot, sizeof(btprot), 1); +} + +static int iwn_config(struct iwn_softc *sc) { struct iwn_ops *ops = &sc->ops; @@ -4756,7 +4816,10 @@ iwn_config(struct iwn_softc *sc) } /* Configure bluetooth coexistence. */ - error = iwn_send_btcoex(sc); + if (sc->sc_flags & IWN_FLAG_ADV_BTCOEX) + error = iwn_send_advanced_btcoex(sc); + else + error = iwn_send_btcoex(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: could not configure bluetooth coexistence, error %d\n", Modified: head/sys/dev/iwn/if_iwnreg.h == --- head/sys/dev/iwn/if_iwnreg.hWed Apr 20 16:38:05 2011 (r220890) +++ head/sys/dev/iwn/if_iwnreg.hWed Apr 20 16:59:27 2011 (r220891) @@ -434,6 +434,8 @@ struct iwn_tx_cmd { #define IWN_CMD_SET_CRITICAL_TEMP 164 #define IWN_CMD_SET_SENSITIVITY168 #define IWN_CMD_PHY_CALIB 176 +#define IWN_CMD_BT_COEX_PRIOTABLE 204 +#define IWN_CMD_BT_COEX_PROT 205 uint8_t flags; uint8_t idx; @@ -829,7 +831,7 @@ struct iwn5000_cmd_txpower { uint8_t reserved; } __packed; -/* Structure for command IWN_CMD_BLUETOOTH. */ +/* Structures for command IWN_CMD_BLUETOOTH. */ struc
svn commit: r220894 - head/sys/dev/iwn
Author: bschmidt Date: Wed Apr 20 17:43:20 2011 New Revision: 220894 URL: http://svn.freebsd.org/changeset/base/220894 Log: The 6000 series gen2 adapters have 2 firmware images, one with advanced btcoex support and one without. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Wed Apr 20 17:34:09 2011(r220893) +++ head/sys/dev/iwn/if_iwn.c Wed Apr 20 17:43:20 2011(r220894) @@ -816,9 +816,11 @@ iwn5000_attach(struct iwn_softc *sc, uin break; case IWN_HW_REV_TYPE_6005: sc->limits = &iwn6000_sensitivity_limits; - sc->fwname = "iwn6005fw"; - if (pid != 0x0082 && pid != 0x0085) + if (pid != 0x0082 && pid != 0x0085) { + sc->fwname = "iwn6000g2bfw"; sc->sc_flags |= IWN_FLAG_ADV_BTCOEX; + } else + sc->fwname = "iwn6000g2afw"; break; default: device_printf(sc->sc_dev, "adapter type %d not supported\n", ___ 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: r220895 - head/sys/dev/iwn
Author: bschmidt Date: Wed Apr 20 17:49:05 2011 New Revision: 220895 URL: http://svn.freebsd.org/changeset/base/220895 Log: Now that all bits are in for 1030/6230 adapters enable those. While here pull the adapter names from the Linux driver and sort the list by ID. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Wed Apr 20 17:43:20 2011(r220894) +++ head/sys/dev/iwn/if_iwn.c Wed Apr 20 17:49:05 2011(r220895) @@ -78,38 +78,31 @@ struct iwn_ident { const char *name; }; -static const struct iwn_ident iwn_ident_table [] = { - { 0x8086, 0x4229, "Intel(R) PRO/Wireless 4965BGN" }, - { 0x8086, 0x422D, "Intel(R) PRO/Wireless 4965BGN" }, - { 0x8086, 0x4230, "Intel(R) PRO/Wireless 4965BGN" }, - { 0x8086, 0x4233, "Intel(R) PRO/Wireless 4965BGN" }, - { 0x8086, 0x4232, "Intel(R) PRO/Wireless 5100" }, - { 0x8086, 0x4237, "Intel(R) PRO/Wireless 5100" }, - { 0x8086, 0x423C, "Intel(R) PRO/Wireless 5150" }, - { 0x8086, 0x423D, "Intel(R) PRO/Wireless 5150" }, - { 0x8086, 0x4235, "Intel(R) PRO/Wireless 5300" }, - { 0x8086, 0x4236, "Intel(R) PRO/Wireless 5300" }, - { 0x8086, 0x423A, "Intel(R) PRO/Wireless 5350" }, - { 0x8086, 0x423B, "Intel(R) PRO/Wireless 5350" }, - { 0x8086, 0x0083, "Intel(R) PRO/Wireless 1000" }, - { 0x8086, 0x0084, "Intel(R) PRO/Wireless 1000" }, - { 0x8086, 0x008D, "Intel(R) PRO/Wireless 6000" }, - { 0x8086, 0x008E, "Intel(R) PRO/Wireless 6000" }, - { 0x8086, 0x4238, "Intel(R) PRO/Wireless 6000" }, - { 0x8086, 0x4239, "Intel(R) PRO/Wireless 6000" }, - { 0x8086, 0x422B, "Intel(R) PRO/Wireless 6000" }, - { 0x8086, 0x422C, "Intel(R) PRO/Wireless 6000" }, - { 0x8086, 0x0087, "Intel(R) PRO/Wireless 6250" }, - { 0x8086, 0x0089, "Intel(R) PRO/Wireless 6250" }, - { 0x8086, 0x0082, "Intel(R) PRO/Wireless 6205a" }, - { 0x8086, 0x0085, "Intel(R) PRO/Wireless 6205a" }, -#ifdef notyet - { 0x8086, 0x008a, "Intel(R) PRO/Wireless 6205b" }, - { 0x8086, 0x008b, "Intel(R) PRO/Wireless 6205b" }, - { 0x8086, 0x008f, "Intel(R) PRO/Wireless 6205b" }, - { 0x8086, 0x0090, "Intel(R) PRO/Wireless 6205b" }, - { 0x8086, 0x0091, "Intel(R) PRO/Wireless 6205b" }, -#endif +static const struct iwn_ident iwn_ident_table[] = { + { 0x8086, 0x0082, "Intel(R) Centrino(R) Advanced-N 6205" }, + { 0x8086, 0x0083, "Intel(R) Centrino(R) Wireless-N 1000" }, + { 0x8086, 0x0084, "Intel(R) Centrino(R) Wireless-N 1000" }, + { 0x8086, 0x0085, "Intel(R) Centrino(R) Advanced-N 6205" }, + { 0x8086, 0x0087, "Intel(R) Centrino(R) Advanced-N + WiMAX 6250" }, + { 0x8086, 0x0089, "Intel(R) Centrino(R) Advanced-N + WiMAX 6250" }, + { 0x8086, 0x008a, "Intel(R) Centrino(R) Wireless-N 1030" }, + { 0x8086, 0x008b, "Intel(R) Centrino(R) Wireless-N 1030" }, + { 0x8086, 0x0090, "Intel(R) Centrino(R) Advanced-N 6230" }, + { 0x8086, 0x0091, "Intel(R) Centrino(R) Advanced-N 6230" }, + { 0x8086, 0x4229, "Intel(R) Wireless WiFi Link 4965" }, + { 0x8086, 0x422b, "Intel(R) Centrino(R) Ultimate-N 6300" }, + { 0x8086, 0x422c, "Intel(R) Centrino(R) Advanced-N 6200" }, + { 0x8086, 0x4230, "Intel(R) Wireless WiFi Link 4965" }, + { 0x8086, 0x4232, "Intel(R) WiFi Link 5100" }, + { 0x8086, 0x4235, "Intel(R) Ultimate N WiFi Link 5300" }, + { 0x8086, 0x4236, "Intel(R) Ultimate N WiFi Link 5300" }, + { 0x8086, 0x4237, "Intel(R) WiFi Link 5100" }, + { 0x8086, 0x4238, "Intel(R) Centrino(R) Ultimate-N 6300" }, + { 0x8086, 0x4239, "Intel(R) Centrino(R) Advanced-N 6200" }, + { 0x8086, 0x423a, "Intel(R) WiMAX/WiFi Link 5350"}, + { 0x8086, 0x423b, "Intel(R) WiMAX/WiFi Link 5350"}, + { 0x8086, 0x423c, "Intel(R) WiMAX/WiFi Link 5150"}, + { 0x8086, 0x423d, "Intel(R) WiMAX/WiFi Link 5150"}, { 0, 0, NULL } }; ___ 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: r220896 - head/share/man/man4
Author: bschmidt Date: Wed Apr 20 17:53:39 2011 New Revision: 220896 URL: http://svn.freebsd.org/changeset/base/220896 Log: Add ref to the latest firmware additions. Modified: head/share/man/man4/iwnfw.4 Modified: head/share/man/man4/iwnfw.4 == --- head/share/man/man4/iwnfw.4 Wed Apr 20 17:49:05 2011(r220895) +++ head/share/man/man4/iwnfw.4 Wed Apr 20 17:53:39 2011(r220896) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2010 +.Dd April 20, 2011 .Dt IWNFW 4 .Os .Sh NAME @@ -45,6 +45,8 @@ of the following: .Cd "device iwn5000fw" .Cd "device iwn5150fw" .Cd "device iwn6000fw" +.Cd "device iwn6000g2afw" +.Cd "device iwn6000g2bfw" .Cd "device iwn6050fw" .Ed .Pp @@ -57,6 +59,8 @@ iwn1000fw_load="YES" iwn5000fw_load="YES" iwn5150fw_load="YES" iwn6000fw_load="YES" +iwn6000g2afw_load="YES" +iwn6000g2bfw_load="YES" iwn6050fw_load="YES" .Ed .Sh DESCRIPTION ___ 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: r220897 - head/sys/dev/cxgbe
Author: np Date: Wed Apr 20 18:04:34 2011 New Revision: 220897 URL: http://svn.freebsd.org/changeset/base/220897 Log: Use the correct free routine when destroying a control queue. X-MFC after: r220873 Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c == --- head/sys/dev/cxgbe/t4_sge.c Wed Apr 20 17:53:39 2011(r220896) +++ head/sys/dev/cxgbe/t4_sge.c Wed Apr 20 18:04:34 2011(r220897) @@ -1470,7 +1470,7 @@ free_ctrlq(struct adapter *sc, struct sg struct sge_eq *eq = &ctrlq->eq; if (eq->flags & (EQ_ALLOCATED | EQ_STARTED)) { - rc = -t4_eth_eq_free(sc, sc->mbox, sc->pf, 0, eq->cntxt_id); + rc = -t4_ctrl_eq_free(sc, sc->mbox, sc->pf, 0, eq->cntxt_id); if (rc != 0) { device_printf(sc->dev, "failed to free ctrl queue %p: %d\n", eq, rc); ___ 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: r220898 - head/sbin/hastd
Author: pjd Date: Wed Apr 20 18:43:28 2011 New Revision: 220898 URL: http://svn.freebsd.org/changeset/base/220898 Log: When we become primary, we connect to the remote and expect it to be in secondary role. It is possible that the remote node is primary, but only because there was a role change and it didn't finish cleaning up (unmounting file systems, etc.). If we detect such situation, wait for the remote node to switch the role to secondary before accepting I/Os. If we don't wait for it in that case, we will most likely cause split-brain. MFC after:1 week Modified: head/sbin/hastd/hastd.c head/sbin/hastd/primary.c Modified: head/sbin/hastd/hastd.c == --- head/sbin/hastd/hastd.c Wed Apr 20 18:04:34 2011(r220897) +++ head/sbin/hastd/hastd.c Wed Apr 20 18:43:28 2011(r220898) @@ -736,6 +736,13 @@ listen_accept(void) nv_add_stringf(nverr, "errmsg", "Remote node acts as %s for the resource and not as %s.", role2str(res->hr_role), role2str(HAST_ROLE_SECONDARY)); + if (res->hr_role == HAST_ROLE_PRIMARY) { + /* +* If we act as primary request the other side to wait +* for us for a bit, as may might be finishing cleanups. +*/ + nv_add_uint8(nverr, 1, "wait"); + } goto fail; } /* Does token (if exists) match? */ Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Wed Apr 20 18:04:34 2011(r220897) +++ head/sbin/hastd/primary.c Wed Apr 20 18:43:28 2011(r220898) @@ -219,6 +219,7 @@ static pthread_cond_t range_regular_cond static struct rangelocks *range_sync; static bool range_sync_wait; static pthread_cond_t range_sync_cond; +static bool fullystarted; static void *ggate_recv_thread(void *arg); static void *local_send_thread(void *arg); @@ -524,7 +525,7 @@ primary_connect(struct hast_resource *re return (0); } -static bool +static int init_remote(struct hast_resource *res, struct proto_conn **inp, struct proto_conn **outp) { @@ -537,6 +538,7 @@ init_remote(struct hast_resource *res, s int64_t datasize; uint32_t mapsize; size_t size; + int error; PJDLOG_ASSERT((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL)); PJDLOG_ASSERT(real_remote(res)); @@ -545,7 +547,9 @@ init_remote(struct hast_resource *res, s errmsg = NULL; if (primary_connect(res, &out) == -1) - return (false); + return (ECONNREFUSED); + + error = ECONNABORTED; /* * First handshake step. @@ -577,6 +581,8 @@ init_remote(struct hast_resource *res, s errmsg = nv_get_string(nvin, "errmsg"); if (errmsg != NULL) { pjdlog_warning("%s", errmsg); + if (nv_exists(nvin, "wait")) + error = EBUSY; nv_free(nvin); goto close; } @@ -734,14 +740,14 @@ init_remote(struct hast_resource *res, s res->hr_remoteout = out; } event_send(res, EVENT_CONNECT); - return (true); + return (0); close: if (errmsg != NULL && strcmp(errmsg, "Split-brain condition!") == 0) event_send(res, EVENT_SPLITBRAIN); proto_close(out); if (in != NULL) proto_close(in); - return (false); + return (error); } static void @@ -920,8 +926,30 @@ hastd_primary(struct hast_resource *res) */ error = pthread_create(&td, NULL, ctrl_thread, res); PJDLOG_ASSERT(error == 0); - if (real_remote(res) && init_remote(res, NULL, NULL)) - sync_start(); + if (real_remote(res)) { + error = init_remote(res, NULL, NULL); + if (error == 0) { + sync_start(); + } else if (error == EBUSY) { + time_t start = time(NULL); + + pjdlog_warning("Waiting for remote node to become %s for %ds.", + role2str(HAST_ROLE_SECONDARY), + res->hr_timeout); + for (;;) { + sleep(1); + error = init_remote(res, NULL, NULL); + if (error != EBUSY) + break; + if (time(NULL) > start + res->hr_timeout) + break; + } + if (error == EBUSY) { + pjdlog_warning("Remote node is still %s, starting anyway.", +
svn commit: r220899 - head/sbin/hastd
Author: pjd Date: Wed Apr 20 18:49:12 2011 New Revision: 220899 URL: http://svn.freebsd.org/changeset/base/220899 Log: Correct comment. MFC after:1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c == --- head/sbin/hastd/hastd.c Wed Apr 20 18:43:28 2011(r220898) +++ head/sbin/hastd/hastd.c Wed Apr 20 18:49:12 2011(r220899) @@ -739,7 +739,7 @@ listen_accept(void) if (res->hr_role == HAST_ROLE_PRIMARY) { /* * If we act as primary request the other side to wait -* for us for a bit, as may might be finishing cleanups. +* for us a bit, as we might be finishing cleanups. */ nv_add_uint8(nverr, 1, "wait"); } ___ 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: r220900 - head/sys/dev/sound/usb
Author: hselasky Date: Wed Apr 20 19:41:08 2011 New Revision: 220900 URL: http://svn.freebsd.org/changeset/base/220900 Log: Only set the sample rate if the USB audio channel reports that it supports the frequency control request. MFC after:7 days Approved by: thompsa (mentor) Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c == --- head/sys/dev/sound/usb/uaudio.c Wed Apr 20 18:49:12 2011 (r220899) +++ head/sys/dev/sound/usb/uaudio.c Wed Apr 20 19:41:08 2011 (r220900) @@ -1360,11 +1360,10 @@ uaudio_chan_init(struct uaudio_softc *sc sc->sc_mixer_iface_index); /* -* If just one sampling rate is supported, -* no need to call "uaudio_set_speed()". -* Roland SD-90 freezes by a SAMPLING_FREQ_CONTROL request. +* Only set the sample rate if the channel reports that it +* supports the frequency control. */ - if (ch->p_asf1d->bSamFreqType != 1) { + if (ch->p_sed->bmAttributes & UA_SED_FREQ_CONTROL) { if (uaudio_set_speed(sc->sc_udev, endpoint, ch->sample_rate)) { /* * If the endpoint is adaptive setting the speed may ___ 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: r220877 - head/sys/fs/nfsclient
> > This is not that easy, I'm afraid. You need to ask yourself a question > what you are trying to protect from. Here, the mutex only guarantees > to > have consistent view of the nm_maxfilesize field. For example if this > field modification wouldn't be atomic you would need the mutex to > ensure > that the value is correct. > > Imagine a situation where it is modifed not by simple 'a = b', but by > something like this: > > mtx_lock(&nmp->nm_mtx); > nmp->nm_maxfilesize = some_32bit_array[0]; > nmp->nm_maxfilesize |= some_32bit_array[1] << 32; > mtx_unlock(&nmp->nm_mtx); > > To read that properly you need a mutex to ensure you won't read the > value between those two operations. > > If it is not the case - its modification is atomic and reading it is > atomic then you don't need mutex to read the value as it will always > be > consistent. Well, its value will be consistent, but not necessarily the "up to date" value set by another thread, if I understood alc@'s recent post. If you haven't yet read it, take a look at his post today on freebsd-hackers@ under the Subject Re: SMP question w.r.t. reading kernel variables If I understood his explanation, a thread must lock a mutex that the thread that modified the value has locked/unlocked before it is guaranteed to see that value for the variable instead of some stale memory cached value. (It can be any mutex, but it is probably much easier to use the same one that the modifying thread used during modification instead of finding some other mutex the same thread locked/unlocked after the modification.) > The question is what will happen if it changes after you > read it. > > thread0 thread1 > --- --- > > mtx_lock(&nmp->nm_mtx); > nmp->nm_maxfilesize = 8192; > mtx_unlock(&nmp->nm_mtx); > > mtx_lock(&nmp->nm_mtx); > if (tmp_off > nmp->nm_maxfilesize) { > mtx_unlock(&nmp->nm_mtx); > return (EFBIG); > } > mtx_unlock(&nmp->nm_mtx); > > mtx_lock(&nmp->nm_mtx); > nmp->nm_maxfilesize = 2048; > mtx_unlock(&nmp->nm_mtx); > > > > Now, if tmp_off is 4096 what will happen if you have a race like the > above? Is it critical? Then you need to protect with > this mutex as well. > Yes, understood. I need to look at the above check w.r.t. nm_maxfilesize further (such as discussed by bde@). If a server were to change the value during a read or write, all that should happen is that the server will return an error for an operation that goes past its specified maxfilesize. (As you noted, it is unlikely to ever change and, if it did change, I suspect the server would "grow" it and not "shrink" it.) The mtx_lock(&nmp->nm_mtx); and mtx_unlock(&nmp->nm_mtx); just ensures that it reads the "most up to date" value for the variable set by another thread. rick ___ 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: r220903 - in head: bin/sh tools/regression/bin/sh/expansion
Author: jilles Date: Wed Apr 20 22:24:54 2011 New Revision: 220903 URL: http://svn.freebsd.org/changeset/base/220903 Log: sh: Do not word split "${#parameter}". This is only a problem if IFS contains digits, which is unusual but valid. Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated as ${#parameter}. The underlying problem was that "${#parameter}" erroneously added CTLESC bytes before determining the length. This was properly fixed for PR bin/56147 but the incorrect fix was not backed out. Reported by: Seeker on forums.freebsd.org MFC after:2 weeks Added: head/tools/regression/bin/sh/expansion/length6.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c == --- head/bin/sh/parser.cWed Apr 20 22:10:44 2011(r220902) +++ head/bin/sh/parser.cWed Apr 20 22:24:54 2011(r220903) @@ -1572,8 +1572,8 @@ varname: pungetc(); } STPUTC('=', out); - if (subtype != VSLENGTH && (state[level].syntax == DQSYNTAX || - state[level].syntax == ARISYNTAX)) + if (state[level].syntax == DQSYNTAX || + state[level].syntax == ARISYNTAX) flags |= VSQUOTE; *(stackblock() + typeloc) = subtype | flags; if (subtype != VSNORMAL) { Added: head/tools/regression/bin/sh/expansion/length6.0 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/length6.0Wed Apr 20 22:24:54 2011(r220903) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +x='!@#$%^&*()[]' +[ ${#x} = 12 ] || echo bad 1 +[ "${#x}" = 12 ] || echo bad 2 +IFS=2 +[ ${#x} = 1 ] || echo bad 3 +[ "${#x}" = 12 ] || echo bad 4 ___ 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: r220905 - head/sys/dev/cxgbe
Author: np Date: Wed Apr 20 23:20:00 2011 New Revision: 220905 URL: http://svn.freebsd.org/changeset/base/220905 Log: Ring the freelist doorbell from within refill_fl. While here, fix a bug that could have allowed the hardware pidx to reach the cidx even though the freelist isn't empty. (Haven't actually seen this but it was there waiting to happen..) MFC after:1 week Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c == --- head/sys/dev/cxgbe/t4_sge.c Wed Apr 20 23:17:17 2011(r220904) +++ head/sys/dev/cxgbe/t4_sge.c Wed Apr 20 23:20:00 2011(r220905) @@ -114,7 +114,7 @@ static void oneseg_dma_callback(void *, static inline bool is_new_response(const struct sge_iq *, struct rsp_ctrl **); static inline void iq_next(struct sge_iq *); static inline void ring_fl_db(struct adapter *, struct sge_fl *); -static void refill_fl(struct sge_fl *, int); +static void refill_fl(struct adapter *, struct sge_fl *, int, int); static int alloc_fl_sdesc(struct sge_fl *); static void free_fl_sdesc(struct sge_fl *); static int alloc_tx_maps(struct sge_txq *); @@ -763,9 +763,7 @@ t4_eth_rx(void *arg) FL_LOCK(fl); fl->needed += i; if (fl->needed >= 32) - refill_fl(fl, 64); - if (fl->pending >= 32) - ring_fl_db(sc, fl); + refill_fl(sc, fl, 64, 32); FL_UNLOCK(fl); nextdesc: ndescs++; @@ -793,9 +791,7 @@ nextdesc: ndescs++; FL_LOCK(fl); if (fl->needed >= 32) - refill_fl(fl, 128); - if (fl->pending >= 8) - ring_fl_db(sc, fl); + refill_fl(sc, fl, 128, 8); FL_UNLOCK(fl); } @@ -1179,7 +1175,7 @@ alloc_iq_fl(struct port_info *pi, struct rc); return (rc); } - fl->needed = fl->cap - 1; /* one less to avoid cidx = pidx */ + fl->needed = fl->cap; c.iqns_to_fl0congen = htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE)); @@ -1222,9 +1218,7 @@ alloc_iq_fl(struct port_info *pi, struct sc->sge.eqmap[cntxt_id] = (void *)fl; FL_LOCK(fl); - refill_fl(fl, -1); - if (fl->pending >= 8) - ring_fl_db(sc, fl); + refill_fl(sc, fl, -1, 8); FL_UNLOCK(fl); } @@ -1692,24 +1686,31 @@ iq_next(struct sge_iq *iq) } } +#define FL_HW_IDX(x) ((x) >> 3) static inline void ring_fl_db(struct adapter *sc, struct sge_fl *fl) { int ndesc = fl->pending / 8; - /* Caller responsible for ensuring there's something useful to do */ - KASSERT(ndesc > 0, ("%s called with no useful work to do.", __func__)); + if (FL_HW_IDX(fl->pidx) == FL_HW_IDX(fl->cidx)) + ndesc--;/* hold back one credit */ + + if (ndesc <= 0) + return; /* nothing to do */ wmb(); t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), F_DBPRIO | V_QID(fl->cntxt_id) | V_PIDX(ndesc)); - - fl->pending &= 7; + fl->pending -= ndesc * 8; } +/* + * Fill up the freelist by upto nbufs and ring its doorbell if the number of + * buffers ready to be handed to the hardware >= dbthresh. + */ static void -refill_fl(struct sge_fl *fl, int nbufs) +refill_fl(struct adapter *sc, struct sge_fl *fl, int nbufs, int dbthresh) { __be64 *d = &fl->desc[fl->pidx]; struct fl_sdesc *sd = &fl->sdesc[fl->pidx]; @@ -1800,6 +1801,9 @@ recycled: d = fl->desc; } } + + if (fl->pending >= dbthresh) + ring_fl_db(sc, fl); } static 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: r220906 - head/sys/fs/nfsclient
Author: rmacklem Date: Wed Apr 20 23:25:18 2011 New Revision: 220906 URL: http://svn.freebsd.org/changeset/base/220906 Log: Add a check for VI_DOOMED at the beginning of nfscl_request() so that it won't try and use vp->v_mount to do an RPC during a forced dismount. There needs to be at least one more kernel commit, plus a change to the umount(8) command before forced dismounts will work for the experimental NFS client. MFC after:2 weeks Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c == --- head/sys/fs/nfsclient/nfs_clport.c Wed Apr 20 23:20:00 2011 (r220905) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Apr 20 23:25:18 2011 (r220906) @@ -819,6 +819,8 @@ nfscl_request(struct nfsrv_descript *nd, int ret, vers; struct nfsmount *nmp; + if ((vp->v_iflag & VI_DOOMED) != 0) + return (EPERM); nmp = VFSTONFS(vp->v_mount); if (nd->nd_flag & ND_NFSV4) vers = NFS_VER4; ___ 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: r220877 - head/sys/fs/nfsclient
On Wed, 20 Apr 2011, Pawel Jakub Dawidek wrote: On Wed, Apr 20, 2011 at 08:09:32AM -0400, Rick Macklem wrote: + tmp_off = uio->uio_offset + uio->uio_resid; + mtx_lock(&nmp->nm_mtx); + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) { + mtx_unlock(&nmp->nm_mtx); return (EFBIG); + } + mtx_unlock(&nmp->nm_mtx); I don't think you need the lock to protect nm_maxfilesize. Can it change from under us? My guess is that it is set on mount time and is not modified afterwards. I said the same in a private reply which was initially about overflow errors in the overflow checking, but expanded to also cover errors in the return values (EFBIG instead of EOF or EOVERFLOW for read()) and this point. Good question. For NFSv3 - it is only modified by the first fsinfo RPC and that normally happens at mount time, as you guessed above. (This is consistent with RFC1813, which defines the fsinfo RPC as getting non-volatile information.) For NFSv4 - it gets it each time VFS_STATFS() happens. I am not sure that this is correct, but I don't know of anywhere in RFC3530 where it states that this attribute will not change. In practice, I suspect that servers seldom, if ever, change it. So, it is unlikely to change and I'd be comfortable taking the mutex lock off the check for it, if others are? (As you might be aware, I started a thread on hackers-freebsd@ where my question was basically "do you need to mutex lock when you read a global variable". My main concern there was a case that I'm working on w.r.t. forced dismounts. jhb@ suggested that he thinks it is good practice to always lock, to play it safe. At least that was my interpretation?) This is not that easy, I'm afraid. You need to ask yourself a question what you are trying to protect from. Here, the mutex only guarantees to have consistent view of the nm_maxfilesize field. For example if this field modification wouldn't be atomic you would need the mutex to ensure that the value is correct. The modification isn't necessarily atomic since the field is a typedefed type. The actual type is 64 bits, so the modification happens to be atomic on 64 bit arches but not on 32 bit arches. Imagine a situation where it is modifed not by simple 'a = b', but by something like this: mtx_lock(&nmp->nm_mtx); nmp->nm_maxfilesize = some_32bit_array[0]; nmp->nm_maxfilesize |= some_32bit_array[1] << 32; mtx_unlock(&nmp->nm_mtx); To read that properly you need a mutex to ensure you won't read the value between those two operations. Modification of 64 bit values on 32 bit arches is essentially the same as a modification of an array consisting of 2 32 bit elements. However, for numeric values, it is very unlikely that the modification gives a fatally invalid in-between value, no matter which order the writes and reads occur. E.g., for some values, the upper bits might never be changed. Only modifications like incrementing from 0x to 0x1 may give fatally different values (this can give a value of 0 from a new value of 0 in the lower bits and an old value of 0 in the upper bits). If it is not the case - its modification is atomic and reading it is atomic then you don't need mutex to read the value as it will always be consistent. The question is what will happen if it changes after you read it. thread0 thread1 --- --- mtx_lock(&nmp->nm_mtx); nmp->nm_maxfilesize = 8192; mtx_unlock(&nmp->nm_mtx); mtx_lock(&nmp->nm_mtx); if (tmp_off > nmp->nm_maxfilesize) { mtx_unlock(&nmp->nm_mtx); return (EFBIG); } mtx_unlock(&nmp->nm_mtx); mtx_lock(&nmp->nm_mtx); nmp->nm_maxfilesize = 2048; mtx_unlock(&nmp->nm_mtx); Now, if tmp_off is 4096 what will happen if you have a race like the above? Is it critical? Then you need to protect with this mutex as well. Locking of the whole transaction is especially impossible for this field. nm_maxfilesize is from the server (except for local resource limits which may require reducing it). If it changes after being initialized, it is probably the server that changed it (since any change would be foot-shooting so you shouldn't do it locally). There is no way to prevent the server changing its limit. The copy of the limit in nm_maxfilesize may have become out of date slightly before it was written there, or between the write there and the read here, or after it is checked here, so the server may reject the write for many slightly different temporal reasons. Any reduction of these race windows or remote checks that they aren't there or remote locking to prevent them would be huge pessimizations. So we shouldn't do any locki
Re: svn commit: r220877 - head/sys/fs/nfsclient
On Wed, 20 Apr 2011, Rick Macklem wrote: Well, its value will be consistent, but not necessarily the "up to date" value set by another thread, if I understood alc@'s recent post. If you haven't yet read it, take a look at his post today on freebsd-hackers@ under the Subject Re: SMP question w.r.t. reading kernel variables I didn't look, but... If I understood his explanation, a thread must lock a mutex that the thread that modified the value has locked/unlocked before it is guaranteed to see that value for the variable instead of some stale memory cached value. (It can be any mutex, but it is probably much easier to use the same one that the modifying thread used during modification instead of finding some other mutex the same thread locked/unlocked after the modification.) I don't see how it can be "any" mutex. "Any" mutex will probably cause some sort of bus lock which will sync the readers and writers at the time of the mutex operation, but not afterwards. I think all that happens is that SMP code executes mutex operations _very_ often. This gives very short race windows which I think hide lots of bugs. Bruce ___ 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: r220907 - in head: sbin/ifconfig sys/net80211
Author: adrian Date: Thu Apr 21 03:47:40 2011 New Revision: 220907 URL: http://svn.freebsd.org/changeset/base/220907 Log: Change the MIMO userland export ABI to include flags, number of radio chains, extended EVM statistics and EXT channel data. ifconfig still displays 3 chains worth of ctl noise/rssi. Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/_ieee80211.h head/sys/net80211/ieee80211_node.c Modified: head/sbin/ifconfig/ifieee80211.c == --- head/sbin/ifconfig/ifieee80211.cWed Apr 20 23:25:18 2011 (r220906) +++ head/sbin/ifconfig/ifieee80211.cThu Apr 21 03:47:40 2011 (r220907) @@ -3139,11 +3139,13 @@ static void printmimo(const struct ieee80211_mimo_info *mi) { /* NB: don't muddy display unless there's something to show */ - if (mi->rssi[0] != 0 || mi->rssi[1] != 0 || mi->rssi[2] != 0) { + /* XXX should check flags and n_rx_chains */ + if (mi->rssi_ctl[0] != 0 || mi->rssi_ctl[1] != 0 || mi->rssi_ctl[2] != 0) { /* XXX ignore EVM for now */ + /* XXX ignore EXT for now */ printf(" (rssi %d:%d:%d nf %d:%d:%d)", - mi->rssi[0], mi->rssi[1], mi->rssi[2], - mi->noise[0], mi->noise[1], mi->noise[2]); + mi->rssi_ctl[0], mi->rssi_ctl[1], mi->rssi_ctl[2], + mi->noise_ctl[0], mi->noise_ctl[1], mi->noise_ctl[2]); } } Modified: head/sys/net80211/_ieee80211.h == --- head/sys/net80211/_ieee80211.h Wed Apr 20 23:25:18 2011 (r220906) +++ head/sys/net80211/_ieee80211.h Thu Apr 21 03:47:40 2011 (r220907) @@ -395,9 +395,14 @@ struct ieee80211_regdomain { * XXX This doesn't yet export both ctl/ext chain details */ struct ieee80211_mimo_info { - int8_t rssi[IEEE80211_MAX_CHAINS]; /* per-antenna rssi */ - int8_t noise[IEEE80211_MAX_CHAINS];/* per-antenna noise floor */ - uint8_t pad[2]; - uint32_tevm[3]; /* EVM data */ +uint16_t flags; /* IEEE80211_R_* flags */ +uint8_tn_rx_chains;/* number of RX chains involved */ + uint8_t pad[1]; + int8_t rssi_ctl[IEEE80211_MAX_CHAINS]; /* per-antenna rssi */ + int8_t noise_ctl[IEEE80211_MAX_CHAINS];/* per-antenna noise floor */ + int8_t rssi_ext[IEEE80211_MAX_CHAINS]; /* per-antenna ext rssi */ + int8_t noise_ext[IEEE80211_MAX_CHAINS];/* per-antenna ext noise floor */ + uint32_tevm[IEEE80211_MAX_CHAINS][IEEE80211_MAX_EVM_PILOTS]; + /* EVM data */ }; #endif /* _NET80211__IEEE80211_H_ */ Modified: head/sys/net80211/ieee80211_node.c == --- head/sys/net80211/ieee80211_node.c Wed Apr 20 23:25:18 2011 (r220906) +++ head/sys/net80211/ieee80211_node.c Thu Apr 21 03:47:40 2011 (r220907) @@ -1091,18 +1091,30 @@ node_getmimoinfo(const struct ieee80211_ bzero(info, sizeof(*info)); + /* XXX set flags - evm, ctl/ext data, etc. */ + info->n_rx_chains = ni->ni_mimo_chains; + for (i = 0; i < ni->ni_mimo_chains; i++) { + /* Ctl channel */ avgrssi = ni->ni_mimo_rssi_ctl[i]; if (avgrssi == IEEE80211_RSSI_DUMMY_MARKER) { - info->rssi[i] = 0; + info->rssi_ctl[i] = 0; } else { rssi = IEEE80211_RSSI_GET(avgrssi); - info->rssi[i] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi; + info->rssi_ctl[i] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi; } - info->noise[i] = ni->ni_mimo_noise_ctl[i]; - } + info->noise_ctl[i] = ni->ni_mimo_noise_ctl[i]; - /* XXX ext radios? */ + /* Ext channel */ + avgrssi = ni->ni_mimo_rssi_ext[i]; + if (avgrssi == IEEE80211_RSSI_DUMMY_MARKER) { + info->rssi_ext[i] = 0; + } else { + rssi = IEEE80211_RSSI_GET(avgrssi); + info->rssi_ext[i] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi; + } + info->noise_ext[i] = ni->ni_mimo_noise_ext[i]; + } /* XXX EVM? */ } ___ 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: r220908 - in head/sys: conf net80211
Author: adrian Date: Thu Apr 21 03:59:37 2011 New Revision: 220908 URL: http://svn.freebsd.org/changeset/base/220908 Log: Implement very basic ALQ logging for net80211. This is destined to be a lightweight and optional set of ALQ probes for debugging events which are just impossible to debug with printf/log (eg packet TX/RX handling; AMPDU handling.) The probes and operations themselves will appear in subsequent commits. Added: head/sys/net80211/ieee80211_alq.c (contents, props changed) head/sys/net80211/ieee80211_alq.h (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/files == --- head/sys/conf/files Thu Apr 21 03:47:40 2011(r220907) +++ head/sys/conf/files Thu Apr 21 03:59:37 2011(r220908) @@ -2577,6 +2577,7 @@ net80211/ieee80211_superg.c optional wla net80211/ieee80211_tdma.c optional wlan ieee80211_support_tdma net80211/ieee80211_wds.c optional wlan net80211/ieee80211_xauth.c optional wlan wlan_xauth +net80211/ieee80211_alq.c optional wlan ieee80211_alq netatalk/aarp.coptional netatalk netatalk/at_control.c optional netatalk netatalk/at_proto.coptional netatalk Modified: head/sys/conf/options == --- head/sys/conf/options Thu Apr 21 03:47:40 2011(r220907) +++ head/sys/conf/options Thu Apr 21 03:59:37 2011(r220908) @@ -834,6 +834,7 @@ IEEE80211_AMPDU_AGE opt_wlan.h IEEE80211_SUPPORT_MESH opt_wlan.h IEEE80211_SUPPORT_SUPERG opt_wlan.h IEEE80211_SUPPORT_TDMA opt_wlan.h +IEEE80211_ALQ opt_wlan.h # 802.11 TDMA support TDMA_SLOTLEN_DEFAULT opt_tdma.h Added: head/sys/net80211/ieee80211_alq.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net80211/ieee80211_alq.c Thu Apr 21 03:59:37 2011 (r220908) @@ -0,0 +1,144 @@ +/*- + * Copyright (c) 2011 Adrian Chadd, Xenion Lty Ltd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#ifdef __FreeBSD__ +__FBSDID("$FreeBSD$"); +#endif + +/* + * net80211 fast-logging support, primarily for debugging. + * + * This implements a single debugging queue which includes + * per-device enumeration where needed. + */ + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static struct alq *ieee80211_alq; +static int ieee80211_alq_lost; +static char ieee80211_alq_logfile[MAXPATHLEN] = "/tmp/net80211.log"; +static unsigned int ieee80211_alq_qsize = 64*1024; + +static int +ieee80211_alq_setlogging(int enable) +{ + int error; + + if (enable) { + if (ieee80211_alq) + alq_close(ieee80211_alq); + + error = alq_open(&ieee80211_alq, + ieee80211_alq_logfile, + curthread->td_ucred, + ALQ_DEFAULT_CMODE, + sizeof (struct ieee80211_alq_rec), + ieee80211_alq_qsize); + ieee80211_alq_lost = 0; + printf("net80211: logging to %s enabled\n", ieee80211_alq_logfile); + } else { + if (ieee80211_alq) + alq_close(ieee80211_alq); + ieee80211_alq = NULL; + printf("net80211: logging disabled\n"); + error =
svn commit: r220909 - in head/usr.sbin/pc-sysinstall: backend backend-query
Author: jpaetzel Date: Thu Apr 21 06:25:12 2011 New Revision: 220909 URL: http://svn.freebsd.org/changeset/base/220909 Log: - Allows using full device name paths, such as /dev/ad0 or /dev/mirror/gm0 in config files - Fixes some issues creating gmirror devices, including on GPT partitions - Bugfixes for ZFS mirroring - Enhanced GELI to work with a passphrase only, or key-file only - Bugfix to prevent crashing of PC-BSD Live media when checking for upgrade partitions Submitted by: Kris Moore Approved by: kib (mentor) Sponsored by: iXsystems Modified: head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh head/usr.sbin/pc-sysinstall/backend/functions.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh == --- head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh Thu Apr 21 03:59:37 2011(r220908) +++ head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh Thu Apr 21 06:25:12 2011(r220909) @@ -37,16 +37,22 @@ FSMNT="/mnt" # Get the freebsd version on this partition get_fbsd_ver() { - - VER="`file ${FSMNT}/bin/sh | grep 'for FreeBSD' | sed 's|for FreeBSD |;|g' | cut -d ';' -f 2 | cut -d ',' -f 1`" - if [ "$?" = "0" ] ; then -file ${FSMNT}/bin/sh | grep '32-bit' >/dev/null 2>/dev/null -if [ "${?}" = "0" ] ; then - echo "${1}: FreeBSD ${VER} (32bit)" -else - echo "${1}: FreeBSD ${VER} (64bit)" + sFiles="/bin/sh /boot/kernel/kernel" + for file in $sFiles + do + if [ ! -e "${FSMNT}/$file" ] ; then continue ; fi + + VER="`file ${FSMNT}/$file | grep 'for FreeBSD' | sed 's|for FreeBSD |;|g' | cut -d ';' -f 2 | cut -d ',' -f 1`" +if [ "$?" = "0" ] ; then + file ${FSMNT}/$file | grep '32-bit' >/dev/null 2>/dev/null + if [ "${?}" = "0" ] ; then +echo "${1}: FreeBSD ${VER} (32bit)" + else +echo "${1}: FreeBSD ${VER} (64bit)" + fi fi - fi +break + done } @@ -86,25 +92,8 @@ do fi mount -o ro ${_dsk} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} - if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then + if [ $? -eq 0 ] ; then get_fbsd_ver "`echo ${_dsk} | sed 's|/dev/||g'`" umount -f ${FSMNT} >/dev/null 2>/dev/null fi done - -# Now search for any ZFS root partitions -zpool import -o altroot=${FSMNT} -a - -# Unmount any auto-mounted stuff -umount_all_dir "${FSMNT}" - -# Get pools -_zps="`zpool list | grep -v 'NAME' | cut -d ' ' -f 1`" -for _zpools in ${_zps} -do - mount -o ro -t zfs ${_zpools} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} - if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then -get_fbsd_ver "${_zpools}" -umount -f ${FSMNT} >/dev/null 2>/dev/null - fi -done Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh == --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Thu Apr 21 03:59:37 2011(r220908) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Thu Apr 21 06:25:12 2011(r220909) @@ -101,7 +101,6 @@ setup_zfs_mirror_parts() if [ $? -eq 0 ] ; then echo "Setting up ZFS mirror disk $_zvars" >>${LOGOUT} init_gpt_full_disk "$_zvars" >/dev/null 2>/dev/null - rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null rc_halt "gpart add -t freebsd-zfs ${_zvars}" >/dev/null 2>/dev/null _nZFS="$_nZFS ${_zvars}p2" else @@ -319,7 +318,8 @@ setup_gpart_partitions() # Save this data to our partition config dir if [ "${_pType}" = "gpt" ] ; then -echo "${FS}:${MNT}:${ENC}:${PLABEL}:GPT:${XTRAOPTS}" >${PARTDIR}/${_pDisk}p${CURPART} + _dFile="`echo $_pDisk | sed 's|/|-|g'`" +echo "${FS}:${MNT}:${ENC}:${PLABEL}:GPT:${XTRAOPTS}" >${PARTDIR}/${_dFile}p${CURPART} # Clear out any headers sleep 2 @@ -327,18 +327,19 @@ setup_gpart_partitions() # If we have a enc password, save it as well if [ -n "${ENCPASS}" ] ; then - echo "${ENCPASS}" >${PARTDIR}-enc/${_pDisk}p${CURPART}-encpass + echo "${ENCPASS}" >${PARTDIR}-enc/${_dFile}p${CURPART}-encpass fi else # MBR Partition -echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}:${IMAGE}" >${PARTDIR}/${_wSlice}${PARTLETTER} + _dFile="`echo $_wSlice | sed 's|/|-|g'`" +echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}:${IMAGE}" >${PARTDIR}/${_dFile}${PARTLETTER} # Clear out any headers sleep 2 dd if=