svn commit: r299590 - head/sys/dev/bxe
Author: scottl Date: Fri May 13 05:57:21 2016 New Revision: 299590 URL: https://svnweb.freebsd.org/changeset/base/299590 Log: Don't jam the softc in the device_probe routine. The softc isn't owned by the driver here, so it shouldn't be accessed, let alone written to. Remove the nearby debug line, it's the only thing that depended on the softc, and it depended on it in a way that couldn't work in this part of the code. This fixes some reports of use-after-free and system instability with DEBUG_MEMGUARD enabled. Submitted by: Matthew Macy MFC after:3 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Fri May 13 05:49:02 2016(r299589) +++ head/sys/dev/bxe/bxe.c Fri May 13 05:57:21 2016(r299590) @@ -2454,14 +2454,11 @@ bxe_sp_post(struct bxe_softc *sc, static int bxe_probe(device_t dev) { -struct bxe_softc *sc; struct bxe_device_type *t; char *descbuf; uint16_t did, sdid, svid, vid; /* Find our device structure */ -sc = device_get_softc(dev); -sc->dev = dev; t = bxe_devs; /* Get the data for the device to be probed. */ @@ -2470,10 +2467,6 @@ bxe_probe(device_t dev) svid = pci_get_subvendor(dev); sdid = pci_get_subdevice(dev); -BLOGD(sc, DBG_LOAD, - "%s(); VID = 0x%04X, DID = 0x%04X, SVID = 0x%04X, " - "SDID = 0x%04X\n", __FUNCTION__, vid, did, svid, sdid); - /* Look through the list of known devices for a match. */ while (t->bxe_name != NULL) { if ((vid == t->bxe_vid) && (did == t->bxe_did) && ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299589 - head/usr.bin/catman
Author: truckman Date: Fri May 13 05:49:02 2016 New Revision: 299589 URL: https://svnweb.freebsd.org/changeset/base/299589 Log: Instead of ignoring the EEXIST from link(), unconditionally unlink the terget before calling link(). This should prevent links to an old copy of the file from being retained. Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c == --- head/usr.bin/catman/catman.cFri May 13 05:39:29 2016 (r299588) +++ head/usr.bin/catman/catman.cFri May 13 05:49:02 2016 (r299589) @@ -422,9 +422,11 @@ process_page(char *mandir, char *src, ch fprintf(stderr, "%slink %s -> %s\n", verbose ? "\t" : "", cat, link_name); } - if (!pretend) - if (link(link_name, cat) < 0 && errno != EEXIST) + if (!pretend) { + (void) unlink(cat); + if (link(link_name, cat) < 0) warn("%s %s: link", link_name, cat); + } return; } insert_hashtable(links, src_ino, src_dev, strdup(cat)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299588 - head/usr.sbin/binmiscctl
Author: truckman Date: Fri May 13 05:39:29 2016 New Revision: 299588 URL: https://svnweb.freebsd.org/changeset/base/299588 Log: Revert r299584: Mark usage() as __dead2 so that Coverity doesn't think that execution continues after the call and uses a negative array subscript. Requested by: bde Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c == --- head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 04:03:20 2016 (r299587) +++ head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 05:39:29 2016 (r299588) @@ -133,7 +133,7 @@ static char const *cmd_sysctl_name[] = { IBE_SYSCTL_NAME_LIST }; -static void __dead2 +static void usage(const char *format, ...) { va_list args; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299587 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc
Author: jasone Date: Fri May 13 04:03:20 2016 New Revision: 299587 URL: https://svnweb.freebsd.org/changeset/base/299587 Log: Update jemalloc to 4.2.0. Added: head/contrib/jemalloc/include/jemalloc/internal/ph.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/witness.h (contents, props changed) head/contrib/jemalloc/src/witness.c (contents, props changed) Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/base.h head/contrib/jemalloc/include/jemalloc/internal/bitmap.h head/contrib/jemalloc/include/jemalloc/internal/chunk.h head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h head/contrib/jemalloc/include/jemalloc/internal/ckh.h head/contrib/jemalloc/include/jemalloc/internal/ctl.h head/contrib/jemalloc/include/jemalloc/internal/extent.h head/contrib/jemalloc/include/jemalloc/internal/hash.h head/contrib/jemalloc/include/jemalloc/internal/huge.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/mb.h head/contrib/jemalloc/include/jemalloc/internal/mutex.h head/contrib/jemalloc/include/jemalloc/internal/nstime.h head/contrib/jemalloc/include/jemalloc/internal/pages.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/internal/rtree.h head/contrib/jemalloc/include/jemalloc/internal/stats.h head/contrib/jemalloc/include/jemalloc/internal/tcache.h head/contrib/jemalloc/include/jemalloc/internal/tsd.h head/contrib/jemalloc/include/jemalloc/internal/util.h head/contrib/jemalloc/include/jemalloc/internal/valgrind.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/base.c head/contrib/jemalloc/src/bitmap.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/chunk_mmap.c head/contrib/jemalloc/src/ckh.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/mutex.c head/contrib/jemalloc/src/nstime.c head/contrib/jemalloc/src/pages.c head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/quarantine.c head/contrib/jemalloc/src/rtree.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/tsd.c head/contrib/jemalloc/src/util.c head/lib/libc/stdlib/jemalloc/Makefile.inc Modified: head/contrib/jemalloc/ChangeLog == --- head/contrib/jemalloc/ChangeLog Fri May 13 02:58:11 2016 (r299586) +++ head/contrib/jemalloc/ChangeLog Fri May 13 04:03:20 2016 (r299587) @@ -4,6 +4,50 @@ brevity. Much more detail can be found https://github.com/jemalloc/jemalloc +* 4.2.0 (May 12, 2016) + + New features: + - Add the arena..reset mallctl, which makes it possible to discard all of +an arena's allocations in a single operation. (@jasone) + - Add the stats.retained and stats.arenas..retained statistics. (@jasone) + - Add the --with-version configure option. (@jasone) + - Support --with-lg-page values larger than actual page size. (@jasone) + + Optimizations: + - Use pairing heaps rather than red-black trees for various hot data +structures. (@djwatson, @jasone) + - Streamline fast paths of rtree operations. (@jasone) + - Optimize the fast paths of calloc() and [m,d,sd]allocx(). (@jasone) + - Decommit unused virtual memory if the OS does not overcommit. (@jasone) + - Specify MAP_NORESERVE on Linux if [heuristic] overcommit is active, in order +to avoid unfortunate interactions during fork(2). (@jasone) + + Bug fixes: + - Fix chunk accounting related to triggering gdump profiles. (@jasone) + - Link against librt for clock_gettime(2) if glibc < 2.17. (@jasone) + - Scale leak report summary according to sampling probability. (@jasone) + +* 4.1.1 (May 3, 2016) + + This bugfix release resolves a variety of mostly minor issues, though the + bitmap fix is critical for 64-bit Windows. + + Bug fixes: + - Fix the linear scan version of bitmap_sfu() to shift by the proper amount +even when sizeof(long) is not the same as sizeof(void *), as on 64-bit +Windows. (@jasone) + - Fix hashing functions to avoid unaligned memory accesses (and resulting +crashes). This is relevant at least to some ARM-based platforms. +(@rkmisra) + - Fix fork()-related lock rank ordering reversals. These reversals were +unlikely to cause deadlocks in practice except when heap profiling was +
svn commit: r299586 - head/usr.sbin/i2c
Author: pfg Date: Fri May 13 02:58:11 2016 New Revision: 299586 URL: https://svnweb.freebsd.org/changeset/base/299586 Log: i2c(8): uninitialized variable (UNINIT). If i2c_opt.width is somehow zero, the bufsize will be left uninitialized and make cause trouble later on. CID: 1331549 Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c == --- head/usr.sbin/i2c/i2c.c Fri May 13 01:52:41 2016(r299585) +++ head/usr.sbin/i2c/i2c.c Fri May 13 02:58:11 2016(r299586) @@ -294,7 +294,8 @@ i2c_write(char *dev, struct options i2c_ err_msg = "error: offset malloc"; goto err1; } - } + } else + bufsize = 0; switch(i2c_opt.mode) { case I2C_MODE_STOP_START: ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299585 - head/libexec/ftpd
On 13 May, To: src-committ...@freebsd.org wrote: > Author: truckman > Date: Fri May 13 01:52:41 2016 > New Revision: 299585 > URL: https://svnweb.freebsd.org/changeset/base/299585 > > Log: > Declare line[] in the outermost scope of retrieve() instead of > declaring it in an inner scope and then using it via a pointer > in the outer scope. > > Reported by:Coverity > CID:605895 MFC after: 1 week ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299585 - head/libexec/ftpd
Author: truckman Date: Fri May 13 01:52:41 2016 New Revision: 299585 URL: https://svnweb.freebsd.org/changeset/base/299585 Log: Declare line[] in the outermost scope of retrieve() instead of declaring it in an inner scope and then using it via a pointer in the outer scope. Reported by:Coverity CID:605895 Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c == --- head/libexec/ftpd/ftpd.cFri May 13 01:14:38 2016(r299584) +++ head/libexec/ftpd/ftpd.cFri May 13 01:52:41 2016(r299585) @@ -1671,14 +1671,14 @@ retrieve(char *cmd, char *name) struct stat st; int (*closefunc)(FILE *); time_t start; + char line[BUFSIZ]; if (cmd == 0) { fin = fopen(name, "r"), closefunc = fclose; st.st_size = 0; } else { - char line[BUFSIZ]; - - (void) snprintf(line, sizeof(line), cmd, name), name = line; + (void) snprintf(line, sizeof(line), cmd, name); + name = line; fin = ftpd_popen(line, "r"), closefunc = ftpd_pclose; st.st_size = -1; st.st_blksize = BUFSIZ; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299584 - head/usr.sbin/binmiscctl
On Fri, 13 May 2016, Don Lewis wrote: Log: Mark usage() as __dead2 so that Coverity doesn't think that execution continues after the call and uses a negative array subscript. Reported by: Coverity CID: 1305629 This was just a bug in Coverity. Now it is also a style bug. usage() doesn't return since it finishes with exit() and this is marked with __dead2. It is a style bug to declare usage() and similar functions that obviously don't return as __dead2. Thus can only be obvious only obvious for static function. Coverity should do more global checking and not need this markup for some extern functions. Even lint can do that. Only about 32 of 451 declarations of usage() in /usr/src have this style bug. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299584 - head/usr.sbin/binmiscctl
Author: truckman Date: Fri May 13 01:14:38 2016 New Revision: 299584 URL: https://svnweb.freebsd.org/changeset/base/299584 Log: Mark usage() as __dead2 so that Coverity doesn't think that execution continues after the call and uses a negative array subscript. Reported by: Coverity CID: 1305629 Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c == --- head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 00:58:05 2016 (r299583) +++ head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 01:14:38 2016 (r299584) @@ -133,7 +133,7 @@ static char const *cmd_sysctl_name[] = { IBE_SYSCTL_NAME_LIST }; -static void +static void __dead2 usage(const char *format, ...) { va_list args; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299583 - head/usr.sbin/ypldap
Author: truckman Date: Fri May 13 00:58:05 2016 New Revision: 299583 URL: https://svnweb.freebsd.org/changeset/base/299583 Log: Avoid indexing an array with a negative value. Reported by: Coverity CID: 971121 Modified: head/usr.sbin/ypldap/ber.c Modified: head/usr.sbin/ypldap/ber.c == --- head/usr.sbin/ypldap/ber.c Fri May 13 00:50:53 2016(r299582) +++ head/usr.sbin/ypldap/ber.c Fri May 13 00:58:05 2016(r299583) @@ -726,7 +726,7 @@ ber_scanf_elements(struct ber_element *b continue; case '}': case ')': - if (parent[level] == NULL) + if (level < 0 || parent[level] == NULL) goto fail; ber = parent[level--]; ret++; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299582 - head/usr.bin/rpcinfo
Author: truckman Date: Fri May 13 00:50:53 2016 New Revision: 299582 URL: https://svnweb.freebsd.org/changeset/base/299582 Log: Simplify some overly complex code so that both humans and Coverity have a better chance of understanding it. Reported by: Coverity CID: 1009684, 1006931 Modified: head/usr.bin/rpcinfo/rpcinfo.c Modified: head/usr.bin/rpcinfo/rpcinfo.c == --- head/usr.bin/rpcinfo/rpcinfo.c Fri May 13 00:26:14 2016 (r299581) +++ head/usr.bin/rpcinfo/rpcinfo.c Fri May 13 00:50:53 2016 (r299582) @@ -609,12 +609,13 @@ reply_proc(void *res, struct netbuf *who } else { hostname = hostbuf; } - if (!(uaddr = taddr2uaddr(nconf, who))) { - uaddr = UNKNOWN; - } - printf("%s\t%s\n", uaddr, hostname); - if (strcmp(uaddr, UNKNOWN)) + uaddr = taddr2uaddr(nconf, who); + if (uaddr == NULL) { + printf("%s\t%s\n", UNKNOWN, hostname); + } else { + printf("%s\t%s\n", uaddr, hostname); free((char *)uaddr); + } return (FALSE); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299581 - head/lib/libutil
Author: truckman Date: Fri May 13 00:26:14 2016 New Revision: 299581 URL: https://svnweb.freebsd.org/changeset/base/299581 Log: Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL terminated. Don't bother checking for truncation since the subsequent stat() call should detect that and fail. Reported by: Coverity CID: 1018189 MFC after:1 week Modified: head/lib/libutil/quotafile.c Modified: head/lib/libutil/quotafile.c == --- head/lib/libutil/quotafile.cFri May 13 00:17:57 2016 (r299580) +++ head/lib/libutil/quotafile.cFri May 13 00:26:14 2016 (r299581) @@ -124,7 +124,7 @@ quota_open(struct fstab *fs, int quotaty return (NULL); qf->fd = -1; qf->quotatype = quotatype; - strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); + strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); if (stat(qf->fsname, ) != 0) goto error; qf->dev = st.st_dev; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299580 - head/usr.sbin/timed/timed
Author: truckman Date: Fri May 13 00:17:57 2016 New Revision: 299580 URL: https://svnweb.freebsd.org/changeset/base/299580 Log: Use strlcpy() instead of strncpy() to ensure that ret->name is NUL terminated. The source and destination buffers are the same size and the source *should* be NUL terminated, but be paranoid. Reported by: Coverity CID: 1011274 MFC after:1 week Modified: head/usr.sbin/timed/timed/master.c Modified: head/usr.sbin/timed/timed/master.c == --- head/usr.sbin/timed/timed/master.c Fri May 13 00:02:03 2016 (r299579) +++ head/usr.sbin/timed/timed/master.c Fri May 13 00:17:57 2016 (r299580) @@ -623,7 +623,7 @@ addmach(char *name, struct sockaddr_in * } ret->addr = *addr; ret->ntp = ntp; - (void)strncpy(ret->name, name, sizeof(ret->name)); + (void)strlcpy(ret->name, name, sizeof(ret->name)); ret->good = good_host_name(name); ret->l_fwd = ret->l_bak = self.l_bak; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299579 - head/usr.sbin/edquota
Author: truckman Date: Fri May 13 00:02:03 2016 New Revision: 299579 URL: https://svnweb.freebsd.org/changeset/base/299579 Log: Use strlcpy() instead of strncpy() to ensure that qup->fsname is NUL terminated. Don't bother checking for truncation since the subsequent quota_read() should detect that and fail. Reported by: Coverity CID: 1009980 MFC after:1 week Modified: head/usr.sbin/edquota/edquota.c Modified: head/usr.sbin/edquota/edquota.c == --- head/usr.sbin/edquota/edquota.c Thu May 12 23:37:58 2016 (r299578) +++ head/usr.sbin/edquota/edquota.c Fri May 13 00:02:03 2016 (r299579) @@ -390,7 +390,7 @@ getprivs(long id, int quotatype, char *f if ((qup = (struct quotause *)calloc(1, sizeof(*qup))) == NULL) errx(2, "out of memory"); qup->qf = qf; - strncpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); + strlcpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); if (quota_read(qf, >dqblk, id) == -1) { warn("cannot read quotas on %s", fs->fs_file); freeprivs(qup); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299575 - head/sys/net80211
Wait a sec, I thought the DEBUG_REFCNT stuff worked? -a On 12 May 2016 at 15:17, Andriy Voskoboinykwrote: > Author: avos > Date: Thu May 12 22:17:00 2016 > New Revision: 299575 > URL: https://svnweb.freebsd.org/changeset/base/299575 > > Log: > net80211: drop some unused variables / local macros > > Most of them left after some commits (r178354, r191544, r287197 etc.); > some were never used. > > Found by: Clang Static Analyzer > > Modified: > head/sys/net80211/ieee80211_adhoc.c > head/sys/net80211/ieee80211_hostap.c > head/sys/net80211/ieee80211_hwmp.c > head/sys/net80211/ieee80211_mesh.c > head/sys/net80211/ieee80211_node.c > head/sys/net80211/ieee80211_output.c > head/sys/net80211/ieee80211_phy.c > head/sys/net80211/ieee80211_scan_sw.c > head/sys/net80211/ieee80211_sta.c > head/sys/net80211/ieee80211_wds.c > > Modified: head/sys/net80211/ieee80211_adhoc.c > == > --- head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:13:12 2016 > (r299574) > +++ head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:17:00 2016 > (r299575) > @@ -674,7 +674,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n > struct ieee80211com *ic = ni->ni_ic; > struct ieee80211_channel *rxchan = ic->ic_curchan; > struct ieee80211_frame *wh; > - uint8_t *frm, *efrm, *sfrm; > + uint8_t *frm, *efrm; > uint8_t *ssid, *rates, *xrates; > #if 0 > int ht_state_change = 0; > @@ -809,7 +809,6 @@ adhoc_recv_mgmt(struct ieee80211_node *n > * [tlv] extended supported rates > */ > ssid = rates = xrates = NULL; > - sfrm = frm; > while (efrm - frm > 1) { > IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, > return); > switch (*frm) { > > Modified: head/sys/net80211/ieee80211_hostap.c > == > --- head/sys/net80211/ieee80211_hostap.cThu May 12 22:13:12 2016 > (r299574) > +++ head/sys/net80211/ieee80211_hostap.cThu May 12 22:17:00 2016 > (r299575) > @@ -412,16 +412,8 @@ hostap_deliver_data(struct ieee80211vap > ieee80211_free_node(sta); > } > } > - if (mcopy != NULL) { > - int len, err; > - len = mcopy->m_pkthdr.len; > - err = ieee80211_vap_xmitpkt(vap, mcopy); > - if (err) { > - /* NB: IFQ_HANDOFF reclaims mcopy */ > - } else { > - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); > - } > - } > + if (mcopy != NULL && ieee80211_vap_xmitpkt(vap, mcopy) == 0) > + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); > } > if (m != NULL) { > /* > @@ -1798,7 +1790,6 @@ hostap_recv_mgmt(struct ieee80211_node * > * [tlv] extended supported rates > */ > ssid = rates = xrates = NULL; > - sfrm = frm; > while (efrm - frm > 1) { > IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, > return); > switch (*frm) { > > Modified: head/sys/net80211/ieee80211_hwmp.c > == > --- head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:13:12 2016 > (r299574) > +++ head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:17:00 2016 > (r299575) > @@ -128,7 +128,6 @@ typedef uint32_t ieee80211_hwmp_seq; > #defineHWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) > #defineHWMP_SEQ_EQ(a, b) ((int32_t)((a)-(b)) == 0) > #defineHWMP_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) > -#defineHWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) > > #define HWMP_SEQ_MAX(a, b) (a > b ? a : b) > > @@ -1526,7 +1525,6 @@ hwmp_peerdown(struct ieee80211_node *ni) > #definePERR_DADDR(n) perr->perr_dests[n].dest_addr > #definePERR_DSEQ(n)perr->perr_dests[n].dest_seq > #definePERR_DEXTADDR(n)perr->perr_dests[n].dest_ext_addr > -#definePERR_DRCODE(n) perr->perr_dests[n].dest_rcode > static void > hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni, > const struct ieee80211_frame *wh, const struct ieee80211_meshperr_ie > *perr) > @@ -1628,7 +1626,6 @@ done: > #undef PERR_DADDR > #undef PERR_DSEQ > #undef PERR_DEXTADDR > -#undef PERR_DRCODE > > static int > hwmp_send_perr(struct ieee80211vap *vap, > @@ -1737,7 +1734,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, > struct ieee80211_hwmp_route
svn commit: r299578 - head/usr.bin/catman
Author: truckman Date: Thu May 12 23:37:58 2016 New Revision: 299578 URL: https://svnweb.freebsd.org/changeset/base/299578 Log: If fchdir() fails, call err() instead of warn(). Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c == --- head/usr.bin/catman/catman.cThu May 12 23:14:31 2016 (r299577) +++ head/usr.bin/catman/catman.cThu May 12 23:37:58 2016 (r299578) @@ -613,7 +613,7 @@ static void process_mandir(char *dir_name, char *section) { if (fchdir(starting_dir) < 0) - warn("fchdir"); + err(1, "fchdir"); if (already_visited(NULL, dir_name, section == NULL)) return; check_writable(dir_name); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299577 - head/usr.bin/catman
Author: truckman Date: Thu May 12 23:14:31 2016 New Revision: 299577 URL: https://svnweb.freebsd.org/changeset/base/299577 Log: Avoid Coverity NUL termination warning about strncpy() by using memcpy() instead. It's probably a bit more optimal in this case anyway. [1] The program logic leading up to the creation of the strncpy/memcpy destination buffer is a bit hairy. Add a call to assert() to make it clear what is happening here and detect any potential buffer overruns in the future. Check a couple syscall error returns. Ignore the EEXIST error from link() to preserve existing behavior. [2] [3] Reported by: Coverity CID: 1009659 [1], 1009349 [2], 1009350 [3] Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c == --- head/usr.bin/catman/catman.cThu May 12 22:51:04 2016 (r299576) +++ head/usr.bin/catman/catman.cThu May 12 23:14:31 2016 (r299577) @@ -34,9 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include #include @@ -267,7 +269,8 @@ get_cat_section(char *section) char *cat_section; cat_section = strdup(section); - strncpy(cat_section, "cat", 3); + assert(strlen(section) > 3 && strncmp(section, "man", 3) == 0); + memcpy(cat_section, "cat", 3); return cat_section; } @@ -420,7 +423,8 @@ process_page(char *mandir, char *src, ch verbose ? "\t" : "", cat, link_name); } if (!pretend) - link(link_name, cat); + if (link(link_name, cat) < 0 && errno != EEXIST) + warn("%s %s: link", link_name, cat); return; } insert_hashtable(links, src_ino, src_dev, strdup(cat)); @@ -608,7 +612,8 @@ select_sections(const struct dirent *ent static void process_mandir(char *dir_name, char *section) { - fchdir(starting_dir); + if (fchdir(starting_dir) < 0) + warn("fchdir"); if (already_visited(NULL, dir_name, section == NULL)) return; check_writable(dir_name); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299529 - in head: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/liba
Should be fixed with r299576 On 13.05.2016 00:24, Antoine Brodin wrote: > On Thu, May 12, 2016 at 12:16 PM, Martin Matuskawrote: >> Author: mm >> Date: Thu May 12 10:16:16 2016 >> New Revision: 299529 >> URL: https://svnweb.freebsd.org/changeset/base/299529 >> >> Log: >> MFV r299425: >> >> Update libarchive to 3.2.0 >> >> New features: >> - new bsdcat command-line utility >> - LZ4 compression (in src only via external utility from ports) >> - Warc format support >> - 'Raw' format writer >> - Zip: Support archives >4GB, entries >4GB >> - Zip: Support encrypting and decrypting entries >> - Zip: Support experimental streaming extension >> - Identify encrypted entries in several formats >> - New --clear-nochange-flags option to bsdtar tries to remove noschg and >> similar flags before deleting files >> - New --ignore-zeros option to bsdtar to handle concatenated tar archives >> - Use multi-threaded LZMA decompression if liblzma supports it >> - Expose version info for libraries used by libarchive >> >> Patched files (fixed compiler warnings): >> >> contrib/libarchive/cat/bsdcat.c (vendor PR #702) >> contrib/libarchive/cat/bsdcat.h (vendor PR #702) >> contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701) >> contrib/libarchive/libarchive_fe/err.c (vendor PR #703) >> >> MFC after:1 month >> Relnotes: yes > Hi, > > cpio(1) looks broken after this update and the ports tree is unusable > (it uses cpio in COPYTREE*). > Please revert and request a ports exp-run. > > Cheers, > > Antoine (with hat: portmgr) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299576 - head/contrib/libarchive/cpio
Author: mm Date: Thu May 12 22:51:04 2016 New Revision: 299576 URL: https://svnweb.freebsd.org/changeset/base/299576 Log: Fix broken cpio behavior. Suggested upstream as PR #704. MFC: 1 month (together with libarchive 3.2.0) Modified: head/contrib/libarchive/cpio/bsdcpio.1 head/contrib/libarchive/cpio/cpio.c Modified: head/contrib/libarchive/cpio/bsdcpio.1 == --- head/contrib/libarchive/cpio/bsdcpio.1 Thu May 12 22:17:00 2016 (r299575) +++ head/contrib/libarchive/cpio/bsdcpio.1 Thu May 12 22:51:04 2016 (r299576) @@ -156,8 +156,7 @@ See above for description. .It Fl Fl insecure (i and p mode only) Disable security checks during extraction or copying. -This allows extraction via symbolic links, absolute paths, -and path names containing +This allows extraction via symbolic links and path names containing .Sq .. in the name. .It Fl J , Fl Fl xz Modified: head/contrib/libarchive/cpio/cpio.c == --- head/contrib/libarchive/cpio/cpio.c Thu May 12 22:17:00 2016 (r299575) +++ head/contrib/libarchive/cpio/cpio.c Thu May 12 22:51:04 2016 (r299576) @@ -171,7 +171,6 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; - cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; @@ -257,7 +256,6 @@ main(int argc, char *argv[]) case OPTION_INSECURE: cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; - cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case 'L': /* GNU cpio */ cpio->option_follow_links = 1; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299456 - in head: include lib/libc/stdio
On Thu, May 12, 2016 at 12:49 PM, Antoine Brodinwrote: > On Wed, May 11, 2016 at 4:38 PM, Conrad E. Meyer wrote: >> Author: cem >> Date: Wed May 11 14:38:27 2016 >> New Revision: 299456 >> URL: https://svnweb.freebsd.org/changeset/base/299456 >> >> Log: >> libc: Add fopencookie(3) wrapper around funopen(3) >> >> Reviewed by: jhb, oshogbo >> Sponsored by: EMC / Isilon Storage Division >> Differential Revision:https://reviews.freebsd.org/D6282 > > Please revert this and request a ports exp-run as this breaks lots of > important ports. The number of failed ports is actually pretty small (less than 11). I've identified a couple different kinds of issue and implemented fixes for them. 1. libc doesn't actually export the fopencookie() function, because it was missing from Symbols.map (base issue). This is rectified in 299572 and I've personally test-built php56 successfully with that change. 2. Some ports assume that off64_t's presence in stdio.h implies it is more widely available (port issue). Or that it implies __off64_t exists. Examples: devel/rudiments, devel/zziplib. To that end, I've made off64_t and __off64_t as widely available as off_t and __off_t in r299571. I've test-built both of these and both succeed after these changes. 3. Finally, Clang (?)sometimes rejects that particular style of function typedef (base issue). Additionally, sometimes size_t isn't defined. For example, lang/pypy. r299574 fixes that issue. I've personally test-built pypy (well, it's still compiling, but it's past that initial platform detection failure now). Are there any other important ports you think this change impacted? Several other failures are not related to this change (Lynx, Xterm, ncurses, cdialog). So, other than assuming php70 and php55 will be fixed by the same change as php56, I don't think there are any failures unaccounted for that I haven't test-built successfully at this point. Do you still want a revert, or any further test builds? Or is that fine? Best, Conrad ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299529 - in head: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/liba
On Thu, May 12, 2016 at 12:16 PM, Martin Matuskawrote: > Author: mm > Date: Thu May 12 10:16:16 2016 > New Revision: 299529 > URL: https://svnweb.freebsd.org/changeset/base/299529 > > Log: > MFV r299425: > > Update libarchive to 3.2.0 > > New features: > - new bsdcat command-line utility > - LZ4 compression (in src only via external utility from ports) > - Warc format support > - 'Raw' format writer > - Zip: Support archives >4GB, entries >4GB > - Zip: Support encrypting and decrypting entries > - Zip: Support experimental streaming extension > - Identify encrypted entries in several formats > - New --clear-nochange-flags option to bsdtar tries to remove noschg and > similar flags before deleting files > - New --ignore-zeros option to bsdtar to handle concatenated tar archives > - Use multi-threaded LZMA decompression if liblzma supports it > - Expose version info for libraries used by libarchive > > Patched files (fixed compiler warnings): > > contrib/libarchive/cat/bsdcat.c (vendor PR #702) > contrib/libarchive/cat/bsdcat.h (vendor PR #702) > contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701) > contrib/libarchive/libarchive_fe/err.c (vendor PR #703) > > MFC after:1 month > Relnotes: yes Hi, cpio(1) looks broken after this update and the ports tree is unusable (it uses cpio in COPYTREE*). Please revert and request a ports exp-run. Cheers, Antoine (with hat: portmgr) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299575 - head/sys/net80211
Author: avos Date: Thu May 12 22:17:00 2016 New Revision: 299575 URL: https://svnweb.freebsd.org/changeset/base/299575 Log: net80211: drop some unused variables / local macros Most of them left after some commits (r178354, r191544, r287197 etc.); some were never used. Found by: Clang Static Analyzer Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_phy.c head/sys/net80211/ieee80211_scan_sw.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_adhoc.c == --- head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:17:00 2016 (r299575) @@ -674,7 +674,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n struct ieee80211com *ic = ni->ni_ic; struct ieee80211_channel *rxchan = ic->ic_curchan; struct ieee80211_frame *wh; - uint8_t *frm, *efrm, *sfrm; + uint8_t *frm, *efrm; uint8_t *ssid, *rates, *xrates; #if 0 int ht_state_change = 0; @@ -809,7 +809,6 @@ adhoc_recv_mgmt(struct ieee80211_node *n * [tlv] extended supported rates */ ssid = rates = xrates = NULL; - sfrm = frm; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { Modified: head/sys/net80211/ieee80211_hostap.c == --- head/sys/net80211/ieee80211_hostap.cThu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_hostap.cThu May 12 22:17:00 2016 (r299575) @@ -412,16 +412,8 @@ hostap_deliver_data(struct ieee80211vap ieee80211_free_node(sta); } } - if (mcopy != NULL) { - int len, err; - len = mcopy->m_pkthdr.len; - err = ieee80211_vap_xmitpkt(vap, mcopy); - if (err) { - /* NB: IFQ_HANDOFF reclaims mcopy */ - } else { - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - } - } + if (mcopy != NULL && ieee80211_vap_xmitpkt(vap, mcopy) == 0) + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } if (m != NULL) { /* @@ -1798,7 +1790,6 @@ hostap_recv_mgmt(struct ieee80211_node * * [tlv] extended supported rates */ ssid = rates = xrates = NULL; - sfrm = frm; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { Modified: head/sys/net80211/ieee80211_hwmp.c == --- head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:17:00 2016 (r299575) @@ -128,7 +128,6 @@ typedef uint32_t ieee80211_hwmp_seq; #defineHWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) #defineHWMP_SEQ_EQ(a, b) ((int32_t)((a)-(b)) == 0) #defineHWMP_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) -#defineHWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) #define HWMP_SEQ_MAX(a, b) (a > b ? a : b) @@ -1526,7 +1525,6 @@ hwmp_peerdown(struct ieee80211_node *ni) #definePERR_DADDR(n) perr->perr_dests[n].dest_addr #definePERR_DSEQ(n)perr->perr_dests[n].dest_seq #definePERR_DEXTADDR(n)perr->perr_dests[n].dest_ext_addr -#definePERR_DRCODE(n) perr->perr_dests[n].dest_rcode static void hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni, const struct ieee80211_frame *wh, const struct ieee80211_meshperr_ie *perr) @@ -1628,7 +1626,6 @@ done: #undef PERR_DADDR #undef PERR_DSEQ #undef PERR_DEXTADDR -#undef PERR_DRCODE static int hwmp_send_perr(struct ieee80211vap *vap, @@ -1737,7 +1734,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, struct ieee80211_hwmp_route *hr; struct ieee80211_meshpreq_ie preq; struct ieee80211_meshrann_ie prann; - uint32_t metric = 0; if (IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) return; @@ -1766,7 +1762,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, /* RANN ACCEPTED */ ieee80211_hwmp_rannint =
svn commit: r299574 - head/include
Author: cem Date: Thu May 12 22:13:12 2016 New Revision: 299574 URL: https://svnweb.freebsd.org/changeset/base/299574 Log: stdio.h: Fix function-type typedef style and use _types.h __ssize_t I'm still not sure why only Pypy runs into the error with the function typedefs. Fix it anyway. Use __ssize_t instead of ssize_t for the types; it's possible for the size_t type to not be visible if at the wrong POSIX_VISIBLE level. A final (crossing my fingers) follow-up to r299456. Sponsored by: EMC / Isilon Storage Division Modified: head/include/stdio.h Modified: head/include/stdio.h == --- head/include/stdio.hThu May 12 21:35:40 2016(r299573) +++ head/include/stdio.hThu May 12 22:13:12 2016(r299574) @@ -432,10 +432,10 @@ FILE *funopen(const void *, #definefropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) #definefwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) -typedef ssize_t (cookie_read_function_t)(void *, char *, size_t); -typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t); -typedef int (cookie_seek_function_t)(void *, off64_t *, int); -typedef int (cookie_close_function_t)(void *); +typedef __ssize_t cookie_read_function_t(void *, char *, size_t); +typedef __ssize_t cookie_write_function_t(void *, const char *, size_t); +typedef int cookie_seek_function_t(void *, off64_t *, int); +typedef int cookie_close_function_t(void *); typedef struct { cookie_read_function_t *read; cookie_write_function_t *write; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299573 - head/usr.sbin/ypbind
Author: truckman Date: Thu May 12 21:35:40 2016 New Revision: 299573 URL: https://svnweb.freebsd.org/changeset/base/299573 Log: Use strlcpy() instead of strncpy() when copying to dom_domain to ensure that the latter is NUL terminated since it is passed as an argument to *printf(). Warn about NIS domains that are too long. Reported by: Coverity CID: 1009620, 1009621 MFH: 1 week Modified: head/usr.sbin/ypbind/ypbind.c Modified: head/usr.sbin/ypbind/ypbind.c == --- head/usr.sbin/ypbind/ypbind.c Thu May 12 21:30:22 2016 (r299572) +++ head/usr.sbin/ypbind/ypbind.c Thu May 12 21:35:40 2016 (r299573) @@ -199,6 +199,11 @@ rejecting.", *argp); res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; return (); } + if (strlen(*argp) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", *argp); + res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; + return (); + } ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); @@ -206,7 +211,7 @@ rejecting.", *argp); return (); } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); ypdb->dom_vers = YPVERS; ypdb->dom_alive = 0; ypdb->dom_default = 0; @@ -416,6 +421,9 @@ main(int argc, char *argv[]) errx(1, "unknown option: %s", argv[i]); } + if (strlen(domain_name) > YPMAXDOMAIN) + warnx("truncating domain name %s", domain_name); + /* blow away everything in BINDINGDIR (if it exists) */ if ((dird = opendir(BINDINGDIR)) != NULL) { @@ -456,7 +464,7 @@ main(int argc, char *argv[]) if (ypbindlist == NULL) errx(1, "malloc"); bzero(ypbindlist, sizeof *ypbindlist); - strncpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); + strlcpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); ypbindlist->dom_vers = YPVERS; ypbindlist->dom_alive = 0; ypbindlist->dom_lockfd = -1; @@ -886,13 +894,17 @@ rpc_received(char *dom, struct sockaddr_ if (ypdb == NULL) { if (force == 0) return; + if (strlen(dom) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", dom); + return; + } ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); return; } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); ypdb->dom_lockfd = -1; ypdb->dom_default = 0; ypdb->dom_pnext = ypbindlist; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299563 - head/sys/dev/gpio
Ian Lepore (i...@freebsd.org) wrote: > On Thu, 2016-05-12 at 20:12 +, Oleksandr Tymoshenko wrote: > > Author: gonzo > > Date: Thu May 12 20:12:45 2016 > > New Revision: 299563 > > URL: https://svnweb.freebsd.org/changeset/base/299563 > > > > Log: > > Add gpiobus_release_pin function to release mapped pin > > > > Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. > > Without it it's impossible to properly release pin so if kernel > > module is reloaded it can't re-use pins again > > This reminds me that we (Michael Meloun & I) had talked on irc about > renaming gpiobus_map_pin() to gpiobus_acquire_pin() and adding a > release function. Now we have the release, but its name really doesn't > scream that it's the inverse of map_pin. Is it too late to rename map > to acquire? (I'm not too wed to the 'acquire' name, 'allocate' would > also be a good candidate. We also considered 'reserve' but that had > less of a "now I own it exclusively" feel to it. 'map' didn't feel > quite right because mapping pins in an FDT world is the responsibility > of the pinmux driver, not a gpio thing.) I do not think it's too late. I guess if you do this before code slush for 11 that should be OK. At least I can not come up with a reason why it can't be done. -- gonzo ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299572 - head/lib/libc/stdio
Author: cem Date: Thu May 12 21:30:22 2016 New Revision: 299572 URL: https://svnweb.freebsd.org/changeset/base/299572 Log: libc: Actually export fopencookie(3) A follow-up to r299456. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/stdio/Symbol.map Modified: head/lib/libc/stdio/Symbol.map == --- head/lib/libc/stdio/Symbol.map Thu May 12 21:18:17 2016 (r299571) +++ head/lib/libc/stdio/Symbol.map Thu May 12 21:30:22 2016 (r299572) @@ -164,6 +164,7 @@ FBSD_1.3 { FBSD_1.4 { fdclose; + fopencookie; }; FBSDprivate_1.0 { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299571 - in head: include sys/sys
Author: cem Date: Thu May 12 21:18:17 2016 New Revision: 299571 URL: https://svnweb.freebsd.org/changeset/base/299571 Log: Pollute more places with off64_t and add __off64_t Despite the private namespace, several broken ports depend on the __off64_t name for the type. Export it exactly the same way off_t and __off_t are exported. A follow-up to r299456. Suggested by: php56 Sponsored by: EMC / Isilon Storage Division Modified: head/include/stdio.h head/sys/sys/_types.h head/sys/sys/types.h Modified: head/include/stdio.h == --- head/include/stdio.hThu May 12 20:53:49 2016(r299570) +++ head/include/stdio.hThu May 12 21:18:17 2016(r299571) @@ -60,7 +60,7 @@ typedef __ssize_t ssize_t; #ifndef _OFF64_T_DECLARED #define_OFF64_T_DECLARED -typedef__off_t off64_t; +typedef__off64_t off64_t; #endif #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE Modified: head/sys/sys/_types.h == --- head/sys/sys/_types.h Thu May 12 20:53:49 2016(r299570) +++ head/sys/sys/_types.h Thu May 12 21:18:17 2016(r299571) @@ -51,6 +51,7 @@ typedef int __accmode_t;/* access perm typedefint __nl_item; typedef__uint16_t __nlink_t; /* link count */ typedef__int64_t __off_t;/* file offset */ +typedef__int64_t __off64_t; /* file offset (alias) */ typedef__int32_t __pid_t;/* process [group] */ typedef__int64_t __rlim_t; /* resource limit - intentionally */ /* signed, because of legacy code */ Modified: head/sys/sys/types.h == --- head/sys/sys/types.hThu May 12 20:53:49 2016(r299570) +++ head/sys/sys/types.hThu May 12 21:18:17 2016(r299571) @@ -174,6 +174,11 @@ typedef__off_t off_t; /* file offset #define_OFF_T_DECLARED #endif +#ifndef _OFF64_T_DECLARED +typedef__off64_t off64_t;/* file offset (alias) */ +#define_OFF64_T_DECLARED +#endif + #ifndef _PID_T_DECLARED typedef__pid_t pid_t; /* process id */ #define_PID_T_DECLARED ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299563 - head/sys/dev/gpio
On Thu, May 12, 2016 at 5:40 PM, Ian Lepore wrote: > On Thu, 2016-05-12 at 20:12 +, Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Thu May 12 20:12:45 2016 >> New Revision: 299563 >> URL: https://svnweb.freebsd.org/changeset/base/299563 >> >> Log: >> Add gpiobus_release_pin function to release mapped pin >> >> Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. >> Without it >> it's impossible to properly release pin so if kernel module is >> reloaded >> it can't re-use pins again > > This reminds me that we (Michael Meloun & I) had talked on irc about > renaming gpiobus_map_pin() to gpiobus_acquire_pin() and adding a > release function. Now we have the release, but its name really doesn't > scream that it's the inverse of map_pin. Is it too late to rename map > to acquire? (I'm not too wed to the 'acquire' name, 'allocate' would > also be a good candidate. We also considered 'reserve' but that had > less of a "now I own it exclusively" feel to it. 'map' didn't feel > quite right because mapping pins in an FDT world is the responsibility > of the pinmux driver, not a gpio thing.) I don't think it is too late for this change, actually I think we are right on time to fill the gaps (just another term to 'fix my bugs'...). Luiz ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299563 - head/sys/dev/gpio
On Thu, 2016-05-12 at 20:12 +, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Thu May 12 20:12:45 2016 > New Revision: 299563 > URL: https://svnweb.freebsd.org/changeset/base/299563 > > Log: > Add gpiobus_release_pin function to release mapped pin > > Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. > Without it > it's impossible to properly release pin so if kernel module is > reloaded > it can't re-use pins again This reminds me that we (Michael Meloun & I) had talked on irc about renaming gpiobus_map_pin() to gpiobus_acquire_pin() and adding a release function. Now we have the release, but its name really doesn't scream that it's the inverse of map_pin. Is it too late to rename map to acquire? (I'm not too wed to the 'acquire' name, 'allocate' would also be a good candidate. We also considered 'reserve' but that had less of a "now I own it exclusively" feel to it. 'map' didn't feel quite right because mapping pins in an FDT world is the responsibility of the pinmux driver, not a gpio thing.) -- Ian ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299568 - in head/sys/modules/gpio: . gpiokeys
Author: gonzo Date: Thu May 12 20:20:54 2016 New Revision: 299568 URL: https://svnweb.freebsd.org/changeset/base/299568 Log: Add loadable module for gpiokeys Added: head/sys/modules/gpio/gpiokeys/ head/sys/modules/gpio/gpiokeys/Makefile (contents, props changed) Modified: head/sys/modules/gpio/Makefile Modified: head/sys/modules/gpio/Makefile == --- head/sys/modules/gpio/Makefile Thu May 12 20:18:37 2016 (r299567) +++ head/sys/modules/gpio/Makefile Thu May 12 20:20:54 2016 (r299568) @@ -25,6 +25,6 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled +SUBDIR = gpiobus gpioiic gpioled gpiokeys .include Added: head/sys/modules/gpio/gpiokeys/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/gpiokeys/Makefile Thu May 12 20:20:54 2016 (r299568) @@ -0,0 +1,14 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../dev/gpio/ + +KMOD= gpiokeys +SRCS= gpiokeys.c gpiokeys_codes.c +SRCS+= bus_if.h device_if.h gpio_if.h ofw_bus_if.h +SRCS+= opt_platform.h opt_kbd.h + +CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ + +.include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299566 - head/sys/dev/gpio
Author: gonzo Date: Thu May 12 20:15:23 2016 New Revision: 299566 URL: https://svnweb.freebsd.org/changeset/base/299566 Log: Fix detach routine for gpiokeys - Release pin only when all per=key callouts are stopped - Unregister keyboard when detaching device node Modified: head/sys/dev/gpio/gpiokeys.c Modified: head/sys/dev/gpio/gpiokeys.c == --- head/sys/dev/gpio/gpiokeys.cThu May 12 20:14:44 2016 (r299565) +++ head/sys/dev/gpio/gpiokeys.cThu May 12 20:15:23 2016 (r299566) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#defineKBD_DRIVER_NAME "gpiokeys" + #defineGPIOKEYS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #defineGPIOKEYS_UNLOCK(_sc)mtx_unlock(&(_sc)->sc_mtx) #defineGPIOKEYS_LOCK_INIT(_sc) \ @@ -357,12 +359,12 @@ gpiokeys_detach_key(struct gpiokeys_soft if (key->irq_res) bus_release_resource(sc->sc_dev, SYS_RES_IRQ, key->irq_rid, key->irq_res); - if (key->pin) - gpio_pin_release(key->pin); if (callout_pending(>repeat_callout)) callout_drain(>repeat_callout); if (callout_pending(>debounce_callout)) callout_drain(>debounce_callout); + if (key->pin) + gpio_pin_release(key->pin); GPIOKEY_UNLOCK(key); GPIOKEY_LOCK_DESTROY(key); @@ -397,7 +399,7 @@ gpiokeys_attach(device_t dev) GPIOKEYS_LOCK_INIT(sc); unit = device_get_unit(dev); - kbd_init_struct(kbd, "gpiokeys", KB_OTHER, unit, 0, 0, 0); + kbd_init_struct(kbd, KBD_DRIVER_NAME, KB_OTHER, unit, 0, 0, 0); kbd->kb_data = (void *)sc; sc->sc_mode = K_XLATE; @@ -468,6 +470,7 @@ static int gpiokeys_detach(device_t dev) { struct gpiokeys_softc *sc; + keyboard_t *kbd; int i; sc = device_get_softc(dev); @@ -475,6 +478,14 @@ gpiokeys_detach(device_t dev) for (i = 0; i < sc->sc_total_keys; i++) gpiokeys_detach_key(sc, >sc_keys[i]); + kbd = kbd_get_keyboard(kbd_find_keyboard(KBD_DRIVER_NAME, + device_get_unit(dev))); + +#ifdef KBD_INSTALL_CDEV + kbd_detach(kbd); +#endif + kbd_unregister(kbd); + GPIOKEYS_LOCK_DESTROY(sc); if (sc->sc_keys) free(sc->sc_keys, M_DEVBUF); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299564 - head/sys/dev/gpio
Author: gonzo Date: Thu May 12 20:13:16 2016 New Revision: 299564 URL: https://svnweb.freebsd.org/changeset/base/299564 Log: Properly release mapped pin in gpio_pin_release Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c == --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 12 20:12:45 2016 (r299563) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 12 20:13:16 2016 (r299564) @@ -139,10 +139,17 @@ gpio_pin_get_by_ofw_name(device_t consum void gpio_pin_release(gpio_pin_t gpio) { + device_t busdev; if (gpio == NULL) return; + KASSERT(gpio->dev != NULL, ("invalid pin state")); + + busdev = GPIO_GET_BUS(gpio->dev); + if (busdev != NULL) + gpiobus_release_pin(busdev, gpio->pin); + /* Unreserve pin. */ free(gpio, M_DEVBUF); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299563 - head/sys/dev/gpio
Author: gonzo Date: Thu May 12 20:12:45 2016 New Revision: 299563 URL: https://svnweb.freebsd.org/changeset/base/299563 Log: Add gpiobus_release_pin function to release mapped pin Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. Without it it's impossible to properly release pin so if kernel module is reloaded it can't re-use pins again Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h Modified: head/sys/dev/gpio/gpiobus.c == --- head/sys/dev/gpio/gpiobus.c Thu May 12 20:04:09 2016(r299562) +++ head/sys/dev/gpio/gpiobus.c Thu May 12 20:12:45 2016(r299563) @@ -281,6 +281,30 @@ gpiobus_map_pin(device_t bus, uint32_t p return (0); } +/* Release mapped pin */ +int +gpiobus_release_pin(device_t bus, uint32_t pin) +{ + struct gpiobus_softc *sc; + + sc = device_get_softc(bus); + /* Consistency check. */ + if (pin >= sc->sc_npins) { + device_printf(bus, + "gpiobus_map_pin: invalid pin %d, max=%d\n", + pin, sc->sc_npins - 1); + return (-1); + } + + if (!sc->sc_pins[pin].mapped) { + device_printf(bus, "gpiobus_map_pin: pin %d is not mapped\n", pin); + return (-1); + } + sc->sc_pins[pin].mapped = 0; + + return (0); +} + static int gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask) { Modified: head/sys/dev/gpio/gpiobusvar.h == --- head/sys/dev/gpio/gpiobusvar.h Thu May 12 20:04:09 2016 (r299562) +++ head/sys/dev/gpio/gpiobusvar.h Thu May 12 20:12:45 2016 (r299563) @@ -138,6 +138,7 @@ int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); int gpiobus_map_pin(device_t, uint32_t); +int gpiobus_release_pin(device_t, uint32_t); extern driver_t gpiobus_driver; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299562 - head/share/misc
Author: n_hibma Date: Thu May 12 20:04:09 2016 New Revision: 299562 URL: https://svnweb.freebsd.org/changeset/base/299562 Log: Add myself to the list of src committers. I've never been added it seems. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot == --- head/share/misc/committers-src.dot Thu May 12 19:50:14 2016 (r299561) +++ head/share/misc/committers-src.dot Thu May 12 20:04:09 2016 (r299562) @@ -247,6 +247,7 @@ ngie [label="Garrett Cooper\nngie@FreeBS nork [label="Norikatsu Shigemura\nn...@freebsd.org\n2009/06/09"] np [label="Navdeep Parhar\n...@freebsd.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhiteh...@freebsd.org\n2008/07/03"] +n_hibma [label="Nick Hibma\nn_hi...@freebsd.org\n1998/11/26"] obrien [label="David E. O'Brien\nobr...@freebsd.org\n1996/10/29"] olli [label="Oliver Fromme\no...@freebsd.org\n2008/02/14"] oshogbo [label="Mariusz Zaborski\nosho...@freebsd.org\n2015/04/15"] ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299456 - in head: include lib/libc/stdio
On Wed, May 11, 2016 at 4:38 PM, Conrad E. Meyerwrote: > Author: cem > Date: Wed May 11 14:38:27 2016 > New Revision: 299456 > URL: https://svnweb.freebsd.org/changeset/base/299456 > > Log: > libc: Add fopencookie(3) wrapper around funopen(3) > > Reviewed by: jhb, oshogbo > Sponsored by: EMC / Isilon Storage Division > Differential Revision:https://reviews.freebsd.org/D6282 Hi, Please revert this and request a ports exp-run as this breaks lots of important ports. Cheers, Antoine (with hat: portmgr) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299559 - head/sys/net
Author: n_hibma Date: Thu May 12 19:42:13 2016 New Revision: 299559 URL: https://svnweb.freebsd.org/changeset/base/299559 Log: Allow silencing of 'promiscuous mode enabled/disabled' messages. PR: 166255 Submitted by: eugen.grosbein.net Obtained from:eugen.grosbein.net MFC after:1 week Modified: head/sys/net/if.c Modified: head/sys/net/if.c == --- head/sys/net/if.c Thu May 12 19:40:47 2016(r299558) +++ head/sys/net/if.c Thu May 12 19:42:13 2016(r299559) @@ -112,6 +112,13 @@ SYSCTL_INT(_net_link, OID_AUTO, log_link _link_state_change, 0, "log interface link state change events"); +/* Log promiscuous mode change events */ +static int log_promisc_mode_change = 1; + +SYSCTL_INT(_net_link, OID_AUTO, log_promisc_mode_change, CTLFLAG_RW, + _promisc_mode_change, 1, + "log promiscuous mode change events"); + /* Interface description */ static unsigned int ifdescr_maxlen = 1024; SYSCTL_UINT(_net, OID_AUTO, ifdescr_maxlen, CTLFLAG_RW, @@ -2326,9 +2333,11 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, ifp->if_flags |= IFF_PROMISC; else if (ifp->if_pcount == 0) ifp->if_flags &= ~IFF_PROMISC; - log(LOG_INFO, "%s: permanently promiscuous mode %s\n", - ifp->if_xname, - (new_flags & IFF_PPROMISC) ? "enabled" : "disabled"); + if (log_promisc_mode_change) +log(LOG_INFO, "%s: permanently promiscuous mode %s\n", +ifp->if_xname, +((new_flags & IFF_PPROMISC) ? + "enabled" : "disabled")); } ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) | (new_flags &~ IFF_CANTCHANGE); @@ -2813,7 +2822,8 @@ ifpromisc(struct ifnet *ifp, int pswitch error = if_setflag(ifp, IFF_PROMISC, IFF_PPROMISC, >if_pcount, pswitch); /* If promiscuous mode status has changed, log a message */ - if (error == 0 && ((ifp->if_flags ^ oldflags) & IFF_PROMISC)) + if (error == 0 && ((ifp->if_flags ^ oldflags) & IFF_PROMISC) && +log_promisc_mode_change) log(LOG_INFO, "%s: promiscuous mode %s\n", ifp->if_xname, (ifp->if_flags & IFF_PROMISC) ? "enabled" : "disabled"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299557 - head/release/doc/en_US.ISO8859-1/relnotes
Author: skreuzer (doc,ports committer) Date: Thu May 12 19:32:40 2016 New Revision: 299557 URL: https://svnweb.freebsd.org/changeset/base/299557 Log: Document r296633, OpenSSH updated to 7.2p2. Approved by: gjb@ (implicit with re@ hat on) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml == --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 12 18:22:34 2016(r299556) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 12 19:32:40 2016(r299557) @@ -460,8 +460,8 @@ has been updated to version 20140101. - OpenSSH has - been updated to 6.5p1. + OpenSSH has + been updated to 7.2p2. mdocml has been updated to version 1.12.3. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299544 - head/sys/dev/an
On Thursday, May 12, 2016 05:47:30 PM Scott Long wrote: > Author: scottl > Date: Thu May 12 17:47:30 2016 > New Revision: 299544 > URL: https://svnweb.freebsd.org/changeset/base/299544 > > Log: > Move mutex initialization from PCI probe to PCI attach. Drivers are not > allowed to create any persistent state in their probe routine because it's > not guaranteed that they'll win the election and be allowed to attach. Except that if they return 0 (which most shouldn't) it is guaranteed. an_probe() used to return 0, but it was changed to return BUS_PROBE_DEFAULT without fixing this. (Oops) an_probe() could just be fixed to destroy the lock and the lock init could then be moved into an_attach(). > Modified: head/sys/dev/an/if_an_pci.c > == > --- head/sys/dev/an/if_an_pci.c Thu May 12 16:34:59 2016 > (r299543) > +++ head/sys/dev/an/if_an_pci.c Thu May 12 17:47:30 2016 > (r299544) > @@ -119,16 +119,16 @@ static int > an_probe_pci(device_t dev) > { > struct an_type *t; > - struct an_softc *sc = device_get_softc(dev); > + uint16_t vid, did; > > - bzero(sc, sizeof(struct an_softc)); This wasn't necessary before. > t = an_devs; > + vid = pci_get_vendor(dev); > + did = pci_get_device(dev); > > while (t->an_name != NULL) { > - if (pci_get_vendor(dev) == t->an_vid && > - pci_get_device(dev) == t->an_did) { > + if (vid == t->an_vid && > + did == t->an_did) { > device_set_desc(dev, t->an_name); > - an_pci_probe(dev); > return(BUS_PROBE_DEFAULT); > } > t++; > @@ -145,8 +145,16 @@ an_attach_pci(dev) > int flags, error = 0; > > sc = device_get_softc(dev); > + bzero(sc, sizeof(struct an_softc)); This isn't necessary now (softc's are pre-zeroed by new-bus). > flags = device_get_flags(dev); > > + /* > + * Setup the lock in PCI attachment since it skips the an_probe > + * function. > + */ > + mtx_init(>an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, > + MTX_DEF); > + > if (pci_get_vendor(dev) == AIRONET_VENDORID && > pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { > sc->mpi350 = 1; > -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299556 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:22:34 2016 New Revision: 299556 URL: https://svnweb.freebsd.org/changeset/base/299556 Log: ixl: Re-add a change to TC0 setup made in D5203. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c == --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:22:12 2016(r299555) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:22:34 2016(r299556) @@ -3115,9 +3115,17 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) */ ctxt.info.valid_sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID; ctxt.info.mapping_flags |= I40E_AQ_VSI_QUE_MAP_CONTIG; - ctxt.info.queue_mapping[0] = 0; - /* This VSI is assigned 64 queues (we may not use all of them) */ - ctxt.info.tc_mapping[0] = 0x0c00; + /* In contig mode, que_mapping[0] is first queue index used by this VSI */ + ctxt.info.queue_mapping[0] = 0; + /* +* This VSI will only use traffic class 0; start traffic class 0's +* queue allocation at queue 0, and assign it 64 (2^6) queues (though +* the driver may not use all of them). +*/ + ctxt.info.tc_mapping[0] = ((0 << I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT) + & I40E_AQ_VSI_TC_QUE_OFFSET_MASK) | + ((6 << I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) + & I40E_AQ_VSI_TC_QUE_NUMBER_MASK); /* Set VLAN receive stripping mode */ ctxt.info.valid_sections |= I40E_AQ_VSI_PROP_VLAN_VALID; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299555 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:22:12 2016 New Revision: 299555 URL: https://svnweb.freebsd.org/changeset/base/299555 Log: ixl: Update to 1.4.27-k. Changes: Kevin Scott i40e-shared: Save off VSI resource count when updating VSI Anjali Singhai Jain i40e-shared: Expose some registers to program parser, FD and RSS logic Eric Joyner ixl: Fix errors in queue interrupt setup in MSIX mode. Shannon Nelsoni40e-shared: implement and use rx ctl helper functions Shannon Nelsoni40e-shared: don't use AQ calls from clear_hw Eric Joyner ixl: Use rx ctl read/write functions instead of register accesses in certain places. Shannon Nelsoni40e-shared: add adminq commands for rx ctl registers Shannon Nelsoni40e-shared: implement and use rx ctl helper functions Jeremiah Kyle i40e-shared: Corrected function name in comment block Deepthi Kavalur i40e-shared: correcting a HW capability display info Shannon Nelsoni40e-shared: fixups for (Linux) upstream consistency Eric Joyner ixl: Only stop firmware's LLDP agent on older firmware versions. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq.h head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_register.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/i40e_adminq.c == --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:22:12 2016 (r299555) @@ -44,8 +44,8 @@ **/ static INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc) { - return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase) || - desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update)); + return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase)) || + (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update)); } /** @@ -555,6 +555,24 @@ shutdown_arq_out: } /** + * i40e_resume_aq - resume AQ processing from 0 + * @hw: pointer to the hardware structure + **/ +static void i40e_resume_aq(struct i40e_hw *hw) +{ + /* Registers are reset after PF reset */ + hw->aq.asq.next_to_use = 0; + hw->aq.asq.next_to_clean = 0; + + i40e_config_asq_regs(hw); + + hw->aq.arq.next_to_use = 0; + hw->aq.arq.next_to_clean = 0; + + i40e_config_arq_regs(hw); +} + +/** * i40e_init_adminq - main initialization routine for Admin Queue * @hw: pointer to the hardware structure * @@ -567,10 +585,11 @@ shutdown_arq_out: **/ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { - enum i40e_status_code ret_code; - u16 eetrack_lo, eetrack_hi; u16 cfg_ptr, oem_hi, oem_lo; + u16 eetrack_lo, eetrack_hi; + enum i40e_status_code ret_code; int retry = 0; + /* verify input for valid configuration */ if ((hw->aq.num_arq_entries == 0) || (hw->aq.num_asq_entries == 0) || @@ -579,8 +598,6 @@ enum i40e_status_code i40e_init_adminq(s ret_code = I40E_ERR_CONFIG; goto init_adminq_exit; } - - /* initialize spin locks */ i40e_init_spinlock(>aq.asq_spinlock); i40e_init_spinlock(>aq.arq_spinlock); @@ -681,8 +698,6 @@ enum i40e_status_code i40e_shutdown_admi i40e_shutdown_asq(hw); i40e_shutdown_arq(hw); - - /* destroy the spinlocks */ i40e_destroy_spinlock(>aq.asq_spinlock); i40e_destroy_spinlock(>aq.arq_spinlock); @@ -708,7 +723,6 @@ u16 i40e_clean_asq(struct i40e_hw *hw) desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); - while (rd32(hw, hw->aq.asq.head) != ntc) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); @@ -899,7 +913,6 @@ enum i40e_status_code i40e_asq_send_comm */ if (i40e_asq_done(hw)) break; - /* ugh! delay while spin_lock */ i40e_msec_delay(1); total_delay++; } while (total_delay < hw->aq.asq_cmd_timeout); @@ -1098,16 +,3 @@ clean_arq_element_err: return ret_code; } -void i40e_resume_aq(struct i40e_hw *hw) -{ - /* Registers are reset after PF reset */ - hw->aq.asq.next_to_use = 0; - hw->aq.asq.next_to_clean = 0; - - i40e_config_asq_regs(hw);
svn commit: r299552 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:21:17 2016 New Revision: 299552 URL: https://svnweb.freebsd.org/changeset/base/299552 Log: ixl: Update to 1.4.17-k. Changes: Kiran Patil i40e-shared: APIs to Add/remove port mirroring rules Shannon Nelsoni40e-shared: add VEB stat control and remove L2 cloud filter Eric Joyner ixl: Update NVM version information shown. Eric Joyner ixl: Remove empty else block. Eric Joyner ixl: Slightly re-work ixl_init_msix(). Eric Joyner ixl: Remove duplicate queue enablement. Shannon Nelsoni40e-shared: implement the API function for aq_set_switch_config Eric Joyner ixl: Update nvm version string shown in sysctl. Eric Joyner ixl/ixlv: Changes to PF/VF minor version checking/handling. Eric Joyner ixlv: Reduce maximum wait time for responses to VF AQ messages. Eric Joyner ixl/ixlv: Edit comments, comment out code, and edit spacing. Eric Joyner ixl: Print log message when SR-IOV init is successful. Eric Joyner ixl: Add Tx Flow Control filter from main PF VSI. Eric Joyner ixlv: Add extra error message when ixlv_get_vf_config times out. Eric Joyner ixl: Assign current MOCS optics the XLPPI media type. Eric Joyner ixl: Remove conditional wait after link status event. Eric Joyner ixl: Add line break and remove extraneous return statement. Eric Joyner ixl: Allow 40G speeds in the advertise_speed sysctl. Eric Joyner ixl: Add "CRC enable" field to link_status sysctl output. Eric Joyner ixl: Move sbuf.h include out of IXL_DEBUG* defines. Eric Joyner ixl: Move remaining debug sysctl funcs to IXL_DEBUG_SYSCTL define. Eric Joyner ixl: Add cases for all remaining media types in shared code to media_status(). Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/i40e_common.c == --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:59 2016 (r299551) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:17 2016 (r299552) @@ -2161,6 +2161,37 @@ enum i40e_status_code i40e_aq_set_vsi_br } /** + * i40e_aq_set_vsi_vlan_promisc - control the VLAN promiscuous setting + * @hw: pointer to the hw struct + * @seid: vsi number + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, + u16 seid, bool enable, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *) + enum i40e_status_code status; + u16 flags = 0; + + i40e_fill_default_direct_cmd_desc(, + i40e_aqc_opc_set_vsi_promiscuous_modes); + if (enable) + flags |= I40E_AQC_SET_VSI_PROMISC_VLAN; + + cmd->promiscuous_flags = CPU_TO_LE16(flags); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_VLAN); + cmd->seid = CPU_TO_LE16(seid); + + status = i40e_asq_send_command(hw, , NULL, 0, cmd_details); + + return status; +} + +/** * i40e_get_vsi_params - get VSI configuration info * @hw: pointer to the hw struct * @vsi_ctx: pointer to a vsi context struct @@ -2263,6 +2294,34 @@ enum i40e_status_code i40e_aq_get_switch } /** + * i40e_aq_set_switch_config + * @hw: pointer to the hardware structure + * @flags: bit flag values to set + * @valid_flags: which bit flags to set + * @cmd_details: pointer to command details structure or NULL + * + * Set switch configuration bits + **/ +enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, + u16 flags, u16 valid_flags, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_switch_config *scfg = + (struct i40e_aqc_set_switch_config *) + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(, + i40e_aqc_opc_set_switch_config); + scfg->flags = CPU_TO_LE16(flags); + scfg->valid_flags = CPU_TO_LE16(valid_flags); + + status = i40e_asq_send_command(hw, , NULL, 0, cmd_details); + + return status; +} + +/** * i40e_aq_get_firmware_version * @hw: pointer to the hw struct *
svn commit: r299554 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:21:52 2016 New Revision: 299554 URL: https://svnweb.freebsd.org/changeset/base/299554 Log: ixl: Update to 1.4.24-k. Changes by author: Eric Joyner ixl: Fix compile error when IXL_DEBUG is defined. Eric Joyner ixl: Fix taskqueues created in init() not being freed in stop(). Eric Joyner ixl: Add additional debug sysctls, for Tx and Rx queue stats. Eric Joyner ixl: Enable dynamic itr by default. Eric Joyner ixl: Edit spacing, comments, function signatures (to conform to style(9)). Eric Joyner ixl: Check for errors when tearing down msix interrupts. Eric Joyner ixl: Remove unnecessary register reads/writes. Eric Joyner ixl: Remove admin queue interrupt enable from general interrupt enable. Eric Joyner ixl: Update switch config after teardown/reset flow in init(). Eric Joyner ixl: Add additional admin queue error code output to admin queue call errors. Eric Joyner ixl: Don't destroy i40e spinlock if it's already uninitialized. Shannon Nelsoni40e-shared: clean event descriptor before use Anjali Singhai Jain i40e-shared: When in promisc mode apply promisc mode to Tx Traffic as well Kevin Scott i40e_shared: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit Eric Joyner ixlv: Fix IXL_DEBUG compile issue. Eric Joyner ixlv: Attempt to fix panic/other issues when rapidly unloading/loading driver. Eric Joyner ixl/ixlv: Revert m_collapse() in ixl_xmit() to m_defrag(). Deepthi Kavalur i40e_shared: Trace logging HW capabilities Eric Joyner ixlv: Correctly unlock/relock around init() call in vc_completion(). Eric Joyner ixl: Stop preventing changing flow control mode for CR4 media. Eric Joyner ixl: Set IPv6 TCP offload flag when doing TSO. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/i40e_adminq.c == --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:21:52 2016 (r299554) @@ -993,6 +993,9 @@ enum i40e_status_code i40e_clean_arq_ele u16 flags; u16 ntu; + /* pre-clean the event info */ + i40e_memset(>desc, 0, sizeof(e->desc), I40E_NONDMA_MEM); + /* take the lock before we start messing with the ring */ i40e_acquire_spinlock(>aq.arq_spinlock); @@ -1065,13 +1068,6 @@ enum i40e_status_code i40e_clean_arq_ele hw->aq.arq.next_to_clean = ntc; hw->aq.arq.next_to_use = ntu; -clean_arq_element_out: - /* Set pending if needed, unlock and return */ - if (pending != NULL) - *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); -clean_arq_element_err: - i40e_release_spinlock(>aq.arq_spinlock); - if (i40e_is_nvm_update_op(>desc)) { if (hw->aq.nvm_release_on_done) { i40e_release_nvm(hw); @@ -1092,6 +1088,13 @@ clean_arq_element_err: } } +clean_arq_element_out: + /* Set pending if needed, unlock and return */ + if (pending != NULL) + *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); +clean_arq_element_err: + i40e_release_spinlock(>aq.arq_spinlock); + return ret_code; } Modified: head/sys/dev/ixl/i40e_adminq_cmd.h == --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:21:52 2016 (r299554) @@ -1087,6 +1087,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 +#define I40E_AQC_SET_VSI_PROMISC_TX0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK0x3FF __le16 vlan_tag; Modified: head/sys/dev/ixl/i40e_common.c == --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:52 2016 (r299554) @@ -1103,7 +1103,11 @@ enum i40e_status_code
svn commit: r299553 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:21:34 2016 New Revision: 299553 URL: https://svnweb.freebsd.org/changeset/base/299553 Log: ixl: Update to 1.4.20-k. Changes by author: Eric Joyner ixl: Add more error messages/checks to ixl_vsi_assign_msix(). Eric Joyner ixl/ixlv: Clarify a comment about descriptors. Eric Joyner ixl/ixlv: Improve i40e_debug() implementation. Eric Joyner ixl/ixlv: Remove unused ASSERT() macro; move struct around. Eric Joyner ixl: Set initial advertised speed value in init_locked(). Eric Joyner ixl: Fix flow control sysctl value being stored when new value is invalid. Eric Joyner Edit comments and spacing. Carolyn Wyborny i40e-shared: Add functions to blink led on Coppervale PHY Eric Joyner ixl: Re-do interrupt setup. Eric Joyner ixl: Remove VFLR task setup from legacy flow. Eric Joyner ixl: Shutdown/setup HMC when handling an EMPR reset. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h Modified: head/sys/dev/ixl/i40e_common.c == --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:17 2016 (r299552) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:34 2016 (r299553) @@ -5601,6 +5601,335 @@ enum i40e_status_code i40e_aq_configure_ } /** + * i40e_read_phy_register + * @hw: pointer to the HW structure + * @page: registers page number + * @reg: register address in the page + * @phy_adr: PHY address on MDIO interface + * @value: PHY register value + * + * Reads specified PHY register value + **/ +enum i40e_status_code i40e_read_phy_register(struct i40e_hw *hw, +u8 page, u16 reg, u8 phy_addr, +u16 *value) +{ + enum i40e_status_code status = I40E_ERR_TIMEOUT; + u32 command = 0; + u16 retry = 1000; + u8 port_num = (u8)hw->func_caps.mdio_port_num; + + command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) | + (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | + (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) | + (I40E_MDIO_OPCODE_ADDRESS) | + (I40E_MDIO_STCODE) | + (I40E_GLGEN_MSCA_MDICMD_MASK) | + (I40E_GLGEN_MSCA_MDIINPROGEN_MASK); + wr32(hw, I40E_GLGEN_MSCA(port_num), command); + do { + command = rd32(hw, I40E_GLGEN_MSCA(port_num)); + if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) { + status = I40E_SUCCESS; + break; + } + i40e_usec_delay(10); + retry--; + } while (retry); + + if (status) { + i40e_debug(hw, I40E_DEBUG_PHY, + "PHY: Can't write command to external PHY.\n"); + goto phy_read_end; + } + + command = (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | + (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) | + (I40E_MDIO_OPCODE_READ) | + (I40E_MDIO_STCODE) | + (I40E_GLGEN_MSCA_MDICMD_MASK) | + (I40E_GLGEN_MSCA_MDIINPROGEN_MASK); + status = I40E_ERR_TIMEOUT; + retry = 1000; + wr32(hw, I40E_GLGEN_MSCA(port_num), command); + do { + command = rd32(hw, I40E_GLGEN_MSCA(port_num)); + if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) { + status = I40E_SUCCESS; + break; + } + i40e_usec_delay(10); + retry--; + } while (retry); + + if (!status) { + command = rd32(hw, I40E_GLGEN_MSRWD(port_num)); + *value = (command & I40E_GLGEN_MSRWD_MDIRDDATA_MASK) >> +I40E_GLGEN_MSRWD_MDIRDDATA_SHIFT; + } else { + i40e_debug(hw, I40E_DEBUG_PHY, + "PHY: Can't read register value from external PHY.\n"); + } + +phy_read_end: + return status; +} + +/** + * i40e_write_phy_register + * @hw: pointer to the HW structure + * @page: registers page number + * @reg: register address in the page + * @phy_adr: PHY address on MDIO interface + * @value: PHY register value + * + * Writes value to specified PHY register + **/ +enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, + u8 page, u16 reg, u8 phy_addr, + u16 value) +{ + enum i40e_status_code status = I40E_ERR_TIMEOUT; + u32 command = 0; +
svn commit: r299551 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:20:59 2016 New Revision: 299551 URL: https://svnweb.freebsd.org/changeset/base/299551 Log: ixl: Update to 1.4.13-k. Changes: Shannon Nelsoni40e-shared: set shared bit for multicast filters Piotr Raczynski i40e-shared: Bump AQ minor version for FVL/FPK Eric Joyner ixl: Remove call to i40e_aq_set_mac_config() in init path. Eric Joyner ixl: Always add interface mac address to driver+hw filter list. Eric Joyner ixl: Edit comments. Eric Joyner ixl: Add more descriptive sysctl help messages. Eric Joyner ixl: Report more info in link_status sysctl. Eric Joyner ixl: Flip set_aq_phy_int_mask mask bits. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_common.c == --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:52 2016 (r299550) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:59 2016 (r299551) @@ -2564,6 +2564,7 @@ enum i40e_status_code i40e_aq_add_macvla (struct i40e_aqc_macvlan *) enum i40e_status_code status; u16 buf_size; + int i; if (count == 0 || !mv_list || !hw) return I40E_ERR_PARAM; @@ -2577,12 +2578,16 @@ enum i40e_status_code i40e_aq_add_macvla cmd->seid[1] = 0; cmd->seid[2] = 0; + for (i = 0; i < count; i++) + if (I40E_IS_MULTICAST(mv_list[i].mac_addr)) + mv_list[i].flags |= I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC; + desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); if (buf_size > I40E_AQ_LARGE_BUF) desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); status = i40e_asq_send_command(hw, , mv_list, buf_size, - cmd_details); + cmd_details); return status; } Modified: head/sys/dev/ixl/i40e_type.h == --- head/sys/dev/ixl/i40e_type.hThu May 12 18:20:52 2016 (r299550) +++ head/sys/dev/ixl/i40e_type.hThu May 12 18:20:59 2016 (r299551) @@ -162,7 +162,7 @@ enum i40e_memcpy_type { }; -#define I40E_FW_API_VERSION_MINOR_X710 0x0004 +#define I40E_FW_API_VERSION_MINOR_X710 0x0005 /* These are structs for managing the hardware information and the operations. Modified: head/sys/dev/ixl/if_ixl.c == --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:52 2016(r299550) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:59 2016(r299551) @@ -48,7 +48,7 @@ /* * Driver version */ -char ixl_driver_version[] = "1.4.12-k"; +char ixl_driver_version[] = "1.4.13-k"; /* * PCI Device ID Table @@ -1086,10 +1086,11 @@ ixl_init_locked(struct ixl_pf *pf) "change failed!!\n"); return; } else { - ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); } } + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + /* Set the various hardware offload abilities */ ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TSO) @@ -1138,14 +1139,6 @@ ixl_init_locked(struct ixl_pf *pf) ixl_reconfigure_filters(vsi); - /* Set MTU in hardware*/ - int aq_error = i40e_aq_set_mac_config(hw, vsi->max_frame_size, - TRUE, 0, NULL); - if (aq_error) - device_printf(vsi->dev, - "aq_set_mac_config in init error, code %d\n", - aq_error); - /* And now turn on interrupts */ ixl_enable_intr(vsi); @@ -1163,7 +1156,6 @@ ixl_init_locked(struct ixl_pf *pf) return; } -// XXX: super experimental stuff static int ixl_teardown_hw_structs(struct ixl_pf *pf) { @@ -1918,6 +1910,8 @@ ixl_del_multi(struct ixl_vsi *vsi) * This routine checks for link status,updates statistics, * and runs the watchdog check. * + * Only runs when the driver is configured UP and RUNNING. + * **/ static void @@ -4835,12 +4829,12 @@ ixl_add_device_sysctls(struct ixl_pf *pf SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
svn commit: r299549 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:20:36 2016 New Revision: 299549 URL: https://svnweb.freebsd.org/changeset/base/299549 Log: ixl: Update to 1.4.12-k. Changes by author: Eric Joyner ixl: Remove substitution of EACCES for EPERM when perrno is set on an nvmupdate command return. Eric Joyner ixl: Print message when hardware sends GRST interrupt. Eric Joyner ixl: Fix kernel panic when driver fails to initialize admin queue. Eric Joyner ixl: Print out messages when a non-handled other interrupt occurs. Eric Joyner ixl: Fix spaces in a couple messages. Eric Joyner ixl: Add lock around nvmupd command entry point and reconvert EPERM errors to EACCES. Anjali Singhai Jain i40e-shared: Make some changes in the nvm read code Shannon Nelsoni40e-shared: AQ Add Run PHY Activity struct Shannon Nelsoni40e-shared: AQ Add Geneve cloud tunnel type Shannon Nelsoni40e-shared: AQ Add external power class to get link status response struct Shannon Nelsoni40e-shared: AQ Add shared resource flags for macvlan filters Shannon Nelsoni40e-shared: AQ Add set_switch_config Shannon Nelsoni40e-shared: AQ Add VXLAN-GPE tunnel type for cloud filter and tunnel commands Shannon Nelsoni40e-shared: AQ thermal sensor control struct Shannon Nelsoni40e-shared: Bump AQ minor version to 1.5 for FVL5 features Shannon Nelsoni40e-shared: add a little more to an NVM update debug message Carolyn Wyborny i40e-shared: Fix for PHY NVM interaction problem Eric Joyner i40e-shared: Add prototypes for private NVM write functions Eric Joyner ixl/ixlv: Remove unused define from ixl.h. Eric Joyner ixl: Add handling of EMP reset for nvm update purposes. Eric Joyner ixl: Move addition of device sysctls to separate function. Eric Joyner ixl: Fix up a couple error messages in ixl_attach(). Eric Joyner ixl: Update the hardware resource allocation debug sysctl. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_adminq_cmd.h == --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:20:18 2016 (r299548) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:20:36 2016 (r299549) @@ -42,7 +42,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0004 +#define I40E_FW_API_VERSION_MINOR 0x0005 struct i40e_aq_desc { __le16 flags; @@ -153,6 +153,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_remove_statistics = 0x0202, i40e_aqc_opc_set_port_parameters= 0x0203, i40e_aqc_opc_get_switch_resource_alloc = 0x0204, + i40e_aqc_opc_set_switch_config = 0x0205, i40e_aqc_opc_add_vsi= 0x0210, i40e_aqc_opc_update_vsi_parameters = 0x0211, @@ -228,6 +229,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_get_phy_wol_caps = 0x0621, i40e_aqc_opc_set_phy_debug = 0x0622, i40e_aqc_opc_upload_ext_phy_fm = 0x0625, + i40e_aqc_opc_run_phy_activity = 0x0626, /* NVM commands */ i40e_aqc_opc_nvm_read = 0x0701, @@ -236,6 +238,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_config_read= 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, i40e_aqc_opc_oem_post_update= 0x0720, + i40e_aqc_opc_thermal_sensor = 0x0721, /* virtualization commands */ i40e_aqc_opc_send_msg_to_pf = 0x0801, @@ -686,6 +689,17 @@ struct i40e_aqc_switch_resource_alloc_el I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp); +/* Set Switch Configuration (direct 0x0205) */ +struct i40e_aqc_set_switch_config { + __le16 flags; +#define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 +#define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 + __le16 valid_flags; + u8 reserved[12]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config); + /* Add VSI (indirect 0x0210) *this indirect command uses struct i40e_aqc_vsi_properties_data *as the indirect buffer (128 bytes) @@ -908,7 +922,8 @@ struct i40e_aqc_add_veb { I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT) #define
svn commit: r299548 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:20:18 2016 New Revision: 299548 URL: https://svnweb.freebsd.org/changeset/base/299548 Log: ixl: Update to 1.4.9-k. Changes by author: Kamil Krawczyki40e-shared: use explicit cast from u16 to u8 Anjali Singhai Jain i40e-shared: Add a Virtchnl offload for RSS PCTYPE V2 Eric Joyner ixl: Remove HP device IDs. Jesse Brandeburg i40e-shared: add small bit of debug Mitch Williamsi40e-shared: check for stopped admin queue Mitch Williamsi40e-shared: set aq count after memory allocation Jesse Brandeburg i40e-shared: remove forever unused ID Eric Joyner ixl: Fix bug where RSS does not hash to more than 16 queues. Shannon Nelsoni40e-shared: define function capabilities in only one place Eric Joyner ixl: Change spacing, comments, and a single error message. Eric Joyner ixl: Save admin queue phy interrupt mask as a define. Eric Joyner ixl: Move callout_reset() to later in init_locked(), and stop clearing OACTIVE in driver flags. Eric Joyner ixl: Add new reset+build flow to init() if it detects that the admin queue is stopped. Eric Joyner ixl: Return EACCES instead of EPERM when an nvmupdate command fails. Eric Joyner ixl: Remove KX_A device ID. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_devids.h head/sys/dev/ixl/i40e_lan_hmc.c head/sys/dev/ixl/i40e_virtchnl.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_adminq.c == --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:20:18 2016 (r299548) @@ -400,7 +400,6 @@ enum i40e_status_code i40e_init_asq(stru hw->aq.asq.next_to_use = 0; hw->aq.asq.next_to_clean = 0; - hw->aq.asq.count = hw->aq.num_asq_entries; /* allocate the ring memory */ ret_code = i40e_alloc_adminq_asq_ring(hw); @@ -418,6 +417,7 @@ enum i40e_status_code i40e_init_asq(stru goto init_adminq_free_rings; /* success! */ + hw->aq.asq.count = hw->aq.num_asq_entries; goto init_adminq_exit; init_adminq_free_rings: @@ -459,7 +459,6 @@ enum i40e_status_code i40e_init_arq(stru hw->aq.arq.next_to_use = 0; hw->aq.arq.next_to_clean = 0; - hw->aq.arq.count = hw->aq.num_arq_entries; /* allocate the ring memory */ ret_code = i40e_alloc_adminq_arq_ring(hw); @@ -477,6 +476,7 @@ enum i40e_status_code i40e_init_arq(stru goto init_adminq_free_rings; /* success! */ + hw->aq.arq.count = hw->aq.num_arq_entries; goto init_adminq_exit; init_adminq_free_rings: @@ -996,6 +996,13 @@ enum i40e_status_code i40e_clean_arq_ele /* take the lock before we start messing with the ring */ i40e_acquire_spinlock(>aq.arq_spinlock); + if (hw->aq.arq.count == 0) { + i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + "AQRX: Admin queue not initialized.\n"); + ret_code = I40E_ERR_QUEUE_EMPTY; + goto clean_arq_element_err; + } + /* set next_to_use to head */ if (!i40e_is_vf(hw)) ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); @@ -1062,6 +1069,7 @@ clean_arq_element_out: /* Set pending if needed, unlock and return */ if (pending != NULL) *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); +clean_arq_element_err: i40e_release_spinlock(>aq.arq_spinlock); if (i40e_is_nvm_update_op(>desc)) { Modified: head/sys/dev/ixl/i40e_adminq_cmd.h == --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:20:18 2016 (r299548) @@ -267,10 +267,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - /* Proxy commands */ - i40e_aqc_opc_set_proxy_config = 0x0104, - i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, - /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -410,6 +406,7 @@ struct i40e_aqc_list_capabilities_elemen #define I40E_AQ_CAP_ID_OS2BMC_CAP 0x0004 #define I40E_AQ_CAP_ID_FUNCTIONS_VALID 0x0005 #define I40E_AQ_CAP_ID_ALTERNATE_RAM 0x0006 +#define I40E_AQ_CAP_ID_WOL_AND_PROXY 0x0008
svn commit: r299547 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:19:53 2016 New Revision: 299547 URL: https://svnweb.freebsd.org/changeset/base/299547 Log: ixl: Update to 1.4.7-k. Changes by author: Helin Zhang i40e_shared: Fix compilation error - pointer-arith Paul M Stillwell Jr i40e-shared: Replace sprintf with i40e_debug Anjali Singhai Jain i40e-shared: Fix an accidental error with BIT_ULL replacement Jesse Brandeburg i40e-shared: remove useless assignments Anjali Singhai Jain i40e-shared: Add a workaround to drop all flow control frames Anjali Singhai Jain i40e-shared: Add new response struct from FW for AQ command i40e_aqc_lldp_set_local_mib Anjali Singhai Jain i40e-shared: Acquire NVM, before issuing an AQ read nvm command Eric Joyner ixl/ixlv: Remove unused MAX_LOOP define. Eric Joyner ixl: Remove extra aq_get_link_info() call in attach(). Eric Joyner ixl: Modify a couple error messages in attach() to be more informative. Eric Joyner ixl: Add i40e_get_link_status() call to init_locked(). Eric Joyner ixl: Move callout_stop() to earlier in ixl_stop(). Eric Joyner ixl: Add extra comments around link ITR code. Eric Joyner ixl: Attempt to enhance link event handling. Eric Joyner ixl: Style, spacing, and comment changes. Eric Joyner ixl: Add I40E_NVM_ACCESS definition. Eric Joyner ixl: Add interface for nvmupdate tool ioctl to driver. Eric Joyner ixl: Don't strip out nvm update support from the driver anymore. Eric Joyner ixl: Interrupts are now allocated/setup and torn down/released on init()/stop(). Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.h head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_adminq.h == --- head/sys/dev/ixl/i40e_adminq.h Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_adminq.h Thu May 12 18:19:53 2016 (r299547) @@ -115,6 +115,49 @@ struct i40e_adminq_info { enum i40e_admin_queue_err arq_last_status; }; +/** + * i40e_aq_rc_to_posix - convert errors to user-land codes + * aq_ret: AdminQ handler error code can override aq_rc + * aq_rc: AdminQ firmware error code to convert + **/ +static INLINE int i40e_aq_rc_to_posix(int aq_ret, int aq_rc) +{ + int aq_to_posix[] = { + 0, /* I40E_AQ_RC_OK */ + -EPERM, /* I40E_AQ_RC_EPERM */ + -ENOENT, /* I40E_AQ_RC_ENOENT */ + -ESRCH, /* I40E_AQ_RC_ESRCH */ + -EINTR, /* I40E_AQ_RC_EINTR */ + -EIO,/* I40E_AQ_RC_EIO */ + -ENXIO, /* I40E_AQ_RC_ENXIO */ + -E2BIG, /* I40E_AQ_RC_E2BIG */ + -EAGAIN, /* I40E_AQ_RC_EAGAIN */ + -ENOMEM, /* I40E_AQ_RC_ENOMEM */ + -EACCES, /* I40E_AQ_RC_EACCES */ + -EFAULT, /* I40E_AQ_RC_EFAULT */ + -EBUSY, /* I40E_AQ_RC_EBUSY */ + -EEXIST, /* I40E_AQ_RC_EEXIST */ + -EINVAL, /* I40E_AQ_RC_EINVAL */ + -ENOTTY, /* I40E_AQ_RC_ENOTTY */ + -ENOSPC, /* I40E_AQ_RC_ENOSPC */ + -ENOSYS, /* I40E_AQ_RC_ENOSYS */ + -ERANGE, /* I40E_AQ_RC_ERANGE */ + -EPIPE, /* I40E_AQ_RC_EFLUSHED */ + -ESPIPE, /* I40E_AQ_RC_BAD_ADDR */ + -EROFS, /* I40E_AQ_RC_EMODE */ + -EFBIG, /* I40E_AQ_RC_EFBIG */ + }; + + /* aq_rc is invalid if AQ timed out */ + if (aq_ret == I40E_ERR_ADMIN_QUEUE_TIMEOUT) + return -EAGAIN; + + if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0] + return -ERANGE; + + return aq_to_posix[aq_rc]; +} + /* general information */ #define I40E_AQ_LARGE_BUF 512 #define I40E_ASQ_CMD_TIMEOUT 250 /* msecs */ Modified: head/sys/dev/ixl/i40e_adminq_cmd.h == --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:53 2016 (r299547) @@ -2158,6 +2158,14 @@ struct i40e_aqc_lldp_set_local_mib { I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_set_local_mib); +struct i40e_aqc_lldp_set_local_mib_resp { +#define SET_LOCAL_MIB_RESP_EVENT_TRIGGERED_MASK 0x01 + u8
svn commit: r299546 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:19:31 2016 New Revision: 299546 URL: https://svnweb.freebsd.org/changeset/base/299546 Log: ixl: Update to 1.4.6-k. Changes by author: Greg Rose ixl: Add MAC+VLAN filter for LAA MAC assignment Carolyn Wyborny i40e_shared: fix for PHY NVM interaction problem Anjali Singhai Jain i40e-shared: Fix an accidental error with BIT_ULL replacement Eric Joyner ixl: Fix potential crash when loading driver a startup and cannot setup all requested MSIX vectors. Eric Joyner ixl: Add max of 8 queues limit to autoconfig. Eric Joyner ixl: Re-add ian@'s sysctl fixes from upstream (r280043). Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h Modified: head/sys/dev/ixl/i40e_adminq_cmd.h == --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:31 2016 (r299546) @@ -267,6 +267,10 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, + /* Proxy commands */ + i40e_aqc_opc_set_proxy_config = 0x0104, + i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, + /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, Modified: head/sys/dev/ixl/i40e_common.c == --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:19:31 2016 (r299546) @@ -339,16 +339,20 @@ void i40e_debug_aq(struct i40e_hw *hw, e buf[i+4], buf[i+5], buf[i+6], buf[i+7], buf[i+8], buf[i+9], buf[i+10], buf[i+11], buf[i+12], buf[i+13], buf[i+14], buf[i+15]); - /* write whatever's left over without overrunning the buffer */ + /* the most we could have left is 16 bytes, pad with zeros */ if (i < len) { - char d_buf[80]; - int j = 0; + char d_buf[16]; + int j; memset(d_buf, 0, sizeof(d_buf)); - j += sprintf(d_buf, "\t0x%04X ", i); - while (i < len) - j += sprintf(_buf[j], " %02X", buf[i++]); - i40e_debug(hw, mask, "%s\n", d_buf); + for (j = 0; i < len; j++, i++) + d_buf[j] = buf[i]; + i40e_debug(hw, mask, + "\t0x%04X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", + i, d_buf[0], d_buf[1], d_buf[2], d_buf[3], + d_buf[4], d_buf[5], d_buf[6], d_buf[7], + d_buf[8], d_buf[9], d_buf[10], d_buf[11], + d_buf[12], d_buf[13], d_buf[14], d_buf[15]); } } } Modified: head/sys/dev/ixl/i40e_type.h == --- head/sys/dev/ixl/i40e_type.hThu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/i40e_type.hThu May 12 18:19:31 2016 (r299546) @@ -161,6 +161,10 @@ enum i40e_memcpy_type { I40E_DMA_TO_NONDMA }; + +#define I40E_FW_API_VERSION_MINOR_X710 0x0004 + + /* These are structs for managing the hardware information and the operations. * The structures of function pointers are filled out at init time when we * know for sure exactly which hardware we're working with. This gives us the @@ -1183,7 +1187,8 @@ enum i40e_filter_program_desc_fd_status }; #define I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT 23 -#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK BIT_ULL(I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT) +#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK(0x1FFUL << \ +I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT) #define I40E_TXD_FLTR_QW1_DTYPE_SHIFT 0 #define I40E_TXD_FLTR_QW1_DTYPE_MASK (0xFUL << I40E_TXD_FLTR_QW1_DTYPE_SHIFT) Modified: head/sys/dev/ixl/if_ixl.c == --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:18:55 2016(r299545) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:19:31 2016(r299546) @@ -48,7 +48,7 @@
svn commit: r299545 - head/sys/dev/ixl
Author: erj Date: Thu May 12 18:18:55 2016 New Revision: 299545 URL: https://svnweb.freebsd.org/changeset/base/299545 Log: ixl: Update to 1.4.5-k. This first update will revert some upstream changes; forthcoming updates will reinstate them. Changes, by author: Anjali Singhai Jain i40e-shared: Add WB_ON_ITR offload support Shannon Nelsoni40e-shared: fix phy_types bitmap type Kevin Scott i40e-shared: Store off PHY capabilities Shannon Nelsoni40e-shared: fix byteswap of phy_type Jingjing Wu i40e-shared: Fix compile issue related to const string Greg Bowers i40e-shared: Add AQ defines for non-willing Apps (DCB) Greg Bowers i40e-shared: Support for non-willing Apps (DCB) Shannon Nelsoni40e-shared: use upper-32 bit macro for address Shannon Nelsoni40e-shared: grab the AQ spinlocks before clearing registers Eric Joyner ixl: Properly strip out X722_SUPPORT (temporarily). Eric Joyner ixl: Allow Fort Pond devices to advertise 100M in set_advertise sysctl. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by:sbruno, kmacy, jeffrey.e.pie...@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_alloc.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_devids.h head/sys/dev/ixl/i40e_hmc.c head/sys/dev/ixl/i40e_lan_hmc.h head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_register.h head/sys/dev/ixl/i40e_status.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/i40e_virtchnl.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv_vc_mgr.h Modified: head/sys/dev/ixl/i40e_adminq.c == --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:18:55 2016 (r299545) @@ -496,8 +496,12 @@ enum i40e_status_code i40e_shutdown_asq( { enum i40e_status_code ret_code = I40E_SUCCESS; - if (hw->aq.asq.count == 0) - return I40E_ERR_NOT_READY; + i40e_acquire_spinlock(>aq.asq_spinlock); + + if (hw->aq.asq.count == 0) { + ret_code = I40E_ERR_NOT_READY; + goto shutdown_asq_out; + } /* Stop firmware AdminQ processing */ wr32(hw, hw->aq.asq.head, 0); @@ -506,16 +510,13 @@ enum i40e_status_code i40e_shutdown_asq( wr32(hw, hw->aq.asq.bal, 0); wr32(hw, hw->aq.asq.bah, 0); - /* make sure spinlock is available */ - i40e_acquire_spinlock(>aq.asq_spinlock); - hw->aq.asq.count = 0; /* to indicate uninitialized queue */ /* free ring buffers */ i40e_free_asq_bufs(hw); +shutdown_asq_out: i40e_release_spinlock(>aq.asq_spinlock); - return ret_code; } @@ -529,8 +530,12 @@ enum i40e_status_code i40e_shutdown_arq( { enum i40e_status_code ret_code = I40E_SUCCESS; - if (hw->aq.arq.count == 0) - return I40E_ERR_NOT_READY; + i40e_acquire_spinlock(>aq.arq_spinlock); + + if (hw->aq.arq.count == 0) { + ret_code = I40E_ERR_NOT_READY; + goto shutdown_arq_out; + } /* Stop firmware AdminQ processing */ wr32(hw, hw->aq.arq.head, 0); @@ -539,16 +544,13 @@ enum i40e_status_code i40e_shutdown_arq( wr32(hw, hw->aq.arq.bal, 0); wr32(hw, hw->aq.arq.bah, 0); - /* make sure spinlock is available */ - i40e_acquire_spinlock(>aq.arq_spinlock); - hw->aq.arq.count = 0; /* to indicate uninitialized queue */ /* free ring buffers */ i40e_free_arq_bufs(hw); +shutdown_arq_out: i40e_release_spinlock(>aq.arq_spinlock); - return ret_code; } @@ -773,21 +775,23 @@ enum i40e_status_code i40e_asq_send_comm u16 retval = 0; u32 val = 0; + i40e_acquire_spinlock(>aq.asq_spinlock); + hw->aq.asq_last_status = I40E_AQ_RC_OK; - val = rd32(hw, hw->aq.asq.head); - if (val >= hw->aq.num_asq_entries) { + if (hw->aq.asq.count == 0) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, - "AQTX: head overrun at %d\n", val); + "AQTX: Admin queue not initialized.\n"); status = I40E_ERR_QUEUE_EMPTY; - goto asq_send_command_exit; + goto asq_send_command_error; } - if (hw->aq.asq.count == 0) { + val = rd32(hw, hw->aq.asq.head); + if (val >= hw->aq.num_asq_entries) { i40e_debug(hw,
svn commit: r299544 - head/sys/dev/an
Author: scottl Date: Thu May 12 17:47:30 2016 New Revision: 299544 URL: https://svnweb.freebsd.org/changeset/base/299544 Log: Move mutex initialization from PCI probe to PCI attach. Drivers are not allowed to create any persistent state in their probe routine because it's not guaranteed that they'll win the election and be allowed to attach. Submitted by: Matthew Macy MFC after:3 days Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_an_pci.c head/sys/dev/an/if_anreg.h Modified: head/sys/dev/an/if_an.c == --- head/sys/dev/an/if_an.c Thu May 12 16:34:59 2016(r299543) +++ head/sys/dev/an/if_an.c Thu May 12 17:47:30 2016(r299544) @@ -304,23 +304,6 @@ SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_m 0, sizeof(an_conf_cache), sysctl_an_cache_mode, "A", ""); /* - * Setup the lock for PCI attachment since it skips the an_probe - * function. We need to setup the lock in an_probe since some - * operations need the lock. So we might as well create the - * lock in the probe. - */ -int -an_pci_probe(device_t dev) -{ - struct an_softc *sc = device_get_softc(dev); - - mtx_init(>an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, - MTX_DEF); - - return(0); -} - -/* * We probe for an Aironet 4500/4800 card by attempting to * read the default SSID list. On reset, the first entry in * the SSID list will contain the name "tsunami." If we don't Modified: head/sys/dev/an/if_an_pci.c == --- head/sys/dev/an/if_an_pci.c Thu May 12 16:34:59 2016(r299543) +++ head/sys/dev/an/if_an_pci.c Thu May 12 17:47:30 2016(r299544) @@ -119,16 +119,16 @@ static int an_probe_pci(device_t dev) { struct an_type *t; - struct an_softc *sc = device_get_softc(dev); + uint16_t vid, did; - bzero(sc, sizeof(struct an_softc)); t = an_devs; + vid = pci_get_vendor(dev); + did = pci_get_device(dev); while (t->an_name != NULL) { - if (pci_get_vendor(dev) == t->an_vid && - pci_get_device(dev) == t->an_did) { + if (vid == t->an_vid && + did == t->an_did) { device_set_desc(dev, t->an_name); - an_pci_probe(dev); return(BUS_PROBE_DEFAULT); } t++; @@ -145,8 +145,16 @@ an_attach_pci(dev) int flags, error = 0; sc = device_get_softc(dev); + bzero(sc, sizeof(struct an_softc)); flags = device_get_flags(dev); + /* +* Setup the lock in PCI attachment since it skips the an_probe +* function. +*/ + mtx_init(>an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + if (pci_get_vendor(dev) == AIRONET_VENDORID && pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { sc->mpi350 = 1; Modified: head/sys/dev/an/if_anreg.h == --- head/sys/dev/an/if_anreg.h Thu May 12 16:34:59 2016(r299543) +++ head/sys/dev/an/if_anreg.h Thu May 12 17:47:30 2016(r299544) @@ -500,7 +500,6 @@ int an_alloc_port (device_t, int, int); intan_alloc_memory (device_t, int, int); intan_alloc_aux_memory (device_t, int, int); intan_alloc_irq(device_t, int, int); -intan_pci_probe(device_t); intan_probe(device_t); intan_shutdown (device_t); void an_resume (device_t); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299543 - head/sys/netinet
Author: tuexen Date: Thu May 12 16:34:59 2016 New Revision: 299543 URL: https://svnweb.freebsd.org/changeset/base/299543 Log: Retire net.inet.sctp.strict_sacks and net.inet.sctp.strict_data_order sysctl's, since they where only there to interop with non-conformant implementations. This should not be a problem anymore. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_indata.c == --- head/sys/netinet/sctp_indata.c Thu May 12 16:18:02 2016 (r299542) +++ head/sys/netinet/sctp_indata.c Thu May 12 16:34:59 2016 (r299543) @@ -2655,16 +2655,18 @@ sctp_process_data(struct mbuf **mm, int case SCTP_STREAM_RESET: case SCTP_FORWARD_CUM_TSN: case SCTP_ASCONF: - /* -* Now, what do we do with KNOWN chunks that -* are NOT in the right place? -* -* For now, I do nothing but ignore them. We -* may later want to add sysctl stuff to -* switch out and do either an ABORT() or -* possibly process them. -*/ - if (SCTP_BASE_SYSCTL(sctp_strict_data_order)) { + { + /* +* Now, what do we do with KNOWN +* chunks that are NOT in the right +* place? +* +* For now, I do nothing but ignore +* them. We may later want to add +* sysctl stuff to switch out and do +* either an ABORT() or possibly +* process them. +*/ struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; @@ -2674,7 +2676,6 @@ sctp_process_data(struct mbuf **mm, int sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } - break; default: /* unknown chunk type, use bit rules */ if (ch->chunk_type & 0x40) { @@ -3748,6 +3749,7 @@ sctp_express_handle_sack(struct sctp_tcb int win_probe_recovered = 0; int j, done_once = 0; int rto_ok = 1; + uint32_t send_s; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_SACK_ARRIVALS_ENABLE) { sctp_misc_ints(SCTP_SACK_LOG_EXPRESS, cumack, @@ -3799,29 +3801,25 @@ sctp_express_handle_sack(struct sctp_tcb (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); } } - if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { - uint32_t send_s; - - if (!TAILQ_EMPTY(>sent_queue)) { - tp1 = TAILQ_LAST(>sent_queue, - sctpchunk_listhead); - send_s = tp1->rec.data.TSN_seq + 1; - } else { - send_s = asoc->sending_seq; - } - if (SCTP_TSN_GE(cumack, send_s)) { - struct mbuf *op_err; - char msg[SCTP_DIAG_INFO_LEN]; - - *abort_now = 1; - /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", - cumack, send_s); - op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; - sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); - return; - } + if (!TAILQ_EMPTY(>sent_queue)) { + tp1 = TAILQ_LAST(>sent_queue, + sctpchunk_listhead); + send_s = tp1->rec.data.TSN_seq + 1; + } else { + send_s = asoc->sending_seq; + } + if (SCTP_TSN_GE(cumack, send_s)) { + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; + + *abort_now = 1; + /* XXX */ + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN
svn commit: r299542 - head/sys/dev/xen/netfront
Author: royger Date: Thu May 12 16:18:02 2016 New Revision: 299542 URL: https://svnweb.freebsd.org/changeset/base/299542 Log: xen-netfront: fix feature detection Current netfront code relies on xs_scanf returning a value < 0 on error, which is not right, xs_scanf returns a positive value on error. MFC after:3 days Tested by:Stephen JonesSponsored by: Citrix Systems R Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c == --- head/sys/dev/xen/netfront/netfront.cThu May 12 16:14:16 2016 (r299541) +++ head/sys/dev/xen/netfront/netfront.cThu May 12 16:18:02 2016 (r299542) @@ -2016,7 +2016,7 @@ xn_query_features(struct netfront_info * device_printf(np->xbdev, "backend features:"); if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), - "feature-sg", NULL, "%d", ) < 0) + "feature-sg", NULL, "%d", ) != 0) val = 0; np->maxfrags = 1; @@ -2026,7 +2026,7 @@ xn_query_features(struct netfront_info * } if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), - "feature-gso-tcpv4", NULL, "%d", ) < 0) + "feature-gso-tcpv4", NULL, "%d", ) != 0) val = 0; np->xn_ifp->if_capabilities &= ~(IFCAP_TSO4|IFCAP_LRO); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299541 - head/sys/dev/siba
Author: adrian Date: Thu May 12 16:14:16 2016 New Revision: 299541 URL: https://svnweb.freebsd.org/changeset/base/299541 Log: [siba] add more MCS tx power offset decoding. This is required by the bwn(4) N-PHY support. Obtained from:Linux ssb (definitions) Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c == --- head/sys/dev/siba/siba_core.c Thu May 12 16:07:25 2016 (r299540) +++ head/sys/dev/siba/siba_core.c Thu May 12 16:14:16 2016 (r299541) @@ -1834,6 +1834,9 @@ siba_sprom_r8(struct siba_sprom *out, co SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SROM8_5GH_PA_2, ~0); } + SIBA_SHIFTOUT(cddpo, SIBA_SPROM8_CDDPO, ~0); + SIBA_SHIFTOUT(stbcpo, SIBA_SPROM8_STBCPO, ~0); + siba_sprom_r458(out, in); } @@ -2562,6 +2565,12 @@ siba_read_sprom(device_t dev, device_t c case SIBA_SPROMVAR_TXPID_5GH_3: *result = siba->siba_sprom.txpid5gh[3]; break; + case SIBA_SPROMVAR_STBCPO: + *result = siba->siba_sprom.stbcpo; + break; + case SIBA_SPROMVAR_CDDPO: + *result = siba->siba_sprom.cddpo; + break; default: return (ENOENT); } @@ -2814,6 +2823,46 @@ siba_sprom_get_core_power_info(device_t return (0); } +int +siba_sprom_get_mcs2gpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, >siba_sprom.mcs2gpo, sizeof(uint16_t) * 8); + return (0); +} + +int +siba_sprom_get_mcs5glpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, >siba_sprom.mcs5glpo, sizeof(uint16_t) * 8); + return (0); +} + +int +siba_sprom_get_mcs5gpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, >siba_sprom.mcs5gpo, sizeof(uint16_t) * 8); + return (0); +} + +int +siba_sprom_get_mcs5ghpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, >siba_sprom.mcs5ghpo, sizeof(uint16_t) * 8); + return (0); +} + void siba_pmu_spuravoid_pllupdate(device_t dev, int spur_avoid) { Modified: head/sys/dev/siba/sibareg.h == --- head/sys/dev/siba/sibareg.h Thu May 12 16:07:25 2016(r299540) +++ head/sys/dev/siba/sibareg.h Thu May 12 16:14:16 2016(r299541) @@ -520,6 +520,10 @@ #defineSIBA_SPROM8_OFDM5GPO0x1146 #defineSIBA_SPROM8_OFDM5GLPO 0x114a #defineSIBA_SPROM8_OFDM5GHPO 0x114e +#defineSIBA_SPROM8_CDDPO 0x0192 +#defineSIBA_SPROM8_STBCPO 0x0194 +#defineSIBA_SPROM8_BW40PO 0x0196 +#defineSIBA_SPROM8_BWDUPPO 0x0198 /* There are 4 blocks with power info sharing the same layout */ #defineSIBA_SROM8_PWR_INFO_CORE0 0x00C0 Modified: head/sys/dev/siba/sibavar.h == --- head/sys/dev/siba/sibavar.h Thu May 12 16:07:25 2016(r299540) +++ head/sys/dev/siba/sibavar.h Thu May 12 16:14:16 2016(r299541) @@ -305,6 +305,8 @@ enum siba_sprom_vars { SIBA_SPROMVAR_TXPID_5GH_1, SIBA_SPROMVAR_TXPID_5GH_2, SIBA_SPROMVAR_TXPID_5GH_3, + SIBA_SPROMVAR_STBCPO, + SIBA_SPROMVAR_CDDPO, }; intsiba_read_sprom(device_t, device_t, int, uintptr_t *); @@ -419,6 +421,8 @@ SIBA_SPROM_ACCESSOR(txpid_5gh_0, TXPID_5 SIBA_SPROM_ACCESSOR(txpid_5gh_1, TXPID_5GH_1, uint8_t); SIBA_SPROM_ACCESSOR(txpid_5gh_2, TXPID_5GH_2, uint8_t); SIBA_SPROM_ACCESSOR(txpid_5gh_3, TXPID_5GH_3, uint8_t); +SIBA_SPROM_ACCESSOR(stbcpo, STBCPO, uint16_t); +SIBA_SPROM_ACCESSOR(cddpo, CDDPO, uint16_t); #undef SIBA_SPROM_ACCESSOR @@ -512,6 +516,14 @@ struct siba_sprom { uint8_t antswlut; } ghz5; } fem; + + uint16_t mcs2gpo[8]; + uint16_t mcs5gpo[8]; + uint16_t mcs5glpo[8]; + uint16_t mcs5ghpo[8]; + + uint16_t cddpo; + uint16_t stbcpo; }; #defineSIBA_LDO_PAREF 0 @@ -648,6 +660,10 @@ uint32_t siba_gpio_get(device_t); void siba_fix_imcfglobug(device_t); intsiba_sprom_get_core_power_info(device_t, int, struct siba_sprom_core_pwr_info *); +intsiba_sprom_get_mcs2gpo(device_t, uint16_t *); +intsiba_sprom_get_mcs5glpo(device_t,
svn commit: r299540 - in head/contrib/libarchive: . libarchive
Author: mm Date: Thu May 12 16:07:25 2016 New Revision: 299540 URL: https://svnweb.freebsd.org/changeset/base/299540 Log: MFV 299539: Record mergeinfo in contrib/libarchive for patches accepted upstream. Modified: Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299539 - in vendor/libarchive/dist: cat libarchive libarchive_fe
Author: mm Date: Thu May 12 16:03:55 2016 New Revision: 299539 URL: https://svnweb.freebsd.org/changeset/base/299539 Log: Update vendor/libarchive/dist to git commit f48d99b Integrates my pull requests #701, #702 and #703 Modified: vendor/libarchive/dist/cat/bsdcat.c vendor/libarchive/dist/cat/bsdcat.h vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive_fe/err.c Modified: vendor/libarchive/dist/cat/bsdcat.c == --- vendor/libarchive/dist/cat/bsdcat.c Thu May 12 16:01:33 2016 (r299538) +++ vendor/libarchive/dist/cat/bsdcat.c Thu May 12 16:03:55 2016 (r299539) @@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$"); #defineBYTES_PER_BLOCK (20*512) -struct archive *a; -struct archive_entry *ae; -char *bsdcat_current_path; -int exit_status = 0; +static struct archive *a; +static struct archive_entry *ae; +static const char *bsdcat_current_path; +static int exit_status = 0; void @@ -68,7 +68,7 @@ version(void) } void -bsdcat_next() +bsdcat_next(void) { a = archive_read_new(); archive_read_support_filter_all(a); @@ -85,7 +85,7 @@ bsdcat_print_error(void) } void -bsdcat_read_to_stdout(char* filename) +bsdcat_read_to_stdout(const char* filename) { int r; Modified: vendor/libarchive/dist/cat/bsdcat.h == --- vendor/libarchive/dist/cat/bsdcat.h Thu May 12 16:01:33 2016 (r299538) +++ vendor/libarchive/dist/cat/bsdcat.h Thu May 12 16:03:55 2016 (r299539) @@ -53,4 +53,4 @@ int bsdcat_getopt(struct bsdcat *); void usage(FILE *stream, int eval); void bsdcat_next(void); void bsdcat_print_error(void); -void bsdcat_read_to_stdout(char* filename); +void bsdcat_read_to_stdout(const char* filename); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c == --- vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu May 12 16:01:33 2016(r299538) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu May 12 16:03:55 2016(r299539) @@ -1342,7 +1342,7 @@ parse_line(struct archive_read *a, struc /* strsep() is not in C90, but strcspn() is. */ /* Taken from http://unixpapa.com/incnote/string.html */ static char * -la_strsep(char **sp, char *sep) +la_strsep(char **sp, const char *sep) { char *p, *s; if (sp == NULL || *sp == NULL || **sp == '\0') Modified: vendor/libarchive/dist/libarchive_fe/err.c == --- vendor/libarchive/dist/libarchive_fe/err.c Thu May 12 16:01:33 2016 (r299538) +++ vendor/libarchive/dist/libarchive_fe/err.c Thu May 12 16:03:55 2016 (r299539) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); static void lafe_vwarnc(int, const char *, va_list) __LA_PRINTFLIKE(2, 0); -const char *lafe_progname; +static const char *lafe_progname; const char * lafe_getprogname(void) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299538 - head/sys/dev/siba
Author: adrian Date: Thu May 12 16:01:33 2016 New Revision: 299538 URL: https://svnweb.freebsd.org/changeset/base/299538 Log: [siba] add TX power index entry parsing. This is required by the bwn(4) N-PHY support. Obtained from:Linux ssb (definitions) Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c == --- head/sys/dev/siba/siba_core.c Thu May 12 15:48:08 2016 (r299537) +++ head/sys/dev/siba/siba_core.c Thu May 12 16:01:33 2016 (r299538) @@ -1569,6 +1569,47 @@ siba_sprom_r123(struct siba_sprom *out, } static void +siba_sprom_r458(struct siba_sprom *out, const uint16_t *in) +{ + + SIBA_SHIFTOUT(txpid2g[0], SIBA_SPROM4_TXPID2G01, + SIBA_SPROM4_TXPID2G0); + SIBA_SHIFTOUT(txpid2g[1], SIBA_SPROM4_TXPID2G01, + SIBA_SPROM4_TXPID2G1); + SIBA_SHIFTOUT(txpid2g[2], SIBA_SPROM4_TXPID2G23, + SIBA_SPROM4_TXPID2G2); + SIBA_SHIFTOUT(txpid2g[3], SIBA_SPROM4_TXPID2G23, + SIBA_SPROM4_TXPID2G3); + + SIBA_SHIFTOUT(txpid5gl[0], SIBA_SPROM4_TXPID5GL01, + SIBA_SPROM4_TXPID5GL0); + SIBA_SHIFTOUT(txpid5gl[1], SIBA_SPROM4_TXPID5GL01, + SIBA_SPROM4_TXPID5GL1); + SIBA_SHIFTOUT(txpid5gl[2], SIBA_SPROM4_TXPID5GL23, + SIBA_SPROM4_TXPID5GL2); + SIBA_SHIFTOUT(txpid5gl[3], SIBA_SPROM4_TXPID5GL23, + SIBA_SPROM4_TXPID5GL3); + + SIBA_SHIFTOUT(txpid5g[0], SIBA_SPROM4_TXPID5G01, + SIBA_SPROM4_TXPID5G0); + SIBA_SHIFTOUT(txpid5g[1], SIBA_SPROM4_TXPID5G01, + SIBA_SPROM4_TXPID5G1); + SIBA_SHIFTOUT(txpid5g[2], SIBA_SPROM4_TXPID5G23, + SIBA_SPROM4_TXPID5G2); + SIBA_SHIFTOUT(txpid5g[3], SIBA_SPROM4_TXPID5G23, + SIBA_SPROM4_TXPID5G3); + + SIBA_SHIFTOUT(txpid5gh[0], SIBA_SPROM4_TXPID5GH01, + SIBA_SPROM4_TXPID5GH0); + SIBA_SHIFTOUT(txpid5gh[1], SIBA_SPROM4_TXPID5GH01, + SIBA_SPROM4_TXPID5GH1); + SIBA_SHIFTOUT(txpid5gh[2], SIBA_SPROM4_TXPID5GH23, + SIBA_SPROM4_TXPID5GH2); + SIBA_SHIFTOUT(txpid5gh[3], SIBA_SPROM4_TXPID5GH23, + SIBA_SPROM4_TXPID5GH3); +} + +static void siba_sprom_r45(struct siba_sprom *out, const uint16_t *in) { int i; @@ -1659,6 +1700,8 @@ siba_sprom_r45(struct siba_sprom *out, c SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SPROM4_5GH_PA_2, ~0); SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[3], o + SIBA_SPROM4_5GH_PA_3, ~0); } + + siba_sprom_r458(out, in); } static void @@ -1700,6 +1743,7 @@ siba_sprom_r8(struct siba_sprom *out, co SIBA_SHIFTOUT(tri5gh, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GH); SIBA_SHIFTOUT(rxpo2g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO2G); SIBA_SHIFTOUT(rxpo5g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO5G); + SIBA_SHIFTOUT(rssismf2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMF2G); SIBA_SHIFTOUT(rssismc2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMC2G); SIBA_SHIFTOUT(rssisav2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISAV2G); @@ -1789,6 +1833,8 @@ siba_sprom_r8(struct siba_sprom *out, co SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[1], o + SIBA_SROM8_5GH_PA_1, ~0); SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SROM8_5GH_PA_2, ~0); } + + siba_sprom_r458(out, in); } static int8_t @@ -2468,6 +2514,54 @@ siba_read_sprom(device_t dev, device_t c case SIBA_SPROMVAR_FEM_5GHZ_ANTSWLUT: *result = siba->siba_sprom.fem.ghz5.antswlut; break; + case SIBA_SPROMVAR_TXPID_2G_0: + *result = siba->siba_sprom.txpid2g[0]; + break; + case SIBA_SPROMVAR_TXPID_2G_1: + *result = siba->siba_sprom.txpid2g[1]; + break; + case SIBA_SPROMVAR_TXPID_2G_2: + *result = siba->siba_sprom.txpid2g[2]; + break; + case SIBA_SPROMVAR_TXPID_2G_3: + *result = siba->siba_sprom.txpid2g[3]; + break; + case SIBA_SPROMVAR_TXPID_5GL_0: + *result = siba->siba_sprom.txpid5gl[0]; + break; + case SIBA_SPROMVAR_TXPID_5GL_1: + *result = siba->siba_sprom.txpid5gl[1]; + break; + case SIBA_SPROMVAR_TXPID_5GL_2: + *result = siba->siba_sprom.txpid5gl[2]; + break; + case SIBA_SPROMVAR_TXPID_5GL_3: + *result = siba->siba_sprom.txpid5gl[3]; + break; + case SIBA_SPROMVAR_TXPID_5G_0: + *result = siba->siba_sprom.txpid5g[0]; + break; + case SIBA_SPROMVAR_TXPID_5G_1: + *result = siba->siba_sprom.txpid5g[1]; + break; + case SIBA_SPROMVAR_TXPID_5G_2: + *result =
svn commit: r299537 - head/sys/netinet
Author: tuexen Date: Thu May 12 15:48:08 2016 New Revision: 299537 URL: https://svnweb.freebsd.org/changeset/base/299537 Log: Enable SACK Immediately per default. This has been tested for a long time and implements covered by RFC 7053. MFC after: 1 week Modified: head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_sysctl.h == --- head/sys/netinet/sctp_sysctl.h Thu May 12 15:31:58 2016 (r299536) +++ head/sys/netinet/sctp_sysctl.h Thu May 12 15:48:08 2016 (r299537) @@ -492,7 +492,7 @@ struct sctp_sysctl { #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit." #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN0 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX1 -#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN +#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX /* Enable sending of the NAT-FRIENDLY message */ #define SCTPCTL_NAT_FRIENDLY_INITS_DESC"Enable sending of the nat-friendly SCTP option on INITs." ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299536 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: asomers Date: Thu May 12 15:31:58 2016 New Revision: 299536 URL: https://svnweb.freebsd.org/changeset/base/299536 Log: MFC r297986, r298017 to vdev_geom.c r297986 | asomers | 2016-04-14 13:20:31 -0600 (Thu, 14 Apr 2016) | 6 lines Update a debugging message in vdev_geom_open_by_guids for consistency with similar messages elsewhere in the file. r298017 | asomers | 2016-04-14 17:14:41 -0600 (Thu, 14 Apr 2016) | 8 lines Add more debugging statements in vdev_geom.c Log a debugging message whenever geom functions fail in vdev_geom_attach. Printing these messages is controlled by vfs.zfs.debug Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c == --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu May 12 15:24:36 2016(r299535) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu May 12 15:31:58 2016(r299536) @@ -158,6 +158,7 @@ vdev_geom_attach(struct g_provider *pp, { struct g_geom *gp; struct g_consumer *cp; + int error; g_topology_assert(); @@ -175,11 +176,17 @@ vdev_geom_attach(struct g_provider *pp, gp->orphan = vdev_geom_orphan; gp->attrchanged = vdev_geom_attrchanged; cp = g_new_consumer(gp); - if (g_attach(cp, pp) != 0) { + error = g_attach(cp, pp); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", __func__, + __LINE__, error); g_wither_geom(gp, ENXIO); return (NULL); } - if (g_access(cp, 1, 0, 1) != 0) { + error = g_access(cp, 1, 0, 1); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__, + __LINE__, error); g_wither_geom(gp, ENXIO); return (NULL); } @@ -194,19 +201,29 @@ vdev_geom_attach(struct g_provider *pp, } if (cp == NULL) { cp = g_new_consumer(gp); - if (g_attach(cp, pp) != 0) { + error = g_attach(cp, pp); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", + __func__, __LINE__, error); g_destroy_consumer(cp); return (NULL); } - if (g_access(cp, 1, 0, 1) != 0) { + error = g_access(cp, 1, 0, 1); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", + __func__, __LINE__, error); g_detach(cp); g_destroy_consumer(cp); return (NULL); } ZFS_LOG(1, "Created consumer for %s.", pp->name); } else { - if (g_access(cp, 1, 0, 1) != 0) + error = g_access(cp, 1, 0, 1); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", + __func__, __LINE__, error); return (NULL); + } ZFS_LOG(1, "Used existing consumer for %s.", pp->name); } } @@ -622,7 +639,8 @@ vdev_geom_open_by_guids(vdev_t *vd) g_topology_assert(); - ZFS_LOG(1, "Searching by guid [%ju].", (uintmax_t)vd->vdev_guid); + ZFS_LOG(1, "Searching by guids [%ju:%ju].", + (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid); cp = vdev_geom_attach_by_guids(vd); if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299535 - head/sys/arm64/arm64
Author: andrew Date: Thu May 12 15:24:36 2016 New Revision: 299535 URL: https://svnweb.freebsd.org/changeset/base/299535 Log: Rename the internal BUC_DMA_* flags to BF_* so they won't conflict with the flags in sys/bus_dma.h. Obtained from:ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c == --- head/sys/arm64/arm64/busdma_bounce.cThu May 12 15:18:36 2016 (r299534) +++ head/sys/arm64/arm64/busdma_bounce.cThu May 12 15:24:36 2016 (r299535) @@ -59,9 +59,9 @@ __FBSDID("$FreeBSD$"); #define MAX_BPAGES 4096 enum { - BUS_DMA_COULD_BOUNCE= 0x01, - BUS_DMA_MIN_ALLOC_COMP = 0x02, - BUS_DMA_KMEM_ALLOC = 0x04, + BF_COULD_BOUNCE = 0x01, + BF_MIN_ALLOC_COMP = 0x02, + BF_KMEM_ALLOC = 0x04, }; struct bounce_zone; @@ -172,14 +172,14 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->segments = NULL; if (parent != NULL && ((newtag->common.filter != NULL) || - ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))) - newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; + ((parent->bounce_flags & BF_COULD_BOUNCE) != 0))) + newtag->bounce_flags |= BF_COULD_BOUNCE; if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || newtag->common.alignment > 1) - newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; + newtag->bounce_flags |= BF_COULD_BOUNCE; - if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((newtag->bounce_flags & BF_COULD_BOUNCE) != 0) && (flags & BUS_DMA_ALLOCNOW) != 0) { struct bounce_zone *bz; @@ -200,7 +200,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t error = ENOMEM; } /* Performed initial allocation */ - newtag->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; + newtag->bounce_flags |= BF_MIN_ALLOC_COMP; } else error = 0; @@ -300,7 +300,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t d * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { + if (dmat->bounce_flags & BF_COULD_BOUNCE) { /* Must bounce */ if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) { @@ -321,18 +321,18 @@ bounce_bus_dmamap_create(bus_dma_tag_t d else maxpages = MIN(MAX_BPAGES, Maxmem - atop(dmat->common.lowaddr)); - if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) == 0 || (bz->map_count > 0 && bz->total_bpages < maxpages)) { pages = MAX(atop(dmat->common.maxsize), 1); pages = MIN(maxpages - bz->total_bpages, pages); pages = MAX(pages, 1); if (alloc_bounce_pages(dmat, pages) < pages) error = ENOMEM; - if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) == 0) { if (error == 0) { dmat->bounce_flags |= - BUS_DMA_MIN_ALLOC_COMP; + BF_MIN_ALLOC_COMP; } } else error = 0; @@ -450,13 +450,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, attr); - dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; + dmat->bounce_flags |= BF_KMEM_ALLOC; } else { *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, dmat->common.boundary, attr); - dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; + dmat->bounce_flags |= BF_KMEM_ALLOC; } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", @@ -482,12 +482,12 @@ bounce_bus_dmamem_free(bus_dma_tag_t dma /* * Check the map came from bounce_bus_dmamem_alloc, so the map -* should be NULL and the BUS_DMA_KMEM_ALLOC flag cleared if
svn commit: r299534 - head/sys/dev/siba
Author: adrian Date: Thu May 12 15:18:36 2016 New Revision: 299534 URL: https://svnweb.freebsd.org/changeset/base/299534 Log: [siba] add extra methods for chipcommon access and PLL configuration. This is needed by the PHY-N bwn(4) support. Obtained from:Linux b43 (definitions) Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c == --- head/sys/dev/siba/siba_core.c Thu May 12 14:41:53 2016 (r299533) +++ head/sys/dev/siba/siba_core.c Thu May 12 15:18:36 2016 (r299534) @@ -2720,3 +2720,124 @@ siba_sprom_get_core_power_info(device_t return (0); } +void +siba_pmu_spuravoid_pllupdate(device_t dev, int spur_avoid) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = >siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + switch (siba_get_chipid(dev)) { + case 0x4322: + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL0, 0x11100070); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL1, 0x1014140a); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL5, 0x8854); + if (spur_avoid == 1) + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x05201828); + else + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x05001828); + break; + case 43222: + if (spur_avoid == 1) { + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL0, 0x1158); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL1, 0x0C000C06); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x0F600a08); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL3, 0x); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL4, 0x2001E920); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL5, 0x8815); + } else { + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL0, 0x1118); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL1, 0x0c000c06); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x03000a08); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL3, 0x); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL4, 0x25c0); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL5, 0x8855); + } + break; + default: + device_printf(dev, + "%s: unknown spur avoidance settings for chip 0x%04x\n", + __func__, + siba_get_chipid(dev)); + return; + } + + /* Both chips above use the same update */ + SIBA_CC_SET32(scc, SIBA_CC_PMUCTL, SIBA_CC_PMUCTL_PLL_UPD); +} + +void +siba_cc_set32(device_t dev, uint32_t reg, uint32_t val) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = >siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + SIBA_CC_SET32(scc, reg, val); +} + +void +siba_cc_mask32(device_t dev, uint32_t reg, uint32_t mask) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = >siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + SIBA_CC_MASK32(scc, reg, mask); +} + +uint32_t +siba_cc_read32(device_t dev, uint32_t reg) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = >siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return 0x; + } + + return SIBA_CC_READ32(scc, reg); +} + +void +siba_cc_write32(device_t dev, uint32_t reg, uint32_t val) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = >siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + SIBA_CC_WRITE32(scc, reg, val); +} + Modified: head/sys/dev/siba/sibareg.h == --- head/sys/dev/siba/sibareg.h Thu May 12 14:41:53 2016(r299533) +++ head/sys/dev/siba/sibareg.h Thu May 12
svn commit: r299533 - head/sys/netinet
Author: tuexen Date: Thu May 12 14:41:53 2016 New Revision: 299533 URL: https://svnweb.freebsd.org/changeset/base/299533 Log: Use a format string in snprintf() for consistency. This was reported by Radek Malcic when using the userland stack in combination with MinGW. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c == --- head/sys/netinet/sctp_indata.c Thu May 12 12:13:28 2016 (r299532) +++ head/sys/netinet/sctp_indata.c Thu May 12 14:41:53 2016 (r299533) @@ -2566,7 +2566,7 @@ sctp_process_data(struct mbuf **mm, int struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "I-DATA chunk received when DATA was negotiated"); + snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_18; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2577,7 +2577,7 @@ sctp_process_data(struct mbuf **mm, int struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk received when I-DATA was negotiated"); + snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299532 - head/sys/arm64/arm64
Author: andrew Date: Thu May 12 12:13:28 2016 New Revision: 299532 URL: https://svnweb.freebsd.org/changeset/base/299532 Log: Restrict the memory barriers in bus_dmamap_sync to just the operations where it's needed. Obtained from:ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c == --- head/sys/arm64/arm64/busdma_bounce.cThu May 12 12:03:27 2016 (r299531) +++ head/sys/arm64/arm64/busdma_bounce.cThu May 12 12:13:28 2016 (r299532) @@ -799,12 +799,6 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma struct bounce_page *bpage; vm_offset_t datavaddr, tempvaddr; - if ((bpage = STAILQ_FIRST(>bpages)) == NULL) { - /* Wait for any memory access to complete */ - dsb(sy); - return; - } - /* * XXX ARM64TODO: * This bus_dma implementation requires IO-Coherent architecutre. @@ -812,56 +806,63 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma * added to this function. */ - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " - "performing bounce", __func__, dmat, dmat->common.flags, op); - - if ((op & BUS_DMASYNC_PREWRITE) != 0) { - while (bpage != NULL) { - tempvaddr = 0; - datavaddr = bpage->datavaddr; - if (datavaddr == 0) { - tempvaddr = - pmap_quick_enter_page(bpage->datapage); - datavaddr = tempvaddr | bpage->dataoffs; - } - - bcopy((void *)datavaddr, - (void *)bpage->vaddr, bpage->datacount); - if (tempvaddr != 0) - pmap_quick_remove_page(tempvaddr); - bpage = STAILQ_NEXT(bpage, links); - } - dmat->bounce_zone->total_bounced++; - - /* -* Wait for the bcopy to complete before any DMA operations. -*/ - dsb(sy); - } - if ((op & BUS_DMASYNC_POSTREAD) != 0) { /* * Wait for any DMA operations to complete before the bcopy. */ dsb(sy); + } - while (bpage != NULL) { - tempvaddr = 0; - datavaddr = bpage->datavaddr; - if (datavaddr == 0) { - tempvaddr = - pmap_quick_enter_page(bpage->datapage); - datavaddr = tempvaddr | bpage->dataoffs; + if ((bpage = STAILQ_FIRST(>bpages)) != NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " + "performing bounce", __func__, dmat, dmat->common.flags, + op); + + if ((op & BUS_DMASYNC_PREWRITE) != 0) { + while (bpage != NULL) { + tempvaddr = 0; + datavaddr = bpage->datavaddr; + if (datavaddr == 0) { + tempvaddr = pmap_quick_enter_page( + bpage->datapage); + datavaddr = tempvaddr | bpage->dataoffs; + } + + bcopy((void *)datavaddr, + (void *)bpage->vaddr, bpage->datacount); + if (tempvaddr != 0) + pmap_quick_remove_page(tempvaddr); + bpage = STAILQ_NEXT(bpage, links); } + dmat->bounce_zone->total_bounced++; + } - bcopy((void *)bpage->vaddr, - (void *)datavaddr, bpage->datacount); - - if (tempvaddr != 0) - pmap_quick_remove_page(tempvaddr); - bpage = STAILQ_NEXT(bpage, links); + if ((op & BUS_DMASYNC_POSTREAD) != 0) { + while (bpage != NULL) { + tempvaddr = 0; + datavaddr = bpage->datavaddr; + if (datavaddr == 0) { + tempvaddr = pmap_quick_enter_page( + bpage->datapage); + datavaddr = tempvaddr | bpage->dataoffs; + } + + bcopy((void *)bpage->vaddr, + (void *)datavaddr,
svn commit: r299531 - stable/10/sys/cam
Author: scottl Date: Thu May 12 12:03:27 2016 New Revision: 299531 URL: https://svnweb.freebsd.org/changeset/base/299531 Log: MFC r298977: Fix a memory leak introduced with the devctl intergration of cam_periph Modified: stable/10/sys/cam/cam_periph.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c == --- stable/10/sys/cam/cam_periph.c Thu May 12 11:38:28 2016 (r299530) +++ stable/10/sys/cam/cam_periph.c Thu May 12 12:03:27 2016 (r299531) @@ -1876,6 +1876,7 @@ cam_periph_devctl_notify(union ccb *ccb) if (cgd->ccb_h.status == CAM_REQ_CMP) sbuf_bcat(, cgd->serial_num, cgd->serial_num_len); + xpt_free_ccb((union ccb *)cgd); } sbuf_printf(, "\" "); sbuf_printf(, "cam_status=\"0x%x\" ", ccb->ccb_h.status); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299530 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys
Author: hselasky Date: Thu May 12 11:38:28 2016 New Revision: 299530 URL: https://svnweb.freebsd.org/changeset/base/299530 Log: Fix handling of IOCTLs in the LinuxKPI. Linux requires that all IOCTL data resides in userspace. FreeBSD always moves the main IOCTL structure into a kernel buffer before invoking the IOCTL handler and then copies it back into userspace, before returning. Hide this difference in the "linux_copyin()" and "linux_copyout()" functions by remapping userspace addresses in the range from 0x1 to 0x2, to the kernel IOCTL data buffer. It is assumed that the userspace code, data and stack segments starts no lower than memory address 0x40, which is also stated by "man 1 ld", which means any valid userspace pointer can be passed to regular LinuxKPI handled IOCTLs. Bump the FreeBSD version to force recompilation of all kernel modules. Discussed with: kmacy @ MFC after:1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/include/linux/uaccess.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h == --- head/sys/compat/linuxkpi/common/include/asm/uaccess.h Thu May 12 10:16:16 2016(r299529) +++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h Thu May 12 11:38:28 2016(r299530) @@ -36,7 +36,7 @@ static inline long copy_to_user(void *to, const void *from, unsigned long n) { - if (copyout(from, to, n) != 0) + if (linux_copyout(from, to, n) != 0) return n; return 0; } @@ -44,7 +44,7 @@ copy_to_user(void *to, const void *from, static inline long copy_from_user(void *to, const void *from, unsigned long n) { - if (copyin(from, to, n) != 0) + if (linux_copyin(from, to, n) != 0) return n; return 0; } Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h == --- head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 10:16:16 2016(r299529) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 11:38:28 2016(r299530) @@ -66,6 +66,8 @@ struct task_struct { int should_stop; pid_t pid; const char*comm; + void*bsd_ioctl_data; + unsignedbsd_ioctl_len; }; #definecurrent task_struct_get(curthread) Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h == --- head/sys/compat/linuxkpi/common/include/linux/uaccess.h Thu May 12 10:16:16 2016(r299529) +++ head/sys/compat/linuxkpi/common/include/linux/uaccess.h Thu May 12 11:38:28 2016(r299530) @@ -34,19 +34,23 @@ #include -#define__get_user(_x, _p) ({ \ - int __err; \ - __typeof(*(_p)) __x;\ - __err = -copyin((_p), &(__x), sizeof(*(_p))); \ - (_x) = __x; \ - __err; \ +#define__get_user(_x, _p) ({ \ + int __err; \ + __typeof(*(_p)) __x;\ + __err = linux_copyin((_p), &(__x), sizeof(*(_p))); \ + (_x) = __x; \ + __err; \ }) -#define__put_user(_x, _p) ({ \ - __typeof(*(_p)) __x = (_x); \ - -copyout(&(__x), (_p), sizeof(*(_p))); \ + +#define__put_user(_x, _p) ({ \ + __typeof(*(_p)) __x = (_x); \ + linux_copyout(&(__x), (_p), sizeof(*(_p))); \ }) -#defineget_user(_x, _p)-copyin((_p), &(_x), sizeof(*(_p))) -#defineput_user(_x, _p)-copyout(&(_x), (_p), sizeof(*(_p))) +#defineget_user(_x, _p)linux_copyin((_p), &(_x), sizeof(*(_p))) +#defineput_user(_x, _p)linux_copyout(&(_x), (_p), sizeof(*(_p))) + +extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); +extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); /* * NOTE: The returned value from pagefault_disable() must be stored Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c == --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 12 10:16:16
Re: svn commit: r299514 - head/sys/fs/nfsserver
Oh, and I'll MFC it in 2 weeks unless there is an objection, rick - Original Message - > Author: cem > Date: Thu May 12 05:03:12 2016 > New Revision: 299514 > URL: https://svnweb.freebsd.org/changeset/base/299514 > > Log: > nfsd: Fix use-after-free in NFS4 lock test service > > Trivial use-after-free where stp was freed too soon in the non-error path. > To fix, simply move its release to the end of the routine. > > Reported by:Coverity > CID:1006105 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/fs/nfsserver/nfs_nfsdserv.c > > Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c > == > --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 04:54:32 2016 > (r299513) > +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 05:03:12 2016 > (r299514) > @@ -2437,8 +2437,6 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > if (!nd->nd_repstat) > nd->nd_repstat = nfsrv_lockctrl(vp, , , , clientid, > , exp, nd, p); > - if (stp) > - FREE((caddr_t)stp, M_NFSDSTATE); > if (nd->nd_repstat) { > if (nd->nd_repstat == NFSERR_DENIED) { > NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); > @@ -2460,6 +2458,8 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > } > } > vput(vp); > + if (stp) > + FREE((caddr_t)stp, M_NFSDSTATE); > NFSEXITCODE2(0, nd); > return (0); > nfsmout: > > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299514 - head/sys/fs/nfsserver
Thanks for spotting/fixing this, rick - Original Message - > Author: cem > Date: Thu May 12 05:03:12 2016 > New Revision: 299514 > URL: https://svnweb.freebsd.org/changeset/base/299514 > > Log: > nfsd: Fix use-after-free in NFS4 lock test service > > Trivial use-after-free where stp was freed too soon in the non-error path. > To fix, simply move its release to the end of the routine. > > Reported by:Coverity > CID:1006105 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/fs/nfsserver/nfs_nfsdserv.c > > Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c > == > --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 04:54:32 2016 > (r299513) > +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 05:03:12 2016 > (r299514) > @@ -2437,8 +2437,6 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > if (!nd->nd_repstat) > nd->nd_repstat = nfsrv_lockctrl(vp, , , , clientid, > , exp, nd, p); > - if (stp) > - FREE((caddr_t)stp, M_NFSDSTATE); > if (nd->nd_repstat) { > if (nd->nd_repstat == NFSERR_DENIED) { > NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); > @@ -2460,6 +2458,8 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > } > } > vput(vp); > + if (stp) > + FREE((caddr_t)stp, M_NFSDSTATE); > NFSEXITCODE2(0, nd); > return (0); > nfsmout: > > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299529 - in head: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libar...
Author: mm Date: Thu May 12 10:16:16 2016 New Revision: 299529 URL: https://svnweb.freebsd.org/changeset/base/299529 Log: MFV r299425: Update libarchive to 3.2.0 New features: - new bsdcat command-line utility - LZ4 compression (in src only via external utility from ports) - Warc format support - 'Raw' format writer - Zip: Support archives >4GB, entries >4GB - Zip: Support encrypting and decrypting entries - Zip: Support experimental streaming extension - Identify encrypted entries in several formats - New --clear-nochange-flags option to bsdtar tries to remove noschg and similar flags before deleting files - New --ignore-zeros option to bsdtar to handle concatenated tar archives - Use multi-threaded LZMA decompression if liblzma supports it - Expose version info for libraries used by libarchive Patched files (fixed compiler warnings): contrib/libarchive/cat/bsdcat.c (vendor PR #702) contrib/libarchive/cat/bsdcat.h (vendor PR #702) contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701) contrib/libarchive/libarchive_fe/err.c (vendor PR #703) MFC after:1 month Relnotes: yes Added: head/contrib/libarchive/cat/ - copied from r299425, vendor/libarchive/dist/cat/ head/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_extract.cpio.lz4.uu head/contrib/libarchive/cpio/test/test_extract_cpio_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_extract_cpio_lz4.c head/contrib/libarchive/cpio/test/test_option_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_option_lz4.c head/contrib/libarchive/cpio/test/test_option_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_option_passphrase.c head/contrib/libarchive/cpio/test/test_option_passphrase.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_option_passphrase.zip.uu head/contrib/libarchive/libarchive/archive_cryptor.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_cryptor.c head/contrib/libarchive/libarchive/archive_cryptor_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_cryptor_private.h head/contrib/libarchive/libarchive/archive_digest.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_digest.c head/contrib/libarchive/libarchive/archive_digest_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_digest_private.h head/contrib/libarchive/libarchive/archive_getdate.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_getdate.h head/contrib/libarchive/libarchive/archive_hmac.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_hmac.c head/contrib/libarchive/libarchive/archive_hmac_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_hmac_private.h head/contrib/libarchive/libarchive/archive_pack_dev.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_pack_dev.c head/contrib/libarchive/libarchive/archive_pack_dev.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_pack_dev.h head/contrib/libarchive/libarchive/archive_random.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_random.c head/contrib/libarchive/libarchive/archive_random_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_random_private.h head/contrib/libarchive/libarchive/archive_read_add_passphrase.3 - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_add_passphrase.3 head/contrib/libarchive/libarchive/archive_read_add_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_add_passphrase.c head/contrib/libarchive/libarchive/archive_read_extract2.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_extract2.c head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_add_filter_lz4.c head/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_set_format_filter_by_ext.c
svn commit: r299528 - vendor/libarchive/3.2.0
Author: mm Date: Thu May 12 09:44:21 2016 New Revision: 299528 URL: https://svnweb.freebsd.org/changeset/base/299528 Log: Tag libarchive 3.2.0 Added: vendor/libarchive/3.2.0/ - copied from r299433, vendor/libarchive/dist/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299527 - head/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Thu May 12 09:11:18 2016 New Revision: 299527 URL: https://svnweb.freebsd.org/changeset/base/299527 Log: Remove redundant "task_struct_set()". This is done by the "linux_kthread_fn()". MFC after:1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h == --- head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 09:06:54 2016(r299526) +++ head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 09:11:18 2016(r299527) @@ -81,8 +81,7 @@ linux_kthread_create(int (*threadfn)(voi 0, 0, fmt, ## __VA_ARGS__)) { \ kfree(_task); \ _task = NULL; \ - } else \ - task_struct_set(_task->task_thread, _task); \ + } \ _task; \ }) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299526 - in head/sys/compat/linuxkpi/common: include/linux src
Author: hselasky Date: Thu May 12 09:06:54 2016 New Revision: 299526 URL: https://svnweb.freebsd.org/changeset/base/299526 Log: Create a dummy "task_struct" on the stack which is returned by "current" inside all LinuxKPI file operation callbacks. The "current" is frequently used for various debug prints, printing the thread name and thread ID for example. Obtained from:kmacy @ MFC after:1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h == --- head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 08:55:57 2016(r299525) +++ head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 09:06:54 2016(r299526) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,15 +45,18 @@ static inline void linux_kthread_fn(void *arg) { struct task_struct *task; + struct thread *td = curthread; task = arg; - task_struct_set(curthread, task); + task_struct_fill(td, task); + task_struct_set(td, task); if (task->should_stop == 0) task->task_ret = task->task_fn(task->task_data); - PROC_LOCK(task->task_thread->td_proc); + PROC_LOCK(td->td_proc); task->should_stop = TASK_STOPPED; wakeup(task); - PROC_UNLOCK(task->task_thread->td_proc); + PROC_UNLOCK(td->td_proc); + task_struct_set(td, NULL); kthread_exit(); } Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h == --- head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 08:55:57 2016(r299525) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 09:06:54 2016(r299526) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,10 +50,12 @@ #defineTASK_STOPPED2 /* - * A task_struct is only provided for those tasks created with kthread. - * Using these routines with threads not started via kthread will cause - * panics because no task_struct is allocated and td_retval[1] is - * overwritten by syscalls which kernel threads will not make use of. + * A task_struct is only provided for threads created by kthread() and + * file operation callbacks. + * + * Using these routines outside the above mentioned contexts will + * cause panics because no task_struct is assigned and td_retval[1] is + * overwritten by syscalls. */ struct task_struct { struct thread *task_thread; @@ -62,10 +64,17 @@ struct task_struct { int task_ret; int state; int should_stop; + pid_t pid; + const char*comm; }; #definecurrent task_struct_get(curthread) #definetask_struct_get(x) ((struct task_struct *)(uintptr_t)(x)->td_retval[1]) +#definetask_struct_fill(x, y) do { \ + (y)->task_thread = (x); \ + (y)->comm = (x)->td_name; \ + (y)->pid = (x)->td_tid; \ +} while (0) #definetask_struct_set(x, y) (x)->td_retval[1] = (uintptr_t)(y) /* ensure the task_struct pointer fits into the td_retval[1] field */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c == --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 12 08:55:57 2016(r299525) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 12 09:06:54 2016(r299526) @@ -374,12 +374,31 @@ kobject_init_and_add(struct kobject *kob } static void +linux_set_current(struct thread *td, struct task_struct *t) +{ + memset(t, 0, sizeof(*t)); + task_struct_fill(td, t); + task_struct_set(td, t); +} + +static void +linux_clear_current(struct thread *td) +{ + task_struct_set(td, NULL); +} + +static void linux_file_dtor(void *cdp) { struct linux_file *filp; + struct task_struct t; + struct thread *td; + td = curthread; filp = cdp; +
svn commit: r299525 - head/usr.bin/msgs
Author: truckman Date: Thu May 12 08:55:57 2016 New Revision: 299525 URL: https://svnweb.freebsd.org/changeset/base/299525 Log: Use strlcpy() instead of strncpy() when copying date and subj to ensure that these are properly NUL terminated since they are passed to printf(). Reported by: Coverity CID: 974770 MFH: 1 week Modified: head/usr.bin/msgs/msgs.c Modified: head/usr.bin/msgs/msgs.c == --- head/usr.bin/msgs/msgs.cThu May 12 08:41:22 2016(r299524) +++ head/usr.bin/msgs/msgs.cThu May 12 08:55:57 2016(r299525) @@ -855,7 +855,7 @@ gfrsub(FILE *infile) } *ptr = '\0'; if (*(in = nxtfld(in))) - strncpy(date, in, sizeof date); + strlcpy(date, in, sizeof date); else { date[0] = '\n'; date[1] = '\0'; @@ -886,7 +886,7 @@ gfrsub(FILE *infile) if (!seensubj && strncmp(inbuf, "Subj", 4)==0) { seensubj = YES; frompos = ftello(infile); - strncpy(subj, nxtfld(inbuf), sizeof subj); + strlcpy(subj, nxtfld(inbuf), sizeof subj); } } if (!blankline) @@ -899,7 +899,7 @@ gfrsub(FILE *infile) /* * for possible use with Mail */ - strncpy(subj, "(No Subject)\n", sizeof subj); + strlcpy(subj, "(No Subject)\n", sizeof subj); } static char * ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299524 - head/usr.bin/mklocale
Author: truckman Date: Thu May 12 08:41:22 2016 New Revision: 299524 URL: https://svnweb.freebsd.org/changeset/base/299524 Log: Use strlcpy() instead of strncpy() when copying the encoding value to ensure that the destination is NUL terminated. Length truncation of one more character should not be an issue since encoding values that long are not supported by libc. The destination string is treated as a NUL terminated string, but it is only passed to strcmp() for comparison to a set of shorter, fixed length strings, so this is not a serious problem. Reported by: Coverity CID: 974769 MFC after:1 week Modified: head/usr.bin/mklocale/yacc.y Modified: head/usr.bin/mklocale/yacc.y == --- head/usr.bin/mklocale/yacc.yThu May 12 07:38:10 2016 (r299523) +++ head/usr.bin/mklocale/yacc.yThu May 12 08:41:22 2016 (r299524) @@ -123,7 +123,7 @@ entry : ENCODING STRING strcmp($2, "BIG5") && strcmp($2, "MSKanji")) warnx("ENCODING %s is not supported by libc", $2); - strncpy(new_locale.encoding, $2, + strlcpy(new_locale.encoding, $2, sizeof(new_locale.encoding)); } | VARIABLE { new_locale.variable_len = strlen($1) + 1; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299523 - head/sys/kern
Author: trasz Date: Thu May 12 07:38:10 2016 New Revision: 299523 URL: https://svnweb.freebsd.org/changeset/base/299523 Log: Stop hiding errors that result in failure to mount /dev. Otherwise, missing /dev directory makes one end up with a completely deaf (init without stdout/stderr) system with no hints on the console, unless you've booted up with bootverbose. MFC after:1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c == --- head/sys/kern/vfs_mountroot.c Thu May 12 06:55:42 2016 (r299522) +++ head/sys/kern/vfs_mountroot.c Thu May 12 07:38:10 2016 (r299523) @@ -347,9 +347,9 @@ vfs_mountroot_shuffle(struct thread *td, } NDFREE(, NDF_ONLY_PNBUF); - if (error && bootverbose) + if (error) printf("mountroot: unable to remount previous root " - "under /.mount or /mnt (error %d).\n", error); + "under /.mount or /mnt (error %d)\n", error); } /* Remount devfs under /dev */ @@ -373,9 +373,9 @@ vfs_mountroot_shuffle(struct thread *td, } else vput(vp); } - if (error && bootverbose) + if (error) printf("mountroot: unable to remount devfs under /dev " - "(error %d).\n", error); + "(error %d)\n", error); NDFREE(, NDF_ONLY_PNBUF); if (mporoot == mpdevfs) { @@ -383,7 +383,7 @@ vfs_mountroot_shuffle(struct thread *td, /* Unlink the no longer needed /dev/dev -> / symlink */ error = kern_unlinkat(td, AT_FDCWD, "/dev/dev", UIO_SYSSPACE, 0); - if (error && bootverbose) + if (error) printf("mountroot: unable to unlink /dev/dev " "(error %d)\n", error); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299522 - stable/10/share/man/man3
Author: kib Date: Thu May 12 06:55:42 2016 New Revision: 299522 URL: https://svnweb.freebsd.org/changeset/base/299522 Log: MFC r299115: Warn about consequences of suspending threads in arbitrary state of execution Modified: stable/10/share/man/man3/pthread_resume_np.3 stable/10/share/man/man3/pthread_suspend_all_np.3 stable/10/share/man/man3/pthread_suspend_np.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man3/pthread_resume_np.3 == --- stable/10/share/man/man3/pthread_resume_np.3Thu May 12 06:53:22 2016(r299521) +++ stable/10/share/man/man3/pthread_resume_np.3Thu May 12 06:55:42 2016(r299522) @@ -57,7 +57,7 @@ function will fail if: The value specified by the .Fa tid argument is invalid. -.It Bq ESRC +.It Bq Er ESRC No thread could be found corresponding to the thread ID specified by the .Fa tid argument. Modified: stable/10/share/man/man3/pthread_suspend_all_np.3 == --- stable/10/share/man/man3/pthread_suspend_all_np.3 Thu May 12 06:53:22 2016(r299521) +++ stable/10/share/man/man3/pthread_suspend_all_np.3 Thu May 12 06:55:42 2016(r299522) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd May 5, 2016 .Dt PTHREAD_SUSPEND_ALL_NP 3 .Os .Sh NAME @@ -44,6 +44,13 @@ The only exception is the current thread the thread that called the .Fn pthread_suspend_all_np function. +.Pp +It is not safe for the caller of the +.Fn pthread_suspend_all_np +function to use any non-async signal safe functions, besides +.Xr pthread_resume_all_np 3 , +until threads are resumed, unless measures are taken to ensure +that all threads are suspended at safe points. .Sh SEE ALSO .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 , Modified: stable/10/share/man/man3/pthread_suspend_np.3 == --- stable/10/share/man/man3/pthread_suspend_np.3 Thu May 12 06:53:22 2016(r299521) +++ stable/10/share/man/man3/pthread_suspend_np.3 Thu May 12 06:55:42 2016(r299522) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd May 5, 2016 .Dt PTHREAD_SUSPEND_NP 3 .Os .Sh NAME @@ -40,6 +40,13 @@ The .Fn pthread_suspend_np function, called on an active thread, causes it to suspend. +.Pp +It is not safe for the caller of the +.Fn pthread_suspend_np +function to use any non-async signal safe functions, except +.Xr pthread_resume_np 3 , +until suspended thread is resumed, unless measures are taken to ensure +that the thread is suspended at a safe point. .Sh RETURN VALUES If successful, .Fn pthread_suspend_np @@ -56,7 +63,7 @@ An attempt was made to suspend the curre The value specified by the .Fa tid argument is invalid. -.It Bq ESRC +.It Bq Er ESRC No thread could be found corresponding to the thread ID specified by the .Fa tid argument. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299521 - stable/10/lib/libthr/thread
Author: kib Date: Thu May 12 06:53:22 2016 New Revision: 299521 URL: https://svnweb.freebsd.org/changeset/base/299521 Log: MFC r299114: Do not leak THR_FLAGS_SUSPENDED from the previous suspend/resume cycle. PR: 209233 Modified: stable/10/lib/libthr/thread/thr_resume_np.c stable/10/lib/libthr/thread/thr_sig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_resume_np.c == --- stable/10/lib/libthr/thread/thr_resume_np.c Thu May 12 06:39:13 2016 (r299520) +++ stable/10/lib/libthr/thread/thr_resume_np.c Thu May 12 06:53:22 2016 (r299521) @@ -90,7 +90,7 @@ static void resume_common(struct pthread *thread) { /* Clear the suspend flag: */ - thread->flags &= ~THR_FLAGS_NEED_SUSPEND; + thread->flags &= ~(THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED); thread->cycle++; _thr_umtx_wake(>cycle, 1, 0); } Modified: stable/10/lib/libthr/thread/thr_sig.c == --- stable/10/lib/libthr/thread/thr_sig.c Thu May 12 06:39:13 2016 (r299520) +++ stable/10/lib/libthr/thread/thr_sig.c Thu May 12 06:53:22 2016 (r299521) @@ -373,8 +373,7 @@ check_suspend(struct pthread *curthread) */ curthread->critical_count++; THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - while ((curthread->flags & (THR_FLAGS_NEED_SUSPEND | - THR_FLAGS_SUSPENDED)) == THR_FLAGS_NEED_SUSPEND) { + while ((curthread->flags & THR_FLAGS_NEED_SUSPEND) != 0) { curthread->cycle++; cycle = curthread->cycle; @@ -391,7 +390,6 @@ check_suspend(struct pthread *curthread) THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); _thr_umtx_wait_uint(>cycle, cycle, NULL, 0); THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - curthread->flags &= ~THR_FLAGS_SUSPENDED; } THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); curthread->critical_count--; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299520 - head/lib/libfetch
Author: truckman Date: Thu May 12 06:39:13 2016 New Revision: 299520 URL: https://svnweb.freebsd.org/changeset/base/299520 Log: Use strlcpy() instead of strncpy() to copy the string returned by setlocale() so that static analyzers know that the string is NUL terminated. This was causing a false positive in Coverity even though the longest string returned by setlocale() is ENCODING_LEN (31) and we are copying into a 64 byte buffer. This change is also a bit of an optimization since we don't need the strncpy() feature of padding the rest of the destination buffer with NUL characters. Reported by: Coverity CID: 974654 Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cThu May 12 06:20:26 2016(r299519) +++ head/lib/libfetch/http.cThu May 12 06:39:13 2016(r299520) @@ -875,7 +875,7 @@ http_parse_mtime(const char *p, time_t * char locale[64], *r; struct tm tm; - strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); + strlcpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", ); /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299518 - head/sys/dev/sfxge/common
Author: arybchik Date: Thu May 12 06:20:26 2016 New Revision: 299518 URL: https://svnweb.freebsd.org/changeset/base/299518 Log: sfxge(4): update multicast filter insertion algorithm When the multicast filters we're allowed to insert are controlled by the hypervisor, it may be that we can insert some but not others. So we need to have fallbacks where we insert any filters we can without rolling back when one fails to insert. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6318 Modified: head/sys/dev/sfxge/common/hunt_filter.c Modified: head/sys/dev/sfxge/common/hunt_filter.c == --- head/sys/dev/sfxge/common/hunt_filter.c Thu May 12 06:19:06 2016 (r299517) +++ head/sys/dev/sfxge/common/hunt_filter.c Thu May 12 06:20:26 2016 (r299518) @@ -1044,36 +1044,36 @@ fail1: } static __checkReturn efx_rc_t -ef10_filter_multicast_refresh( +ef10_filter_insert_multicast_list( __inefx_nic_t *enp, __inboolean_t mulcst, - __inboolean_t all_mulcst, __inboolean_t brdcst, __in_ecount(6*count)uint8_t const *addrs, __inuint32_t count, - __inefx_filter_flag_t filter_flags) + __inefx_filter_flag_t filter_flags, + __inboolean_t rollback) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; uint8_t addr[6]; - unsigned i; + uint32_t i; + uint32_t filter_index; + uint32_t filter_count; efx_rc_t rc; - if (all_mulcst == B_TRUE) - goto use_mc_def; - if (mulcst == B_FALSE) count = 0; if (count + (brdcst ? 1 : 0) > EFX_ARRAY_SIZE(eftp->eft_mulcst_filter_indexes)) { - /* Too many MAC addresses; use unknown multicast filter */ - goto use_mc_def; + /* Too many MAC addresses */ + rc = EINVAL; + goto fail1; } /* Insert/renew multicast address list filters */ - eftp->eft_mulcst_filter_count = count; - for (i = 0; i < eftp->eft_mulcst_filter_count; i++) { + filter_count = 0; + for (i = 0; i < count; i++) { efx_filter_spec_init_rx(, EFX_FILTER_PRI_AUTO, filter_flags, @@ -1084,16 +1084,21 @@ ef10_filter_multicast_refresh( [i * EFX_MAC_ADDR_LEN]); rc = ef10_filter_add_internal(enp, , B_TRUE, - >eft_mulcst_filter_indexes[i]); - if (rc != 0) { - /* Rollback, then use unknown multicast filter */ + _index); + + if (rc == 0) { + eftp->eft_mulcst_filter_indexes[filter_count] = + filter_index; + filter_count++; + } else if (rollback == B_TRUE) { + /* Only stop upon failure if told to rollback */ goto rollback; } + } if (brdcst == B_TRUE) { /* Insert/renew broadcast address filter */ - eftp->eft_mulcst_filter_count++; efx_filter_spec_init_rx(, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); @@ -1103,28 +1108,46 @@ ef10_filter_multicast_refresh( addr); rc = ef10_filter_add_internal(enp, , B_TRUE, - >eft_mulcst_filter_indexes[ - eftp->eft_mulcst_filter_count - 1]); - if (rc != 0) { - /* Rollback, then use unknown multicast filter */ + _index); + + if (rc == 0) { + eftp->eft_mulcst_filter_indexes[filter_count] = + filter_index; + filter_count++; + } else if (rollback == B_TRUE) { + /* Only stop upon failure if told to rollback */ goto rollback; } } + eftp->eft_mulcst_filter_count = filter_count; + return (0); rollback: - /* -* Rollback by removing any filters we have inserted -* before inserting the unknown multicast filter. -*/ + /* Remove any filters we have inserted */ + i = filter_count; while (i--) { (void) ef10_filter_delete_internal(enp,
svn commit: r299519 - head/sys/sys
Author: kib Date: Thu May 12 06:20:26 2016 New Revision: 299519 URL: https://svnweb.freebsd.org/changeset/base/299519 Log: Typo in comment. Modified: head/sys/sys/turnstile.h Modified: head/sys/sys/turnstile.h == --- head/sys/sys/turnstile.hThu May 12 06:20:26 2016(r299518) +++ head/sys/sys/turnstile.hThu May 12 06:20:26 2016(r299519) @@ -33,7 +33,7 @@ * Turnstile interface. Non-sleepable locks use a turnstile for the * queue of threads blocked on them when they are contested. Each * turnstile contains two sub-queues: one for threads waiting for a - * shared, or eread, lock, and one for threads waiting for an + * shared, or read, lock, and one for threads waiting for an * exclusive, or write, lock. * * A thread calls turnstile_chain_lock() to lock the turnstile chain ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299517 - head/sys/dev/sfxge/common
Author: arybchik Date: Thu May 12 06:19:06 2016 New Revision: 299517 URL: https://svnweb.freebsd.org/changeset/base/299517 Log: sfxge(4): cleanup: constify common code method tables Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6317 Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/efx_port.c head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/hunt_mac.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/siena_mac.c Modified: head/sys/dev/sfxge/common/efx_ev.c == --- head/sys/dev/sfxge/common/efx_ev.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_ev.c Thu May 12 06:19:06 2016 (r299517) @@ -109,7 +109,7 @@ falconsiena_ev_qstats_update( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA -static efx_ev_ops_t__efx_ev_siena_ops = { +static const efx_ev_ops_t __efx_ev_siena_ops = { falconsiena_ev_init,/* eevo_init */ falconsiena_ev_fini,/* eevo_fini */ falconsiena_ev_qcreate, /* eevo_qcreate */ @@ -124,7 +124,7 @@ static efx_ev_ops_t __efx_ev_siena_ops = #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_ev_ops_t__efx_ev_ef10_ops = { +static const efx_ev_ops_t __efx_ev_ef10_ops = { ef10_ev_init, /* eevo_init */ ef10_ev_fini, /* eevo_fini */ ef10_ev_qcreate,/* eevo_qcreate */ @@ -143,7 +143,7 @@ static efx_ev_ops_t __efx_ev_ef10_ops = efx_ev_init( __inefx_nic_t *enp) { - efx_ev_ops_t *eevop; + const efx_ev_ops_t *eevop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -157,19 +157,19 @@ efx_ev_init( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - eevop = (efx_ev_ops_t *)&__efx_ev_siena_ops; + eevop = &__efx_ev_siena_ops; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops; + eevop = &__efx_ev_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops; + eevop = &__efx_ev_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ @@ -203,7 +203,7 @@ fail1: efx_ev_fini( __inefx_nic_t *enp) { - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -228,7 +228,7 @@ efx_ev_qcreate( __inuint32_t id, __deref_out efx_evq_t **eepp) { - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_evq_t *eep; efx_rc_t rc; @@ -272,7 +272,7 @@ efx_ev_qdestroy( __inefx_evq_t *eep) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -291,7 +291,7 @@ efx_ev_qprime( __inunsigned int count) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; efx_rc_t rc; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -383,7 +383,7 @@ efx_ev_qpost( __inuint16_t data) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -399,7 +399,7 @@ efx_ev_qmoderate( __inunsigned int us) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; efx_rc_t rc; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -421,7 +421,7 @@ efx_ev_qstats_update( __inout_ecount(EV_NQSTATS) efsys_stat_t