From owner-svn-src-head@freebsd.org Sun Nov 25 09:37:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94050114D6AD; Sun, 25 Nov 2018 09:37:58 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0BA7C5A6; Sun, 25 Nov 2018 09:37:58 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 076601B04B; Sun, 25 Nov 2018 09:37:58 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAP9bvSh026101; Sun, 25 Nov 2018 09:37:57 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAP9bv1n026100; Sun, 25 Nov 2018 09:37:57 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811250937.wAP9bv1n026100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Sun, 25 Nov 2018 09:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340917 - head/stand/i386/pxeldr X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/stand/i386/pxeldr X-SVN-Commit-Revision: 340917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C0BA7C5A6 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.16)[0.164,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 09:37:58 -0000 Author: ygy (doc committer) Date: Sun Nov 25 09:37:57 2018 New Revision: 340917 URL: https://svnweb.freebsd.org/changeset/base/340917 Log: Update pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3 server. PR: 123484 Submitted by: edwin@mavetju.org Reviewed by: AllanJude MFC after: 1 week Modified: head/stand/i386/pxeldr/pxeboot.8 Modified: head/stand/i386/pxeldr/pxeboot.8 ============================================================================== --- head/stand/i386/pxeldr/pxeboot.8 Sun Nov 25 00:34:00 2018 (r340916) +++ head/stand/i386/pxeldr/pxeboot.8 Sun Nov 25 09:37:57 2018 (r340917) @@ -58,7 +58,7 @@ The .Nm binary is loaded just like any other boot file, by specifying it in the DHCP server's configuration file. -Below is a sample configuration for the ISC DHCP v2 server: +Below is a sample configuration for the ISC DHCP v3 server: .Bd -literal -offset indent option domain-name "example.com"; option routers 10.0.0.1; @@ -67,6 +67,7 @@ option broadcast-address 10.0.0.255; option domain-name-servers 10.0.0.1; server-name "DHCPserver"; server-identifier 10.0.0.1; +next-server 10.0.0.1; default-lease-time 120; max-lease-time 120; @@ -80,10 +81,11 @@ subnet 10.0.0.0 netmask 255.255.255.0 { } .Ed +.Va next-server +is the IP address of the next server in the bootstrap process, i.e. +your TFTP server or NFS server. .Nm recognizes -.Va next-server -and .Va option root-path directives as the server and path to NFS mount for file requests, respectively, or the server to make TFTP requests to. From owner-svn-src-head@freebsd.org Sun Nov 25 17:56:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3060C113B670; Sun, 25 Nov 2018 17:56:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC2076FC63; Sun, 25 Nov 2018 17:56:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD0FD20265; Sun, 25 Nov 2018 17:56:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAPHun2p083599; Sun, 25 Nov 2018 17:56:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPHunIm083598; Sun, 25 Nov 2018 17:56:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811251756.wAPHunIm083598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 25 Nov 2018 17:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340922 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 340922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC2076FC63 X-Spamd-Result: default: False [1.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.17)[0.174,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 17:56:50 -0000 Author: kib Date: Sun Nov 25 17:56:49 2018 New Revision: 340922 URL: https://svnweb.freebsd.org/changeset/base/340922 Log: Avoid unneeded check in vmspace_alloc(). All vmspace_alloc() callers know which kind of pmap they allocate. Reviewed by: alc, markj (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18329 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Nov 25 17:46:37 2018 (r340921) +++ head/sys/vm/vm_map.c Sun Nov 25 17:56:49 2018 (r340922) @@ -283,12 +283,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, pmap_p struct vmspace *vm; vm = uma_zalloc(vmspace_zone, M_WAITOK); - KASSERT(vm->vm_map.pmap == NULL, ("vm_map.pmap must be NULL")); - - if (pinit == NULL) - pinit = &pmap_pinit; - if (!pinit(vmspace_pmap(vm))) { uma_zfree(vmspace_zone, vm); return (NULL); @@ -3424,7 +3419,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c old_map = &vm1->vm_map; /* Copy immutable fields of vm1 to vm2. */ - vm2 = vmspace_alloc(vm_map_min(old_map), vm_map_max(old_map), NULL); + vm2 = vmspace_alloc(vm_map_min(old_map), vm_map_max(old_map), + pmap_pinit); if (vm2 == NULL) return (NULL); vm2->vm_taddr = vm1->vm_taddr; @@ -3975,7 +3971,7 @@ vmspace_exec(struct proc *p, vm_offset_t minuser, vm_o KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0, ("vmspace_exec recursed")); - newvmspace = vmspace_alloc(minuser, maxuser, NULL); + newvmspace = vmspace_alloc(minuser, maxuser, pmap_pinit); if (newvmspace == NULL) return (ENOMEM); newvmspace->vm_swrss = oldvmspace->vm_swrss; From owner-svn-src-head@freebsd.org Sun Nov 25 18:01:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 027E1113BA29; Sun, 25 Nov 2018 18:01:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99812700FD; Sun, 25 Nov 2018 18:01:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A7C52039B; Sun, 25 Nov 2018 18:01:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAPI1G9H084798; Sun, 25 Nov 2018 18:01:16 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPI1F0f084795; Sun, 25 Nov 2018 18:01:15 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201811251801.wAPI1F0f084795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 25 Nov 2018 18:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340924 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 340924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99812700FD X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.66)[0.657,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.198,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 18:01:17 -0000 Author: mckusick Date: Sun Nov 25 18:01:15 2018 New Revision: 340924 URL: https://svnweb.freebsd.org/changeset/base/340924 Log: Calculate updated superblock check-hash before writing it into the snapshot. This corrects a bug that prevented snapshots from being mounted due to a superblock check-hash failure. Reported by: Brennan Vincent Tested by: Peter Holm (pho@) Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_subr.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sun Nov 25 18:00:50 2018 (r340923) +++ head/sys/ufs/ffs/ffs_extern.h Sun Nov 25 18:01:15 2018 (r340924) @@ -68,6 +68,7 @@ ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_ ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); void ffs_blkrelease_finish(struct ufsmount *, u_long); u_long ffs_blkrelease_start(struct ufsmount *, struct vnode *, ino_t); +uint32_t ffs_calc_sbhash(struct fs *); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); void ffs_clrblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_clusteracct(struct fs *, struct cg *, ufs1_daddr_t, int); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sun Nov 25 18:00:50 2018 (r340923) +++ head/sys/ufs/ffs/ffs_snapshot.c Sun Nov 25 18:01:15 2018 (r340924) @@ -795,6 +795,7 @@ out1: brelse(nbp); } else { loc = blkoff(fs, fs->fs_sblockloc); + copy_fs->fs_ckhash = ffs_calc_sbhash(copy_fs); bcopy((char *)copy_fs, &nbp->b_data[loc], (u_int)fs->fs_sbsize); bawrite(nbp); } Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Sun Nov 25 18:00:50 2018 (r340923) +++ head/sys/ufs/ffs/ffs_subr.c Sun Nov 25 18:01:15 2018 (r340924) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include uint32_t calculate_crc32c(uint32_t, const void *, size_t); +uint32_t ffs_calc_sbhash(struct fs *); struct malloc_type; #define UFS_MALLOC(size, type, flags) malloc(size) #define UFS_FREE(ptr, type) free(ptr) @@ -147,7 +148,6 @@ ffs_load_inode(struct buf *bp, struct inode *ip, struc static off_t sblock_try[] = SBLOCKSEARCH; static int readsuper(void *, struct fs **, off_t, int, int (*)(void *, off_t, void **, int)); -static uint32_t calc_sbhash(struct fs *); /* * Read a superblock from the devfd device. @@ -276,7 +276,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo fs->fs_bsize <= MAXBSIZE && fs->fs_bsize >= roundup(sizeof(struct fs), DEV_BSIZE) && fs->fs_sbsize <= SBLOCKSIZE) { - if (fs->fs_ckhash != (ckhash = calc_sbhash(fs))) { + if (fs->fs_ckhash != (ckhash = ffs_calc_sbhash(fs))) { #ifdef _KERNEL res = uprintf("Superblock check-hash failed: recorded " "check-hash 0x%x != computed check-hash 0x%x\n", @@ -339,7 +339,7 @@ ffs_sbput(void *devfd, struct fs *fs, off_t loc, } fs->fs_fmod = 0; fs->fs_time = UFS_TIME; - fs->fs_ckhash = calc_sbhash(fs); + fs->fs_ckhash = ffs_calc_sbhash(fs); if ((error = (*writefunc)(devfd, loc, fs, fs->fs_sbsize)) != 0) return (error); return (0); @@ -348,8 +348,8 @@ ffs_sbput(void *devfd, struct fs *fs, off_t loc, /* * Calculate the check-hash for a superblock. */ -static uint32_t -calc_sbhash(struct fs *fs) +uint32_t +ffs_calc_sbhash(struct fs *fs) { uint32_t ckhash, save_ckhash; From owner-svn-src-head@freebsd.org Sun Nov 25 18:09:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 559D0113BD7B; Sun, 25 Nov 2018 18:09:40 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE920705CD; Sun, 25 Nov 2018 18:09:39 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE9982040B; Sun, 25 Nov 2018 18:09:39 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAPI9dIO089082; Sun, 25 Nov 2018 18:09:39 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPI9de2089081; Sun, 25 Nov 2018 18:09:39 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201811251809.wAPI9de2089081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 25 Nov 2018 18:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340925 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 340925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE920705CD X-Spamd-Result: default: False [1.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.17)[0.174,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 18:09:40 -0000 Author: mckusick Date: Sun Nov 25 18:09:39 2018 New Revision: 340925 URL: https://svnweb.freebsd.org/changeset/base/340925 Log: Properly recover from superblock check-hash failures. Specifically, report the check-hash failure and offer to search for and use alternate superblocks. Prior to this fix fsck_ffs would simply report the check-hash failure and exit. Reported by: Julian H. Stacey Tested by: Peter Holm Sponsored by: Netflix Modified: head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Sun Nov 25 18:01:15 2018 (r340924) +++ head/sbin/fsck_ffs/setup.c Sun Nov 25 18:09:39 2018 (r340925) @@ -127,7 +127,7 @@ setup(char *dev) } } if ((fsreadfd = open(dev, O_RDONLY)) < 0 || - ufs_disk_fillout(&disk, dev) < 0) { + ufs_disk_fillout_blank(&disk, dev) < 0) { if (bkgrdflag) { unlink(snapname); bkgrdflag = 0; @@ -325,10 +325,8 @@ readsb(int listerr) if ((ret = sbget(fsreadfd, &fs, super)) != 0) { switch (ret) { case EINVAL: - fprintf(stderr, "The previous newfs operation " - "on this volume did not complete.\nYou must " - "complete newfs before using this volume.\n"); - exit(11); + /* Superblock check-hash failed */ + return (0); case ENOENT: if (bflag) fprintf(stderr, "%jd is not a file system " From owner-svn-src-head@freebsd.org Sun Nov 25 19:37:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BA5A113FCD8; Sun, 25 Nov 2018 19:37:01 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE83A7417F; Sun, 25 Nov 2018 19:37:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9102521337; Sun, 25 Nov 2018 19:37:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAPJb0tk035544; Sun, 25 Nov 2018 19:37:00 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAPJb0Mc035543; Sun, 25 Nov 2018 19:37:00 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201811251937.wAPJb0Mc035543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 25 Nov 2018 19:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340926 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 340926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE83A7417F X-Spamd-Result: default: False [1.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.26)[0.262,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:37:01 -0000 Author: wulf Date: Sun Nov 25 19:37:00 2018 New Revision: 340926 URL: https://svnweb.freebsd.org/changeset/base/340926 Log: evdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or. MFC after: 2 weeks Modified: head/sys/dev/evdev/evdev_utils.c Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Sun Nov 25 18:09:39 2018 (r340925) +++ head/sys/dev/evdev/evdev_utils.c Sun Nov 25 19:37:00 2018 (r340926) @@ -250,12 +250,15 @@ evdev_scancode2key(int *state, int scancode) */ *state = 0; if ((scancode & 0x7f) == 0x1D) - *state = 0x1D; + *state = scancode; return (NONE); /* NOT REACHED */ case 0x1D: /* pause / break */ + case 0x9D: + if ((*state ^ scancode) & 0x80) + return (NONE); *state = 0; - if (scancode != 0x45) + if ((scancode & 0x7f) != 0x45) return (NONE); keycode = KEY_PAUSE; break; From owner-svn-src-head@freebsd.org Mon Nov 26 00:58:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683E11148CDB; Mon, 26 Nov 2018 00:58:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA6C7E55F; Mon, 26 Nov 2018 00:58:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D368E24879; Mon, 26 Nov 2018 00:58:07 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQ0w7S8099204; Mon, 26 Nov 2018 00:58:07 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQ0w7MU099202; Mon, 26 Nov 2018 00:58:07 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201811260058.wAQ0w7MU099202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 26 Nov 2018 00:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340927 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 340927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0AA6C7E55F X-Spamd-Result: default: False [1.75 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.464,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 00:58:08 -0000 Author: mckusick Date: Mon Nov 26 00:58:07 2018 New Revision: 340927 URL: https://svnweb.freebsd.org/changeset/base/340927 Log: Move the check for the filesystem having been run on a kernel that predates metadata check hashes so that it is done before deciding whether to compute a check-hash of the superblock. Reported by: Rick Macklem Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Sun Nov 25 19:37:00 2018 (r340926) +++ head/sys/ufs/ffs/ffs_subr.c Mon Nov 26 00:58:07 2018 (r340927) @@ -276,6 +276,12 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo fs->fs_bsize <= MAXBSIZE && fs->fs_bsize >= roundup(sizeof(struct fs), DEV_BSIZE) && fs->fs_sbsize <= SBLOCKSIZE) { + /* + * If the filesystem has been run on a kernel without + * metadata check hashes, disable them. + */ + if ((fs->fs_flags & FS_METACKHASH) == 0) + fs->fs_metackhash = 0; if (fs->fs_ckhash != (ckhash = ffs_calc_sbhash(fs))) { #ifdef _KERNEL res = uprintf("Superblock check-hash failed: recorded " Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Nov 25 19:37:00 2018 (r340926) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 26 00:58:07 2018 (r340927) @@ -813,9 +813,6 @@ ffs_mountfs(devvp, mp, td) if ((error = ffs_sbget(devvp, &fs, -1, M_UFSMNT, ffs_use_bread)) != 0) goto out; fs->fs_fmod = 0; - /* if we ran on a kernel without metadata check hashes, disable them */ - if ((fs->fs_flags & FS_METACKHASH) == 0) - fs->fs_metackhash = 0; /* none of these types of check-hashes are maintained by this kernel */ fs->fs_metackhash &= ~(CK_INODE | CK_INDIR | CK_DIR); /* no support for any undefined flags */ From owner-svn-src-head@freebsd.org Mon Nov 26 06:20:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F534114EC28; Mon, 26 Nov 2018 06:20:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3D7188AFC; Mon, 26 Nov 2018 06:20:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D049727D0B; Mon, 26 Nov 2018 06:20:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQ6KFV0064716; Mon, 26 Nov 2018 06:20:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQ6KDYw064706; Mon, 26 Nov 2018 06:20:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811260620.wAQ6KDYw064706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 26 Nov 2018 06:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340928 - in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Commit-Revision: 340928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3D7188AFC X-Spamd-Result: default: False [1.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.54)[0.541,0]; NEURAL_SPAM_MEDIUM(0.69)[0.693,0]; NEURAL_SPAM_LONG(0.69)[0.695,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 06:20:16 -0000 Author: arybchik Date: Mon Nov 26 06:20:13 2018 New Revision: 340928 URL: https://svnweb.freebsd.org/changeset/base/340928 Log: sfxge(4): add API to control UDP tunnel ports HW needs to know which UDP packets should be treated as tunnel encapsulation to do inner packet recognition, classification and offloads. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18134 Added: head/sys/dev/sfxge/common/efx_tunnel.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_nic.c head/sys/modules/sfxge/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/conf/files.amd64 Mon Nov 26 06:20:13 2018 (r340928) @@ -438,6 +438,7 @@ dev/sfxge/common/efx_phy.c optional sfxge pci dev/sfxge/common/efx_port.c optional sfxge pci dev/sfxge/common/efx_rx.c optional sfxge pci dev/sfxge/common/efx_sram.c optional sfxge pci +dev/sfxge/common/efx_tunnel.c optional sfxge pci dev/sfxge/common/efx_tx.c optional sfxge pci dev/sfxge/common/efx_vpd.c optional sfxge pci dev/sfxge/common/hunt_nic.c optional sfxge pci Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/dev/sfxge/common/ef10_nic.c Mon Nov 26 06:20:13 2018 (r340928) @@ -1079,11 +1079,19 @@ ef10_get_datapath_caps( * Check if firmware supports VXLAN and NVGRE tunnels. * The capability indicates Geneve protocol support as well. */ - if (CAP_FLAG(flags, VXLAN_NVGRE)) + if (CAP_FLAG(flags, VXLAN_NVGRE)) { encp->enc_tunnel_encapsulations_supported = (1u << EFX_TUNNEL_PROTOCOL_VXLAN) | (1u << EFX_TUNNEL_PROTOCOL_GENEVE) | (1u << EFX_TUNNEL_PROTOCOL_NVGRE); + + EFX_STATIC_ASSERT(EFX_TUNNEL_MAXNENTRIES == + MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MAXNUM); + encp->enc_tunnel_config_udp_entries_max = + EFX_TUNNEL_MAXNENTRIES; + } else { + encp->enc_tunnel_config_udp_entries_max = 0; + } #undef CAP_FLAG #undef CAP_FLAG2 Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/dev/sfxge/common/efsys.h Mon Nov 26 06:20:13 2018 (r340928) @@ -283,6 +283,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_RX_PACKED_STREAM 0 +#define EFSYS_OPT_TUNNEL 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/dev/sfxge/common/efx.h Mon Nov 26 06:20:13 2018 (r340928) @@ -1209,6 +1209,11 @@ typedef struct efx_nic_cfg_s { boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; uint32_t enc_tunnel_encapsulations_supported; + /* + * NIC global maximum for unique UDP tunnel ports shared by all + * functions. + */ + uint32_t enc_tunnel_config_udp_entries_max; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; @@ -2635,6 +2640,52 @@ efx_lic_finish_partition( #endif /* EFSYS_OPT_LICENSING */ +/* TUNNEL */ + +#if EFSYS_OPT_TUNNEL + +extern __checkReturn efx_rc_t +efx_tunnel_init( + __in efx_nic_t *enp); + +extern void +efx_tunnel_fini( + __in efx_nic_t *enp); + +/* + * For overlay network encapsulation using UDP, the firmware needs to know + * the configured UDP port for the overlay so it can decode encapsulated + * frames correctly. + * The UDP port/protocol list is global. + */ + +extern __checkReturn efx_rc_t +efx_tunnel_config_udp_add( + __in efx_nic_t *enp, + __in uint16_t port /* host/cpu-endian */, + __in efx_tunnel_protocol_t protocol); + +extern __checkReturn efx_rc_t +efx_tunnel_config_udp_remove( + __in efx_nic_t *enp, + __in uint16_t port /* host/cpu-endian */, + __in efx_tunnel_protocol_t protocol); + +extern void +efx_tunnel_config_clear( + __in efx_nic_t *enp); + +/** + * Apply tunnel UDP ports configuration to hardware. + * + * EAGAIN is returned if hardware will be reset (datapath and management CPU + * reboot). + */ +extern __checkReturn efx_rc_t +efx_tunnel_reconfigure( + __in efx_nic_t *enp); + +#endif /* EFSYS_OPT_TUNNEL */ #ifdef __cplusplus Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/dev/sfxge/common/efx_check.h Mon Nov 26 06:20:13 2018 (r340928) @@ -346,4 +346,11 @@ # endif #endif +/* Support hardware assistance for tunnels */ +#if EFSYS_OPT_TUNNEL +# if !EFSYS_OPT_MEDFORD +# error "TUNNEL requires MEDFORD" +# endif +#endif /* EFSYS_OPT_TUNNEL */ + #endif /* _SYS_EFX_CHECK_H */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/dev/sfxge/common/efx_impl.h Mon Nov 26 06:20:13 2018 (r340928) @@ -78,6 +78,7 @@ extern "C" { #define EFX_MOD_MON 0x00000400 #define EFX_MOD_FILTER 0x00001000 #define EFX_MOD_LIC 0x00002000 +#define EFX_MOD_TUNNEL 0x00004000 #define EFX_RESET_PHY 0x00000001 #define EFX_RESET_RXQ_ERR 0x00000002 @@ -266,6 +267,12 @@ efx_filter_reconfigure( #endif /* EFSYS_OPT_FILTER */ +#if EFSYS_OPT_TUNNEL +typedef struct efx_tunnel_ops_s { + boolean_t (*eto_udp_encap_supported)(efx_nic_t *); + efx_rc_t (*eto_reconfigure)(efx_nic_t *); +} efx_tunnel_ops_t; +#endif /* EFSYS_OPT_TUNNEL */ typedef struct efx_port_s { efx_mac_type_t ep_mac_type; @@ -429,6 +436,22 @@ siena_filter_tbl_clear( #if EFSYS_OPT_MCDI +#define EFX_TUNNEL_MAXNENTRIES (16) + +#if EFSYS_OPT_TUNNEL + +typedef struct efx_tunnel_udp_entry_s { + uint16_t etue_port; /* host/cpu-endian */ + uint16_t etue_protocol; +} efx_tunnel_udp_entry_t; + +typedef struct efx_tunnel_cfg_s { + efx_tunnel_udp_entry_t etc_udp_entries[EFX_TUNNEL_MAXNENTRIES]; + unsigned int etc_udp_entries_num; +} efx_tunnel_cfg_t; + +#endif /* EFSYS_OPT_TUNNEL */ + typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *); void (*emco_send_request)(efx_nic_t *, void *, size_t, @@ -641,6 +664,10 @@ struct efx_nic_s { efx_filter_t en_filter; const efx_filter_ops_t *en_efop; #endif /* EFSYS_OPT_FILTER */ +#if EFSYS_OPT_TUNNEL + efx_tunnel_cfg_t en_tunnel_cfg; + const efx_tunnel_ops_t *en_etop; +#endif /* EFSYS_OPT_TUNNEL */ #if EFSYS_OPT_MCDI efx_mcdi_t en_mcdi; #endif /* EFSYS_OPT_MCDI */ Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/dev/sfxge/common/efx_mcdi.h Mon Nov 26 06:20:13 2018 (r340928) @@ -386,6 +386,10 @@ efx_mcdi_phy_module_get_info( EFX_WORD_FIELD(*MCDI_OUT2(_emr, efx_word_t, _ofst), \ EFX_WORD_0) +#define MCDI_OUT_WORD_FIELD(_emr, _ofst, _field) \ + EFX_WORD_FIELD(*MCDI_OUT2(_emr, efx_word_t, _ofst), \ + MC_CMD_ ## _field) + #define MCDI_OUT_DWORD(_emr, _ofst) \ EFX_DWORD_FIELD(*MCDI_OUT2(_emr, efx_dword_t, _ofst), \ EFX_DWORD_0) Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/dev/sfxge/common/efx_nic.c Mon Nov 26 06:20:13 2018 (r340928) @@ -510,7 +510,7 @@ efx_nic_reset( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); /* - * All modules except the MCDI, PROBE, NVRAM, VPD, MON + * All modules except the MCDI, PROBE, NVRAM, VPD, MON, TUNNEL * (which we do not reset here) must have been shut down or never * initialized. * @@ -520,7 +520,10 @@ efx_nic_reset( */ mod_flags = enp->en_mod_flags; mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM | - EFX_MOD_VPD | EFX_MOD_MON); + EFX_MOD_VPD | EFX_MOD_MON); +#if EFSYS_OPT_TUNNEL + mod_flags &= ~EFX_MOD_TUNNEL; +#endif /* EFSYS_OPT_TUNNEL */ EFSYS_ASSERT3U(mod_flags, ==, 0); if (mod_flags != 0) { rc = EINVAL; Added: head/sys/dev/sfxge/common/efx_tunnel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/efx_tunnel.c Mon Nov 26 06:20:13 2018 (r340928) @@ -0,0 +1,492 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017-2018 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "efx.h" +#include "efx_impl.h" + + +#if EFSYS_OPT_TUNNEL + +#if EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON +static const efx_tunnel_ops_t __efx_tunnel_dummy_ops = { + NULL, /* eto_udp_encap_supported */ + NULL, /* eto_reconfigure */ +}; +#endif /* EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD +static __checkReturn boolean_t +medford_udp_encap_supported( + __in efx_nic_t *enp); + +static __checkReturn efx_rc_t +medford_tunnel_reconfigure( + __in efx_nic_t *enp); + +static const efx_tunnel_ops_t __efx_tunnel_medford_ops = { + medford_udp_encap_supported, /* eto_udp_encap_supported */ + medford_tunnel_reconfigure, /* eto_reconfigure */ +}; +#endif /* EFSYS_OPT_MEDFORD */ + +static __checkReturn efx_rc_t +efx_mcdi_set_tunnel_encap_udp_ports( + __in efx_nic_t *enp, + __in efx_tunnel_cfg_t *etcp, + __in boolean_t unloading, + __out boolean_t *resetting) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LENMAX, + MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_LEN)]; + efx_word_t flags; + efx_rc_t rc; + unsigned int i; + unsigned int entries_num; + + if (etcp == NULL) + entries_num = 0; + else + entries_num = etcp->etc_udp_entries_num; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS; + req.emr_in_buf = payload; + req.emr_in_length = + MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LEN(entries_num); + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_LEN; + + EFX_POPULATE_WORD_1(flags, + MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_UNLOADING, + (unloading == B_TRUE) ? 1 : 0); + MCDI_IN_SET_WORD(req, SET_TUNNEL_ENCAP_UDP_PORTS_IN_FLAGS, + EFX_WORD_FIELD(flags, EFX_WORD_0)); + + MCDI_IN_SET_WORD(req, SET_TUNNEL_ENCAP_UDP_PORTS_IN_NUM_ENTRIES, + entries_num); + + for (i = 0; i < entries_num; ++i) { + uint16_t mcdi_udp_protocol; + + switch (etcp->etc_udp_entries[i].etue_protocol) { + case EFX_TUNNEL_PROTOCOL_VXLAN: + mcdi_udp_protocol = TUNNEL_ENCAP_UDP_PORT_ENTRY_VXLAN; + break; + case EFX_TUNNEL_PROTOCOL_GENEVE: + mcdi_udp_protocol = TUNNEL_ENCAP_UDP_PORT_ENTRY_GENEVE; + break; + default: + rc = EINVAL; + goto fail1; + } + + /* + * UDP port is MCDI native little-endian in the request + * and EFX_POPULATE_DWORD cares about conversion from + * host/CPU byte order to little-endian. + */ + EFX_STATIC_ASSERT(sizeof (efx_dword_t) == + TUNNEL_ENCAP_UDP_PORT_ENTRY_LEN); + EFX_POPULATE_DWORD_2( + MCDI_IN2(req, efx_dword_t, + SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES)[i], + TUNNEL_ENCAP_UDP_PORT_ENTRY_UDP_PORT, + etcp->etc_udp_entries[i].etue_port, + TUNNEL_ENCAP_UDP_PORT_ENTRY_PROTOCOL, + mcdi_udp_protocol); + } + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail2; + } + + if (req.emr_out_length_used != + MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_LEN) { + rc = EMSGSIZE; + goto fail3; + } + + *resetting = MCDI_OUT_WORD_FIELD(req, + SET_TUNNEL_ENCAP_UDP_PORTS_OUT_FLAGS, + SET_TUNNEL_ENCAP_UDP_PORTS_OUT_RESETTING); + + return (0); + +fail3: + EFSYS_PROBE(fail3); + +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_tunnel_init( + __in efx_nic_t *enp) +{ + efx_tunnel_cfg_t *etcp = &enp->en_tunnel_cfg; + const efx_tunnel_ops_t *etop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_TUNNEL)); + + EFX_STATIC_ASSERT(EFX_TUNNEL_MAXNENTRIES == + MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MAXNUM); + + switch (enp->en_family) { +#if EFSYS_OPT_SIENA + case EFX_FAMILY_SIENA: + etop = &__efx_tunnel_dummy_ops; + break; +#endif /* EFSYS_OPT_SIENA */ + +#if EFSYS_OPT_HUNTINGTON + case EFX_FAMILY_HUNTINGTON: + etop = &__efx_tunnel_dummy_ops; + break; +#endif /* EFSYS_OPT_HUNTINGTON */ + +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + etop = &__efx_tunnel_medford_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ + + default: + EFSYS_ASSERT(0); + rc = ENOTSUP; + goto fail1; + } + + memset(etcp->etc_udp_entries, 0, sizeof (etcp->etc_udp_entries)); + etcp->etc_udp_entries_num = 0; + + enp->en_etop = etop; + enp->en_mod_flags |= EFX_MOD_TUNNEL; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + enp->en_etop = NULL; + enp->en_mod_flags &= ~EFX_MOD_TUNNEL; + + return (rc); +} + + void +efx_tunnel_fini( + __in efx_nic_t *enp) +{ + boolean_t resetting; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TUNNEL); + + if ((enp->en_etop->eto_udp_encap_supported != NULL) && + enp->en_etop->eto_udp_encap_supported(enp)) { + /* + * The UNLOADING flag allows the MC to suppress the datapath + * reset if it was set on the last call to + * MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS by all functions + */ + (void) efx_mcdi_set_tunnel_encap_udp_ports(enp, NULL, B_TRUE, + &resetting); + } + + enp->en_etop = NULL; + enp->en_mod_flags &= ~EFX_MOD_TUNNEL; +} + +static __checkReturn efx_rc_t +efx_tunnel_config_find_udp_tunnel_entry( + __in efx_tunnel_cfg_t *etcp, + __in uint16_t port, + __out unsigned int *entryp) +{ + unsigned int i; + + for (i = 0; i < etcp->etc_udp_entries_num; ++i) { + efx_tunnel_udp_entry_t *p = &etcp->etc_udp_entries[i]; + + if (p->etue_port == port) { + *entryp = i; + return (0); + } + } + + return (ENOENT); +} + + __checkReturn efx_rc_t +efx_tunnel_config_udp_add( + __in efx_nic_t *enp, + __in uint16_t port /* host/cpu-endian */, + __in efx_tunnel_protocol_t protocol) +{ + const efx_nic_cfg_t *encp = &enp->en_nic_cfg; + efx_tunnel_cfg_t *etcp = &enp->en_tunnel_cfg; + efsys_lock_state_t state; + efx_rc_t rc; + unsigned int entry; + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TUNNEL); + + if (protocol >= EFX_TUNNEL_NPROTOS) { + rc = EINVAL; + goto fail1; + } + + if ((encp->enc_tunnel_encapsulations_supported & + (1u << protocol)) == 0) { + rc = ENOTSUP; + goto fail2; + } + + EFSYS_LOCK(enp->en_eslp, state); + + rc = efx_tunnel_config_find_udp_tunnel_entry(etcp, port, &entry); + if (rc == 0) { + rc = EEXIST; + goto fail3; + } + + if (etcp->etc_udp_entries_num == + encp->enc_tunnel_config_udp_entries_max) { + rc = ENOSPC; + goto fail4; + } + + etcp->etc_udp_entries[etcp->etc_udp_entries_num].etue_port = port; + etcp->etc_udp_entries[etcp->etc_udp_entries_num].etue_protocol = + protocol; + + etcp->etc_udp_entries_num++; + + EFSYS_UNLOCK(enp->en_eslp, state); + + return (0); + +fail4: + EFSYS_PROBE(fail4); + +fail3: + EFSYS_PROBE(fail3); + EFSYS_UNLOCK(enp->en_eslp, state); + +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_tunnel_config_udp_remove( + __in efx_nic_t *enp, + __in uint16_t port /* host/cpu-endian */, + __in efx_tunnel_protocol_t protocol) +{ + efx_tunnel_cfg_t *etcp = &enp->en_tunnel_cfg; + efsys_lock_state_t state; + unsigned int entry; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TUNNEL); + + EFSYS_LOCK(enp->en_eslp, state); + + rc = efx_tunnel_config_find_udp_tunnel_entry(etcp, port, &entry); + if (rc != 0) + goto fail1; + + if (etcp->etc_udp_entries[entry].etue_protocol != protocol) { + rc = EINVAL; + goto fail2; + } + + EFSYS_ASSERT3U(etcp->etc_udp_entries_num, >, 0); + etcp->etc_udp_entries_num--; + + if (entry < etcp->etc_udp_entries_num) { + memmove(&etcp->etc_udp_entries[entry], + &etcp->etc_udp_entries[entry + 1], + (etcp->etc_udp_entries_num - entry) * + sizeof (etcp->etc_udp_entries[0])); + } + + memset(&etcp->etc_udp_entries[etcp->etc_udp_entries_num], 0, + sizeof (etcp->etc_udp_entries[0])); + + EFSYS_UNLOCK(enp->en_eslp, state); + + return (0); + +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + EFSYS_UNLOCK(enp->en_eslp, state); + + return (rc); +} + + void +efx_tunnel_config_clear( + __in efx_nic_t *enp) +{ + efx_tunnel_cfg_t *etcp = &enp->en_tunnel_cfg; + efsys_lock_state_t state; + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TUNNEL); + + EFSYS_LOCK(enp->en_eslp, state); + + etcp->etc_udp_entries_num = 0; + memset(etcp->etc_udp_entries, 0, sizeof (etcp->etc_udp_entries)); + + EFSYS_UNLOCK(enp->en_eslp, state); +} + + __checkReturn efx_rc_t +efx_tunnel_reconfigure( + __in efx_nic_t *enp) +{ + const efx_tunnel_ops_t *etop = enp->en_etop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TUNNEL); + + if (etop->eto_reconfigure == NULL) { + rc = ENOTSUP; + goto fail1; + } + + if ((rc = enp->en_etop->eto_reconfigure(enp)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#if EFSYS_OPT_MEDFORD +static __checkReturn boolean_t +medford_udp_encap_supported( + __in efx_nic_t *enp) +{ + const efx_nic_cfg_t *encp = &enp->en_nic_cfg; + uint32_t udp_tunnels_mask = 0; + + udp_tunnels_mask |= (1u << EFX_TUNNEL_PROTOCOL_VXLAN); + udp_tunnels_mask |= (1u << EFX_TUNNEL_PROTOCOL_GENEVE); + + return ((encp->enc_tunnel_encapsulations_supported & + udp_tunnels_mask) == 0 ? B_FALSE : B_TRUE); +} + +static __checkReturn efx_rc_t +medford_tunnel_reconfigure( + __in efx_nic_t *enp) +{ + efx_tunnel_cfg_t *etcp = &enp->en_tunnel_cfg; + efx_rc_t rc; + boolean_t resetting; + efsys_lock_state_t state; + efx_tunnel_cfg_t etc; + + EFSYS_LOCK(enp->en_eslp, state); + memcpy(&etc, etcp, sizeof (etc)); + EFSYS_UNLOCK(enp->en_eslp, state); + + if (medford_udp_encap_supported(enp) == B_FALSE) { + /* + * It is OK to apply empty UDP tunnel ports when UDP + * tunnel encapsulations are not supported - just nothing + * should be done. + */ + if (etc.etc_udp_entries_num == 0) + return (0); + rc = ENOTSUP; + goto fail1; + } else { + /* + * All PCI functions can see a reset upon the + * MCDI request completion + */ + rc = efx_mcdi_set_tunnel_encap_udp_ports(enp, &etc, B_FALSE, + &resetting); + if (rc != 0) + goto fail2; + + /* + * Although the caller should be able to handle MC reboot, + * it might come in handy to report the impending reboot + * by returning EAGAIN + */ + return ((resetting) ? EAGAIN : 0); + } +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} +#endif /* EFSYS_OPT_MEDFORD */ + +#endif /* EFSYS_OPT_TUNNEL */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Mon Nov 26 00:58:07 2018 (r340927) +++ head/sys/modules/sfxge/Makefile Mon Nov 26 06:20:13 2018 (r340928) @@ -16,8 +16,8 @@ SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h .PATH: ${SRCTOP}/sys/dev/sfxge/common SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_lic.c efx_mac.c SRCS+= efx_mcdi.c efx_mon.c efx_nic.c -SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c -SRCS+= efx_vpd.c efx_filter.c efx_hash.c +SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tunnel.c +SRCS+= efx_tx.c efx_vpd.c efx_filter.c efx_hash.c SRCS+= efsys.h SRCS+= efx.h efx_check.h efx_impl.h efx_mcdi.h efx_regs.h efx_regs_ef10.h SRCS+= efx_regs_mcdi.h efx_regs_pci.h efx_types.h efx_phy_ids.h From owner-svn-src-head@freebsd.org Mon Nov 26 07:15:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87D21114FECE; Mon, 26 Nov 2018 07:15:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 279F28A9B9; Mon, 26 Nov 2018 07:15:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07635707; Mon, 26 Nov 2018 07:15:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQ7FJCR095785; Mon, 26 Nov 2018 07:15:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQ7FJbd095784; Mon, 26 Nov 2018 07:15:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811260715.wAQ7FJbd095784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 26 Nov 2018 07:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340929 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 279F28A9B9 X-Spamd-Result: default: False [1.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.46)[0.461,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 07:15:20 -0000 Author: arybchik Date: Mon Nov 26 07:15:19 2018 New Revision: 340929 URL: https://svnweb.freebsd.org/changeset/base/340929 Log: sfxge(4): regenerate files with genfwdef after ID update Add security level to image boot header. Submitted by: Andrew Jackson Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18289 Modified: head/sys/dev/sfxge/common/siena_flash.h Modified: head/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- head/sys/dev/sfxge/common/siena_flash.h Mon Nov 26 06:20:13 2018 (r340928) +++ head/sys/dev/sfxge/common/siena_flash.h Mon Nov 26 07:15:19 2018 (r340929) @@ -131,7 +131,14 @@ typedef struct siena_mc_boot_hdr_s { /* GENERATED BY /* the key, or 0xffff if unsigned. (Otherwise set to 0) */ efx_byte_t mumfw_subtype; /* MUM & SUC images: subtype. (Otherwise set to 0) */ efx_byte_t reserved_b[3]; /* (set to 0) */ - efx_dword_t reserved_c[6]; /* (set to 0) */ + efx_dword_t security_level; /* This number increases every time a serious security flaw */ + /* is fixed. A secure NIC may not downgrade to any image */ + /* with a lower security level than the current image. */ + /* Note: The number in this header should only be used for */ + /* determining the level of new images, not to determine */ + /* the level of the current image as this header is not */ + /* protected by a CMAC. */ + efx_dword_t reserved_c[5]; /* (set to 0) */ } siena_mc_boot_hdr_t; #define SIENA_MC_BOOT_HDR_PADDING \ From owner-svn-src-head@freebsd.org Mon Nov 26 07:23:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81D201150195; Mon, 26 Nov 2018 07:23:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 312F18AE91; Mon, 26 Nov 2018 07:23:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 120F28A1; Mon, 26 Nov 2018 07:23:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQ7N4L9000954; Mon, 26 Nov 2018 07:23:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQ7N3pT000949; Mon, 26 Nov 2018 07:23:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811260723.wAQ7N3pT000949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 26 Nov 2018 07:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340930 - in head: . sys/dev/sfxge/common sys/modules/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head: . sys/dev/sfxge/common sys/modules/sfxge X-SVN-Commit-Revision: 340930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 312F18AE91 X-Spamd-Result: default: False [1.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.71)[0.710,0]; NEURAL_SPAM_SHORT(0.56)[0.565,0]; NEURAL_SPAM_MEDIUM(0.71)[0.710,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 07:23:05 -0000 Author: arybchik Date: Mon Nov 26 07:23:02 2018 New Revision: 340930 URL: https://svnweb.freebsd.org/changeset/base/340930 Log: sfxge(4): update autogenerated headers from firmwaresrc Pick up Medford2 interfaces. Split AOE operations out into own header. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18137 Added: head/sys/dev/sfxge/common/efx_regs_mcdi_aoe.h (contents, props changed) Modified: head/.gitattributes head/sys/dev/sfxge/common/ef10_tlv_layout.h head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_regs_mcdi.h head/sys/modules/sfxge/Makefile Modified: head/.gitattributes ============================================================================== --- head/.gitattributes Mon Nov 26 07:15:19 2018 (r340929) +++ head/.gitattributes Mon Nov 26 07:23:02 2018 (r340930) @@ -3,3 +3,5 @@ *.cpp diff=cpp *.hpp diff=cpp *.py diff=python +. svn-properties=svn:mime-type=sys/dev/sfxge/common/efx_regs_mcdi_aoe.h +. svn-properties=svn:eol-style=sys/dev/sfxge/common/efx_regs_mcdi_aoe.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Nov 26 07:15:19 2018 (r340929) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Nov 26 07:23:02 2018 (r340930) @@ -540,6 +540,17 @@ struct tlv_pcie_config_r2 { * number of externally visible ports (and, hence, PF to port mapping), so must * be done at boot time. * + * Port mode naming convention is + * + * [nports_on_cage0]x[port_lane_width]_[nports_on_cage1]x[port_lane_width] + * + * Port lane width determines the capabilities (speeds) of the ports, subject + * to architecture capabilities (e.g. 25G support) and switch bandwidth + * constraints: + * - single lane ports can do 25G/10G/1G + * - dual lane ports can do 50G/25G/10G/1G (with fallback to 1 lane) + * - quad lane ports can do 100G/40G/50G/25G/10G/1G (with fallback to 2 or 1 lanes) + * This tag supercedes tlv_global_port_config. */ @@ -550,18 +561,68 @@ struct tlv_global_port_mode { uint32_t length; uint32_t port_mode; #define TLV_PORT_MODE_DEFAULT (0xffffffff) /* Default for given platform */ -#define TLV_PORT_MODE_10G (0) /* 10G, single SFP/10G-KR */ -#define TLV_PORT_MODE_40G (1) /* 40G, single QSFP/40G-KR */ -#define TLV_PORT_MODE_10G_10G (2) /* 2x10G, dual SFP/10G-KR or single QSFP */ -#define TLV_PORT_MODE_40G_40G (3) /* 40G + 40G, dual QSFP/40G-KR (Greenport, Medford) */ -#define TLV_PORT_MODE_10G_10G_10G_10G (4) /* 2x10G + 2x10G, quad SFP/10G-KR or dual QSFP (Greenport) */ -#define TLV_PORT_MODE_10G_10G_10G_10G_Q1 (4) /* 4x10G, single QSFP, cage 0 (Medford) */ -#define TLV_PORT_MODE_10G_10G_10G_10G_Q (5) /* 4x10G, single QSFP, cage 0 (Medford) OBSOLETE DO NOT USE */ -#define TLV_PORT_MODE_40G_10G_10G (6) /* 1x40G + 2x10G, dual QSFP (Greenport, Medford) */ -#define TLV_PORT_MODE_10G_10G_40G (7) /* 2x10G + 1x40G, dual QSFP (Greenport, Medford) */ -#define TLV_PORT_MODE_10G_10G_10G_10G_Q2 (8) /* 4x10G, single QSFP, cage 1 (Medford) */ -#define TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2 (9) /* 2x10G + 2x10G, dual QSFP (Medford) */ -#define TLV_PORT_MODE_MAX TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2 +#define TLV_PORT_MODE_1x1_NA (0) /* Single 10G/25G on mdi0 */ +#define TLV_PORT_MODE_1x4_NA (1) /* Single 100G/40G on mdi0 */ +#define TLV_PORT_MODE_NA_1x4 (22) /* Single 100G/40G on mdi1 */ +#define TLV_PORT_MODE_1x2_NA (10) /* Single 50G on mdi0 */ +#define TLV_PORT_MODE_NA_1x2 (11) /* Single 50G on mdi1 */ +#define TLV_PORT_MODE_1x1_1x1 (2) /* Single 10G/25G on mdi0, single 10G/25G on mdi1 */ +#define TLV_PORT_MODE_1x4_1x4 (3) /* Single 40G on mdi0, single 40G on mdi1 */ +#define TLV_PORT_MODE_2x1_2x1 (4) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1 - WARNING: bug3720: On Newport only, this is actually Quad 10G on mdi0 */ +#define TLV_PORT_MODE_4x1_NA (5) /* Quad 10G/25G on mdi0 */ +#define TLV_PORT_MODE_NA_4x1 (8) /* Quad 10G/25G on mdi1 */ +#define TLV_PORT_MODE_1x4_2x1 (6) /* Single 40G on mdi0, dual 10G/25G on mdi1 */ +#define TLV_PORT_MODE_2x1_1x4 (7) /* Dual 10G/25G on mdi0, single 40G on mdi1 */ +#define TLV_PORT_MODE_1x2_1x2 (12) /* Single 50G on mdi0, single 50G on mdi1 */ +#define TLV_PORT_MODE_2x2_NA (13) /* Dual 50G on mdi0 */ +#define TLV_PORT_MODE_NA_2x2 (14) /* Dual 50G on mdi1 */ +#define TLV_PORT_MODE_1x4_1x2 (15) /* Single 40G on mdi0, single 50G on mdi1 */ +#define TLV_PORT_MODE_1x2_1x4 (16) /* Single 50G on mdi0, single 40G on mdi1 */ +#define TLV_PORT_MODE_1x2_2x1 (17) /* Single 50G on mdi0, dual 10G/25G on mdi1 */ +#define TLV_PORT_MODE_2x1_1x2 (18) /* Dual 10G/25G on mdi0, single 50G on mdi1 */ +#define TLV_PORT_MODE_2x1_2x1_LL (19) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1, low-latency PCS */ +#define TLV_PORT_MODE_4x1_NA_LL (20) /* Quad 10G/25G on mdi0, low-latency PCS */ +#define TLV_PORT_MODE_NA_4x1_LL (21) /* Quad 10G/25G on mdi1, low-latency PCS */ +#define TLV_PORT_MODE_1x1_NA_LL (23) /* Single 10G/25G on mdi0, low-latency PCS */ +#define TLV_PORT_MODE_1x1_1x1_LL (24) /* Single 10G/25G on mdi0, single 10G/25G on mdi1, low-latency PCS */ +#define TLV_PORT_MODE_BUG63720_DO_NOT_USE (9) /* bug63720: Do not use */ +#define TLV_PORT_MODE_MAX TLV_PORT_MODE_1x1_1x1_LL + +/* Deprecated aliases */ +#define TLV_PORT_MODE_10G TLV_PORT_MODE_1x1_NA +#define TLV_PORT_MODE_40G TLV_PORT_MODE_1x4_NA +#define TLV_PORT_MODE_10G_10G TLV_PORT_MODE_1x1_1x1 +#define TLV_PORT_MODE_40G_40G TLV_PORT_MODE_1x4_1x4 +#define TLV_PORT_MODE_10G_10G_10G_10G TLV_PORT_MODE_2x1_2x1 +#define TLV_PORT_MODE_10G_10G_10G_10G_Q1 TLV_PORT_MODE_2x1_2x1 /* bug63720: Do not use */ +#define TLV_PORT_MODE_10G_10G_10G_10G_Q TLV_PORT_MODE_4x1_NA +#define TLV_PORT_MODE_40G_10G_10G TLV_PORT_MODE_1x4_2x1 +#define TLV_PORT_MODE_10G_10G_40G TLV_PORT_MODE_2x1_1x4 +#define TLV_PORT_MODE_10G_10G_10G_10G_Q2 TLV_PORT_MODE_NA_4x1 +#define TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2 TLV_PORT_MODE_BUG63720_DO_NOT_USE /* bug63720: Do not use */ +#define TLV_PORT_MODE_25G TLV_PORT_MODE_1x1_NA /* Single 25G on mdi0 */ +#define TLV_PORT_MODE_100G_Q1 TLV_PORT_MODE_1x4_NA /* Single 100G on mdi0 */ +#define TLV_PORT_MODE_100G_Q2 TLV_PORT_MODE_NA_1x4 /* Single 100G on mdi1 */ +#define TLV_PORT_MODE_50G_Q1 TLV_PORT_MODE_1x2_NA /* Single 50G on mdi0 */ +#define TLV_PORT_MODE_50G_Q2 TLV_PORT_MODE_NA_1x2 /* Single 50G on mdi1 */ +#define TLV_PORT_MODE_25G_25G TLV_PORT_MODE_1x1_1x1 /* Single 25G on mdi0, single 25G on mdi1 */ +#define TLV_PORT_MODE_25G_25G_25G_25G_Q1_Q2 TLV_PORT_MODE_2x1_2x1 /* Dual 25G on mdi0, dual 25G on mdi1 */ +#define TLV_PORT_MODE_25G_25G_25G_25G_Q1 TLV_PORT_MODE_4x1_NA /* Quad 25G on mdi0 */ +#define TLV_PORT_MODE_25G_25G_25G_25G_Q2 TLV_PORT_MODE_NA_4x1 /* Quad 25G on mdi1 */ +#define TLV_PORT_MODE_40G_25G_25G TLV_PORT_MODE_1x4_2x1 /* Single 40G on mdi0, dual 25G on mdi1 */ +#define TLV_PORT_MODE_25G_25G_40G TLV_PORT_MODE_2x1_1x4 /* Dual 25G on mdi0, single 40G on mdi1 */ +#define TLV_PORT_MODE_50G_50G_Q1_Q2 TLV_PORT_MODE_1x2_1x2 /* Single 50G on mdi0, single 50G on mdi1 */ +#define TLV_PORT_MODE_50G_50G_Q1 TLV_PORT_MODE_2x2_NA /* Dual 50G on mdi0 */ +#define TLV_PORT_MODE_50G_50G_Q2 TLV_PORT_MODE_NA_2x2 /* Dual 50G on mdi1 */ +#define TLV_PORT_MODE_40G_50G TLV_PORT_MODE_1x4_1x2 /* Single 40G on mdi0, single 50G on mdi1 */ +#define TLV_PORT_MODE_50G_40G TLV_PORT_MODE_1x2_1x4 /* Single 50G on mdi0, single 40G on mdi1 */ +#define TLV_PORT_MODE_50G_25G_25G TLV_PORT_MODE_1x2_2x1 /* Single 50G on mdi0, dual 25G on mdi1 */ +#define TLV_PORT_MODE_25G_25G_50G TLV_PORT_MODE_2x1_1x2 /* Dual 25G on mdi0, single 50G on mdi1 */ +#define TLV_PORT_MODE_25G_25G_25G_25G_Q1_Q2_LL TLV_PORT_MODE_2x1_2x1_LL /* Dual 25G on mdi0, dual 25G on mdi1, low-latency PCS */ +#define TLV_PORT_MODE_25G_25G_25G_25G_Q1_LL TLV_PORT_MODE_4x1_NA_LL /* Quad 25G on mdi0, low-latency PCS */ +#define TLV_PORT_MODE_25G_25G_25G_25G_Q2_LL TLV_PORT_MODE_NA_4x1_LL /* Quad 25G on mdi1, low-latency PCS */ +#define TLV_PORT_MODE_25G_LL TLV_PORT_MODE_1x1_NA_LL /* Single 10G/25G on mdi0, low-latency PCS */ +#define TLV_PORT_MODE_25G_25G_LL TLV_PORT_MODE_1x1_1x1_LL /* Single 10G/25G on mdi0, single 10G/25G on mdi1, low-latency PCS */ }; /* Type of the v-switch created implicitly by the firmware */ Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Mon Nov 26 07:15:19 2018 (r340929) +++ head/sys/dev/sfxge/common/efx_lic.c Mon Nov 26 07:23:02 2018 (r340930) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_LICENSING #include "ef10_tlv_layout.h" +#if EFSYS_OPT_SIENA +#include "efx_regs_mcdi_aoe.h" +#endif #if EFSYS_OPT_SIENA | EFSYS_OPT_HUNTINGTON Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Mon Nov 26 07:15:19 2018 (r340929) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Mon Nov 26 07:23:02 2018 (r340930) @@ -312,6 +312,14 @@ /* This command needs to be processed in the background but there were no * resources to do so. Send it again after a command has completed. */ #define MC_CMD_ERR_QUEUE_FULL 0x1017 +/* The operation could not be completed because the PCIe link has gone + * away. This error code is never expected to be returned over the TLP + * transport. */ +#define MC_CMD_ERR_NO_PCIE 0x1018 +/* The operation could not be completed because the datapath has gone + * away. This is distinct from MC_CMD_ERR_DATAPATH_DISABLED in that the + * datapath absence may be temporary*/ +#define MC_CMD_ERR_NO_DATAPATH 0x1019 #define MC_CMD_ERR_CODE_OFST 0 @@ -397,6 +405,7 @@ /* enum: Fatal. */ #define MCDI_EVENT_LEVEL_FATAL 0x3 #define MCDI_EVENT_DATA_OFST 0 +#define MCDI_EVENT_DATA_LEN 4 #define MCDI_EVENT_CMDDONE_SEQ_LBN 0 #define MCDI_EVENT_CMDDONE_SEQ_WIDTH 8 #define MCDI_EVENT_CMDDONE_DATALEN_LBN 8 @@ -415,6 +424,12 @@ #define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3 /* enum: 40Gbs */ #define MCDI_EVENT_LINKCHANGE_SPEED_40G 0x4 +/* enum: 25Gbs */ +#define MCDI_EVENT_LINKCHANGE_SPEED_25G 0x5 +/* enum: 50Gbs */ +#define MCDI_EVENT_LINKCHANGE_SPEED_50G 0x6 +/* enum: 100Gbs */ +#define MCDI_EVENT_LINKCHANGE_SPEED_100G 0x7 #define MCDI_EVENT_LINKCHANGE_FCNTL_LBN 20 #define MCDI_EVENT_LINKCHANGE_FCNTL_WIDTH 4 #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_LBN 24 @@ -503,8 +518,23 @@ #define MCDI_EVENT_AOE_INVALID_FPGA_FLASH_TYPE 0xf /* enum: Notify that the attempt to run FPGA Controller firmware timedout */ #define MCDI_EVENT_AOE_FC_RUN_TIMEDOUT 0x10 +/* enum: Failure to probe one or more FPGA boot flash chips */ +#define MCDI_EVENT_AOE_FPGA_BOOT_FLASH_INVALID 0x11 +/* enum: FPGA boot-flash contains an invalid image header */ +#define MCDI_EVENT_AOE_FPGA_BOOT_FLASH_HDR_INVALID 0x12 +/* enum: Failed to program clocks required by the FPGA */ +#define MCDI_EVENT_AOE_FPGA_CLOCKS_PROGRAM_FAILED 0x13 +/* enum: Notify that FPGA Controller is alive to serve MCDI requests */ +#define MCDI_EVENT_AOE_FC_RUNNING 0x14 #define MCDI_EVENT_AOE_ERR_DATA_LBN 8 #define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8 +#define MCDI_EVENT_AOE_ERR_FC_ASSERT_INFO_LBN 8 +#define MCDI_EVENT_AOE_ERR_FC_ASSERT_INFO_WIDTH 8 +/* enum: FC Assert happened, but the register information is not available */ +#define MCDI_EVENT_AOE_ERR_FC_ASSERT_SEEN 0x0 +/* enum: The register information for FC Assert is ready for readinng by driver + */ +#define MCDI_EVENT_AOE_ERR_FC_ASSERT_DATA_READY 0x1 #define MCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_LBN 8 #define MCDI_EVENT_AOE_ERR_CODE_FPGA_HEADER_VERIFY_FAILED_WIDTH 8 /* enum: Reading from NV failed */ @@ -557,6 +587,22 @@ #define MCDI_EVENT_MUM_WATCHDOG 0x3 #define MCDI_EVENT_MUM_ERR_DATA_LBN 8 #define MCDI_EVENT_MUM_ERR_DATA_WIDTH 8 +#define MCDI_EVENT_DBRET_SEQ_LBN 0 +#define MCDI_EVENT_DBRET_SEQ_WIDTH 8 +#define MCDI_EVENT_SUC_ERR_TYPE_LBN 0 +#define MCDI_EVENT_SUC_ERR_TYPE_WIDTH 8 +/* enum: Corrupted or bad SUC application. */ +#define MCDI_EVENT_SUC_BAD_APP 0x1 +/* enum: SUC application reported an assert. */ +#define MCDI_EVENT_SUC_ASSERT 0x2 +/* enum: SUC application reported an exception. */ +#define MCDI_EVENT_SUC_EXCEPTION 0x3 +/* enum: SUC watchdog timer expired. */ +#define MCDI_EVENT_SUC_WATCHDOG 0x4 +#define MCDI_EVENT_SUC_ERR_ADDRESS_LBN 8 +#define MCDI_EVENT_SUC_ERR_ADDRESS_WIDTH 24 +#define MCDI_EVENT_SUC_ERR_DATA_LBN 8 +#define MCDI_EVENT_SUC_ERR_DATA_WIDTH 24 #define MCDI_EVENT_DATA_LBN 0 #define MCDI_EVENT_DATA_WIDTH 32 #define MCDI_EVENT_SRC_LBN 36 @@ -629,73 +675,99 @@ * been processed and it may now resend the command */ #define MCDI_EVENT_CODE_PROXY_RESPONSE 0x1d +/* enum: MCDI command accepted. New commands can be issued but this command is + * not done yet. + */ +#define MCDI_EVENT_CODE_DBRET 0x1e +/* enum: The MC has detected a fault on the SUC */ +#define MCDI_EVENT_CODE_SUC 0x1f /* enum: Artificial event generated by host and posted via MC for test * purposes. */ #define MCDI_EVENT_CODE_TESTGEN 0xfa #define MCDI_EVENT_CMDDONE_DATA_OFST 0 +#define MCDI_EVENT_CMDDONE_DATA_LEN 4 #define MCDI_EVENT_CMDDONE_DATA_LBN 0 #define MCDI_EVENT_CMDDONE_DATA_WIDTH 32 #define MCDI_EVENT_LINKCHANGE_DATA_OFST 0 +#define MCDI_EVENT_LINKCHANGE_DATA_LEN 4 #define MCDI_EVENT_LINKCHANGE_DATA_LBN 0 #define MCDI_EVENT_LINKCHANGE_DATA_WIDTH 32 #define MCDI_EVENT_SENSOREVT_DATA_OFST 0 +#define MCDI_EVENT_SENSOREVT_DATA_LEN 4 #define MCDI_EVENT_SENSOREVT_DATA_LBN 0 #define MCDI_EVENT_SENSOREVT_DATA_WIDTH 32 #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_OFST 0 +#define MCDI_EVENT_MAC_STATS_DMA_GENERATION_LEN 4 #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_LBN 0 #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_WIDTH 32 #define MCDI_EVENT_TX_ERR_DATA_OFST 0 +#define MCDI_EVENT_TX_ERR_DATA_LEN 4 #define MCDI_EVENT_TX_ERR_DATA_LBN 0 #define MCDI_EVENT_TX_ERR_DATA_WIDTH 32 /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the seconds field of * timestamp */ #define MCDI_EVENT_PTP_SECONDS_OFST 0 +#define MCDI_EVENT_PTP_SECONDS_LEN 4 #define MCDI_EVENT_PTP_SECONDS_LBN 0 #define MCDI_EVENT_PTP_SECONDS_WIDTH 32 /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the major field of * timestamp */ #define MCDI_EVENT_PTP_MAJOR_OFST 0 +#define MCDI_EVENT_PTP_MAJOR_LEN 4 #define MCDI_EVENT_PTP_MAJOR_LBN 0 #define MCDI_EVENT_PTP_MAJOR_WIDTH 32 /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the nanoseconds field * of timestamp */ #define MCDI_EVENT_PTP_NANOSECONDS_OFST 0 +#define MCDI_EVENT_PTP_NANOSECONDS_LEN 4 #define MCDI_EVENT_PTP_NANOSECONDS_LBN 0 #define MCDI_EVENT_PTP_NANOSECONDS_WIDTH 32 /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the minor field of * timestamp */ #define MCDI_EVENT_PTP_MINOR_OFST 0 +#define MCDI_EVENT_PTP_MINOR_LEN 4 #define MCDI_EVENT_PTP_MINOR_LBN 0 #define MCDI_EVENT_PTP_MINOR_WIDTH 32 /* For CODE_PTP_RX events, the lowest four bytes of sourceUUID from PTP packet */ #define MCDI_EVENT_PTP_UUID_OFST 0 +#define MCDI_EVENT_PTP_UUID_LEN 4 #define MCDI_EVENT_PTP_UUID_LBN 0 #define MCDI_EVENT_PTP_UUID_WIDTH 32 #define MCDI_EVENT_RX_ERR_DATA_OFST 0 +#define MCDI_EVENT_RX_ERR_DATA_LEN 4 #define MCDI_EVENT_RX_ERR_DATA_LBN 0 #define MCDI_EVENT_RX_ERR_DATA_WIDTH 32 #define MCDI_EVENT_PAR_ERR_DATA_OFST 0 +#define MCDI_EVENT_PAR_ERR_DATA_LEN 4 #define MCDI_EVENT_PAR_ERR_DATA_LBN 0 #define MCDI_EVENT_PAR_ERR_DATA_WIDTH 32 #define MCDI_EVENT_ECC_CORR_ERR_DATA_OFST 0 +#define MCDI_EVENT_ECC_CORR_ERR_DATA_LEN 4 #define MCDI_EVENT_ECC_CORR_ERR_DATA_LBN 0 #define MCDI_EVENT_ECC_CORR_ERR_DATA_WIDTH 32 #define MCDI_EVENT_ECC_FATAL_ERR_DATA_OFST 0 +#define MCDI_EVENT_ECC_FATAL_ERR_DATA_LEN 4 #define MCDI_EVENT_ECC_FATAL_ERR_DATA_LBN 0 #define MCDI_EVENT_ECC_FATAL_ERR_DATA_WIDTH 32 /* For CODE_PTP_TIME events, the major value of the PTP clock */ #define MCDI_EVENT_PTP_TIME_MAJOR_OFST 0 +#define MCDI_EVENT_PTP_TIME_MAJOR_LEN 4 #define MCDI_EVENT_PTP_TIME_MAJOR_LBN 0 #define MCDI_EVENT_PTP_TIME_MAJOR_WIDTH 32 /* For CODE_PTP_TIME events, bits 19-26 of the minor value of the PTP clock */ #define MCDI_EVENT_PTP_TIME_MINOR_26_19_LBN 36 #define MCDI_EVENT_PTP_TIME_MINOR_26_19_WIDTH 8 +/* For CODE_PTP_TIME events, most significant bits of the minor value of the + * PTP clock. This is a more generic equivalent of PTP_TIME_MINOR_26_19. + */ +#define MCDI_EVENT_PTP_TIME_MINOR_MS_8BITS_LBN 36 +#define MCDI_EVENT_PTP_TIME_MINOR_MS_8BITS_WIDTH 8 /* For CODE_PTP_TIME events where report sync status is enabled, indicates * whether the NIC clock has ever been set */ @@ -711,10 +783,17 @@ */ #define MCDI_EVENT_PTP_TIME_MINOR_26_21_LBN 38 #define MCDI_EVENT_PTP_TIME_MINOR_26_21_WIDTH 6 +/* For CODE_PTP_TIME events, most significant bits of the minor value of the + * PTP clock. This is a more generic equivalent of PTP_TIME_MINOR_26_21. + */ +#define MCDI_EVENT_PTP_TIME_MINOR_MS_6BITS_LBN 38 +#define MCDI_EVENT_PTP_TIME_MINOR_MS_6BITS_WIDTH 6 #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_OFST 0 +#define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_LEN 4 #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_LBN 0 #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_WIDTH 32 #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_OFST 0 +#define MCDI_EVENT_PROXY_RESPONSE_HANDLE_LEN 4 #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_LBN 0 #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_WIDTH 32 /* Zero means that the request has been completed or authorized, and the driver @@ -723,6 +802,10 @@ */ #define MCDI_EVENT_PROXY_RESPONSE_RC_LBN 36 #define MCDI_EVENT_PROXY_RESPONSE_RC_WIDTH 8 +#define MCDI_EVENT_DBRET_DATA_OFST 0 +#define MCDI_EVENT_DBRET_DATA_LEN 4 +#define MCDI_EVENT_DBRET_DATA_LBN 0 +#define MCDI_EVENT_DBRET_DATA_WIDTH 32 /* FCDI_EVENT structuredef */ #define FCDI_EVENT_LEN 8 @@ -739,6 +822,7 @@ /* enum: Fatal. */ #define FCDI_EVENT_LEVEL_FATAL 0x3 #define FCDI_EVENT_DATA_OFST 0 +#define FCDI_EVENT_DATA_LEN 4 #define FCDI_EVENT_LINK_STATE_STATUS_LBN 0 #define FCDI_EVENT_LINK_STATE_STATUS_WIDTH 1 #define FCDI_EVENT_LINK_DOWN 0x0 /* enum */ @@ -778,6 +862,7 @@ #define FCDI_EVENT_REBOOT_FC_FW 0x0 /* enum */ #define FCDI_EVENT_REBOOT_FC_BOOTLOADER 0x1 /* enum */ #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0 +#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LEN 4 #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0 #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32 #define FCDI_EVENT_ASSERT_TYPE_LBN 36 @@ -785,12 +870,15 @@ #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_LBN 36 #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_WIDTH 8 #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_OFST 0 +#define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LEN 4 #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LBN 0 #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_WIDTH 32 #define FCDI_EVENT_LINK_STATE_DATA_OFST 0 +#define FCDI_EVENT_LINK_STATE_DATA_LEN 4 #define FCDI_EVENT_LINK_STATE_DATA_LBN 0 #define FCDI_EVENT_LINK_STATE_DATA_WIDTH 32 #define FCDI_EVENT_PTP_STATE_OFST 0 +#define FCDI_EVENT_PTP_STATE_LEN 4 #define FCDI_EVENT_PTP_UNDEFINED 0x0 /* enum */ #define FCDI_EVENT_PTP_SETUP_FAILED 0x1 /* enum */ #define FCDI_EVENT_PTP_OPERATIONAL 0x2 /* enum */ @@ -799,6 +887,7 @@ #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_LBN 36 #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_WIDTH 8 #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_OFST 0 +#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LEN 4 #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LBN 0 #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_WIDTH 32 /* Index of MC port being referred to */ @@ -806,9 +895,11 @@ #define FCDI_EVENT_PORT_CONFIG_SRC_WIDTH 8 /* FC Port index that matches the MC port index in SRC */ #define FCDI_EVENT_PORT_CONFIG_DATA_OFST 0 +#define FCDI_EVENT_PORT_CONFIG_DATA_LEN 4 #define FCDI_EVENT_PORT_CONFIG_DATA_LBN 0 #define FCDI_EVENT_PORT_CONFIG_DATA_WIDTH 32 #define FCDI_EVENT_BOOT_RESULT_OFST 0 +#define FCDI_EVENT_BOOT_RESULT_LEN 4 /* Enum values, see field(s): */ /* MC_CMD_AOE/MC_CMD_AOE_OUT_INFO/FC_BOOT_RESULT */ #define FCDI_EVENT_BOOT_RESULT_LBN 0 @@ -825,14 +916,17 @@ #define FCDI_EXTENDED_EVENT_PPS_LEN(num) (8+8*(num)) /* Number of timestamps following */ #define FCDI_EXTENDED_EVENT_PPS_COUNT_OFST 0 +#define FCDI_EXTENDED_EVENT_PPS_COUNT_LEN 4 #define FCDI_EXTENDED_EVENT_PPS_COUNT_LBN 0 #define FCDI_EXTENDED_EVENT_PPS_COUNT_WIDTH 32 /* Seconds field of a timestamp record */ #define FCDI_EXTENDED_EVENT_PPS_SECONDS_OFST 8 +#define FCDI_EXTENDED_EVENT_PPS_SECONDS_LEN 4 #define FCDI_EXTENDED_EVENT_PPS_SECONDS_LBN 64 #define FCDI_EXTENDED_EVENT_PPS_SECONDS_WIDTH 32 /* Nanoseconds field of a timestamp record */ #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_OFST 12 +#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LEN 4 #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LBN 96 #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_WIDTH 32 /* Timestamp records comprising the event */ @@ -860,6 +954,7 @@ /* enum: Fatal. */ #define MUM_EVENT_LEVEL_FATAL 0x3 #define MUM_EVENT_DATA_OFST 0 +#define MUM_EVENT_DATA_LEN 4 #define MUM_EVENT_SENSOR_ID_LBN 0 #define MUM_EVENT_SENSOR_ID_WIDTH 8 /* Enum values, see field(s): */ @@ -897,18 +992,23 @@ /* enum: Link fault has been asserted, or has cleared. */ #define MUM_EVENT_CODE_QSFP_LASI_INTERRUPT 0x4 #define MUM_EVENT_SENSOR_DATA_OFST 0 +#define MUM_EVENT_SENSOR_DATA_LEN 4 #define MUM_EVENT_SENSOR_DATA_LBN 0 #define MUM_EVENT_SENSOR_DATA_WIDTH 32 #define MUM_EVENT_PORT_PHY_FLAGS_OFST 0 +#define MUM_EVENT_PORT_PHY_FLAGS_LEN 4 #define MUM_EVENT_PORT_PHY_FLAGS_LBN 0 #define MUM_EVENT_PORT_PHY_FLAGS_WIDTH 32 #define MUM_EVENT_PORT_PHY_COPPER_LEN_OFST 0 +#define MUM_EVENT_PORT_PHY_COPPER_LEN_LEN 4 #define MUM_EVENT_PORT_PHY_COPPER_LEN_LBN 0 #define MUM_EVENT_PORT_PHY_COPPER_LEN_WIDTH 32 #define MUM_EVENT_PORT_PHY_CAPS_OFST 0 +#define MUM_EVENT_PORT_PHY_CAPS_LEN 4 #define MUM_EVENT_PORT_PHY_CAPS_LBN 0 #define MUM_EVENT_PORT_PHY_CAPS_WIDTH 32 #define MUM_EVENT_PORT_PHY_TECH_OFST 0 +#define MUM_EVENT_PORT_PHY_TECH_LEN 4 #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_UNKNOWN 0x0 /* enum */ #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_OPTICAL 0x1 /* enum */ #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_PASSIVE 0x2 /* enum */ @@ -932,7 +1032,9 @@ /***********************************/ /* MC_CMD_READ32 - * Read multiple 32byte words from MC memory. + * Read multiple 32byte words from MC memory. Note - this command really + * belongs to INSECURE category but is required by shmboot. The command handler + * has additional checks to reject insecure calls. */ #define MC_CMD_READ32 0x1 #undef MC_CMD_0x1_PRIVILEGE_CTG @@ -942,7 +1044,9 @@ /* MC_CMD_READ32_IN msgrequest */ #define MC_CMD_READ32_IN_LEN 8 #define MC_CMD_READ32_IN_ADDR_OFST 0 +#define MC_CMD_READ32_IN_ADDR_LEN 4 #define MC_CMD_READ32_IN_NUMWORDS_OFST 4 +#define MC_CMD_READ32_IN_NUMWORDS_LEN 4 /* MC_CMD_READ32_OUT msgresponse */ #define MC_CMD_READ32_OUT_LENMIN 4 @@ -961,13 +1065,14 @@ #define MC_CMD_WRITE32 0x2 #undef MC_CMD_0x2_PRIVILEGE_CTG -#define MC_CMD_0x2_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0x2_PRIVILEGE_CTG SRIOV_CTG_INSECURE /* MC_CMD_WRITE32_IN msgrequest */ #define MC_CMD_WRITE32_IN_LENMIN 8 #define MC_CMD_WRITE32_IN_LENMAX 252 #define MC_CMD_WRITE32_IN_LEN(num) (4+4*(num)) #define MC_CMD_WRITE32_IN_ADDR_OFST 0 +#define MC_CMD_WRITE32_IN_ADDR_LEN 4 #define MC_CMD_WRITE32_IN_BUFFER_OFST 4 #define MC_CMD_WRITE32_IN_BUFFER_LEN 4 #define MC_CMD_WRITE32_IN_BUFFER_MINNUM 1 @@ -979,7 +1084,9 @@ /***********************************/ /* MC_CMD_COPYCODE - * Copy MC code between two locations and jump. + * Copy MC code between two locations and jump. Note - this command really + * belongs to INSECURE category but is required by shmboot. The command handler + * has additional checks to reject insecure calls. */ #define MC_CMD_COPYCODE 0x3 #undef MC_CMD_0x3_PRIVILEGE_CTG @@ -995,6 +1102,7 @@ * is a bitfield, with each bit as documented below. */ #define MC_CMD_COPYCODE_IN_SRC_ADDR_OFST 0 +#define MC_CMD_COPYCODE_IN_SRC_ADDR_LEN 4 /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT (see below) */ #define MC_CMD_COPYCODE_HUNT_NO_MAGIC_ADDR 0x10000 /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT and @@ -1020,9 +1128,12 @@ #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_DISABLE_XIP_WIDTH 1 /* Destination address */ #define MC_CMD_COPYCODE_IN_DEST_ADDR_OFST 4 +#define MC_CMD_COPYCODE_IN_DEST_ADDR_LEN 4 #define MC_CMD_COPYCODE_IN_NUMWORDS_OFST 8 +#define MC_CMD_COPYCODE_IN_NUMWORDS_LEN 4 /* Address of where to jump after copy. */ #define MC_CMD_COPYCODE_IN_JUMP_OFST 12 +#define MC_CMD_COPYCODE_IN_JUMP_LEN 4 /* enum: Control should return to the caller rather than jumping */ #define MC_CMD_COPYCODE_JUMP_NONE 0x1 @@ -1037,12 +1148,13 @@ #define MC_CMD_SET_FUNC 0x4 #undef MC_CMD_0x4_PRIVILEGE_CTG -#define MC_CMD_0x4_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0x4_PRIVILEGE_CTG SRIOV_CTG_INSECURE /* MC_CMD_SET_FUNC_IN msgrequest */ #define MC_CMD_SET_FUNC_IN_LEN 4 /* Set function */ #define MC_CMD_SET_FUNC_IN_FUNC_OFST 0 +#define MC_CMD_SET_FUNC_IN_FUNC_LEN 4 /* MC_CMD_SET_FUNC_OUT msgresponse */ #define MC_CMD_SET_FUNC_OUT_LEN 0 @@ -1055,7 +1167,7 @@ #define MC_CMD_GET_BOOT_STATUS 0x5 #undef MC_CMD_0x5_PRIVILEGE_CTG -#define MC_CMD_0x5_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0x5_PRIVILEGE_CTG SRIOV_CTG_GENERAL /* MC_CMD_GET_BOOT_STATUS_IN msgrequest */ #define MC_CMD_GET_BOOT_STATUS_IN_LEN 0 @@ -1064,9 +1176,11 @@ #define MC_CMD_GET_BOOT_STATUS_OUT_LEN 8 /* ?? */ #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_OFST 0 +#define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_LEN 4 /* enum: indicates that the MC wasn't flash booted */ #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_NULL 0xdeadbeef #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_OFST 4 +#define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_LEN 4 #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_LBN 0 #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_WIDTH 1 #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_PRIMARY_LBN 1 @@ -1090,11 +1204,13 @@ #define MC_CMD_GET_ASSERTS_IN_LEN 4 /* Set to clear assertion */ #define MC_CMD_GET_ASSERTS_IN_CLEAR_OFST 0 +#define MC_CMD_GET_ASSERTS_IN_CLEAR_LEN 4 /* MC_CMD_GET_ASSERTS_OUT msgresponse */ #define MC_CMD_GET_ASSERTS_OUT_LEN 140 /* Assertion status flag. */ #define MC_CMD_GET_ASSERTS_OUT_GLOBAL_FLAGS_OFST 0 +#define MC_CMD_GET_ASSERTS_OUT_GLOBAL_FLAGS_LEN 4 /* enum: No assertions have failed. */ #define MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS 0x1 /* enum: A system-level assertion has failed. */ @@ -1107,6 +1223,7 @@ #define MC_CMD_GET_ASSERTS_FLAGS_ADDR_TRAP 0x5 /* Failing PC value */ #define MC_CMD_GET_ASSERTS_OUT_SAVED_PC_OFFS_OFST 4 +#define MC_CMD_GET_ASSERTS_OUT_SAVED_PC_OFFS_LEN 4 /* Saved GP regs */ #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_OFST 8 #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_LEN 4 @@ -1117,7 +1234,9 @@ #define MC_CMD_GET_ASSERTS_REG_NO_DATA 0xda7a1057 /* Failing thread address */ #define MC_CMD_GET_ASSERTS_OUT_THREAD_OFFS_OFST 132 +#define MC_CMD_GET_ASSERTS_OUT_THREAD_OFFS_LEN 4 #define MC_CMD_GET_ASSERTS_OUT_RESERVED_OFST 136 +#define MC_CMD_GET_ASSERTS_OUT_RESERVED_LEN 4 /***********************************/ @@ -1134,12 +1253,14 @@ #define MC_CMD_LOG_CTRL_IN_LEN 8 /* Log destination */ #define MC_CMD_LOG_CTRL_IN_LOG_DEST_OFST 0 +#define MC_CMD_LOG_CTRL_IN_LOG_DEST_LEN 4 /* enum: UART. */ #define MC_CMD_LOG_CTRL_IN_LOG_DEST_UART 0x1 /* enum: Event queue. */ #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ 0x2 /* Legacy argument. Must be zero. */ #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ_OFST 4 +#define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ_LEN 4 /* MC_CMD_LOG_CTRL_OUT msgresponse */ #define MC_CMD_LOG_CTRL_OUT_LEN 0 @@ -1161,23 +1282,29 @@ #define MC_CMD_GET_VERSION_EXT_IN_LEN 4 /* placeholder, set to 0 */ #define MC_CMD_GET_VERSION_EXT_IN_EXT_FLAGS_OFST 0 +#define MC_CMD_GET_VERSION_EXT_IN_EXT_FLAGS_LEN 4 /* MC_CMD_GET_VERSION_V0_OUT msgresponse: deprecated version format */ #define MC_CMD_GET_VERSION_V0_OUT_LEN 4 #define MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 +#define MC_CMD_GET_VERSION_OUT_FIRMWARE_LEN 4 /* enum: Reserved version number to indicate "any" version. */ #define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff /* enum: Bootrom version value for Siena. */ #define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000 /* enum: Bootrom version value for Huntington. */ #define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001 +/* enum: Bootrom version value for Medford2. */ +#define MC_CMD_GET_VERSION_OUT_FIRMWARE_MEDFORD2_BOOTROM 0xb0070002 /* MC_CMD_GET_VERSION_OUT msgresponse */ #define MC_CMD_GET_VERSION_OUT_LEN 32 /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */ +/* MC_CMD_GET_VERSION_OUT_FIRMWARE_LEN 4 */ /* Enum values, see field(s): */ /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */ #define MC_CMD_GET_VERSION_OUT_PCOL_OFST 4 +#define MC_CMD_GET_VERSION_OUT_PCOL_LEN 4 /* 128bit mask of functions supported by the current firmware */ #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_OFST 8 #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_LEN 16 @@ -1189,9 +1316,11 @@ /* MC_CMD_GET_VERSION_EXT_OUT msgresponse */ #define MC_CMD_GET_VERSION_EXT_OUT_LEN 48 /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */ +/* MC_CMD_GET_VERSION_OUT_FIRMWARE_LEN 4 */ /* Enum values, see field(s): */ /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */ #define MC_CMD_GET_VERSION_EXT_OUT_PCOL_OFST 4 +#define MC_CMD_GET_VERSION_EXT_OUT_PCOL_LEN 4 /* 128bit mask of functions supported by the current firmware */ #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_OFST 8 #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_LEN 16 @@ -1205,2421 +1334,6 @@ /***********************************/ -/* MC_CMD_FC - * Perform an FC operation - */ -#define MC_CMD_FC 0x9 - -/* MC_CMD_FC_IN msgrequest */ -#define MC_CMD_FC_IN_LEN 4 -#define MC_CMD_FC_IN_OP_HDR_OFST 0 -#define MC_CMD_FC_IN_OP_LBN 0 -#define MC_CMD_FC_IN_OP_WIDTH 8 -/* enum: NULL MCDI command to FC. */ -#define MC_CMD_FC_OP_NULL 0x1 -/* enum: Unused opcode */ -#define MC_CMD_FC_OP_UNUSED 0x2 -/* enum: MAC driver commands */ -#define MC_CMD_FC_OP_MAC 0x3 -/* enum: Read FC memory */ -#define MC_CMD_FC_OP_READ32 0x4 -/* enum: Write to FC memory */ -#define MC_CMD_FC_OP_WRITE32 0x5 -/* enum: Read FC memory */ -#define MC_CMD_FC_OP_TRC_READ 0x6 -/* enum: Write to FC memory */ -#define MC_CMD_FC_OP_TRC_WRITE 0x7 -/* enum: FC firmware Version */ -#define MC_CMD_FC_OP_GET_VERSION 0x8 -/* enum: Read FC memory */ -#define MC_CMD_FC_OP_TRC_RX_READ 0x9 -/* enum: Write to FC memory */ -#define MC_CMD_FC_OP_TRC_RX_WRITE 0xa -/* enum: SFP parameters */ -#define MC_CMD_FC_OP_SFP 0xb -/* enum: DDR3 test */ -#define MC_CMD_FC_OP_DDR_TEST 0xc -/* enum: Get Crash context from FC */ -#define MC_CMD_FC_OP_GET_ASSERT 0xd -/* enum: Get FPGA Build registers */ -#define MC_CMD_FC_OP_FPGA_BUILD 0xe -/* enum: Read map support commands */ -#define MC_CMD_FC_OP_READ_MAP 0xf -/* enum: FC Capabilities */ -#define MC_CMD_FC_OP_CAPABILITIES 0x10 -/* enum: FC Global flags */ -#define MC_CMD_FC_OP_GLOBAL_FLAGS 0x11 -/* enum: FC IO using relative addressing modes */ -#define MC_CMD_FC_OP_IO_REL 0x12 -/* enum: FPGA link information */ -#define MC_CMD_FC_OP_UHLINK 0x13 -/* enum: Configure loopbacks and link on FPGA ports */ -#define MC_CMD_FC_OP_SET_LINK 0x14 -/* enum: Licensing operations relating to AOE */ -#define MC_CMD_FC_OP_LICENSE 0x15 -/* enum: Startup information to the FC */ -#define MC_CMD_FC_OP_STARTUP 0x16 -/* enum: Configure a DMA read */ -#define MC_CMD_FC_OP_DMA 0x17 -/* enum: Configure a timed read */ -#define MC_CMD_FC_OP_TIMED_READ 0x18 -/* enum: Control UART logging */ -#define MC_CMD_FC_OP_LOG 0x19 -/* enum: Get the value of a given clock_id */ -#define MC_CMD_FC_OP_CLOCK 0x1a -/* enum: DDR3/QDR3 parameters */ -#define MC_CMD_FC_OP_DDR 0x1b -/* enum: PTP and timestamp control */ -#define MC_CMD_FC_OP_TIMESTAMP 0x1c -/* enum: Commands for SPI Flash interface */ -#define MC_CMD_FC_OP_SPI 0x1d -/* enum: Commands for diagnostic components */ -#define MC_CMD_FC_OP_DIAG 0x1e -/* enum: External AOE port. */ -#define MC_CMD_FC_IN_PORT_EXT_OFST 0x0 -/* enum: Internal AOE port. */ -#define MC_CMD_FC_IN_PORT_INT_OFST 0x40 - -/* MC_CMD_FC_IN_NULL msgrequest */ -#define MC_CMD_FC_IN_NULL_LEN 4 -#define MC_CMD_FC_IN_CMD_OFST 0 - -/* MC_CMD_FC_IN_PHY msgrequest */ -#define MC_CMD_FC_IN_PHY_LEN 5 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* FC PHY driver operation code */ -#define MC_CMD_FC_IN_PHY_OP_OFST 4 -#define MC_CMD_FC_IN_PHY_OP_LEN 1 -/* enum: PHY init handler */ -#define MC_CMD_FC_OP_PHY_OP_INIT 0x1 -/* enum: PHY reconfigure handler */ -#define MC_CMD_FC_OP_PHY_OP_RECONFIGURE 0x2 -/* enum: PHY reboot handler */ -#define MC_CMD_FC_OP_PHY_OP_REBOOT 0x3 -/* enum: PHY get_supported_cap handler */ -#define MC_CMD_FC_OP_PHY_OP_GET_SUPPORTED_CAP 0x4 -/* enum: PHY get_config handler */ -#define MC_CMD_FC_OP_PHY_OP_GET_CONFIG 0x5 -/* enum: PHY get_media_info handler */ -#define MC_CMD_FC_OP_PHY_OP_GET_MEDIA_INFO 0x6 -/* enum: PHY set_led handler */ -#define MC_CMD_FC_OP_PHY_OP_SET_LED 0x7 -/* enum: PHY lasi_interrupt handler */ -#define MC_CMD_FC_OP_PHY_OP_LASI_INTERRUPT 0x8 -/* enum: PHY check_link handler */ -#define MC_CMD_FC_OP_PHY_OP_CHECK_LINK 0x9 -/* enum: PHY fill_stats handler */ -#define MC_CMD_FC_OP_PHY_OP_FILL_STATS 0xa -/* enum: PHY bpx_link_state_changed handler */ -#define MC_CMD_FC_OP_PHY_OP_BPX_LINK_STATE_CHANGED 0xb -/* enum: PHY get_state handler */ -#define MC_CMD_FC_OP_PHY_OP_GET_STATE 0xc -/* enum: PHY start_bist handler */ -#define MC_CMD_FC_OP_PHY_OP_START_BIST 0xd -/* enum: PHY poll_bist handler */ -#define MC_CMD_FC_OP_PHY_OP_POLL_BIST 0xe -/* enum: PHY nvram_test handler */ -#define MC_CMD_FC_OP_PHY_OP_NVRAM_TEST 0xf -/* enum: PHY relinquish handler */ -#define MC_CMD_FC_OP_PHY_OP_RELINQUISH_SPI 0x10 -/* enum: PHY read connection from FC - may be not required */ -#define MC_CMD_FC_OP_PHY_OP_GET_CONNECTION 0x11 -/* enum: PHY read flags from FC - may be not required */ -#define MC_CMD_FC_OP_PHY_OP_GET_FLAGS 0x12 - -/* MC_CMD_FC_IN_PHY_INIT msgrequest */ -#define MC_CMD_FC_IN_PHY_INIT_LEN 4 -#define MC_CMD_FC_IN_PHY_CMD_OFST 0 - -/* MC_CMD_FC_IN_MAC msgrequest */ -#define MC_CMD_FC_IN_MAC_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_MAC_HEADER_OFST 4 -#define MC_CMD_FC_IN_MAC_OP_LBN 0 -#define MC_CMD_FC_IN_MAC_OP_WIDTH 8 -/* enum: MAC reconfigure handler */ -#define MC_CMD_FC_OP_MAC_OP_RECONFIGURE 0x1 -/* enum: MAC Set command - same as MC_CMD_SET_MAC */ -#define MC_CMD_FC_OP_MAC_OP_SET_LINK 0x2 -/* enum: MAC statistics */ -#define MC_CMD_FC_OP_MAC_OP_GET_STATS 0x3 -/* enum: MAC RX statistics */ -#define MC_CMD_FC_OP_MAC_OP_GET_RX_STATS 0x6 -/* enum: MAC TX statistics */ -#define MC_CMD_FC_OP_MAC_OP_GET_TX_STATS 0x7 -/* enum: MAC Read status */ -#define MC_CMD_FC_OP_MAC_OP_READ_STATUS 0x8 -#define MC_CMD_FC_IN_MAC_PORT_TYPE_LBN 8 -#define MC_CMD_FC_IN_MAC_PORT_TYPE_WIDTH 8 -/* enum: External FPGA port. */ -#define MC_CMD_FC_PORT_EXT 0x0 -/* enum: Internal Siena-facing FPGA ports. */ -#define MC_CMD_FC_PORT_INT 0x1 -#define MC_CMD_FC_IN_MAC_PORT_IDX_LBN 16 -#define MC_CMD_FC_IN_MAC_PORT_IDX_WIDTH 8 -#define MC_CMD_FC_IN_MAC_CMD_FORMAT_LBN 24 -#define MC_CMD_FC_IN_MAC_CMD_FORMAT_WIDTH 8 -/* enum: Default FC command format; the fields PORT_TYPE and PORT_IDX are - * irrelevant. Port number is derived from pci_fn; passed in FC header. - */ -#define MC_CMD_FC_OP_MAC_CMD_FORMAT_DEFAULT 0x0 -/* enum: Override default port number. Port number determined by fields - * PORT_TYPE and PORT_IDX. - */ -#define MC_CMD_FC_OP_MAC_CMD_FORMAT_PORT_OVERRIDE 0x1 - -/* MC_CMD_FC_IN_MAC_RECONFIGURE msgrequest */ -#define MC_CMD_FC_IN_MAC_RECONFIGURE_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ - -/* MC_CMD_FC_IN_MAC_SET_LINK msgrequest */ -#define MC_CMD_FC_IN_MAC_SET_LINK_LEN 32 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ -/* MTU size */ -#define MC_CMD_FC_IN_MAC_SET_LINK_MTU_OFST 8 -/* Drain Tx FIFO */ -#define MC_CMD_FC_IN_MAC_SET_LINK_DRAIN_OFST 12 -#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_OFST 16 -#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_LEN 8 -#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_LO_OFST 16 -#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_HI_OFST 20 -#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_OFST 24 -#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_UNICAST_LBN 0 -#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_UNICAST_WIDTH 1 -#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_BRDCAST_LBN 1 -#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_BRDCAST_WIDTH 1 -#define MC_CMD_FC_IN_MAC_SET_LINK_FCNTL_OFST 28 - -/* MC_CMD_FC_IN_MAC_READ_STATUS msgrequest */ -#define MC_CMD_FC_IN_MAC_READ_STATUS_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ - -/* MC_CMD_FC_IN_MAC_GET_RX_STATS msgrequest */ -#define MC_CMD_FC_IN_MAC_GET_RX_STATS_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ - -/* MC_CMD_FC_IN_MAC_GET_TX_STATS msgrequest */ -#define MC_CMD_FC_IN_MAC_GET_TX_STATS_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ - -/* MC_CMD_FC_IN_MAC_GET_STATS msgrequest */ -#define MC_CMD_FC_IN_MAC_GET_STATS_LEN 20 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ -/* MC Statistics index */ -#define MC_CMD_FC_IN_MAC_GET_STATS_STATS_INDEX_OFST 8 -#define MC_CMD_FC_IN_MAC_GET_STATS_FLAGS_OFST 12 -#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_ALL_LBN 0 -#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_ALL_WIDTH 1 -#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_LBN 1 -#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_WIDTH 1 -#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_LBN 2 -#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_WIDTH 1 -/* Number of statistics to read */ -#define MC_CMD_FC_IN_MAC_GET_STATS_NUM_OFST 16 -#define MC_CMD_FC_MAC_NSTATS_PER_BLOCK 0x1e /* enum */ -#define MC_CMD_FC_MAC_NBYTES_PER_STAT 0x8 /* enum */ - -/* MC_CMD_FC_IN_READ32 msgrequest */ -#define MC_CMD_FC_IN_READ32_LEN 16 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_READ32_ADDR_HI_OFST 4 -#define MC_CMD_FC_IN_READ32_ADDR_LO_OFST 8 -#define MC_CMD_FC_IN_READ32_NUMWORDS_OFST 12 - -/* MC_CMD_FC_IN_WRITE32 msgrequest */ -#define MC_CMD_FC_IN_WRITE32_LENMIN 16 -#define MC_CMD_FC_IN_WRITE32_LENMAX 252 -#define MC_CMD_FC_IN_WRITE32_LEN(num) (12+4*(num)) -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_WRITE32_ADDR_HI_OFST 4 -#define MC_CMD_FC_IN_WRITE32_ADDR_LO_OFST 8 -#define MC_CMD_FC_IN_WRITE32_BUFFER_OFST 12 -#define MC_CMD_FC_IN_WRITE32_BUFFER_LEN 4 -#define MC_CMD_FC_IN_WRITE32_BUFFER_MINNUM 1 -#define MC_CMD_FC_IN_WRITE32_BUFFER_MAXNUM 60 - -/* MC_CMD_FC_IN_TRC_READ msgrequest */ -#define MC_CMD_FC_IN_TRC_READ_LEN 12 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_TRC_READ_TRC_OFST 4 -#define MC_CMD_FC_IN_TRC_READ_CHANNEL_OFST 8 - -/* MC_CMD_FC_IN_TRC_WRITE msgrequest */ -#define MC_CMD_FC_IN_TRC_WRITE_LEN 28 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_TRC_WRITE_TRC_OFST 4 -#define MC_CMD_FC_IN_TRC_WRITE_CHANNEL_OFST 8 -#define MC_CMD_FC_IN_TRC_WRITE_DATA_OFST 12 -#define MC_CMD_FC_IN_TRC_WRITE_DATA_LEN 4 -#define MC_CMD_FC_IN_TRC_WRITE_DATA_NUM 4 - -/* MC_CMD_FC_IN_GET_VERSION msgrequest */ -#define MC_CMD_FC_IN_GET_VERSION_LEN 4 -/* MC_CMD_FC_IN_CMD_OFST 0 */ - -/* MC_CMD_FC_IN_TRC_RX_READ msgrequest */ -#define MC_CMD_FC_IN_TRC_RX_READ_LEN 12 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_TRC_RX_READ_TRC_OFST 4 -#define MC_CMD_FC_IN_TRC_RX_READ_CHANNEL_OFST 8 - -/* MC_CMD_FC_IN_TRC_RX_WRITE msgrequest */ -#define MC_CMD_FC_IN_TRC_RX_WRITE_LEN 20 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_TRC_RX_WRITE_TRC_OFST 4 -#define MC_CMD_FC_IN_TRC_RX_WRITE_CHANNEL_OFST 8 -#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_OFST 12 -#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_LEN 4 -#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_NUM 2 - -/* MC_CMD_FC_IN_SFP msgrequest */ -#define MC_CMD_FC_IN_SFP_LEN 28 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* Link speed is 100, 1000, 10000, 40000 */ -#define MC_CMD_FC_IN_SFP_SPEED_OFST 4 -/* Length of copper cable - zero when not relevant (e.g. if cable is fibre) */ -#define MC_CMD_FC_IN_SFP_COPPER_LEN_OFST 8 -/* Not relevant for cards with QSFP modules. For older cards, true if module is - * a dual speed SFP+ module. - */ -#define MC_CMD_FC_IN_SFP_DUAL_SPEED_OFST 12 -/* True if an SFP Module is present (other fields valid when true) */ -#define MC_CMD_FC_IN_SFP_PRESENT_OFST 16 -/* The type of the SFP+ Module. For later cards with QSFP modules, this field - * is unused and the type is communicated by other means. - */ -#define MC_CMD_FC_IN_SFP_TYPE_OFST 20 -/* Capabilities corresponding to 1 bits. */ -#define MC_CMD_FC_IN_SFP_CAPS_OFST 24 - -/* MC_CMD_FC_IN_DDR_TEST msgrequest */ -#define MC_CMD_FC_IN_DDR_TEST_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 -#define MC_CMD_FC_IN_DDR_TEST_OP_LBN 0 -#define MC_CMD_FC_IN_DDR_TEST_OP_WIDTH 8 -/* enum: DRAM Test Start */ -#define MC_CMD_FC_OP_DDR_TEST_START 0x1 -/* enum: DRAM Test Poll */ -#define MC_CMD_FC_OP_DDR_TEST_POLL 0x2 - -/* MC_CMD_FC_IN_DDR_TEST_START msgrequest */ -#define MC_CMD_FC_IN_DDR_TEST_START_LEN 12 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 */ -#define MC_CMD_FC_IN_DDR_TEST_START_MASK_OFST 8 -#define MC_CMD_FC_IN_DDR_TEST_START_T0_LBN 0 -#define MC_CMD_FC_IN_DDR_TEST_START_T0_WIDTH 1 -#define MC_CMD_FC_IN_DDR_TEST_START_T1_LBN 1 -#define MC_CMD_FC_IN_DDR_TEST_START_T1_WIDTH 1 -#define MC_CMD_FC_IN_DDR_TEST_START_B0_LBN 2 -#define MC_CMD_FC_IN_DDR_TEST_START_B0_WIDTH 1 -#define MC_CMD_FC_IN_DDR_TEST_START_B1_LBN 3 -#define MC_CMD_FC_IN_DDR_TEST_START_B1_WIDTH 1 - -/* MC_CMD_FC_IN_DDR_TEST_POLL msgrequest */ -#define MC_CMD_FC_IN_DDR_TEST_POLL_LEN 12 -#define MC_CMD_FC_IN_DDR_TEST_CMD_OFST 0 -/* MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 */ -/* Clear previous test result and prepare for restarting DDR test */ -#define MC_CMD_FC_IN_DDR_TEST_POLL_CLEAR_RESULT_FOR_DDR_TEST_OFST 8 - -/* MC_CMD_FC_IN_GET_ASSERT msgrequest */ -#define MC_CMD_FC_IN_GET_ASSERT_LEN 4 -/* MC_CMD_FC_IN_CMD_OFST 0 */ - -/* MC_CMD_FC_IN_FPGA_BUILD msgrequest */ -#define MC_CMD_FC_IN_FPGA_BUILD_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* FPGA build info operation code */ -#define MC_CMD_FC_IN_FPGA_BUILD_OP_OFST 4 -/* enum: Get the build registers */ -#define MC_CMD_FC_IN_FPGA_BUILD_BUILD 0x1 -/* enum: Get the services registers */ -#define MC_CMD_FC_IN_FPGA_BUILD_SERVICES 0x2 -/* enum: Get the BSP version */ -#define MC_CMD_FC_IN_FPGA_BUILD_BSP_VERSION 0x3 -/* enum: Get build register for V2 (SFA974X) */ -#define MC_CMD_FC_IN_FPGA_BUILD_BUILD_V2 0x4 -/* enum: GEt the services register for V2 (SFA974X) */ -#define MC_CMD_FC_IN_FPGA_BUILD_SERVICES_V2 0x5 - -/* MC_CMD_FC_IN_READ_MAP msgrequest */ -#define MC_CMD_FC_IN_READ_MAP_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -#define MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 -#define MC_CMD_FC_IN_READ_MAP_OP_LBN 0 -#define MC_CMD_FC_IN_READ_MAP_OP_WIDTH 8 -/* enum: Get the number of map regions */ -#define MC_CMD_FC_OP_READ_MAP_COUNT 0x1 -/* enum: Get the specified map */ -#define MC_CMD_FC_OP_READ_MAP_INDEX 0x2 - -/* MC_CMD_FC_IN_READ_MAP_COUNT msgrequest */ -#define MC_CMD_FC_IN_READ_MAP_COUNT_LEN 8 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 */ - -/* MC_CMD_FC_IN_READ_MAP_INDEX msgrequest */ -#define MC_CMD_FC_IN_READ_MAP_INDEX_LEN 12 -/* MC_CMD_FC_IN_CMD_OFST 0 */ -/* MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 26 07:30:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6736A115036B; Mon, 26 Nov 2018 07:30:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B9408B264; Mon, 26 Nov 2018 07:30:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0DE99B2; Mon, 26 Nov 2018 07:30:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQ7Ul9A001562; Mon, 26 Nov 2018 07:30:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQ7UlXV001561; Mon, 26 Nov 2018 07:30:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811260730.wAQ7UlXV001561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 26 Nov 2018 07:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340931 - in head: . sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head: . sys/dev/sfxge/common X-SVN-Commit-Revision: 340931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B9408B264 X-Spamd-Result: default: False [1.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.461,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 07:30:48 -0000 Author: arybchik Date: Mon Nov 26 07:30:47 2018 New Revision: 340931 URL: https://svnweb.freebsd.org/changeset/base/340931 Log: sfxge(4): fix incorrectly set svn properties File name was used by the svn property value since real value was lost in the command. Modified: head/.gitattributes Directory Properties: head/sys/dev/sfxge/common/efx_regs_mcdi_aoe.h (props changed) Modified: head/.gitattributes ============================================================================== --- head/.gitattributes Mon Nov 26 07:23:02 2018 (r340930) +++ head/.gitattributes Mon Nov 26 07:30:47 2018 (r340931) @@ -3,5 +3,3 @@ *.cpp diff=cpp *.hpp diff=cpp *.py diff=python -. svn-properties=svn:mime-type=sys/dev/sfxge/common/efx_regs_mcdi_aoe.h -. svn-properties=svn:eol-style=sys/dev/sfxge/common/efx_regs_mcdi_aoe.h From owner-svn-src-head@freebsd.org Mon Nov 26 07:42:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5339011506A9; Mon, 26 Nov 2018 07:42:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E95348B8DC; Mon, 26 Nov 2018 07:42:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABE46BD6; Mon, 26 Nov 2018 07:42:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQ7gqjU011429; Mon, 26 Nov 2018 07:42:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQ7gqmV011427; Mon, 26 Nov 2018 07:42:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811260742.wAQ7gqmV011427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 26 Nov 2018 07:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340932 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E95348B8DC X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.64)[0.638,0]; NEURAL_SPAM_SHORT(0.37)[0.375,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 07:42:53 -0000 Author: arybchik Date: Mon Nov 26 07:42:52 2018 New Revision: 340932 URL: https://svnweb.freebsd.org/changeset/base/340932 Log: sfxge(4): add 3.3V and 12.0V current sensors Automatically generated using mkconfig.py. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18138 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon Nov 26 07:30:47 2018 (r340931) +++ head/sys/dev/sfxge/common/efx.h Mon Nov 26 07:42:52 2018 (r340932) @@ -631,7 +631,7 @@ efx_mon_init( #define EFX_MON_STATS_PAGE_SIZE 0x100 #define EFX_MON_MASK_ELEMENT_SIZE 32 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock aa0233c80156308e */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock fcc1b6748432e1ac */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -712,6 +712,8 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_BOARD_BACK_TEMP, EFX_MON_STAT_I1V8, EFX_MON_STAT_I2V5, + EFX_MON_STAT_I3V3, + EFX_MON_STAT_I12V0, EFX_MON_NSTATS } efx_mon_stat_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Mon Nov 26 07:30:47 2018 (r340931) +++ head/sys/dev/sfxge/common/efx_mon.c Mon Nov 26 07:42:52 2018 (r340932) @@ -128,7 +128,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock d92af1538001301f */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock a808884b01444549 */ static const char * const __mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -209,6 +209,8 @@ static const char * const __mon_stat_name[] = { "board_back_temp", "i1v8", "i2v5", + "i3v3", + "i12v0", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ From owner-svn-src-head@freebsd.org Mon Nov 26 08:16:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0356115116D; Mon, 26 Nov 2018 08:16:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 613288C783; Mon, 26 Nov 2018 08:16:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4211610C5; Mon, 26 Nov 2018 08:16:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQ8GY4l027088; Mon, 26 Nov 2018 08:16:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQ8GXpk027081; Mon, 26 Nov 2018 08:16:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201811260816.wAQ8GXpk027081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 26 Nov 2018 08:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340933 - head/lib/libedit X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/lib/libedit X-SVN-Commit-Revision: 340933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 613288C783 X-Spamd-Result: default: False [1.72 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.406,0]; NEURAL_SPAM_MEDIUM(0.66)[0.657,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 08:16:35 -0000 Author: bapt Date: Mon Nov 26 08:16:33 2018 New Revision: 340933 URL: https://svnweb.freebsd.org/changeset/base/340933 Log: libedit: improve multibyte support Until this commit libedit only supported UTF-8 for multibyte charset Improve it to support other multibyte charsets Tested with eucJP and SJIS charsets. Note that this change as been review and committed in upstream libedit as well via christos@NetBSD Submitted by: naito.yuichiro _at_ gmail.com Reviewed by: bapt, pfg, yuripv, 0mp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17903 Modified: head/lib/libedit/chartype.c head/lib/libedit/chartype.h head/lib/libedit/el.c head/lib/libedit/el.h head/lib/libedit/read.c Modified: head/lib/libedit/chartype.c ============================================================================== --- head/lib/libedit/chartype.c Mon Nov 26 07:42:52 2018 (r340932) +++ head/lib/libedit/chartype.c Mon Nov 26 08:16:33 2018 (r340933) @@ -37,6 +37,7 @@ __RCSID("$NetBSD: chartype.c,v 1.23 2016/02/28 23:02:2 __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -182,17 +183,13 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer protected size_t ct_enc_width(Char c) { - /* UTF-8 encoding specific values */ - if (c < 0x80) - return 1; - else if (c < 0x0800) - return 2; - else if (c < 0x10000) - return 3; - else if (c < 0x110000) - return 4; - else - return 0; /* not a valid codepoint */ + mbstate_t ps = (mbstate_t){{0}}; + size_t len; + char cbuf[MB_LEN_MAX]; + len = ct_wcrtomb(cbuf, c, &ps); + if (len == (size_t)-1) + return (0); + return (len); } protected ssize_t Modified: head/lib/libedit/chartype.h ============================================================================== --- head/lib/libedit/chartype.h Mon Nov 26 07:42:52 2018 (r340932) +++ head/lib/libedit/chartype.h Mon Nov 26 08:16:33 2018 (r340933) @@ -56,6 +56,7 @@ #define ct_wctob wctob #define ct_wctomb wctomb +#define ct_wcrtomb wcrtomb #define ct_wctomb_reset wctomb(0,0) #define ct_wcstombs wcstombs #define ct_mbstowcs mbstowcs @@ -109,6 +110,7 @@ Width(wchar_t c) #define ct_wctob(w) ((int)(w)) #define ct_wctomb error +#define ct_wcrtomb error #define ct_wctomb_reset #define ct_wcstombs(a, b, c) (strncpy(a, b, c), strlen(a)) #define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a)) Modified: head/lib/libedit/el.c ============================================================================== --- head/lib/libedit/el.c Mon Nov 26 07:42:52 2018 (r340932) +++ head/lib/libedit/el.c Mon Nov 26 08:16:33 2018 (r340933) @@ -99,10 +99,6 @@ el_init_fd(const char *prog, FILE *fin, FILE *fout, FI * Initialize all the modules. Order is important!!! */ el->el_flags = 0; - if (setlocale(LC_CTYPE, NULL) != NULL){ - if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) - el->el_flags |= CHARSET_IS_UTF8; - } if (terminal_init(el) == -1) { el_free(el->el_prog); @@ -293,7 +289,7 @@ FUN(el,set)(EditLine *el, int op, ...) void *ptr = va_arg(ap, void *); rv = hist_set(el, func, ptr); - if (!(el->el_flags & CHARSET_IS_UTF8)) + if (MB_CUR_MAX == 1) el->el_flags &= ~NARROW_HISTORY; break; } Modified: head/lib/libedit/el.h ============================================================================== --- head/lib/libedit/el.h Mon Nov 26 07:42:52 2018 (r340932) +++ head/lib/libedit/el.h Mon Nov 26 08:16:33 2018 (r340933) @@ -56,7 +56,6 @@ #define NO_TTY 0x02 #define EDIT_DISABLED 0x04 #define UNBUFFERED 0x08 -#define CHARSET_IS_UTF8 0x10 #define NARROW_HISTORY 0x40 typedef unsigned char el_action_t; /* Index to command array */ Modified: head/lib/libedit/read.c ============================================================================== --- head/lib/libedit/read.c Mon Nov 26 07:42:52 2018 (r340932) +++ head/lib/libedit/read.c Mon Nov 26 08:16:33 2018 (r340933) @@ -363,13 +363,7 @@ read_char(EditLine *el, wchar_t *cp) goto again; } case (size_t)-2: - /* - * We don't support other multibyte charsets. - * The second condition shouldn't happen - * and is here merely for additional safety. - */ - if ((el->el_flags & CHARSET_IS_UTF8) == 0 || - cbp >= MB_LEN_MAX) { + if (cbp >= MB_LEN_MAX) { errno = EILSEQ; *cp = L'\0'; return -1; From owner-svn-src-head@freebsd.org Mon Nov 26 11:04:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFDE7115503A; Mon, 26 Nov 2018 11:04:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFCC6C444; Mon, 26 Nov 2018 11:04:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EDD92CD8; Mon, 26 Nov 2018 11:04:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQB4aCj015463; Mon, 26 Nov 2018 11:04:36 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQB4ZLL015459; Mon, 26 Nov 2018 11:04:35 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201811261104.wAQB4ZLL015459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 26 Nov 2018 11:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340939 - in head/contrib/libarchive/libarchive: . test X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head/contrib/libarchive/libarchive: . test X-SVN-Commit-Revision: 340939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DFCC6C444 X-Spamd-Result: default: False [1.08 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.27)[-0.272,0]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.68)[0.676,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 11:04:37 -0000 Author: mm Date: Mon Nov 26 11:04:35 2018 New Revision: 340939 URL: https://svnweb.freebsd.org/changeset/base/340939 Log: MFV r340938: Sync libarchive with vendor. Relevant vendor changes: Issue #1096: Support extracting ACLs with in-entry comments (GNU tar) PR #1023: Support extracting extattrs as non-root on non-user-writeable files MFC after: 1 week Modified: head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Mon Nov 26 11:01:51 2018 (r340938) +++ head/contrib/libarchive/libarchive/archive_acl.c Mon Nov 26 11:04:35 2018 (r340939) @@ -1585,18 +1585,30 @@ next_field_w(const wchar_t **wp, const wchar_t **start /* Scan for the separator. */ while (**wp != L'\0' && **wp != L',' && **wp != L':' && - **wp != L'\n') { + **wp != L'\n' && **wp != L'#') { (*wp)++; } *sep = **wp; - /* Trim trailing whitespace to locate end of field. */ - *end = *wp - 1; - while (**end == L' ' || **end == L'\t' || **end == L'\n') { - (*end)--; + /* Locate end of field, trim trailing whitespace if necessary */ + if (*wp == *start) { + *end = *wp; + } else { + *end = *wp - 1; + while (**end == L' ' || **end == L'\t' || **end == L'\n') { + (*end)--; + } + (*end)++; } - (*end)++; + /* Handle in-field comments */ + if (*sep == L'#') { + while (**wp != L'\0' && **wp != L',' && **wp != L'\n') { + (*wp)++; + } + *sep = **wp; + } + /* Adjust scanner location. */ if (**wp != L'\0') (*wp)++; @@ -1646,7 +1658,7 @@ archive_acl_from_text_l(struct archive_acl *acl, const ret = ARCHIVE_OK; types = 0; - while (text != NULL && *text != '\0') { + while (text != NULL && *text != '\0') { /* * Parse the fields out of the next entry, * advance 'text' to start of next entry. @@ -2057,23 +2069,30 @@ next_field(const char **p, const char **start, *start = *p; /* Scan for the separator. */ - while (**p != '\0' && **p != ',' && **p != ':' && **p != '\n') { + while (**p != '\0' && **p != ',' && **p != ':' && **p != '\n' && + **p != '#') { (*p)++; } *sep = **p; - /* If the field is only whitespace, bail out now. */ - if (**p == '\0') { + /* Locate end of field, trim trailing whitespace if necessary */ + if (*p == *start) { *end = *p; - return; + } else { + *end = *p - 1; + while (**end == ' ' || **end == '\t' || **end == '\n') { + (*end)--; + } + (*end)++; } - /* Trim trailing whitespace to locate end of field. */ - *end = *p - 1; - while (**end == ' ' || **end == '\t' || **end == '\n') { - (*end)--; + /* Handle in-field comments */ + if (*sep == '#') { + while (**p != '\0' && **p != ',' && **p != '\n') { + (*p)++; + } + *sep = **p; } - (*end)++; /* Adjust scanner location. */ if (**p != '\0') Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Mon Nov 26 11:01:51 2018 (r340938) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Mon Nov 26 11:04:35 2018 (r340939) @@ -1705,6 +1705,20 @@ _archive_write_disk_finish_entry(struct archive *_a) } /* + * HYPOTHESIS: + * If we're not root, we won't be setting any security + * attributes that may be wiped by the set_mode() routine + * below. We also can't set xattr on non-owner-writable files, + * which may be the state after set_mode(). Perform + * set_xattrs() first based on these constraints. + */ + if (a->user_uid != 0 && + (a->todo & TODO_XATTR)) { + int r2 = set_xattrs(a); + if (r2 < ret) ret = r2; + } + + /* * set_mode must precede ACLs on systems such as Solaris and * FreeBSD where setting the mode implicitly clears extended ACLs */ @@ -1717,8 +1731,10 @@ _archive_write_disk_finish_entry(struct archive *_a) * Security-related extended attributes (such as * security.capability on Linux) have to be restored last, * since they're implicitly removed by other file changes. + * We do this last only when root. */ - if (a->todo & TODO_XATTR) { + if (a->user_uid == 0 && + (a->todo & TODO_XATTR)) { int r2 = set_xattrs(a); if (r2 < ret) ret = r2; } @@ -2222,6 +2238,15 @@ create_filesystem_object(struct archive_write_disk *a) * security, so we never restore them at this point. */ mode = final_mode & 0777 & ~a->user_umask; + + /* + * Always create writable such that [f]setxattr() works if we're not + * root. + */ + if (a->user_uid != 0 && + a->todo & (TODO_HFS_COMPRESSION | TODO_XATTR)) { + mode |= 0200; + } switch (a->mode & AE_IFMT) { default: Modified: head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c Mon Nov 26 11:01:51 2018 (r340938) +++ head/contrib/libarchive/libarchive/test/test_extattr_freebsd.c Mon Nov 26 11:04:35 2018 (r340939) @@ -49,7 +49,6 @@ DEFINE_TEST(test_extattr_freebsd) struct archive_entry *ae; ssize_t n; int fd; - int extattr_privilege_bug = 0; /* * First, do a quick manual set/read of an extended attribute @@ -73,24 +72,6 @@ DEFINE_TEST(test_extattr_freebsd) assertEqualInt(4, n); close(fd); - /* - * Repeat the above, but with file permissions set to 0000. - * This should work (extattr_set_fd() should follow fd - * permissions, not file permissions), but is known broken on - * some versions of FreeBSD. - */ - fd = open("pretest2", O_RDWR | O_CREAT, 00000); - failure("Could not create test file?!"); - if (!assert(fd >= 0)) - return; - - n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, "testattr", "1234", 4); - if (n != 4) { - skipping("Restoring xattr to an unwritable file seems to be broken on this platform"); - extattr_privilege_bug = 1; - } - close(fd); - /* Create a write-to-disk object. */ assert(NULL != (a = archive_write_disk_new())); archive_write_disk_set_options(a, @@ -120,16 +101,12 @@ DEFINE_TEST(test_extattr_freebsd) archive_entry_free(ae); /* Close the archive. */ - if (extattr_privilege_bug) - /* If the bug is here, write_close will return warning. */ - assertEqualIntA(a, ARCHIVE_WARN, archive_write_close(a)); - else - assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); - assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); /* Verify the data on disk. */ assertEqualInt(0, stat("test0", &st)); assertEqualInt(st.st_mtime, 123456); + assertEqualInt(st.st_mode & 0777, 0755); /* Verify extattr */ n = extattr_get_file("test0", EXTATTR_NAMESPACE_USER, "foo", buff, sizeof(buff)); @@ -141,17 +118,20 @@ DEFINE_TEST(test_extattr_freebsd) /* Verify the data on disk. */ assertEqualInt(0, stat("test1", &st)); assertEqualInt(st.st_mtime, 12345678); + assertEqualInt(st.st_mode & 0777, 0); + /* + * If we are not root, we have to make test1 user readable + * or extattr_get_file() will fail + */ + if (geteuid() != 0) { + chmod("test1", S_IRUSR); + } /* Verify extattr */ n = extattr_get_file("test1", EXTATTR_NAMESPACE_USER, "bar", buff, sizeof(buff)); - if (extattr_privilege_bug) { - /* If we have the bug, the extattr won't have been written. */ - assertEqualInt(n, -1); - } else { - if (assertEqualInt(n, 6)) { - buff[n] = '\0'; - assertEqualString(buff, "123456"); - } + if (assertEqualInt(n, 6)) { + buff[n] = '\0'; + assertEqualString(buff, "123456"); } /* Use libarchive APIs to read the file back into an entry and Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Mon Nov 26 11:01:51 2018 (r340938) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Mon Nov 26 11:04:35 2018 (r340939) @@ -90,7 +90,7 @@ int verify_data(const uint8_t* data_ptr, int magic, in static int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc) { - la_ssize_t fsize, read; + la_ssize_t fsize, bytes_read; uint8_t* buf; int ret = 1; uint32_t computed_crc; @@ -100,9 +100,9 @@ int extract_one(struct archive* a, struct archive_entr if(buf == NULL) return 1; - read = archive_read_data(a, buf, fsize); - if(read != fsize) { - assertEqualInt(read, fsize); + bytes_read = archive_read_data(a, buf, fsize); + if(bytes_read != fsize) { + assertEqualInt(bytes_read, fsize); goto fn_exit; } From owner-svn-src-head@freebsd.org Mon Nov 26 13:42:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7017C1136292; Mon, 26 Nov 2018 13:42:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F6074249; Mon, 26 Nov 2018 13:42:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E743A4BC0; Mon, 26 Nov 2018 13:42:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQDgIV0098543; Mon, 26 Nov 2018 13:42:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQDgIrm098540; Mon, 26 Nov 2018 13:42:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811261342.wAQDgIrm098540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 26 Nov 2018 13:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340968 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11F6074249 X-Spamd-Result: default: False [1.53 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.261,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:42:19 -0000 Author: markj Date: Mon Nov 26 13:42:18 2018 New Revision: 340968 URL: https://svnweb.freebsd.org/changeset/base/340968 Log: Plug routing sysctl leaks. Various structures exported by sysctl_rtsock() contain padding fields which were not being zeroed. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: ae MFC after: 3 days Security: kernel memory disclosure Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18333 Modified: head/sys/net/if.h head/sys/net/route.h head/sys/net/rtsock.c Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Mon Nov 26 13:36:30 2018 (r340967) +++ head/sys/net/if.h Mon Nov 26 13:42:18 2018 (r340968) @@ -271,6 +271,7 @@ struct if_msghdr { int ifm_addrs; /* like rtm_addrs */ int ifm_flags; /* value of if_flags */ u_short ifm_index; /* index for associated ifp */ + u_short _ifm_spare1; struct if_data ifm_data;/* statistics and other data about if */ }; @@ -296,6 +297,7 @@ struct if_msghdrl { u_short _ifm_spare1; /* spare space to grow if_index, see if_var.h */ u_short ifm_len; /* length of if_msghdrl incl. if_data */ u_short ifm_data_off; /* offset of if_data from beginning */ + int _ifm_spare2; struct if_data ifm_data;/* statistics and other data about if */ }; @@ -311,6 +313,7 @@ struct ifa_msghdr { int ifam_addrs; /* like rtm_addrs */ int ifam_flags; /* value of ifa_flags */ u_short ifam_index; /* index for associated ifp */ + u_short _ifam_spare1; int ifam_metric; /* value of ifa_ifp->if_metric */ }; @@ -352,6 +355,7 @@ struct ifma_msghdr { int ifmam_addrs; /* like rtm_addrs */ int ifmam_flags; /* value of ifa_flags */ u_short ifmam_index; /* index for associated ifp */ + u_short _ifmam_spare1; }; /* Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Nov 26 13:36:30 2018 (r340967) +++ head/sys/net/route.h Mon Nov 26 13:42:18 2018 (r340968) @@ -251,6 +251,7 @@ struct rt_msghdr { u_char rtm_version; /* future binary compatibility */ u_char rtm_type; /* message type */ u_short rtm_index; /* index for associated ifp */ + u_short _rtm_spare1; int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ int rtm_addrs; /* bitmask identifying sockaddrs in msg */ pid_t rtm_pid; /* identify sender */ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Nov 26 13:36:30 2018 (r340967) +++ head/sys/net/rtsock.c Mon Nov 26 13:42:18 2018 (r340968) @@ -83,6 +83,7 @@ struct if_msghdr32 { int32_t ifm_addrs; int32_t ifm_flags; uint16_t ifm_index; + uint16_t _ifm_spare1; struct if_data ifm_data; }; @@ -96,6 +97,7 @@ struct if_msghdrl32 { uint16_t _ifm_spare1; uint16_t ifm_len; uint16_t ifm_data_off; + uint32_t _ifm_spare2; struct if_data ifm_data; }; @@ -1219,8 +1221,11 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo dlen = ALIGN(len) - len; if (buflen < dlen) cp = NULL; - else + else { + bzero(cp, dlen); + cp += dlen; buflen -= dlen; + } } len = ALIGN(len); @@ -1577,6 +1582,8 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) if (w->w_req && w->w_tmem) { struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem; + bzero(&rtm->rtm_index, + sizeof(*rtm) - offsetof(struct rt_msghdr, rtm_index)); if (rt->rt_flags & RTF_GWFLAG_COMPAT) rtm->rtm_flags = RTF_GATEWAY | (rt->rt_flags & ~RTF_GWFLAG_COMPAT); @@ -1584,7 +1591,6 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) rtm->rtm_flags = rt->rt_flags; rt_getmetrics(rt, &rtm->rtm_rmx); rtm->rtm_index = rt->rt_ifp->if_index; - rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0; rtm->rtm_addrs = info.rti_addrs; error = SYSCTL_OUT(w->w_req, (caddr_t)rtm, size); return (error); @@ -1612,6 +1618,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, const struct if_ ifm32->_ifm_spare1 = 0; ifm32->ifm_len = sizeof(*ifm32); ifm32->ifm_data_off = offsetof(struct if_msghdrl32, ifm_data); + ifm32->_ifm_spare2 = 0; ifd = &ifm32->ifm_data; } else #endif @@ -1622,6 +1629,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, const struct if_ ifm->_ifm_spare1 = 0; ifm->ifm_len = sizeof(*ifm); ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); + ifm->_ifm_spare2 = 0; ifd = &ifm->ifm_data; } @@ -1647,6 +1655,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, const struct if_d ifm32->ifm_addrs = info->rti_addrs; ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm32->ifm_index = ifp->if_index; + ifm32->_ifm_spare1 = 0; ifd = &ifm32->ifm_data; } else #endif @@ -1654,6 +1663,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, const struct if_d ifm->ifm_addrs = info->rti_addrs; ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_index = ifp->if_index; + ifm->_ifm_spare1 = 0; ifd = &ifm->ifm_data; } @@ -1722,6 +1732,7 @@ sysctl_iflist_ifam(struct ifaddr *ifa, struct rt_addri ifam->ifam_addrs = info->rti_addrs; ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->_ifam_spare1 = 0; ifam->ifam_metric = ifa->ifa_ifp->if_metric; return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); @@ -1833,6 +1844,7 @@ sysctl_ifmalist(int af, struct walkarg *w) ifmam->ifmam_index = ifma->ifma_ifp->if_index; ifmam->ifmam_flags = 0; ifmam->ifmam_addrs = info.rti_addrs; + ifmam->_ifmam_spare1 = 0; error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error != 0) break; From owner-svn-src-head@freebsd.org Mon Nov 26 13:56:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31B7E1136960; Mon, 26 Nov 2018 13:56:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDEDF7493F; Mon, 26 Nov 2018 13:56:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB4384D79; Mon, 26 Nov 2018 13:56:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQDuJex004303; Mon, 26 Nov 2018 13:56:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQDuJ0E004302; Mon, 26 Nov 2018 13:56:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261356.wAQDuJ0E004302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 13:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340969 - head/lib/libc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc X-SVN-Commit-Revision: 340969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDEDF7493F X-Spamd-Result: default: False [1.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.228,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:56:20 -0000 Author: emaste Date: Mon Nov 26 13:56:19 2018 New Revision: 340969 URL: https://svnweb.freebsd.org/changeset/base/340969 Log: revert r340640 "libc: forcibly disable BIND_NOW" When immediate bind mode is requested, as of r340675 rtld processes irelocs in PLT immediately after other PLT relocs. That addresses the libc + BIND_NOW startup crash the workaround is no longer needed. PR: 233333 Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon Nov 26 13:42:18 2018 (r340968) +++ head/lib/libc/Makefile Mon Nov 26 13:56:19 2018 (r340969) @@ -6,8 +6,6 @@ SHLIBDIR?= /lib .include -# BIND_NOW in libc results in segfault at startup (PR 233333) -MK_BIND_NOW= no # Force building of libc_pic.a MK_TOOLCHAIN= yes From owner-svn-src-head@freebsd.org Mon Nov 26 14:27:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB57C113760E; Mon, 26 Nov 2018 14:27:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71C9475D96; Mon, 26 Nov 2018 14:27:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D37D52C3; Mon, 26 Nov 2018 14:27:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQERE1i019888; Mon, 26 Nov 2018 14:27:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQERE40019887; Mon, 26 Nov 2018 14:27:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811261427.wAQERE40019887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Nov 2018 14:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340971 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 340971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71C9475D96 X-Spamd-Result: default: False [1.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 14:27:15 -0000 Author: manu Date: Mon Nov 26 14:27:13 2018 New Revision: 340971 URL: https://svnweb.freebsd.org/changeset/base/340971 Log: aw_usbphy: Do not error if it's not phy 0 Only phy0 can switch between host/otg, do not error if we request host mode on phy != 0. MFC after: 1 month X-MFC with: r340846 Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Mon Nov 26 14:01:05 2018 (r340970) +++ head/sys/arm/allwinner/aw_usbphy.c Mon Nov 26 14:27:13 2018 (r340971) @@ -389,8 +389,11 @@ awusbphy_set_mode(struct phynode *phynode, int mode) phy = phynode_get_id(phynode); sc = device_get_softc(dev); - if (phy != 0) - return (EINVAL); + if (phy != 0) { + if (mode != PHY_USB_MODE_HOST) + return (EINVAL); + return (0); + } switch (mode) { case PHY_USB_MODE_HOST: From owner-svn-src-head@freebsd.org Mon Nov 26 14:34:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE1191137A59; Mon, 26 Nov 2018 14:34:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD177635C; Mon, 26 Nov 2018 14:34:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F9A85456; Mon, 26 Nov 2018 14:34:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQEYV58025009; Mon, 26 Nov 2018 14:34:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQEYU6R025007; Mon, 26 Nov 2018 14:34:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261434.wAQEYU6R025007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 14:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340972 - head/usr.bin/clang/llvm-objdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/llvm-objdump X-SVN-Commit-Revision: 340972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FD177635C X-Spamd-Result: default: False [1.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; NEURAL_SPAM_SHORT(0.37)[0.375,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 14:34:32 -0000 Author: emaste Date: Mon Nov 26 14:34:30 2018 New Revision: 340972 URL: https://svnweb.freebsd.org/changeset/base/340972 Log: llvm-objdump: initial man page Based on llvm-objdump's online documentation and usage information. This serves as a starting point; additional detail and cleanup still required. Also being submitted upstream in LLVM review D54864. I expect to use this bespoke copy while we have LLVM 6.0 or 7.0 in FreeBSD; when we update to LLVM 8.0 it should be upstream and we will switch to it. PR: 233437 Reviewed by: bcr (man formatting) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18309 Added: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 (contents, props changed) Modified: head/usr.bin/clang/llvm-objdump/Makefile Modified: head/usr.bin/clang/llvm-objdump/Makefile ============================================================================== --- head/usr.bin/clang/llvm-objdump/Makefile Mon Nov 26 14:27:13 2018 (r340971) +++ head/usr.bin/clang/llvm-objdump/Makefile Mon Nov 26 14:34:30 2018 (r340972) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG_CXX= llvm-objdump -MAN= SRCDIR= tools/llvm-objdump SRCS+= COFFDump.cpp Added: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Mon Nov 26 14:34:30 2018 (r340972) @@ -0,0 +1,213 @@ +.\" This file is distributed under the University of Illinois Open Source +.\" License. +.\" +.Dd November 26, 2018 +.Dt LLVM-OBJDUMP 1 +.Os +.Sh NAME +.Nm llvm-objdump +.Nd LLVM object file dumper +.Sh SYNOPSIS +.Nm llvm-objdump +.Op Ar options +.Ar objfile ... +.Sh DESCRIPTION +.Nm +prints the contents of object files and final linked images named on the +command line. +If no file name is specified, +.Nm +will attempt to read from +.Pa a.out . +If +.Pa - +is used as a file name, +.Nm +will process a file on its standard input stream. +.Nm +accepts many of the same command line arguments as GNU objdump. +.Sh OPTIONS +.Ss General Options +.Bl -tag -width indent +.It Fl -aarch64-neon-syntax Ns = Ns Ar value +Choose style of NEON code to emit from AArch64 backend. +.Ar value +may be one of: +.Bl -tag -width indent +.It generic +Generic NEON assembly +.It apple +Apple-style NEON assembly +.El +.It Fl -arch Ns = Ns Ar value +Choose architecture(s) from a Mach-O file to dump +.It Fl -arch-name Ns = Ns ar arch +Target arch to disassemble for. +See +.Fl -version +for available targets. +.It Fl -bind +Display mach-o binding info. +.It Fl -color +Use colored syntax highlighting. +Default autodetect. +.It Fl -disassemble +Display assembler mnemonics for machine instructions. +.It Fl -disassemble-all +Display assembler mnemonics for the machine instruction in all sections. +.It Fl -dsym Ns = Ns Ar file +Use +.Ar file +for debug info. +.It Fl -dwarf Ns = Ns Ar sections +Dump of dwarf debug sections. +.Bl -tag -width indent +.It frames +.Dv .debug_frame +.El +.It Fl -exports-trie +Display mach-o exported symbols. +.It Fl -fault-map-section +Display contents of faultmap section. +.It Fl -filter-print-funcs Ns = Ns Ar functions +Only print IR for functions whose name match +.Ar functions +for all print-[before|after][-all] options. +.It Fl -full-leading-addr +Print full leading address. +.It Fl g +Print line information from debug info if available. +.It Fl h , -headers , -section-headers +Display summaries of the headers for each section. +.It Fl -help +Display available options. +Use +.Fl -help-hidden +for more. +.It Fl -lazy-bind +Display mach-o lazy binding info. +.It Fl -line-numbers +Display source line numbers with disassembly. Implies disassemble object. +.It Fl -macho +Use MachO specific object file parser. +.It Fl -mattr Ns = Ns Ar attribute ... +Target specific attributes. +.It Fl -mcpu Ns = Ns Ar CPU +Target a specific cpu type. +Use +.Fl mcpu Ns = Ns help +for details. +.It Fl -no-leading-addr +Print no leading address. +.It Fl -no-leading-headers +Print no leading headers. +.It Fl -no-show-raw-insn +When disassembling instructions, do not print the instruction bytes. +.It Fl -print-after-all +Print IR after each pass. +.It Fl -print-before-all +Print IR before each pass. +.It Fl -print-imm-hex +Use hex format for immediate values. +.It Fl -private-header +Display only the first format specific file header. +.It Fl -private-headers +Display format specific file headers. +.It Fl r +Display the relocation entries in the file. +.It Fl -raw-clang-ast +Dump the raw binary contents of the clang AST section. +.It Fl -rebase +Display mach-o rebasing info. +.It Fl -reverse-iterate +Reverse iterate. +.It Fl -rng-seed Ns = Ns Ar seed +Seed for the random number generator. +.It Fl s +Display the content of each section. +.It Fl -section Ns = Ns Ar section +Operate on the specified sections only. +With +.Fl -macho +dump segment,section. +.It Fl -source +Display source inline with disassembly. +Implies disassmble object. +.It Fl -start-address Ns = Ns Ar address +Disassemble beginning at +.Ar address . +.It Fl -stats +Enable statistics output from program. +Available with Asserts builds. +.It Fl -stats-json +Display statistics as json data. +.It Fl -stop-address Ns = Ns Ar address +Stop disassembly at +.Ar address . +.It Fl t +Display the symbol table. +.It Fl -time-passes +Time each pass, printing elapsed time for each on exit +.It Fl -triple Ns = Ns Ar triple +Target triple to disassemble for. +See +.Fl -version +for available targets. +.It Fl -unwind-info +Display unwind information. +.It Fl -verify-debug-info +Verify debug info. +.It Fl -verify-dom-info +Verify dominator info (time consuming). +.It Fl -version +Display the version of this program. +.It Fl -weak-bind +Display mach-o weak binding info. +.It Fl -x86-asm-syntax Ns = Ns Ar syntax +Choose style of code to emit from X86 backend. +.Bl -tag -width indent +.It att +Emit AT&T-style assembly. +.It intel +Emit Intel-style assembly. +.El +.El +.Ss Mach-O Options +There are a number of options specific to the Mach-O format. +These are used in combination with the +.Fl -macho +option. +.Bl -tag -width indent +.It Fl -archive-headers +Print archive headers for Mach-O archives. +.It Fl -archive-member-offsets +Print the offset to each archive member for Mach-O archives. +Requires +.Fl -macho +and +.Fl -archive-headers. +.It Fl -data-in-code +Print the data in code table for Mach-O objects. +.It Fl -dis-symname Ns = Ns Ar symbol +Disassemble just +.Ar symbol 's +instructions. +.It Fl -dylib-id +Print the shared library's id for the dylib Mach-O file. +.It Fl -dylibs-used +Print the shared libraries used for linked Mach-O files. +.It Fl -indirect-symbols +Print indirect symbol table for Mach-O objects. +.It Fl -info-plist +Print the info plist section as strings for Mach-O objects. +.It Fl -link-opt-hints +Print the linker optimization hints for Mach-O objects. +.It Fl -no-symbolic-operands +do not symbolic operands when disassembling. +.It Fl -non-verbose +Print the info for Mach-O objects in non-verbose or numeric form. +.It Fl -objc-meta-data +Print the Objective-C runtime meta data for Mach-O files. +.It Fl -universal-headers +Print Mach-O universal headers. +.El From owner-svn-src-head@freebsd.org Mon Nov 26 14:45:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A6211380C8; Mon, 26 Nov 2018 14:45:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5320176CA8; Mon, 26 Nov 2018 14:45:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F7CB5606; Mon, 26 Nov 2018 14:45:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQEjx87029956; Mon, 26 Nov 2018 14:45:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQEjxir029955; Mon, 26 Nov 2018 14:45:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261445.wAQEjxir029955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 14:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340973 - head/usr.bin/clang/llvm-objdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/llvm-objdump X-SVN-Commit-Revision: 340973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5320176CA8 X-Spamd-Result: default: False [1.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 14:46:00 -0000 Author: emaste Date: Mon Nov 26 14:45:58 2018 New Revision: 340973 URL: https://svnweb.freebsd.org/changeset/base/340973 Log: llvm-objdump.1: remove invalid options Some options appear in llvm-objdump's usage information as a side effect of its option parsing implementation and are not actually llvm-objdump options. Reported in LLVM review https://reviews.llvm.org/D54864. Reported by: Fangrui Song Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Modified: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 ============================================================================== --- head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Mon Nov 26 14:34:30 2018 (r340972) +++ head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Mon Nov 26 14:45:58 2018 (r340973) @@ -103,10 +103,6 @@ Print no leading address. Print no leading headers. .It Fl -no-show-raw-insn When disassembling instructions, do not print the instruction bytes. -.It Fl -print-after-all -Print IR after each pass. -.It Fl -print-before-all -Print IR before each pass. .It Fl -print-imm-hex Use hex format for immediate values. .It Fl -private-header @@ -155,10 +151,6 @@ See for available targets. .It Fl -unwind-info Display unwind information. -.It Fl -verify-debug-info -Verify debug info. -.It Fl -verify-dom-info -Verify dominator info (time consuming). .It Fl -version Display the version of this program. .It Fl -weak-bind From owner-svn-src-head@freebsd.org Mon Nov 26 15:11:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B21371139748; Mon, 26 Nov 2018 15:11:33 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5732777E1A; Mon, 26 Nov 2018 15:11:33 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38B5C59B0; Mon, 26 Nov 2018 15:11:33 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQFBXA9041352; Mon, 26 Nov 2018 15:11:33 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQFBXrG041351; Mon, 26 Nov 2018 15:11:33 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811261511.wAQFBXrG041351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Mon, 26 Nov 2018 15:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340974 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 340974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5732777E1A X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.08)[-0.084,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 15:11:33 -0000 Author: yuripv Date: Mon Nov 26 15:11:32 2018 New Revision: 340974 URL: https://svnweb.freebsd.org/changeset/base/340974 Log: bectl: sync usage with man page, removing stray multibyte characters in the process. PR: 233526 Submitted by: tigersharke@gmail.com (original version) Reviewed by: kevans Approved by: kib (mentor, implicit) MFC after: 3 days Differential revision: https://reviews.freebsd.org/D18335 Modified: head/sbin/bectl/bectl.c Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Mon Nov 26 14:45:58 2018 (r340973) +++ head/sbin/bectl/bectl.c Mon Nov 26 15:11:32 2018 (r340974) @@ -66,22 +66,24 @@ usage(bool explicit) FILE *fp; fp = explicit ? stdout : stderr; - fprintf(fp, + fprintf(fp, "%s", "usage:\tbectl {-h | -? | subcommand [args...]}\n" +#if SOON + "\tbectl add (path)*\n" +#endif "\tbectl activate [-t] beName\n" - "\tbectl create [-e {nonActiveBe | -e beName@snapshot}] beName\n" - "\tbectl create beName@snapshot\n" + "\tbectl create [-r] [-e {nonActiveBe | beName@snapshot}] beName\n" + "\tbectl create [-r] beName@snapshot\n" "\tbectl destroy [-F] {beName | beName@snapshot}\n" "\tbectl export sourceBe\n" "\tbectl import targetBe\n" -#if SOON - "\tbectl add (path)*\n" -#endif - "\tbectl jail [{-b | -U}] [{-o key=value | -u key}]... bootenv [utility [argument ...]]\n" - "\tbectl list [-a] [-D] [-H] [-s]\n" + "\tbectl jail {-b | -U} [{-o key=value | -u key}]... " + "{jailID | jailName}\n" + "\t bootenv [utility [argument ...]]\n" + "\tbectl list [-DHas]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" - "\tbectl {ujail | unjail} ⟨jailID | jailName | bootenv)\n" + "\tbectl {ujail | unjail} {jailID | jailName} bootenv\n" "\tbectl {umount | unmount} [-f] beName\n"); return (explicit ? 0 : EX_USAGE); From owner-svn-src-head@freebsd.org Mon Nov 26 15:12:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A577113982E; Mon, 26 Nov 2018 15:12:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99E6978173; Mon, 26 Nov 2018 15:12:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77E795AF1; Mon, 26 Nov 2018 15:12:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQFCwdd045160; Mon, 26 Nov 2018 15:12:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQFCweH045159; Mon, 26 Nov 2018 15:12:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261512.wAQFCweH045159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 15:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340975 - head/usr.bin/clang/llvm-objdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/llvm-objdump X-SVN-Commit-Revision: 340975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99E6978173 X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_HAM_SHORT(-0.08)[-0.084,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 15:12:59 -0000 Author: emaste Date: Mon Nov 26 15:12:58 2018 New Revision: 340975 URL: https://svnweb.freebsd.org/changeset/base/340975 Log: llvm-objdump.1: fix igor / mandoc -Tlint warnings Accidentally omitted from r340972. Modified: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Modified: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 ============================================================================== --- head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Mon Nov 26 15:11:32 2018 (r340974) +++ head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Mon Nov 26 15:12:58 2018 (r340975) @@ -87,7 +87,8 @@ for more. .It Fl -lazy-bind Display mach-o lazy binding info. .It Fl -line-numbers -Display source line numbers with disassembly. Implies disassemble object. +Display source line numbers with disassembly. +Implies disassemble object. .It Fl -macho Use MachO specific object file parser. .It Fl -mattr Ns = Ns Ar attribute ... @@ -177,7 +178,7 @@ Print the offset to each archive member for Mach-O arc Requires .Fl -macho and -.Fl -archive-headers. +.Fl -archive-headers . .It Fl -data-in-code Print the data in code table for Mach-O objects. .It Fl -dis-symname Ns = Ns Ar symbol From owner-svn-src-head@freebsd.org Mon Nov 26 15:33:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC0E41139EB1; Mon, 26 Nov 2018 15:33:56 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EFB579080; Mon, 26 Nov 2018 15:33:56 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F9275E48; Mon, 26 Nov 2018 15:33:56 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQFXuNS055424; Mon, 26 Nov 2018 15:33:56 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQFXu3W055423; Mon, 26 Nov 2018 15:33:56 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811261533.wAQFXu3W055423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Mon, 26 Nov 2018 15:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340976 - head/contrib/nvi/common X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/contrib/nvi/common X-SVN-Commit-Revision: 340976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EFB579080 X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.08)[-0.084,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 15:33:57 -0000 Author: yuripv Date: Mon Nov 26 15:33:55 2018 New Revision: 340976 URL: https://svnweb.freebsd.org/changeset/base/340976 Log: vi: fix UTF-8 detection. PR: 202290 Submitted by: lampa@fit.vutbr.cz Reviewed by: bapt Approved by: kib (mentor, implicit) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17950 Modified: head/contrib/nvi/common/encoding.c Modified: head/contrib/nvi/common/encoding.c ============================================================================== --- head/contrib/nvi/common/encoding.c Mon Nov 26 15:12:58 2018 (r340975) +++ head/contrib/nvi/common/encoding.c Mon Nov 26 15:33:55 2018 (r340976) @@ -96,7 +96,7 @@ looks_utf8(const char *ibuf, size_t nbytes) if (i >= nbytes) goto done; - if (buf[i] & 0x40) /* 10xxxxxx */ + if ((buf[i] & 0xc0) != 0x80) /* 10xxxxxx */ return -1; } From owner-svn-src-head@freebsd.org Mon Nov 26 16:02:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0E4113A86A; Mon, 26 Nov 2018 16:02:18 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C19AD7A0D5; Mon, 26 Nov 2018 16:02:17 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3A676333; Mon, 26 Nov 2018 16:02:17 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQG2HIc068060; Mon, 26 Nov 2018 16:02:17 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQG2HUc068059; Mon, 26 Nov 2018 16:02:17 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261602.wAQG2HUc068059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 16:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340978 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C19AD7A0D5 X-Spamd-Result: default: False [1.50 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; NEURAL_SPAM_SHORT(0.23)[0.234,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 16:02:18 -0000 Author: eugen Date: Mon Nov 26 16:02:17 2018 New Revision: 340978 URL: https://svnweb.freebsd.org/changeset/base/340978 Log: ipfw.8: add new section to EXAMPLES: SELECTIVE MIRRORING If your network has network traffic analyzer connected to your host directly via dedicated interface or remotely via RSPAN vlan, you can selectively mirror some ethernet layer2 frames to the analyzer. ... Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Nov 26 15:46:46 2018 (r340977) +++ head/sbin/ipfw/ipfw.8 Mon Nov 26 16:02:17 2018 (r340978) @@ -4086,6 +4086,55 @@ option could be used to (re)mark user traffic, by adding the following to the appropriate place in ruleset: .Pp .Dl "ipfw add setdscp be ip from any to any dscp af11,af21" +.Ss SELECTIVE MIRRORING +If your network has network traffic analyzer +connected to your host directly via dedicated interface +or remotely via RSPAN vlan, you can selectively mirror +some ethernet layer2 frames to the analyzer. +.Pp +First, make sure your firewall is already configured and runs. +Then, enable layer2 processing if not already enabled: +.Pp +.Dl "sysctl net.link.ether.ipfw=1" +.Pp +Next, load needed additional kernel modules: +.Pp +.Dl "kldload ng_ether ng_ipfw" +.Pp +Optionally, make system load these modules automatically +at startup: +.Pp +.Dl sysrc kld_list+="ng_ether ng_ipfw" +.Pp +Next, configure +.Xr ng_ipfw 4 +kernel module to transmit mirrored copies of layer2 frames +out via vlan900 interface: +.Pp +.Dl "ngctl connect ipfw: vlan900: 1 lower" +.Pp +Think of "1" here as of "mirroring instance index" and vlan900 is its +destination. +You can have arbitrary number of instances. +Refer to +.Xr ng_ipfw 4 +for details. +.Pp +At last, actually start mirroring of selected frames using "instance 1". +For frames incoming from em0 interface: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 in recv em0" +.Pp +For frames outgoing to em0 interface: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 out xmit em0" +.Pp +For both incoming and outgoing frames while flowing through em0: +.Pp +.Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 via em0" +.Pp +Make sure you do not perform mirroring for already duplicated frames +or kernel may hang as there is no safety net here. .Ss DYNAMIC RULES In order to protect a site from flood attacks involving fake TCP packets, it is safer to use dynamic rules: @@ -4524,6 +4573,7 @@ can be changed in a similar way as for .Xr if_bridge 4 , .Xr ip 4 , .Xr ipfirewall 4 , +.Xr ng_ether 4 , .Xr ng_ipfw 4 , .Xr protocols 5 , .Xr services 5 , @@ -4531,6 +4581,7 @@ can be changed in a similar way as for .Xr kldload 8 , .Xr reboot 8 , .Xr sysctl 8 , +.Xr sysrc 8 , .Xr syslogd 8 .Sh HISTORY The From owner-svn-src-head@freebsd.org Mon Nov 26 16:10:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09262113AC6C; Mon, 26 Nov 2018 16:10:21 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A05E47A50D; Mon, 26 Nov 2018 16:10:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 831DF6351; Mon, 26 Nov 2018 16:10:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQGAKaN070984; Mon, 26 Nov 2018 16:10:20 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQGAK1n070983; Mon, 26 Nov 2018 16:10:20 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261610.wAQGAK1n070983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 16:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340979 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A05E47A50D X-Spamd-Result: default: False [1.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.18)[0.179,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 16:10:21 -0000 Author: eugen Date: Mon Nov 26 16:10:20 2018 New Revision: 340979 URL: https://svnweb.freebsd.org/changeset/base/340979 Log: Small language fix after r340978. MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Nov 26 16:02:17 2018 (r340978) +++ head/sbin/ipfw/ipfw.8 Mon Nov 26 16:10:20 2018 (r340979) @@ -4134,7 +4134,7 @@ For both incoming and outgoing frames while flowing th .Dl "ipfw add ngtee 1 ip from any to 192.168.0.1 layer2 via em0" .Pp Make sure you do not perform mirroring for already duplicated frames -or kernel may hang as there is no safety net here. +or kernel may hang as there is no safety net. .Ss DYNAMIC RULES In order to protect a site from flood attacks involving fake TCP packets, it is safer to use dynamic rules: From owner-svn-src-head@freebsd.org Mon Nov 26 16:38:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701EB113BFE7; Mon, 26 Nov 2018 16:38:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15B7E7C033; Mon, 26 Nov 2018 16:38:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D258D6855; Mon, 26 Nov 2018 16:38:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQGcdf6086538; Mon, 26 Nov 2018 16:38:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQGcdPr086536; Mon, 26 Nov 2018 16:38:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811261638.wAQGcdPr086536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Nov 2018 16:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340981 - in head/release: arm64 tools X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/release: arm64 tools X-SVN-Commit-Revision: 340981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15B7E7C033 X-Spamd-Result: default: False [1.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.569,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 16:38:40 -0000 Author: manu Date: Mon Nov 26 16:38:39 2018 New Revision: 340981 URL: https://svnweb.freebsd.org/changeset/base/340981 Log: release: arm64: Add PINEBOOK config Add a configuration for PINEBOOK image. Pinebook is a arm64 laptop based on a Pine64 board. Since the usb trackpad need a quirk, add a common function for adding quirk for arm board. A default one is supplied as most board to not need quirks. Reviewed by: gjb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18337 Added: head/release/arm64/PINEBOOK.conf (contents, props changed) Modified: head/release/tools/arm.subr Added: head/release/arm64/PINEBOOK.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/arm64/PINEBOOK.conf Mon Nov 26 16:38:39 2018 (r340981) @@ -0,0 +1,42 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +EMBEDDED_TARGET_ARCH="aarch64" +EMBEDDED_TARGET="arm64" +EMBEDDEDBUILD=1 +EMBEDDEDPORTS="sysutils/u-boot-pinebook" +FAT_SIZE="54m -b 1m" +FAT_TYPE="16" +IMAGE_SIZE="2560M" +KERNEL="GENERIC" +MD_ARGS="-x 63 -y 255" +NODOC=1 +PART_SCHEME="MBR" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +export BOARDNAME="PINEBOOK" + +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-pinebook" + UBOOT_FILES="u-boot-sunxi-with-spl.bin" + chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + of=/dev/${mddev} bs=1k seek=8 conv=sync + + return 0 +} + +arm_do_quirk() { + echo '# Enable quirk for trackpad' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'usb_quirk_load=YES' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'ums_load=YES' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'hw.usb.quirk="0x258a 0x000c 0x0000 0xffff UQ_CFG_INDEX=1"' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + # We want EFIFB but there is no node and so we cannot know + # which regulator is used for powering lcd/hdmi + echo 'hw.regulator.disable_unused=0' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf +} Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Nov 26 16:36:38 2018 (r340980) +++ head/release/tools/arm.subr Mon Nov 26 16:38:39 2018 (r340981) @@ -174,6 +174,7 @@ arm_install_base() { arm64_setup_multicons arm_setup_fdt_overlays arm_setup_minimal_loader + arm_do_quirk echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab @@ -237,4 +238,8 @@ arm_install_uboot() { # Override in the arm/KERNEL.conf file. return 0 +} + +arm_do_quirk() { + # Override in the arm{,64}/BOARD.conf file. } From owner-svn-src-head@freebsd.org Mon Nov 26 17:00:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4700113C7D0; Mon, 26 Nov 2018 17:00:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 561CD7CD07; Mon, 26 Nov 2018 17:00:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 372686BB4; Mon, 26 Nov 2018 17:00:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQH0eCX097326; Mon, 26 Nov 2018 17:00:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQH0eaJ097325; Mon, 26 Nov 2018 17:00:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811261700.wAQH0eaJ097325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 26 Nov 2018 17:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340983 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 340983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 561CD7CD07 X-Spamd-Result: default: False [1.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.55)[0.551,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 17:00:40 -0000 Author: gjb Date: Mon Nov 26 17:00:39 2018 New Revision: 340983 URL: https://svnweb.freebsd.org/changeset/base/340983 Log: Fix NTP query on GCE due to unresolved hostname. PR: 232456 Submitted by: Lucas Kanashiro MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Mon Nov 26 16:54:16 2018 (r340982) +++ head/release/tools/gce.conf Mon Nov 26 17:00:39 2018 (r340983) @@ -49,7 +49,7 @@ aesni_load="YES" nvme_load="YES" EOF - echo '169.254.169.254 metadata.google.internal metadata' > \ + echo '169.254.169.254 metadata.google.internal metadata' >> \ ${DESTDIR}/etc/hosts # overwrite ntp.conf From owner-svn-src-head@freebsd.org Mon Nov 26 17:07:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2777F113CBA2; Mon, 26 Nov 2018 17:07:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C006B7D352; Mon, 26 Nov 2018 17:07:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DBEF6D76; Mon, 26 Nov 2018 17:07:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQH7anO002194; Mon, 26 Nov 2018 17:07:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQH7Zjr002190; Mon, 26 Nov 2018 17:07:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261707.wAQH7Zjr002190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 17:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340984 - in head: gnu/usr.bin/binutils tools/build/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: gnu/usr.bin/binutils tools/build/mk tools/build/options X-SVN-Commit-Revision: 340984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C006B7D352 X-Spamd-Result: default: False [1.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.57)[0.569,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 17:07:37 -0000 Author: emaste Date: Mon Nov 26 17:07:35 2018 New Revision: 340984 URL: https://svnweb.freebsd.org/changeset/base/340984 Log: Do not install GNU ld if lld is /usr/bin/ld GNU binutils ld.bfd 2.17.50 does not support ifuncs and produces broken binaries when ifuncs are in use. When LLD_IS_LD is default we have an ifunc-capable system linker and can just avoid installing ld.bfd. Reported by: theraven Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18340 Modified: head/gnu/usr.bin/binutils/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITH_BINUTILS Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Mon Nov 26 17:00:39 2018 (r340983) +++ head/gnu/usr.bin/binutils/Makefile Mon Nov 26 17:07:35 2018 (r340984) @@ -8,9 +8,13 @@ SUBDIR= doc\ libopcodes \ libbinutils \ as \ - ld \ objdump +# When we use ld.lld as /usr/bin/ld, do not install the non-ifunc-capable +# GNU binutils 2.17.50 ld. +.if ${MK_LLD_IS_LD} == "no" +SUBDIR+=ld +.endif SUBDIR_DEPEND_libbinutils=libbfd # for bfdver.h SUBDIR_DEPEND_as=libbfd libiberty libopcodes Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 26 17:00:39 2018 (r340983) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 26 17:07:35 2018 (r340984) @@ -208,7 +208,6 @@ OLD_FILES+=usr/bin/as OLD_FILES+=usr/bin/ld OLD_FILES+=usr/share/man/man1/ld.1.gz .endif -OLD_FILES+=usr/bin/ld.bfd OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xbn @@ -411,6 +410,9 @@ OLD_FILES+=usr/share/man/man7/as.7.gz OLD_FILES+=usr/share/man/man7/ld.7.gz OLD_FILES+=usr/share/man/man7/ldint.7.gz OLD_FILES+=usr/share/man/man7/binutils.7.gz +.endif +.if ${MK_BINUTILS} == no || ${MK_LLD_IS_LD} == yes +OLD_FILES+=usr/bin/ld.bfd .endif .if ${MK_BLACKLIST} == no Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Mon Nov 26 17:00:39 2018 (r340983) +++ head/tools/build/options/WITHOUT_BINUTILS Mon Nov 26 17:07:35 2018 (r340984) @@ -1,4 +1,9 @@ .\" $FreeBSD$ -Set to not build or install binutils (as, ld, and objdump) as part +Set to not build or install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. The resulting system cannot build programs from source. Modified: head/tools/build/options/WITH_BINUTILS ============================================================================== --- head/tools/build/options/WITH_BINUTILS Mon Nov 26 17:00:39 2018 (r340983) +++ head/tools/build/options/WITH_BINUTILS Mon Nov 26 17:07:35 2018 (r340984) @@ -1,3 +1,8 @@ .\" $FreeBSD$ -Set to build and install binutils (as, ld, and objdump) as part +Set to build and install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. From owner-svn-src-head@freebsd.org Mon Nov 26 17:11:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41AD6113CE1E; Mon, 26 Nov 2018 17:11:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC1DD7D77B; Mon, 26 Nov 2018 17:11:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD2856EDB; Mon, 26 Nov 2018 17:11:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQHBoAk006869; Mon, 26 Nov 2018 17:11:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQHBoxR006867; Mon, 26 Nov 2018 17:11:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261711.wAQHBoxR006867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 17:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340985 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 340985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC1DD7D77B X-Spamd-Result: default: False [1.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.568,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 17:11:51 -0000 Author: emaste Date: Mon Nov 26 17:11:50 2018 New Revision: 340985 URL: https://svnweb.freebsd.org/changeset/base/340985 Log: src.conf.5: regen after r340984 (and r340841) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Nov 26 17:07:35 2018 (r340984) +++ head/share/man/man5/src.conf.5 Mon Nov 26 17:11:50 2018 (r340985) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd November 6, 2018 +.Dd November 26, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -149,7 +149,12 @@ Build all binaries with the flag set to indicate that the run-time loader should perform all relocation processing at process startup rather than on demand. .It Va WITHOUT_BINUTILS -Set to not build or install binutils (as, ld, and objdump) as part +Set to not build or install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. The resulting system cannot build programs from source. .Pp @@ -162,7 +167,12 @@ When set, it enforces these options: .Va WITHOUT_GDB .El .It Va WITH_BINUTILS -Set to build and install binutils (as, ld, and objdump) as part +Set to build and install GNU +.Xr as 1 , +.Xr objdump 1 , +and for some CPU architectures +.Xr ld.bfd 1 +as part of the normal system build. .Pp This is a default setting on @@ -224,8 +234,8 @@ and related programs. .It Va WITHOUT_BSD_CPIO Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . -.It Va WITH_BSD_CRTBEGIN -Enable the BSD licensed +.It Va WITHOUT_BSD_CRTBEGIN +Disable the BSD licensed .Pa crtbegin.o and .Pa crtend.o . From owner-svn-src-head@freebsd.org Mon Nov 26 17:22:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E2D113D8F3; Mon, 26 Nov 2018 17:22:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2972C7E26D; Mon, 26 Nov 2018 17:22:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AB6570A5; Mon, 26 Nov 2018 17:22:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQHMNN1012375; Mon, 26 Nov 2018 17:22:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQHMNPT012374; Mon, 26 Nov 2018 17:22:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261722.wAQHMNPT012374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 17:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340986 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2972C7E26D X-Spamd-Result: default: False [1.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.57)[0.568,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 17:22:24 -0000 Author: emaste Date: Mon Nov 26 17:22:23 2018 New Revision: 340986 URL: https://svnweb.freebsd.org/changeset/base/340986 Log: UPDATING: add note for r340984 (ld.bfd removal) Sponsored by: The FreeBSD Foundation Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Nov 26 17:11:50 2018 (r340985) +++ head/UPDATING Mon Nov 26 17:22:23 2018 (r340986) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20181126: + On amd64, arm64 and armv7 (architectures that install LLVM's ld.lld + linker as /usr/bin/ld) GNU ld is no longer installed as ld.bfd, as + it produces broken binaries when ifuncs are in use. Users needing + GNU ld should install the binutils port or package. + 20181123: The BSD crtbegin and crtend code has been enabled by default. It has had extensive testing on amd64, arm64, and i386. It can be disabled From owner-svn-src-head@freebsd.org Mon Nov 26 17:59:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29824113E6CF; Mon, 26 Nov 2018 17:59:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5B7C7FD7D; Mon, 26 Nov 2018 17:59:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A287D7596; Mon, 26 Nov 2018 17:59:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQHxPjd028594; Mon, 26 Nov 2018 17:59:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQHxPKF028593; Mon, 26 Nov 2018 17:59:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811261759.wAQHxPKF028593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Nov 2018 17:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340987 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 340987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5B7C7FD7D X-Spamd-Result: default: False [1.33 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.12)[0.120,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 17:59:26 -0000 Author: manu Date: Mon Nov 26 17:59:25 2018 New Revision: 340987 URL: https://svnweb.freebsd.org/changeset/base/340987 Log: arm64: Add evdev support to GENERIC Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Nov 26 17:22:23 2018 (r340986) +++ head/sys/arm64/conf/GENERIC Mon Nov 26 17:59:25 2018 (r340987) @@ -242,6 +242,11 @@ device kbdmux device vt_efifb +# EVDEV support +device evdev # input event device support +options EVDEV_SUPPORT # evdev support in legacy drivers +device uinput # install /dev/uinput cdev + # Pseudo devices. device crypto # core crypto support device loop # Network loopback From owner-svn-src-head@freebsd.org Mon Nov 26 18:31:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E488E113FA13; Mon, 26 Nov 2018 18:31:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFA9581483; Mon, 26 Nov 2018 18:31:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90AC67A91; Mon, 26 Nov 2018 18:31:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQIV0t3044739; Mon, 26 Nov 2018 18:31:00 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQIV0ng044738; Mon, 26 Nov 2018 18:31:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201811261831.wAQIV0ng044738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 26 Nov 2018 18:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340988 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFA9581483 X-Spamd-Result: default: False [1.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_SHORT(0.19)[0.191,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 18:31:01 -0000 Author: asomers Date: Mon Nov 26 18:31:00 2018 New Revision: 340988 URL: https://svnweb.freebsd.org/changeset/base/340988 Log: vfs_aio.c: rename "physio" symbols to "bio". aio has two paths: an asynchronous "physio" path and a synchronous path. Confusingly, physio(9) isn't actually used by the "physio" path, and never has been. In fact, it may even be called by the synchronous path! Rename the "physio" path to the "bio" path to reflect what it actually does: directly compose BIOs and send them to character devices. MFC after: 2 weeks Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Nov 26 17:59:25 2018 (r340987) +++ head/sys/kern/vfs_aio.c Mon Nov 26 18:31:00 2018 (r340988) @@ -212,7 +212,7 @@ typedef struct oaiocb { /* * If the routine that services an AIO request blocks while running in an * AIO kernel process it can starve other I/O requests. BIO requests - * queued via aio_qphysio() complete in GEOM and do not use AIO kernel + * queued via aio_qbio() complete asynchronously and do not use AIO kernel * processes at all. Socket I/O requests use a separate pool of * kprocs and also force non-blocking I/O. Other file I/O requests * use the generic fo_read/fo_write operations which can block. The @@ -268,7 +268,7 @@ struct kaioinfo { int kaio_flags; /* (a) per process kaio flags */ int kaio_active_count; /* (c) number of currently used AIOs */ int kaio_count; /* (a) size of AIO queue */ - int kaio_buffer_count; /* (a) number of physio buffers */ + int kaio_buffer_count; /* (a) number of bio buffers */ TAILQ_HEAD(,kaiocb) kaio_all; /* (a) all AIOs in a process */ TAILQ_HEAD(,kaiocb) kaio_done; /* (a) done queue for process */ TAILQ_HEAD(,aioliojob) kaio_liojoblist; /* (a) list of lio jobs */ @@ -318,11 +318,11 @@ static int aio_newproc(int *); int aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lio, int type, struct aiocb_ops *ops); static int aio_queue_file(struct file *fp, struct kaiocb *job); -static void aio_physwakeup(struct bio *bp); +static void aio_biowakeup(struct bio *bp); static void aio_proc_rundown(void *arg, struct proc *p); static void aio_proc_rundown_exec(void *arg, struct proc *p, struct image_params *imgp); -static int aio_qphysio(struct proc *p, struct kaiocb *job); +static int aio_qbio(struct proc *p, struct kaiocb *job); static void aio_daemon(void *param); static void aio_bio_done_notify(struct proc *userp, struct kaiocb *job); static bool aio_clear_cancel_function_locked(struct kaiocb *job); @@ -741,9 +741,9 @@ drop: /* * The AIO processing activity for LIO_READ/LIO_WRITE. This is the code that - * does the I/O request for the non-physio version of the operations. The - * normal vn operations are used, and this code should work in all instances - * for every type of file, including pipes, sockets, fifos, and regular files. + * does the I/O request for the non-bio version of the operations. The normal + * vn operations are used, and this code should work in all instances for every + * type of file, including pipes, sockets, fifos, and regular files. * * XXX I don't think it works well for socket, pipe, and fifo. */ @@ -1195,7 +1195,7 @@ aio_newproc(int *start) } /* - * Try the high-performance, low-overhead physio method for eligible + * Try the high-performance, low-overhead bio method for eligible * VCHR devices. This method doesn't use an aio helper thread, and * thus has very low overhead. * @@ -1204,7 +1204,7 @@ aio_newproc(int *start) * duration of this call. */ static int -aio_qphysio(struct proc *p, struct kaiocb *job) +aio_qbio(struct proc *p, struct kaiocb *job) { struct aiocb *cb; struct file *fp; @@ -1277,7 +1277,7 @@ aio_qphysio(struct proc *p, struct kaiocb *job) bp->bio_length = cb->aio_nbytes; bp->bio_bcount = cb->aio_nbytes; - bp->bio_done = aio_physwakeup; + bp->bio_done = aio_biowakeup; bp->bio_data = (void *)(uintptr_t)cb->aio_buf; bp->bio_offset = cb->aio_offset; bp->bio_cmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ; @@ -1442,7 +1442,7 @@ static struct aiocb_ops aiocb_ops_osigevent = { #endif /* - * Queue a new AIO request. Choosing either the threaded or direct physio VCHR + * Queue a new AIO request. Choosing either the threaded or direct bio VCHR * technique is done in this code. */ int @@ -1697,7 +1697,7 @@ aio_queue_file(struct file *fp, struct kaiocb *job) bool safe; ki = job->userproc->p_aioinfo; - error = aio_qphysio(job->userproc, job); + error = aio_qbio(job->userproc, job); if (error >= 0) return (error); safe = false; @@ -1947,8 +1947,7 @@ sys_aio_suspend(struct thread *td, struct aio_suspend_ } /* - * aio_cancel cancels any non-physio aio operations not currently in - * progress. + * aio_cancel cancels any non-bio aio operations not currently in progress. */ int sys_aio_cancel(struct thread *td, struct aio_cancel_args *uap) @@ -2332,7 +2331,7 @@ sys_lio_listio(struct thread *td, struct lio_listio_ar } static void -aio_physwakeup(struct bio *bp) +aio_biowakeup(struct bio *bp) { struct kaiocb *job = (struct kaiocb *)bp->bio_caller1; struct proc *userp; From owner-svn-src-head@freebsd.org Mon Nov 26 18:46:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D21C1140543; Mon, 26 Nov 2018 18:46:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD4382920; Mon, 26 Nov 2018 18:46:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D8A97DAB; Mon, 26 Nov 2018 18:46:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQIkFGs053915; Mon, 26 Nov 2018 18:46:15 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQIkFx8053914; Mon, 26 Nov 2018 18:46:15 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811261846.wAQIkFx8053914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Nov 2018 18:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340989 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 340989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FD4382920 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.300,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 18:46:16 -0000 Author: manu Date: Mon Nov 26 18:46:15 2018 New Revision: 340989 URL: https://svnweb.freebsd.org/changeset/base/340989 Log: regulator_fixed: Do not disable fixed regulator at probe If the regulator is unused it will be disabled by the regulator_shutdown sysinit. Tested on pinebook where the backlight is controlled by a fixed-regulator. The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe. We later enable it but this cause the screen to go black. Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17978 Modified: head/sys/dev/extres/regulator/regulator_fixed.c Modified: head/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_fixed.c Mon Nov 26 18:31:00 2018 (r340988) +++ head/sys/dev/extres/regulator/regulator_fixed.c Mon Nov 26 18:46:15 2018 (r340989) @@ -145,7 +145,6 @@ regnode_fixed_init(struct regnode *regnode) struct regnode_fixed_sc *sc; struct gpiobus_pin *pin; uint32_t flags; - bool enable; int rv; sc = regnode_get_softc(regnode); @@ -158,14 +157,15 @@ regnode_fixed_init(struct regnode *regnode) flags = GPIO_PIN_OUTPUT; if (sc->gpio_open_drain) flags |= GPIO_PIN_OPENDRAIN; - enable = sc->param->boot_on || sc->param->always_on; - if (!sc->param->enable_active_high) - enable = !enable; - rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); - if (rv != 0) { - device_printf(dev, "Cannot set GPIO pin: %d\n", pin->pin); - return (rv); + if (sc->param->boot_on || sc->param->always_on) { + rv = GPIO_PIN_SET(pin->dev, pin->pin, sc->param->enable_active_high); + if (rv != 0) { + device_printf(dev, "Cannot set GPIO pin: %d\n", + pin->pin); + return (rv); + } } + rv = GPIO_PIN_SETFLAGS(pin->dev, pin->pin, flags); if (rv != 0) { device_printf(dev, "Cannot configure GPIO pin: %d\n", pin->pin); From owner-svn-src-head@freebsd.org Mon Nov 26 19:14:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3AC31141777; Mon, 26 Nov 2018 19:14:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59D9F848AB; Mon, 26 Nov 2018 19:14:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E7451027C; Mon, 26 Nov 2018 19:14:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQJEXbF070924; Mon, 26 Nov 2018 19:14:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQJEX4C070922; Mon, 26 Nov 2018 19:14:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261914.wAQJEX4C070922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 19:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340990 - head/stand/i386/btx/lib X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/stand/i386/btx/lib X-SVN-Commit-Revision: 340990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59D9F848AB X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_SHORT(0.40)[0.404,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 19:14:35 -0000 Author: emaste Date: Mon Nov 26 19:14:33 2018 New Revision: 340990 URL: https://svnweb.freebsd.org/changeset/base/340990 Log: btx: rename .s files to .S to use Clang IAS As part of the migration away from obsolete binutils we want to retire GNU as. Most assembly files used on amd64 have a .S extension and are assembled with Clang's integrated assembler; rename two files in stand/i386/btx/lib to .S to use IAS as well. The generated .text is identical (the entire .o files are not, as Clang adds debug info). PR: 205250, 233094 Discussed with: imp Sponsored by: The FreeBSD Foundation Added: head/stand/i386/btx/lib/btxsys.S - copied unchanged from r340989, head/stand/i386/btx/lib/btxsys.s head/stand/i386/btx/lib/btxv86.S - copied unchanged from r340989, head/stand/i386/btx/lib/btxv86.s Deleted: head/stand/i386/btx/lib/btxsys.s head/stand/i386/btx/lib/btxv86.s Modified: head/stand/i386/btx/lib/Makefile Modified: head/stand/i386/btx/lib/Makefile ============================================================================== --- head/stand/i386/btx/lib/Makefile Mon Nov 26 18:46:15 2018 (r340989) +++ head/stand/i386/btx/lib/Makefile Mon Nov 26 19:14:33 2018 (r340990) @@ -4,7 +4,7 @@ PROG= crt0.o INTERNALPROG= -SRCS= btxcsu.S btxsys.s btxv86.s +SRCS= btxcsu.S btxsys.S btxv86.S CFLAGS+=-I${BOOTSRC}/i386/common LDFLAGS+=-Wl,-r Copied: head/stand/i386/btx/lib/btxsys.S (from r340989, head/stand/i386/btx/lib/btxsys.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/btx/lib/btxsys.S Mon Nov 26 19:14:33 2018 (r340990, copy of r340989, head/stand/i386/btx/lib/btxsys.s) @@ -0,0 +1,40 @@ +# +# Copyright (c) 1998 Robert Nordier +# All rights reserved. +# +# Redistribution and use in source and binary forms are freely +# permitted provided that the above copyright notice and this +# paragraph and the following disclaimer are duplicated in all +# such forms. +# +# This software is provided "AS IS" and without any express or +# implied warranties, including, without limitation, the implied +# warranties of merchantability and fitness for a particular +# purpose. +# + +# $FreeBSD$ + +# +# BTX system calls. +# + +# +# Globals. +# + .global __exit + .global __exec +# +# Constants. +# + .set INT_SYS,0x30 # Interrupt number +# +# System call: exit +# +__exit: xorl %eax,%eax # BTX system + int $INT_SYS # call 0x0 +# +# System call: exec +# +__exec: movl $0x1,%eax # BTX system + int $INT_SYS # call 0x1 Copied: head/stand/i386/btx/lib/btxv86.S (from r340989, head/stand/i386/btx/lib/btxv86.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/btx/lib/btxv86.S Mon Nov 26 19:14:33 2018 (r340990, copy of r340989, head/stand/i386/btx/lib/btxv86.s) @@ -0,0 +1,85 @@ +# +# Copyright (c) 1998 Robert Nordier +# All rights reserved. +# +# Redistribution and use in source and binary forms are freely +# permitted provided that the above copyright notice and this +# paragraph and the following disclaimer are duplicated in all +# such forms. +# +# This software is provided "AS IS" and without any express or +# implied warranties, including, without limitation, the implied +# warranties of merchantability and fitness for a particular +# purpose. +# + +# $FreeBSD$ + +# +# BTX V86 interface. +# + +# +# Globals. +# + .global __v86int +# +# Fields in V86 interface structure. +# + .set V86_CTL,0x0 # Control flags + .set V86_ADDR,0x4 # Int number/address + .set V86_ES,0x8 # V86 ES + .set V86_DS,0xc # V86 DS + .set V86_FS,0x10 # V86 FS + .set V86_GS,0x14 # V86 GS + .set V86_EAX,0x18 # V86 EAX + .set V86_ECX,0x1c # V86 ECX + .set V86_EDX,0x20 # V86 EDX + .set V86_EBX,0x24 # V86 EBX + .set V86_EFL,0x28 # V86 eflags + .set V86_EBP,0x2c # V86 EBP + .set V86_ESI,0x30 # V86 ESI + .set V86_EDI,0x34 # V86 EDI +# +# Other constants. +# + .set INT_V86,0x31 # Interrupt number + .set SIZ_V86,0x38 # Size of V86 structure +# +# V86 interface function. +# +__v86int: popl __v86ret # Save return address + pushl $__v86 # Push pointer + call __v86_swap # Load V86 registers + int $INT_V86 # To BTX + call __v86_swap # Load user registers + addl $0x4,%esp # Discard pointer + pushl __v86ret # Restore return address + ret # To user +# +# Swap V86 and user registers. +# +__v86_swap: xchgl %ebp,0x4(%esp,1) # Swap pointer, EBP + xchgl %eax,V86_EAX(%ebp) # Swap EAX + xchgl %ecx,V86_ECX(%ebp) # Swap ECX + xchgl %edx,V86_EDX(%ebp) # Swap EDX + xchgl %ebx,V86_EBX(%ebp) # Swap EBX + pushl %eax # Save + pushf # Put eflags + popl %eax # in EAX + xchgl %eax,V86_EFL(%ebp) # Swap + pushl %eax # Put EAX + popf # in eflags + movl 0x8(%esp,1),%eax # Load EBP + xchgl %eax,V86_EBP(%ebp) # Swap + movl %eax,0x8(%esp,1) # Save EBP + popl %eax # Restore + xchgl %esi,V86_ESI(%ebp) # Swap ESI + xchgl %edi,V86_EDI(%ebp) # Swap EDI + xchgl %ebp,0x4(%esp,1) # Swap pointer, EBP + ret # To caller +# +# V86 interface structure. +# + .comm __v86,SIZ_V86 + .comm __v86ret,4 From owner-svn-src-head@freebsd.org Mon Nov 26 19:29:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 784DB1141D80; Mon, 26 Nov 2018 19:29:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA4685050; Mon, 26 Nov 2018 19:29:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D89F11042E; Mon, 26 Nov 2018 19:29:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQJTInG076380; Mon, 26 Nov 2018 19:29:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQJTI2C076378; Mon, 26 Nov 2018 19:29:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811261929.wAQJTI2C076378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 26 Nov 2018 19:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340991 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 340991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DA4685050 X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.40)[0.404,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 19:29:19 -0000 Author: emaste Date: Mon Nov 26 19:29:18 2018 New Revision: 340991 URL: https://svnweb.freebsd.org/changeset/base/340991 Log: stand/i386/libi386: rename .s file to .S to use Clang IAS As part of the migration away from obsolete binutils we want to retire GNU as. Most assembly files used on amd64 have a .S extension and are assembled with Clang's Integrated Assembler (IAS); rename pxetram.s to .S to use IAS as well. The generated .text is identical (the entire .o file is not, as Clang adds debug info.) PR: 205250, 233094 Sponsored by: The FreeBSD Foundation Added: head/stand/i386/libi386/pxetramp.S - copied unchanged from r340990, head/stand/i386/libi386/pxetramp.s Deleted: head/stand/i386/libi386/pxetramp.s Modified: head/stand/i386/libi386/Makefile Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Mon Nov 26 19:14:33 2018 (r340990) +++ head/stand/i386/libi386/Makefile Mon Nov 26 19:29:18 2018 (r340991) @@ -8,7 +8,7 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ - i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ + i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.S \ smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c Copied: head/stand/i386/libi386/pxetramp.S (from r340990, head/stand/i386/libi386/pxetramp.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/libi386/pxetramp.S Mon Nov 26 19:29:18 2018 (r340991, copy of r340990, head/stand/i386/libi386/pxetramp.s) @@ -0,0 +1,38 @@ +# +# Copyright (c) 2000 Peter Wemm +# All rights reserved. +# +# Redistribution and use in source and binary forms are freely +# permitted provided that the above copyright notice and this +# paragraph and the following disclaimer are duplicated in all +# such forms. +# +# This software is provided "AS IS" and without any express or +# implied warranties, including, without limitation, the implied +# warranties of merchantability and fitness for a particular +# purpose. +# +# $FreeBSD$ + +# ph33r this + + .globl __bangpxeentry, __bangpxeseg, __bangpxeoff + .globl __pxenventry, __pxenvseg, __pxenvoff + + .code16 + .p2align 4,0x90 +__bangpxeentry: + push %dx # seg:data + push %ax # off:data + push %bx # int16 func + .byte 0x9a # far call +__bangpxeoff: .word 0x0000 # offset +__bangpxeseg: .word 0x0000 # segment + add $6, %sp # restore stack + .byte 0xcb # to vm86int +# +__pxenventry: + .byte 0x9a # far call +__pxenvoff: .word 0x0000 # offset +__pxenvseg: .word 0x0000 # segment + .byte 0xcb # to vm86int From owner-svn-src-head@freebsd.org Mon Nov 26 19:39:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A07011420DD; Mon, 26 Nov 2018 19:39:52 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 435CF8578C; Mon, 26 Nov 2018 19:39:52 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2561B105C2; Mon, 26 Nov 2018 19:39:52 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQJdq7j081341; Mon, 26 Nov 2018 19:39:52 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQJdnXx081329; Mon, 26 Nov 2018 19:39:49 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811261939.wAQJdnXx081329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Mon, 26 Nov 2018 19:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340992 - in head: etc/mtree share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale tools/tools/locale/etc X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: etc/mtree share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale tools/tools/locale/etc X-SVN-Commit-Revision: 340992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 435CF8578C X-Spamd-Result: default: False [1.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.65)[0.649,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.40)[0.404,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 19:39:52 -0000 Author: yuripv Date: Mon Nov 26 19:39:49 2018 New Revision: 340992 URL: https://svnweb.freebsd.org/changeset/base/340992 Log: Add ga_IE.UTF-8 locale. PR: 228587 Submitted by: Micil (LC_TIME) Reviewed by: bapt Approved by: kib (mentor, implicit) MFC after: 3 days Differential revision: https://reviews.freebsd.org/D17997 Added: head/share/monetdef/ga_IE.UTF-8.src - copied unchanged from r340991, head/share/monetdef/en_IE.UTF-8.src head/share/msgdef/ga_IE.UTF-8.src (contents, props changed) head/share/timedef/ga_IE.UTF-8.src (contents, props changed) Deleted: head/share/monetdef/en_IE.UTF-8.src Modified: head/etc/mtree/BSD.usr.dist head/share/colldef/Makefile head/share/ctypedef/Makefile head/share/monetdef/Makefile head/share/msgdef/Makefile head/share/numericdef/Makefile head/share/timedef/Makefile head/tools/tools/locale/Makefile head/tools/tools/locale/etc/charmaps.xml Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Mon Nov 26 19:29:18 2018 (r340991) +++ head/etc/mtree/BSD.usr.dist Mon Nov 26 19:39:49 2018 (r340992) @@ -635,6 +635,8 @@ .. fr_FR.UTF-8 .. + ga_IE.UTF-8 + .. he_IL.UTF-8 .. hi_IN.ISCII-DEV Modified: head/share/colldef/Makefile ============================================================================== --- head/share/colldef/Makefile Mon Nov 26 19:29:18 2018 (r340991) +++ head/share/colldef/Makefile Mon Nov 26 19:39:49 2018 (r340992) @@ -184,6 +184,7 @@ SAME+= en_US.UTF-8 nl_NL.UTF-8 SAME+= en_US.UTF-8 nl_BE.UTF-8 SAME+= en_US.UTF-8 it_IT.UTF-8 SAME+= en_US.UTF-8 it_CH.UTF-8 +SAME+= en_US.UTF-8 ga_IE.UTF-8 SAME+= en_US.UTF-8 fr_FR.UTF-8 SAME+= en_US.UTF-8 fr_CH.UTF-8 SAME+= en_US.UTF-8 fr_BE.UTF-8 Modified: head/share/ctypedef/Makefile ============================================================================== --- head/share/ctypedef/Makefile Mon Nov 26 19:29:18 2018 (r340991) +++ head/share/ctypedef/Makefile Mon Nov 26 19:39:49 2018 (r340992) @@ -82,6 +82,7 @@ SAME+= C.UTF-8 hu_HU.UTF-8 SAME+= C.UTF-8 hr_HR.UTF-8 SAME+= C.UTF-8 hi_IN.UTF-8 SAME+= C.UTF-8 he_IL.UTF-8 +SAME+= C.UTF-8 ga_IE.UTF-8 SAME+= C.UTF-8 fr_FR.UTF-8 SAME+= C.UTF-8 fr_CH.UTF-8 SAME+= C.UTF-8 fr_CA.UTF-8 Modified: head/share/monetdef/Makefile ============================================================================== --- head/share/monetdef/Makefile Mon Nov 26 19:29:18 2018 (r340991) +++ head/share/monetdef/Makefile Mon Nov 26 19:39:49 2018 (r340992) @@ -31,7 +31,6 @@ LOCALES+= en_GB.US-ASCII LOCALES+= en_GB.UTF-8 LOCALES+= en_IE.ISO8859-1 LOCALES+= en_IE.ISO8859-15 -LOCALES+= en_IE.UTF-8 LOCALES+= en_NZ.UTF-8 LOCALES+= en_PH.UTF-8 LOCALES+= en_SG.UTF-8 @@ -47,6 +46,7 @@ LOCALES+= fr_CA.UTF-8 LOCALES+= fr_CH.ISO8859-15 LOCALES+= fr_CH.UTF-8 LOCALES+= fr_FR.UTF-8 +LOCALES+= ga_IE.UTF-8 LOCALES+= he_IL.UTF-8 LOCALES+= hi_IN.ISCII-DEV LOCALES+= hi_IN.UTF-8 @@ -156,6 +156,7 @@ SAME+= en_CA.UTF-8 en_CA.ISO8859-1 SAME+= en_GB.ISO8859-15 en_GB.ISO8859-1 SAME+= zh_HK.UTF-8 en_HK.UTF-8 SAME+= zh_HK.UTF-8 en_HK.ISO8859-1 +SAME+= ga_IE.UTF-8 en_IE.UTF-8 SAME+= en_NZ.UTF-8 en_NZ.US-ASCII SAME+= en_NZ.UTF-8 en_NZ.ISO8859-15 SAME+= en_NZ.UTF-8 en_NZ.ISO8859-1 Copied: head/share/monetdef/ga_IE.UTF-8.src (from r340991, head/share/monetdef/en_IE.UTF-8.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/monetdef/ga_IE.UTF-8.src Mon Nov 26 19:39:49 2018 (r340992, copy of r340991, head/share/monetdef/en_IE.UTF-8.src) @@ -0,0 +1,50 @@ +# Warning: Do not edit. This file is automatically generated from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +# +# int_curr_symbol (last character always SPACE) +EUR +# +# currency_symbol +€ +# +# mon_decimal_point +. +# +# mon_thousands_sep +, +# +# mon_grouping +3 +# +# positive_sign + +# +# negative_sign +- +# +# int_frac_digits +2 +# +# frac_digits +2 +# +# p_cs_precedes +1 +# +# p_sep_by_space +0 +# +# n_cs_precedes +1 +# +# n_sep_by_space +0 +# +# p_sign_posn +1 +# +# n_sign_posn +1 +# EOF Modified: head/share/msgdef/Makefile ============================================================================== --- head/share/msgdef/Makefile Mon Nov 26 19:29:18 2018 (r340991) +++ head/share/msgdef/Makefile Mon Nov 26 19:39:49 2018 (r340992) @@ -28,6 +28,7 @@ LOCALES+= eu_ES.UTF-8 LOCALES+= fi_FI.ISO8859-15 LOCALES+= fi_FI.UTF-8 LOCALES+= fr_FR.UTF-8 +LOCALES+= ga_IE.UTF-8 LOCALES+= he_IL.UTF-8 LOCALES+= hi_IN.ISCII-DEV LOCALES+= hi_IN.UTF-8 Added: head/share/msgdef/ga_IE.UTF-8.src ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/msgdef/ga_IE.UTF-8.src Mon Nov 26 19:39:49 2018 (r340992) @@ -0,0 +1,17 @@ +# Warning: Do not edit. This file is automatically generated from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +# +# yesexpr +^(([tT]([áÃ])?)|([tT])|([yY]([eE][sS])?)|([yY])) +# +# noexpr +^(([nN]([íÃ][lL])?)|([nN])|([nN]([oO])?)|([nN])) +# +# yesstr +tá:t:TÃ:T:yes:y:YES:Y +# +# nostr +níl:n:NÃL:N:no:n:NO:N +# EOF Modified: head/share/numericdef/Makefile ============================================================================== --- head/share/numericdef/Makefile Mon Nov 26 19:29:18 2018 (r340991) +++ head/share/numericdef/Makefile Mon Nov 26 19:39:49 2018 (r340992) @@ -105,6 +105,7 @@ SAME+= en_US.UTF-8 ja_JP.UTF-8 SAME+= en_US.UTF-8 ja_JP.SJIS SAME+= en_US.UTF-8 ja_JP.eucJP SAME+= en_US.UTF-8 he_IL.UTF-8 +SAME+= en_US.UTF-8 ga_IE.UTF-8 SAME+= en_US.UTF-8 es_MX.UTF-8 SAME+= en_US.UTF-8 es_MX.ISO8859-1 SAME+= en_US.UTF-8 en_US.US-ASCII Modified: head/share/timedef/Makefile ============================================================================== --- head/share/timedef/Makefile Mon Nov 26 19:29:18 2018 (r340991) +++ head/share/timedef/Makefile Mon Nov 26 19:39:49 2018 (r340992) @@ -58,6 +58,7 @@ LOCALES+= fr_CH.ISO8859-15 LOCALES+= fr_CH.UTF-8 LOCALES+= fr_FR.ISO8859-15 LOCALES+= fr_FR.UTF-8 +LOCALES+= ga_IE.UTF-8 LOCALES+= he_IL.UTF-8 LOCALES+= hi_IN.ISCII-DEV LOCALES+= hi_IN.UTF-8 Added: head/share/timedef/ga_IE.UTF-8.src ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/timedef/ga_IE.UTF-8.src Mon Nov 26 19:39:49 2018 (r340992) @@ -0,0 +1,83 @@ +# +# Short month names +Ean +Fea +Már +Abr +Bea +Mei +Iul +Lún +Mnf +Drf +Sam +Nol +# +# Long month names (as in a date) +Mí Eanair +Mí na Feabhra +Mí an Mhárta +Mí Aibreáin +Mí na Bealtaine +Mí an Mheithimh +Mí Iúil +Mí na Lúnasa +Mí Meán Fhómhair +Mí Deireadh Fómhair +Mí na Samhna +Mí na Nollag +# +# Short weekday names +Dom +Lua +Már +Céa +Déa +Aoi +Sat +# +# Long weekday names +Dé Domhnaigh +Dé Luain +Dé Máirt +Dé Céadaoin +Déardaoin +Dé hAoine +Dé Sathairn +# +# X_fmt +%H:%M:%S +# +# x_fmt +%d/%m/%Y +# +# c_fmt +%a %e %b %X %Y +# +# AM/PM +r.n. +i.n. +# +# date_fmt +%a %e %b %Y %X %Z +# +# Long month names (without case ending) +Mí Eanair +Mí na Feabhra +Mí an Mhárta +Mí Aibreáin +Mí na Bealtaine +Mí an Mheithimh +Mí Iúil +Mí na Lúnasa +Mí Meán Fhómhair +Mí Deireadh Fómhair +Mí na Samhna +Mí na Nollag +# +# md_order +dm +# +# ampm_fmt +%I:%M:%S %p +# EOF Modified: head/tools/tools/locale/Makefile ============================================================================== --- head/tools/tools/locale/Makefile Mon Nov 26 19:29:18 2018 (r340991) +++ head/tools/tools/locale/Makefile Mon Nov 26 19:39:49 2018 (r340992) @@ -111,7 +111,7 @@ BASE_LOCALES_OF_INTEREST?= \ cs_CZ da_DK de_AT de_CH de_DE el_GR en_AU en_CA \ en_GB en_HK en_IE en_NZ en_PH en_SG en_US en_ZA \ es_AR es_CR es_ES es_MX et_EE eu_ES fi_FI fr_BE \ - fr_CA fr_CH fr_FR he_IL hi_IN hr_HR hu_HU hy_AM \ + fr_CA fr_CH fr_FR ga_IE he_IL hi_IN hr_HR hu_HU hy_AM \ is_IS it_CH it_IT ja_JP ko_KR lt_LT lv_LV \ nb_NO nl_BE nl_NL nn_NO pl_PL pt_BR pt_PT ro_RO \ ru_RU se_FI se_NO sk_SK sl_SI sv_FI sv_SE tr_TR \ Modified: head/tools/tools/locale/etc/charmaps.xml ============================================================================== --- head/tools/tools/locale/etc/charmaps.xml Mon Nov 26 19:29:18 2018 (r340991) +++ head/tools/tools/locale/etc/charmaps.xml Mon Nov 26 19:39:49 2018 (r340992) @@ -93,6 +93,8 @@ + Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC5DD11424E7; Mon, 26 Nov 2018 19:41:14 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7631385C58; Mon, 26 Nov 2018 19:41:14 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58C13105F9; Mon, 26 Nov 2018 19:41:14 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQJfEPp081490; Mon, 26 Nov 2018 19:41:14 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQJfEvL081489; Mon, 26 Nov 2018 19:41:14 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811261941.wAQJfEvL081489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Mon, 26 Nov 2018 19:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340993 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 340993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7631385C58 X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.404,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 19:41:15 -0000 Author: bwidawsk Date: Mon Nov 26 19:41:13 2018 New Revision: 340993 URL: https://svnweb.freebsd.org/changeset/base/340993 Log: acpi/ec: Fix regression caused by r340644 After r340644 there were two things wrong in cases where there is both an ECDT, and an EC device exposed via acpica. The first is a rather trivial situation where the device desc would say ECDT even when it was not implicitly created via ECDT (not really sure why the compiler doesn't seem to warn about this). The other more pervasive issue is that the code is designed to essentially not do anything for EC probe when its uid was already created an EC based on the ECDT's uid. The issue was that probe would still return 0 in this case, and so we'd end up with some weird duplication. Now to be honest, I'm not actually sure what exactly broke, but it was definitely not working as intended. To fix this, all that is really needed is to make sure we return ENXIO when we're probing the device already added for the ECDT entry. While here though, move the check for this earlier to avoid wasted cycles when we know after obtaining the uid that it's duplicative. There remains one questionable bit here which I don't want to touch - when doing probe for PNP0C09, if acquiring _UID for the device fails, 0 is assumed, which is a valid UID used by the implicit ECDT. Reported by: Charlie Li, et al. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D18311 Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Mon Nov 26 19:39:49 2018 (r340992) +++ head/sys/dev/acpica/acpi_ec.c Mon Nov 26 19:41:13 2018 (r340993) @@ -362,7 +362,8 @@ acpi_ec_probe(device_t dev) ret = 0; goto out; - } + } else + ecdt = 0; ret = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); if (ret > 0) @@ -382,6 +383,22 @@ acpi_ec_probe(device_t dev) if (ACPI_FAILURE(status)) params->uid = 0; + /* + * Check for a duplicate probe. This can happen when a probe via ECDT + * succeeded already. If this is a duplicate, disable this device. + * + * NB: It would seem device_disable would be sufficient to not get + * duplicated devices, and ENXIO isn't needed, however, device_probe() only + * checks DF_ENABLED at the start and so disabling it here is too late to + * prevent device_attach() from being called. + */ + peer = devclass_get_device(acpi_ec_devclass, params->uid); + if (peer != NULL && device_is_alive(peer)) { + device_disable(dev); + ret = ENXIO; + goto out; + } + status = acpi_GetInteger(h, "_GLK", ¶ms->glk); if (ACPI_FAILURE(status)) params->glk = 0; @@ -421,16 +438,6 @@ acpi_ec_probe(device_t dev) /* Store the values we got from the namespace for attach. */ acpi_set_private(dev, params); - - /* - * Check for a duplicate probe. This can happen when a probe via ECDT - * succeeded already. If this is a duplicate, disable this device. - */ - peer = devclass_get_device(acpi_ec_devclass, params->uid); - if (peer == NULL || !device_is_alive(peer)) - ret = 0; - else - device_disable(dev); if (buf.Pointer) AcpiOsFree(buf.Pointer); From owner-svn-src-head@freebsd.org Mon Nov 26 20:19:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D9D71142FBD; Mon, 26 Nov 2018 20:19:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 105DF86CC6; Mon, 26 Nov 2018 20:19:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 410D010B476; Mon, 26 Nov 2018 15:19:53 -0500 (EST) Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Mateusz Guzik , Warner Losh References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <8cae923a-2b14-c16b-23e7-e6eb7e9a8c3a@FreeBSD.org> Date: Mon, 26 Nov 2018 12:19:51 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 26 Nov 2018 15:19:54 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 105DF86CC6 X-Spamd-Result: default: False [2.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.66)[0.663,0]; NEURAL_SPAM_MEDIUM(0.71)[0.711,0]; NEURAL_SPAM_LONG(0.82)[0.817,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 20:19:55 -0000 On 11/22/18 9:28 AM, Mateusz Guzik wrote: > diff --git a/sys/sys/systm.h b/sys/sys/systm.h > index a1b98c5660c..fab94ee7979 100644 > --- a/sys/sys/systm.h > +++ b/sys/sys/systm.h > @@ -523,7 +523,11 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); > int alloc_unrl(struct unrhdr *uh); > void free_unr(struct unrhdr *uh, u_int item); > > -#if defined(__mips__) || defined(__powerpc__) > +#if defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) > +#define UNR64_LOCKED > +#endif This would perhaps be shorter as: #if defined(__mips__) && defined(__mips_o32) > + > +#if defined(__powerpc__) && !defined(__powerpc64__) > #define UNR64_LOCKED > #endif It's not clear to me why this isn't just conditional on LP64 though. If 32-bit riscv existed in FreeBSD it would also not have this. If we really care that much about i386 and 32-bit arm you could write it as: #if !(defined(__LP64__) || defined(__i386__) || defined(__arm__)) (I'm not sure we care that much though and think we could just use __LP64__ alone and call it a day.) -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Mon Nov 26 20:50:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F241143F38; Mon, 26 Nov 2018 20:50:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39A856A5A6; Mon, 26 Nov 2018 20:50:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE2A911244; Mon, 26 Nov 2018 20:50:55 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQKotHZ017378; Mon, 26 Nov 2018 20:50:55 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQKotfL017375; Mon, 26 Nov 2018 20:50:55 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811262050.wAQKotfL017375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 26 Nov 2018 20:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340994 - in head/sys: amd64/ia32 mips/mips powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head/sys: amd64/ia32 mips/mips powerpc/powerpc X-SVN-Commit-Revision: 340994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 39A856A5A6 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.28)[0.285,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 20:50:56 -0000 Author: vangyzen Date: Mon Nov 26 20:50:55 2018 New Revision: 340994 URL: https://svnweb.freebsd.org/changeset/base/340994 Log: Prevent kernel stack disclosure in getcontext/swapcontext Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc. MFC after: 2 days Security: FreeBSD-EN-18:12.mem Security: CVE-2018-17155 Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/ia32/ia32_signal.c head/sys/mips/mips/freebsd32_machdep.c head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon Nov 26 19:41:13 2018 (r340993) +++ head/sys/amd64/ia32/ia32_signal.c Mon Nov 26 20:50:55 2018 (r340994) @@ -261,6 +261,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -301,6 +302,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); ia32_get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Mon Nov 26 19:41:13 2018 (r340993) +++ head/sys/mips/mips/freebsd32_machdep.c Mon Nov 26 20:50:55 2018 (r340994) @@ -294,6 +294,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -333,6 +334,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 26 19:41:13 2018 (r340993) +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 26 20:50:55 2018 (r340994) @@ -785,6 +785,7 @@ freebsd32_getcontext(struct thread *td, struct freebsd if (uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -824,6 +825,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; From owner-svn-src-head@freebsd.org Mon Nov 26 20:52:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2514E1144369; Mon, 26 Nov 2018 20:52:55 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C01DE6AA1B; Mon, 26 Nov 2018 20:52:54 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1215112BB; Mon, 26 Nov 2018 20:52:54 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQKqski022339; Mon, 26 Nov 2018 20:52:54 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQKqsPi022337; Mon, 26 Nov 2018 20:52:54 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811262052.wAQKqsPi022337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 26 Nov 2018 20:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340995 - in head/sys: arm/arm arm64/arm64 riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 riscv/riscv X-SVN-Commit-Revision: 340995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C01DE6AA1B X-Spamd-Result: default: False [1.48 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.27)[0.274,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.64)[0.643,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 20:52:55 -0000 Author: vangyzen Date: Mon Nov 26 20:52:53 2018 New Revision: 340995 URL: https://svnweb.freebsd.org/changeset/base/340995 Log: Prevent kernel stack disclosure in signal delivery On arm64 and riscv platforms, sendsig() failed to zero the signal frame before copying it out to userspace. Zero it. On arm, I believe all the contents of the frame were initialized, so there was no disclosure. However, explicitly zero the whole frame because that fact could inadvertently change in the future, it's more clear to the reader, and I could be wrong in the first place. MFC after: 2 days Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155 Sponsored by: Dell EMC Isilon Modified: head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/riscv/riscv/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Nov 26 20:50:55 2018 (r340994) +++ head/sys/arm/arm/machdep.c Mon Nov 26 20:52:53 2018 (r340995) @@ -641,6 +641,7 @@ sendsig(catcher, ksi, mask) /* make the stack aligned */ fp = (struct sigframe *)STACKALIGN(fp); /* Populate the siginfo frame. */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); #ifdef VFP get_vfpcontext(td, &frame.sf_vfp); Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Mon Nov 26 20:50:55 2018 (r340994) +++ head/sys/arm64/arm64/machdep.c Mon Nov 26 20:52:53 2018 (r340995) @@ -656,6 +656,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask fp = (struct sigframe *)STACKALIGN(fp); /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Mon Nov 26 20:50:55 2018 (r340994) +++ head/sys/riscv/riscv/machdep.c Mon Nov 26 20:52:53 2018 (r340995) @@ -582,6 +582,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask fp = (struct sigframe *)STACKALIGN(fp); /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; From owner-svn-src-head@freebsd.org Mon Nov 26 20:56:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32768114442B; Mon, 26 Nov 2018 20:56:07 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C96556ABAB; Mon, 26 Nov 2018 20:56:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9127112BE; Mon, 26 Nov 2018 20:56:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQKu64J022545; Mon, 26 Nov 2018 20:56:06 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQKu6q2022542; Mon, 26 Nov 2018 20:56:06 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811262056.wAQKu6q2022542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 26 Nov 2018 20:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340996 - in head/sys: amd64/amd64 amd64/ia32 i386/i386 kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 i386/i386 kern X-SVN-Commit-Revision: 340996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C96556ABAB X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.28)[0.285,0]; NEURAL_SPAM_MEDIUM(0.61)[0.607,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 20:56:07 -0000 Author: vangyzen Date: Mon Nov 26 20:56:05 2018 New Revision: 340996 URL: https://svnweb.freebsd.org/changeset/base/340996 Log: Remove superfluous bzero in getcontext/swapcontext/sendsig We zero the whole structure; we don't need to zero the __spare__ field again. Remove trailing whitespace. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/i386/i386/machdep.c head/sys/kern/kern_context.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/amd64/amd64/machdep.c Mon Nov 26 20:56:05 2018 (r340996) @@ -392,7 +392,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase; bzero(sf.sf_uc.uc_mcontext.mc_spare, sizeof(sf.sf_uc.uc_mcontext.mc_spare)); - bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/amd64/ia32/ia32_signal.c Mon Nov 26 20:56:05 2018 (r340996) @@ -266,7 +266,6 @@ freebsd32_getcontext(struct thread *td, struct freebsd PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; PROC_UNLOCK(td->td_proc); - bzero(&uc.__spare__, sizeof(uc.__spare__)); ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); } return (ret); @@ -276,7 +275,7 @@ int freebsd32_setcontext(struct thread *td, struct freebsd32_setcontext_args *uap) { struct ia32_ucontext uc; - int ret; + int ret; if (uap->ucp == NULL) ret = EINVAL; @@ -297,7 +296,7 @@ int freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args *uap) { struct ia32_ucontext uc; - int ret; + int ret; if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; @@ -622,7 +621,6 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t fpstate_drop(td); sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase; sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase; - bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/i386/i386/machdep.c Mon Nov 26 20:56:05 2018 (r340996) @@ -645,7 +645,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask sdp->sd_lobase; bzero(sf.sf_uc.uc_mcontext.mc_spare2, sizeof(sf.sf_uc.uc_mcontext.mc_spare2)); - bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && Modified: head/sys/kern/kern_context.c ============================================================================== --- head/sys/kern/kern_context.c Mon Nov 26 20:52:53 2018 (r340995) +++ head/sys/kern/kern_context.c Mon Nov 26 20:56:05 2018 (r340996) @@ -75,7 +75,6 @@ sys_getcontext(struct thread *td, struct getcontext_ar PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; PROC_UNLOCK(td->td_proc); - bzero(uc.__spare__, sizeof(uc.__spare__)); ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); } return (ret); @@ -85,7 +84,7 @@ int sys_setcontext(struct thread *td, struct setcontext_args *uap) { ucontext_t uc; - int ret; + int ret; if (uap->ucp == NULL) ret = EINVAL; @@ -106,14 +105,13 @@ int sys_swapcontext(struct thread *td, struct swapcontext_args *uap) { ucontext_t uc; - int ret; + int ret; if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { bzero(&uc, sizeof(ucontext_t)); get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); - bzero(uc.__spare__, sizeof(uc.__spare__)); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; PROC_UNLOCK(td->td_proc); From owner-svn-src-head@freebsd.org Mon Nov 26 21:26:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B1221144ECC; Mon, 26 Nov 2018 21:26:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02D476BD67; Mon, 26 Nov 2018 21:26:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1854610A87D; Mon, 26 Nov 2018 16:26:41 -0500 (EST) Subject: Re: svn commit: r340617 - head/sys/netgraph To: Eugene Grosbein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 26 Nov 2018 13:26:38 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201811190727.wAJ7RpDN052165@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 26 Nov 2018 16:26:41 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 02D476BD67 X-Spamd-Result: default: False [2.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.85)[0.853,0]; NEURAL_SPAM_MEDIUM(0.74)[0.741,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_SPAM_SHORT(0.77)[0.775,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 21:26:43 -0000 On 11/18/18 11:27 PM, Eugene Grosbein wrote: > Author: eugen > Date: Mon Nov 19 07:27:50 2018 > New Revision: 340617 > URL: https://svnweb.freebsd.org/changeset/base/340617 > > Log: > Unbreak ng_source(4) for 64-bit platforms including amd64. > > Modified: > head/sys/netgraph/ng_source.c > > Modified: head/sys/netgraph/ng_source.c > ============================================================================== > --- head/sys/netgraph/ng_source.c Mon Nov 19 06:52:20 2018 (r340616) > +++ head/sys/netgraph/ng_source.c Mon Nov 19 07:27:50 2018 (r340617) > @@ -125,8 +125,13 @@ static int ng_source_dup_mod(sc_p, struct mbuf *, > > /* Parse type for timeval */ > static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = { > +#ifdef __LP64__ > + { "tv_sec", &ng_parse_int64_type }, > + { "tv_usec", &ng_parse_int64_type }, > +#else > { "tv_sec", &ng_parse_int32_type }, > { "tv_usec", &ng_parse_int32_type }, > +#endif > { NULL } time_t (and thus tv_sec) is 64 bits on all but i386 now. tv_usec is still a long, so follows LP64 though. If this is trying to match an actual struct timeval then you might want something like this: #ifdef __i386__ { "tv_sec", &ng_parse_int32_type }, #else { "tv_sec", &ng_parse_int64_type }, #endif #ifdef __LP64__ { "tv_usec", &ng_parse_int32_type }, #else { "tv_usec", &ng_parse_int64_type }, #endif -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Mon Nov 26 21:45:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B9131145667; Mon, 26 Nov 2018 21:45:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E603D6C8B4; Mon, 26 Nov 2018 21:45:27 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BED9411B4E; Mon, 26 Nov 2018 21:45:27 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQLjRMK048497; Mon, 26 Nov 2018 21:45:27 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQLjRwO048495; Mon, 26 Nov 2018 21:45:27 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201811262145.wAQLjRwO048495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 26 Nov 2018 21:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340997 - head/lib/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/lib/libarchive X-SVN-Commit-Revision: 340997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E603D6C8B4 X-Spamd-Result: default: False [1.70 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.49)[0.493,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 21:45:28 -0000 Author: mm Date: Mon Nov 26 21:45:27 2018 New Revision: 340997 URL: https://svnweb.freebsd.org/changeset/base/340997 Log: libarchive configuration changes - move HAVE_BZLIB_H, HAVE_LIBLZMA and HAVE_LZMA_H to config_freebsd.h - activate support for multi-threaded lzma encoding [1] PR: 233543 [1] Reported by: cem MFC after: 1 week Modified: head/lib/libarchive/Makefile head/lib/libarchive/config_freebsd.h Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Mon Nov 26 20:56:05 2018 (r340996) +++ head/lib/libarchive/Makefile Mon Nov 26 21:45:27 2018 (r340997) @@ -7,7 +7,6 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive LIB= archive LIBADD= z bz2 lzma bsdxml -CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. Modified: head/lib/libarchive/config_freebsd.h ============================================================================== --- head/lib/libarchive/config_freebsd.h Mon Nov 26 20:56:05 2018 (r340996) +++ head/lib/libarchive/config_freebsd.h Mon Nov 26 21:45:27 2018 (r340997) @@ -133,14 +133,17 @@ #define HAVE_LCHFLAGS 1 #define HAVE_LCHMOD 1 #define HAVE_LCHOWN 1 +#define HAVE_LIBLZMA 1 #define HAVE_LIBZ 1 #define HAVE_LIMITS_H 1 #define HAVE_LINK 1 +#define HAVE_LZMA_H 1 #define HAVE_LOCALE_H 1 #define HAVE_LOCALTIME_R 1 #define HAVE_LONG_LONG_INT 1 #define HAVE_LSTAT 1 #define HAVE_LUTIMES 1 +#define HAVE_LZMA_STREAM_ENCODER_MT 1 #define HAVE_MBRTOWC 1 #define HAVE_MEMMOVE 1 #define HAVE_MEMORY_H 1 From owner-svn-src-head@freebsd.org Mon Nov 26 22:42:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A571311475F0; Mon, 26 Nov 2018 22:42:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43F6C6F33E; Mon, 26 Nov 2018 22:42:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 235991250C; Mon, 26 Nov 2018 22:42:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQMgrnk078780; Mon, 26 Nov 2018 22:42:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQMgrrx078779; Mon, 26 Nov 2018 22:42:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811262242.wAQMgrrx078779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 26 Nov 2018 22:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341001 - head/sys/dev/cxgbe/cxgbei X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/cxgbe/cxgbei X-SVN-Commit-Revision: 341001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 43F6C6F33E X-Spamd-Result: default: False [1.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.26)[0.258,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 22:42:53 -0000 Author: markj Date: Mon Nov 26 22:42:52 2018 New Revision: 341001 URL: https://svnweb.freebsd.org/changeset/base/341001 Log: Check for an allocation failure before dereferencing the pointer. Reported by: Ilja Van Sprundel Reviewed by: np MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18310 Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Nov 26 22:21:40 2018 (r341000) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Nov 26 22:42:52 2018 (r341001) @@ -449,9 +449,9 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he struct icl_pdu *ip0; ip0 = icl_cxgbei_new_pdu(M_NOWAIT); - icl_cxgbei_new_pdu_set_conn(ip0, ic); if (ip0 == NULL) CXGBE_UNIMPLEMENTED("PDU allocation failure"); + icl_cxgbei_new_pdu_set_conn(ip0, ic); icp0 = ip_to_icp(ip0); icp0->icp_seq = 0; /* XXX */ icp0->icp_flags = ICPF_RX_HDR | ICPF_RX_STATUS; From owner-svn-src-head@freebsd.org Mon Nov 26 22:45:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 669351147687; Mon, 26 Nov 2018 22:45:59 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C4C36F4E5; Mon, 26 Nov 2018 22:45:59 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E154E12512; Mon, 26 Nov 2018 22:45:58 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQMjwLg078978; Mon, 26 Nov 2018 22:45:58 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQMjws4078977; Mon, 26 Nov 2018 22:45:58 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201811262245.wAQMjws4078977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Mon, 26 Nov 2018 22:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341002 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markm X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 341002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C4C36F4E5 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_SHORT(0.30)[0.302,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 22:45:59 -0000 Author: markm Date: Mon Nov 26 22:45:58 2018 New Revision: 341002 URL: https://svnweb.freebsd.org/changeset/base/341002 Log: Add dependency to allow if_muge device to be only ethernet device in stripped-down RPI3 kernel. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 26 22:42:52 2018 (r341001) +++ head/sys/conf/files Mon Nov 26 22:45:58 2018 (r341002) @@ -3282,7 +3282,7 @@ dev/usb/net/if_urndis.c optional urndis dev/usb/net/ruephy.c optional rue dev/usb/net/usb_ethernet.c optional uether | aue | axe | axge | cdce | \ cue | ipheth | kue | mos | rue | \ - smsc | udav | ure | urndis + smsc | udav | ure | urndis | muge dev/usb/net/uhso.c optional uhso # # USB WLAN drivers From owner-svn-src-head@freebsd.org Mon Nov 26 22:50:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECFA1147878; Mon, 26 Nov 2018 22:50:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C954D6F73D; Mon, 26 Nov 2018 22:50:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB8AF12528; Mon, 26 Nov 2018 22:50:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQMoUAT079235; Mon, 26 Nov 2018 22:50:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQMoUbP079234; Mon, 26 Nov 2018 22:50:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811262250.wAQMoUbP079234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 26 Nov 2018 22:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341003 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 341003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C954D6F73D X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.30)[0.302,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.64)[0.643,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 22:50:31 -0000 Author: imp Date: Mon Nov 26 22:50:30 2018 New Revision: 341003 URL: https://svnweb.freebsd.org/changeset/base/341003 Log: Minor tweaks to the formatting Tweak the format of the trim + read bias code. Add similar debug to the read + writes case. Spondored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Mon Nov 26 22:45:58 2018 (r341002) +++ head/sys/cam/cam_iosched.c Mon Nov 26 22:50:30 2018 (r341003) @@ -1240,7 +1240,7 @@ cam_iosched_get_write(struct cam_iosched_softc *isc) "Reads present and current_read_bias is %d queued " "writes %d queued reads %d\n", isc->current_read_bias, isc->write_stats.queued, - isc->read_stats.queued); + isc->read_stats.queued); isc->current_read_bias--; /* We're not limiting writes, per se, just doing reads first */ return NULL; @@ -1326,14 +1326,18 @@ cam_iosched_get_trim(struct cam_iosched_softc *isc) if (!cam_iosched_has_more_trim(isc)) return NULL; #ifdef CAM_IOSCHED_DYNAMIC + /* + * If pending read, prefer that based on current read bias setting. The + * read bias is shared for both writes and TRIMs, but on TRIMs the bias + * is for a combined TRIM not a single TRIM request that's come in. + */ if (do_dynamic_iosched) { - /* - * If pending read, prefer that based on current read bias - * setting. The read bias is shared for both writes and - * TRIMs, but on TRIMs the bias is for a combined TRIM - * not a single TRIM request that's come in. - */ if (bioq_first(&isc->bio_queue) && isc->current_read_bias) { + if (iosched_debug) + printf("Reads present and current_read_bias is %d" + " queued trims %d queued reads %d\n", + isc->current_read_bias, isc->trim_stats.queued, + isc->read_stats.queued); isc->current_read_bias--; /* We're not limiting TRIMS, per se, just doing reads first */ return NULL; From owner-svn-src-head@freebsd.org Mon Nov 26 23:09:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60652114823B; Mon, 26 Nov 2018 23:09:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02324704AE; Mon, 26 Nov 2018 23:09:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1C9912874; Mon, 26 Nov 2018 23:09:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQN9jbx089423; Mon, 26 Nov 2018 23:09:45 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQN9jar089422; Mon, 26 Nov 2018 23:09:45 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201811262309.wAQN9jar089422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 26 Nov 2018 23:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341004 - head/lib/libufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/lib/libufs X-SVN-Commit-Revision: 341004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02324704AE X-Spamd-Result: default: False [1.33 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.12)[0.120,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; NEURAL_SPAM_LONG(0.64)[0.643,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 23:09:46 -0000 Author: mckusick Date: Mon Nov 26 23:09:45 2018 New Revision: 341004 URL: https://svnweb.freebsd.org/changeset/base/341004 Log: Bring up to date with recently added functions berase(3), getinode(3), putinode(3), sbget(3), and sbput(3). Sponsored by: Netflix Modified: head/lib/libufs/libufs.3 Modified: head/lib/libufs/libufs.3 ============================================================================== --- head/lib/libufs/libufs.3 Mon Nov 26 22:50:30 2018 (r341003) +++ head/lib/libufs/libufs.3 Mon Nov 26 23:09:45 2018 (r341004) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2018 +.Dd November 26, 2018 .Dt LIBUFS 3 .Os .Sh NAME @@ -53,6 +53,7 @@ field of .Vt "struct uufsd" to a string describing the error. .Sh SEE ALSO +.Xr berase 3 , .Xr bread 3 , .Xr bwrite 3 , .Xr cgget 3 , @@ -61,6 +62,10 @@ to a string describing the error. .Xr cgread1 3 , .Xr cgwrite 3 , .Xr cgwrite1 3 , +.Xr getinode 3 , +.Xr putinode 3 , +.Xr sbget 3 , +.Xr sbput 3 , .Xr sbread 3 , .Xr sbwrite 3 , .Xr ufs_disk_close 3 , From owner-svn-src-head@freebsd.org Mon Nov 26 23:29:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D33EE114890A for ; Mon, 26 Nov 2018 23:29:37 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 599B170F66; Mon, 26 Nov 2018 23:29:37 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAQNTURf060404 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Nov 2018 00:29:31 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: jhb@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAQNTTJe052666 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 27 Nov 2018 06:29:30 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r340617 - head/sys/netgraph To: John Baldwin , src-committers@freebsd.org, svn-src-head@freebsd.org References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> From: Eugene Grosbein Message-ID: <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> Date: Tue, 27 Nov 2018 06:29:24 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 599B170F66 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.10)[-0.102,0]; NEURAL_SPAM_LONG(0.75)[0.746,0]; NEURAL_SPAM_SHORT(0.13)[0.129,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 23:29:38 -0000 27.11.2018 4:26, John Baldwin wrote: >> /* Parse type for timeval */ >> static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = { >> +#ifdef __LP64__ >> + { "tv_sec", &ng_parse_int64_type }, >> + { "tv_usec", &ng_parse_int64_type }, >> +#else >> { "tv_sec", &ng_parse_int32_type }, >> { "tv_usec", &ng_parse_int32_type }, >> +#endif >> { NULL } > > time_t (and thus tv_sec) is 64 bits on all but i386 now. tv_usec is still a > long, so follows LP64 though. If this is trying to match an actual struct > timeval then you might want something like this: > > #ifdef __i386__ > { "tv_sec", &ng_parse_int32_type }, > #else > { "tv_sec", &ng_parse_int64_type }, > #endif > #ifdef __LP64__ > { "tv_usec", &ng_parse_int32_type }, > #else > { "tv_usec", &ng_parse_int64_type }, > #endif I'm not sure I get it right: do you mean there is a difference for some platform we have? From owner-svn-src-head@freebsd.org Mon Nov 26 23:35:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C964B1148C27 for ; Mon, 26 Nov 2018 23:35:57 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 312D9714BB for ; Mon, 26 Nov 2018 23:35:57 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1543275347; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=MolRgNg0aFmRrkYLsBKKsS5QXMCI+O6LYI2P17hGRAMDbFBTo95nAlGA/GbE9o/LpIYl7Yejn68Cn q0+3+LeFpi76mJGVbVVHmkqiN334XBmv6FMVJ8nE37yY72DJY5nXT80NcFZwQrWOBMUEiPuI9/Fybb Qrq1LvBQMZByEbT+JofYq4+F/al0CM9OrgQNcfx2hLDkLqsnq4rGddjoa8g43wdd5bOEBCLI8PB+jW U3PkDOBON3xVV0LLeqeCLmDFYafPLLTAkvdXDVbi8wk//5BZdo9eu8WiOgXqfT5A7Czs8TkgaXil45 UHrUPiaXcfIAyEcVbnX1iAMYJ7TLquQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=u64cyOEncdliR6UVEqYK8330m+aw28HhtAJiW9Xoi5E=; b=Yz4cJ4sk2LRpayUkz8gxr5o8x5ghysoGL85I1jqgL5XL80ht0pItnWTahCn3TvuuAREo6lvkiGYqT T2misiM8MtlFr+npbpRtH3aUywooPHluNKjs157jllm4OzPlTh6AEO91qi4++j8dg0JanwVVHUS1xK ++IwqEIVxMlH1S5VJyEa2ut9fjEy19KNzBI2Y5O+8fCsiwMGyIUH+mKQpYboNXTBTMjzqyNAF1nCBM bWZB1tpRJrH7TIgbtPT2vLUGPu2sA4XuCtwN17RnVkhF0BUQEjYGOuIHAhcFugEblTjJRQc/6yasTF kz/xvpLdc8CBK63HNAngTgpukPwmelw== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=u64cyOEncdliR6UVEqYK8330m+aw28HhtAJiW9Xoi5E=; b=FbmW6CS9HMnpfOVznc7E0CD6wG7xbEbpml335a9DYx4C2g7CI7RuDhE+Fk7BgUKuFAo5LLAO+ZJct SMTGJfVwRE7LuHU+CFKGe/t0xzpJ43hkz09Swe3TErV2MQyp6beNc69VuilgV0qELgApGYu882nBkc 4rqPIORbNXd9nYTCYNQTEZlg9zyL1cAOcAoiCSeN0kZ5z7Xh3tz3YOjAdJ+Pf8vAqDhez+xijzyD4l 47yypi8yaPuribxqX88zNcP5cX9l1WO97IBtoDFQP2kjM6nz/o7rMn1OyhRL7reAZnYL8CwGa9C4d3 bzj/nA2u72E05Ykf9CIxcAiGx0aoWSQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: fe74eeea-f1d3-11e8-8a28-a1efd8da9a94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id fe74eeea-f1d3-11e8-8a28-a1efd8da9a94; Mon, 26 Nov 2018 23:35:45 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wAQNZidR032434; Mon, 26 Nov 2018 16:35:44 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1543275344.1860.28.camel@freebsd.org> Subject: Re: svn commit: r340617 - head/sys/netgraph From: Ian Lepore To: Eugene Grosbein , John Baldwin , src-committers@freebsd.org, svn-src-head@freebsd.org Date: Mon, 26 Nov 2018 16:35:44 -0700 In-Reply-To: <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 312D9714BB X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.16)[-0.164,0]; NEURAL_SPAM_LONG(0.58)[0.576,0]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; NEURAL_HAM_SHORT(-0.05)[-0.046,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 23:35:58 -0000 On Tue, 2018-11-27 at 06:29 +0700, Eugene Grosbein wrote: > 27.11.2018 4:26, John Baldwin wrote: > > > > > > > > >  /* Parse type for timeval */ > > >  static const struct ng_parse_struct_field > > > ng_source_timeval_type_fields[] = { > > > +#ifdef __LP64__ > > > + { "tv_sec", &ng_parse_int64_type } > > > , > > > + { "tv_usec", &ng_parse_int64_type > > > }, > > > +#else > > >   { "tv_sec", &ng_parse_int32_type } > > > , > > >   { "tv_usec", &ng_parse_int32_type > > > }, > > > +#endif > > >   { NULL } > > time_t (and thus tv_sec) is 64 bits on all but i386 now.  tv_usec > > is still a > > long, so follows LP64 though.  If this is trying to match an actual > > struct > > timeval then you might want something like this: > > > > #ifdef __i386__ > >     { "tv_sec",         &ng_parse_int32_type }, > > #else > >     { "tv_sec",         &ng_parse_int64_type }, > > #endif > > #ifdef __LP64__ > >     { "tv_usec",        &ng_parse_int32_type }, > > #else > >     { "tv_usec",        &ng_parse_int64_type }, > > #endif > I'm not sure I get it right: do you mean there is a difference for > some platform we have? I think there's a typo there... it makes more sense if the second test is #ifndef __LP64__ (or swap the 32 and 64 in the true/false legs of the test as shown). -- Ian From owner-svn-src-head@freebsd.org Mon Nov 26 23:45:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 556391148EAE for ; Mon, 26 Nov 2018 23:45:16 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CE78471A13; Mon, 26 Nov 2018 23:45:15 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAQNj9d0060572 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Nov 2018 00:45:09 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: ian@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAQNj8lx052937 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 27 Nov 2018 06:45:08 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r340617 - head/sys/netgraph To: Ian Lepore , John Baldwin , src-committers@freebsd.org, svn-src-head@freebsd.org References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> <1543275344.1860.28.camel@freebsd.org> From: Eugene Grosbein Message-ID: <47a21d5b-f0a9-cd23-a5f4-870aabd09995@freebsd.org> Date: Tue, 27 Nov 2018 06:45:03 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1543275344.1860.28.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: CE78471A13 X-Spamd-Result: default: False [0.74 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.10)[-0.096,0]; NEURAL_SPAM_LONG(0.72)[0.723,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; NEURAL_SPAM_SHORT(0.11)[0.115,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 23:45:16 -0000 27.11.2018 6:35, Ian Lepore wrote: >>> #ifdef __LP64__ >>> { "tv_usec", &ng_parse_int32_type }, >>> #else >>> { "tv_usec", &ng_parse_int64_type }, >>> #endif >> I'm not sure I get it right: do you mean there is a difference for >> some platform we have? > > I think there's a typo there... it makes more sense if the second test > is #ifndef __LP64__ (or swap the 32 and 64 in the true/false legs of > the test as shown). That was obvious typo :-) and my question was not about it. From owner-svn-src-head@freebsd.org Tue Nov 27 00:03:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD2611497C3 for ; Tue, 27 Nov 2018 00:03:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E68A4725FB for ; Tue, 27 Nov 2018 00:03:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1543276051; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=J4/mqAWeVMr8gvI85R54lXvjlkx3lCRmmZnhPjVN2MefJwG4cRwU4H0zVCv2BhOiw5wVSWlA4MJF/ 7Pl/NhvFbTC5Af0YC2HL+vPbSFByJ0PYw1Fy4qfNcsJlKdcqSW1F7Ja8Yr55NrH6MeZlwhdo5BHgfQ NpN27qgj6DuuUlp0+B1qqSE5kGzlePxM+YdtzT6kWuFo2YkVx4TkjfbZqgnTs09CEtsAHVAYG+SaTJ /VviegbMQhPr7R1yKrR2dKXTRJrN6nrcuQXbb+/2UzOxg/pCRv6r4g/q5+s7uMtmmRGOu6Xn5mIAxq Lrjlhj+nrWuCjmrgi3KTTGAl5h7Omzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=VQYL9dtPdXg0y1OfohC5ggOz04B8CSYeSRS09kUb2ZU=; b=Wd1ByM84/MrJA6OvWIwXrz2teXEMyl8/1lncCIBoRhQgGrO7L8VCM1uuKOqExw6XIClH++YxslMVd YdJsCIO5//rU+w50oOWZQTMupgr60lS5SP+wr8jFpr2caxX+dRpf/oeZQOqFD8/M4EEuibQSOR+T+E UER98nGFWcnq5BCKIlllMwDW28UVgPpZs34oTUKUXFeWe5N/Dx0urSVSBQ6Als4QWm1iWqdQ8rYSuY VGVXx6ve541COyM4ALe5g5/WUmJ1iYzLndI99ERHrLKDcPs+7W5SX2fe7Mxu1Lp3K+Iy63Y0vOc3eN uXfv2nuabruhB64sLFtDuQoS22ZuOcg== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=VQYL9dtPdXg0y1OfohC5ggOz04B8CSYeSRS09kUb2ZU=; b=nN8L8LR6yRCr23OtLbWxbRQ7zajY29ZeYWdLOwbkwpJ6yBURdknwnNHEYFUnU6mM7gfodPNunvELY PazJea8jgksie1oXks37dH7yfhW5fav42rJBuf3+3kC2dtpFDE7leX7UkXDdOW5Bqe305O7bau2zsq hL6U3DY1WR2LxGfwOSmqpzQcs3FvquNNZWpo/+y45x7WqhKaoErlNsOjjoK0EsZX5TkVajGS1+jz/+ LXjEsM3v6bbggXNRTfqxmbL79m4SahvL+E5T54Ov2DLsEok9eF03EONTVjW5297HU1VxYwNzlJx9gD hKJ0BvuGZ95Q/w0cCLDhk24hGYuQLww== X-MHO-RoutePath: aGlwcGll X-MHO-User: a2303759-f1d5-11e8-a887-bd2f23b465e5 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id a2303759-f1d5-11e8-a887-bd2f23b465e5; Mon, 26 Nov 2018 23:47:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wAQNlSpk032481; Mon, 26 Nov 2018 16:47:28 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1543276048.1860.29.camel@freebsd.org> Subject: Re: svn commit: r340617 - head/sys/netgraph From: Ian Lepore To: Eugene Grosbein , John Baldwin , src-committers@freebsd.org, svn-src-head@freebsd.org Date: Mon, 26 Nov 2018 16:47:28 -0700 In-Reply-To: <47a21d5b-f0a9-cd23-a5f4-870aabd09995@freebsd.org> References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> <1543275344.1860.28.camel@freebsd.org> <47a21d5b-f0a9-cd23-a5f4-870aabd09995@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E68A4725FB X-Spamd-Result: default: False [0.48 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.03)[0.026,0]; NEURAL_SPAM_MEDIUM(0.14)[0.138,0]; NEURAL_SPAM_LONG(0.31)[0.314,0]; ASN(0.00)[asn:16509, ipnet:52.58.0.0/15, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 00:03:45 -0000 On Tue, 2018-11-27 at 06:45 +0700, Eugene Grosbein wrote: > 27.11.2018 6:35, Ian Lepore wrote: > > > > > > > > > > > > > > #ifdef __LP64__ > > > >     { "tv_usec",        &ng_parse_int32_type }, > > > > #else > > > >     { "tv_usec",        &ng_parse_int64_type }, > > > > #endif > > > I'm not sure I get it right: do you mean there is a difference > > > for > > > some platform we have? > > I think there's a typo there... it makes more sense if the second > > test > > is #ifndef __LP64__ (or swap the 32 and 64 in the true/false legs > > of > > the test as shown). > That was obvious typo :-) and my question was not about it. > Hrm, then what is your question? It seems like the suggested code is self-explanatory with the typo corrected. -- Ian From owner-svn-src-head@freebsd.org Tue Nov 27 00:15:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 386671149AC9 for ; Tue, 27 Nov 2018 00:15:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2F0872B81 for ; Tue, 27 Nov 2018 00:15:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd2c.google.com with SMTP id w7so15514509iom.12 for ; Mon, 26 Nov 2018 16:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d0Cm1wzoc1R4F7D/w496ir0uH2xi8BrStpIDx5TEBBQ=; b=fgYe9qUtFZiOziFBCyqr+QnrrVBPjnWvc0BOsq4miFGbQFx4ToahFeRbs33mbS1mj6 880Y7yYGclkABhi8RXO/S4fkMrCMRAfwaf3yBpvq3GrAqdwlWV80wg//1XDV67htYq6q eBuuIQenLQDD1pR4hrDprZ0H7kqU662tq44T1sMOGM+wmgKOiwWEbKkYZA3jqp3HSjP1 2BkBv2g58KDQBihvU72CHd2VH0QQuds4LsfLQPPs5ZVF9xPoq8T5Rzt973RAB5CK2k9P 4XWInRmGVnwCecN0POPXLjxvlzNqPE3jppEEdZ9FC2XKgu1Omky+wqu1o/Xv75WbmWX9 cvuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d0Cm1wzoc1R4F7D/w496ir0uH2xi8BrStpIDx5TEBBQ=; b=g1/ngayby0alNOMRfoYDS87nQR2xWBbKok4NhMnzIr/6kgE6H/lTrgf7Jdpa0gchvY 6cODMVeaNRewPkgGROeDEaDwg5WeXPzCCTIB0PgWbpd8IPi/NSHlhqCLQ0t8nWZfZuv2 RMKNrDoexnq2Y2NogUivSF5y2BM37coSJxeYiheAwFFm9GU9kKucTW8CZupjV84oU5LQ rNWZO+8QyKlb2qcoeXvJ1Ae9bcEvCEHk1Ag8qJJk66ur0+ehtrKUwjteMLC422/RwiyF 2pMIFuSS/hKDrKAnaqekwWUp9ysXkRUJkoxJ7H6bGYenMmlifKO781+h2fMdl4l2fJF/ iCZg== X-Gm-Message-State: AA+aEWYLrItFDqe2cGiAe9zC8awzr8DWUGdEirBcpMoJ6ZHFOPSfTSsW lNaMW1/eNBQe2DGJJuU7DP7OA6PjJ+sdA6WVjxZa6g== X-Google-Smtp-Source: AFSGD/WwNAxagYkOyJtBnsNm0DjCF/W39/UOwOxpjCc37oUdEkWNaQraApaa0OmViYzDcZn1tCi/0762t4dlxEs5KiA= X-Received: by 2002:a5e:d808:: with SMTP id l8mr8684150iok.299.1543277730747; Mon, 26 Nov 2018 16:15:30 -0800 (PST) MIME-Version: 1.0 References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> In-Reply-To: <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> From: Warner Losh Date: Mon, 26 Nov 2018 17:15:19 -0700 Message-ID: Subject: Re: svn commit: r340617 - head/sys/netgraph To: eugen@freebsd.org Cc: John Baldwin , src-committers , svn-src-head@freebsd.org X-Rspamd-Queue-Id: A2F0872B81 X-Spamd-Result: default: False [-5.31 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[c.2.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.34)[ip: (-8.45), ipnet: 2607:f8b0::/32(-1.78), asn: 15169(-1.37), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 00:15:32 -0000 On Mon, Nov 26, 2018 at 4:29 PM Eugene Grosbein wrote: > 27.11.2018 4:26, John Baldwin wrote: > > >> /* Parse type for timeval */ > >> static const struct ng_parse_struct_field > ng_source_timeval_type_fields[] = { > >> +#ifdef __LP64__ > >> + { "tv_sec", &ng_parse_int64_type }, > >> + { "tv_usec", &ng_parse_int64_type }, > >> +#else > >> { "tv_sec", &ng_parse_int32_type }, > >> { "tv_usec", &ng_parse_int32_type }, > >> +#endif > >> { NULL } > > > > time_t (and thus tv_sec) is 64 bits on all but i386 now. tv_usec is > still a > > long, so follows LP64 though. If this is trying to match an actual > struct > > timeval then you might want something like this: > > > > #ifdef __i386__ > > { "tv_sec", &ng_parse_int32_type }, > > #else > > { "tv_sec", &ng_parse_int64_type }, > > #endif > > #ifdef __LP64__ > > { "tv_usec", &ng_parse_int32_type }, > > #else > > { "tv_usec", &ng_parse_int64_type }, > > #endif > > I'm not sure I get it right: do you mean there is a difference for some > platform we have? > time_t is 64-bits in FreeBSD for all architectures regardless of __LP64__, except it's 32-bits on i386. Warner From owner-svn-src-head@freebsd.org Tue Nov 27 00:25:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF66C1149FA3 for ; Tue, 27 Nov 2018 00:25:17 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CFF1738F7; Tue, 27 Nov 2018 00:25:17 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAR0P8QA060929 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Nov 2018 01:25:09 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAR0P7wh053156 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 27 Nov 2018 07:25:08 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r340617 - head/sys/netgraph To: Warner Losh References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> Cc: John Baldwin , src-committers , svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <557d9e3e-233b-f187-ec89-b114b9948114@freebsd.org> Date: Tue, 27 Nov 2018 07:25:02 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 1CFF1738F7 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.13)[-0.134,0]; NEURAL_SPAM_LONG(0.27)[0.275,0]; NEURAL_SPAM_MEDIUM(0.31)[0.314,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 00:25:17 -0000 27.11.2018 7:15, Warner Losh wrote: > I'm not sure I get it right: do you mean there is a difference for some platform we have? > > time_t is 64-bits in FreeBSD for all architectures regardless of __LP64__, except it's 32-bits on i386. Now I've got it :-) thanks. From owner-svn-src-head@freebsd.org Tue Nov 27 00:36:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD183114A35C; Tue, 27 Nov 2018 00:36:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80D6A741D7; Tue, 27 Nov 2018 00:36:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 598F51372D; Tue, 27 Nov 2018 00:36:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAR0aa4A035844; Tue, 27 Nov 2018 00:36:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAR0aZZB035842; Tue, 27 Nov 2018 00:36:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811270036.wAR0aZZB035842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 27 Nov 2018 00:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341005 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 341005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80D6A741D7 X-Spamd-Result: default: False [1.22 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.02)[0.022,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_LONG(0.51)[0.511,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 00:36:37 -0000 Author: imp Date: Tue Nov 27 00:36:35 2018 New Revision: 341005 URL: https://svnweb.freebsd.org/changeset/base/341005 Log: NVME trim clocking Add the ability to set two goals for trims in the I/O scheduler. The first goal is the number of BIO_DELETEs to accumulate (kern.cam.XX.U.trim_goal). When non-zero, this many trims will be accumulated before we start to transfer them to lower layers. This is useful for devices that like to get lots of trims all at once in one transaction (not all devices are like this, and some vary by workload). The second is a number of ticks to defer trims. If you've set a trim goal, then kern.cam.XX.U.trim_ticks controls how long the system will defer those trims before timing out and sending them anyway. It has no effect when trim_goal is 0. In any event, a BIO_FLUSH will cause all the TRIMs to be released to the periph drivers. This may be a minor overloading of what BIO_FLUSH is supposed to mean, but it's useful to preserve other ordering semantics that users of BIO_FLUSH reply on. Sponsored by: Netflix, Inc Modified: head/sys/cam/cam_iosched.c head/sys/cam/cam_iosched.h Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Mon Nov 26 23:09:45 2018 (r341004) +++ head/sys/cam/cam_iosched.c Tue Nov 27 00:36:35 2018 (r341005) @@ -277,6 +277,10 @@ struct cam_iosched_softc { /* scheduler flags < 16, user flags >= 16 */ uint32_t flags; int sort_io_queue; + int trim_goal; /* # of trims to queue before sending */ + int trim_ticks; /* Max ticks to hold trims */ + int last_trim_tick; /* Last 'tick' time ld a trim */ + int queued_trims; /* Number of trims in the queue */ #ifdef CAM_IOSCHED_DYNAMIC int read_bias; /* Read bias setting */ int current_read_bias; /* Current read bias state */ @@ -751,6 +755,22 @@ cam_iosched_has_io(struct cam_iosched_softc *isc) static inline bool cam_iosched_has_more_trim(struct cam_iosched_softc *isc) { + + /* + * If we've set a trim_goal, then if we exceed that allow trims + * to be passed back to the driver. If we've also set a tick timeout + * allow trims back to the driver. Otherwise, don't allow trims yet. + */ + if (isc->trim_goal > 0) { + if (isc->queued_trims >= isc->trim_goal) + return true; + if (isc->queued_trims > 0 && + isc->trim_ticks > 0 && + ticks - isc->last_trim_tick > isc->trim_ticks) + return true; + return false; + } + return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && bioq_first(&isc->trim_queue); } @@ -1131,14 +1151,21 @@ cam_iosched_fini(struct cam_iosched_softc *isc) void cam_iosched_sysctl_init(struct cam_iosched_softc *isc, struct sysctl_ctx_list *ctx, struct sysctl_oid *node) { -#ifdef CAM_IOSCHED_DYNAMIC struct sysctl_oid_list *n; -#endif - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(node), + n = SYSCTL_CHILDREN(node); + SYSCTL_ADD_INT(ctx, n, OID_AUTO, "sort_io_queue", CTLFLAG_RW | CTLFLAG_MPSAFE, &isc->sort_io_queue, 0, "Sort IO queue to try and optimise disk access patterns"); + SYSCTL_ADD_INT(ctx, n, + OID_AUTO, "trim_goal", CTLFLAG_RW, + &isc->trim_goal, 0, + "Number of trims to try to accumulate before sending to hardware"); + SYSCTL_ADD_INT(ctx, n, + OID_AUTO, "trim_ticks", CTLFLAG_RW, + &isc->trim_goal, 0, + "IO Schedul qaunta to hold back trims for when accumulating"); #ifdef CAM_IOSCHED_DYNAMIC if (!do_dynamic_iosched) @@ -1193,6 +1220,41 @@ cam_iosched_set_latfcn(struct cam_iosched_softc *isc, } /* + * Client drivers can set two parameters. "goal" is the number of BIO_DELETEs + * that will be queued up before iosched will "release" the trims to the client + * driver to wo with what they will (usually combine as many as possible). If we + * don't get this many, after trim_ticks we'll submit the I/O anyway with + * whatever we have. We do need an I/O of some kind of to clock the deferred + * trims out to disk. Since we will eventually get a write for the super block + * or something before we shutdown, the trims will complete. To be safe, when a + * BIO_FLUSH is presented to the iosched work queue, we set the ticks time far + * enough in the past so we'll present the BIO_DELETEs to the client driver. + * There might be a race if no BIO_DELETESs were queued, a BIO_FLUSH comes in + * and then a BIO_DELETE is sent down. No know client does this, and there's + * already a race between an ordered BIO_FLUSH and any BIO_DELETEs in flight, + * but no client depends on the ordering being honored. + * + * XXX I'm not sure what the interaction between UFS direct BIOs and the BUF + * flushing on shutdown. I think there's bufs that would be dependent on the BIO + * finishing to write out at least metadata, so we'll be fine. To be safe, keep + * the number of ticks low (less than maybe 10s) to avoid shutdown races. + */ + +void +cam_iosched_set_trim_goal(struct cam_iosched_softc *isc, int goal) +{ + + isc->trim_goal = goal; +} + +void +cam_iosched_set_trim_ticks(struct cam_iosched_softc *isc, int trim_ticks) +{ + + isc->trim_ticks = trim_ticks; +} + +/* * Flush outstanding I/O. Consumers of this library don't know all the * queues we may keep, so this allows all I/O to be flushed in one * convenient call. @@ -1281,6 +1343,9 @@ void cam_iosched_put_back_trim(struct cam_iosched_softc *isc, struct bio *bp) { bioq_insert_head(&isc->trim_queue, bp); + if (isc->queued_trims == 0) + isc->last_trim_tick = ticks; + isc->queued_trims++; #ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.queued++; isc->trim_stats.total--; /* since we put it back, don't double count */ @@ -1304,6 +1369,8 @@ cam_iosched_next_trim(struct cam_iosched_softc *isc) if (bp == NULL) return NULL; bioq_remove(&isc->trim_queue, bp); + isc->queued_trims--; + isc->last_trim_tick = ticks; /* Reset the tick timer when we take trims */ #ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.queued--; isc->trim_stats.total++; @@ -1430,12 +1497,22 @@ cam_iosched_queue_work(struct cam_iosched_softc *isc, { /* - * Put all trims on the trim queue sorted, since we know - * that the collapsing code requires this. Otherwise put - * the work on the bio queue. + * If we get a BIO_FLUSH, and we're doing delayed BIO_DELETEs then we + * set the last tick time to one less than the current ticks minus the + * delay to force the BIO_DELETEs to be presented to the client driver. */ + if (bp->bio_cmd == BIO_FLUSH && isc->trim_ticks > 0) + isc->last_trim_tick = ticks - isc->trim_ticks - 1; + + /* + * Put all trims on the trim queue. Otherwise put the work on the bio + * queue. + */ if (bp->bio_cmd == BIO_DELETE) { bioq_insert_tail(&isc->trim_queue, bp); + if (isc->queued_trims == 0) + isc->last_trim_tick = ticks; + isc->queued_trims++; #ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.in++; isc->trim_stats.queued++; Modified: head/sys/cam/cam_iosched.h ============================================================================== --- head/sys/cam/cam_iosched.h Mon Nov 26 23:09:45 2018 (r341004) +++ head/sys/cam/cam_iosched.h Tue Nov 27 00:36:35 2018 (r341005) @@ -101,6 +101,7 @@ void cam_iosched_clr_work_flags(struct cam_iosched_sof void cam_iosched_trim_done(struct cam_iosched_softc *isc); int cam_iosched_bio_complete(struct cam_iosched_softc *isc, struct bio *bp, union ccb *done_ccb); void cam_iosched_set_latfcn(struct cam_iosched_softc *isc, cam_iosched_latfcn_t, void *); - +void cam_iosched_set_trim_goal(struct cam_iosched_softc *isc, int goal); +void cam_iosched_set_trim_ticks(struct cam_iosched_softc *isc, int ticks); #endif #endif From owner-svn-src-head@freebsd.org Tue Nov 27 03:18:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528751137501 for ; Tue, 27 Nov 2018 03:18:29 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A56217F11A; Tue, 27 Nov 2018 03:18:28 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAR3IJUa062872 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Nov 2018 04:18:19 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAR3IHXb054528 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 27 Nov 2018 10:18:18 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r340617 - head/sys/netgraph To: Warner Losh References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> Cc: John Baldwin , src-committers , svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <7ee81b60-1984-e3cf-32ad-3a06fcceba60@freebsd.org> Date: Tue, 27 Nov 2018 10:18:12 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: A56217F11A X-Spamd-Result: default: False [0.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.27)[0.275,0]; NEURAL_SPAM_MEDIUM(0.31)[0.314,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; NEURAL_SPAM_SHORT(0.33)[0.327,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 03:18:29 -0000 27.11.2018 7:15, Warner Losh wrote: > time_t is 64-bits in FreeBSD for all architectures regardless of __LP64__, except it's 32-bits on i386. > > Warner sys/powerpc/include/_types.h defines time_t being 32 or 64 bit depending on __LP64__ just like sys/x86/include/_types.h does. Does 32-bit PowerPC mode actually exist/is supported? From owner-svn-src-head@freebsd.org Tue Nov 27 03:22:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94ADE113783E for ; Tue, 27 Nov 2018 03:22:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x131.google.com (mail-it1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8A5F7F58B for ; Tue, 27 Nov 2018 03:22:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x131.google.com with SMTP id x19so32053123itl.1 for ; Mon, 26 Nov 2018 19:22:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GdbP5pbC0emVUxL1VeJdJmQOz5RlhHiTzgbvacCsAN4=; b=Afi7KoeSXe6E38CfZOO+oNvNEhpacT3dUGY7VGSqjqD4NU0TOl9mnUGHkZKCWa+eQk Yu5QIGKKe7za0HA4G1gqsO+VqUioF0DSMnKkr5kTpqO5C25NgoriEjBjySbv2KvcqC5T 7UrSyGxcpHWiIoPy/qPUpZCXZSIprQTugEMiMbVG9upa9G5K0map33UO9AUYRGGaz+i/ KloE5I7mWf/EoaKnkTSIOXYiOcK3/qKHN7nVt7HuWBMMWeUjwcDstdHBoDmbbzr/Ci3H AxF/Q5iTvGZAMI1kQaxINaygN7/Fbc0au6DzimHcmSl7SMP9rGYIFEt4fwiIlX//Mp6e QCAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GdbP5pbC0emVUxL1VeJdJmQOz5RlhHiTzgbvacCsAN4=; b=AjbCAp1sJD/Xa+7Jqh7FZtE15Iu1cG+PqfoB+tYqJAShCepOASzZ6EaLpYdvEuwcCB w3hKxh+YmShD8Xb++Vrsj6aSzhuPMF3oRgBuqrUhIu9iFoobSsGznT6OsArRgykFJ59E 9nHso2JCaJ/+lFjNhfAwm15z/3KJctS2FYuqlD1NJvMzSYdw6lNuKkYKPKvE50LjhJAg g9U6VnPIqBRMrqgNLKOIRIstb5hlm1nwHD8szvFeLBr1jqmAsbyoeuttD1PnklHBMF7T 7ddneQRCztgi0XOCCQ23mpb8YbmJxdl9U4OxySk8CeiLbbr4Bixu/VdOMM/QZ2bFXV29 zH7Q== X-Gm-Message-State: AGRZ1gL8iXNIrt8AIkSZe9ZG7gE8yWDfB12gA3uAHTPzJrSZ4+H2+w5a 2TpUiYvvl/Of6gl9Xb3D7kWRO751IEQv2cwBtJokkA== X-Google-Smtp-Source: AJdET5easFKBccMTquxuHpdlN1z/Sx8Gbfzgozna/jh3yfmEmVRhPcBZDfaaGPXpYhBw4uLrchfCJbefYlO10LqJSyQ= X-Received: by 2002:a02:1b1d:: with SMTP id l29mr27110986jad.98.1543288937037; Mon, 26 Nov 2018 19:22:17 -0800 (PST) MIME-Version: 1.0 References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> <7ee81b60-1984-e3cf-32ad-3a06fcceba60@freebsd.org> In-Reply-To: <7ee81b60-1984-e3cf-32ad-3a06fcceba60@freebsd.org> From: Warner Losh Date: Mon, 26 Nov 2018 20:22:06 -0700 Message-ID: Subject: Re: svn commit: r340617 - head/sys/netgraph To: eugen@freebsd.org Cc: John Baldwin , src-committers , svn-src-head@freebsd.org X-Rspamd-Queue-Id: B8A5F7F58B X-Spamd-Result: default: False [-4.94 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.97)[ip: (-6.56), ipnet: 2607:f8b0::/32(-1.80), asn: 15169(-1.39), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 03:22:18 -0000 On Mon, Nov 26, 2018 at 8:18 PM Eugene Grosbein wrote: > 27.11.2018 7:15, Warner Losh wrote: > > > time_t is 64-bits in FreeBSD for all architectures regardless of > __LP64__, except it's 32-bits on i386. > > > > Warner > > sys/powerpc/include/_types.h defines time_t being 32 or 64 bit depending > on __LP64__ > just like sys/x86/include/_types.h does. > > Does 32-bit PowerPC mode actually exist/is supported? > typedef __int64_t __time_t; /* time()... */ is what I see, unconditionally. It used to be 32-bit years ago... 32-bit powerpc is still a thing. Warner From owner-svn-src-head@freebsd.org Tue Nov 27 03:39:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 098EC1137FEF for ; Tue, 27 Nov 2018 03:39:44 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8351E7FCE6; Tue, 27 Nov 2018 03:39:43 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAR3dZMw063034 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Nov 2018 04:39:36 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAR3dZj9054718 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 27 Nov 2018 10:39:35 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r340617 - head/sys/netgraph To: Warner Losh References: <201811190727.wAJ7RpDN052165@repo.freebsd.org> <5e7d2e8e-2a06-e687-f4c1-5c30ee4c50be@freebsd.org> <7ee81b60-1984-e3cf-32ad-3a06fcceba60@freebsd.org> Cc: John Baldwin , src-committers , svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: Date: Tue, 27 Nov 2018 10:39:29 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 8351E7FCE6 X-Spamd-Result: default: False [0.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.33)[0.327,0]; NEURAL_SPAM_MEDIUM(0.31)[0.314,0]; NEURAL_SPAM_LONG(0.27)[0.275,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 03:39:44 -0000 27.11.2018 10:22, Warner Losh пишет: > > > On Mon, Nov 26, 2018 at 8:18 PM Eugene Grosbein > wrote: > > 27.11.2018 7:15, Warner Losh wrote: > > > time_t is 64-bits in FreeBSD for all architectures regardless of __LP64__, except it's 32-bits on i386. > > > > Warner > > sys/powerpc/include/_types.h defines time_t being 32 or 64 bit depending on __LP64__ > just like sys/x86/include/_types.h does. > > Does 32-bit PowerPC mode actually exist/is supported? > > > typedef __int64_t __time_t; /* time()... */ > > is what I see, unconditionally. It used to be 32-bit years ago... In fact, it is 32-bit in stable/11 :-) It was changed 17 months ago, https://svnweb.freebsd.org/base?view=revision&revision=320347 and never merged, so 12.0-RELEASE will be the first release with 64-bit time_t for powerpc32. > 32-bit powerpc is still a thing. OK From owner-svn-src-head@freebsd.org Tue Nov 27 04:05:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A52A11389D0; Tue, 27 Nov 2018 04:05:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A29E980ABA; Tue, 27 Nov 2018 04:05:38 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7936916024; Tue, 27 Nov 2018 04:05:38 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAR45cQk044830; Tue, 27 Nov 2018 04:05:38 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAR45cmZ044829; Tue, 27 Nov 2018 04:05:38 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811270405.wAR45cmZ044829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 27 Nov 2018 04:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341006 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 341006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A29E980ABA X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.245,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_LONG(0.47)[0.465,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 04:05:39 -0000 Author: eugen Date: Tue Nov 27 04:05:38 2018 New Revision: 341006 URL: https://svnweb.freebsd.org/changeset/base/341006 Log: ng_source(4): correction after the change r340617 tv_usec has "long" type for all architecture in FreeBSD and follows __LP64__. However, this is not true for tv_sec that has "time_t" type. Since r320347 that changed time_t from 32 to 64 bit integer for 32 bit version of powerpc architecture, we have only single i386 architecture having 32 bit time_t type. Submitted by: jhb MFC after: 1 week. Modified: head/sys/netgraph/ng_source.c Modified: head/sys/netgraph/ng_source.c ============================================================================== --- head/sys/netgraph/ng_source.c Tue Nov 27 00:36:35 2018 (r341005) +++ head/sys/netgraph/ng_source.c Tue Nov 27 04:05:38 2018 (r341006) @@ -125,11 +125,14 @@ static int ng_source_dup_mod(sc_p, struct mbuf *, /* Parse type for timeval */ static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = { -#ifdef __LP64__ +#ifdef __i386__ + { "tv_sec", &ng_parse_int32_type }, +#else { "tv_sec", &ng_parse_int64_type }, +#endif +#ifdef __LP64__ { "tv_usec", &ng_parse_int64_type }, #else - { "tv_sec", &ng_parse_int32_type }, { "tv_usec", &ng_parse_int32_type }, #endif { NULL } From owner-svn-src-head@freebsd.org Tue Nov 27 08:51:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB1C311400E8; Tue, 27 Nov 2018 08:51:16 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B44A6BD88; Tue, 27 Nov 2018 08:51:16 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C81518DE0; Tue, 27 Nov 2018 08:51:16 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAR8pGbM092190; Tue, 27 Nov 2018 08:51:16 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAR8pGvB092189; Tue, 27 Nov 2018 08:51:16 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811270851.wAR8pGvB092189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Tue, 27 Nov 2018 08:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341007 - head/stand/i386/pxeldr X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/stand/i386/pxeldr X-SVN-Commit-Revision: 341007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B44A6BD88 X-Spamd-Result: default: False [1.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.417,0]; NEURAL_SPAM_MEDIUM(0.60)[0.595,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.422,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 08:51:17 -0000 Author: ygy (doc committer) Date: Tue Nov 27 08:51:15 2018 New Revision: 341007 URL: https://svnweb.freebsd.org/changeset/base/341007 Log: Bump the date of pxeboot(8) manual page for r340917. PR: 123484 MFC after: 5 days Modified: head/stand/i386/pxeldr/pxeboot.8 Modified: head/stand/i386/pxeldr/pxeboot.8 ============================================================================== --- head/stand/i386/pxeldr/pxeboot.8 Tue Nov 27 04:05:38 2018 (r341006) +++ head/stand/i386/pxeldr/pxeboot.8 Tue Nov 27 08:51:15 2018 (r341007) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2017 +.Dd November 25, 2018 .Dt PXEBOOT 8 .Os .Sh NAME From owner-svn-src-head@freebsd.org Tue Nov 27 09:04:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF08114107B; Tue, 27 Nov 2018 09:04:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01C356C918; Tue, 27 Nov 2018 09:04:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6E771911C; Tue, 27 Nov 2018 09:04:06 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAR946Tm098915; Tue, 27 Nov 2018 09:04:06 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAR946K9098913; Tue, 27 Nov 2018 09:04:06 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811270904.wAR946K9098913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 27 Nov 2018 09:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341008 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 341008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01C356C918 X-Spamd-Result: default: False [1.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.456,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 09:04:07 -0000 Author: ae Date: Tue Nov 27 09:04:06 2018 New Revision: 341008 URL: https://svnweb.freebsd.org/changeset/base/341008 Log: Fix possible panic during ifnet detach in rtsock. The panic can happen, when some application does dump of routing table using sysctl interface. To prevent this, set IFF_DYING flag in if_detach_internal() function, when ifnet under lock is removed from the chain. In sysctl_rtsock() take IFNET_RLOCK_NOSLEEP() to prevent ifnet detach during routes enumeration. In case, if some interface was detached in the time before we take the lock, add the check, that ifnet is not DYING. This prevents access to memory that could be freed after ifnet is unlinked. PR: 227720, 230498, 233306 Reviewed by: bz, eugen MFC after: 1 week Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D18338 Modified: head/sys/net/if.c head/sys/net/rtsock.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Nov 27 08:51:15 2018 (r341007) +++ head/sys/net/if.c Tue Nov 27 09:04:06 2018 (r341008) @@ -1068,6 +1068,8 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc CK_STAILQ_FOREACH(iter, &V_ifnet, if_link) if (iter == ifp) { CK_STAILQ_REMOVE(&V_ifnet, ifp, ifnet, if_link); + if (!vmove) + ifp->if_flags |= IFF_DYING; found = 1; break; } Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Nov 27 08:51:15 2018 (r341007) +++ head/sys/net/rtsock.c Tue Nov 27 09:04:06 2018 (r341008) @@ -1559,6 +1559,8 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) struct rt_addrinfo info; struct sockaddr_storage ss; + IFNET_RLOCK_NOSLEEP_ASSERT(); + if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg)) return 0; if ((rt->rt_flags & RTF_HOST) == 0 @@ -1571,7 +1573,7 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(rt_key(rt), rt_mask(rt), &ss); info.rti_info[RTAX_GENMASK] = 0; - if (rt->rt_ifp) { + if (rt->rt_ifp && !(rt->rt_ifp->if_flags & IFF_DYING)) { info.rti_info[RTAX_IFP] = rt->rt_ifp->if_addr->ifa_addr; info.rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr; if (rt->rt_ifp->if_flags & IFF_POINTOPOINT) @@ -1934,8 +1936,10 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) rnh = rt_tables_get_rnh(fib, i); if (rnh != NULL) { RIB_RLOCK(rnh); + IFNET_RLOCK_NOSLEEP(); error = rnh->rnh_walktree(&rnh->head, sysctl_dumpentry, &w); + IFNET_RUNLOCK_NOSLEEP(); RIB_RUNLOCK(rnh); } else if (af != 0) error = EAFNOSUPPORT; From owner-svn-src-head@freebsd.org Tue Nov 27 09:41:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1681143057; Tue, 27 Nov 2018 09:41:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 929966E7F9; Tue, 27 Nov 2018 09:41:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7475219831; Tue, 27 Nov 2018 09:41:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAR9fm9Q019786; Tue, 27 Nov 2018 09:41:48 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAR9flYD019783; Tue, 27 Nov 2018 09:41:47 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811270941.wAR9flYD019783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 27 Nov 2018 09:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341009 - in head: lib/libc/net usr.sbin/nscd X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head: lib/libc/net usr.sbin/nscd X-SVN-Commit-Revision: 341009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 929966E7F9 X-Spamd-Result: default: False [1.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.46)[0.456,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 09:41:49 -0000 Author: des Date: Tue Nov 27 09:41:47 2018 New Revision: 341009 URL: https://svnweb.freebsd.org/changeset/base/341009 Log: Style cleanup. Modified: head/lib/libc/net/nscachedcli.c head/usr.sbin/nscd/nscdcli.c head/usr.sbin/nscd/query.c Modified: head/lib/libc/net/nscachedcli.c ============================================================================== --- head/lib/libc/net/nscachedcli.c Tue Nov 27 09:04:06 2018 (r341008) +++ head/lib/libc/net/nscachedcli.c Tue Nov 27 09:41:47 2018 (r341009) @@ -144,29 +144,27 @@ safe_read(struct cached_connection_ *connection, void static int send_credentials(struct cached_connection_ *connection, int type) { + union { + struct cmsghdr hdr; + char pad[CMSG_SPACE(sizeof(struct cmsgcred))]; + } cmsg; + struct msghdr mhdr; + struct iovec iov; struct kevent eventlist; int nevents; ssize_t result; int res; - struct msghdr cred_hdr; - struct iovec iov; - - struct { - struct cmsghdr hdr; - char cred[CMSG_SPACE(sizeof(struct cmsgcred))]; - } cmsg; - memset(&cmsg, 0, sizeof(cmsg)); - cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred)); + cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred)); cmsg.hdr.cmsg_level = SOL_SOCKET; cmsg.hdr.cmsg_type = SCM_CREDS; - memset(&cred_hdr, 0, sizeof(struct msghdr)); - cred_hdr.msg_iov = &iov; - cred_hdr.msg_iovlen = 1; - cred_hdr.msg_control = (caddr_t)&cmsg; - cred_hdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); + memset(&mhdr, 0, sizeof(mhdr)); + mhdr.msg_iov = &iov; + mhdr.msg_iovlen = 1; + mhdr.msg_control = &cmsg; + mhdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); iov.iov_base = &type; iov.iov_len = sizeof(int); @@ -178,8 +176,8 @@ send_credentials(struct cached_connection_ *connection nevents = _kevent(connection->write_queue, NULL, 0, &eventlist, 1, NULL); if (nevents == 1 && eventlist.filter == EVFILT_WRITE) { - result = (_sendmsg(connection->sockfd, &cred_hdr, - MSG_NOSIGNAL) == -1) ? -1 : 0; + result = _sendmsg(connection->sockfd, &mhdr, + MSG_NOSIGNAL) == -1 ? -1 : 0; EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD, 0, 0, NULL); _kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL); Modified: head/usr.sbin/nscd/nscdcli.c ============================================================================== --- head/usr.sbin/nscd/nscdcli.c Tue Nov 27 09:04:06 2018 (r341008) +++ head/usr.sbin/nscd/nscdcli.c Tue Nov 27 09:41:47 2018 (r341009) @@ -130,44 +130,41 @@ safe_read(struct nscd_connection_ *connection, void *d static int send_credentials(struct nscd_connection_ *connection, int type) { + union { + struct cmsghdr hdr; + char pad[CMSG_SPACE(sizeof(struct cmsgcred))]; + } cmsg; + struct msghdr mhdr; + struct iovec iov; struct kevent eventlist; int nevents; ssize_t result; int res; - struct msghdr cred_hdr; - struct iovec iov; - - union { - struct cmsghdr hdr; - char cred[CMSG_SPACE(sizeof(struct cmsgcred))]; - } cmsg; - TRACE_IN(send_credentials); memset(&cmsg, 0, sizeof(cmsg)); cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred)); cmsg.hdr.cmsg_level = SOL_SOCKET; cmsg.hdr.cmsg_type = SCM_CREDS; - memset(&cred_hdr, 0, sizeof(struct msghdr)); - cred_hdr.msg_iov = &iov; - cred_hdr.msg_iovlen = 1; - cred_hdr.msg_control = &cmsg; - cred_hdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); + memset(&mhdr, 0, sizeof(mhdr)); + mhdr.msg_iov = &iov; + mhdr.msg_iovlen = 1; + mhdr.msg_control = &cmsg; + mhdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); iov.iov_base = &type; iov.iov_len = sizeof(int); EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD, - NOTE_LOWAT, sizeof(int), NULL); + NOTE_LOWAT, sizeof(int), NULL); res = kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL); nevents = kevent(connection->write_queue, NULL, 0, &eventlist, 1, NULL); if ((nevents == 1) && (eventlist.filter == EVFILT_WRITE)) { - result = (sendmsg(connection->sockfd, &cred_hdr, 0) == -1) ? -1 - : 0; + result = sendmsg(connection->sockfd, &mhdr, 0) == -1 ? -1 : 0; EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD, - 0, 0, NULL); + 0, 0, NULL); kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL); TRACE_OUT(send_credentials); return (result); Modified: head/usr.sbin/nscd/query.c ============================================================================== --- head/usr.sbin/nscd/query.c Tue Nov 27 09:04:06 2018 (r341008) +++ head/usr.sbin/nscd/query.c Tue Nov 27 09:41:47 2018 (r341009) @@ -155,38 +155,37 @@ clear_config_entry_part(struct configuration_entry *co static int on_query_startup(struct query_state *qstate) { - struct msghdr cred_hdr; - struct iovec iov; + union { + struct cmsghdr hdr; + char pad[CMSG_SPACE(sizeof(struct cmsgcred))]; + } cmsg; + struct msghdr mhdr; + struct iovec iov; struct cmsgcred *cred; int elem_type; - union { - struct cmsghdr hdr; - char cred[CMSG_SPACE(sizeof(struct cmsgcred))]; - } cmsg; - TRACE_IN(on_query_startup); assert(qstate != NULL); - memset(&cred_hdr, 0, sizeof(struct msghdr)); - cred_hdr.msg_iov = &iov; - cred_hdr.msg_iovlen = 1; - cred_hdr.msg_control = &cmsg; - cred_hdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); + memset(&mhdr, 0, sizeof(mhdr)); + mhdr.msg_iov = &iov; + mhdr.msg_iovlen = 1; + mhdr.msg_control = &cmsg; + mhdr.msg_controllen = sizeof(cmsg); - memset(&iov, 0, sizeof(struct iovec)); + memset(&iov, 0, sizeof(iov)); iov.iov_base = &elem_type; - iov.iov_len = sizeof(int); + iov.iov_len = sizeof(elem_type); - if (recvmsg(qstate->sockfd, &cred_hdr, 0) == -1) { + if (recvmsg(qstate->sockfd, &mhdr, 0) == -1) { TRACE_OUT(on_query_startup); return (-1); } - if (cred_hdr.msg_controllen < CMSG_LEN(sizeof(struct cmsgcred)) - || cmsg.hdr.cmsg_len < CMSG_LEN(sizeof(struct cmsgcred)) - || cmsg.hdr.cmsg_level != SOL_SOCKET - || cmsg.hdr.cmsg_type != SCM_CREDS) { + if (mhdr.msg_controllen != CMSG_SPACE(sizeof(struct cmsgcred)) || + cmsg.hdr.cmsg_len != CMSG_LEN(sizeof(struct cmsgcred)) || + cmsg.hdr.cmsg_level != SOL_SOCKET || + cmsg.hdr.cmsg_type != SCM_CREDS) { TRACE_OUT(on_query_startup); return (-1); } @@ -206,9 +205,9 @@ on_query_startup(struct query_state *qstate) return (-1); #else if ((elem_type != CET_READ_REQUEST) && - (elem_type != CET_MP_READ_SESSION_REQUEST) && - (elem_type != CET_WRITE_REQUEST) && - (elem_type != CET_MP_WRITE_SESSION_REQUEST)) { + (elem_type != CET_MP_READ_SESSION_REQUEST) && + (elem_type != CET_WRITE_REQUEST) && + (elem_type != CET_MP_WRITE_SESSION_REQUEST)) { TRACE_OUT(on_query_startup); return (-1); } From owner-svn-src-head@freebsd.org Tue Nov 27 09:46:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E54191143545; Tue, 27 Nov 2018 09:46:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C5B36ECED; Tue, 27 Nov 2018 09:46:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D7E719883; Tue, 27 Nov 2018 09:46:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAR9k1Pn020022; Tue, 27 Nov 2018 09:46:01 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAR9k1hp020021; Tue, 27 Nov 2018 09:46:01 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811270946.wAR9k1hp020021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 27 Nov 2018 09:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341010 - head/usr.sbin/unbound/setup X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/usr.sbin/unbound/setup X-SVN-Commit-Revision: 341010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C5B36ECED X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_SHORT(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 09:46:02 -0000 Author: des Date: Tue Nov 27 09:46:01 2018 New Revision: 341010 URL: https://svnweb.freebsd.org/changeset/base/341010 Log: Check that /etc/resolv.conf exists before trying to read it. Fix whitespace nit introduced in previous commit. MFC after: 1 week Modified: head/usr.sbin/unbound/setup/local-unbound-setup.sh Modified: head/usr.sbin/unbound/setup/local-unbound-setup.sh ============================================================================== --- head/usr.sbin/unbound/setup/local-unbound-setup.sh Tue Nov 27 09:41:47 2018 (r341009) +++ head/usr.sbin/unbound/setup/local-unbound-setup.sh Tue Nov 27 09:46:01 2018 (r341010) @@ -218,7 +218,7 @@ gen_forward_conf() { if [ "${use_tls}" = "yes" ] ; then echo " forward-tls-upstream: yes" sed -nE \ - -e "s/^(${RE_forward_tls})$/ forward-addr: \\1/p" + -e "s/^${RE_forward_tls}\$/ forward-addr: \\1/p" else sed -nE \ -e "s/^${RE_forward_addr}\$/ forward-addr: \\1/p" \ @@ -411,8 +411,10 @@ main() { style=recursing ;; "") - echo "Extracting forwarders from ${resolv_conf}." - forwarders=$(get_nameservers <"${D}${resolv_conf}") + if [ -f "${D}${resolv_conf}" ] ; then + echo "Extracting forwarders from ${resolv_conf}." + forwarders=$(get_nameservers <"${D}${resolv_conf}") + fi style=dynamic ;; *) From owner-svn-src-head@freebsd.org Tue Nov 27 10:06:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEDA1114467F; Tue, 27 Nov 2018 10:06:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B6F6FC16; Tue, 27 Nov 2018 10:06:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5363F19C0B; Tue, 27 Nov 2018 10:06:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARA6gZh030260; Tue, 27 Nov 2018 10:06:42 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARA6gCM030259; Tue, 27 Nov 2018 10:06:42 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811271006.wARA6gCM030259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 27 Nov 2018 10:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341011 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 341011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72B6F6FC16 X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.58)[0.579,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_LONG(0.47)[0.465,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 10:06:43 -0000 Author: des Date: Tue Nov 27 10:06:41 2018 New Revision: 341011 URL: https://svnweb.freebsd.org/changeset/base/341011 Log: Support proxying FTP over HTTPS, not just HTTP. There is probably a PR for this, but I can't find this, or remember who submitted it. The patch got lost in the noise of another that wasn't ready to commit. MFC after: 3 days Modified: head/lib/libfetch/ftp.c Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Tue Nov 27 09:46:01 2018 (r341010) +++ head/lib/libfetch/ftp.c Tue Nov 27 10:06:41 2018 (r341011) @@ -1104,7 +1104,8 @@ ftp_request(struct url *url, const char *op, struct ur int oflag; /* check if we should use HTTP instead */ - if (purl && strcasecmp(purl->scheme, SCHEME_HTTP) == 0) { + if (purl && (strcasecmp(purl->scheme, SCHEME_HTTP) == 0 || + strcasecmp(purl->scheme, SCHEME_HTTPS) == 0)) { if (strcmp(op, "STAT") == 0) return (http_request(url, "HEAD", us, purl, flags)); else if (strcmp(op, "RETR") == 0) From owner-svn-src-head@freebsd.org Tue Nov 27 10:31:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85434114506A; Tue, 27 Nov 2018 10:31:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9FC70ADB; Tue, 27 Nov 2018 10:31:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FE7C19F8F; Tue, 27 Nov 2018 10:31:30 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARAVTEL041476; Tue, 27 Nov 2018 10:31:29 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARAVTdL041475; Tue, 27 Nov 2018 10:31:29 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811271031.wARAVTdL041475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 27 Nov 2018 10:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341012 - in head/usr.sbin: etcupdate mergemaster X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in head/usr.sbin: etcupdate mergemaster X-SVN-Commit-Revision: 341012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D9FC70ADB X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.579,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 10:31:30 -0000 Author: 0mp (ports committer) Date: Tue Nov 27 10:31:29 2018 New Revision: 341012 URL: https://svnweb.freebsd.org/changeset/base/341012 Log: Cross-reference mergemaster(8) & etcupdate(8). Suggested by: Daniel Ebdrup Reviewed by: bcr Approved by: bcr (doc), krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18350 Modified: head/usr.sbin/etcupdate/etcupdate.8 head/usr.sbin/mergemaster/mergemaster.8 Modified: head/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.8 Tue Nov 27 10:06:41 2018 (r341011) +++ head/usr.sbin/etcupdate/etcupdate.8 Tue Nov 27 10:31:29 2018 (r341012) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2015 +.Dd November 27, 2018 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -853,6 +853,7 @@ but it has been removed in the destination directory. .Xr make 1 , .Xr newaliases 1 , .Xr sh 1 , +.Xr mergemaster 8 , .Xr pwd_mkdb 8 , .Xr services_mkdb 8 , .Xr tzsetup 8 Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Tue Nov 27 10:06:41 2018 (r341011) +++ head/usr.sbin/mergemaster/mergemaster.8 Tue Nov 27 10:31:29 2018 (r341012) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 8, 2018 +.Dd November 27, 2018 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -453,6 +453,7 @@ comparison, use: .Xr make 1 , .Xr less 1 , .Xr sdiff 1 , +.Xr etcupdate 8 , .Xr pwd_mkdb 8 .Pp .Pa /usr/src/etc/Makefile From owner-svn-src-head@freebsd.org Tue Nov 27 10:45:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D54B11455A1; Tue, 27 Nov 2018 10:45:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30649710A1; Tue, 27 Nov 2018 10:45:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10CCD1A297; Tue, 27 Nov 2018 10:45:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARAjEFk050430; Tue, 27 Nov 2018 10:45:14 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARAjEbp050427; Tue, 27 Nov 2018 10:45:14 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811271045.wARAjEbp050427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 27 Nov 2018 10:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341013 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 341013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 30649710A1 X-Spamd-Result: default: False [1.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.60)[0.595,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 10:45:15 -0000 Author: des Date: Tue Nov 27 10:45:14 2018 New Revision: 341013 URL: https://svnweb.freebsd.org/changeset/base/341013 Log: Improve URL parsing. In particular, convert scheme and host to lowercase. MFC after: 1 week Modified: head/lib/libfetch/common.c head/lib/libfetch/fetch.c head/lib/libfetch/ftp.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Tue Nov 27 10:31:29 2018 (r341012) +++ head/lib/libfetch/common.c Tue Nov 27 10:45:14 2018 (r341013) @@ -189,9 +189,9 @@ fetch_default_port(const char *scheme) if ((se = getservbyname(scheme, "tcp")) != NULL) return (ntohs(se->s_port)); - if (strcasecmp(scheme, SCHEME_FTP) == 0) + if (strcmp(scheme, SCHEME_FTP) == 0) return (FTP_DEFAULT_PORT); - if (strcasecmp(scheme, SCHEME_HTTP) == 0) + if (strcmp(scheme, SCHEME_HTTP) == 0) return (HTTP_DEFAULT_PORT); return (0); } @@ -202,9 +202,9 @@ fetch_default_port(const char *scheme) int fetch_default_proxy_port(const char *scheme) { - if (strcasecmp(scheme, SCHEME_FTP) == 0) + if (strcmp(scheme, SCHEME_FTP) == 0) return (FTP_DEFAULT_PROXY_PORT); - if (strcasecmp(scheme, SCHEME_HTTP) == 0) + if (strcmp(scheme, SCHEME_HTTP) == 0) return (HTTP_DEFAULT_PROXY_PORT); return (0); } Modified: head/lib/libfetch/fetch.c ============================================================================== --- head/lib/libfetch/fetch.c Tue Nov 27 10:31:29 2018 (r341012) +++ head/lib/libfetch/fetch.c Tue Nov 27 10:45:14 2018 (r341013) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include -#include +#include + +#include #include #include #include @@ -81,13 +83,13 @@ fetchXGet(struct url *URL, struct url_stat *us, const us->size = -1; us->atime = us->mtime = 0; } - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchXGetFile(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchXGetFTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchXGetHTTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchXGetHTTP(URL, us, flags)); url_seterr(URL_BAD_SCHEME); return (NULL); @@ -111,13 +113,13 @@ FILE * fetchPut(struct url *URL, const char *flags) { - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchPutFile(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchPutFTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchPutHTTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchPutHTTP(URL, flags)); url_seterr(URL_BAD_SCHEME); return (NULL); @@ -135,13 +137,13 @@ fetchStat(struct url *URL, struct url_stat *us, const us->size = -1; us->atime = us->mtime = 0; } - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchStatFile(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchStatFTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchStatHTTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchStatHTTP(URL, us, flags)); url_seterr(URL_BAD_SCHEME); return (-1); @@ -155,13 +157,13 @@ struct url_ent * fetchList(struct url *URL, const char *flags) { - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchListFile(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchListFTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchListHTTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchListHTTP(URL, flags)); url_seterr(URL_BAD_SCHEME); return (NULL); @@ -345,7 +347,7 @@ fetchParseURL(const char *URL) char *doc; const char *p, *q; struct url *u; - int i; + int i, n; /* allocate struct url */ if ((u = calloc(1, sizeof(*u))) == NULL) { @@ -356,8 +358,10 @@ fetchParseURL(const char *URL) /* scheme name */ if ((p = strstr(URL, ":/"))) { - snprintf(u->scheme, URL_SCHEMELEN+1, - "%.*s", (int)(p - URL), URL); + if (p - URL > URL_SCHEMELEN) + goto ouch; + for (i = 0; URL + i < p; i++) + u->scheme[i] = tolower((unsigned char)URL[i]); URL = ++p; /* * Only one slash: no host, leave slash as part of document @@ -388,28 +392,37 @@ fetchParseURL(const char *URL) } /* hostname */ - if (*p == '[' && (q = strchr(p + 1, ']')) != NULL && - (*++q == '\0' || *q == '/' || *q == ':')) { - if ((i = q - p) > MAXHOSTNAMELEN) - i = MAXHOSTNAMELEN; - strncpy(u->host, p, i); - p = q; + if (*p == '[') { + q = p + 1 + strspn(p + 1, ":0123456789ABCDEFabcdef"); + if (*q++ != ']') + goto ouch; } else { - for (i = 0; *p && (*p != '/') && (*p != ':'); p++) - if (i < MAXHOSTNAMELEN) - u->host[i++] = *p; + /* valid characters in a DNS name */ + q = p + strspn(p, "-." "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "_" + "abcdefghijklmnopqrstuvwxyz"); } + if ((*q != '\0' && *q != '/' && *q != ':') || q - p > MAXHOSTNAMELEN) + goto ouch; + for (i = 0; p + i < q; i++) + u->host[i] = tolower((unsigned char)p[i]); + u->host[i] = '\0'; + p = q; /* port */ if (*p == ':') { - for (q = ++p; *q && (*q != '/'); q++) - if (isdigit((unsigned char)*q)) - u->port = u->port * 10 + (*q - '0'); - else { + for (n = 0, q = ++p; *q && (*q != '/'); q++) { + if (*q >= '0' && *q <= '9' && n < INT_MAX / 10) { + n = n * 10 + (*q - '0'); + } else { /* invalid port */ url_seterr(URL_BAD_PORT); goto ouch; } + } + if (n < 1 || n > IPPORT_MAX) + goto ouch; + u->port = n; p = q; } @@ -418,8 +431,8 @@ nohost: if (!*p) p = "/"; - if (strcasecmp(u->scheme, SCHEME_HTTP) == 0 || - strcasecmp(u->scheme, SCHEME_HTTPS) == 0) { + if (strcmp(u->scheme, SCHEME_HTTP) == 0 || + strcmp(u->scheme, SCHEME_HTTPS) == 0) { const char hexnums[] = "0123456789abcdef"; /* percent-escape whitespace. */ Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Tue Nov 27 10:31:29 2018 (r341012) +++ head/lib/libfetch/ftp.c Tue Nov 27 10:45:14 2018 (r341013) @@ -1085,8 +1085,8 @@ ftp_get_proxy(struct url * url, const char *flags) } if (!purl->port) purl->port = fetch_default_proxy_port(purl->scheme); - if (strcasecmp(purl->scheme, SCHEME_FTP) == 0 || - strcasecmp(purl->scheme, SCHEME_HTTP) == 0) + if (strcmp(purl->scheme, SCHEME_FTP) == 0 || + strcmp(purl->scheme, SCHEME_HTTP) == 0) return (purl); fetchFreeURL(purl); } @@ -1104,8 +1104,8 @@ ftp_request(struct url *url, const char *op, struct ur int oflag; /* check if we should use HTTP instead */ - if (purl && (strcasecmp(purl->scheme, SCHEME_HTTP) == 0 || - strcasecmp(purl->scheme, SCHEME_HTTPS) == 0)) { + if (purl && (strcmp(purl->scheme, SCHEME_HTTP) == 0 || + strcmp(purl->scheme, SCHEME_HTTPS) == 0)) { if (strcmp(op, "STAT") == 0) return (http_request(url, "HEAD", us, purl, flags)); else if (strcmp(op, "RETR") == 0) From owner-svn-src-head@freebsd.org Tue Nov 27 11:22:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C2321146B67; Tue, 27 Nov 2018 11:22:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D480672503; Tue, 27 Nov 2018 11:22:19 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5B8C1A82B; Tue, 27 Nov 2018 11:22:19 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARBMJkj070515; Tue, 27 Nov 2018 11:22:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARBMJ0C070514; Tue, 27 Nov 2018 11:22:19 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811271122.wARBMJ0C070514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 27 Nov 2018 11:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341014 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 341014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D480672503 X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.579,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 11:22:20 -0000 Author: des Date: Tue Nov 27 11:22:19 2018 New Revision: 341014 URL: https://svnweb.freebsd.org/changeset/base/341014 Log: A few more cases where strcasecmp() is no longer required. MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Tue Nov 27 10:45:14 2018 (r341013) +++ head/lib/libfetch/http.c Tue Nov 27 11:22:19 2018 (r341014) @@ -1408,7 +1408,7 @@ http_connect(struct url *URL, struct url *purl, const /* fetch_connect() has already set an error code */ return (NULL); init_http_headerbuf(&headerbuf); - if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { + if (strcmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { http_cmd(conn, "CONNECT %s:%d HTTP/1.1", URL->host, URL->port); http_cmd(conn, "Host: %s:%d", @@ -1436,7 +1436,7 @@ http_connect(struct url *URL, struct url *purl, const } } while (h > hdr_end); } - if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && + if (strcmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { /* grrr */ errno = EAUTH; @@ -1473,7 +1473,7 @@ http_get_proxy(struct url * url, const char *flags) strcpy(purl->scheme, SCHEME_HTTP); if (!purl->port) purl->port = fetch_default_proxy_port(purl->scheme); - if (strcasecmp(purl->scheme, SCHEME_HTTP) == 0) + if (strcmp(purl->scheme, SCHEME_HTTP) == 0) return (purl); fetchFreeURL(purl); } @@ -1617,7 +1617,7 @@ http_request_body(struct url *URL, const char *op, str if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { + if (purl && strcmp(URL->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else { From owner-svn-src-head@freebsd.org Tue Nov 27 11:26:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9409E1146D75; Tue, 27 Nov 2018 11:26:23 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF572727DE; Tue, 27 Nov 2018 11:26:22 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x72d.google.com with SMTP id r71so14276078qkr.10; Tue, 27 Nov 2018 03:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gGW1QGQ1UrHh6vNhqfWyVCVMZfwMZK4KDlyzMkjaJFg=; b=fsSHeVmubg6z7jFUIEk3/5Tp1LaJ1K27MVr8SQvPZqMKZZxRuN+0WPuiOa9hM0Pock o5M/x3M+SvjDIcPfB08aSPcU3Y/9nmRcNfUN9shUAD9OWrmeqOTLXyIogr9K9C7PLPmN jcw599DMv6hXhRXIX+gVJkWemjoE2PGiEk/9idR/rupMLpGjc8mfn2BIbw/i/Krwn79+ kkoYVXF1KiunqM+BvoYygFh61oVCfz4fgPHgxk4okLsFZRBbJOiT3/C03fGi3bKLcqFf ODKML4gtkgVJA1dtHB2SiNOeZNFOw91nzX642mwVUlpUOh74S66BeGH23MXtxAcM4VGK 5a5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=gGW1QGQ1UrHh6vNhqfWyVCVMZfwMZK4KDlyzMkjaJFg=; b=ochH98ZJUyg/9wgL9xB5o1hnN7i1cz1iGKDM1teCbOmPHsQDYRsKy9MysTI7cvQQ/O lgVpA50Soq15XmIeAc8VChkbOXC0wjB8bsQusUsRG6SVgnO91rK0geF1tmyQCSomLxk8 zp2SJ9rcUr8ohmi5KnxNFZWHu4FAlsFYctTjUP0AUyQYijQipEV82uhzDu1V/Unp15uy NB0UOnaHpS3kT5UBX2j44MsLLE7twUVXCC2XPSRDXsAcq8r2Ak7yZhLKokJLc/XnPvss syY9V5lFoNpYUvSx3vWvdXzxEwRdUcZ90uzGkLxssDJEtZbHCcCfKXcaEDI0+o9sjqCp 2exA== X-Gm-Message-State: AA+aEWY+SDgddFHDyXqdY/ogB81ZADFRjXsqXimh5tJ/fAOldwemsnVn FQzfn895oMQmESQv9U1ZEqvp4v1J X-Google-Smtp-Source: AFSGD/XrsUES+sT/11POUYVrijJ63hxCak6KKtWhFeiwSjZT69hEzRNt8WiE6y3V40QBTSajMdy5IQ== X-Received: by 2002:a37:9841:: with SMTP id a62mr29133711qke.348.1543317982255; Tue, 27 Nov 2018 03:26:22 -0800 (PST) Received: from mbp.local (mail2.bluepex.com. [200.247.39.210]) by smtp.gmail.com with ESMTPSA id g5sm1570671qkd.55.2018.11.27.03.26.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 03:26:21 -0800 (PST) Sender: Renato Botelho Subject: Re: svn commit: r341011 - head/lib/libfetch To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811271006.wARA6gCM030259@repo.freebsd.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/UM7ATQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABwsB8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <9fbc002a-a4e2-e7e3-c0db-ecafde637ca4@FreeBSD.org> Date: Tue, 27 Nov 2018 09:26:18 -0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <201811271006.wARA6gCM030259@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF572727DE X-Spamd-Result: default: False [-3.81 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.66)[ipnet: 2607:f8b0::/32(-1.80), asn: 15169(-1.40), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[d.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 11:26:23 -0000 On 27/11/18 08:06, Dag-Erling Smørgrav wrote: > Author: des > Date: Tue Nov 27 10:06:41 2018 > New Revision: 341011 > URL: https://svnweb.freebsd.org/changeset/base/341011 > > Log: > Support proxying FTP over HTTPS, not just HTTP. > > There is probably a PR for this, but I can't find this, or remember who > submitted it. The patch got lost in the noise of another that wasn't > ready to commit. Are you talking about this one? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220468 -- Renato Botelho From owner-svn-src-head@freebsd.org Tue Nov 27 12:11:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8063011488E8; Tue, 27 Nov 2018 12:11:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26ED9742AD; Tue, 27 Nov 2018 12:11:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 081361B018; Tue, 27 Nov 2018 12:11:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCBGIl094659; Tue, 27 Nov 2018 12:11:16 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCBGpe094657; Tue, 27 Nov 2018 12:11:16 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811271211.wARCBGpe094657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 27 Nov 2018 12:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341016 - in head: . sys/modules/iavf X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in head: . sys/modules/iavf X-SVN-Commit-Revision: 341016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26ED9742AD X-Spamd-Result: default: False [1.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:11:17 -0000 Author: marius Date: Tue Nov 27 12:11:16 2018 New Revision: 341016 URL: https://svnweb.freebsd.org/changeset/base/341016 Log: - Add a belated UPDATING entry for the ixlv(4) -> iavf(4) rename in r339338. - Likewise, add ixlv.4.gz to OLD_FILES, - and link if_ixlv.ko to if_iavf.ko in order to aid a bit in the transition. Modified: head/ObsoleteFiles.inc head/UPDATING head/sys/modules/iavf/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 27 11:55:43 2018 (r341015) +++ head/ObsoleteFiles.inc Tue Nov 27 12:11:16 2018 (r341016) @@ -67,6 +67,8 @@ OLD_LIBS+=usr/lib32/libcap_pwd.so.0 OLD_LIBS+=usr/lib32/libcap_random.so.0 OLD_LIBS+=usr/lib32/libcap_dns.so.0 OLD_LIBS+=usr/lib32/libcap_syslog.so.0 +# 20181012: rename of ixlv(4) to iavf(4) +OLD_FILES+=usr/share/man/man4/ixlv.4.gz # 20181009: OpenSSL 1.1.1 OLD_FILES+=usr/include/openssl/des_old.h OLD_FILES+=usr/include/openssl/dso.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Nov 27 11:55:43 2018 (r341015) +++ head/UPDATING Tue Nov 27 12:11:16 2018 (r341016) @@ -83,6 +83,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: loading from X11 startup. These will become the defaults in 13-current shortly. +20181012: + The ixlv(4) driver has been renamed to iavf(4). As a consequence, + custom kernel and module loading configuration files must be updated + accordingly. Moreover, interfaces previous presented as ixlvN to the + system are now exposed as iavfN and network configuration files must + be adjusted as necessary. + 20181009: OpenSSL has been updated to version 1.1.1. This update included additional various API changes througout the base system. It is Modified: head/sys/modules/iavf/Makefile ============================================================================== --- head/sys/modules/iavf/Makefile Tue Nov 27 11:55:43 2018 (r341015) +++ head/sys/modules/iavf/Makefile Tue Nov 27 12:11:16 2018 (r341016) @@ -15,4 +15,6 @@ SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c # Enable asserts and other debugging facilities # CFLAGS += -DINVARIANTS -DINVARIANTS_SUPPORT -DWITNESS +LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_ixlv.ko + .include From owner-svn-src-head@freebsd.org Tue Nov 27 12:13:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3919E1148A18; Tue, 27 Nov 2018 12:13:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF79474541; Tue, 27 Nov 2018 12:13:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD44A1B181; Tue, 27 Nov 2018 12:13:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCDdI3096421; Tue, 27 Nov 2018 12:13:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCDdns096420; Tue, 27 Nov 2018 12:13:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271213.wARCDdns096420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341017 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF79474541 X-Spamd-Result: default: False [1.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:13:40 -0000 Author: arybchik Date: Tue Nov 27 12:13:39 2018 New Revision: 341017 URL: https://svnweb.freebsd.org/changeset/base/341017 Log: sfxge(4): add Medford2 PCI IDs Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18139 Modified: head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:11:16 2018 (r341016) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:13:39 2018 (r341017) @@ -68,6 +68,7 @@ typedef enum efx_family_e { EFX_FAMILY_SIENA, EFX_FAMILY_HUNTINGTON, EFX_FAMILY_MEDFORD, + EFX_FAMILY_MEDFORD2, EFX_FAMILY_NTYPES } efx_family_t; @@ -96,6 +97,10 @@ efx_family( #define EFX_PCI_DEVID_MEDFORD_PF_UNINIT 0x0913 #define EFX_PCI_DEVID_MEDFORD 0x0A03 /* SFC9240 PF */ #define EFX_PCI_DEVID_MEDFORD_VF 0x1A03 /* SFC9240 VF */ + +#define EFX_PCI_DEVID_MEDFORD2_PF_UNINIT 0x0B13 +#define EFX_PCI_DEVID_MEDFORD2 0x0B03 /* SFC9250 PF */ +#define EFX_PCI_DEVID_MEDFORD2_VF 0x1B03 /* SFC9250 VF */ #define EFX_MEM_BAR 2 From owner-svn-src-head@freebsd.org Tue Nov 27 12:13:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6629E1148A3B; Tue, 27 Nov 2018 12:13:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAB3474637; Tue, 27 Nov 2018 12:13:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D1751B182; Tue, 27 Nov 2018 12:13:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCDsLC096479; Tue, 27 Nov 2018 12:13:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCDsvu096478; Tue, 27 Nov 2018 12:13:54 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271213.wARCDsvu096478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341018 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BAB3474637 X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.73)[0.726,0]; NEURAL_SPAM_SHORT(0.41)[0.406,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:13:55 -0000 Author: arybchik Date: Tue Nov 27 12:13:54 2018 New Revision: 341018 URL: https://svnweb.freebsd.org/changeset/base/341018 Log: sfxge(4): add efsys option for Medford2 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18140 Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Tue Nov 27 12:13:39 2018 (r341017) +++ head/sys/dev/sfxge/common/efsys.h Tue Nov 27 12:13:54 2018 (r341018) @@ -241,6 +241,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_SIENA 1 #define EFSYS_OPT_HUNTINGTON 1 #define EFSYS_OPT_MEDFORD 1 +#define EFSYS_OPT_MEDFORD2 0 #ifdef DEBUG #define EFSYS_OPT_CHECK_REG 1 #else Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue Nov 27 12:13:39 2018 (r341017) +++ head/sys/dev/sfxge/common/efx_check.h Tue Nov 27 12:13:54 2018 (r341018) @@ -56,8 +56,9 @@ /* Verify chip implements accessed registers */ #if EFSYS_OPT_CHECK_REG -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_CHECK_REG */ @@ -70,15 +71,17 @@ /* Support diagnostic hardware tests */ #if EFSYS_OPT_DIAG -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "DIAG requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "DIAG requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_DIAG */ /* Support optimized EVQ data access */ #if EFSYS_OPT_EV_PREFETCH -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "EV_PREFETCH requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "EV_PREFETCH requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_EV_PREFETCH */ @@ -88,21 +91,23 @@ /* Support hardware packet filters */ #if EFSYS_OPT_FILTER -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "FILTER requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "FILTER requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_FILTER */ -#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) # if !EFSYS_OPT_FILTER -# error "HUNTINGTON or MEDFORD requires FILTER" +# error "HUNTINGTON or MEDFORD or MEDFORD2 requires FILTER" # endif #endif /* EFSYS_OPT_HUNTINGTON */ /* Support hardware loopback modes */ #if EFSYS_OPT_LOOPBACK -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "LOOPBACK requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "LOOPBACK requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_LOOPBACK */ @@ -116,21 +121,24 @@ /* Support MAC statistics */ #if EFSYS_OPT_MAC_STATS -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "MAC_STATS requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "MAC_STATS requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_MAC_STATS */ /* Support management controller messages */ #if EFSYS_OPT_MCDI -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "MCDI requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "MCDI requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_MCDI */ -#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) # if !EFSYS_OPT_MCDI -# error "SIENA or HUNTINGTON or MEDFORD requires MCDI" +# error "SIENA or HUNTINGTON or MEDFORD or MEDFORD2 requires MCDI" # endif #endif @@ -170,15 +178,17 @@ /* Support monitor statistics (voltage/temperature) */ #if EFSYS_OPT_MON_STATS -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "MON_STATS requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "MON_STATS requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_MON_STATS */ /* Support Monitor via mcdi */ #if EFSYS_OPT_MON_MCDI -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_MON_MCDI*/ @@ -192,8 +202,9 @@ /* Support non volatile configuration */ #if EFSYS_OPT_NVRAM -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "NVRAM requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "NVRAM requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_NVRAM */ @@ -226,8 +237,9 @@ /* Support for PHY LED control */ #if EFSYS_OPT_PHY_LED_CONTROL -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_PHY_LED_CONTROL */ @@ -272,8 +284,9 @@ /* Support EVQ/RXQ/TXQ statistics */ #if EFSYS_OPT_QSTATS -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "QSTATS requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "QSTATS requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_QSTATS */ @@ -283,15 +296,17 @@ /* Support receive scaling (RSS) */ #if EFSYS_OPT_RX_SCALE -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "RX_SCALE requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "RX_SCALE requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_RX_SCALE */ /* Support receive scatter DMA */ #if EFSYS_OPT_RX_SCATTER -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "RX_SCATTER requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "RX_SCATTER requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_RX_SCATTER */ @@ -301,8 +316,9 @@ /* Support PCI Vital Product Data (VPD) */ #if EFSYS_OPT_VPD -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "VPD requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "VPD requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_VPD */ @@ -317,8 +333,9 @@ /* Support BIST */ #if EFSYS_OPT_BIST -# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "BIST requires SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || \ + EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "BIST requires SIENA or HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_BIST */ @@ -334,15 +351,15 @@ /* Support adapters with missing static config (for factory use only) */ #if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC -# if !EFSYS_OPT_MEDFORD -# error "ALLOW_UNCONFIGURED_NIC requires MEDFORD" +# if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "ALLOW_UNCONFIGURED_NIC requires MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ /* Support packed stream mode */ #if EFSYS_OPT_RX_PACKED_STREAM -# if !(EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "PACKED_STREAM requires HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "PACKED_STREAM requires HUNTINGTON or MEDFORD or MEDFORD2" # endif #endif From owner-svn-src-head@freebsd.org Tue Nov 27 12:14:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 340A41148A67; Tue, 27 Nov 2018 12:14:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C660674713; Tue, 27 Nov 2018 12:14:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C6BC1B183; Tue, 27 Nov 2018 12:14:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCE5V7096540; Tue, 27 Nov 2018 12:14:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCE5j2096539; Tue, 27 Nov 2018 12:14:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271214.wARCE5j2096539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341019 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C660674713 X-Spamd-Result: default: False [1.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:14:07 -0000 Author: arybchik Date: Tue Nov 27 12:14:05 2018 New Revision: 341019 URL: https://svnweb.freebsd.org/changeset/base/341019 Log: sfxge(4): put Siena-specific code under its efsys option Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18141 Modified: head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:13:54 2018 (r341018) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:14:05 2018 (r341019) @@ -373,6 +373,8 @@ typedef struct efx_nic_ops_s { #if EFSYS_OPT_FILTER +#if EFSYS_OPT_SIENA + typedef struct siena_filter_spec_s { uint8_t sfs_type; uint32_t sfs_flags; @@ -418,6 +420,8 @@ typedef struct siena_filter_s { unsigned int sf_depth[EFX_SIENA_FILTER_NTYPES]; } siena_filter_t; +#endif /* EFSYS_OPT_SIENA */ + typedef struct efx_filter_s { #if EFSYS_OPT_SIENA siena_filter_t *ef_siena_filter; @@ -427,10 +431,14 @@ typedef struct efx_filter_s { #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ } efx_filter_t; +#if EFSYS_OPT_SIENA + extern void siena_filter_tbl_clear( __in efx_nic_t *enp, __in siena_filter_tbl_id_t tbl); + +#endif /* EFSYS_OPT_SIENA */ #endif /* EFSYS_OPT_FILTER */ From owner-svn-src-head@freebsd.org Tue Nov 27 12:14:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 016CF1148AA1; Tue, 27 Nov 2018 12:14:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC797483D; Tue, 27 Nov 2018 12:14:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6625F1B184; Tue, 27 Nov 2018 12:14:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCEI4W096609; Tue, 27 Nov 2018 12:14:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCEGxt096601; Tue, 27 Nov 2018 12:14:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271214.wARCEGxt096601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341020 - in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Commit-Revision: 341020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CC797483D X-Spamd-Result: default: False [1.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.59)[0.594,0]; NEURAL_SPAM_SHORT(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.76)[0.760,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:14:21 -0000 Author: arybchik Date: Tue Nov 27 12:14:16 2018 New Revision: 341020 URL: https://svnweb.freebsd.org/changeset/base/341020 Log: sfxge(4): add Medford2 support to NIC module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18142 Added: head/sys/dev/sfxge/common/medford2_impl.h (contents, props changed) head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/modules/sfxge/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Nov 27 12:14:05 2018 (r341019) +++ head/sys/conf/files.amd64 Tue Nov 27 12:14:16 2018 (r341020) @@ -444,6 +444,7 @@ dev/sfxge/common/efx_vpd.c optional sfxge pci dev/sfxge/common/hunt_nic.c optional sfxge pci dev/sfxge/common/mcdi_mon.c optional sfxge pci dev/sfxge/common/medford_nic.c optional sfxge pci +dev/sfxge/common/medford2_nic.c optional sfxge pci dev/sfxge/common/siena_mac.c optional sfxge pci dev/sfxge/common/siena_mcdi.c optional sfxge pci dev/sfxge/common/siena_nic.c optional sfxge pci Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:14:05 2018 (r341019) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:14:16 2018 (r341020) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include "mcdi_mon.h" #endif -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 #include "ef10_tlv_layout.h" @@ -52,7 +52,8 @@ efx_mcdi_get_port_assignment( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_ASSIGNMENT; @@ -97,7 +98,8 @@ efx_mcdi_get_port_modes( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_MODES; @@ -277,7 +279,8 @@ efx_mcdi_get_mac_address_pf( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_MAC_ADDRESSES; @@ -335,7 +338,8 @@ efx_mcdi_get_mac_address_vf( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VPORT_GET_MAC_ADDRESSES; @@ -399,7 +403,8 @@ efx_mcdi_get_clock( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_CLOCK; @@ -810,7 +815,8 @@ ef10_nic_pio_alloc( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); EFSYS_ASSERT(bufnump); EFSYS_ASSERT(handlep); EFSYS_ASSERT(blknump); @@ -1310,7 +1316,8 @@ ef10_nic_probe( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* Read and clear any assertion state */ if ((rc = efx_mcdi_read_assertion(enp)) != 0) @@ -1524,7 +1531,8 @@ ef10_nic_init( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* Enable reporting of some events (e.g. link change) */ if ((rc = efx_mcdi_log_ctrl(enp)) != 0) @@ -1680,7 +1688,8 @@ ef10_nic_get_vi_pool( __out uint32_t *vi_countp) { EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* * Report VIs that the client driver can use. @@ -1701,7 +1710,8 @@ ef10_nic_get_bar_region( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* * TODO: Specify host memory mapping alignment and granularity @@ -1798,4 +1808,4 @@ fail1: #endif /* EFSYS_OPT_DIAG */ -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:14:05 2018 (r341019) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:14:16 2018 (r341020) @@ -204,7 +204,7 @@ efx_nic_check_pcie_link_speed( #if EFSYS_OPT_MCDI -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 /* Huntington and Medford require MCDIv2 commands */ #define WITH_MCDI_V2 1 #endif @@ -1172,11 +1172,11 @@ typedef struct efx_nic_cfg_s { #if EFSYS_OPT_BIST uint32_t enc_bist_mask; #endif /* EFSYS_OPT_BIST */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 uint32_t enc_pf; uint32_t enc_vf; uint32_t enc_privilege_mask; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ boolean_t enc_bug26807_workaround; boolean_t enc_bug35388_workaround; boolean_t enc_bug41750_workaround; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:14:05 2018 (r341019) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:14:16 2018 (r341020) @@ -57,9 +57,13 @@ #include "medford_impl.h" #endif /* EFSYS_OPT_MEDFORD */ -#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +#if EFSYS_OPT_MEDFORD2 +#include "medford2_impl.h" +#endif /* EFSYS_OPT_MEDFORD2 */ + +#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) #include "ef10_impl.h" -#endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ +#endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) */ #ifdef __cplusplus extern "C" { @@ -426,9 +430,9 @@ typedef struct efx_filter_s { #if EFSYS_OPT_SIENA siena_filter_t *ef_siena_filter; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 ef10_filter_table_t *ef_ef10_filter_table; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ } efx_filter_t; #if EFSYS_OPT_SIENA @@ -711,7 +715,7 @@ struct efx_nic_s { #endif /* EFSYS_OPT_SIENA */ int enu_unused; } en_u; -#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) union en_arch { struct { int ena_vi_base; @@ -732,7 +736,7 @@ struct efx_nic_s { size_t ena_wc_mem_map_size; } ef10; } en_arch; -#endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */ +#endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) */ }; @@ -851,6 +855,10 @@ struct efx_txq_s { \ case EFX_FAMILY_MEDFORD: \ rev = 'E'; \ + break; \ + \ + case EFX_FAMILY_MEDFORD2: \ + rev = 'F'; \ break; \ \ default: \ Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 12:14:05 2018 (r341019) +++ head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 12:14:16 2018 (r341020) @@ -97,6 +97,24 @@ efx_family( return (0); #endif /* EFSYS_OPT_MEDFORD */ +#if EFSYS_OPT_MEDFORD2 + case EFX_PCI_DEVID_MEDFORD2_PF_UNINIT: + /* + * Hardware default for PF0 of uninitialised Medford2. + * manftest must be able to cope with this device id. + */ + *efp = EFX_FAMILY_MEDFORD2; + return (0); + + case EFX_PCI_DEVID_MEDFORD2: + *efp = EFX_FAMILY_MEDFORD2; + return (0); + + case EFX_PCI_DEVID_MEDFORD2_VF: + *efp = EFX_FAMILY_MEDFORD2; + return (0); +#endif /* EFSYS_OPT_MEDFORD2 */ + case EFX_PCI_DEVID_FALCON: /* Obsolete, not supported */ default: break; @@ -164,7 +182,26 @@ static const efx_nic_ops_t __efx_nic_medford_ops = { #endif /* EFSYS_OPT_MEDFORD */ +#if EFSYS_OPT_MEDFORD2 +static const efx_nic_ops_t __efx_nic_medford2_ops = { + ef10_nic_probe, /* eno_probe */ + medford2_board_cfg, /* eno_board_cfg */ + ef10_nic_set_drv_limits, /* eno_set_drv_limits */ + ef10_nic_reset, /* eno_reset */ + ef10_nic_init, /* eno_init */ + ef10_nic_get_vi_pool, /* eno_get_vi_pool */ + ef10_nic_get_bar_region, /* eno_get_bar_region */ +#if EFSYS_OPT_DIAG + ef10_nic_register_test, /* eno_register_test */ +#endif /* EFSYS_OPT_DIAG */ + ef10_nic_fini, /* eno_fini */ + ef10_nic_unprobe, /* eno_unprobe */ +}; + +#endif /* EFSYS_OPT_MEDFORD2 */ + + __checkReturn efx_rc_t efx_nic_create( __in efx_family_t family, @@ -241,6 +278,22 @@ efx_nic_create( EFX_FEATURE_PACKED_STREAM; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + enp->en_enop = &__efx_nic_medford2_ops; + enp->en_features = + EFX_FEATURE_IPV6 | + EFX_FEATURE_LINK_EVENTS | + EFX_FEATURE_PERIODIC_MAC_STATS | + EFX_FEATURE_MCDI | + EFX_FEATURE_MAC_HEADER_FILTERS | + EFX_FEATURE_MCDI_DMA | + EFX_FEATURE_PIO_BUFFERS | + EFX_FEATURE_FW_ASSISTED_TSO_V2 | + EFX_FEATURE_PACKED_STREAM; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: rc = ENOTSUP; Added: head/sys/dev/sfxge/common/medford2_impl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/medford2_impl.h Tue Nov 27 12:14:16 2018 (r341020) @@ -0,0 +1,63 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2015-2018 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + * + * $FreeBSD$ + */ + +#ifndef _SYS_MEDFORD2_IMPL_H +#define _SYS_MEDFORD2_IMPL_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifndef ER_EZ_TX_PIOBUF_SIZE +#define ER_EZ_TX_PIOBUF_SIZE 4096 +#endif + + +#define MEDFORD2_PIOBUF_NBUFS (16) +#define MEDFORD2_PIOBUF_SIZE (ER_EZ_TX_PIOBUF_SIZE) + +#define MEDFORD2_MIN_PIO_ALLOC_SIZE (MEDFORD2_PIOBUF_SIZE / 32) + + +extern __checkReturn efx_rc_t +medford2_board_cfg( + __in efx_nic_t *enp); + + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_MEDFORD2_IMPL_H */ Added: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:14:16 2018 (r341020) @@ -0,0 +1,417 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2015-2018 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "efx.h" +#include "efx_impl.h" + + +#if EFSYS_OPT_MEDFORD2 + +static __checkReturn efx_rc_t +efx_mcdi_get_rxdp_config( + __in efx_nic_t *enp, + __out uint32_t *end_paddingp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN, + MC_CMD_GET_RXDP_CONFIG_OUT_LEN)]; + uint32_t end_padding; + efx_rc_t rc; + + memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_RXDP_CONFIG; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN; + + efx_mcdi_execute(enp, &req); + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) { + /* RX DMA end padding is disabled */ + end_padding = 0; + } else { + switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: + end_padding = 64; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128: + end_padding = 128; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256: + end_padding = 256; + break; + default: + rc = ENOTSUP; + goto fail2; + } + } + + *end_paddingp = end_padding; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +medford2_nic_get_required_pcie_bandwidth( + __in efx_nic_t *enp, + __out uint32_t *bandwidth_mbpsp) +{ + uint32_t port_modes; + uint32_t current_mode; + uint32_t bandwidth; + efx_rc_t rc; + + /* FIXME: support new Medford2 dynamic port modes */ + + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, + ¤t_mode)) != 0) { + /* No port mode info available. */ + bandwidth = 0; + goto out; + } + + if ((rc = ef10_nic_get_port_mode_bandwidth(current_mode, + &bandwidth)) != 0) + goto fail1; + +out: + *bandwidth_mbpsp = bandwidth; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +medford2_board_cfg( + __in efx_nic_t *enp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint8_t mac_addr[6] = { 0 }; + uint32_t board_type = 0; + ef10_link_state_t els; + efx_port_t *epp = &(enp->en_port); + uint32_t port; + uint32_t pf; + uint32_t vf; + uint32_t mask; + uint32_t sysclk, dpcpu_clk; + uint32_t base, nvec; + uint32_t end_padding; + uint32_t bandwidth; + efx_rc_t rc; + + /* + * FIXME: Likely to be incomplete and incorrect. + * Parts of this should be shared with Huntington. + */ + + if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) + goto fail1; + + /* + * NOTE: The MCDI protocol numbers ports from zero. + * The common code MCDI interface numbers ports from one. + */ + emip->emi_port = port + 1; + + if ((rc = ef10_external_port_mapping(enp, port, + &encp->enc_external_port)) != 0) + goto fail2; + + /* + * Get PCIe function number from firmware (used for + * per-function privilege and dynamic config info). + * - PCIe PF: pf = PF number, vf = 0xffff. + * - PCIe VF: pf = parent PF, vf = VF number. + */ + if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) + goto fail3; + + encp->enc_pf = pf; + encp->enc_vf = vf; + + /* MAC address for this function */ + if (EFX_PCI_FUNCTION_IS_PF(encp)) { + rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); +#if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC + /* + * Disable static config checking for Medford NICs, ONLY + * for manufacturing test and setup at the factory, to + * allow the static config to be installed. + */ +#else /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ + if ((rc == 0) && (mac_addr[0] & 0x02)) { + /* + * If the static config does not include a global MAC + * address pool then the board may return a locally + * administered MAC address (this should only happen on + * incorrectly programmed boards). + */ + rc = EINVAL; + } +#endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ + } else { + rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); + } + if (rc != 0) + goto fail4; + + EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); + + /* Board configuration */ + rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); + if (rc != 0) { + /* Unprivileged functions may not be able to read board cfg */ + if (rc == EACCES) + board_type = 0; + else + goto fail5; + } + + encp->enc_board_type = board_type; + encp->enc_clk_mult = 1; /* not used for Medford2 */ + + /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ + if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) + goto fail6; + + /* Obtain the default PHY advertised capabilities */ + if ((rc = ef10_phy_get_link(enp, &els)) != 0) + goto fail7; + epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; + + /* + * Enable firmware workarounds for hardware errata. + * Expected responses are: + * - 0 (zero): + * Success: workaround enabled or disabled as requested. + * - MC_CMD_ERR_ENOSYS (reported as ENOTSUP): + * Firmware does not support the MC_CMD_WORKAROUND request. + * (assume that the workaround is not supported). + * - MC_CMD_ERR_ENOENT (reported as ENOENT): + * Firmware does not support the requested workaround. + * - MC_CMD_ERR_EPERM (reported as EACCES): + * Unprivileged function cannot enable/disable workarounds. + * + * See efx_mcdi_request_errcode() for MCDI error translations. + */ + + + if (EFX_PCI_FUNCTION_IS_VF(encp)) { + /* + * Interrupt testing does not work for VFs. See bug50084. + * FIXME: Does this still apply to Medford2? + */ + encp->enc_bug41750_workaround = B_TRUE; + } + + /* Chained multicast is always enabled on Medford2 */ + encp->enc_bug26807_workaround = B_TRUE; + + /* + * If the bug61265 workaround is enabled, then interrupt holdoff timers + * cannot be controlled by timer table writes, so MCDI must be used + * (timer table writes can still be used for wakeup timers). + */ + rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG61265, B_TRUE, + NULL); + if ((rc == 0) || (rc == EACCES)) + encp->enc_bug61265_workaround = B_TRUE; + else if ((rc == ENOTSUP) || (rc == ENOENT)) + encp->enc_bug61265_workaround = B_FALSE; + else + goto fail8; + + /* Get clock frequencies (in MHz). */ + if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) + goto fail9; + + /* + * The Medford2 timer quantum is 1536 dpcpu_clk cycles, documented for + * the EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. + */ + encp->enc_evq_timer_quantum_ns = 1536000UL / dpcpu_clk; /* 1536 cycles */ + encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << + FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; + + /* Check capabilities of running datapath firmware */ + if ((rc = ef10_get_datapath_caps(enp)) != 0) + goto fail10; + + /* Alignment for receive packet DMA buffers */ + encp->enc_rx_buf_align_start = 1; + + /* Get the RX DMA end padding alignment configuration */ + if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { + if (rc != EACCES) + goto fail11; + + /* Assume largest tail padding size supported by hardware */ + end_padding = 256; + } + encp->enc_rx_buf_align_end = end_padding; + + /* Alignment for WPTR updates */ + encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + + /* + * Maximum number of exclusive RSS contexts which can be allocated. The + * hardware supports 64, but 6 are reserved for shared contexts. They + * are a global resource so not all may be available. + */ + encp->enc_rx_scale_max_exclusive_contexts = 58; + + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + + /* + * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use + * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available + * resources (allocated to this PCIe function), which is zero until + * after we have allocated VIs. + */ + encp->enc_evq_limit = 1024; + encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; + encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + + /* + * The maximum supported transmit queue size is 2048. TXQs with 4096 + * descriptors are not supported as the top bit is used for vfifo + * stuffing. + */ + encp->enc_txq_max_ndescs = 2048; + + encp->enc_buftbl_limit = 0xFFFFFFFF; + + encp->enc_piobuf_limit = MEDFORD2_PIOBUF_NBUFS; + encp->enc_piobuf_size = MEDFORD2_PIOBUF_SIZE; + encp->enc_piobuf_min_alloc_size = MEDFORD2_MIN_PIO_ALLOC_SIZE; + + /* + * Get the current privilege mask. Note that this may be modified + * dynamically, so this value is informational only. DO NOT use + * the privilege mask to check for sufficient privileges, as that + * can result in time-of-check/time-of-use bugs. + */ + if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) + goto fail12; + encp->enc_privilege_mask = mask; + + /* Get interrupt vector limits */ + if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { + if (EFX_PCI_FUNCTION_IS_PF(encp)) + goto fail13; + + /* Ignore error (cannot query vector limits from a VF). */ + base = 0; + nvec = 1024; + } + encp->enc_intr_vec_base = base; + encp->enc_intr_limit = nvec; + + /* + * Maximum number of bytes into the frame the TCP header can start for + * firmware assisted TSO to work. + */ + encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + + /* + * Medford2 stores a single global copy of VPD, not per-PF as on + * Huntington. + */ + encp->enc_vpd_is_global = B_TRUE; + + rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); + if (rc != 0) + goto fail14; + encp->enc_required_pcie_bandwidth_mbps = bandwidth; + encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; + + return (0); + +fail14: + EFSYS_PROBE(fail14); +fail13: + EFSYS_PROBE(fail13); +fail12: + EFSYS_PROBE(fail12); +fail11: + EFSYS_PROBE(fail11); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); +fail8: + EFSYS_PROBE(fail8); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_MEDFORD2 */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Tue Nov 27 12:14:05 2018 (r341019) +++ head/sys/modules/sfxge/Makefile Tue Nov 27 12:14:16 2018 (r341020) @@ -40,6 +40,9 @@ SRCS+= hunt_impl.h SRCS+= medford_nic.c SRCS+= medford_impl.h +SRCS+= medford2_nic.c +SRCS+= medford2_impl.h + # Extra debug checks #CFLAGS += -DDEBUG=1 From owner-svn-src-head@freebsd.org Tue Nov 27 12:19:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C45D11148D51; Tue, 27 Nov 2018 12:19:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 688FA74BA8; Tue, 27 Nov 2018 12:19:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4974D1B19C; Tue, 27 Nov 2018 12:19:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCJoUd096882; Tue, 27 Nov 2018 12:19:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCJnM1096878; Tue, 27 Nov 2018 12:19:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271219.wARCJnM1096878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341021 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 688FA74BA8 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:19:51 -0000 Author: arybchik Date: Tue Nov 27 12:19:49 2018 New Revision: 341021 URL: https://svnweb.freebsd.org/changeset/base/341021 Log: sfxge(4): correct PIO buffer dimensions for Medford2 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18143 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:14:16 2018 (r341020) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:19:49 2018 (r341021) @@ -37,13 +37,27 @@ extern "C" { #endif -#if (EFSYS_OPT_HUNTINGTON && EFSYS_OPT_MEDFORD) -#define EF10_MAX_PIOBUF_NBUFS MAX(HUNT_PIOBUF_NBUFS, MEDFORD_PIOBUF_NBUFS) -#elif EFSYS_OPT_HUNTINGTON -#define EF10_MAX_PIOBUF_NBUFS HUNT_PIOBUF_NBUFS -#elif EFSYS_OPT_MEDFORD -#define EF10_MAX_PIOBUF_NBUFS MEDFORD_PIOBUF_NBUFS -#endif + +/* Number of hardware PIO buffers (for compile-time resource dimensions) */ +#define EF10_MAX_PIOBUF_NBUFS (16) + +#if EFSYS_OPT_HUNTINGTON +# if (EF10_MAX_PIOBUF_NBUFS < HUNT_PIOBUF_NBUFS) +# error "EF10_MAX_PIOBUF_NBUFS too small" +# endif +#endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD +# if (EF10_MAX_PIOBUF_NBUFS < MEDFORD_PIOBUF_NBUFS) +# error "EF10_MAX_PIOBUF_NBUFS too small" +# endif +#endif /* EFSYS_OPT_MEDFORD */ +#if EFSYS_OPT_MEDFORD2 +# if (EF10_MAX_PIOBUF_NBUFS < MEDFORD2_PIOBUF_NBUFS) +# error "EF10_MAX_PIOBUF_NBUFS too small" +# endif +#endif /* EFSYS_OPT_MEDFORD2 */ + + /* * FIXME: This is just a power of 2 which fits in an MCDI v1 message, and could Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Tue Nov 27 12:14:16 2018 (r341020) +++ head/sys/dev/sfxge/common/hunt_nic.c Tue Nov 27 12:19:49 2018 (r341021) @@ -333,6 +333,7 @@ hunt_board_cfg( encp->enc_buftbl_limit = 0xFFFFFFFF; + EFX_STATIC_ASSERT(HUNT_PIOBUF_NBUFS <= EF10_MAX_PIOBUF_NBUFS); encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS; encp->enc_piobuf_size = HUNT_PIOBUF_SIZE; encp->enc_piobuf_min_alloc_size = HUNT_MIN_PIO_ALLOC_SIZE; Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:14:16 2018 (r341020) +++ head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:19:49 2018 (r341021) @@ -336,6 +336,7 @@ medford2_board_cfg( encp->enc_buftbl_limit = 0xFFFFFFFF; + EFX_STATIC_ASSERT(MEDFORD2_PIOBUF_NBUFS <= EF10_MAX_PIOBUF_NBUFS); encp->enc_piobuf_limit = MEDFORD2_PIOBUF_NBUFS; encp->enc_piobuf_size = MEDFORD2_PIOBUF_SIZE; encp->enc_piobuf_min_alloc_size = MEDFORD2_MIN_PIO_ALLOC_SIZE; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:14:16 2018 (r341020) +++ head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:19:49 2018 (r341021) @@ -332,6 +332,7 @@ medford_board_cfg( encp->enc_buftbl_limit = 0xFFFFFFFF; + EFX_STATIC_ASSERT(MEDFORD_PIOBUF_NBUFS <= EF10_MAX_PIOBUF_NBUFS); encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS; encp->enc_piobuf_size = MEDFORD_PIOBUF_SIZE; encp->enc_piobuf_min_alloc_size = MEDFORD_MIN_PIO_ALLOC_SIZE; From owner-svn-src-head@freebsd.org Tue Nov 27 12:20:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E37991148D79; Tue, 27 Nov 2018 12:20:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8608B74C94; Tue, 27 Nov 2018 12:20:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 663F61B1A0; Tue, 27 Nov 2018 12:20:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCK2gm096974; Tue, 27 Nov 2018 12:20:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCK1LQ096971; Tue, 27 Nov 2018 12:20:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271220.wARCK1LQ096971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341022 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8608B74C94 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:20:03 -0000 Author: arybchik Date: Tue Nov 27 12:20:01 2018 New Revision: 341022 URL: https://svnweb.freebsd.org/changeset/base/341022 Log: sfxge(4): move RxDP config get to EF10 NIC code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18144 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:19:49 2018 (r341021) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:20:01 2018 (r341022) @@ -1171,6 +1171,11 @@ efx_mcdi_get_clock( extern __checkReturn efx_rc_t +efx_mcdi_get_rxdp_config( + __in efx_nic_t *enp, + __out uint32_t *end_paddingp); + +extern __checkReturn efx_rc_t efx_mcdi_get_vector_cfg( __in efx_nic_t *enp, __out_opt uint32_t *vec_basep, Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:19:49 2018 (r341021) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:20:01 2018 (r341022) @@ -451,6 +451,64 @@ fail1: } __checkReturn efx_rc_t +efx_mcdi_get_rxdp_config( + __in efx_nic_t *enp, + __out uint32_t *end_paddingp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN, + MC_CMD_GET_RXDP_CONFIG_OUT_LEN)]; + uint32_t end_padding; + efx_rc_t rc; + + memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_RXDP_CONFIG; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN; + + efx_mcdi_execute(enp, &req); + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) { + /* RX DMA end padding is disabled */ + end_padding = 0; + } else { + switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, + GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: + end_padding = 64; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128: + end_padding = 128; + break; + case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256: + end_padding = 256; + break; + default: + rc = ENOTSUP; + goto fail2; + } + } + + *end_paddingp = end_padding; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t efx_mcdi_get_vector_cfg( __in efx_nic_t *enp, __out_opt uint32_t *vec_basep, Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:19:49 2018 (r341021) +++ head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:20:01 2018 (r341022) @@ -40,64 +40,6 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MEDFORD2 static __checkReturn efx_rc_t -efx_mcdi_get_rxdp_config( - __in efx_nic_t *enp, - __out uint32_t *end_paddingp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN, - MC_CMD_GET_RXDP_CONFIG_OUT_LEN)]; - uint32_t end_padding; - efx_rc_t rc; - - memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_RXDP_CONFIG; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN; - - efx_mcdi_execute(enp, &req); - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, - GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) { - /* RX DMA end padding is disabled */ - end_padding = 0; - } else { - switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, - GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { - case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: - end_padding = 64; - break; - case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128: - end_padding = 128; - break; - case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256: - end_padding = 256; - break; - default: - rc = ENOTSUP; - goto fail2; - } - } - - *end_paddingp = end_padding; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static __checkReturn efx_rc_t medford2_nic_get_required_pcie_bandwidth( __in efx_nic_t *enp, __out uint32_t *bandwidth_mbpsp) Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:19:49 2018 (r341021) +++ head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:20:01 2018 (r341022) @@ -38,64 +38,6 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MEDFORD static __checkReturn efx_rc_t -efx_mcdi_get_rxdp_config( - __in efx_nic_t *enp, - __out uint32_t *end_paddingp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN, - MC_CMD_GET_RXDP_CONFIG_OUT_LEN)]; - uint32_t end_padding; - efx_rc_t rc; - - memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_RXDP_CONFIG; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN; - - efx_mcdi_execute(enp, &req); - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, - GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) { - /* RX DMA end padding is disabled */ - end_padding = 0; - } else { - switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA, - GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) { - case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64: - end_padding = 64; - break; - case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128: - end_padding = 128; - break; - case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256: - end_padding = 256; - break; - default: - rc = ENOTSUP; - goto fail2; - } - } - - *end_paddingp = end_padding; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static __checkReturn efx_rc_t medford_nic_get_required_pcie_bandwidth( __in efx_nic_t *enp, __out uint32_t *bandwidth_mbpsp) From owner-svn-src-head@freebsd.org Tue Nov 27 12:20:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE4601148DAC; Tue, 27 Nov 2018 12:20:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF0174DB5; Tue, 27 Nov 2018 12:20:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AD521B1A1; Tue, 27 Nov 2018 12:20:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCKDoY097032; Tue, 27 Nov 2018 12:20:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCKDTj097031; Tue, 27 Nov 2018 12:20:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271220.wARCKDTj097031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341023 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CF0174DB5 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:20:16 -0000 Author: arybchik Date: Tue Nov 27 12:20:12 2018 New Revision: 341023 URL: https://svnweb.freebsd.org/changeset/base/341023 Log: sfxge(4): add Medford2 support to EV module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18145 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Tue Nov 27 12:20:01 2018 (r341022) +++ head/sys/dev/sfxge/common/ef10_ev.c Tue Nov 27 12:20:12 2018 (r341023) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include "mcdi_mon.h" #endif -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 #if EFSYS_OPT_QSTATS #define EFX_EV_QSTAT_INCR(_eep, _stat) \ @@ -576,7 +576,8 @@ ef10_ev_qdestroy( efx_nic_t *enp = eep->ee_enp; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); (void) efx_mcdi_fini_evq(enp, eep->ee_index); } @@ -1415,4 +1416,4 @@ ef10_ev_rxlabel_fini( #endif } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Tue Nov 27 12:20:01 2018 (r341022) +++ head/sys/dev/sfxge/common/efx_ev.c Tue Nov 27 12:20:12 2018 (r341023) @@ -120,7 +120,7 @@ static const efx_ev_ops_t __efx_ev_siena_ops = { }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_ev_ops_t __efx_ev_ef10_ops = { ef10_ev_init, /* eevo_init */ ef10_ev_fini, /* eevo_fini */ @@ -133,7 +133,7 @@ static const efx_ev_ops_t __efx_ev_ef10_ops = { ef10_ev_qstats_update, /* eevo_qstats_update */ #endif }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t @@ -169,6 +169,12 @@ efx_ev_init( eevop = &__efx_ev_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + eevop = &__efx_ev_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(0); From owner-svn-src-head@freebsd.org Tue Nov 27 12:20:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF1291148DEF; Tue, 27 Nov 2018 12:20:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 390F174E90; Tue, 27 Nov 2018 12:20:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC3121B1A2; Tue, 27 Nov 2018 12:20:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCKOMI097092; Tue, 27 Nov 2018 12:20:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCKOUe097091; Tue, 27 Nov 2018 12:20:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271220.wARCKOUe097091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341024 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 390F174E90 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:20:28 -0000 Author: arybchik Date: Tue Nov 27 12:20:23 2018 New Revision: 341024 URL: https://svnweb.freebsd.org/changeset/base/341024 Log: sfxge(4): add Medford2 support to FILTER module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18146 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Tue Nov 27 12:20:12 2018 (r341023) +++ head/sys/dev/sfxge/common/ef10_filter.c Tue Nov 27 12:20:23 2018 (r341024) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 #if EFSYS_OPT_FILTER @@ -122,7 +122,8 @@ ef10_filter_init( ef10_filter_table_t *eftp; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); #define MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match)) EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST == @@ -177,7 +178,8 @@ ef10_filter_fini( __in efx_nic_t *enp) { EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); if (enp->en_filter.ef_ef10_filter_table != NULL) { EFSYS_KMEM_FREE(enp->en_esip, sizeof (ef10_filter_table_t), @@ -522,7 +524,8 @@ ef10_filter_restore( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); for (tbl_id = 0; tbl_id < EFX_EF10_FILTER_TBL_ROWS; tbl_id++) { @@ -597,7 +600,8 @@ ef10_filter_add_internal( boolean_t locked = B_FALSE; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); hash = ef10_filter_hash(spec); @@ -869,7 +873,8 @@ ef10_filter_delete( boolean_t locked = B_FALSE; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); hash = ef10_filter_hash(spec); @@ -1663,4 +1668,4 @@ ef10_filter_default_rxq_clear( #endif /* EFSYS_OPT_FILTER */ -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Tue Nov 27 12:20:12 2018 (r341023) +++ head/sys/dev/sfxge/common/efx_filter.c Tue Nov 27 12:20:23 2018 (r341024) @@ -85,7 +85,7 @@ static const efx_filter_ops_t __efx_filter_siena_ops = }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_filter_ops_t __efx_filter_ef10_ops = { ef10_filter_init, /* efo_init */ ef10_filter_fini, /* efo_fini */ @@ -95,7 +95,7 @@ static const efx_filter_ops_t __efx_filter_ef10_ops = ef10_filter_supported_filters, /* efo_supported_filters */ ef10_filter_reconfigure, /* efo_reconfigure */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_filter_insert( @@ -173,6 +173,12 @@ efx_filter_init( efop = &__efx_filter_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + efop = &__efx_filter_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(0); From owner-svn-src-head@freebsd.org Tue Nov 27 12:20:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADBD41148E61; Tue, 27 Nov 2018 12:20:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B59474FC9; Tue, 27 Nov 2018 12:20:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1CDB1B1A4; Tue, 27 Nov 2018 12:20:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCKZ4N097150; Tue, 27 Nov 2018 12:20:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCKZwf097149; Tue, 27 Nov 2018 12:20:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271220.wARCKZwf097149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341025 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B59474FC9 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:20:39 -0000 Author: arybchik Date: Tue Nov 27 12:20:35 2018 New Revision: 341025 URL: https://svnweb.freebsd.org/changeset/base/341025 Log: sfxge(4): add Medford2 support to INTR module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18147 Modified: head/sys/dev/sfxge/common/ef10_intr.c head/sys/dev/sfxge/common/efx_intr.c Modified: head/sys/dev/sfxge/common/ef10_intr.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_intr.c Tue Nov 27 12:20:23 2018 (r341024) +++ head/sys/dev/sfxge/common/ef10_intr.c Tue Nov 27 12:20:35 2018 (r341025) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 __checkReturn efx_rc_t ef10_intr_init( @@ -83,7 +83,8 @@ efx_mcdi_trigger_interrupt( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); if (level >= enp->en_nic_cfg.enc_intr_limit) { rc = EINVAL; @@ -156,7 +157,8 @@ ef10_intr_status_line( efx_dword_t dword; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* Read the queue mask and implicitly acknowledge the interrupt. */ EFX_BAR_READD(enp, ER_DZ_BIU_INT_ISR_REG, &dword, B_FALSE); @@ -174,7 +176,8 @@ ef10_intr_status_message( __out boolean_t *fatalp) { EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); _NOTE(ARGUNUSED(enp, message)) @@ -197,4 +200,4 @@ ef10_intr_fini( _NOTE(ARGUNUSED(enp)) } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Tue Nov 27 12:20:23 2018 (r341024) +++ head/sys/dev/sfxge/common/efx_intr.c Tue Nov 27 12:20:35 2018 (r341025) @@ -104,7 +104,7 @@ static const efx_intr_ops_t __efx_intr_siena_ops = { }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_intr_ops_t __efx_intr_ef10_ops = { ef10_intr_init, /* eio_init */ ef10_intr_enable, /* eio_enable */ @@ -116,7 +116,7 @@ static const efx_intr_ops_t __efx_intr_ef10_ops = { ef10_intr_fatal, /* eio_fatal */ ef10_intr_fini, /* eio_fini */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_intr_init( @@ -160,6 +160,12 @@ efx_intr_init( eiop = &__efx_intr_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + eiop = &__efx_intr_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(B_FALSE); From owner-svn-src-head@freebsd.org Tue Nov 27 12:20:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 316BB1148EAE; Tue, 27 Nov 2018 12:20:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 650627506B; Tue, 27 Nov 2018 12:20:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2A511B1B4; Tue, 27 Nov 2018 12:20:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCKkOB098098; Tue, 27 Nov 2018 12:20:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCKkMF098096; Tue, 27 Nov 2018 12:20:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271220.wARCKkMF098096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341026 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 650627506B X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:20:48 -0000 Author: arybchik Date: Tue Nov 27 12:20:46 2018 New Revision: 341026 URL: https://svnweb.freebsd.org/changeset/base/341026 Log: sfxge(4): add Medford2 support to MAC module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18148 Modified: head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Tue Nov 27 12:20:35 2018 (r341025) +++ head/sys/dev/sfxge/common/ef10_mac.c Tue Nov 27 12:20:46 2018 (r341026) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 __checkReturn efx_rc_t ef10_mac_poll( @@ -383,7 +383,8 @@ ef10_mac_multicast_list_set( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); if ((rc = emop->emo_reconfigure(enp)) != 0) goto fail1; @@ -897,4 +898,4 @@ ef10_mac_stats_update( #endif /* EFSYS_OPT_MAC_STATS */ -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:20:35 2018 (r341025) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:20:46 2018 (r341026) @@ -93,6 +93,7 @@ typedef enum efx_mac_type_e { EFX_MAC_SIENA, EFX_MAC_HUNTINGTON, EFX_MAC_MEDFORD, + EFX_MAC_MEDFORD2, EFX_MAC_NTYPES } efx_mac_type_t; Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue Nov 27 12:20:35 2018 (r341025) +++ head/sys/dev/sfxge/common/efx_mac.c Tue Nov 27 12:20:46 2018 (r341026) @@ -68,7 +68,7 @@ static const efx_mac_ops_t __efx_mac_siena_ops = { }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_mac_ops_t __efx_mac_ef10_ops = { ef10_mac_poll, /* emo_poll */ ef10_mac_up, /* emo_up */ @@ -91,7 +91,7 @@ static const efx_mac_ops_t __efx_mac_ef10_ops = { ef10_mac_stats_update /* emo_stats_update */ #endif /* EFSYS_OPT_MAC_STATS */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_mac_pdu_set( @@ -854,6 +854,13 @@ efx_mac_select( type = EFX_MAC_MEDFORD; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + emop = &__efx_mac_ef10_ops; + type = EFX_MAC_MEDFORD2; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: rc = EINVAL; From owner-svn-src-head@freebsd.org Tue Nov 27 12:21:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 611AE1148F5E; Tue, 27 Nov 2018 12:21:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A064F752C7; Tue, 27 Nov 2018 12:20:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BA651B1C2; Tue, 27 Nov 2018 12:20:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCKwBW098851; Tue, 27 Nov 2018 12:20:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCKviU098848; Tue, 27 Nov 2018 12:20:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271220.wARCKviU098848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341027 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A064F752C7 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:21:00 -0000 Author: arybchik Date: Tue Nov 27 12:20:57 2018 New Revision: 341027 URL: https://svnweb.freebsd.org/changeset/base/341027 Log: sfxge(4): add Medford2 support to MCDI module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18149 Modified: head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Tue Nov 27 12:20:46 2018 (r341026) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Tue Nov 27 12:20:57 2018 (r341027) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 #if EFSYS_OPT_MCDI @@ -55,7 +55,8 @@ ef10_mcdi_init( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); EFSYS_ASSERT(enp->en_features & EFX_FEATURE_MCDI_DMA); /* @@ -162,7 +163,8 @@ ef10_mcdi_send_request( unsigned int pos; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* Write the header */ for (pos = 0; pos < hdr_len; pos += sizeof (efx_dword_t)) { @@ -281,7 +283,8 @@ ef10_mcdi_feature_supported( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* * Use privilege mask state at MCDI attach. @@ -342,4 +345,4 @@ fail1: #endif /* EFSYS_OPT_MCDI */ -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 12:20:46 2018 (r341026) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 12:20:57 2018 (r341027) @@ -74,7 +74,7 @@ static const efx_mcdi_ops_t __efx_mcdi_siena_ops = { #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_mcdi_ops_t __efx_mcdi_ef10_ops = { ef10_mcdi_init, /* emco_init */ @@ -87,7 +87,7 @@ static const efx_mcdi_ops_t __efx_mcdi_ef10_ops = { ef10_mcdi_get_timeout, /* emco_get_timeout */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ @@ -121,6 +121,12 @@ efx_mcdi_init( break; #endif /* EFSYS_OPT_MEDFORD */ +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + emcop = &__efx_mcdi_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; @@ -1650,7 +1656,7 @@ fail1: #if EFSYS_OPT_BIST -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 /* * Enter bist offline mode. This is a fw mode which puts the NIC into a state * where memory BIST tests can be run and not much else can interfere or happen. @@ -1686,7 +1692,7 @@ fail1: return (rc); } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_mcdi_bist_start( @@ -1950,7 +1956,7 @@ fail1: #endif /* EFSYS_OPT_MAC_STATS */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 /* * This function returns the pf and vf number of a function. If it is a pf the @@ -2049,7 +2055,7 @@ fail1: return (rc); } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_mcdi_set_workaround( Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Tue Nov 27 12:20:46 2018 (r341026) +++ head/sys/dev/sfxge/common/efx_mcdi.h Tue Nov 27 12:20:57 2018 (r341027) @@ -194,11 +194,11 @@ efx_mcdi_mac_spoofing_supported( #if EFSYS_OPT_BIST -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 extern __checkReturn efx_rc_t efx_mcdi_bist_enable_offline( __in efx_nic_t *enp); -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ extern __checkReturn efx_rc_t efx_mcdi_bist_start( __in efx_nic_t *enp, From owner-svn-src-head@freebsd.org Tue Nov 27 12:21:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA5D114906A; Tue, 27 Nov 2018 12:21:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5FDE75461; Tue, 27 Nov 2018 12:21:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 494C71B1D7; Tue, 27 Nov 2018 12:21:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCL9dd001446; Tue, 27 Nov 2018 12:21:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCL8PS001444; Tue, 27 Nov 2018 12:21:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271221.wARCL8PS001444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341028 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5FDE75461 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.37)[0.371,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_LONG(0.51)[0.511,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:21:14 -0000 Author: arybchik Date: Tue Nov 27 12:21:08 2018 New Revision: 341028 URL: https://svnweb.freebsd.org/changeset/base/341028 Log: sfxge(4): add Medford2 support to PHY module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18150 Modified: head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 12:20:57 2018 (r341027) +++ head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 12:21:08 2018 (r341028) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static void mcdi_phy_decode_cap( @@ -633,4 +633,4 @@ ef10_bist_stop( #endif /* EFSYS_OPT_BIST */ -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue Nov 27 12:20:57 2018 (r341027) +++ head/sys/dev/sfxge/common/efx_phy.c Tue Nov 27 12:21:08 2018 (r341028) @@ -56,7 +56,7 @@ static const efx_phy_ops_t __efx_phy_siena_ops = { }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_phy_ops_t __efx_phy_ef10_ops = { ef10_phy_power, /* epo_power */ NULL, /* epo_reset */ @@ -73,7 +73,7 @@ static const efx_phy_ops_t __efx_phy_ef10_ops = { ef10_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_phy_probe( @@ -96,16 +96,25 @@ efx_phy_probe( epop = &__efx_phy_siena_ops; break; #endif /* EFSYS_OPT_SIENA */ + #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: epop = &__efx_phy_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ + #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: epop = &__efx_phy_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + epop = &__efx_phy_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ + default: rc = ENOTSUP; goto fail1; From owner-svn-src-head@freebsd.org Tue Nov 27 12:21:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F121149129; Tue, 27 Nov 2018 12:21:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9320375589; Tue, 27 Nov 2018 12:21:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70A101B1E5; Tue, 27 Nov 2018 12:21:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCLKq8001504; Tue, 27 Nov 2018 12:21:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCLKQL001502; Tue, 27 Nov 2018 12:21:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271221.wARCLKQL001502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341029 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9320375589 X-Spamd-Result: default: False [1.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:21:33 -0000 Author: arybchik Date: Tue Nov 27 12:21:19 2018 New Revision: 341029 URL: https://svnweb.freebsd.org/changeset/base/341029 Log: sfxge(4): add Medford2 support to Rx module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18151 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Tue Nov 27 12:21:08 2018 (r341028) +++ head/sys/dev/sfxge/common/ef10_rx.c Tue Nov 27 12:21:19 2018 (r341029) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static __checkReturn efx_rc_t @@ -1114,4 +1114,4 @@ ef10_rx_fini( #endif /* EFSYS_OPT_RX_SCALE */ } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Tue Nov 27 12:21:08 2018 (r341028) +++ head/sys/dev/sfxge/common/efx_rx.c Tue Nov 27 12:21:19 2018 (r341029) @@ -180,7 +180,7 @@ static const efx_rx_ops_t __efx_rx_siena_ops = { }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_rx_ops_t __efx_rx_ef10_ops = { ef10_rx_init, /* erxo_init */ ef10_rx_fini, /* erxo_fini */ @@ -207,7 +207,7 @@ static const efx_rx_ops_t __efx_rx_ef10_ops = { ef10_rx_qcreate, /* erxo_qcreate */ ef10_rx_qdestroy, /* erxo_qdestroy */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t @@ -248,6 +248,12 @@ efx_rx_init( erxop = &__efx_rx_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + erxop = &__efx_rx_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(0); From owner-svn-src-head@freebsd.org Tue Nov 27 12:21:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 654C1114914E; Tue, 27 Nov 2018 12:21:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC864755F8; Tue, 27 Nov 2018 12:21:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F46A1B1F4; Tue, 27 Nov 2018 12:21:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCLVKN001562; Tue, 27 Nov 2018 12:21:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCLVeX001560; Tue, 27 Nov 2018 12:21:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271221.wARCLVeX001560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341030 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC864755F8 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:21:35 -0000 Author: arybchik Date: Tue Nov 27 12:21:30 2018 New Revision: 341030 URL: https://svnweb.freebsd.org/changeset/base/341030 Log: sfxge(4): add Medford2 support to Tx module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18152 Modified: head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 12:21:19 2018 (r341029) +++ head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 12:21:30 2018 (r341030) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 #if EFSYS_OPT_QSTATS #define EFX_TX_QSTAT_INCR(_etp, _stat) \ @@ -779,4 +779,4 @@ ef10_tx_qstats_update( #endif /* EFSYS_OPT_QSTATS */ -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Tue Nov 27 12:21:19 2018 (r341029) +++ head/sys/dev/sfxge/common/efx_tx.c Tue Nov 27 12:21:30 2018 (r341030) @@ -204,6 +204,33 @@ static const efx_tx_ops_t __efx_tx_medford_ops = { }; #endif /* EFSYS_OPT_MEDFORD */ +#if EFSYS_OPT_MEDFORD2 +static const efx_tx_ops_t __efx_tx_medford2_ops = { + ef10_tx_init, /* etxo_init */ + ef10_tx_fini, /* etxo_fini */ + ef10_tx_qcreate, /* etxo_qcreate */ + ef10_tx_qdestroy, /* etxo_qdestroy */ + ef10_tx_qpost, /* etxo_qpost */ + ef10_tx_qpush, /* etxo_qpush */ + ef10_tx_qpace, /* etxo_qpace */ + ef10_tx_qflush, /* etxo_qflush */ + ef10_tx_qenable, /* etxo_qenable */ + ef10_tx_qpio_enable, /* etxo_qpio_enable */ + ef10_tx_qpio_disable, /* etxo_qpio_disable */ + ef10_tx_qpio_write, /* etxo_qpio_write */ + ef10_tx_qpio_post, /* etxo_qpio_post */ + ef10_tx_qdesc_post, /* etxo_qdesc_post */ + ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ + NULL, /* etxo_qdesc_tso_create */ + ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ + ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ +#if EFSYS_OPT_QSTATS + ef10_tx_qstats_update, /* etxo_qstats_update */ +#endif +}; +#endif /* EFSYS_OPT_MEDFORD2 */ + + __checkReturn efx_rc_t efx_tx_init( __in efx_nic_t *enp) @@ -242,6 +269,12 @@ efx_tx_init( etxop = &__efx_tx_medford_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + etxop = &__efx_tx_medford2_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(0); From owner-svn-src-head@freebsd.org Tue Nov 27 12:21:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF5B11492FC; Tue, 27 Nov 2018 12:21:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A461775737; Tue, 27 Nov 2018 12:21:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BD4D1B207; Tue, 27 Nov 2018 12:21:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCLgGB002322; Tue, 27 Nov 2018 12:21:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCLgGi002320; Tue, 27 Nov 2018 12:21:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271221.wARCLgGi002320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341031 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A461775737 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:21:45 -0000 Author: arybchik Date: Tue Nov 27 12:21:41 2018 New Revision: 341031 URL: https://svnweb.freebsd.org/changeset/base/341031 Log: sfxge(4): add Medford2 support to NVRAM module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18153 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Tue Nov 27 12:21:30 2018 (r341030) +++ head/sys/dev/sfxge/common/ef10_nvram.c Tue Nov 27 12:21:41 2018 (r341031) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 #if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM @@ -2179,6 +2179,20 @@ static ef10_parttbl_entry_t medford_parttbl[] = { PARTN_MAP_ENTRY(MUM_FIRMWARE, ALL, MUM_FIRMWARE), }; +static ef10_parttbl_entry_t medford2_parttbl[] = { + /* partn ports nvtype */ + PARTN_MAP_ENTRY(MC_FIRMWARE, ALL, MC_FIRMWARE), + PARTN_MAP_ENTRY(MC_FIRMWARE_BACKUP, ALL, MC_GOLDEN), + PARTN_MAP_ENTRY(EXPANSION_ROM, ALL, BOOTROM), + PARTN_MAP_ENTRY(EXPROM_CONFIG, ALL, BOOTROM_CFG), + PARTN_MAP_ENTRY(DYNAMIC_CONFIG, ALL, DYNAMIC_CFG), + PARTN_MAP_ENTRY(FPGA, ALL, FPGA), + PARTN_MAP_ENTRY(FPGA_BACKUP, ALL, FPGA_BACKUP), + PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), + PARTN_MAP_ENTRY(EXPANSION_UEFI, ALL, UEFIROM), + PARTN_MAP_ENTRY(MUM_FIRMWARE, ALL, MUM_FIRMWARE), +}; + static __checkReturn efx_rc_t ef10_parttbl_get( __in efx_nic_t *enp, @@ -2196,6 +2210,11 @@ ef10_parttbl_get( *parttbl_rowsp = EFX_ARRAY_SIZE(medford_parttbl); break; + case EFX_FAMILY_MEDFORD2: + *parttblp = medford2_parttbl; + *parttbl_rowsp = EFX_ARRAY_SIZE(medford2_parttbl); + break; + default: EFSYS_ASSERT(B_FALSE); return (EINVAL); @@ -2389,4 +2408,4 @@ fail1: #endif /* EFSYS_OPT_NVRAM */ -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Tue Nov 27 12:21:30 2018 (r341030) +++ head/sys/dev/sfxge/common/efx_nvram.c Tue Nov 27 12:21:41 2018 (r341031) @@ -59,7 +59,7 @@ static const efx_nvram_ops_t __efx_nvram_siena_ops = { #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_nvram_ops_t __efx_nvram_ef10_ops = { #if EFSYS_OPT_DIAG @@ -78,7 +78,7 @@ static const efx_nvram_ops_t __efx_nvram_ef10_ops = { ef10_nvram_buffer_validate, /* envo_buffer_validate */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_nvram_init( @@ -109,6 +109,12 @@ efx_nvram_init( envop = &__efx_nvram_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + envop = &__efx_nvram_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(0); From owner-svn-src-head@freebsd.org Tue Nov 27 12:21:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD65114934A; Tue, 27 Nov 2018 12:21:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9439C7589A; Tue, 27 Nov 2018 12:21:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 801721B218; Tue, 27 Nov 2018 12:21:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCLr0r002377; Tue, 27 Nov 2018 12:21:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCLrCf002376; Tue, 27 Nov 2018 12:21:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271221.wARCLrCf002376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341032 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9439C7589A X-Spamd-Result: default: False [1.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:21:58 -0000 Author: arybchik Date: Tue Nov 27 12:21:53 2018 New Revision: 341032 URL: https://svnweb.freebsd.org/changeset/base/341032 Log: sfxge(4): add Medford2 support to SRAM module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18154 Modified: head/sys/dev/sfxge/common/efx_sram.c Modified: head/sys/dev/sfxge/common/efx_sram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_sram.c Tue Nov 27 12:21:41 2018 (r341031) +++ head/sys/dev/sfxge/common/efx_sram.c Tue Nov 27 12:21:53 2018 (r341032) @@ -54,9 +54,10 @@ efx_sram_buf_tbl_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 if (enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD) { + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2) { /* * FIXME: the efx_sram_buf_tbl_*() functionality needs to be * pulled inside the Falcon/Siena queue create/destroy code, @@ -68,7 +69,7 @@ efx_sram_buf_tbl_set( return (0); } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ if (stop >= EFX_BUF_TBL_SIZE) { rc = EFBIG; @@ -176,9 +177,10 @@ efx_sram_buf_tbl_clear( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 if (enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD) { + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2) { /* * FIXME: the efx_sram_buf_tbl_*() functionality needs to be * pulled inside the Falcon/Siena queue create/destroy code, @@ -190,7 +192,7 @@ efx_sram_buf_tbl_clear( return; } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ EFSYS_ASSERT3U(stop, <, EFX_BUF_TBL_SIZE); From owner-svn-src-head@freebsd.org Tue Nov 27 12:22:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 247E111493A3; Tue, 27 Nov 2018 12:22:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B76F0759D8; Tue, 27 Nov 2018 12:22:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CE5B1B224; Tue, 27 Nov 2018 12:22:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCM46i002466; Tue, 27 Nov 2018 12:22:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCM4Me002465; Tue, 27 Nov 2018 12:22:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271222.wARCM4Me002465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341033 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B76F0759D8 X-Spamd-Result: default: False [1.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:22:10 -0000 Author: arybchik Date: Tue Nov 27 12:22:03 2018 New Revision: 341033 URL: https://svnweb.freebsd.org/changeset/base/341033 Log: sfxge(4): add Medford2 support to BOOTCFG module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18155 Modified: head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Tue Nov 27 12:21:53 2018 (r341032) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Tue Nov 27 12:22:03 2018 (r341033) @@ -97,6 +97,20 @@ efx_bootcfg_sector_info( } #endif /* EFSYS_OPT_MEDFORD */ +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: { + /* Shared partition (array indexed by PF) */ + max_size = BOOTCFG_PER_PF; + count = BOOTCFG_PF_COUNT; + if (pf >= count) { + rc = EINVAL; + goto fail3; + } + offset = max_size * pf; + break; + } +#endif /* EFSYS_OPT_MEDFORD2 */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; @@ -111,6 +125,10 @@ efx_bootcfg_sector_info( return (0); +#if EFSYS_OPT_MEDFORD2 +fail3: + EFSYS_PROBE(fail3); +#endif #if EFSYS_OPT_MEDFORD fail2: EFSYS_PROBE(fail2); @@ -306,7 +324,7 @@ efx_bootcfg_read( efx_rc_t rc; uint32_t sector_number; -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 sector_number = enp->en_nic_cfg.enc_pf; #else sector_number = 0; @@ -447,7 +465,7 @@ efx_bootcfg_write( efx_rc_t rc; uint32_t sector_number; -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 sector_number = enp->en_nic_cfg.enc_pf; #else sector_number = 0; From owner-svn-src-head@freebsd.org Tue Nov 27 12:22:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D88711493E9; Tue, 27 Nov 2018 12:22:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EF8C75B0D; Tue, 27 Nov 2018 12:22:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7547F1B233; Tue, 27 Nov 2018 12:22:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCMFiD002526; Tue, 27 Nov 2018 12:22:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCMFQG002525; Tue, 27 Nov 2018 12:22:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271222.wARCMFQG002525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341034 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EF8C75B0D X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:22:21 -0000 Author: arybchik Date: Tue Nov 27 12:22:14 2018 New Revision: 341034 URL: https://svnweb.freebsd.org/changeset/base/341034 Log: sfxge(4): add Medford2 support to VPD module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18156 Modified: head/sys/dev/sfxge/common/ef10_vpd.c head/sys/dev/sfxge/common/efx_vpd.c Modified: head/sys/dev/sfxge/common/ef10_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_vpd.c Tue Nov 27 12:22:03 2018 (r341033) +++ head/sys/dev/sfxge/common/ef10_vpd.c Tue Nov 27 12:22:14 2018 (r341034) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_VPD -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 #include "ef10_tlv_layout.h" @@ -53,7 +53,8 @@ ef10_vpd_init( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); if (enp->en_nic_cfg.enc_vpd_is_global) { tag = TLV_TAG_GLOBAL_STATIC_VPD; @@ -109,7 +110,8 @@ ef10_vpd_size( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* * This function returns the total size the user should allocate @@ -142,7 +144,8 @@ ef10_vpd_read( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); if (enp->en_nic_cfg.enc_vpd_is_global) { tag = TLV_TAG_GLOBAL_DYNAMIC_VPD; @@ -194,7 +197,8 @@ ef10_vpd_verify( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* * Strictly you could take the view that dynamic vpd is optional. @@ -315,7 +319,8 @@ ef10_vpd_get( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* Attempt to satisfy the request from svpd first */ if (enp->en_arch.ef10.ena_svpd_length > 0) { @@ -361,7 +366,8 @@ ef10_vpd_set( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); /* If the provided (tag,keyword) exists in svpd, then it is readonly */ if (enp->en_arch.ef10.ena_svpd_length > 0) { @@ -414,7 +420,8 @@ ef10_vpd_write( efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); if (enp->en_nic_cfg.enc_vpd_is_global) { tag = TLV_TAG_GLOBAL_DYNAMIC_VPD; @@ -450,7 +457,8 @@ ef10_vpd_fini( __in efx_nic_t *enp) { EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); + enp->en_family == EFX_FAMILY_MEDFORD || + enp->en_family == EFX_FAMILY_MEDFORD2); if (enp->en_arch.ef10.ena_svpd_length > 0) { EFSYS_KMEM_FREE(enp->en_esip, enp->en_arch.ef10.ena_svpd_length, @@ -461,6 +469,6 @@ ef10_vpd_fini( } } -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ #endif /* EFSYS_OPT_VPD */ Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Tue Nov 27 12:22:03 2018 (r341033) +++ head/sys/dev/sfxge/common/efx_vpd.c Tue Nov 27 12:22:14 2018 (r341034) @@ -73,7 +73,7 @@ static const efx_vpd_ops_t __efx_vpd_siena_ops = { #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static const efx_vpd_ops_t __efx_vpd_ef10_ops = { ef10_vpd_init, /* evpdo_init */ @@ -88,7 +88,7 @@ static const efx_vpd_ops_t __efx_vpd_ef10_ops = { ef10_vpd_fini, /* evpdo_fini */ }; -#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_vpd_init( @@ -119,6 +119,12 @@ efx_vpd_init( evpdop = &__efx_vpd_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + evpdop = &__efx_vpd_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(0); From owner-svn-src-head@freebsd.org Tue Nov 27 12:22:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57AC81149427; Tue, 27 Nov 2018 12:22:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F68E75BE1; Tue, 27 Nov 2018 12:22:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 738A81B335; Tue, 27 Nov 2018 12:22:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCMQXV002583; Tue, 27 Nov 2018 12:22:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCMQS3002582; Tue, 27 Nov 2018 12:22:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271222.wARCMQS3002582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341035 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F68E75BE1 X-Spamd-Result: default: False [1.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:22:31 -0000 Author: arybchik Date: Tue Nov 27 12:22:25 2018 New Revision: 341035 URL: https://svnweb.freebsd.org/changeset/base/341035 Log: sfxge(4): add Medford2 support to MON module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18157 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Tue Nov 27 12:22:14 2018 (r341034) +++ head/sys/dev/sfxge/common/mcdi_mon.c Tue Nov 27 12:22:25 2018 (r341035) @@ -504,6 +504,11 @@ mcdi_mon_cfg_build( encp->enc_mon_type = EFX_MON_SFC92X0; break; #endif +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + encp->enc_mon_type = EFX_MON_SFC92X0; + break; +#endif default: rc = EINVAL; goto fail1; From owner-svn-src-head@freebsd.org Tue Nov 27 12:22:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE49A1149482; Tue, 27 Nov 2018 12:22:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D03975CFC; Tue, 27 Nov 2018 12:22:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E94021B338; Tue, 27 Nov 2018 12:22:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCMdqJ002650; Tue, 27 Nov 2018 12:22:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCMbHd002639; Tue, 27 Nov 2018 12:22:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271222.wARCMbHd002639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341036 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D03975CFC X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.73)[0.726,0]; NEURAL_SPAM_SHORT(0.41)[0.406,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:22:45 -0000 Author: arybchik Date: Tue Nov 27 12:22:37 2018 New Revision: 341036 URL: https://svnweb.freebsd.org/changeset/base/341036 Log: sfxge(4): support runtime VI window size Medford2 uses a configurable VI window size, and requires updates to register accesses to use a runtime VI window size rather than the *_STEP register constants used for earlier controllers. Update the common code to query the VI window size via MCDI, and add new EFX_BAR_VI_* accessor macros for per-VI registers. The existing EFX_BAR_TBL_* macros can be used for non-VI register tables (and for code that can never be called for a Medford2 controller e.g. Siena-only code). Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18158 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/ef10_ev.c Tue Nov 27 12:22:37 2018 (r341036) @@ -604,7 +604,7 @@ ef10_ev_qprime( EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH, ERF_DD_EVQ_IND_RPTR, (rptr >> ERF_DD_EVQ_IND_RPTR_WIDTH)); - EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, + EFX_BAR_VI_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, &dword, B_FALSE); EFX_POPULATE_DWORD_2(dword, @@ -612,11 +612,11 @@ ef10_ev_qprime( EFE_DD_EVQ_IND_RPTR_FLAGS_LOW, ERF_DD_EVQ_IND_RPTR, rptr & ((1 << ERF_DD_EVQ_IND_RPTR_WIDTH) - 1)); - EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, + EFX_BAR_VI_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, &dword, B_FALSE); } else { EFX_POPULATE_DWORD_1(dword, ERF_DZ_EVQ_RPTR, rptr); - EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_RPTR_REG, eep->ee_index, + EFX_BAR_VI_WRITED(enp, ER_DZ_EVQ_RPTR_REG, eep->ee_index, &dword, B_FALSE); } @@ -729,13 +729,13 @@ ef10_ev_qmoderate( EFE_DD_EVQ_IND_TIMER_FLAGS, ERF_DD_EVQ_IND_TIMER_MODE, mode, ERF_DD_EVQ_IND_TIMER_VAL, ticks); - EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, + EFX_BAR_VI_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, &dword, 0); } else { EFX_POPULATE_DWORD_2(dword, ERF_DZ_TC_TIMER_MODE, mode, ERF_DZ_TC_TIMER_VAL, ticks); - EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, + EFX_BAR_VI_WRITED(enp, ER_DZ_EVQ_TMR_REG, eep->ee_index, &dword, 0); } } Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:22:37 2018 (r341036) @@ -1186,6 +1186,11 @@ extern __checkReturn efx_rc_t ef10_get_datapath_caps( __in efx_nic_t *enp); +extern __checkReturn efx_rc_t +ef10_get_vi_window_shift( + __in efx_nic_t *enp, + __out uint32_t *vi_window_shiftp); + extern __checkReturn efx_rc_t ef10_get_privilege_mask( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:22:37 2018 (r341036) @@ -1170,7 +1170,72 @@ fail1: return (rc); } + __checkReturn efx_rc_t +ef10_get_vi_window_shift( + __in efx_nic_t *enp, + __out uint32_t *vi_window_shiftp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, + MC_CMD_GET_CAPABILITIES_V3_OUT_LEN)]; + uint32_t mode; + efx_rc_t rc; + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_CAPABILITIES; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_CAPABILITIES_V3_OUT_LEN; + + efx_mcdi_execute_quiet(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V3_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + mode = MCDI_OUT_BYTE(req, GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE); + + switch (mode) { + case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_8K: + EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8 * 1024); + *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_8K; + break; + + case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_16K: + EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_16K == 16 * 1024); + *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_16K; + break; + + case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_64K: + EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_64K == 64 * 1024); + *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_64K; + break; + + default: + *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_INVALID; + rc = EINVAL; + goto fail3; + } + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + #define EF10_LEGACY_PF_PRIVILEGE_MASK \ (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ @@ -1586,6 +1651,7 @@ ef10_nic_init( uint32_t i; uint32_t retry; uint32_t delay_us; + uint32_t vi_window_size; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || @@ -1648,15 +1714,21 @@ ef10_nic_init( enp->en_arch.ef10.ena_pio_write_vi_base = vi_count - enp->en_arch.ef10.ena_piobuf_count; + EFSYS_ASSERT3U(enp->en_nic_cfg.enc_vi_window_shift, !=, + EFX_VI_WINDOW_SHIFT_INVALID); + EFSYS_ASSERT3U(enp->en_nic_cfg.enc_vi_window_shift, <=, + EFX_VI_WINDOW_SHIFT_64K); + vi_window_size = 1U << enp->en_nic_cfg.enc_vi_window_shift; + /* Save UC memory mapping details */ enp->en_arch.ef10.ena_uc_mem_map_offset = 0; if (enp->en_arch.ef10.ena_piobuf_count > 0) { enp->en_arch.ef10.ena_uc_mem_map_size = - (ER_DZ_TX_PIOBUF_STEP * + (vi_window_size * enp->en_arch.ef10.ena_pio_write_vi_base); } else { enp->en_arch.ef10.ena_uc_mem_map_size = - (ER_DZ_TX_PIOBUF_STEP * + (vi_window_size * enp->en_arch.ef10.ena_vi_count); } @@ -1666,7 +1738,7 @@ ef10_nic_init( enp->en_arch.ef10.ena_uc_mem_map_size; enp->en_arch.ef10.ena_wc_mem_map_size = - (ER_DZ_TX_PIOBUF_STEP * + (vi_window_size * enp->en_arch.ef10.ena_piobuf_count); /* Link piobufs to extra VIs in WC mapping */ Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/ef10_rx.c Tue Nov 27 12:22:37 2018 (r341036) @@ -822,8 +822,8 @@ ef10_rx_qpush( EFX_DMA_SYNC_QUEUE_FOR_DEVICE(erp->er_esmp, erp->er_mask + 1, wptr, pushed & erp->er_mask); EFSYS_PIO_WRITE_BARRIER(); - EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG, - erp->er_index, &dword, B_FALSE); + EFX_BAR_VI_WRITED(enp, ER_DZ_RX_DESC_UPD_REG, + erp->er_index, &dword, B_FALSE); } #if EFSYS_OPT_RX_PACKED_STREAM @@ -854,7 +854,7 @@ ef10_rx_qpush_ps_credits( ERF_DZ_RX_DESC_MAGIC_CMD, ERE_DZ_RX_DESC_MAGIC_CMD_PS_CREDITS, ERF_DZ_RX_DESC_MAGIC_DATA, credits); - EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG, + EFX_BAR_VI_WRITED(enp, ER_DZ_RX_DESC_UPD_REG, erp->er_index, &dword, B_FALSE); rxq_state->eers_rx_packed_stream_credits = 0; Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 12:22:37 2018 (r341036) @@ -538,8 +538,8 @@ ef10_tx_qpush( EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, wptr, id); EFSYS_PIO_WRITE_BARRIER(); - EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG, - etp->et_index, &oword); + EFX_BAR_VI_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG, + etp->et_index, &oword); } else { efx_dword_t dword; @@ -554,8 +554,8 @@ ef10_tx_qpush( EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, wptr, id); EFSYS_PIO_WRITE_BARRIER(); - EFX_BAR_TBL_WRITED2(enp, ER_DZ_TX_DESC_UPD_REG, - etp->et_index, &dword, B_FALSE); + EFX_BAR_VI_WRITED2(enp, ER_DZ_TX_DESC_UPD_REG, + etp->et_index, &dword, B_FALSE); } } Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:22:37 2018 (r341036) @@ -1115,6 +1115,13 @@ typedef enum efx_tunnel_protocol_e { EFX_TUNNEL_NPROTOS } efx_tunnel_protocol_t; +typedef enum efx_vi_window_shift_e { + EFX_VI_WINDOW_SHIFT_INVALID = 0, + EFX_VI_WINDOW_SHIFT_8K = 13, + EFX_VI_WINDOW_SHIFT_16K = 14, + EFX_VI_WINDOW_SHIFT_64K = 16, +} efx_vi_window_shift_t; + typedef struct efx_nic_cfg_s { uint32_t enc_board_type; uint32_t enc_phy_type; @@ -1128,6 +1135,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_mon_stat_mask[(EFX_MON_NSTATS + 31) / 32]; #endif unsigned int enc_features; + efx_vi_window_shift_t enc_vi_window_shift; uint8_t enc_mac_addr[6]; uint8_t enc_port; /* PHY port number */ uint32_t enc_intr_vec_base; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:22:37 2018 (r341036) @@ -952,6 +952,15 @@ struct efx_txq_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) +/* + * Accessors for memory BAR non-VI tables. + * + * Code used on EF10 *must* use EFX_BAR_VI_*() macros for per-VI registers, + * to ensure the correct runtime VI window size is used on Medford2. + * + * Siena-only code may continue using EFX_BAR_TBL_*() macros for VI registers. + */ + #define EFX_BAR_TBL_READD(_enp, _reg, _index, _edp, _lock) \ do { \ EFX_CHECK_REG((_enp), (_reg)); \ @@ -978,21 +987,6 @@ struct efx_txq_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -#define EFX_BAR_TBL_WRITED2(_enp, _reg, _index, _edp, _lock) \ - do { \ - EFX_CHECK_REG((_enp), (_reg)); \ - EFSYS_PROBE4(efx_bar_tbl_writed, const char *, #_reg, \ - uint32_t, (_index), \ - uint32_t, _reg ## _OFST, \ - uint32_t, (_edp)->ed_u32[0]); \ - EFSYS_BAR_WRITED((_enp)->en_esbp, \ - (_reg ## _OFST + \ - (2 * sizeof (efx_dword_t)) + \ - ((_index) * _reg ## _STEP)), \ - (_edp), (_lock)); \ - _NOTE(CONSTANTCONDITION) \ - } while (B_FALSE) - #define EFX_BAR_TBL_WRITED3(_enp, _reg, _index, _edp, _lock) \ do { \ EFX_CHECK_REG((_enp), (_reg)); \ @@ -1069,16 +1063,66 @@ struct efx_txq_s { } while (B_FALSE) /* - * Allow drivers to perform optimised 128-bit doorbell writes. + * Accessors for memory BAR per-VI registers. + * + * The VI window size is 8KB for Medford and all earlier controllers. + * For Medford2, the VI window size can be 8KB, 16KB or 64KB. + */ + +#define EFX_BAR_VI_READD(_enp, _reg, _index, _edp, _lock) \ + do { \ + EFX_CHECK_REG((_enp), (_reg)); \ + EFSYS_BAR_READD((_enp)->en_esbp, \ + ((_reg ## _OFST) + \ + ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \ + (_edp), (_lock)); \ + EFSYS_PROBE4(efx_bar_vi_readd, const char *, #_reg, \ + uint32_t, (_index), \ + uint32_t, _reg ## _OFST, \ + uint32_t, (_edp)->ed_u32[0]); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFX_BAR_VI_WRITED(_enp, _reg, _index, _edp, _lock) \ + do { \ + EFX_CHECK_REG((_enp), (_reg)); \ + EFSYS_PROBE4(efx_bar_vi_writed, const char *, #_reg, \ + uint32_t, (_index), \ + uint32_t, _reg ## _OFST, \ + uint32_t, (_edp)->ed_u32[0]); \ + EFSYS_BAR_WRITED((_enp)->en_esbp, \ + ((_reg ## _OFST) + \ + ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \ + (_edp), (_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFX_BAR_VI_WRITED2(_enp, _reg, _index, _edp, _lock) \ + do { \ + EFX_CHECK_REG((_enp), (_reg)); \ + EFSYS_PROBE4(efx_bar_vi_writed, const char *, #_reg, \ + uint32_t, (_index), \ + uint32_t, _reg ## _OFST, \ + uint32_t, (_edp)->ed_u32[0]); \ + EFSYS_BAR_WRITED((_enp)->en_esbp, \ + ((_reg ## _OFST) + \ + (2 * sizeof (efx_dword_t)) + \ + ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \ + (_edp), (_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +/* + * Allow drivers to perform optimised 128-bit VI doorbell writes. * The DMA descriptor pointers (RX_DESC_UPD and TX_DESC_UPD) are * special-cased in the BIU on the Falcon/Siena and EF10 architectures to avoid * the need for locking in the host, and are the only ones known to be safe to * use 128-bites write with. */ -#define EFX_BAR_TBL_DOORBELL_WRITEO(_enp, _reg, _index, _eop) \ +#define EFX_BAR_VI_DOORBELL_WRITEO(_enp, _reg, _index, _eop) \ do { \ EFX_CHECK_REG((_enp), (_reg)); \ - EFSYS_PROBE7(efx_bar_tbl_doorbell_writeo, \ + EFSYS_PROBE7(efx_bar_vi_doorbell_writeo, \ const char *, #_reg, \ uint32_t, (_index), \ uint32_t, _reg ## _OFST, \ @@ -1087,7 +1131,8 @@ struct efx_txq_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ EFSYS_BAR_DOORBELL_WRITEO((_enp)->en_esbp, \ - (_reg ## _OFST + ((_index) * _reg ## _STEP)), \ + (_reg ## _OFST + \ + ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \ (_eop)); \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/hunt_nic.c Tue Nov 27 12:22:37 2018 (r341036) @@ -119,6 +119,17 @@ hunt_board_cfg( uint32_t bandwidth; efx_rc_t rc; + /* Huntington has a fixed 8Kbyte VI window size */ + EFX_STATIC_ASSERT(ER_DZ_EVQ_RPTR_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_EVQ_TMR_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_RX_DESC_UPD_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_TX_DESC_UPD_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_TX_PIOBUF_STEP == 8192); + + EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; + + if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) goto fail1; Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:22:37 2018 (r341036) @@ -91,12 +91,21 @@ medford2_board_cfg( uint32_t base, nvec; uint32_t end_padding; uint32_t bandwidth; + uint32_t vi_window_shift; efx_rc_t rc; /* * FIXME: Likely to be incomplete and incorrect. * Parts of this should be shared with Huntington. */ + + /* Medford2 has a variable VI window size (8K, 16K or 64K) */ + if ((rc = ef10_get_vi_window_shift(enp, &vi_window_shift)) != 0) + goto fail1; + + EFSYS_ASSERT3U(vi_window_shift, <=, EFX_VI_WINDOW_SHIFT_64K); + encp->enc_vi_window_shift = vi_window_shift; + if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) goto fail1; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:22:37 2018 (r341036) @@ -94,6 +94,17 @@ medford_board_cfg( * Parts of this should be shared with Huntington. */ + /* Medford has a fixed 8Kbyte VI window size */ + EFX_STATIC_ASSERT(ER_DZ_EVQ_RPTR_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_EVQ_TMR_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_RX_DESC_UPD_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_TX_DESC_UPD_REG_STEP == 8192); + EFX_STATIC_ASSERT(ER_DZ_TX_PIOBUF_STEP == 8192); + + EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; + + if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) goto fail1; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Tue Nov 27 12:22:25 2018 (r341035) +++ head/sys/dev/sfxge/common/siena_nic.c Tue Nov 27 12:22:37 2018 (r341036) @@ -95,6 +95,10 @@ siena_board_cfg( uint32_t nevq, nrxq, ntxq; efx_rc_t rc; + /* Siena has a fixed 8Kbyte VI window size */ + EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; + /* External port identifier using one-based port numbering */ encp->enc_external_port = (uint8_t)enp->en_mcdi.em_emip.emi_port; From owner-svn-src-head@freebsd.org Tue Nov 27 12:23:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C98F11494C2; Tue, 27 Nov 2018 12:23:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B87775E77; Tue, 27 Nov 2018 12:22:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 125E31B339; Tue, 27 Nov 2018 12:22:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCMoRt002707; Tue, 27 Nov 2018 12:22:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCMofR002706; Tue, 27 Nov 2018 12:22:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271222.wARCMofR002706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341037 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B87775E77 X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:23:08 -0000 Author: arybchik Date: Tue Nov 27 12:22:50 2018 New Revision: 341037 URL: https://svnweb.freebsd.org/changeset/base/341037 Log: sfxge(4): improve comments for EF10 ext port mapping Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18159 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:22:37 2018 (r341036) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 12:22:50 2018 (r341037) @@ -1288,26 +1288,58 @@ fail1: /* - * Table of mapping schemes from port number to the number of the external - * connector on the board. The external numbering does not distinguish - * off-board separated outputs such as from multi-headed cables. + * Table of mapping schemes from port number to external number. * - * The count of adjacent port numbers that map to each external port + * Each port number ultimately corresponds to a connector: either as part of + * a cable assembly attached to a module inserted in an SFP+/QSFP+ cage on + * the board, or fixed to the board (e.g. 10GBASE-T magjack on SFN5121T + * "Salina"). In general: + * + * Port number (0-based) + * | + * port mapping (n:1) + * | + * v + * External port number (normally 1-based) + * | + * fixed (1:1) or cable assembly (1:m) + * | + * v + * Connector + * + * The external numbering refers to the cages or magjacks on the board, + * as visibly annotated on the board or back panel. This table describes + * how to determine which external cage/magjack corresponds to the port + * numbers used by the driver. + * + * The count of adjacent port numbers that map to each external number, * and the offset in the numbering, is determined by the chip family and * current port mode. * * For the Huntington family, the current port mode cannot be discovered, + * but a single mapping is used by all modes for a given chip variant, * so the mapping used is instead the last match in the table to the full * set of port modes to which the NIC can be configured. Therefore the - * ordering of entries in the the mapping table is significant. + * ordering of entries in the mapping table is significant. */ -static struct { +static struct ef10_external_port_map_s { efx_family_t family; uint32_t modes_mask; int32_t count; int32_t offset; } __ef10_external_port_mappings[] = { - /* Supported modes with 1 output per external port */ + /* + * Modes used by Huntington family controllers where each port + * number maps to a separate cage. + * SFN7x22F (Torino): + * port 0 -> cage 1 + * port 1 -> cage 2 + * SFN7xx4F (Pavia): + * port 0 -> cage 1 + * port 1 -> cage 2 + * port 2 -> cage 3 + * port 3 -> cage 4 + */ { EFX_FAMILY_HUNTINGTON, (1 << TLV_PORT_MODE_10G) | @@ -1316,6 +1348,14 @@ static struct { 1, 1 }, + /* + * Modes that on Medford allocate each port number to a separate + * cage. + * port 0 -> cage 1 + * port 1 -> cage 2 + * port 2 -> cage 3 + * port 3 -> cage 4 + */ { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G) | @@ -1323,7 +1363,15 @@ static struct { 1, 1 }, - /* Supported modes with 2 outputs per external port */ + /* + * Modes which for Huntington identify a chip variant where 2 + * adjacent port numbers map to each cage. + * SFN7x42Q (Monza): + * port 0 -> cage 1 + * port 1 -> cage 1 + * port 2 -> cage 2 + * port 3 -> cage 2 + */ { EFX_FAMILY_HUNTINGTON, (1 << TLV_PORT_MODE_40G) | @@ -1333,6 +1381,14 @@ static struct { 2, 1 }, + /* + * Modes that on Medford allocate 2 adjacent port numbers to each + * cage. + * port 0 -> cage 1 + * port 1 -> cage 1 + * port 2 -> cage 2 + * port 3 -> cage 2 + */ { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_40G) | @@ -1343,7 +1399,14 @@ static struct { 2, 1 }, - /* Supported modes with 4 outputs per external port */ + /* + * Modes that on Medford allocate 4 adjacent port numbers to each + * connector, starting on cage 1. + * port 0 -> cage 1 + * port 1 -> cage 1 + * port 2 -> cage 1 + * port 3 -> cage 1 + */ { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q) | @@ -1351,6 +1414,14 @@ static struct { 4, 1, }, + /* + * Modes that on Medford allocate 4 adjacent port numbers to each + * connector, starting on cage 2. + * port 0 -> cage 2 + * port 1 -> cage 2 + * port 2 -> cage 2 + * port 3 -> cage 2 + */ { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q2), @@ -1375,7 +1446,7 @@ ef10_external_port_mapping( if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, ¤t)) != 0) { /* - * No current port mode information + * No current port mode information (i.e. Huntington) * - infer mapping from available modes */ if ((rc = efx_mcdi_get_port_modes(enp, @@ -1392,18 +1463,23 @@ ef10_external_port_mapping( } /* - * Infer the internal port -> external port mapping from + * Infer the internal port -> external number mapping from * the possible port modes for this NIC. */ for (i = 0; i < EFX_ARRAY_SIZE(__ef10_external_port_mappings); ++i) { - if (__ef10_external_port_mappings[i].family != - enp->en_family) + struct ef10_external_port_map_s *eepmp = + &__ef10_external_port_mappings[i]; + if (eepmp->family != enp->en_family) continue; - matches = (__ef10_external_port_mappings[i].modes_mask & - port_modes); + matches = (eepmp->modes_mask & port_modes); if (matches != 0) { - count = __ef10_external_port_mappings[i].count; - offset = __ef10_external_port_mappings[i].offset; + /* + * Some modes match. For some Huntington boards + * there will be multiple matches. The mapping on the + * last match is used. + */ + count = eepmp->count; + offset = eepmp->offset; port_modes &= ~matches; } } From owner-svn-src-head@freebsd.org Tue Nov 27 12:23:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F99411494FB; Tue, 27 Nov 2018 12:23:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CFDE75F4D; Tue, 27 Nov 2018 12:23:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FA481B353; Tue, 27 Nov 2018 12:23:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCN2IR002772; Tue, 27 Nov 2018 12:23:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCN2vS002767; Tue, 27 Nov 2018 12:23:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271223.wARCN2vS002767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341038 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CFDE75F4D X-Spamd-Result: default: False [1.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.37)[0.371,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:23:14 -0000 Author: arybchik Date: Tue Nov 27 12:23:01 2018 New Revision: 341038 URL: https://svnweb.freebsd.org/changeset/base/341038 Log: sfxge(4): add method to make checksum option descriptors Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18160 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:22:50 2018 (r341037) +++ head/sys/dev/sfxge/common/ef10_impl.h Tue Nov 27 12:23:01 2018 (r341038) @@ -793,6 +793,11 @@ ef10_tx_qdesc_vlantci_create( __in uint16_t vlan_tci, __out efx_desc_t *edp); +extern void +ef10_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp); #if EFSYS_OPT_QSTATS Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 12:22:50 2018 (r341037) +++ head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 12:23:01 2018 (r341038) @@ -203,7 +203,7 @@ ef10_tx_qcreate( { efx_nic_cfg_t *encp = &enp->en_nic_cfg; uint16_t inner_csum; - efx_qword_t desc; + efx_desc_t desc; efx_rc_t rc; _NOTE(ARGUNUSED(id)) @@ -228,19 +228,9 @@ ef10_tx_qcreate( * a no-op TX option descriptor. See bug29981 for details. */ *addedp = 1; - EFX_POPULATE_QWORD_6(desc, - ESF_DZ_TX_DESC_IS_OPT, 1, - ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, - ESF_DZ_TX_OPTION_UDP_TCP_CSUM, - (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, - ESF_DZ_TX_OPTION_IP_CSUM, - (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0, - ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM, - (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, - ESF_DZ_TX_OPTION_INNER_IP_CSUM, - (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0); + ef10_tx_qdesc_checksum_create(etp, flags, &desc); - EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc); + EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc.ed_eq); ef10_tx_qpush(etp, *addedp, 0); return (0); @@ -700,6 +690,30 @@ ef10_tx_qdesc_vlantci_create( ESE_DZ_TX_OPTION_DESC_VLAN, ESF_DZ_TX_VLAN_OP, tci ? 1 : 0, ESF_DZ_TX_VLAN_TAG1, tci); +} + + void +ef10_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp) +{ + _NOTE(ARGUNUSED(etp)); + + EFSYS_PROBE2(tx_desc_checksum_create, unsigned int, etp->et_index, + uint32_t, flags); + + EFX_POPULATE_QWORD_6(edp->ed_eq, + ESF_DZ_TX_DESC_IS_OPT, 1, + ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, + ESF_DZ_TX_OPTION_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_IP_CSUM, + (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_IP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0); } Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:22:50 2018 (r341037) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:23:01 2018 (r341038) @@ -2280,6 +2280,12 @@ efx_tx_qdesc_vlantci_create( __in uint16_t tci, __out efx_desc_t *edp); +extern void +efx_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp); + #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:22:50 2018 (r341037) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Nov 27 12:23:01 2018 (r341038) @@ -149,6 +149,8 @@ typedef struct efx_tx_ops_s { efx_desc_t *, int); void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t, efx_desc_t *); + void (*etxo_qdesc_checksum_create)(efx_txq_t *, uint16_t, + efx_desc_t *); #if EFSYS_OPT_QSTATS void (*etxo_qstats_update)(efx_txq_t *, efsys_stat_t *); Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Tue Nov 27 12:22:50 2018 (r341037) +++ head/sys/dev/sfxge/common/efx_tx.c Tue Nov 27 12:23:01 2018 (r341038) @@ -146,6 +146,7 @@ static const efx_tx_ops_t __efx_tx_siena_ops = { NULL, /* etxo_qdesc_tso_create */ NULL, /* etxo_qdesc_tso2_create */ NULL, /* etxo_qdesc_vlantci_create */ + NULL, /* etxo_qdesc_checksum_create */ #if EFSYS_OPT_QSTATS siena_tx_qstats_update, /* etxo_qstats_update */ #endif @@ -172,6 +173,7 @@ static const efx_tx_ops_t __efx_tx_hunt_ops = { ef10_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ + ef10_tx_qdesc_checksum_create, /* etxo_qdesc_checksum_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ #endif @@ -198,6 +200,7 @@ static const efx_tx_ops_t __efx_tx_medford_ops = { NULL, /* etxo_qdesc_tso_create */ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ + ef10_tx_qdesc_checksum_create, /* etxo_qdesc_checksum_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ #endif @@ -224,6 +227,7 @@ static const efx_tx_ops_t __efx_tx_medford2_ops = { NULL, /* etxo_qdesc_tso_create */ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ + ef10_tx_qdesc_checksum_create, /* etxo_qdesc_checksum_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ #endif @@ -677,6 +681,21 @@ efx_tx_qdesc_vlantci_create( EFSYS_ASSERT(etxop->etxo_qdesc_vlantci_create != NULL); etxop->etxo_qdesc_vlantci_create(etp, tci, edp); +} + + void +efx_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp) +{ + efx_nic_t *enp = etp->et_enp; + const efx_tx_ops_t *etxop = enp->en_etxop; + + EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); + EFSYS_ASSERT(etxop->etxo_qdesc_checksum_create != NULL); + + etxop->etxo_qdesc_checksum_create(etp, flags, edp); } From owner-svn-src-head@freebsd.org Tue Nov 27 12:35:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF1ED114A06A; Tue, 27 Nov 2018 12:35:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53056772FC; Tue, 27 Nov 2018 12:35:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9D61B51D; Tue, 27 Nov 2018 12:35:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCZqnm008113; Tue, 27 Nov 2018 12:35:52 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCZqi5008112; Tue, 27 Nov 2018 12:35:52 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811271235.wARCZqi5008112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 27 Nov 2018 12:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341041 - head/sys/contrib/ck/include/gcc/sparcv9 X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/contrib/ck/include/gcc/sparcv9 X-SVN-Commit-Revision: 341041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53056772FC X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.49)[0.488,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_LONG(0.51)[0.511,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:35:53 -0000 Author: marius Date: Tue Nov 27 12:35:51 2018 New Revision: 341041 URL: https://svnweb.freebsd.org/changeset/base/341041 Log: Import CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its sparcv9 atomics compatible with the FreeBSD kernel by using instructions which access the appropriate address space. Atomic operations within the kernel must access the nucleus address space instead of the default primary one. Without this change but the increased use of CK in the kernel, machines started to panic after some minutes of uptime due to an unresolvable fault in ck_pr_cas_64_value(). Modified: head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Directory Properties: head/sys/contrib/ck/ (props changed) Modified: head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Tue Nov 27 12:32:32 2018 (r341040) +++ head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Tue Nov 27 12:35:51 2018 (r341041) @@ -136,11 +136,26 @@ CK_PR_STORE_S(int, int, "stsw") #undef CK_PR_STORE_S #undef CK_PR_STORE +/* Use the appropriate address space for atomics within the FreeBSD kernel. */ +#if defined(__FreeBSD__) && defined(_KERNEL) +#include +#include +#define CK_PR_INS_CAS "casa" +#define CK_PR_INS_CASX "casxa" +#define CK_PR_INS_SWAP "swapa" +#define CK_PR_ASI_ATOMIC __XSTRING(__ASI_ATOMIC) +#else +#define CK_PR_INS_CAS "cas" +#define CK_PR_INS_CASX "casx" +#define CK_PR_INS_SWAP "swap" +#define CK_PR_ASI_ATOMIC "" +#endif + CK_CC_INLINE static bool ck_pr_cas_64_value(uint64_t *target, uint64_t compare, uint64_t set, uint64_t *value) { - __asm__ __volatile__("casx [%1], %2, %0" + __asm__ __volatile__(CK_PR_INS_CASX " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" : "+&r" (set) : "r" (target), "r" (compare) @@ -154,7 +169,7 @@ CK_CC_INLINE static bool ck_pr_cas_64(uint64_t *target, uint64_t compare, uint64_t set) { - __asm__ __volatile__("casx [%1], %2, %0" + __asm__ __volatile__(CK_PR_INS_CASX " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" : "+&r" (set) : "r" (target), "r" (compare) @@ -181,7 +196,7 @@ ck_pr_cas_ptr_value(void *target, void *compare, void CK_CC_INLINE static bool \ ck_pr_cas_##N##_value(T *target, T compare, T set, T *value) \ { \ - __asm__ __volatile__("cas [%1], %2, %0" \ + __asm__ __volatile__(CK_PR_INS_CAS " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" \ : "+&r" (set) \ : "r" (target), \ "r" (compare) \ @@ -192,7 +207,7 @@ ck_pr_cas_ptr_value(void *target, void *compare, void CK_CC_INLINE static bool \ ck_pr_cas_##N(T *target, T compare, T set) \ { \ - __asm__ __volatile__("cas [%1], %2, %0" \ + __asm__ __volatile__(CK_PR_INS_CAS " [%1] " CK_PR_ASI_ATOMIC ", %2, %0" \ : "+&r" (set) \ : "r" (target), \ "r" (compare) \ @@ -211,7 +226,7 @@ CK_PR_CAS(int, int) ck_pr_fas_##N(T *target, T update) \ { \ \ - __asm__ __volatile__("swap [%1], %0" \ + __asm__ __volatile__(CK_PR_INS_SWAP " [%1] " CK_PR_ASI_ATOMIC ", %0" \ : "+&r" (update) \ : "r" (target) \ : "memory"); \ @@ -223,6 +238,11 @@ CK_PR_FAS(uint, unsigned int) CK_PR_FAS(32, uint32_t) #undef CK_PR_FAS + +#undef CK_PR_INS_CAS +#undef CK_PR_INS_CASX +#undef CK_PR_INS_SWAP +#undef CK_PR_ASI_ATOMIC #endif /* CK_PR_SPARCV9_H */ From owner-svn-src-head@freebsd.org Tue Nov 27 12:58:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADE02114AB1F; Tue, 27 Nov 2018 12:58:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D04C781D5; Tue, 27 Nov 2018 12:58:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 283D41B87E; Tue, 27 Nov 2018 12:58:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCwrwG019122; Tue, 27 Nov 2018 12:58:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCwqGF019120; Tue, 27 Nov 2018 12:58:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271258.wARCwqGF019120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341042 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D04C781D5 X-Spamd-Result: default: False [1.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_SHORT(0.52)[0.521,0]; NEURAL_SPAM_MEDIUM(0.73)[0.726,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:58:54 -0000 Author: arybchik Date: Tue Nov 27 12:58:52 2018 New Revision: 341042 URL: https://svnweb.freebsd.org/changeset/base/341042 Log: sfxge(4): update hardware headers for Medford2 The changes to efx_regs_ef10.h are auto-generated and include: - Updated event RX_L4_CLASS which is now 2 bits (was 3). The encoding of TCP, UDP and UNKNOWN are unchanged so the narrower Medford2 field definition is compatible with all controllers. - Fix definition of FATSOv2 option descriptors. These were added manually and differ from the auto-generated values in some fields (not yet used in common code). The field definitions have been corrected to agree with the Linux net driver headers and SF-108452-SW. The remaining changes adapt the common code to use the updated headers. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18161 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx_regs_ef10.h Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Tue Nov 27 12:35:51 2018 (r341041) +++ head/sys/dev/sfxge/common/ef10_ev.c Tue Nov 27 12:58:52 2018 (r341042) @@ -895,13 +895,24 @@ ef10_ev_rx( #endif size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES); + cont = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT); next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS); eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS); mac_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS); l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS); - l4_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L4_CLASS); - cont = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT); + /* + * RX_L4_CLASS is 3 bits wide on Huntington and Medford, but is only + * 2 bits wide on Medford2. Check it is safe to use the Medford2 field + * and values for all EF10 controllers. + */ + EFX_STATIC_ASSERT(ESF_FZ_RX_L4_CLASS_LBN == ESF_DE_RX_L4_CLASS_LBN); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_TCP == ESE_DE_L4_CLASS_TCP); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_UDP == ESE_DE_L4_CLASS_UDP); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_UNKNOWN == ESE_DE_L4_CLASS_UNKNOWN); + + l4_class = EFX_QWORD_FIELD(*eqp, ESF_FZ_RX_L4_CLASS); + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DROP_EVENT) != 0) { /* Drop this event */ return (B_FALSE); @@ -979,10 +990,22 @@ ef10_ev_rx( flags |= EFX_CKSUM_IPV4; } - if (l4_class == ESE_DZ_L4_CLASS_TCP) { + /* + * RX_L4_CLASS is 3 bits wide on Huntington and Medford, but is + * only 2 bits wide on Medford2. Check it is safe to use the + * Medford2 field and values for all EF10 controllers. + */ + EFX_STATIC_ASSERT(ESF_FZ_RX_L4_CLASS_LBN == + ESF_DE_RX_L4_CLASS_LBN); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_TCP == ESE_DE_L4_CLASS_TCP); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_UDP == ESE_DE_L4_CLASS_UDP); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_UNKNOWN == + ESE_DE_L4_CLASS_UNKNOWN); + + if (l4_class == ESE_FZ_L4_CLASS_TCP) { EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_IPV4); flags |= EFX_PKT_TCP; - } else if (l4_class == ESE_DZ_L4_CLASS_UDP) { + } else if (l4_class == ESE_FZ_L4_CLASS_UDP) { EFX_EV_QSTAT_INCR(eep, EV_RX_UDP_IPV4); flags |= EFX_PKT_UDP; } else { @@ -994,10 +1017,22 @@ ef10_ev_rx( case ESE_DZ_L3_CLASS_IP6_FRAG: flags |= EFX_PKT_IPV6; - if (l4_class == ESE_DZ_L4_CLASS_TCP) { + /* + * RX_L4_CLASS is 3 bits wide on Huntington and Medford, but is + * only 2 bits wide on Medford2. Check it is safe to use the + * Medford2 field and values for all EF10 controllers. + */ + EFX_STATIC_ASSERT(ESF_FZ_RX_L4_CLASS_LBN == + ESF_DE_RX_L4_CLASS_LBN); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_TCP == ESE_DE_L4_CLASS_TCP); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_UDP == ESE_DE_L4_CLASS_UDP); + EFX_STATIC_ASSERT(ESE_FZ_L4_CLASS_UNKNOWN == + ESE_DE_L4_CLASS_UNKNOWN); + + if (l4_class == ESE_FZ_L4_CLASS_TCP) { EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_IPV6); flags |= EFX_PKT_TCP; - } else if (l4_class == ESE_DZ_L4_CLASS_UDP) { + } else if (l4_class == ESE_FZ_L4_CLASS_UDP) { EFX_EV_QSTAT_INCR(eep, EV_RX_UDP_IPV6); flags |= EFX_PKT_UDP; } else { Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Tue Nov 27 12:35:51 2018 (r341041) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Tue Nov 27 12:58:52 2018 (r341042) @@ -52,7 +52,7 @@ extern "C" { */ #define ER_DZ_BIU_HW_REV_ID_REG_OFST 0x00000000 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_BIU_HW_REV_ID_REG_RESET 0xeb14face @@ -66,7 +66,7 @@ extern "C" { */ #define ER_DZ_BIU_MC_SFT_STATUS_REG_OFST 0x00000010 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_BIU_MC_SFT_STATUS_REG_STEP 4 #define ER_DZ_BIU_MC_SFT_STATUS_REG_ROWS 8 #define ER_DZ_BIU_MC_SFT_STATUS_REG_RESET 0x1111face @@ -82,7 +82,7 @@ extern "C" { */ #define ER_DZ_BIU_INT_ISR_REG_OFST 0x00000090 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_BIU_INT_ISR_REG_RESET 0x0 @@ -96,7 +96,7 @@ extern "C" { */ #define ER_DZ_MC_DB_LWRD_REG_OFST 0x00000200 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_MC_DB_LWRD_REG_RESET 0x0 @@ -110,7 +110,7 @@ extern "C" { */ #define ER_DZ_MC_DB_HWRD_REG_OFST 0x00000204 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_MC_DB_HWRD_REG_RESET 0x0 @@ -124,7 +124,7 @@ extern "C" { */ #define ER_DZ_EVQ_RPTR_REG_OFST 0x00000400 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_EVQ_RPTR_REG_STEP 8192 #define ER_DZ_EVQ_RPTR_REG_ROWS 2048 #define ER_DZ_EVQ_RPTR_REG_RESET 0x0 @@ -137,12 +137,84 @@ extern "C" { /* + * EVQ_RPTR_REG_64K(32bit): + * + */ + +#define ER_FZ_EVQ_RPTR_REG_64K_OFST 0x00000400 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_EVQ_RPTR_REG_64K_STEP 65536 +#define ER_FZ_EVQ_RPTR_REG_64K_ROWS 2048 +#define ER_FZ_EVQ_RPTR_REG_64K_RESET 0x0 + + +#define ERF_FZ_EVQ_RPTR_VLD_LBN 15 +#define ERF_FZ_EVQ_RPTR_VLD_WIDTH 1 +#define ERF_FZ_EVQ_RPTR_LBN 0 +#define ERF_FZ_EVQ_RPTR_WIDTH 15 + + +/* + * EVQ_RPTR_REG_16K(32bit): + * + */ + +#define ER_FZ_EVQ_RPTR_REG_16K_OFST 0x00000400 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_EVQ_RPTR_REG_16K_STEP 16384 +#define ER_FZ_EVQ_RPTR_REG_16K_ROWS 2048 +#define ER_FZ_EVQ_RPTR_REG_16K_RESET 0x0 + + +/* defined as ERF_FZ_EVQ_RPTR_VLD_LBN 15; */ +/* defined as ERF_FZ_EVQ_RPTR_VLD_WIDTH 1 */ +/* defined as ERF_FZ_EVQ_RPTR_LBN 0; */ +/* defined as ERF_FZ_EVQ_RPTR_WIDTH 15 */ + + +/* + * EVQ_TMR_REG_64K(32bit): + * + */ + +#define ER_FZ_EVQ_TMR_REG_64K_OFST 0x00000420 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_EVQ_TMR_REG_64K_STEP 65536 +#define ER_FZ_EVQ_TMR_REG_64K_ROWS 2048 +#define ER_FZ_EVQ_TMR_REG_64K_RESET 0x0 + + +#define ERF_FZ_TC_TIMER_MODE_LBN 14 +#define ERF_FZ_TC_TIMER_MODE_WIDTH 2 +#define ERF_FZ_TC_TIMER_VAL_LBN 0 +#define ERF_FZ_TC_TIMER_VAL_WIDTH 14 + + +/* + * EVQ_TMR_REG_16K(32bit): + * + */ + +#define ER_FZ_EVQ_TMR_REG_16K_OFST 0x00000420 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_EVQ_TMR_REG_16K_STEP 16384 +#define ER_FZ_EVQ_TMR_REG_16K_ROWS 2048 +#define ER_FZ_EVQ_TMR_REG_16K_RESET 0x0 + + +/* defined as ERF_FZ_TC_TIMER_MODE_LBN 14; */ +/* defined as ERF_FZ_TC_TIMER_MODE_WIDTH 2 */ +/* defined as ERF_FZ_TC_TIMER_VAL_LBN 0; */ +/* defined as ERF_FZ_TC_TIMER_VAL_WIDTH 14 */ + + +/* * EVQ_TMR_REG(32bit): * */ #define ER_DZ_EVQ_TMR_REG_OFST 0x00000420 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_EVQ_TMR_REG_STEP 8192 #define ER_DZ_EVQ_TMR_REG_ROWS 2048 #define ER_DZ_EVQ_TMR_REG_RESET 0x0 @@ -155,12 +227,28 @@ extern "C" { /* + * RX_DESC_UPD_REG_16K(32bit): + * + */ + +#define ER_FZ_RX_DESC_UPD_REG_16K_OFST 0x00000830 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_RX_DESC_UPD_REG_16K_STEP 16384 +#define ER_FZ_RX_DESC_UPD_REG_16K_ROWS 2048 +#define ER_FZ_RX_DESC_UPD_REG_16K_RESET 0x0 + + +#define ERF_FZ_RX_DESC_WPTR_LBN 0 +#define ERF_FZ_RX_DESC_WPTR_WIDTH 12 + + +/* * RX_DESC_UPD_REG(32bit): * */ #define ER_DZ_RX_DESC_UPD_REG_OFST 0x00000830 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_RX_DESC_UPD_REG_STEP 8192 #define ER_DZ_RX_DESC_UPD_REG_ROWS 2048 #define ER_DZ_RX_DESC_UPD_REG_RESET 0x0 @@ -169,13 +257,74 @@ extern "C" { #define ERF_DZ_RX_DESC_WPTR_LBN 0 #define ERF_DZ_RX_DESC_WPTR_WIDTH 12 + /* + * RX_DESC_UPD_REG_64K(32bit): + * + */ + +#define ER_FZ_RX_DESC_UPD_REG_64K_OFST 0x00000830 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_RX_DESC_UPD_REG_64K_STEP 65536 +#define ER_FZ_RX_DESC_UPD_REG_64K_ROWS 2048 +#define ER_FZ_RX_DESC_UPD_REG_64K_RESET 0x0 + + +/* defined as ERF_FZ_RX_DESC_WPTR_LBN 0; */ +/* defined as ERF_FZ_RX_DESC_WPTR_WIDTH 12 */ + + +/* + * TX_DESC_UPD_REG_64K(96bit): + * + */ + +#define ER_FZ_TX_DESC_UPD_REG_64K_OFST 0x00000a10 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_TX_DESC_UPD_REG_64K_STEP 65536 +#define ER_FZ_TX_DESC_UPD_REG_64K_ROWS 2048 +#define ER_FZ_TX_DESC_UPD_REG_64K_RESET 0x0 + + +#define ERF_FZ_RSVD_LBN 76 +#define ERF_FZ_RSVD_WIDTH 20 +#define ERF_FZ_TX_DESC_WPTR_LBN 64 +#define ERF_FZ_TX_DESC_WPTR_WIDTH 12 +#define ERF_FZ_TX_DESC_HWORD_LBN 32 +#define ERF_FZ_TX_DESC_HWORD_WIDTH 32 +#define ERF_FZ_TX_DESC_LWORD_LBN 0 +#define ERF_FZ_TX_DESC_LWORD_WIDTH 32 + + +/* + * TX_DESC_UPD_REG_16K(96bit): + * + */ + +#define ER_FZ_TX_DESC_UPD_REG_16K_OFST 0x00000a10 +/* medford2a0=pf_dbell_bar */ +#define ER_FZ_TX_DESC_UPD_REG_16K_STEP 16384 +#define ER_FZ_TX_DESC_UPD_REG_16K_ROWS 2048 +#define ER_FZ_TX_DESC_UPD_REG_16K_RESET 0x0 + + +/* defined as ERF_FZ_RSVD_LBN 76; */ +/* defined as ERF_FZ_RSVD_WIDTH 20 */ +/* defined as ERF_FZ_TX_DESC_WPTR_LBN 64; */ +/* defined as ERF_FZ_TX_DESC_WPTR_WIDTH 12 */ +/* defined as ERF_FZ_TX_DESC_HWORD_LBN 32; */ +/* defined as ERF_FZ_TX_DESC_HWORD_WIDTH 32 */ +/* defined as ERF_FZ_TX_DESC_LWORD_LBN 0; */ +/* defined as ERF_FZ_TX_DESC_LWORD_WIDTH 32 */ + + +/* * TX_DESC_UPD_REG(96bit): * */ #define ER_DZ_TX_DESC_UPD_REG_OFST 0x00000a10 -/* hunta0,medforda0=pcie_pf_bar2 */ +/* hunta0,medforda0,medford2a0=pf_dbell_bar */ #define ER_DZ_TX_DESC_UPD_REG_STEP 8192 #define ER_DZ_TX_DESC_UPD_REG_ROWS 2048 #define ER_DZ_TX_DESC_UPD_REG_RESET 0x0 @@ -261,16 +410,24 @@ extern "C" { #define ESF_DZ_RX_EV_SOFT2_WIDTH 2 #define ESF_DZ_RX_DSC_PTR_LBITS_LBN 48 #define ESF_DZ_RX_DSC_PTR_LBITS_WIDTH 4 -#define ESF_DZ_RX_L4_CLASS_LBN 45 -#define ESF_DZ_RX_L4_CLASS_WIDTH 3 -#define ESE_DZ_L4_CLASS_RSVD7 7 -#define ESE_DZ_L4_CLASS_RSVD6 6 -#define ESE_DZ_L4_CLASS_RSVD5 5 -#define ESE_DZ_L4_CLASS_RSVD4 4 -#define ESE_DZ_L4_CLASS_RSVD3 3 -#define ESE_DZ_L4_CLASS_UDP 2 -#define ESE_DZ_L4_CLASS_TCP 1 -#define ESE_DZ_L4_CLASS_UNKNOWN 0 +#define ESF_DE_RX_L4_CLASS_LBN 45 +#define ESF_DE_RX_L4_CLASS_WIDTH 3 +#define ESE_DE_L4_CLASS_RSVD7 7 +#define ESE_DE_L4_CLASS_RSVD6 6 +#define ESE_DE_L4_CLASS_RSVD5 5 +#define ESE_DE_L4_CLASS_RSVD4 4 +#define ESE_DE_L4_CLASS_RSVD3 3 +#define ESE_DE_L4_CLASS_UDP 2 +#define ESE_DE_L4_CLASS_TCP 1 +#define ESE_DE_L4_CLASS_UNKNOWN 0 +#define ESF_FZ_RX_FASTPD_INDCTR_LBN 47 +#define ESF_FZ_RX_FASTPD_INDCTR_WIDTH 1 +#define ESF_FZ_RX_L4_CLASS_LBN 45 +#define ESF_FZ_RX_L4_CLASS_WIDTH 2 +#define ESE_FZ_L4_CLASS_RSVD3 3 +#define ESE_FZ_L4_CLASS_UDP 2 +#define ESE_FZ_L4_CLASS_TCP 1 +#define ESE_FZ_L4_CLASS_UNKNOWN 0 #define ESF_DZ_RX_L3_CLASS_LBN 42 #define ESF_DZ_RX_L3_CLASS_WIDTH 3 #define ESE_DZ_L3_CLASS_RSVD7 7 @@ -447,6 +604,8 @@ extern "C" { #define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0 #define ESF_DZ_TX_TSO_OPTION_TYPE_LBN 56 #define ESF_DZ_TX_TSO_OPTION_TYPE_WIDTH 4 +#define ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B 3 +#define ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A 2 #define ESE_DZ_TX_TSO_OPTION_DESC_ENCAP 1 #define ESE_DZ_TX_TSO_OPTION_DESC_NORMAL 0 #define ESF_DZ_TX_TSO_TCP_FLAGS_LBN 48 @@ -457,7 +616,7 @@ extern "C" { #define ESF_DZ_TX_TSO_TCP_SEQNO_WIDTH 32 -/* TX_TSO_FATSO2A_DESC */ +/* ES_TX_TSO_V2_DESC_A */ #define ESF_DZ_TX_DESC_IS_OPT_LBN 63 #define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1 #define ESF_DZ_TX_OPTION_TYPE_LBN 60 @@ -477,7 +636,7 @@ extern "C" { #define ESF_DZ_TX_TSO_TCP_SEQNO_WIDTH 32 -/* TX_TSO_FATSO2B_DESC */ +/* ES_TX_TSO_V2_DESC_B */ #define ESF_DZ_TX_DESC_IS_OPT_LBN 63 #define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1 #define ESF_DZ_TX_OPTION_TYPE_LBN 60 @@ -491,12 +650,10 @@ extern "C" { #define ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A 2 #define ESE_DZ_TX_TSO_OPTION_DESC_ENCAP 1 #define ESE_DZ_TX_TSO_OPTION_DESC_NORMAL 0 -#define ESF_DZ_TX_TSO_OUTER_IP_ID_LBN 16 -#define ESF_DZ_TX_TSO_OUTER_IP_ID_WIDTH 16 #define ESF_DZ_TX_TSO_TCP_MSS_LBN 32 #define ESF_DZ_TX_TSO_TCP_MSS_WIDTH 16 -#define ESF_DZ_TX_TSO_INNER_PE_CSUM_LBN 0 -#define ESF_DZ_TX_TSO_INNER_PE_CSUM_WIDTH 16 +#define ESF_DZ_TX_TSO_OUTER_IPID_LBN 0 +#define ESF_DZ_TX_TSO_OUTER_IPID_WIDTH 16 /* ES_TX_VLAN_DESC */ From owner-svn-src-head@freebsd.org Tue Nov 27 12:59:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE970114AB47; Tue, 27 Nov 2018 12:59:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95D3F78301; Tue, 27 Nov 2018 12:59:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 787991B87F; Tue, 27 Nov 2018 12:59:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCxBIR019194; Tue, 27 Nov 2018 12:59:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCx9iV019185; Tue, 27 Nov 2018 12:59:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271259.wARCx9iV019185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341043 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 95D3F78301 X-Spamd-Result: default: False [1.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.521,0]; NEURAL_SPAM_MEDIUM(0.73)[0.726,0]; NEURAL_SPAM_LONG(0.55)[0.554,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:59:12 -0000 Author: arybchik Date: Tue Nov 27 12:59:09 2018 New Revision: 341043 URL: https://svnweb.freebsd.org/changeset/base/341043 Log: sfxge(4): refactoring eliminating code analysis warnings Addresses most of the warnings reported by the sfn windows driver. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18162 Modified: head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/ef10_vpd.c head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/siena_mcdi.c head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Tue Nov 27 12:59:09 2018 (r341043) @@ -215,13 +215,17 @@ ef10_mcdi_read_response( { const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efsys_mem_t *esmp = emtp->emt_dma_mem; - unsigned int pos; + unsigned int pos = 0; efx_dword_t data; + size_t remaining = length; - for (pos = 0; pos < length; pos += sizeof (efx_dword_t)) { + while (remaining > 0) { + size_t chunk = MIN(remaining, sizeof (data)); + EFSYS_MEM_READD(esmp, offset + pos, &data); - memcpy((uint8_t *)bufferp + pos, &data, - MIN(sizeof (data), length - pos)); + memcpy((uint8_t *)bufferp + pos, &data, chunk); + pos += chunk; + remaining -= chunk; } } Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/ef10_nvram.c Tue Nov 27 12:59:09 2018 (r341043) @@ -1376,12 +1376,16 @@ ef10_nvram_partn_read_tlv( */ retry = 10; do { - rc = ef10_nvram_read_tlv_segment(enp, partn, 0, - seg_data, partn_size); - } while ((rc == EAGAIN) && (--retry > 0)); + if ((rc = ef10_nvram_read_tlv_segment(enp, partn, 0, + seg_data, partn_size)) != 0) + --retry; + } while ((rc == EAGAIN) && (retry > 0)); if (rc != 0) { /* Failed to obtain consistent segment data */ + if (rc == EAGAIN) + rc = EIO; + goto fail4; } Modified: head/sys/dev/sfxge/common/ef10_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_vpd.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/ef10_vpd.c Tue Nov 27 12:59:09 2018 (r341043) @@ -163,19 +163,22 @@ ef10_vpd_read( rc = ENOSPC; goto fail2; } - memcpy(data, dvpd, dvpd_size); + if (dvpd != NULL) + memcpy(data, dvpd, dvpd_size); /* Pad data with all-1s, consistent with update operations */ memset(data + dvpd_size, 0xff, size - dvpd_size); - EFSYS_KMEM_FREE(enp->en_esip, dvpd_size, dvpd); + if (dvpd != NULL) + EFSYS_KMEM_FREE(enp->en_esip, dvpd_size, dvpd); return (0); fail2: EFSYS_PROBE(fail2); - EFSYS_KMEM_FREE(enp->en_esip, dvpd_size, dvpd); + if (dvpd != NULL) + EFSYS_KMEM_FREE(enp->en_esip, dvpd_size, dvpd); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/efx_filter.c Tue Nov 27 12:59:09 2018 (r341043) @@ -988,6 +988,7 @@ siena_filter_build( default: EFSYS_ASSERT(B_FALSE); + EFX_ZERO_OWORD(*filter); return (0); } Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 12:59:09 2018 (r341043) @@ -1461,6 +1461,10 @@ efx_mcdi_get_phy_cfg( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_PHY_CFG_IN_LEN, MC_CMD_GET_PHY_CFG_OUT_LEN)]; +#if EFSYS_OPT_NAMES + const char *namep; + size_t namelen; +#endif efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); @@ -1484,10 +1488,12 @@ efx_mcdi_get_phy_cfg( encp->enc_phy_type = MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_TYPE); #if EFSYS_OPT_NAMES - (void) strncpy(encp->enc_phy_name, - MCDI_OUT2(req, char, GET_PHY_CFG_OUT_NAME), - MIN(sizeof (encp->enc_phy_name) - 1, - MC_CMD_GET_PHY_CFG_OUT_NAME_LEN)); + namep = MCDI_OUT2(req, char, GET_PHY_CFG_OUT_NAME); + namelen = MIN(sizeof (encp->enc_phy_name) - 1, + strnlen(namep, MC_CMD_GET_PHY_CFG_OUT_NAME_LEN)); + (void) memset(encp->enc_phy_name, 0, + sizeof (encp->enc_phy_name)); + memcpy(encp->enc_phy_name, namep, namelen); #endif /* EFSYS_OPT_NAMES */ (void) memset(encp->enc_phy_revision, 0, sizeof (encp->enc_phy_revision)); Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/efx_phy.c Tue Nov 27 12:59:09 2018 (r341043) @@ -214,6 +214,7 @@ efx_phy_adv_cap_get( break; default: EFSYS_ASSERT(B_FALSE); + *maskp = 0; break; } } Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/siena_mcdi.c Tue Nov 27 12:59:09 2018 (r341043) @@ -150,17 +150,21 @@ siena_mcdi_read_response( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); unsigned int pdur; - unsigned int pos; + unsigned int pos = 0; efx_dword_t data; + size_t remaining = length; EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); pdur = SIENA_MCDI_PDU(emip); - for (pos = 0; pos < length; pos += sizeof (efx_dword_t)) { + while (remaining > 0) { + size_t chunk = MIN(remaining, sizeof (data)); + EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur + ((offset + pos) >> 2), &data, B_FALSE); - memcpy((uint8_t *)bufferp + pos, &data, - MIN(sizeof (data), length - pos)); + memcpy((uint8_t *)bufferp + pos, &data, chunk); + pos += chunk; + remaining -= chunk; } } Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/siena_nvram.c Tue Nov 27 12:59:09 2018 (r341043) @@ -333,15 +333,20 @@ siena_nvram_get_dynamic_cfg( if ((rc = siena_nvram_partn_size(enp, partn, &size)) != 0) goto fail1; + if (size < SIENA_NVRAM_CHUNK) { + rc = EINVAL; + goto fail2; + } + EFSYS_KMEM_ALLOC(enp->en_esip, size, dcfg); if (dcfg == NULL) { rc = ENOMEM; - goto fail2; + goto fail3; } if ((rc = siena_nvram_partn_read(enp, partn, 0, (caddr_t)dcfg, SIENA_NVRAM_CHUNK)) != 0) - goto fail3; + goto fail4; /* Verify the magic */ if (EFX_DWORD_FIELD(dcfg->magic, EFX_DWORD_0) @@ -376,7 +381,7 @@ siena_nvram_get_dynamic_cfg( if ((rc = siena_nvram_partn_read(enp, partn, SIENA_NVRAM_CHUNK, (caddr_t)dcfg + SIENA_NVRAM_CHUNK, region - SIENA_NVRAM_CHUNK)) != 0) - goto fail4; + goto fail5; } /* Verify checksum */ @@ -418,13 +423,15 @@ done: return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); EFSYS_KMEM_FREE(enp->en_esip, size, dcfg); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Tue Nov 27 12:58:52 2018 (r341042) +++ head/sys/dev/sfxge/common/siena_vpd.c Tue Nov 27 12:59:09 2018 (r341043) @@ -65,21 +65,26 @@ siena_vpd_get_static( if ((rc = siena_nvram_partn_size(enp, partn, &size)) != 0) goto fail1; + if (size < SIENA_NVRAM_CHUNK) { + rc = EINVAL; + goto fail2; + } + EFSYS_KMEM_ALLOC(enp->en_esip, size, scfg); if (scfg == NULL) { rc = ENOMEM; - goto fail2; + goto fail3; } if ((rc = siena_nvram_partn_read(enp, partn, 0, (caddr_t)scfg, SIENA_NVRAM_CHUNK)) != 0) - goto fail3; + goto fail4; /* Verify the magic number */ if (EFX_DWORD_FIELD(scfg->magic, EFX_DWORD_0) != SIENA_MC_STATIC_CONFIG_MAGIC) { rc = EINVAL; - goto fail4; + goto fail5; } /* All future versions of the structure must be backwards compatible */ @@ -93,7 +98,7 @@ siena_vpd_get_static( if (hdr_length > size || vpd_offset > size || vpd_length > size || vpd_length + vpd_offset > size) { rc = EINVAL; - goto fail5; + goto fail6; } /* Read the remainder of scfg + static vpd */ @@ -102,7 +107,7 @@ siena_vpd_get_static( if ((rc = siena_nvram_partn_read(enp, partn, SIENA_NVRAM_CHUNK, (caddr_t)scfg + SIENA_NVRAM_CHUNK, region - SIENA_NVRAM_CHUNK)) != 0) - goto fail6; + goto fail7; } /* Verify checksum */ @@ -111,7 +116,7 @@ siena_vpd_get_static( cksum += ((uint8_t *)scfg)[pos]; if (cksum != 0) { rc = EINVAL; - goto fail7; + goto fail8; } if (vpd_length == 0) @@ -121,7 +126,7 @@ siena_vpd_get_static( EFSYS_KMEM_ALLOC(enp->en_esip, vpd_length, svpd); if (svpd == NULL) { rc = ENOMEM; - goto fail8; + goto fail9; } memcpy(svpd, (caddr_t)scfg + vpd_offset, vpd_length); } @@ -133,6 +138,8 @@ siena_vpd_get_static( return (0); +fail9: + EFSYS_PROBE(fail9); fail8: EFSYS_PROBE(fail8); fail7: @@ -143,11 +150,11 @@ fail5: EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); EFSYS_KMEM_FREE(enp->en_esip, size, scfg); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-head@freebsd.org Tue Nov 27 12:59:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AD58114AB85; Tue, 27 Nov 2018 12:59:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E164783F0; Tue, 27 Nov 2018 12:59:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55F431B880; Tue, 27 Nov 2018 12:59:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCxMRk019251; Tue, 27 Nov 2018 12:59:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCxMBD019250; Tue, 27 Nov 2018 12:59:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271259.wARCxMBD019250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341044 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E164783F0 X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.45)[0.453,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:59:24 -0000 Author: arybchik Date: Tue Nov 27 12:59:21 2018 New Revision: 341044 URL: https://svnweb.freebsd.org/changeset/base/341044 Log: sfxge(4): fix ICC warning because of non-enum value usage Fix ICC warning because of non-enum value asignment to enum variable. Found by upstreaming to DPDK. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18163 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 12:59:09 2018 (r341043) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 12:59:21 2018 (r341044) @@ -1465,6 +1465,7 @@ efx_mcdi_get_phy_cfg( const char *namep; size_t namelen; #endif + uint32_t phy_media_type; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); @@ -1515,8 +1516,8 @@ efx_mcdi_get_phy_cfg( EFX_STATIC_ASSERT(MC_CMD_MEDIA_SFP_PLUS == EFX_PHY_MEDIA_SFP_PLUS); EFX_STATIC_ASSERT(MC_CMD_MEDIA_BASE_T == EFX_PHY_MEDIA_BASE_T); EFX_STATIC_ASSERT(MC_CMD_MEDIA_QSFP_PLUS == EFX_PHY_MEDIA_QSFP_PLUS); - epp->ep_fixed_port_type = - MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_MEDIA_TYPE); + phy_media_type = MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_MEDIA_TYPE); + epp->ep_fixed_port_type = (efx_phy_media_type_t) phy_media_type; if (epp->ep_fixed_port_type >= EFX_PHY_MEDIA_NTYPES) epp->ep_fixed_port_type = EFX_PHY_MEDIA_INVALID; From owner-svn-src-head@freebsd.org Tue Nov 27 12:59:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ACB9114ABAE; Tue, 27 Nov 2018 12:59:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF49C784E5; Tue, 27 Nov 2018 12:59:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6064A1B881; Tue, 27 Nov 2018 12:59:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCxXmo019309; Tue, 27 Nov 2018 12:59:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCxXlJ019307; Tue, 27 Nov 2018 12:59:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271259.wARCxXlJ019307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341045 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF49C784E5 X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.45)[0.453,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:59:36 -0000 Author: arybchik Date: Tue Nov 27 12:59:32 2018 New Revision: 341045 URL: https://svnweb.freebsd.org/changeset/base/341045 Log: sfxge(4): update notes on interrupt testing on VFs Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18164 Modified: head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:59:21 2018 (r341044) +++ head/sys/dev/sfxge/common/medford2_nic.c Tue Nov 27 12:59:32 2018 (r341045) @@ -202,8 +202,8 @@ medford2_board_cfg( if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* - * Interrupt testing does not work for VFs. See bug50084. - * FIXME: Does this still apply to Medford2? + * Interrupt testing does not work for VFs on Medford2. + * See bug50084 and bug71432 comment 21. */ encp->enc_bug41750_workaround = B_TRUE; } Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:59:21 2018 (r341044) +++ head/sys/dev/sfxge/common/medford_nic.c Tue Nov 27 12:59:32 2018 (r341045) @@ -200,8 +200,8 @@ medford_board_cfg( if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* - * Interrupt testing does not work for VFs. See bug50084. - * FIXME: Does this still apply to Medford? + * Interrupt testing does not work for VFs. See bug50084 and + * bug71432 comment 21. */ encp->enc_bug41750_workaround = B_TRUE; } From owner-svn-src-head@freebsd.org Tue Nov 27 12:59:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3174114ABF2; Tue, 27 Nov 2018 12:59:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90C7B785FA; Tue, 27 Nov 2018 12:59:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECD701B882; Tue, 27 Nov 2018 12:59:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCxiQb019369; Tue, 27 Nov 2018 12:59:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCxipb019366; Tue, 27 Nov 2018 12:59:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271259.wARCxipb019366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341046 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 341046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 90C7B785FA X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.488,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:59:50 -0000 Author: arybchik Date: Tue Nov 27 12:59:43 2018 New Revision: 341046 URL: https://svnweb.freebsd.org/changeset/base/341046 Log: sfxge(4): report memory BAR number Remove EFX_MEM_BAR define as it it is not correct on all platforms. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18165 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/sfxge.c head/sys/dev/sfxge/sfxge.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:59:32 2018 (r341045) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 12:59:43 2018 (r341046) @@ -76,7 +76,8 @@ extern __checkReturn efx_rc_t efx_family( __in uint16_t venid, __in uint16_t devid, - __out efx_family_t *efp); + __out efx_family_t *efp, + __out unsigned int *membarp); #define EFX_PCI_VENID_SFC 0x1924 @@ -102,7 +103,17 @@ efx_family( #define EFX_PCI_DEVID_MEDFORD2 0x0B03 /* SFC9250 PF */ #define EFX_PCI_DEVID_MEDFORD2_VF 0x1B03 /* SFC9250 VF */ -#define EFX_MEM_BAR 2 + +#define EFX_MEM_BAR_SIENA 2 + +#define EFX_MEM_BAR_HUNTINGTON_PF 2 +#define EFX_MEM_BAR_HUNTINGTON_VF 0 + +#define EFX_MEM_BAR_MEDFORD_PF 2 +#define EFX_MEM_BAR_MEDFORD_VF 0 + +#define EFX_MEM_BAR_MEDFORD2 0 + /* Error codes */ Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 12:59:32 2018 (r341045) +++ head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 12:59:43 2018 (r341046) @@ -36,11 +36,13 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" + __checkReturn efx_rc_t efx_family( __in uint16_t venid, __in uint16_t devid, - __out efx_family_t *efp) + __out efx_family_t *efp, + __out unsigned int *membarp) { if (venid == EFX_PCI_VENID_SFC) { switch (devid) { @@ -50,12 +52,10 @@ efx_family( * Hardware default for PF0 of uninitialised Siena. * manftest must be able to cope with this device id. */ - *efp = EFX_FAMILY_SIENA; - return (0); - case EFX_PCI_DEVID_BETHPAGE: case EFX_PCI_DEVID_SIENA: *efp = EFX_FAMILY_SIENA; + *membarp = EFX_MEM_BAR_SIENA; return (0); #endif /* EFSYS_OPT_SIENA */ @@ -65,17 +65,16 @@ efx_family( * Hardware default for PF0 of uninitialised Huntington. * manftest must be able to cope with this device id. */ - *efp = EFX_FAMILY_HUNTINGTON; - return (0); - case EFX_PCI_DEVID_FARMINGDALE: case EFX_PCI_DEVID_GREENPORT: *efp = EFX_FAMILY_HUNTINGTON; + *membarp = EFX_MEM_BAR_HUNTINGTON_PF; return (0); case EFX_PCI_DEVID_FARMINGDALE_VF: case EFX_PCI_DEVID_GREENPORT_VF: *efp = EFX_FAMILY_HUNTINGTON; + *membarp = EFX_MEM_BAR_HUNTINGTON_VF; return (0); #endif /* EFSYS_OPT_HUNTINGTON */ @@ -85,15 +84,14 @@ efx_family( * Hardware default for PF0 of uninitialised Medford. * manftest must be able to cope with this device id. */ - *efp = EFX_FAMILY_MEDFORD; - return (0); - case EFX_PCI_DEVID_MEDFORD: *efp = EFX_FAMILY_MEDFORD; + *membarp = EFX_MEM_BAR_MEDFORD_PF; return (0); case EFX_PCI_DEVID_MEDFORD_VF: *efp = EFX_FAMILY_MEDFORD; + *membarp = EFX_MEM_BAR_MEDFORD_VF; return (0); #endif /* EFSYS_OPT_MEDFORD */ @@ -103,15 +101,10 @@ efx_family( * Hardware default for PF0 of uninitialised Medford2. * manftest must be able to cope with this device id. */ - *efp = EFX_FAMILY_MEDFORD2; - return (0); - case EFX_PCI_DEVID_MEDFORD2: - *efp = EFX_FAMILY_MEDFORD2; - return (0); - case EFX_PCI_DEVID_MEDFORD2_VF: *efp = EFX_FAMILY_MEDFORD2; + *membarp = EFX_MEM_BAR_MEDFORD2; return (0); #endif /* EFSYS_OPT_MEDFORD2 */ @@ -124,6 +117,7 @@ efx_family( *efp = EFX_FAMILY_INVALID; return (ENOTSUP); } + #if EFSYS_OPT_SIENA Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Tue Nov 27 12:59:32 2018 (r341045) +++ head/sys/dev/sfxge/sfxge.c Tue Nov 27 12:59:43 2018 (r341046) @@ -651,11 +651,11 @@ sfxge_bar_init(struct sfxge_softc *sc) { efsys_bar_t *esbp = &sc->bar; - esbp->esb_rid = PCIR_BAR(EFX_MEM_BAR); + esbp->esb_rid = PCIR_BAR(sc->mem_bar); if ((esbp->esb_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &esbp->esb_rid, RF_ACTIVE)) == NULL) { device_printf(sc->dev, "Cannot allocate BAR region %d\n", - EFX_MEM_BAR); + sc->mem_bar); return (ENXIO); } esbp->esb_tag = rman_get_bustag(esbp->esb_res); @@ -722,15 +722,15 @@ sfxge_create(struct sfxge_softc *sc) if ((error = sfxge_dma_init(sc)) != 0) goto fail; + error = efx_family(pci_get_vendor(dev), pci_get_device(dev), + &sc->family, &sc->mem_bar); + KASSERT(error == 0, ("Family should be filtered by sfxge_probe()")); + /* Map the device registers. */ DBGPRINT(sc->dev, "bar_init..."); if ((error = sfxge_bar_init(sc)) != 0) goto fail; - error = efx_family(pci_get_vendor(dev), pci_get_device(dev), - &sc->family); - KASSERT(error == 0, ("Family should be filtered by sfxge_probe()")); - DBGPRINT(sc->dev, "nic_create..."); /* Create the common code nic object. */ @@ -1154,13 +1154,14 @@ sfxge_probe(device_t dev) uint16_t pci_vendor_id; uint16_t pci_device_id; efx_family_t family; + unsigned int mem_bar; int rc; pci_vendor_id = pci_get_vendor(dev); pci_device_id = pci_get_device(dev); DBGPRINT(dev, "PCI ID %04x:%04x", pci_vendor_id, pci_device_id); - rc = efx_family(pci_vendor_id, pci_device_id, &family); + rc = efx_family(pci_vendor_id, pci_device_id, &family, &mem_bar); if (rc != 0) { DBGPRINT(dev, "efx_family fail %d", rc); return (ENXIO); Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Tue Nov 27 12:59:32 2018 (r341045) +++ head/sys/dev/sfxge/sfxge.h Tue Nov 27 12:59:43 2018 (r341046) @@ -280,6 +280,8 @@ struct sfxge_softc { struct task task_reset; efx_family_t family; + unsigned int mem_bar; + caddr_t vpd_data; size_t vpd_size; efx_nic_t *enp; From owner-svn-src-head@freebsd.org Tue Nov 27 13:00:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C337114AC37; Tue, 27 Nov 2018 13:00:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D07C1786DA; Tue, 27 Nov 2018 12:59:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20A851B883; Tue, 27 Nov 2018 12:59:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARCxtI1019427; Tue, 27 Nov 2018 12:59:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARCxtYn019425; Tue, 27 Nov 2018 12:59:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271259.wARCxtYn019425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 12:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341047 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D07C1786DA X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.488,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:00:01 -0000 Author: arybchik Date: Tue Nov 27 12:59:55 2018 New Revision: 341047 URL: https://svnweb.freebsd.org/changeset/base/341047 Log: sfxge(4): simplify loopback type checking Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18166 Modified: head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 12:59:43 2018 (r341046) +++ head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 12:59:55 2018 (r341047) @@ -239,26 +239,10 @@ ef10_phy_get_link( &elsp->els_link_mode, &elsp->els_fcntl); #if EFSYS_OPT_LOOPBACK - /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */ - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_NONE == EFX_LOOPBACK_OFF); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_DATA == EFX_LOOPBACK_DATA); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMAC == EFX_LOOPBACK_GMAC); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGMII == EFX_LOOPBACK_XGMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGXS == EFX_LOOPBACK_XGXS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI == EFX_LOOPBACK_XAUI); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII == EFX_LOOPBACK_GMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII == EFX_LOOPBACK_SGMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGBR == EFX_LOOPBACK_XGBR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI == EFX_LOOPBACK_XFI); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_FAR == EFX_LOOPBACK_XAUI_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII_FAR == EFX_LOOPBACK_GMII_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII_FAR == EFX_LOOPBACK_SGMII_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_FAR == EFX_LOOPBACK_XFI_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GPHY == EFX_LOOPBACK_GPHY); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PHYXS == EFX_LOOPBACK_PHY_XS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD); - + /* + * MC_CMD_LOOPBACK and EFX_LOOPBACK names are equivalent, so use the + * MCDI value directly. Agreement is checked in efx_loopback_mask(). + */ elsp->els_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE); #endif /* EFSYS_OPT_LOOPBACK */ Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 12:59:43 2018 (r341046) +++ head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 12:59:55 2018 (r341047) @@ -686,48 +686,46 @@ efx_loopback_mask( EFSYS_ASSERT3U(loopback_kind, <, EFX_LOOPBACK_NKINDS); EFSYS_ASSERT(maskp != NULL); - /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */ - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_NONE == EFX_LOOPBACK_OFF); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_DATA == EFX_LOOPBACK_DATA); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMAC == EFX_LOOPBACK_GMAC); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGMII == EFX_LOOPBACK_XGMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGXS == EFX_LOOPBACK_XGXS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI == EFX_LOOPBACK_XAUI); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII == EFX_LOOPBACK_GMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII == EFX_LOOPBACK_SGMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGBR == EFX_LOOPBACK_XGBR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI == EFX_LOOPBACK_XFI); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_FAR == EFX_LOOPBACK_XAUI_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII_FAR == EFX_LOOPBACK_GMII_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII_FAR == EFX_LOOPBACK_SGMII_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_FAR == EFX_LOOPBACK_XFI_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GPHY == EFX_LOOPBACK_GPHY); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PHYXS == EFX_LOOPBACK_PHY_XS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XPORT == EFX_LOOPBACK_XPORT); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGMII_WS == EFX_LOOPBACK_XGMII_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_WS == EFX_LOOPBACK_XAUI_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_WS_FAR == - EFX_LOOPBACK_XAUI_WS_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_WS_NEAR == - EFX_LOOPBACK_XAUI_WS_NEAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII_WS == EFX_LOOPBACK_GMII_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_WS == EFX_LOOPBACK_XFI_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_WS_FAR == - EFX_LOOPBACK_XFI_WS_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PHYXS_WS == EFX_LOOPBACK_PHYXS_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMA_INT == EFX_LOOPBACK_PMA_INT); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_NEAR == EFX_LOOPBACK_SD_NEAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FAR == EFX_LOOPBACK_SD_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMA_INT_WS == - EFX_LOOPBACK_PMA_INT_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FEP2_WS == - EFX_LOOPBACK_SD_FEP2_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FEP1_5_WS == - EFX_LOOPBACK_SD_FEP1_5_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FEP_WS == EFX_LOOPBACK_SD_FEP_WS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FES_WS == EFX_LOOPBACK_SD_FES_WS); + /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespaces agree */ +#define LOOPBACK_CHECK(_mcdi, _efx) \ + EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_##_mcdi == EFX_LOOPBACK_##_efx) + + LOOPBACK_CHECK(NONE, OFF); + LOOPBACK_CHECK(DATA, DATA); + LOOPBACK_CHECK(GMAC, GMAC); + LOOPBACK_CHECK(XGMII, XGMII); + LOOPBACK_CHECK(XGXS, XGXS); + LOOPBACK_CHECK(XAUI, XAUI); + LOOPBACK_CHECK(GMII, GMII); + LOOPBACK_CHECK(SGMII, SGMII); + LOOPBACK_CHECK(XGBR, XGBR); + LOOPBACK_CHECK(XFI, XFI); + LOOPBACK_CHECK(XAUI_FAR, XAUI_FAR); + LOOPBACK_CHECK(GMII_FAR, GMII_FAR); + LOOPBACK_CHECK(SGMII_FAR, SGMII_FAR); + LOOPBACK_CHECK(XFI_FAR, XFI_FAR); + LOOPBACK_CHECK(GPHY, GPHY); + LOOPBACK_CHECK(PHYXS, PHY_XS); + LOOPBACK_CHECK(PCS, PCS); + LOOPBACK_CHECK(PMAPMD, PMA_PMD); + LOOPBACK_CHECK(XPORT, XPORT); + LOOPBACK_CHECK(XGMII_WS, XGMII_WS); + LOOPBACK_CHECK(XAUI_WS, XAUI_WS); + LOOPBACK_CHECK(XAUI_WS_FAR, XAUI_WS_FAR); + LOOPBACK_CHECK(XAUI_WS_NEAR, XAUI_WS_NEAR); + LOOPBACK_CHECK(GMII_WS, GMII_WS); + LOOPBACK_CHECK(XFI_WS, XFI_WS); + LOOPBACK_CHECK(XFI_WS_FAR, XFI_WS_FAR); + LOOPBACK_CHECK(PHYXS_WS, PHYXS_WS); + LOOPBACK_CHECK(PMA_INT, PMA_INT); + LOOPBACK_CHECK(SD_NEAR, SD_NEAR); + LOOPBACK_CHECK(SD_FAR, SD_FAR); + LOOPBACK_CHECK(PMA_INT_WS, PMA_INT_WS); + LOOPBACK_CHECK(SD_FEP2_WS, SD_FEP2_WS); + LOOPBACK_CHECK(SD_FEP1_5_WS, SD_FEP1_5_WS); + LOOPBACK_CHECK(SD_FEP_WS, SD_FEP_WS); + LOOPBACK_CHECK(SD_FES_WS, SD_FES_WS); +#undef LOOPBACK_CHECK /* Build bitmask of possible loopback types */ EFX_ZERO_QWORD(mask); From owner-svn-src-head@freebsd.org Tue Nov 27 13:00:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 615BB114AC78; Tue, 27 Nov 2018 13:00:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB1F77876B; Tue, 27 Nov 2018 13:00:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBABF1B887; Tue, 27 Nov 2018 13:00:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARD06wr019542; Tue, 27 Nov 2018 13:00:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARD06X0019541; Tue, 27 Nov 2018 13:00:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271300.wARD06X0019541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 13:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341048 - head/sys/dev/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge X-SVN-Commit-Revision: 341048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB1F77876B X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.453,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_LONG(0.47)[0.465,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:00:07 -0000 Author: arybchik Date: Tue Nov 27 13:00:06 2018 New Revision: 341048 URL: https://svnweb.freebsd.org/changeset/base/341048 Log: sfxge(4): removing unneeded assert Remove ASSERT() from sfxge_link_mode_to_phy_cap() which causes an unnecessary panic, even though the callers have proper error handling. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18167 Modified: head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Tue Nov 27 12:59:55 2018 (r341047) +++ head/sys/dev/sfxge/sfxge_port.c Tue Nov 27 13:00:06 2018 (r341048) @@ -896,7 +896,6 @@ sfxge_link_mode_to_phy_cap(efx_link_mode_t mode) case EFX_LINK_40000FDX: return (EFX_PHY_CAP_40000FDX); default: - EFSYS_ASSERT(B_FALSE); return (EFX_PHY_CAP_INVALID); } } From owner-svn-src-head@freebsd.org Tue Nov 27 13:00:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B4F114ACD2; Tue, 27 Nov 2018 13:00:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F18178874; Tue, 27 Nov 2018 13:00:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D48AB1B889; Tue, 27 Nov 2018 13:00:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARD0HcA019603; Tue, 27 Nov 2018 13:00:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARD0H1E019600; Tue, 27 Nov 2018 13:00:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271300.wARD0H1E019600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 13:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341049 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F18178874 X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.488,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:00:19 -0000 Author: arybchik Date: Tue Nov 27 13:00:17 2018 New Revision: 341049 URL: https://svnweb.freebsd.org/changeset/base/341049 Log: sfxge(4): support new link modes Add basic support for new link modes for Medford2. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18168 Modified: head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 13:00:06 2018 (r341048) +++ head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 13:00:17 2018 (r341049) @@ -43,6 +43,26 @@ mcdi_phy_decode_cap( { uint32_t mask; +#define CHECK_CAP(_cap) \ + EFX_STATIC_ASSERT(EFX_PHY_CAP_##_cap == MC_CMD_PHY_CAP_##_cap##_LBN) + + CHECK_CAP(10HDX); + CHECK_CAP(10FDX); + CHECK_CAP(100HDX); + CHECK_CAP(100FDX); + CHECK_CAP(1000HDX); + CHECK_CAP(1000FDX); + CHECK_CAP(10000FDX); + CHECK_CAP(25000FDX); + CHECK_CAP(40000FDX); + CHECK_CAP(50000FDX); + CHECK_CAP(100000FDX); + CHECK_CAP(PAUSE); + CHECK_CAP(ASYM); + CHECK_CAP(AN); + CHECK_CAP(DDM); +#undef CHECK_CAP + mask = 0; if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10HDX_LBN)) mask |= (1 << EFX_PHY_CAP_10HDX); @@ -58,8 +78,15 @@ mcdi_phy_decode_cap( mask |= (1 << EFX_PHY_CAP_1000FDX); if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10000FDX_LBN)) mask |= (1 << EFX_PHY_CAP_10000FDX); + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_25000FDX_LBN)) + mask |= (1 << EFX_PHY_CAP_25000FDX); if (mcdi_cap & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) mask |= (1 << EFX_PHY_CAP_40000FDX); + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_50000FDX_LBN)) + mask |= (1 << EFX_PHY_CAP_50000FDX); + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_100000FDX_LBN)) + mask |= (1 << EFX_PHY_CAP_100000FDX); + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_PAUSE_LBN)) mask |= (1 << EFX_PHY_CAP_PAUSE); if (mcdi_cap & (1 << MC_CMD_PHY_CAP_ASYM_LBN)) @@ -88,8 +115,14 @@ mcdi_phy_decode_link_mode( if (!up) *link_modep = EFX_LINK_DOWN; + else if (speed == 100000 && fd) + *link_modep = EFX_LINK_100000FDX; + else if (speed == 50000 && fd) + *link_modep = EFX_LINK_50000FDX; else if (speed == 40000 && fd) *link_modep = EFX_LINK_40000FDX; + else if (speed == 25000 && fd) + *link_modep = EFX_LINK_25000FDX; else if (speed == 10000 && fd) *link_modep = EFX_LINK_10000FDX; else if (speed == 1000) @@ -300,7 +333,13 @@ ef10_phy_reconfigure( PHY_CAP_AN, (cap_mask >> EFX_PHY_CAP_AN) & 0x1); /* Too many fields for for POPULATE macros, so insert this afterwards */ MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_25000FDX, (cap_mask >> EFX_PHY_CAP_25000FDX) & 0x1); + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, PHY_CAP_40000FDX, (cap_mask >> EFX_PHY_CAP_40000FDX) & 0x1); + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_50000FDX, (cap_mask >> EFX_PHY_CAP_50000FDX) & 0x1); + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_100000FDX, (cap_mask >> EFX_PHY_CAP_100000FDX) & 0x1); #if EFSYS_OPT_LOOPBACK MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_MODE, @@ -315,8 +354,17 @@ ef10_phy_reconfigure( case EFX_LINK_10000FDX: speed = 10000; break; + case EFX_LINK_25000FDX: + speed = 25000; + break; case EFX_LINK_40000FDX: speed = 40000; + break; + case EFX_LINK_50000FDX: + speed = 50000; + break; + case EFX_LINK_100000FDX: + speed = 100000; break; default: speed = 0; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 13:00:06 2018 (r341048) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 13:00:17 2018 (r341049) @@ -452,6 +452,9 @@ typedef enum efx_link_mode_e { EFX_LINK_1000FDX, EFX_LINK_10000FDX, EFX_LINK_40000FDX, + EFX_LINK_25000FDX, + EFX_LINK_50000FDX, + EFX_LINK_100000FDX, EFX_LINK_NMODES } efx_link_mode_t; @@ -889,6 +892,10 @@ typedef enum efx_phy_cap_type_e { EFX_PHY_CAP_ASYM, EFX_PHY_CAP_AN, EFX_PHY_CAP_40000FDX, + EFX_PHY_CAP_DDM, + EFX_PHY_CAP_100000FDX, + EFX_PHY_CAP_25000FDX, + EFX_PHY_CAP_50000FDX, EFX_PHY_CAP_NTYPES } efx_phy_cap_type_t; From owner-svn-src-head@freebsd.org Tue Nov 27 13:00:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 728A6114AD2E; Tue, 27 Nov 2018 13:00:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1472F78DD9; Tue, 27 Nov 2018 13:00:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DA3C1B88A; Tue, 27 Nov 2018 13:00:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARD0Taj019667; Tue, 27 Nov 2018 13:00:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARD0SOE019665; Tue, 27 Nov 2018 13:00:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271300.wARD0SOE019665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 13:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341050 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1472F78DD9 X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.488,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:00:33 -0000 Author: arybchik Date: Tue Nov 27 13:00:28 2018 New Revision: 341050 URL: https://svnweb.freebsd.org/changeset/base/341050 Log: sfxge(4): add new loopback modes Report supported loopback modes for new Medford2 link speeds. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18169 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_port.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 13:00:17 2018 (r341049) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 13:00:28 2018 (r341050) @@ -837,6 +837,9 @@ typedef enum efx_loopback_type_e { EFX_LOOPBACK_SD_FEP1_5_WS = 32, EFX_LOOPBACK_SD_FEP_WS = 33, EFX_LOOPBACK_SD_FES_WS = 34, + EFX_LOOPBACK_AOE_INT_NEAR = 35, + EFX_LOOPBACK_DATA_WS = 36, + EFX_LOOPBACK_FORCE_EXT_LINK = 37, EFX_LOOPBACK_NTYPES } efx_loopback_type_t; Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 13:00:17 2018 (r341049) +++ head/sys/dev/sfxge/common/efx_nic.c Tue Nov 27 13:00:28 2018 (r341050) @@ -725,6 +725,9 @@ efx_loopback_mask( LOOPBACK_CHECK(SD_FEP1_5_WS, SD_FEP1_5_WS); LOOPBACK_CHECK(SD_FEP_WS, SD_FEP_WS); LOOPBACK_CHECK(SD_FES_WS, SD_FES_WS); + LOOPBACK_CHECK(AOE_INT_NEAR, AOE_INT_NEAR); + LOOPBACK_CHECK(DATA_WS, DATA_WS); + LOOPBACK_CHECK(FORCE_EXT_LINK, FORCE_EXT_LINK); #undef LOOPBACK_CHECK /* Build bitmask of possible loopback types */ @@ -783,7 +786,7 @@ efx_mcdi_get_loopback_modes( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_LOOPBACK_MODES_IN_LEN, - MC_CMD_GET_LOOPBACK_MODES_OUT_LEN)]; + MC_CMD_GET_LOOPBACK_MODES_OUT_V2_LEN)]; efx_qword_t mask; efx_qword_t modes; efx_rc_t rc; @@ -793,7 +796,7 @@ efx_mcdi_get_loopback_modes( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LOOPBACK_MODES_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_LOOPBACK_MODES_OUT_LEN; + req.emr_out_length = MC_CMD_GET_LOOPBACK_MODES_OUT_V2_LEN; efx_mcdi_execute(enp, &req); @@ -834,18 +837,51 @@ efx_mcdi_get_loopback_modes( MC_CMD_GET_LOOPBACK_MODES_OUT_40G_OFST + MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LEN) { /* Response includes 40G loopback modes */ - modes = - *MCDI_OUT2(req, efx_qword_t, GET_LOOPBACK_MODES_OUT_40G); + modes = *MCDI_OUT2(req, efx_qword_t, + GET_LOOPBACK_MODES_OUT_40G); EFX_AND_QWORD(modes, mask); encp->enc_loopback_types[EFX_LINK_40000FDX] = modes; } + if (req.emr_out_length_used >= + MC_CMD_GET_LOOPBACK_MODES_OUT_V2_25G_OFST + + MC_CMD_GET_LOOPBACK_MODES_OUT_V2_25G_LEN) { + /* Response includes 25G loopback modes */ + modes = *MCDI_OUT2(req, efx_qword_t, + GET_LOOPBACK_MODES_OUT_V2_25G); + EFX_AND_QWORD(modes, mask); + encp->enc_loopback_types[EFX_LINK_25000FDX] = modes; + } + + if (req.emr_out_length_used >= + MC_CMD_GET_LOOPBACK_MODES_OUT_V2_50G_OFST + + MC_CMD_GET_LOOPBACK_MODES_OUT_V2_50G_LEN) { + /* Response includes 50G loopback modes */ + modes = *MCDI_OUT2(req, efx_qword_t, + GET_LOOPBACK_MODES_OUT_V2_50G); + EFX_AND_QWORD(modes, mask); + encp->enc_loopback_types[EFX_LINK_50000FDX] = modes; + } + + if (req.emr_out_length_used >= + MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100G_OFST + + MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100G_LEN) { + /* Response includes 100G loopback modes */ + modes = *MCDI_OUT2(req, efx_qword_t, + GET_LOOPBACK_MODES_OUT_V2_100G); + EFX_AND_QWORD(modes, mask); + encp->enc_loopback_types[EFX_LINK_100000FDX] = modes; + } + EFX_ZERO_QWORD(modes); EFX_SET_QWORD_BIT(modes, EFX_LOOPBACK_OFF); EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_100FDX]); EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_1000FDX]); EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_10000FDX]); EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_40000FDX]); + EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_25000FDX]); + EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_50000FDX]); + EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_100000FDX]); encp->enc_loopback_types[EFX_LINK_UNKNOWN] = modes; return (0); Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Tue Nov 27 13:00:17 2018 (r341049) +++ head/sys/dev/sfxge/common/efx_port.c Tue Nov 27 13:00:28 2018 (r341050) @@ -209,6 +209,9 @@ static const char * const __efx_loopback_type_name[] = "SD_FEP1_5_WS", "SD_FEP_WS", "SD_FES_WS", + "AOE_INT_NEAR", + "DATA_WS", + "FORCE_EXT_LINK", }; __checkReturn const char * From owner-svn-src-head@freebsd.org Tue Nov 27 13:00:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EED5C114AE80; Tue, 27 Nov 2018 13:00:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 836CE78EFD; Tue, 27 Nov 2018 13:00:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 740C11B89D; Tue, 27 Nov 2018 13:00:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARD0fcW020520; Tue, 27 Nov 2018 13:00:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARD0dv5020511; Tue, 27 Nov 2018 13:00:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271300.wARD0dv5020511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 13:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341051 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 341051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 836CE78EFD X-Spamd-Result: default: False [1.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.488,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:00:44 -0000 Author: arybchik Date: Tue Nov 27 13:00:39 2018 New Revision: 341051 URL: https://svnweb.freebsd.org/changeset/base/341051 Log: sfxge(4): add efsys macro to get memory region size EFSYS_MEM_SIZE() reports the DMA mapped size of an efsys_mem_t allocated region (the allocation size may be different due to memory allocator and DMA alignment restrictions). This ensures that common code internals have explicit knowledge of the usable size of DMA mapped memory regions. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18170 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/siena_phy.c head/sys/dev/sfxge/sfxge_dma.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Tue Nov 27 13:00:28 2018 (r341050) +++ head/sys/dev/sfxge/common/ef10_rx.c Tue Nov 27 13:00:39 2018 (r341051) @@ -64,6 +64,11 @@ efx_mcdi_init_rxq( EFSYS_ASSERT3U(ndescs, <=, EFX_RXQ_MAXNDESCS); + if ((esmp == NULL) || (EFSYS_MEM_SIZE(esmp) < EFX_RXQ_SIZE(ndescs))) { + rc = EINVAL; + goto fail1; + } + if (ps_bufsize > 0) dma_mode = MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM; else @@ -130,11 +135,13 @@ efx_mcdi_init_rxq( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail2; } return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 13:00:28 2018 (r341050) +++ head/sys/dev/sfxge/common/ef10_tx.c Tue Nov 27 13:00:39 2018 (r341051) @@ -69,10 +69,15 @@ efx_mcdi_init_txq( EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >= EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); + if ((esmp == NULL) || (EFSYS_MEM_SIZE(esmp) < EFX_TXQ_SIZE(ndescs))) { + rc = EINVAL; + goto fail1; + } + npages = EFX_TXQ_NBUFS(ndescs); if (MC_CMD_INIT_TXQ_IN_LEN(npages) > sizeof (payload)) { rc = EINVAL; - goto fail1; + goto fail2; } (void) memset(payload, 0, sizeof (payload)); @@ -121,11 +126,13 @@ efx_mcdi_init_txq( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Tue Nov 27 13:00:28 2018 (r341050) +++ head/sys/dev/sfxge/common/efsys.h Tue Nov 27 13:00:39 2018 (r341051) @@ -392,9 +392,19 @@ typedef struct efsys_mem_s { bus_dmamap_t esm_map; caddr_t esm_base; efsys_dma_addr_t esm_addr; + size_t esm_size; } efsys_mem_t; +#define EFSYS_MEM_SIZE(_esmp) \ + ((_esmp)->esm_size) +#define EFSYS_MEM_ADDR(_esmp) \ + ((_esmp)->esm_addr) + +#define EFSYS_MEM_IS_NULL(_esmp) \ + ((_esmp)->esm_base == NULL) + + #define EFSYS_MEM_ZERO(_esmp, _size) \ do { \ (void) memset((_esmp)->esm_base, 0, (_size)); \ @@ -616,12 +626,6 @@ typedef struct efsys_mem_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) #endif - -#define EFSYS_MEM_ADDR(_esmp) \ - ((_esmp)->esm_addr) - -#define EFSYS_MEM_IS_NULL(_esmp) \ - ((_esmp)->esm_base == NULL) /* BAR */ Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Tue Nov 27 13:00:28 2018 (r341050) +++ head/sys/dev/sfxge/common/efx_intr.c Tue Nov 27 13:00:39 2018 (r341051) @@ -318,7 +318,13 @@ siena_intr_init( { efx_intr_t *eip = &(enp->en_intr); efx_oword_t oword; + efx_rc_t rc; + if ((esmp == NULL) || (EFSYS_MEM_SIZE(esmp) < EFX_INTR_SIZE)) { + rc = EINVAL; + goto fail1; + } + /* * bug17213 workaround. * @@ -349,6 +355,11 @@ siena_intr_init( EFX_BAR_WRITEO(enp, FR_AZ_INT_ADR_REG_KER, &oword); return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } static void Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 13:00:28 2018 (r341050) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 13:00:39 2018 (r341051) @@ -1844,10 +1844,12 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0); if (esmp != NULL) { - int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); + uint32_t bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); EFX_STATIC_ASSERT(MC_CMD_MAC_NSTATS * sizeof (uint64_t) <= EFX_MAC_STATS_SIZE); + + EFSYS_ASSERT3U(bytes, <=, (uint32_t)EFSYS_MEM_SIZE(esmp)); MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_LO, EFSYS_MEM_ADDR(esmp) & 0xffffffff); Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Tue Nov 27 13:00:28 2018 (r341050) +++ head/sys/dev/sfxge/common/siena_phy.c Tue Nov 27 13:00:39 2018 (r341051) @@ -563,6 +563,11 @@ siena_phy_stats_update( MC_CMD_PHY_STATS_OUT_DMA_LEN)]; efx_rc_t rc; + if ((esmp == NULL) || (EFSYS_MEM_SIZE(esmp) < EFX_PHY_STATS_SIZE)) { + rc = EINVAL; + goto fail1; + } + (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_PHY_STATS; req.emr_in_buf = payload; @@ -579,7 +584,7 @@ siena_phy_stats_update( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail2; } EFSYS_ASSERT3U(req.emr_out_length, ==, MC_CMD_PHY_STATS_OUT_DMA_LEN); @@ -588,6 +593,8 @@ siena_phy_stats_update( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Tue Nov 27 13:00:28 2018 (r341050) +++ head/sys/dev/sfxge/sfxge_dma.c Tue Nov 27 13:00:39 2018 (r341051) @@ -136,6 +136,7 @@ sfxge_dma_free(efsys_mem_t *esmp) esmp->esm_addr = 0; esmp->esm_base = NULL; + esmp->esm_size = 0; } int @@ -175,6 +176,7 @@ sfxge_dma_alloc(struct sfxge_softc *sc, bus_size_t len goto fail_load_check; esmp->esm_base = vaddr; + esmp->esm_size = len; return (0); From owner-svn-src-head@freebsd.org Tue Nov 27 13:00:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B58DE114AEC9; Tue, 27 Nov 2018 13:00:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B58C7904E; Tue, 27 Nov 2018 13:00:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 541321B8B0; Tue, 27 Nov 2018 13:00:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARD0qGA020579; Tue, 27 Nov 2018 13:00:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARD0qV8020578; Tue, 27 Nov 2018 13:00:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271300.wARD0qV8020578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 13:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341052 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B58C7904E X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.45)[0.453,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:00:57 -0000 Author: arybchik Date: Tue Nov 27 13:00:51 2018 New Revision: 341052 URL: https://svnweb.freebsd.org/changeset/base/341052 Log: sfxge(4): handle new speeds in link events Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18170 Modified: head/sys/dev/sfxge/common/ef10_phy.c Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 13:00:39 2018 (r341051) +++ head/sys/dev/sfxge/common/ef10_phy.c Tue Nov 27 13:00:51 2018 (r341052) @@ -176,8 +176,17 @@ ef10_phy_link_ev( case MCDI_EVENT_LINKCHANGE_SPEED_10G: speed = 10000; break; + case MCDI_EVENT_LINKCHANGE_SPEED_25G: + speed = 25000; + break; case MCDI_EVENT_LINKCHANGE_SPEED_40G: speed = 40000; + break; + case MCDI_EVENT_LINKCHANGE_SPEED_50G: + speed = 50000; + break; + case MCDI_EVENT_LINKCHANGE_SPEED_100G: + speed = 100000; break; default: speed = 0; From owner-svn-src-head@freebsd.org Tue Nov 27 13:29:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2E3C114BEDB; Tue, 27 Nov 2018 13:29:47 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3485D7A8B2; Tue, 27 Nov 2018 13:29:47 +0000 (UTC) (envelope-from des@des.no) Received: from next.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id A7C49B524; Tue, 27 Nov 2018 13:29:46 +0000 (UTC) Received: by next.des.no (Postfix, from userid 1001) id 6F9851034D; Tue, 27 Nov 2018 14:29:47 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Renato Botelho Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341011 - head/lib/libfetch In-Reply-To: <9fbc002a-a4e2-e7e3-c0db-ecafde637ca4@FreeBSD.org> (Renato Botelho's message of "Tue, 27 Nov 2018 09:26:18 -0200") References: <201811271006.wARA6gCM030259@repo.freebsd.org> <9fbc002a-a4e2-e7e3-c0db-ecafde637ca4@FreeBSD.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (berkeley-unix) Date: Tue, 27 Nov 2018 14:29:47 +0100 Message-ID: <868t1er6lw.fsf@next.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 3485D7A8B2 X-Spamd-Result: default: False [-6.57 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[des.no]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; MX_GOOD(-0.01)[cached: smtp.des.no]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.37)[ip: (-8.86), ipnet: 194.63.250.0/24(-4.43), asn: 12996(-3.54), country: NO(-0.01)]; ASN(0.00)[asn:12996, ipnet:194.63.250.0/24, country:NO]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:29:47 -0000 Renato Botelho writes: > Are you talking about this one? > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220468 No, that is a completely different issue. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Tue Nov 27 13:33:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D83F114C30C for ; Tue, 27 Nov 2018 13:33:38 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD4887AD8A for ; Tue, 27 Nov 2018 13:33:37 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x735.google.com with SMTP id y78so3763713qka.12 for ; Tue, 27 Nov 2018 05:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=FtLBkQaBsxU43bKXC0Fen9A9efqsBBeS/Tu1Tjflc70=; b=ktzw7MxZwJRWHmldjAM66sGV1Y20AjItMjbMqBb7ooTNMJAXkb/6tLGIDhi4OMX58o HEEqpZG2l69ndFobKJD3T+3Utmrs1HeEFjd7RBXHYFsr+U2wZGZJzDsqaHt7N/3ftAiC lXknFxiuAqyGe/S3bKEtVnOL8M82F9aSsdBwPU4LsUTGP/VZFQG6vmHq59xxGZyo622V KKdt52J8bI3ZgmRcF8QuthCHoq0Rge72VHJ3A/3jcEcRm5PVS/uZfNsSw9dpDU4bEswL 6SpEOx4eRWG57fjza9JLgh6Rtakann1PcwwQ+nt28+cIz5WRYaseGFVsXVq9GnhERydc rdcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=FtLBkQaBsxU43bKXC0Fen9A9efqsBBeS/Tu1Tjflc70=; b=CtCnnxPHn1RRsLmzXHFFKvYVNxIsd1PrHuMocOhLWLDdGnx+wOqQmEcG5/VQdHFdbu gVGKiFkJmQ+o1bmVyGJR1+Ub67GOIWYYNBrTNqwRj0B4dFfEiNtKNBNkPHTKvsIIHnsZ 9pdQxaRVyarqY0sOmkuBKlzHkk69l4m2rgRfozTQ2kjLar63zwxYjdHyUVmJ8Z4s6KM/ yA2uPt0LUj3A8NwwYJYZPxCYdzA9sUpBSr6hovT/Q5fvt7qnSKl6RYfll9uD2SZXA62f RVJyUCu6hOAl6ChxEl8ZdtejjGDhie3XD3mqpCMbAPjGEcSVQni+6lR2R5DrhREgaLl/ eh6w== X-Gm-Message-State: AA+aEWYuTEX/kDJ8EozktvcIfS9XgtFdi26MYP0XqCQABnz85b5i94Tp DcyJ6PdTiHAX5fUM16dqtWPtngrE X-Google-Smtp-Source: AFSGD/V1K6+lFaNZ7g97ZuvPKi017bXp3Hi+eRXw3bI4lJKBcNup1vHvAE726Z4abipQkfVReqfqow== X-Received: by 2002:a37:8882:: with SMTP id k124mr15692324qkd.1.1543325616897; Tue, 27 Nov 2018 05:33:36 -0800 (PST) Received: from mbp.local (mail2.bluepex.com. [200.247.39.210]) by smtp.gmail.com with ESMTPSA id y2sm1960196qtb.88.2018.11.27.05.33.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 05:33:36 -0800 (PST) Sender: Renato Botelho Subject: Re: svn commit: r341011 - head/lib/libfetch To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Cc: svn-src-head@freebsd.org References: <201811271006.wARA6gCM030259@repo.freebsd.org> <9fbc002a-a4e2-e7e3-c0db-ecafde637ca4@FreeBSD.org> <868t1er6lw.fsf@next.des.no> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/UM7ATQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABwsB8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: Date: Tue, 27 Nov 2018 11:33:32 -0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <868t1er6lw.fsf@next.des.no> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD4887AD8A X-Spamd-Result: default: False [-3.74 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; IP_SCORE(-0.65)[ipnet: 2607:f8b0::/32(-1.79), asn: 15169(-1.39), country: US(-0.09)]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-0.88)[-0.876,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[5.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:33:38 -0000 On 27/11/18 11:29, Dag-Erling Smørgrav wrote: > Renato Botelho writes: >> Are you talking about this one? >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220468 > > No, that is a completely different issue. Do you have any thoughts about that proposed patch? We imported it on pfSense because our users were reporting that issue. Until now it's working as expected. -- Renato Botelho From owner-svn-src-head@freebsd.org Tue Nov 27 13:45:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCA1A114C8EF; Tue, 27 Nov 2018 13:45:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621427B435; Tue, 27 Nov 2018 13:45:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4CC5ED53D; Tue, 27 Nov 2018 13:45:14 +0000 (UTC) Date: Tue, 27 Nov 2018 13:45:14 +0000 From: Alexey Dokuchaev To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r249115 - in head: sbin/camcontrol sys/sys Message-ID: <20181127134514.GA1580@FreeBSD.org> References: <201304042319.r34NJqIP040377@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304042319.r34NJqIP040377@svn.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 621427B435 X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.76)[0.762,0]; NEURAL_SPAM_SHORT(0.10)[0.102,0]; NEURAL_SPAM_MEDIUM(0.81)[0.810,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:45:14 -0000 On Thu, Apr 04, 2013 at 11:19:52PM +0000, Steven Hartland wrote: > New Revision: 249115 > URL: http://svnweb.freebsd.org/changeset/base/249115 > > Log: > Adds security options to camcontrol this includes the ability to secure > erase disks such as SSD's > > Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16) > com[m]and > > Modified: head/sbin/camcontrol/camcontrol.c > > [...] > +static int > +ata_do_identify(struct cam_device *device, int retry_count, int timeout, > + union ccb *ccb, struct ata_params** ident_bufp) > +{ > [...] > + > + error = ata_do_28bit_cmd(device, > + ccb, > + /*retries*/retry_count, > + /*flags*/CAM_DIR_IN, > + /*protocol*/AP_PROTO_PIO_IN, > + /*tag_action*/MSG_SIMPLE_Q_TAG, > + /*command*/command, > + /*features*/0, > + /*lba*/0, > + /*sector_count*/(u_int8_t)sizeof(struct ata_params), This looks strange: sizeof(struct ata_params) is 512, but it is too wide for u_int8_t, so it would be truncated to zero. Should it be 1 (one) here instead for ATA_ATA_IDENTIFY command, since it normally returns some data which typically fits one sector (>=512 bytes)? > + /*data_ptr*/(u_int8_t *)ptr, > + /*dxfer_len*/sizeof(struct ata_params), > + /*timeout*/timeout ? timeout : 30 * 1000, > + /*quiet*/1); > > [...] > + error = ata_do_28bit_cmd(device, > + ccb, > + /*retries*/retry_count, > + /*flags*/CAM_DIR_IN, > + /*protocol*/AP_PROTO_PIO_IN, > + /*tag_action*/MSG_SIMPLE_Q_TAG, > + /*command*/retry_command, > + /*features*/0, > + /*lba*/0, > + /*sector_count*/(u_int8_t) > + sizeof(struct ata_params), Same here. > + /*data_ptr*/(u_int8_t *)ptr, > + /*dxfer_len*/sizeof(struct ata_params), > + /*timeout*/timeout ? timeout : 30 * 1000, > + /*quiet*/0); ./danfe From owner-svn-src-head@freebsd.org Tue Nov 27 13:52:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A81DA114CC95; Tue, 27 Nov 2018 13:52:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9BA7BB0D; Tue, 27 Nov 2018 13:52:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AFBF1C2B7; Tue, 27 Nov 2018 13:52:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARDqqsB049947; Tue, 27 Nov 2018 13:52:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARDqqIe049946; Tue, 27 Nov 2018 13:52:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811271352.wARDqqIe049946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 27 Nov 2018 13:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341055 - head/usr.bin/clang/llvm-objdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/llvm-objdump X-SVN-Commit-Revision: 341055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B9BA7BB0D X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.500,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_LONG(0.47)[0.465,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 13:52:52 -0000 Author: emaste Date: Tue Nov 27 13:52:51 2018 New Revision: 341055 URL: https://svnweb.freebsd.org/changeset/base/341055 Log: llvm-objdump.1: remove more unintentional options Some options come from static constructors in LLVM libraries and are automatically added to llvm's usage output. They're not really supposed to be llvm-objdump options. Reported by: Fangrui Song in LLVM review D54864 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Modified: head/usr.bin/clang/llvm-objdump/llvm-objdump.1 ============================================================================== --- head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Tue Nov 27 13:14:13 2018 (r341054) +++ head/usr.bin/clang/llvm-objdump/llvm-objdump.1 Tue Nov 27 13:52:51 2018 (r341055) @@ -1,7 +1,7 @@ .\" This file is distributed under the University of Illinois Open Source .\" License. .\" -.Dd November 26, 2018 +.Dd November 27, 2018 .Dt LLVM-OBJDUMP 1 .Os .Sh NAME @@ -118,8 +118,6 @@ Dump the raw binary contents of the clang AST section. Display mach-o rebasing info. .It Fl -reverse-iterate Reverse iterate. -.It Fl -rng-seed Ns = Ns Ar seed -Seed for the random number generator. .It Fl s Display the content of each section. .It Fl -section Ns = Ns Ar section @@ -133,18 +131,11 @@ Implies disassmble object. .It Fl -start-address Ns = Ns Ar address Disassemble beginning at .Ar address . -.It Fl -stats -Enable statistics output from program. -Available with Asserts builds. -.It Fl -stats-json -Display statistics as json data. .It Fl -stop-address Ns = Ns Ar address Stop disassembly at .Ar address . .It Fl t Display the symbol table. -.It Fl -time-passes -Time each pass, printing elapsed time for each on exit .It Fl -triple Ns = Ns Ar triple Target triple to disassemble for. See From owner-svn-src-head@freebsd.org Tue Nov 27 14:02:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C73ED114D20C for ; Tue, 27 Nov 2018 14:02:11 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6A63F7C277; Tue, 27 Nov 2018 14:02:11 +0000 (UTC) (envelope-from des@des.no) Received: from next.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 4F5DEB670; Tue, 27 Nov 2018 14:02:09 +0000 (UTC) Received: by next.des.no (Postfix, from userid 1001) id 125F51034F; Tue, 27 Nov 2018 15:02:10 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Renato Botelho Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r341011 - head/lib/libfetch In-Reply-To: (Renato Botelho's message of "Tue, 27 Nov 2018 11:33:32 -0200") References: <201811271006.wARA6gCM030259@repo.freebsd.org> <9fbc002a-a4e2-e7e3-c0db-ecafde637ca4@FreeBSD.org> <868t1er6lw.fsf@next.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (berkeley-unix) Date: Tue, 27 Nov 2018 15:02:10 +0100 Message-ID: <864lc2r53x.fsf@next.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 6A63F7C277 X-Spamd-Result: default: False [-6.57 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[des.no]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MX_GOOD(-0.01)[cached: smtp.des.no]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.37)[ip: (-8.86), ipnet: 194.63.250.0/24(-4.43), asn: 12996(-3.54), country: NO(-0.01)]; ASN(0.00)[asn:12996, ipnet:194.63.250.0/24, country:NO]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:02:11 -0000 Renato Botelho writes: > Do you have any thoughts about that proposed patch? It works, but it's sort of a hack and it makes fixing #203861 harder. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Tue Nov 27 14:14:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC426114DA25; Tue, 27 Nov 2018 14:14:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E32D7CB19; Tue, 27 Nov 2018 14:14:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CBCB1C606; Tue, 27 Nov 2018 14:14:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREEkW3060783; Tue, 27 Nov 2018 14:14:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREEk9j060782; Tue, 27 Nov 2018 14:14:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271414.wAREEk9j060782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341058 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E32D7CB19 X-Spamd-Result: default: False [1.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.73)[0.726,0]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:14:47 -0000 Author: arybchik Date: Tue Nov 27 14:14:45 2018 New Revision: 341058 URL: https://svnweb.freebsd.org/changeset/base/341058 Log: sfxge(4): refactor EF10 get datapath capabilities Inline efx_mcdi_get_capabilities() to prepare for reading newer capabilities response versions. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18172 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 14:03:40 2018 (r341057) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 14:14:45 2018 (r341058) @@ -1021,57 +1021,86 @@ ef10_get_datapath_caps( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t flags; - uint32_t flags2; - uint32_t tso2nc; + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, + MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; efx_rc_t rc; - if ((rc = efx_mcdi_get_capabilities(enp, &flags, NULL, NULL, - &flags2, &tso2nc)) != 0) - goto fail1; - if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) goto fail1; -#define CAP_FLAG(flags1, field) \ - ((flags1) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN))) -#define CAP_FLAG2(flags2, field) \ - ((flags2) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN))) + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_CAPABILITIES; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; + efx_mcdi_execute_quiet(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail2; + } + + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) { + rc = EMSGSIZE; + goto fail3; + } + +#define CAP_FLAGS1(_req, _flag) \ + (MCDI_OUT_DWORD((_req), GET_CAPABILITIES_OUT_FLAGS1) & \ + (1u << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## _flag ## _LBN))) + +#define CAP_FLAGS2(_req, _flag) \ + (((_req).emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) && \ + (MCDI_OUT_DWORD((_req), GET_CAPABILITIES_V2_OUT_FLAGS2) & \ + (1u << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## _flag ## _LBN)))) + /* * Huntington RXDP firmware inserts a 0 or 14 byte prefix. * We only support the 14 byte prefix here. */ - if (CAP_FLAG(flags, RX_PREFIX_LEN_14) == 0) { + if (CAP_FLAGS1(req, RX_PREFIX_LEN_14) == 0) { rc = ENOTSUP; - goto fail2; + goto fail4; } encp->enc_rx_prefix_size = 14; /* Check if the firmware supports TSO */ - encp->enc_fw_assisted_tso_enabled = - CAP_FLAG(flags, TX_TSO) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, TX_TSO)) + encp->enc_fw_assisted_tso_enabled = B_TRUE; + else + encp->enc_fw_assisted_tso_enabled = B_FALSE; /* Check if the firmware supports FATSOv2 */ - encp->enc_fw_assisted_tso_v2_enabled = - CAP_FLAG2(flags2, TX_TSO_V2) ? B_TRUE : B_FALSE; + if (CAP_FLAGS2(req, TX_TSO_V2)) { + encp->enc_fw_assisted_tso_v2_enabled = B_TRUE; + encp->enc_fw_assisted_tso_v2_n_contexts = MCDI_OUT_WORD(req, + GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS); + } else { + encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; + encp->enc_fw_assisted_tso_v2_n_contexts = 0; + } - /* Get the number of TSO contexts (FATSOv2) */ - encp->enc_fw_assisted_tso_v2_n_contexts = - CAP_FLAG2(flags2, TX_TSO_V2) ? tso2nc : 0; - /* Check if the firmware has vadapter/vport/vswitch support */ - encp->enc_datapath_cap_evb = - CAP_FLAG(flags, EVB) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, EVB)) + encp->enc_datapath_cap_evb = B_TRUE; + else + encp->enc_datapath_cap_evb = B_FALSE; /* Check if the firmware supports VLAN insertion */ - encp->enc_hw_tx_insert_vlan_enabled = - CAP_FLAG(flags, TX_VLAN_INSERTION) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, TX_VLAN_INSERTION)) + encp->enc_hw_tx_insert_vlan_enabled = B_TRUE; + else + encp->enc_hw_tx_insert_vlan_enabled = B_FALSE; /* Check if the firmware supports RX event batching */ - encp->enc_rx_batching_enabled = - CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, RX_BATCHING)) + encp->enc_rx_batching_enabled = B_TRUE; + else + encp->enc_rx_batching_enabled = B_FALSE; /* * Even if batching isn't reported as supported, we may still get @@ -1080,38 +1109,49 @@ ef10_get_datapath_caps( encp->enc_rx_batch_max = 16; /* Check if the firmware supports disabling scatter on RXQs */ - encp->enc_rx_disable_scatter_supported = - CAP_FLAG(flags, RX_DISABLE_SCATTER) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, RX_DISABLE_SCATTER)) + encp->enc_rx_disable_scatter_supported = B_TRUE; + else + encp->enc_rx_disable_scatter_supported = B_FALSE; /* Check if the firmware supports packed stream mode */ - encp->enc_rx_packed_stream_supported = - CAP_FLAG(flags, RX_PACKED_STREAM) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, RX_PACKED_STREAM)) + encp->enc_rx_packed_stream_supported = B_TRUE; + else + encp->enc_rx_packed_stream_supported = B_FALSE; /* * Check if the firmware supports configurable buffer sizes * for packed stream mode (otherwise buffer size is 1Mbyte) */ - encp->enc_rx_var_packed_stream_supported = - CAP_FLAG(flags, RX_PACKED_STREAM_VAR_BUFFERS) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, RX_PACKED_STREAM_VAR_BUFFERS)) + encp->enc_rx_var_packed_stream_supported = B_TRUE; + else + encp->enc_rx_var_packed_stream_supported = B_FALSE; /* Check if the firmware supports set mac with running filters */ - encp->enc_allow_set_mac_with_installed_filters = - CAP_FLAG(flags, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) ? - B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED)) + encp->enc_allow_set_mac_with_installed_filters = B_TRUE; + else + encp->enc_allow_set_mac_with_installed_filters = B_FALSE; /* * Check if firmware supports the extended MC_CMD_SET_MAC, which allows * specifying which parameters to configure. */ - encp->enc_enhanced_set_mac_supported = - CAP_FLAG(flags, SET_MAC_ENHANCED) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, SET_MAC_ENHANCED)) + encp->enc_enhanced_set_mac_supported = B_TRUE; + else + encp->enc_enhanced_set_mac_supported = B_FALSE; /* * Check if firmware supports version 2 of MC_CMD_INIT_EVQ, which allows * us to let the firmware choose the settings to use on an EVQ. */ - encp->enc_init_evq_v2_supported = - CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; + if (CAP_FLAGS2(req, INIT_EVQ_V2)) + encp->enc_init_evq_v2_supported = B_TRUE; + else + encp->enc_init_evq_v2_supported = B_FALSE; /* * Check if firmware-verified NVRAM updates must be used. @@ -1121,29 +1161,34 @@ ef10_get_datapath_caps( * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated * partition and report the result). */ - encp->enc_nvram_update_verify_result_supported = - CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? - B_TRUE : B_FALSE; + if (CAP_FLAGS2(req, NVRAM_UPDATE_REPORT_VERIFY_RESULT)) + encp->enc_nvram_update_verify_result_supported = B_TRUE; + else + encp->enc_nvram_update_verify_result_supported = B_FALSE; /* * Check if firmware provides packet memory and Rx datapath * counters. */ - encp->enc_pm_and_rxdp_counters = - CAP_FLAG(flags, PM_AND_RXDP_COUNTERS) ? B_TRUE : B_FALSE; + if (CAP_FLAGS1(req, PM_AND_RXDP_COUNTERS)) + encp->enc_pm_and_rxdp_counters = B_TRUE; + else + encp->enc_pm_and_rxdp_counters = B_FALSE; /* * Check if the 40G MAC hardware is capable of reporting * statistics for Tx size bins. */ - encp->enc_mac_stats_40g_tx_size_bins = - CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; + if (CAP_FLAGS2(req, MAC_STATS_40G_TX_SIZE_BINS)) + encp->enc_mac_stats_40g_tx_size_bins = B_TRUE; + else + encp->enc_mac_stats_40g_tx_size_bins = B_FALSE; /* * Check if firmware supports VXLAN and NVGRE tunnels. * The capability indicates Geneve protocol support as well. */ - if (CAP_FLAG(flags, VXLAN_NVGRE)) { + if (CAP_FLAGS1(req, VXLAN_NVGRE)) { encp->enc_tunnel_encapsulations_supported = (1u << EFX_TUNNEL_PROTOCOL_VXLAN) | (1u << EFX_TUNNEL_PROTOCOL_GENEVE) | @@ -1157,11 +1202,15 @@ ef10_get_datapath_caps( encp->enc_tunnel_config_udp_entries_max = 0; } -#undef CAP_FLAG -#undef CAP_FLAG2 +#undef CAP_FLAGS1 +#undef CAP_FLAGS2 return (0); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-head@freebsd.org Tue Nov 27 14:15:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80858114DA46; Tue, 27 Nov 2018 14:15:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A12B7CC1A; Tue, 27 Nov 2018 14:14:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39E5F1C607; Tue, 27 Nov 2018 14:14:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREEwDT060843; Tue, 27 Nov 2018 14:14:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREEvll060840; Tue, 27 Nov 2018 14:14:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271414.wAREEvll060840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341059 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A12B7CC1A X-Spamd-Result: default: False [1.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.57)[0.566,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:15:00 -0000 Author: arybchik Date: Tue Nov 27 14:14:57 2018 New Revision: 341059 URL: https://svnweb.freebsd.org/changeset/base/341059 Log: sfxge(4): retrieve number of MAC stats from NIC This reports the number of stats (and hence the DMA buffer size) for MAC stats. If MC_GET_CAPABABILITIES_V4 is not supported then use the legacy Siena-compatible MC_CMD_MAC_NSTATS value. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18173 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 14:14:45 2018 (r341058) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 14:14:57 2018 (r341059) @@ -1023,7 +1023,7 @@ ef10_get_datapath_caps( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; + MC_CMD_GET_CAPABILITIES_V4_OUT_LEN)]; efx_rc_t rc; if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) @@ -1035,7 +1035,7 @@ ef10_get_datapath_caps( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; + req.emr_out_length = MC_CMD_GET_CAPABILITIES_V4_OUT_LEN; efx_mcdi_execute_quiet(enp, &req); @@ -1200,6 +1200,16 @@ ef10_get_datapath_caps( EFX_TUNNEL_MAXNENTRIES; } else { encp->enc_tunnel_config_udp_entries_max = 0; + } + + /* Check if firmware supports extended MAC stats. */ + if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V4_OUT_LEN) { + /* Extended stats buffer supported */ + encp->enc_mac_stats_nstats = MCDI_OUT_WORD(req, + GET_CAPABILITIES_V4_OUT_MAC_STATS_NUM_STATS); + } else { + /* Use Siena-compatible legacy MAC stats */ + encp->enc_mac_stats_nstats = MC_CMD_MAC_NSTATS; } #undef CAP_FLAGS1 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:14:45 2018 (r341058) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:14:57 2018 (r341059) @@ -1260,6 +1260,8 @@ typedef struct efx_nic_cfg_s { uint32_t enc_max_pcie_link_gen; /* Firmware verifies integrity of NVRAM updates */ uint32_t enc_nvram_update_verify_result_supported; + /* Firmware support for extended MAC_STATS buffer */ + uint32_t enc_mac_stats_nstats; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Tue Nov 27 14:14:45 2018 (r341058) +++ head/sys/dev/sfxge/common/siena_nic.c Tue Nov 27 14:14:57 2018 (r341059) @@ -185,6 +185,8 @@ siena_board_cfg( encp->enc_nvram_update_verify_result_supported = B_FALSE; + encp->enc_mac_stats_nstats = MC_CMD_MAC_NSTATS; + return (0); fail2: From owner-svn-src-head@freebsd.org Tue Nov 27 14:15:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AE11114DA6B; Tue, 27 Nov 2018 14:15:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E59E67CD1C; Tue, 27 Nov 2018 14:15:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BFBB1C608; Tue, 27 Nov 2018 14:15:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREF8A7060912; Tue, 27 Nov 2018 14:15:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREF8r3060911; Tue, 27 Nov 2018 14:15:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271415.wAREF8r3060911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341060 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E59E67CD1C X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.56)[0.556,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:15:12 -0000 Author: arybchik Date: Tue Nov 27 14:15:08 2018 New Revision: 341060 URL: https://svnweb.freebsd.org/changeset/base/341060 Log: sfxge(4): improve robustness of MAC stats get via MCDI Previously the code relied on the callers of efx_mcdi_mac_stats to provide a DMA buffer or NULL depending on the action. Fix this so that the DMA buffer is only passed in the request when needed, and that an error is reported for a missing DMA buffer. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18174 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 14:14:57 2018 (r341059) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 14:15:08 2018 (r341060) @@ -1843,9 +1843,15 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIODIC_NOEVENT, !events, MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0); - if (esmp != NULL) { + if (enable || events || upload) { uint32_t bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); + /* Periodic stats or stats upload require a DMA buffer */ + if (esmp == NULL) { + rc = EINVAL; + goto fail1; + } + EFX_STATIC_ASSERT(MC_CMD_MAC_NSTATS * sizeof (uint64_t) <= EFX_MAC_STATS_SIZE); @@ -1856,8 +1862,6 @@ efx_mcdi_mac_stats( MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_HI, EFSYS_MEM_ADDR(esmp) >> 32); MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_LEN, bytes); - } else { - EFSYS_ASSERT(!upload && !enable && !events); } /* @@ -1875,12 +1879,14 @@ efx_mcdi_mac_stats( if ((req.emr_rc != ENOENT) || (enp->en_rx_qcount + enp->en_tx_qcount != 0)) { rc = req.emr_rc; - goto fail1; + goto fail2; } } return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Tue Nov 27 14:15:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0536D114DAAA; Tue, 27 Nov 2018 14:15:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 338007CDFA; Tue, 27 Nov 2018 14:15:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAA811C609; Tue, 27 Nov 2018 14:15:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREFJKr060970; Tue, 27 Nov 2018 14:15:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREFJnV060969; Tue, 27 Nov 2018 14:15:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271415.wAREFJnV060969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341061 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 338007CDFA X-Spamd-Result: default: False [1.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.57)[0.566,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:15:23 -0000 Author: arybchik Date: Tue Nov 27 14:15:19 2018 New Revision: 341061 URL: https://svnweb.freebsd.org/changeset/base/341061 Log: sfxge(4): use MAC stats DMA buffer size from caps For Medford2 the DMA buffer used for one-shot or periodic MAC stats has been extended. Ensure the MAC stats DMA buffer size is large enough to hold the number of stats counters supported by firmware. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18175 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 14:15:08 2018 (r341060) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 27 14:15:19 2018 (r341061) @@ -1820,7 +1820,7 @@ efx_mcdi_mac_stats( { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_MAC_STATS_IN_LEN, - MC_CMD_MAC_STATS_OUT_DMA_LEN)]; + MC_CMD_MAC_STATS_V2_OUT_DMA_LEN)]; int clear = (action == EFX_STATS_CLEAR); int upload = (action == EFX_STATS_UPLOAD); int enable = (action == EFX_STATS_ENABLE_NOEVENTS); @@ -1833,7 +1833,7 @@ efx_mcdi_mac_stats( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_MAC_STATS_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_MAC_STATS_OUT_DMA_LEN; + req.emr_out_length = MC_CMD_MAC_STATS_V2_OUT_DMA_LEN; MCDI_IN_POPULATE_DWORD_6(req, MAC_STATS_IN_CMD, MAC_STATS_IN_DMA, upload, @@ -1844,7 +1844,8 @@ efx_mcdi_mac_stats( MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0); if (enable || events || upload) { - uint32_t bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t); + const efx_nic_cfg_t *encp = &enp->en_nic_cfg; + uint32_t bytes; /* Periodic stats or stats upload require a DMA buffer */ if (esmp == NULL) { @@ -1852,11 +1853,20 @@ efx_mcdi_mac_stats( goto fail1; } - EFX_STATIC_ASSERT(MC_CMD_MAC_NSTATS * sizeof (uint64_t) <= - EFX_MAC_STATS_SIZE); + if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS) { + /* MAC stats count too small for legacy MAC stats */ + rc = ENOSPC; + goto fail2; + } - EFSYS_ASSERT3U(bytes, <=, (uint32_t)EFSYS_MEM_SIZE(esmp)); + bytes = encp->enc_mac_stats_nstats * sizeof (efx_qword_t); + if (EFSYS_MEM_SIZE(esmp) < bytes) { + /* DMA buffer too small */ + rc = ENOSPC; + goto fail3; + } + MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_LO, EFSYS_MEM_ADDR(esmp) & 0xffffffff); MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_HI, @@ -1879,12 +1889,16 @@ efx_mcdi_mac_stats( if ((req.emr_rc != ENOENT) || (enp->en_rx_qcount + enp->en_tx_qcount != 0)) { rc = req.emr_rc; - goto fail2; + goto fail4; } } return (0); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-head@freebsd.org Tue Nov 27 14:15:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B799114DADB; Tue, 27 Nov 2018 14:15:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFCA67CEB8; Tue, 27 Nov 2018 14:15:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D5D11C60A; Tue, 27 Nov 2018 14:15:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREFUe7061028; Tue, 27 Nov 2018 14:15:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREFUlN061026; Tue, 27 Nov 2018 14:15:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271415.wAREFUlN061026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341062 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFCA67CEB8 X-Spamd-Result: default: False [1.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; NEURAL_SPAM_SHORT(0.57)[0.566,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:15:32 -0000 Author: arybchik Date: Tue Nov 27 14:15:30 2018 New Revision: 341062 URL: https://svnweb.freebsd.org/changeset/base/341062 Log: sfxge(4): use MAC stats DMA buffer size when decoding On Medford2 and later the MAC stats buffer has been enlarged. Use the MAC stats DMA buffer size to ensure that the stats END generation count is read from the correct location, and that over-reading of the DMA buffer is prevented. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18176 Modified: head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/siena_mac.c Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Tue Nov 27 14:15:19 2018 (r341061) +++ head/sys/dev/sfxge/common/ef10_mac.c Tue Nov 27 14:15:30 2018 (r341062) @@ -579,16 +579,45 @@ ef10_mac_stats_update( __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, __inout_opt uint32_t *generationp) { - efx_qword_t value; + const efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_qword_t generation_start; efx_qword_t generation_end; + efx_qword_t value; + efx_rc_t rc; - _NOTE(ARGUNUSED(enp)) + /* + * The MAC_STATS contain start and end generation counters used to + * detect when the DMA buffer has been updated during stats decode. + * All stats counters are 64bit unsigned values. + * + * Siena-compatible MAC stats contain MC_CMD_MAC_NSTATS 64bit counters. + * The generation end counter is at index MC_CMD_MAC_GENERATION_END + * (same as MC_CMD_MAC_NSTATS-1). + * + * Medford2 and later use a larger DMA buffer: MAC_STATS_NUM_STATS from + * MC_CMD_GET_CAPABILITIES_V4_OUT reports the number of 64bit counters. + * + * Firmware writes the generation end counter as the last counter in the + * DMA buffer. Do not use MC_CMD_MAC_GENERATION_END, as that is only + * correct for legacy Siena-compatible MAC stats. + */ + if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS) { + /* MAC stats count too small for legacy MAC stats */ + rc = ENOSPC; + goto fail1; + } + if (EFSYS_MEM_SIZE(esmp) < + (encp->enc_mac_stats_nstats * sizeof (efx_qword_t))) { + /* DMA buffer too small */ + rc = ENOSPC; + goto fail2; + } + /* Read END first so we don't race with the MC */ - EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); - EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END, - &generation_end); + EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp)); + EF10_MAC_STAT_READ(esmp, (encp->enc_mac_stats_nstats - 1), + &generation_end); EFSYS_MEM_READ_BARRIER(); /* TX */ @@ -878,8 +907,8 @@ ef10_mac_stats_update( EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_OVERFLOW]), &value); - - EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); + /* Read START generation counter */ + EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp)); EFSYS_MEM_READ_BARRIER(); EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START, &generation_start); @@ -894,6 +923,13 @@ ef10_mac_stats_update( *generationp = EFX_QWORD_FIELD(generation_start, EFX_DWORD_0); return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } #endif /* EFSYS_OPT_MAC_STATS */ Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Tue Nov 27 14:15:19 2018 (r341061) +++ head/sys/dev/sfxge/common/siena_mac.c Tue Nov 27 14:15:30 2018 (r341062) @@ -274,16 +274,28 @@ siena_mac_stats_update( __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, __inout_opt uint32_t *generationp) { - efx_qword_t value; + const efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_qword_t generation_start; efx_qword_t generation_end; + efx_qword_t value; + efx_rc_t rc; - _NOTE(ARGUNUSED(enp)) + if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS) { + /* MAC stats count too small */ + rc = ENOSPC; + goto fail1; + } + if (EFSYS_MEM_SIZE(esmp) < + (encp->enc_mac_stats_nstats * sizeof (efx_qword_t))) { + /* DMA buffer too small */ + rc = ENOSPC; + goto fail2; + } /* Read END first so we don't race with the MC */ - EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); - SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END, - &generation_end); + EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp)); + SIENA_MAC_STAT_READ(esmp, (encp->enc_mac_stats_nstats - 1), + &generation_end); EFSYS_MEM_READ_BARRIER(); /* TX */ @@ -466,6 +478,13 @@ siena_mac_stats_update( *generationp = EFX_QWORD_FIELD(generation_start, EFX_DWORD_0); return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } #endif /* EFSYS_OPT_MAC_STATS */ From owner-svn-src-head@freebsd.org Tue Nov 27 14:15:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C5B8114DB0A; Tue, 27 Nov 2018 14:15:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 596F17CFDE; Tue, 27 Nov 2018 14:15:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28EE61C60B; Tue, 27 Nov 2018 14:15:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREFgE0061086; Tue, 27 Nov 2018 14:15:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREFfE3061085; Tue, 27 Nov 2018 14:15:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271415.wAREFfE3061085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341063 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 596F17CFDE X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.56)[0.556,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:15:47 -0000 Author: arybchik Date: Tue Nov 27 14:15:41 2018 New Revision: 341063 URL: https://svnweb.freebsd.org/changeset/base/341063 Log: sfxge(4): run mkconfig.py to add FEC MAC stats Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18177 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:15:30 2018 (r341062) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:15:41 2018 (r341063) @@ -351,7 +351,7 @@ efx_intr_fini( #if EFSYS_OPT_MAC_STATS -/* START MKCONFIG GENERATED EfxHeaderMacBlock e323546097fd7c65 */ +/* START MKCONFIG GENERATED EfxHeaderMacBlock 7b5f45054a3b45bc */ typedef enum efx_mac_stat_e { EFX_MAC_RX_OCTETS, EFX_MAC_RX_PKTS, @@ -434,6 +434,12 @@ typedef enum efx_mac_stat_e { EFX_MAC_VADAPTER_TX_BAD_PACKETS, EFX_MAC_VADAPTER_TX_BAD_BYTES, EFX_MAC_VADAPTER_TX_OVERFLOW, + EFX_MAC_FEC_UNCORRECTED_ERRORS, + EFX_MAC_FEC_CORRECTED_ERRORS, + EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE0, + EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE1, + EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE2, + EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE3, EFX_MAC_NSTATS } efx_mac_stat_t; Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue Nov 27 14:15:30 2018 (r341062) +++ head/sys/dev/sfxge/common/efx_mac.c Tue Nov 27 14:15:41 2018 (r341063) @@ -521,7 +521,7 @@ efx_mac_filter_default_rxq_clear( #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxMacStatNamesBlock c11b91b42f922516 */ +/* START MKCONFIG GENERATED EfxMacStatNamesBlock 8726fc355b6e7c1a */ static const char * const __efx_mac_stat_name[] = { "rx_octets", "rx_pkts", @@ -604,6 +604,12 @@ static const char * const __efx_mac_stat_name[] = { "vadapter_tx_bad_packets", "vadapter_tx_bad_bytes", "vadapter_tx_overflow", + "fec_uncorrected_errors", + "fec_corrected_errors", + "fec_corrected_symbols_lane0", + "fec_corrected_symbols_lane1", + "fec_corrected_symbols_lane2", + "fec_corrected_symbols_lane3", }; /* END MKCONFIG GENERATED EfxMacStatNamesBlock */ From owner-svn-src-head@freebsd.org Tue Nov 27 14:15:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DC95114DB42; Tue, 27 Nov 2018 14:15:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 404967D135; Tue, 27 Nov 2018 14:15:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80ED11C60D; Tue, 27 Nov 2018 14:15:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREFr5c061147; Tue, 27 Nov 2018 14:15:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREFqcB061144; Tue, 27 Nov 2018 14:15:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271415.wAREFqcB061144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341064 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 404967D135 X-Spamd-Result: default: False [1.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.566,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:15:56 -0000 Author: arybchik Date: Tue Nov 27 14:15:52 2018 New Revision: 341064 URL: https://svnweb.freebsd.org/changeset/base/341064 Log: sfxge(4): decode Medford2 FEC stats if available Decode Medford2 FEC stats if available in MAC stats DMA buffer. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18178 Modified: head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Tue Nov 27 14:15:41 2018 (r341063) +++ head/sys/dev/sfxge/common/ef10_mac.c Tue Nov 27 14:15:52 2018 (r341064) @@ -550,8 +550,20 @@ ef10_mac_stats_get_mask( goto fail6; } + if (encp->enc_fec_counters) { + const struct efx_mac_stats_range ef10_fec[] = { + { EFX_MAC_FEC_UNCORRECTED_ERRORS, + EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE3 }, + }; + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_fec, EFX_ARRAY_SIZE(ef10_fec))) != 0) + goto fail7; + } + return (0); +fail7: + EFSYS_PROBE(fail7); fail6: EFSYS_PROBE(fail6); fail5: @@ -907,6 +919,38 @@ ef10_mac_stats_update( EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_OVERFLOW]), &value); + + if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS_V2) + goto done; + + /* FEC */ + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_FEC_UNCORRECTED_ERRORS, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_FEC_UNCORRECTED_ERRORS]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_FEC_CORRECTED_ERRORS, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_FEC_CORRECTED_ERRORS]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE0, + &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE0]), + &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE1, + &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE1]), + &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE2, + &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE2]), + &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE3, + &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE3]), + &value); + +done: /* Read START generation counter */ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp)); EFSYS_MEM_READ_BARRIER(); Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 14:15:41 2018 (r341063) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Nov 27 14:15:52 2018 (r341064) @@ -1212,6 +1212,11 @@ ef10_get_datapath_caps( encp->enc_mac_stats_nstats = MC_CMD_MAC_NSTATS; } + if (encp->enc_mac_stats_nstats >= MC_CMD_MAC_NSTATS_V2) + encp->enc_fec_counters = B_TRUE; + else + encp->enc_fec_counters = B_FALSE; + #undef CAP_FLAGS1 #undef CAP_FLAGS2 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:15:41 2018 (r341063) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:15:52 2018 (r341064) @@ -1268,6 +1268,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_nvram_update_verify_result_supported; /* Firmware support for extended MAC_STATS buffer */ uint32_t enc_mac_stats_nstats; + boolean_t enc_fec_counters; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) From owner-svn-src-head@freebsd.org Tue Nov 27 14:16:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF455114DBA0; Tue, 27 Nov 2018 14:16:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95A797D1E6; Tue, 27 Nov 2018 14:16:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76BA11C60F; Tue, 27 Nov 2018 14:16:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREG449061208; Tue, 27 Nov 2018 14:16:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREG4k3061207; Tue, 27 Nov 2018 14:16:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271416.wAREG4k3061207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341065 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 95A797D1E6 X-Spamd-Result: default: False [1.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.57)[0.566,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:16:05 -0000 Author: arybchik Date: Tue Nov 27 14:16:03 2018 New Revision: 341065 URL: https://svnweb.freebsd.org/changeset/base/341065 Log: sfxge(4): resolve code analysis warnings Minimal changes adding buffer size checks and simplifying checksum processing. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18179 Modified: head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Tue Nov 27 14:15:52 2018 (r341064) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Tue Nov 27 14:16:03 2018 (r341065) @@ -238,19 +238,25 @@ efx_bootcfg_copy_sector( size_t used_bytes; efx_rc_t rc; + /* Minimum buffer is checksum byte and DHCP_END terminator */ + if (data_size < 2) { + rc = ENOSPC; + goto fail1; + } + /* Verify that the area is correctly formatted and checksummed */ rc = efx_bootcfg_verify(enp, sector, sector_length, &used_bytes); if (!handle_format_errors) { if (rc != 0) - goto fail1; + goto fail2; if ((used_bytes < 2) || (sector[used_bytes - 1] != DHCP_END)) { /* Block too short, or DHCP_END missing */ rc = ENOENT; - goto fail2; + goto fail3; } } @@ -284,10 +290,14 @@ efx_bootcfg_copy_sector( */ if (used_bytes > data_size) { rc = ENOSPC; - goto fail3; + goto fail4; } - memcpy(data, sector, used_bytes); + data[0] = 0; /* checksum, updated below */ + + /* Copy all after the checksum to the target buffer */ + memcpy(data + 1, sector + 1, used_bytes - 1); + /* Zero out the unused portion of the target buffer */ if (used_bytes < data_size) (void) memset(data + used_bytes, 0, data_size - used_bytes); @@ -300,6 +310,8 @@ efx_bootcfg_copy_sector( return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -324,6 +336,12 @@ efx_bootcfg_read( efx_rc_t rc; uint32_t sector_number; + /* Minimum buffer is checksum byte and DHCP_END terminator */ + if (size < 2) { + rc = ENOSPC; + goto fail1; + } + #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 sector_number = enp->en_nic_cfg.enc_pf; #else @@ -331,21 +349,26 @@ efx_bootcfg_read( #endif rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length); if (rc != 0) - goto fail1; + goto fail2; /* The bootcfg sector may be stored in a (larger) shared partition */ rc = efx_bootcfg_sector_info(enp, sector_number, NULL, §or_offset, §or_length); if (rc != 0) - goto fail2; + goto fail3; + if (sector_length < 2) { + rc = EINVAL; + goto fail4; + } + if (sector_length > BOOTCFG_MAX_SIZE) sector_length = BOOTCFG_MAX_SIZE; if (sector_offset + sector_length > partn_length) { /* Partition is too small */ rc = EFBIG; - goto fail3; + goto fail5; } /* @@ -358,28 +381,28 @@ efx_bootcfg_read( EFSYS_KMEM_ALLOC(enp->en_esip, sector_length, payload); if (payload == NULL) { rc = ENOMEM; - goto fail4; + goto fail6; } } else payload = (uint8_t *)data; if ((rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) - goto fail5; + goto fail7; if ((rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset, (caddr_t)payload, sector_length)) != 0) { (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL); - goto fail6; + goto fail8; } if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) - goto fail7; + goto fail9; /* Verify that the area is correctly formatted and checksummed */ rc = efx_bootcfg_verify(enp, payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { - payload[0] = (uint8_t)(~DHCP_END & 0xff); + payload[0] = 0; payload[1] = DHCP_END; used_bytes = 2; } @@ -394,10 +417,8 @@ efx_bootcfg_read( * so reinitialise the sector if there isn't room for the character. */ if (payload[used_bytes - 1] != DHCP_END) { - if (used_bytes + 1 > sector_length) { - payload[0] = 0; + if (used_bytes >= sector_length) used_bytes = 1; - } payload[used_bytes] = DHCP_END; ++used_bytes; @@ -409,10 +430,14 @@ efx_bootcfg_read( */ if (used_bytes > size) { rc = ENOSPC; - goto fail8; + goto fail10; } + + data[0] = 0; /* checksum, updated below */ + if (sector_length > size) { - memcpy(data, payload, used_bytes); + /* Copy all after the checksum to the target buffer */ + memcpy(data + 1, payload + 1, used_bytes - 1); EFSYS_KMEM_FREE(enp->en_esip, sector_length, payload); } @@ -428,16 +453,20 @@ efx_bootcfg_read( return (0); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); fail8: EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); + if (sector_length > size) + EFSYS_KMEM_FREE(enp->en_esip, sector_length, payload); fail6: EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); - if (sector_length > size) - EFSYS_KMEM_FREE(enp->en_esip, sector_length, payload); fail4: EFSYS_PROBE(fail4); fail3: From owner-svn-src-head@freebsd.org Tue Nov 27 14:16:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93E76114DC0E; Tue, 27 Nov 2018 14:16:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36C7E7D372; Tue, 27 Nov 2018 14:16:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B79E71C611; Tue, 27 Nov 2018 14:16:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREGFac061267; Tue, 27 Nov 2018 14:16:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREGFEr061264; Tue, 27 Nov 2018 14:16:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811271416.wAREGFEr061264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 27 Nov 2018 14:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341066 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 341066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 36C7E7D372 X-Spamd-Result: default: False [1.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.566,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:16:20 -0000 Author: arybchik Date: Tue Nov 27 14:16:14 2018 New Revision: 341066 URL: https://svnweb.freebsd.org/changeset/base/341066 Log: sfxge(4): remove MAC stats size define Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18180 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_mac.c head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:16:03 2018 (r341065) +++ head/sys/dev/sfxge/common/efx.h Tue Nov 27 14:16:14 2018 (r341066) @@ -589,7 +589,6 @@ efx_mac_stats_get_mask( ((_mask)[(_stat) / EFX_MAC_STATS_MASK_BITS_PER_PAGE] & \ (1ULL << ((_stat) & (EFX_MAC_STATS_MASK_BITS_PER_PAGE - 1)))) -#define EFX_MAC_STATS_SIZE 0x400 extern __checkReturn efx_rc_t efx_mac_stats_clear( @@ -598,8 +597,8 @@ efx_mac_stats_clear( /* * Upload mac statistics supported by the hardware into the given buffer. * - * The reference buffer must be at least %EFX_MAC_STATS_SIZE bytes, - * and page aligned. + * The DMA buffer must be 4Kbyte aligned and sized to hold at least + * efx_nic_cfg_t::enc_mac_stats_nstats 64bit counters. * * The hardware will only DMA statistics that it understands (of course). * Drivers should not make any assumptions about which statistics are Modified: head/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Tue Nov 27 14:16:03 2018 (r341065) +++ head/sys/dev/sfxge/common/siena_mac.c Tue Nov 27 14:16:14 2018 (r341066) @@ -463,7 +463,7 @@ siena_mac_stats_update( SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_NODESC_DROP_CNT]), &value); - EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE); + EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp)); EFSYS_MEM_READ_BARRIER(); SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START, &generation_start); Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Tue Nov 27 14:16:03 2018 (r341065) +++ head/sys/dev/sfxge/sfxge_port.c Tue Nov 27 14:16:14 2018 (r341066) @@ -753,6 +753,8 @@ sfxge_port_init(struct sfxge_softc *sc) struct sysctl_ctx_list *sysctl_ctx; struct sysctl_oid *sysctl_tree; efsys_mem_t *mac_stats_buf, *phy_stats_buf; + uint32_t mac_nstats; + size_t mac_stats_size; int rc; port = &sc->port; @@ -792,7 +794,9 @@ sfxge_port_init(struct sfxge_softc *sc) DBGPRINT(sc->dev, "alloc MAC stats"); port->mac_stats.decode_buf = malloc(EFX_MAC_NSTATS * sizeof(uint64_t), M_SFXGE, M_WAITOK | M_ZERO); - if ((rc = sfxge_dma_alloc(sc, EFX_MAC_STATS_SIZE, mac_stats_buf)) != 0) + mac_nstats = efx_nic_cfg_get(sc->enp)->enc_mac_stats_nstats; + mac_stats_size = P2ROUNDUP(mac_nstats * sizeof(uint64_t), EFX_BUF_SIZE); + if ((rc = sfxge_dma_alloc(sc, mac_stats_size, mac_stats_buf)) != 0) goto fail2; port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); sfxge_mac_stat_init(sc); From owner-svn-src-head@freebsd.org Tue Nov 27 14:58:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D10E114F673; Tue, 27 Nov 2018 14:58:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 921E47F490; Tue, 27 Nov 2018 14:58:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7352D1CD07; Tue, 27 Nov 2018 14:58:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAREwLNB082112; Tue, 27 Nov 2018 14:58:21 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAREwK8s082106; Tue, 27 Nov 2018 14:58:20 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811271458.wAREwK8s082106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 27 Nov 2018 14:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341067 - in head: lib/geom/part sys/geom/part usr.sbin/boot0cfg X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head: lib/geom/part sys/geom/part usr.sbin/boot0cfg X-SVN-Commit-Revision: 341067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 921E47F490 X-Spamd-Result: default: False [1.13 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.07)[-0.067,0]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.69)[0.687,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 14:58:22 -0000 Author: des Date: Tue Nov 27 14:58:19 2018 New Revision: 341067 URL: https://svnweb.freebsd.org/changeset/base/341067 Log: Add a “skip_dsn†option to g_part's bootcode verb to prevent g_part_mbr from setting the volume serial number. This unbreaks older boot blocks that don't support serial numbers, and allows boot0cfg to set the serial number itself if requested by the user. Submitted by: lev@, yuripv@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17386 Modified: head/lib/geom/part/geom_part.c head/lib/geom/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_mbr.c head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/lib/geom/part/geom_part.c ============================================================================== --- head/lib/geom/part/geom_part.c Tue Nov 27 14:16:14 2018 (r341066) +++ head/lib/geom/part/geom_part.c Tue Nov 27 14:58:19 2018 (r341067) @@ -72,6 +72,7 @@ volatile sig_atomic_t undo_restore; #define GPART_PARAM_BOOTCODE "bootcode" #define GPART_PARAM_INDEX "index" #define GPART_PARAM_PARTCODE "partcode" +#define GPART_PARAM_SKIP_DSN "skip_dsn" static struct gclass *find_class(struct gmesh *, const char *); static struct ggeom * find_geom(struct gclass *, const char *); @@ -115,8 +116,9 @@ struct g_command PUBSYM(class_commands)[] = { { 'p', GPART_PARAM_PARTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, + { 'N', GPART_PARAM_SKIP_DSN, NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-b bootcode] [-p partcode -i index] [-f flags] geom" + "[-N] [-b bootcode] [-p partcode -i index] [-f flags] geom" }, { "commit", 0, gpart_issue, G_NULL_OPTS, "geom" Modified: head/lib/geom/part/gpart.8 ============================================================================== --- head/lib/geom/part/gpart.8 Tue Nov 27 14:16:14 2018 (r341066) +++ head/lib/geom/part/gpart.8 Tue Nov 27 14:58:19 2018 (r341067) @@ -49,6 +49,7 @@ .\" ==== BOOTCODE ==== .Nm .Cm bootcode +.Op Fl N .Op Fl b Ar bootcode .Op Fl p Ar partcode Fl i Ar index .Op Fl f Ar flags @@ -214,6 +215,14 @@ The .Cm bootcode command accepts these options: .Bl -tag -width 10n +.It Fl N +Don't preserve the Volume Serial Number for MBR. +MBR bootcode contains Volume Serial Number by default, and +.Nm +tries to preserve it when installing new bootstrap code. +This option allows to skip the preservation to help with some versions of +.Xr boot0 8 +that don't support Volume Serial Number. .It Fl b Ar bootcode Embed bootstrap code from the file .Ar bootcode Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Nov 27 14:16:14 2018 (r341066) +++ head/sys/geom/part/g_part.c Tue Nov 27 14:58:19 2018 (r341067) @@ -1627,6 +1627,7 @@ g_part_ctlreq(struct gctl_req *req, struct g_class *mp if (!strcmp(verb, "bootcode")) { ctlreq = G_PART_CTL_BOOTCODE; mparms |= G_PART_PARM_GEOM | G_PART_PARM_BOOTCODE; + oparms |= G_PART_PARM_SKIP_DSN; } break; case 'c': @@ -1744,6 +1745,8 @@ g_part_ctlreq(struct gctl_req *req, struct g_class *mp parm = G_PART_PARM_SIZE; else if (!strcmp(ap->name, "start")) parm = G_PART_PARM_START; + else if (!strcmp(ap->name, "skip_dsn")) + parm = G_PART_PARM_SKIP_DSN; break; case 't': if (!strcmp(ap->name, "type")) @@ -1803,6 +1806,10 @@ g_part_ctlreq(struct gctl_req *req, struct g_class *mp break; case G_PART_PARM_SIZE: error = g_part_parm_quad(req, ap->name, &gpp.gpp_size); + break; + case G_PART_PARM_SKIP_DSN: + error = g_part_parm_uint32(req, ap->name, + &gpp.gpp_skip_dsn); break; case G_PART_PARM_START: error = g_part_parm_quad(req, ap->name, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Tue Nov 27 14:16:14 2018 (r341066) +++ head/sys/geom/part/g_part.h Tue Nov 27 14:58:19 2018 (r341067) @@ -202,6 +202,7 @@ enum g_part_ctl { #define G_PART_PARM_BOOTCODE 0x1000 #define G_PART_PARM_ATTRIB 0x2000 #define G_PART_PARM_FORCE 0x4000 +#define G_PART_PARM_SKIP_DSN 0x8000 struct g_part_parms { unsigned int gpp_parms; @@ -220,6 +221,7 @@ struct g_part_parms { unsigned int gpp_codesize; const char *gpp_attrib; unsigned int gpp_force; + unsigned int gpp_skip_dsn; }; void g_part_geometry_heads(off_t, u_int, off_t *, u_int *); Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Nov 27 14:16:14 2018 (r341066) +++ head/sys/geom/part/g_part_mbr.c Tue Nov 27 14:58:19 2018 (r341067) @@ -274,7 +274,7 @@ g_part_mbr_bootcode(struct g_part_table *basetable, st table = (struct g_part_mbr_table *)basetable; dsn = *(uint32_t *)(table->mbr + DOSDSNOFF); bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); - if (dsn != 0) + if (dsn != 0 && !gpp->gpp_skip_dsn) *(uint32_t *)(table->mbr + DOSDSNOFF) = dsn; return (0); } Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Tue Nov 27 14:16:14 2018 (r341066) +++ head/usr.sbin/boot0cfg/boot0cfg.c Tue Nov 27 14:58:19 2018 (r341067) @@ -100,7 +100,7 @@ static const char fmt1[] = "%d 0x%02x %4u:%3u:%2u static int geom_class_available(const char *); static int read_mbr(const char *, u_int8_t **, int); -static void write_mbr(const char *, int, u_int8_t *, int); +static void write_mbr(const char *, int, u_int8_t *, int, int); static void display_mbr(u_int8_t *); static int boot0version(const u_int8_t *); static int boot0bs(const u_int8_t *); @@ -200,7 +200,7 @@ main(int argc, char *argv[]) /* save the existing MBR if we are asked to do so */ if (fpath) - write_mbr(fpath, O_CREAT | O_TRUNC, mbr, mbr_size); + write_mbr(fpath, O_CREAT | O_TRUNC, mbr, mbr_size, 0); /* * If we are installing the boot loader, read it from disk and copy the @@ -256,7 +256,7 @@ main(int argc, char *argv[]) } /* write the MBR back to disk */ if (up) - write_mbr(disk, 0, boot0, boot0_size); + write_mbr(disk, 0, boot0, boot0_size, vol_id[4] || b0_ver == 1); /* display the MBR */ if (v_flag) @@ -372,7 +372,8 @@ geom_class_available(const char *name) * Write out the mbr to the specified file. */ static void -write_mbr(const char *fname, int flags, u_int8_t *mbr, int mbr_size) +write_mbr(const char *fname, int flags, u_int8_t *mbr, int mbr_size, + int disable_dsn) { struct gctl_req *grq; const char *errmsg; @@ -417,6 +418,9 @@ write_mbr(const char *fname, int flags, u_int8_t *mbr, gctl_ro_param(grq, "verb", -1, "bootcode"); gctl_ro_param(grq, "bootcode", mbr_size, mbr); gctl_ro_param(grq, "flags", -1, "C"); + if (disable_dsn) + gctl_ro_param(grq, "skip_dsn", sizeof(int), + &disable_dsn); errmsg = gctl_issue(grq); if (errmsg != NULL && errmsg[0] != '\0') errx(1, "GEOM_PART: write bootcode to %s failed: %s", From owner-svn-src-head@freebsd.org Tue Nov 27 15:12:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41A51114FE5F; Tue, 27 Nov 2018 15:12:36 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E924B7FECA; Tue, 27 Nov 2018 15:12:35 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C73221D063; Tue, 27 Nov 2018 15:12:35 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARFCZa9092111; Tue, 27 Nov 2018 15:12:35 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARFCYmP092105; Tue, 27 Nov 2018 15:12:34 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201811271512.wARFCYmP092105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 27 Nov 2018 15:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341068 - head/tests/sys/kqueue/libkqueue X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/tests/sys/kqueue/libkqueue X-SVN-Commit-Revision: 341068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E924B7FECA X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.07)[-0.070,0]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.73)[0.726,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 15:12:36 -0000 Author: dab Date: Tue Nov 27 15:12:34 2018 New Revision: 341068 URL: https://svnweb.freebsd.org/changeset/base/341068 Log: Make whitespace more consistent in libkqueue tests. After r337820, which "corrected" some spaces-instead-of-tab whitespace issues in the libkqueue tests, jmg@ pointed out that these files were originally space-based, not tab-spaced, and so the correction should have been to get rid of the tabs that had been introduced in previous changes, not the spaces. This change does that. This is a whitespace only change; no functional change is intended. Reported by: jmg@ MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kqueue/libkqueue/main.c head/tests/sys/kqueue/libkqueue/proc.c head/tests/sys/kqueue/libkqueue/signal.c head/tests/sys/kqueue/libkqueue/timer.c head/tests/sys/kqueue/libkqueue/user.c head/tests/sys/kqueue/libkqueue/vnode.c Modified: head/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/main.c Tue Nov 27 14:58:19 2018 (r341067) +++ head/tests/sys/kqueue/libkqueue/main.c Tue Nov 27 15:12:34 2018 (r341068) @@ -85,7 +85,7 @@ kevent_get(int kqfd) struct kevent *kev; if ((kev = calloc(1, sizeof(*kev))) == NULL) - err(1, "out of memory"); + err(1, "out of memory"); nfds = kevent(kqfd, NULL, 0, kev, 1, NULL); if (nfds < 1) @@ -103,7 +103,7 @@ kevent_get_timeout(int kqfd, int seconds) struct timespec timeout = {seconds, 0}; if ((kev = calloc(1, sizeof(*kev))) == NULL) - err(1, "out of memory"); + err(1, "out of memory"); nfds = kevent(kqfd, NULL, 0, kev, 1, &timeout); if (nfds < 0) { @@ -123,10 +123,10 @@ kevent_fflags_dump(struct kevent *kev) #define KEVFFL_DUMP(attrib) \ if (kev->fflags & attrib) \ - strncat(buf, #attrib" ", 64); + strncat(buf, #attrib" ", 64); if ((buf = calloc(1, 1024)) == NULL) - abort(); + abort(); /* Not every filter has meaningful fflags */ if (kev->filter == EVFILT_PROC) { @@ -160,7 +160,7 @@ kevent_fflags_dump(struct kevent *kev) #endif buf[strlen(buf) - 1] = ')'; } else { - snprintf(buf, 1024, "fflags = %x", kev->fflags); + snprintf(buf, 1024, "fflags = %x", kev->fflags); } return (buf); @@ -173,10 +173,10 @@ kevent_flags_dump(struct kevent *kev) #define KEVFL_DUMP(attrib) \ if (kev->flags & attrib) \ - strncat(buf, #attrib" ", 64); + strncat(buf, #attrib" ", 64); if ((buf = calloc(1, 1024)) == NULL) - abort(); + abort(); snprintf(buf, 1024, "flags = %d (", kev->flags); KEVFL_DUMP(EV_ADD); @@ -208,17 +208,17 @@ kevent_to_str(struct kevent *kev) snprintf(&buf[0], sizeof(buf), "[ident=%ju, filter=%d, %s, %s, data=%jd, udata=%p, " - "ext=[%jx %jx %jx %jx]", + "ext=[%jx %jx %jx %jx]", (uintmax_t) kev->ident, kev->filter, flags_str, fflags_str, (uintmax_t)kev->data, kev->udata, - (uintmax_t)kev->ext[0], - (uintmax_t)kev->ext[1], - (uintmax_t)kev->ext[2], - (uintmax_t)kev->ext[3]); + (uintmax_t)kev->ext[0], + (uintmax_t)kev->ext[1], + (uintmax_t)kev->ext[2], + (uintmax_t)kev->ext[3]); free(flags_str); free(fflags_str); @@ -239,10 +239,10 @@ kevent_add(int kqfd, struct kevent *kev, EV_SET(kev, ident, filter, flags, fflags, data, NULL); if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { - kev_str = kevent_to_str(kev); - printf("Unable to add the following kevent:\n%s\n", - kev_str); - free(kev_str); + kev_str = kevent_to_str(kev); + printf("Unable to add the following kevent:\n%s\n", + kev_str); + free(kev_str); err(1, "kevent(): %s", strerror(errno)); } } @@ -265,12 +265,12 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) k1->data != k2->data || k1->udata != k2->udata || k1->ext[0] != k2->ext[0] || k1->ext[1] != k2->ext[1] || k1->ext[0] != k2->ext[2] || k1->ext[0] != k2->ext[3]) { - kev1_str = kevent_to_str(k1); - kev2_str = kevent_to_str(k2); - printf("kevent_cmp: mismatch:\n %s !=\n %s\n", - kev1_str, kev2_str); - free(kev1_str); - free(kev2_str); + kev1_str = kevent_to_str(k1); + kev2_str = kevent_to_str(k2); + printf("kevent_cmp: mismatch:\n %s !=\n %s\n", + kev1_str, kev2_str); + free(kev1_str); + free(kev2_str); abort(); } } Modified: head/tests/sys/kqueue/libkqueue/proc.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/proc.c Tue Nov 27 14:58:19 2018 (r341067) +++ head/tests/sys/kqueue/libkqueue/proc.c Tue Nov 27 15:12:34 2018 (r341068) @@ -45,7 +45,7 @@ add_and_delete(void) struct stat s; if (fstat(kqfd, &s) != -1) errx(1, "kqueue inherited across fork! (%s() at %s:%d)", - __func__, __FILE__, __LINE__); + __func__, __FILE__, __LINE__); pause(); exit(2); Modified: head/tests/sys/kqueue/libkqueue/signal.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/signal.c Tue Nov 27 14:58:19 2018 (r341067) +++ head/tests/sys/kqueue/libkqueue/signal.c Tue Nov 27 15:12:34 2018 (r341068) @@ -188,12 +188,12 @@ test_kevent_signal_oneshot(void) void test_evfilt_signal() { - kqfd = kqueue(); - test_kevent_signal_add(); - test_kevent_signal_del(); - test_kevent_signal_get(); - test_kevent_signal_disable(); - test_kevent_signal_enable(); - test_kevent_signal_oneshot(); - close(kqfd); + kqfd = kqueue(); + test_kevent_signal_add(); + test_kevent_signal_del(); + test_kevent_signal_get(); + test_kevent_signal_disable(); + test_kevent_signal_enable(); + test_kevent_signal_oneshot(); + close(kqfd); } Modified: head/tests/sys/kqueue/libkqueue/timer.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/timer.c Tue Nov 27 14:58:19 2018 (r341067) +++ head/tests/sys/kqueue/libkqueue/timer.c Tue Nov 27 15:12:34 2018 (r341068) @@ -34,11 +34,10 @@ int kqfd; static long now(void) { - - struct timeval tv; + struct timeval tv; - gettimeofday(&tv, NULL); - return SEC_TO_US(tv.tv_sec) + tv.tv_usec; + gettimeofday(&tv, NULL); + return SEC_TO_US(tv.tv_sec) + tv.tv_usec; } /* Sleep for a given number of milliseconds. The timeout is assumed to @@ -47,13 +46,12 @@ now(void) void mssleep(int t) { + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(MS_TO_US(t)), + }; - struct timespec stime = { - .tv_sec = 0, - .tv_nsec = US_TO_NS(MS_TO_US(t)), - }; - - nanosleep(&stime, NULL); + nanosleep(&stime, NULL); } /* Sleep for a given number of microseconds. The timeout is assumed to @@ -62,13 +60,12 @@ mssleep(int t) void ussleep(int t) { + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(t), + }; - struct timespec stime = { - .tv_sec = 0, - .tv_nsec = US_TO_NS(t), - }; - - nanosleep(&stime, NULL); + nanosleep(&stime, NULL); } void @@ -241,7 +238,7 @@ test_abstime(void) kevent_cmp(&kev, kevent_get(kqfd)); stop = time(NULL); if (stop < start + timeout) - err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + timeout)); + err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + timeout)); /* Check if the event occurs again */ sleep(3); @@ -264,16 +261,16 @@ test_update(void) /* First set the timer to 1 second */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, SEC_TO_US(1), (void *)1); + NOTE_USECONDS, SEC_TO_US(1), (void *)1); start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Now reduce the timer to 1 ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), (void *)2); + NOTE_USECONDS, MS_TO_US(1), (void *)2); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -288,9 +285,9 @@ test_update(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); if (elapsed > SEC_TO_US(1)) - errx(1, "late timer expiration: %ld us", elapsed); + errx(1, "late timer expiration: %ld us", elapsed); success(); } @@ -309,9 +306,9 @@ test_update_equal(void) /* First set the timer to 1 ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); + NOTE_USECONDS, MS_TO_US(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Sleep for a significant fraction of the timeout. */ ussleep(600); @@ -319,7 +316,7 @@ test_update_equal(void) /* Now re-add the timer with the same parameters */ start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -334,7 +331,7 @@ test_update_equal(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); success(); } @@ -353,9 +350,9 @@ test_update_expired(void) /* Set the timer to 1ms */ EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); + NOTE_USECONDS, MS_TO_US(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for 2 ms to give the timer plenty of time to expire. */ mssleep(2); @@ -363,7 +360,7 @@ test_update_expired(void) /* Now re-add the timer */ start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Wait for the event */ kev.flags |= EV_CLEAR; @@ -378,7 +375,7 @@ test_update_expired(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); /* Make sure the re-added timer does not fire. In other words, * test that the event received above was the only event from the @@ -405,7 +402,7 @@ test_update_periodic(void) EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(1), NULL); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Retrieve the event */ kev.flags = EV_ADD | EV_CLEAR; @@ -420,7 +417,7 @@ test_update_periodic(void) EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(2), NULL); start = now(); if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); /* Retrieve the event */ kev.flags = EV_ADD | EV_CLEAR; @@ -434,12 +431,12 @@ test_update_periodic(void) */ printf("timer expired after %ld us\n", elapsed); if (elapsed < MS_TO_US(2)) - errx(1, "early timer expiration: %ld us", elapsed); + errx(1, "early timer expiration: %ld us", elapsed); /* Delete the event */ kev.flags = EV_DELETE; if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + err(1, "%s", test_id); success(); } @@ -467,46 +464,46 @@ test_update_timing(void) * received is from the update and not the original timer add. */ for (sleeptime = MIN_SLEEP, iteration = 1; - sleeptime < MAX_SLEEP; - ++sleeptime, ++iteration) { + sleeptime < MAX_SLEEP; + ++sleeptime, ++iteration) { - /* First set the timer to 1 ms */ - EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, - NOTE_USECONDS, MS_TO_US(1), NULL); - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + /* First set the timer to 1 ms */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, MS_TO_US(1), NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); - /* Delay; the delay ranges from less than to greater than the - * timer period. - */ - ussleep(sleeptime); + /* Delay; the delay ranges from less than to greater than the + * timer period. + */ + ussleep(sleeptime); - /* Now re-add the timer with the same parameters */ - start = now(); - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); + /* Now re-add the timer with the same parameters */ + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); - /* Wait for the event */ - kev.flags |= EV_CLEAR; - kev.fflags &= ~NOTE_USECONDS; - kev.data = 1; - kevent_cmp(&kev, kevent_get(kqfd)); - stop = now(); - elapsed = stop - start; + /* Wait for the event */ + kev.flags |= EV_CLEAR; + kev.fflags &= ~NOTE_USECONDS; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + stop = now(); + elapsed = stop - start; - /* Check that the timer expired after at least 1 ms. This - * check is to make sure that the timer re-started and that - * the event is not from the original add of the timer. - */ - if (elapsed < MS_TO_US(1)) - errx(1, "early timer expiration: %ld us", elapsed); + /* Check that the timer expired after at least 1 ms. This + * check is to make sure that the timer re-started and that + * the event is not from the original add of the timer. + */ + if (elapsed < MS_TO_US(1)) + errx(1, "early timer expiration: %ld us", elapsed); - /* Make sure the re-added timer does not fire. In other words, - * test that the event received above was the only event from - * the add and re-add of the timer. - */ - mssleep(2); - test_no_kevents_quietly(); + /* Make sure the re-added timer does not fire. In other words, + * test that the event received above was the only event from + * the add and re-add of the timer. + */ + mssleep(2); + test_no_kevents_quietly(); } success(); @@ -515,18 +512,18 @@ test_update_timing(void) void test_evfilt_timer() { - kqfd = kqueue(); - test_kevent_timer_add(); - test_kevent_timer_del(); - test_kevent_timer_get(); - test_oneshot(); - test_periodic(); - test_abstime(); - test_update(); - test_update_equal(); - test_update_expired(); - test_update_timing(); - test_update_periodic(); - disable_and_enable(); - close(kqfd); + kqfd = kqueue(); + test_kevent_timer_add(); + test_kevent_timer_del(); + test_kevent_timer_get(); + test_oneshot(); + test_periodic(); + test_abstime(); + test_update(); + test_update_equal(); + test_update_expired(); + test_update_timing(); + test_update_periodic(); + disable_and_enable(); + close(kqfd); } Modified: head/tests/sys/kqueue/libkqueue/user.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/user.c Tue Nov 27 14:58:19 2018 (r341067) +++ head/tests/sys/kqueue/libkqueue/user.c Tue Nov 27 15:12:34 2018 (r341068) @@ -117,7 +117,7 @@ oneshot(void) void test_evfilt_user() { - kqfd = kqueue(); + kqfd = kqueue(); add_and_delete(); event_wait(); @@ -125,5 +125,5 @@ test_evfilt_user() oneshot(); /* TODO: try different fflags operations */ - close(kqfd); + close(kqfd); } Modified: head/tests/sys/kqueue/libkqueue/vnode.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/vnode.c Tue Nov 27 14:58:19 2018 (r341067) +++ head/tests/sys/kqueue/libkqueue/vnode.c Tue Nov 27 15:12:34 2018 (r341068) @@ -251,16 +251,16 @@ test_kevent_vnode_dispatch(void) void test_evfilt_vnode() { - kqfd = kqueue(); - test_kevent_vnode_add(); - test_kevent_vnode_del(); - test_kevent_vnode_disable_and_enable(); + kqfd = kqueue(); + test_kevent_vnode_add(); + test_kevent_vnode_del(); + test_kevent_vnode_disable_and_enable(); #if HAVE_EV_DISPATCH - test_kevent_vnode_dispatch(); + test_kevent_vnode_dispatch(); #endif - test_kevent_vnode_note_write(); - test_kevent_vnode_note_attrib(); - test_kevent_vnode_note_rename(); - test_kevent_vnode_note_delete(); - close(kqfd); + test_kevent_vnode_note_write(); + test_kevent_vnode_note_attrib(); + test_kevent_vnode_note_rename(); + test_kevent_vnode_note_delete(); + close(kqfd); } From owner-svn-src-head@freebsd.org Tue Nov 27 15:58:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C7191151901; Tue, 27 Nov 2018 15:58:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88EB882553; Tue, 27 Nov 2018 15:58:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id k7so7483648iob.6; Tue, 27 Nov 2018 07:58:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O10bicoBTiY3B5CMdYdfIXLQi2DzAuVtYg6+gNZICZY=; b=BJwENPu/sHgBr8BtySCS+wF3ryiW7CXgZryf7E+5yeOpOpgWRmf4VIhgQsTusxzXAw SvQl5pLHYyHeb4LQQ0Fh3YqmNEJ7mIw26zpYUre6PxJl689qMQxVit4eTMB4WsU/8w2d wJrRGKjTl1pBNPco+k4dxCgIGt31DFEPLasjuiNbRK/oz8idNeqRVfQRA3Q+65KrxWl2 o+mOlERHv27ej/zZS06pL173+kWQ3yxJXgbfp/WZqxehZqRi9YXdcDsMCQexlyUNXLZM jeaOJNoo9SvrYoGDaibRs4PBPfX3npi34Qk1fduuSxfm42OoXnhntcGC+9D7AazCx4o8 i8TA== X-Gm-Message-State: AA+aEWazyw+8mpM0hEelLgsBNgd36w0ui0e6MJEaoPU1D7Fp0WGB90h6 wqMO47zK5avOdEJWHt6lCmaTTcCipuTWHOZufhI8Ow== X-Google-Smtp-Source: AFSGD/WZYbQtFBZB4eeNaDIxGFITZI+UjjpVAhyyShbeOiIrUorfJJ8DM0+hZIccjfB8HBxMezkvDkYX1CRYusbROOc= X-Received: by 2002:a5d:8788:: with SMTP id f8mr6261756ion.239.1543334286568; Tue, 27 Nov 2018 07:58:06 -0800 (PST) MIME-Version: 1.0 References: <201811202104.wAKL4KZl030127@repo.freebsd.org> <20181124132842.GA50931@FreeBSD.org> <20181124161026.GA79732@neutralgood.org> In-Reply-To: <20181124161026.GA79732@neutralgood.org> From: Ed Maste Date: Tue, 27 Nov 2018 10:57:52 -0500 Message-ID: Subject: Re: svn commit: r340702 - in head/lib/csu: amd64 common i386 To: "Kevin P. Neal" Cc: Alexey Dokuchaev , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 88EB882553 X-Spamd-Result: default: False [-3.90 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.90)[-0.896,0]; RCVD_IN_DNSWL_NONE(0.00)[41.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.99)[ipnet: 209.85.128.0/17(-3.48), asn: 15169(-1.38), country: US(-0.09)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 15:58:08 -0000 On Sat, 24 Nov 2018 at 11:10, Kevin P. Neal wrote: > > On Sat, Nov 24, 2018 at 01:28:42PM +0000, Alexey Dokuchaev wrote: > > On Tue, Nov 20, 2018 at 09:04:20PM +0000, Ed Maste wrote: > > > New Revision: 340702 > > > URL: https://svnweb.freebsd.org/changeset/base/340702 > > My guess is that having to distribute a notice of the license with every > single FreeBSD executable shipped by any third party would be a bit silly. Yes, we want to be explicit that there's no requirement for attribution in binaries that link against these files. From owner-svn-src-head@freebsd.org Tue Nov 27 16:16:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923A511524DE; Tue, 27 Nov 2018 16:16:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36432838E5; Tue, 27 Nov 2018 16:16:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 173891DAB6; Tue, 27 Nov 2018 16:16:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARGGcpx023275; Tue, 27 Nov 2018 16:16:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGGcTi023274; Tue, 27 Nov 2018 16:16:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201811271616.wARGGcTi023274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 27 Nov 2018 16:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341071 - head/stand/i386/gptboot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/i386/gptboot X-SVN-Commit-Revision: 341071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 36432838E5 X-Spamd-Result: default: False [1.15 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.04)[0.038,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:16:39 -0000 Author: ian Date: Tue Nov 27 16:16:38 2018 New Revision: 341071 URL: https://svnweb.freebsd.org/changeset/base/341071 Log: Restore the ability to override the disk unit/partition at the boot: prompt in gptboot. When arch-independent geli support was added, a new static 'gdsk' struct was added, but there was still a static 'dsk' struct, and when you typed in an alternate disk/partition, the string was parsed into that struct, which was then never used for anything. Now the string gets parsed into gdsk.dsk, the struct that's actually used. X-MFC after: 3 days Modified: head/stand/i386/gptboot/gptboot.c Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Tue Nov 27 16:13:56 2018 (r341070) +++ head/stand/i386/gptboot/gptboot.c Tue Nov 27 16:16:38 2018 (r341071) @@ -81,7 +81,6 @@ uint32_t opts; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; -static struct dsk dsk; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; @@ -569,22 +568,22 @@ parse_cmds(char *cmdstr, int *dskupdated) arg[1] != dev_nm[i][1]; i++) if (i == NDEV - 1) return (-1); - dsk.type = i; + gdsk.dsk.type = i; arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != 'p' || dsk.unit > 9) + gdsk.dsk.unit = *arg - '0'; + if (arg[1] != 'p' || gdsk.dsk.unit > 9) return (-1); arg += 2; - dsk.part = *arg - '0'; - if (dsk.part < 1 || dsk.part > 9) + gdsk.dsk.part = *arg - '0'; + if (gdsk.dsk.part < 1 || gdsk.dsk.part > 9) return (-1); arg++; if (arg[0] != ')') return (-1); arg++; if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD + drv = gdsk.dsk.unit; + gdsk.dsk.drive = (gdsk.dsk.type <= TYPE_MAXHARD ? DRV_HARD : 0) + drv; *dskupdated = 1; } From owner-svn-src-head@freebsd.org Tue Nov 27 16:20:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB07115274A; Tue, 27 Nov 2018 16:20:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id B755D83D76; Tue, 27 Nov 2018 16:19:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id DAB2E42BBDC; Wed, 28 Nov 2018 03:19:47 +1100 (AEDT) Date: Wed, 28 Nov 2018 03:19:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eugene Grosbein cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341006 - head/sys/netgraph In-Reply-To: <201811270405.wAR45cmZ044829@repo.freebsd.org> Message-ID: <20181128023031.H1503@besplex.bde.org> References: <201811270405.wAR45cmZ044829@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=_EFF_ZO1fJkJcZhbPGAA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: B755D83D76 X-Spamd-Result: default: False [-2.14 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.85)[-0.852,0]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[optusnet.com.au]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; DMARC_NA(0.00)[optusnet.com.au]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.967,0]; IP_SCORE(-0.01)[country: AU(-0.04)]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.00)[-0.001,0]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[246.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:20:02 -0000 On Tue, 27 Nov 2018, Eugene Grosbein wrote: > Log: > ng_source(4): correction after the change r340617 > > tv_usec has "long" type for all architecture in FreeBSD > and follows __LP64__. However, this is not true for tv_sec > that has "time_t" type. tv_usec actually has type suseconds_t. suseconds_t happens to be long on all arches in FreeBSD (it is declared in an MI header without any ifdef). Hard-coding it as long here and elsewhere defeats the reason for existence of suseconds_t. The most common hard-coding of it is probably using %ld format for printing it. However, the existence of suseconds_t is a historical bug (in POSIX). This bug was missing in POSIX Issue 4. tv_usec just had type long then. POSIX added suseconds_t and hangecd the type of tv_usec to suseconds_t in Issue 5, so now almost no one knows the type of tv_usec and messy ifdefs like the one here (but messier) are needed to parse and print it portably. I think suseconds_t came from SysV or XSI. BSD just used long before it was broken to POSIX spec. Similar typedefs and messy ifdefs are unfortunately needed for too many other POSIX types, but tv_usec is too limited to need the complications. This bug is still missing for tv_nsec. I think timespecs were a POSIX invention in 1988. POSIX introduced them and intentionally left out timevals designed timespecs a bit better than timevals since timevals are too limited and unportable. Unfortunately, many older APIs like select() were never updated to the 1980's, so when POSIX started supporting these in 2001 it had to standardize timevals, so now timevals are ever further from going away than in 1988. long for tv_usec and tv_nsec is a smaller historical bug. BSD carefully used long for too many integer types as late as 4.4BSD-Lite1, because very old versions of BSD (2.x?) supported 16-bit ints, and 16-bits is is often too small, and typedef poisoning wasn't very common in merely old versions. Also, support for ABIs was weak. NetBSD changed many of these longs to int or int32_t to support alpha and/or ABIs, and Lite2 obtained these changes from somewhere near NetBSD, and FreeBSD obtained them from Lite2 in 1996. E.g., pid_t went from long in Lite1 to int32_t in Lite2. long was far too large for pid_t and most other types if long is 64 bits or larger, and using it in structs gives unnecessarily MD ABIs. In modern POSIX, int must be at least 32 bits so most types can be plain int, but historical mistakes and ABIs prevent changing the excessively typedefed APIs. So on 64-bit arches, lots of space is wasted not just for 64-bit time_t, but also for 64-bit longs for tv_[nu]sec. 32-bit tv_[nu]sec wouldn't on 64-bit arches since the struct would be padded from 96 to 128 bits. On 32-bit arches with 64-bit time_t, the longs give a natural struct size of 96i bits, and this might be padded to 128 bits (wasting space), or left unpadded (giving worse alignment). Bruce From owner-svn-src-head@freebsd.org Tue Nov 27 16:23:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 961D11152B11; Tue, 27 Nov 2018 16:23:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E52E843AF; Tue, 27 Nov 2018 16:23:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ED831DCA7; Tue, 27 Nov 2018 16:23:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARGNHfQ028851; Tue, 27 Nov 2018 16:23:17 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGNHb5028850; Tue, 27 Nov 2018 16:23:17 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811271623.wARGNHb5028850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 27 Nov 2018 16:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341072 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 341072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E52E843AF X-Spamd-Result: default: False [1.15 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.038,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_LONG(0.47)[0.465,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:23:18 -0000 Author: des Date: Tue Nov 27 16:23:17 2018 New Revision: 341072 URL: https://svnweb.freebsd.org/changeset/base/341072 Log: When deciding whether to send the complete URL or just the document part, we were looking at the original URL rather than the one we were currently processing. This meant that if we were trying to retrieve an HTTP URL but were redirected to an HTTPS URL, and HTTPS proxying was enabled, we would send an invalid request and most likely get garbage back. MFC after: 3 days Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Tue Nov 27 16:16:38 2018 (r341071) +++ head/lib/libfetch/http.c Tue Nov 27 16:23:17 2018 (r341072) @@ -1617,7 +1617,7 @@ http_request_body(struct url *URL, const char *op, str if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl && strcmp(URL->scheme, SCHEME_HTTPS) != 0) { + if (purl && strcmp(url->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else { From owner-svn-src-head@freebsd.org Tue Nov 27 16:51:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E3F1153B0F; Tue, 27 Nov 2018 16:51:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF10185A41; Tue, 27 Nov 2018 16:51:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A02621E030; Tue, 27 Nov 2018 16:51:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARGp1gb040950; Tue, 27 Nov 2018 16:51:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARGp1RZ040949; Tue, 27 Nov 2018 16:51:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811271651.wARGp1RZ040949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 27 Nov 2018 16:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341073 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 341073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF10185A41 X-Spamd-Result: default: False [1.15 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.04)[0.038,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 16:51:02 -0000 Author: ae Date: Tue Nov 27 16:51:01 2018 New Revision: 341073 URL: https://svnweb.freebsd.org/changeset/base/341073 Log: Do not limit the mbuf queue length for keepalive packets. It was unlimited before overhaul, and one user reported that this limit can be reached easily. PR: 233562 MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Tue Nov 27 16:23:17 2018 (r341072) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Tue Nov 27 16:51:01 2018 (r341073) @@ -349,7 +349,6 @@ VNET_DEFINE_STATIC(uint32_t, dyn_short_lifetime); * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower * than dyn_keepalive_period. */ -#define DYN_KEEPALIVE_MAXQ 512 VNET_DEFINE_STATIC(uint32_t, dyn_keepalive_interval); VNET_DEFINE_STATIC(uint32_t, dyn_keepalive_period); VNET_DEFINE_STATIC(uint32_t, dyn_keepalive); @@ -2351,7 +2350,7 @@ dyn_send_keepalive_ipv4(struct ip_fw_chain *chain) struct dyn_ipv4_state *s; uint32_t bucket; - mbufq_init(&q, DYN_KEEPALIVE_MAXQ); + mbufq_init(&q, INT_MAX); IPFW_UH_RLOCK(chain); /* * It is safe to not use hazard pointer and just do lockless @@ -2458,7 +2457,7 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain) struct dyn_ipv6_state *s; uint32_t bucket; - mbufq_init(&q, DYN_KEEPALIVE_MAXQ); + mbufq_init(&q, INT_MAX); IPFW_UH_RLOCK(chain); /* * It is safe to not use hazard pointer and just do lockless From owner-svn-src-head@freebsd.org Tue Nov 27 17:51:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29A01115651F; Tue, 27 Nov 2018 17:51:52 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFFF98AC56; Tue, 27 Nov 2018 17:51:51 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A10481EBE0; Tue, 27 Nov 2018 17:51:51 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARHppiP077621; Tue, 27 Nov 2018 17:51:51 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARHpoPt077616; Tue, 27 Nov 2018 17:51:50 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201811271751.wARHpoPt077616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Tue, 27 Nov 2018 17:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341084 - in head: sys/kern sys/sys usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head: sys/kern sys/sys usr.sbin/jail X-SVN-Commit-Revision: 341084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFFF98AC56 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.73)[0.726,0]; NEURAL_SPAM_SHORT(0.12)[0.118,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:51:52 -0000 Author: jamie Date: Tue Nov 27 17:51:50 2018 New Revision: 341084 URL: https://svnweb.freebsd.org/changeset/base/341084 Log: In hardened systems, where the security.bsd.unprivileged_proc_debug sysctl node is set, allow setting security.bsd.unprivileged_proc_debug per-jail. In part, this is needed to create jails in which the Address Sanitizer (ASAN) fully works as ASAN utilizes libkvm to inspect the virtual address space. Instead of having to allow unprivileged process debugging for the entire system, allow setting it on a per-jail basis. The sysctl node is still security.bsd.unprivileged_proc_debug and the jail(8) param is allow.unprivileged_proc_debug. The sysctl code is now a sysctl proc rather than a sysctl int. This allows us to determine setting the flag for the corresponding jail (or prison0). As part of the change, the dynamic allow.* API needed to be modified to take into account pr_allow flags which may now be disabled in prison0. This prevents conflicts with new pr_allow flags (like that of vmm(4)) that are added (and removed) dynamically. Also teach the jail creation KPI to allow differences for certain pr_allow flags between the parent and child jail. This can happen when unprivileged process debugging is disabled in the parent prison, but enabled in the child. Submitted by: Shawn Webb Obtained from: HardenedBSD (45b3625edba0f73b3e3890b1ec3d0d1e95fd47e1, deba0b5078cef0faae43cbdafed3035b16587afc, ab21eeb3b4c72f2500987c96ff603ccf3b6e7de8) Relnotes: yes Sponsored by: HardenedBSD and G2, Inc Differential Revision: https://reviews.freebsd.org/D18319 Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_priv.c head/sys/kern/kern_prot.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Nov 27 17:10:00 2018 (r341083) +++ head/sys/kern/kern_jail.c Tue Nov 27 17:51:50 2018 (r341084) @@ -194,10 +194,14 @@ static struct bool_flags pr_flag_allow[NBBY * NBPW] = {"allow.reserved_ports", "allow.noreserved_ports", PR_ALLOW_RESERVED_PORTS}, {"allow.read_msgbuf", "allow.noread_msgbuf", PR_ALLOW_READ_MSGBUF}, + {"allow.unprivileged_proc_debug", "allow.nounprivileged_proc_debug", + PR_ALLOW_UNPRIV_DEBUG}, }; const size_t pr_flag_allow_size = sizeof(pr_flag_allow); -#define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | PR_ALLOW_RESERVED_PORTS) +#define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | \ + PR_ALLOW_RESERVED_PORTS | \ + PR_ALLOW_UNPRIV_DEBUG) #define JAIL_DEFAULT_ENFORCE_STATFS 2 #define JAIL_DEFAULT_DEVFS_RSNUM 0 static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; @@ -498,6 +502,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, i int ip6s, redo_ip6; #endif uint64_t pr_allow, ch_allow, pr_flags, ch_flags; + uint64_t pr_allow_diff; unsigned tallow; char numbuf[12]; @@ -1530,7 +1535,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, i } } } - if (pr_allow & ~ppr->pr_allow) { + pr_allow_diff = pr_allow & ~ppr->pr_allow; + if (pr_allow_diff & ~PR_ALLOW_DIFFERENCES) { error = EPERM; goto done_deref_locked; } @@ -3783,6 +3789,8 @@ SYSCTL_JAIL_PARAM(_allow, reserved_ports, CTLTYPE_INT "B", "Jail may bind sockets to reserved ports"); SYSCTL_JAIL_PARAM(_allow, read_msgbuf, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may read the kernel message buffer"); +SYSCTL_JAIL_PARAM(_allow, unprivileged_proc_debug, CTLTYPE_INT | CTLFLAG_RW, + "B", "Unprivileged processes may use process debugging facilities"); SYSCTL_JAIL_PARAM_SUBNODE(allow, mount, "Jail mount/unmount permission flags"); SYSCTL_JAIL_PARAM(_allow_mount, , CTLTYPE_INT | CTLFLAG_RW, @@ -3834,10 +3842,16 @@ prison_add_allow(const char *prefix, const char *name, * Find a free bit in prison0's pr_allow, failing if there are none * (which shouldn't happen as long as we keep track of how many * potential dynamic flags exist). + * + * Due to per-jail unprivileged process debugging support + * using pr_allow, also verify against PR_ALLOW_ALL_STATIC. + * prison0 may have unprivileged process debugging unset. */ for (allow_flag = 1;; allow_flag <<= 1) { if (allow_flag == 0) goto no_add; + if (allow_flag & PR_ALLOW_ALL_STATIC) + continue; if ((prison0.pr_allow & allow_flag) == 0) break; } Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Tue Nov 27 17:10:00 2018 (r341083) +++ head/sys/kern/kern_priv.c Tue Nov 27 17:51:50 2018 (r341084) @@ -166,6 +166,18 @@ priv_check_cred(struct ucred *cred, int priv, int flag } /* + * Allow unprivileged process debugging on a per-jail basis. + * Do this here instead of prison_priv_check(), so it can also + * apply to prison0. + */ + if (priv == PRIV_DEBUG_UNPRIV) { + if (prison_allow(cred, PR_ALLOW_UNPRIV_DEBUG)) { + error = 0; + goto out; + } + } + + /* * Now check with MAC, if enabled, to see if a policy module grants * privilege. */ Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Tue Nov 27 17:10:00 2018 (r341083) +++ head/sys/kern/kern_prot.c Tue Nov 27 17:51:50 2018 (r341084) @@ -1630,19 +1630,47 @@ p_cansched(struct thread *td, struct proc *p) } /* + * Handle getting or setting the prison's unprivileged_proc_debug + * value. + */ +static int +sysctl_unprivileged_proc_debug(SYSCTL_HANDLER_ARGS) +{ + struct prison *pr; + int error, val; + + val = prison_allow(req->td->td_ucred, PR_ALLOW_UNPRIV_DEBUG) != 0; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + pr = req->td->td_ucred->cr_prison; + mtx_lock(&pr->pr_mtx); + switch (val) { + case 0: + pr->pr_allow &= ~(PR_ALLOW_UNPRIV_DEBUG); + break; + case 1: + pr->pr_allow |= PR_ALLOW_UNPRIV_DEBUG; + break; + default: + error = EINVAL; + } + mtx_unlock(&pr->pr_mtx); + + return (error); +} + +/* * The 'unprivileged_proc_debug' flag may be used to disable a variety of * unprivileged inter-process debugging services, including some procfs * functionality, ptrace(), and ktrace(). In the past, inter-process * debugging has been involved in a variety of security problems, and sites * not requiring the service might choose to disable it when hardening * systems. - * - * XXX: Should modifying and reading this variable require locking? - * XXX: data declarations should be together near the beginning of the file. */ -static int unprivileged_proc_debug = 1; -SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_proc_debug, CTLFLAG_RW, - &unprivileged_proc_debug, 0, +SYSCTL_PROC(_security_bsd, OID_AUTO, unprivileged_proc_debug, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_SECURE, 0, 0, + sysctl_unprivileged_proc_debug, "I", "Unprivileged processes may use process debugging facilities"); /*- @@ -1660,11 +1688,8 @@ p_candebug(struct thread *td, struct proc *p) KASSERT(td == curthread, ("%s: td not curthread", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); - if (!unprivileged_proc_debug) { - error = priv_check(td, PRIV_DEBUG_UNPRIV); - if (error) - return (error); - } + if ((error = priv_check(td, PRIV_DEBUG_UNPRIV))) + return (error); if (td->td_proc == p) return (0); if ((error = prison_check(td->td_ucred, p->p_ucred))) Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Tue Nov 27 17:10:00 2018 (r341083) +++ head/sys/sys/jail.h Tue Nov 27 17:51:50 2018 (r341084) @@ -229,9 +229,16 @@ struct prison_racct { #define PR_ALLOW_SOCKET_AF 0x00000040 #define PR_ALLOW_MLOCK 0x00000080 #define PR_ALLOW_READ_MSGBUF 0x00000100 +#define PR_ALLOW_UNPRIV_DEBUG 0x00000200 #define PR_ALLOW_RESERVED_PORTS 0x00008000 #define PR_ALLOW_KMEM_ACCESS 0x00010000 /* reserved, not used yet */ -#define PR_ALLOW_ALL_STATIC 0x000181ff +#define PR_ALLOW_ALL_STATIC 0x000183ff + +/* + * PR_ALLOW_DIFFERENCES determines which flags are able to be + * different between the parent and child jail upon creation. + */ +#define PR_ALLOW_DIFFERENCES (PR_ALLOW_UNPRIV_DEBUG) /* * OSD methods Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Tue Nov 27 17:10:00 2018 (r341083) +++ head/usr.sbin/jail/jail.8 Tue Nov 27 17:51:50 2018 (r341084) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2018 +.Dd November 27, 2018 .Dt JAIL 8 .Os .Sh NAME @@ -582,6 +582,8 @@ memory subject to and resource limits. .It Va allow.reserved_ports The jail root may bind to ports lower than 1024. +.It Va allow.unprivileged_proc_debug +Unprivileged processes in the jail may use debugging facilities. .El .El .Pp From owner-svn-src-head@freebsd.org Tue Nov 27 18:35:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150EA1157A04; Tue, 27 Nov 2018 18:35:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 688FD8C9AA; Tue, 27 Nov 2018 18:35:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f51.google.com with SMTP id u19so17801995ioc.2; Tue, 27 Nov 2018 10:35:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=mw8FawHzWYmqsnJ+2gcDfifCZJLvu2Nf0Xh/zLPTdek=; b=WCcshwAMHi8GkfDxRuITyXBvZq2ccmnfoJjwLpNS7fJ+Q5e+6R3/tczszqPLrQpatK eI218W0fsxpbas0F4bThRgMeC1N8CU9+ovp82I1Vc9Q5tbj2GNFpqxJ58pVDPCcPwsu7 I+LmBZwOatDcI33J25TCpaNlIGSiPQG+EfhKbhrHpSC6kaQ/F+NGNSi9SLAVzhRDEmZL w3PfXVsTmxrOKNULBknkvflYR2UJFCR0oaFcDDwfEQT87ohKZQFCfSWDDw4Dyi+IXLrD lxq9KYNeubzNgvmKo3EY5OQmUJO14Z+GFyVG8+16EPllcjXwDzVXOUxpdkWMaxV4mP7Z FDBA== X-Gm-Message-State: AA+aEWY4va1eGZ+IXaSaQ7uaX+DSP7YpTHRo+UBDPWs0sArdOE2E4Gs/ DGGHUem+d8m7xzZx797vS+s33sO7 X-Google-Smtp-Source: AFSGD/VMts5we0V1uDyBbublL8YvJh/OJ6kqrQZZv8x2ABYm45Uge10wjjJYo+2yI61S9yWIyqLjsw== X-Received: by 2002:a5e:c107:: with SMTP id v7mr6526613iol.155.1543343698201; Tue, 27 Nov 2018 10:34:58 -0800 (PST) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com. [209.85.166.51]) by smtp.gmail.com with ESMTPSA id p74sm1625285iod.14.2018.11.27.10.34.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 10:34:58 -0800 (PST) Received: by mail-io1-f51.google.com with SMTP id r200so17781250iod.11; Tue, 27 Nov 2018 10:34:57 -0800 (PST) X-Received: by 2002:a6b:6119:: with SMTP id v25mr27077137iob.107.1543343697354; Tue, 27 Nov 2018 10:34:57 -0800 (PST) MIME-Version: 1.0 References: <201811271512.wARFCYmP092105@repo.freebsd.org> In-Reply-To: <201811271512.wARFCYmP092105@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 27 Nov 2018 10:34:46 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r341068 - head/tests/sys/kqueue/libkqueue To: dab@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 688FD8C9AA X-Spamd-Result: default: False [-5.92 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-2.92)[ip: (-9.63), ipnet: 209.85.128.0/17(-3.49), asn: 15169(-1.38), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; RCVD_IN_DNSWL_NONE(0.00)[51.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 18:35:06 -0000 As long as we were correcting indentation whitespace, it seems like it would have been good to go to tabs, per style(9), instead of spaces. Or are these considered contrib code from NetBSD? Best, Conrad On Tue, Nov 27, 2018 at 7:12 AM David Bright wrote: > > Author: dab > Date: Tue Nov 27 15:12:34 2018 > New Revision: 341068 > URL: https://svnweb.freebsd.org/changeset/base/341068 > > Log: > Make whitespace more consistent in libkqueue tests. > > After r337820, which "corrected" some spaces-instead-of-tab whitespace > issues in the libkqueue tests, jmg@ pointed out that these files were > originally space-based, not tab-spaced, and so the correction should > have been to get rid of the tabs that had been introduced in previous > changes, not the spaces. This change does that. This is a whitespace > only change; no functional change is intended. > > Reported by: jmg@ > MFC after: 3 days > Sponsored by: Dell EMC Isilon > > Modified: > head/tests/sys/kqueue/libkqueue/main.c > head/tests/sys/kqueue/libkqueue/proc.c > head/tests/sys/kqueue/libkqueue/signal.c > head/tests/sys/kqueue/libkqueue/timer.c > head/tests/sys/kqueue/libkqueue/user.c > head/tests/sys/kqueue/libkqueue/vnode.c > > Modified: head/tests/sys/kqueue/libkqueue/main.c > ============================================================================== > --- head/tests/sys/kqueue/libkqueue/main.c Tue Nov 27 14:58:19 2018 (r341067) > +++ head/tests/sys/kqueue/libkqueue/main.c Tue Nov 27 15:12:34 2018 (r341068) > @@ -85,7 +85,7 @@ kevent_get(int kqfd) > struct kevent *kev; > > if ((kev = calloc(1, sizeof(*kev))) == NULL) > - err(1, "out of memory"); > + err(1, "out of memory"); > > nfds = kevent(kqfd, NULL, 0, kev, 1, NULL); > if (nfds < 1) > @@ -103,7 +103,7 @@ kevent_get_timeout(int kqfd, int seconds) > struct timespec timeout = {seconds, 0}; > > if ((kev = calloc(1, sizeof(*kev))) == NULL) > - err(1, "out of memory"); > + err(1, "out of memory"); > > nfds = kevent(kqfd, NULL, 0, kev, 1, &timeout); > if (nfds < 0) { > @@ -123,10 +123,10 @@ kevent_fflags_dump(struct kevent *kev) > > #define KEVFFL_DUMP(attrib) \ > if (kev->fflags & attrib) \ > - strncat(buf, #attrib" ", 64); > + strncat(buf, #attrib" ", 64); > > if ((buf = calloc(1, 1024)) == NULL) > - abort(); > + abort(); > > /* Not every filter has meaningful fflags */ > if (kev->filter == EVFILT_PROC) { > @@ -160,7 +160,7 @@ kevent_fflags_dump(struct kevent *kev) > #endif > buf[strlen(buf) - 1] = ')'; > } else { > - snprintf(buf, 1024, "fflags = %x", kev->fflags); > + snprintf(buf, 1024, "fflags = %x", kev->fflags); > } > > return (buf); > @@ -173,10 +173,10 @@ kevent_flags_dump(struct kevent *kev) > > #define KEVFL_DUMP(attrib) \ > if (kev->flags & attrib) \ > - strncat(buf, #attrib" ", 64); > + strncat(buf, #attrib" ", 64); > > if ((buf = calloc(1, 1024)) == NULL) > - abort(); > + abort(); > > snprintf(buf, 1024, "flags = %d (", kev->flags); > KEVFL_DUMP(EV_ADD); > @@ -208,17 +208,17 @@ kevent_to_str(struct kevent *kev) > > snprintf(&buf[0], sizeof(buf), > "[ident=%ju, filter=%d, %s, %s, data=%jd, udata=%p, " > - "ext=[%jx %jx %jx %jx]", > + "ext=[%jx %jx %jx %jx]", > (uintmax_t) kev->ident, > kev->filter, > flags_str, > fflags_str, > (uintmax_t)kev->data, > kev->udata, > - (uintmax_t)kev->ext[0], > - (uintmax_t)kev->ext[1], > - (uintmax_t)kev->ext[2], > - (uintmax_t)kev->ext[3]); > + (uintmax_t)kev->ext[0], > + (uintmax_t)kev->ext[1], > + (uintmax_t)kev->ext[2], > + (uintmax_t)kev->ext[3]); > > free(flags_str); > free(fflags_str); > @@ -239,10 +239,10 @@ kevent_add(int kqfd, struct kevent *kev, > > EV_SET(kev, ident, filter, flags, fflags, data, NULL); > if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { > - kev_str = kevent_to_str(kev); > - printf("Unable to add the following kevent:\n%s\n", > - kev_str); > - free(kev_str); > + kev_str = kevent_to_str(kev); > + printf("Unable to add the following kevent:\n%s\n", > + kev_str); > + free(kev_str); > err(1, "kevent(): %s", strerror(errno)); > } > } > @@ -265,12 +265,12 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) > k1->data != k2->data || k1->udata != k2->udata || > k1->ext[0] != k2->ext[0] || k1->ext[1] != k2->ext[1] || > k1->ext[0] != k2->ext[2] || k1->ext[0] != k2->ext[3]) { > - kev1_str = kevent_to_str(k1); > - kev2_str = kevent_to_str(k2); > - printf("kevent_cmp: mismatch:\n %s !=\n %s\n", > - kev1_str, kev2_str); > - free(kev1_str); > - free(kev2_str); > + kev1_str = kevent_to_str(k1); > + kev2_str = kevent_to_str(k2); > + printf("kevent_cmp: mismatch:\n %s !=\n %s\n", > + kev1_str, kev2_str); > + free(kev1_str); > + free(kev2_str); > abort(); > } > } > > Modified: head/tests/sys/kqueue/libkqueue/proc.c > ============================================================================== > --- head/tests/sys/kqueue/libkqueue/proc.c Tue Nov 27 14:58:19 2018 (r341067) > +++ head/tests/sys/kqueue/libkqueue/proc.c Tue Nov 27 15:12:34 2018 (r341068) > @@ -45,7 +45,7 @@ add_and_delete(void) > struct stat s; > if (fstat(kqfd, &s) != -1) > errx(1, "kqueue inherited across fork! (%s() at %s:%d)", > - __func__, __FILE__, __LINE__); > + __func__, __FILE__, __LINE__); > > pause(); > exit(2); > > Modified: head/tests/sys/kqueue/libkqueue/signal.c > ============================================================================== > --- head/tests/sys/kqueue/libkqueue/signal.c Tue Nov 27 14:58:19 2018 (r341067) > +++ head/tests/sys/kqueue/libkqueue/signal.c Tue Nov 27 15:12:34 2018 (r341068) > @@ -188,12 +188,12 @@ test_kevent_signal_oneshot(void) > void > test_evfilt_signal() > { > - kqfd = kqueue(); > - test_kevent_signal_add(); > - test_kevent_signal_del(); > - test_kevent_signal_get(); > - test_kevent_signal_disable(); > - test_kevent_signal_enable(); > - test_kevent_signal_oneshot(); > - close(kqfd); > + kqfd = kqueue(); > + test_kevent_signal_add(); > + test_kevent_signal_del(); > + test_kevent_signal_get(); > + test_kevent_signal_disable(); > + test_kevent_signal_enable(); > + test_kevent_signal_oneshot(); > + close(kqfd); > } > > Modified: head/tests/sys/kqueue/libkqueue/timer.c > ============================================================================== > --- head/tests/sys/kqueue/libkqueue/timer.c Tue Nov 27 14:58:19 2018 (r341067) > +++ head/tests/sys/kqueue/libkqueue/timer.c Tue Nov 27 15:12:34 2018 (r341068) > @@ -34,11 +34,10 @@ int kqfd; > static long > now(void) > { > - > - struct timeval tv; > + struct timeval tv; > > - gettimeofday(&tv, NULL); > - return SEC_TO_US(tv.tv_sec) + tv.tv_usec; > + gettimeofday(&tv, NULL); > + return SEC_TO_US(tv.tv_sec) + tv.tv_usec; > } > > /* Sleep for a given number of milliseconds. The timeout is assumed to > @@ -47,13 +46,12 @@ now(void) > void > mssleep(int t) > { > + struct timespec stime = { > + .tv_sec = 0, > + .tv_nsec = US_TO_NS(MS_TO_US(t)), > + }; > > - struct timespec stime = { > - .tv_sec = 0, > - .tv_nsec = US_TO_NS(MS_TO_US(t)), > - }; > - > - nanosleep(&stime, NULL); > + nanosleep(&stime, NULL); > } > > /* Sleep for a given number of microseconds. The timeout is assumed to > @@ -62,13 +60,12 @@ mssleep(int t) > void > ussleep(int t) > { > + struct timespec stime = { > + .tv_sec = 0, > + .tv_nsec = US_TO_NS(t), > + }; > > - struct timespec stime = { > - .tv_sec = 0, > - .tv_nsec = US_TO_NS(t), > - }; > - > - nanosleep(&stime, NULL); > + nanosleep(&stime, NULL); > } > > void > @@ -241,7 +238,7 @@ test_abstime(void) > kevent_cmp(&kev, kevent_get(kqfd)); > stop = time(NULL); > if (stop < start + timeout) > - err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + timeout)); > + err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + timeout)); > > /* Check if the event occurs again */ > sleep(3); > @@ -264,16 +261,16 @@ test_update(void) > > /* First set the timer to 1 second */ > EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, > - NOTE_USECONDS, SEC_TO_US(1), (void *)1); > + NOTE_USECONDS, SEC_TO_US(1), (void *)1); > start = now(); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Now reduce the timer to 1 ms */ > EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, > - NOTE_USECONDS, MS_TO_US(1), (void *)2); > + NOTE_USECONDS, MS_TO_US(1), (void *)2); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Wait for the event */ > kev.flags |= EV_CLEAR; > @@ -288,9 +285,9 @@ test_update(void) > */ > printf("timer expired after %ld us\n", elapsed); > if (elapsed < MS_TO_US(1)) > - errx(1, "early timer expiration: %ld us", elapsed); > + errx(1, "early timer expiration: %ld us", elapsed); > if (elapsed > SEC_TO_US(1)) > - errx(1, "late timer expiration: %ld us", elapsed); > + errx(1, "late timer expiration: %ld us", elapsed); > > success(); > } > @@ -309,9 +306,9 @@ test_update_equal(void) > > /* First set the timer to 1 ms */ > EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, > - NOTE_USECONDS, MS_TO_US(1), NULL); > + NOTE_USECONDS, MS_TO_US(1), NULL); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Sleep for a significant fraction of the timeout. */ > ussleep(600); > @@ -319,7 +316,7 @@ test_update_equal(void) > /* Now re-add the timer with the same parameters */ > start = now(); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Wait for the event */ > kev.flags |= EV_CLEAR; > @@ -334,7 +331,7 @@ test_update_equal(void) > */ > printf("timer expired after %ld us\n", elapsed); > if (elapsed < MS_TO_US(1)) > - errx(1, "early timer expiration: %ld us", elapsed); > + errx(1, "early timer expiration: %ld us", elapsed); > > success(); > } > @@ -353,9 +350,9 @@ test_update_expired(void) > > /* Set the timer to 1ms */ > EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, > - NOTE_USECONDS, MS_TO_US(1), NULL); > + NOTE_USECONDS, MS_TO_US(1), NULL); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Wait for 2 ms to give the timer plenty of time to expire. */ > mssleep(2); > @@ -363,7 +360,7 @@ test_update_expired(void) > /* Now re-add the timer */ > start = now(); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Wait for the event */ > kev.flags |= EV_CLEAR; > @@ -378,7 +375,7 @@ test_update_expired(void) > */ > printf("timer expired after %ld us\n", elapsed); > if (elapsed < MS_TO_US(1)) > - errx(1, "early timer expiration: %ld us", elapsed); > + errx(1, "early timer expiration: %ld us", elapsed); > > /* Make sure the re-added timer does not fire. In other words, > * test that the event received above was the only event from the > @@ -405,7 +402,7 @@ test_update_periodic(void) > > EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(1), NULL); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Retrieve the event */ > kev.flags = EV_ADD | EV_CLEAR; > @@ -420,7 +417,7 @@ test_update_periodic(void) > EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(2), NULL); > start = now(); > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > /* Retrieve the event */ > kev.flags = EV_ADD | EV_CLEAR; > @@ -434,12 +431,12 @@ test_update_periodic(void) > */ > printf("timer expired after %ld us\n", elapsed); > if (elapsed < MS_TO_US(2)) > - errx(1, "early timer expiration: %ld us", elapsed); > + errx(1, "early timer expiration: %ld us", elapsed); > > /* Delete the event */ > kev.flags = EV_DELETE; > if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + err(1, "%s", test_id); > > success(); > } > @@ -467,46 +464,46 @@ test_update_timing(void) > * received is from the update and not the original timer add. > */ > for (sleeptime = MIN_SLEEP, iteration = 1; > - sleeptime < MAX_SLEEP; > - ++sleeptime, ++iteration) { > + sleeptime < MAX_SLEEP; > + ++sleeptime, ++iteration) { > > - /* First set the timer to 1 ms */ > - EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, > - NOTE_USECONDS, MS_TO_US(1), NULL); > - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + /* First set the timer to 1 ms */ > + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, > + NOTE_USECONDS, MS_TO_US(1), NULL); > + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > + err(1, "%s", test_id); > > - /* Delay; the delay ranges from less than to greater than the > - * timer period. > - */ > - ussleep(sleeptime); > + /* Delay; the delay ranges from less than to greater than the > + * timer period. > + */ > + ussleep(sleeptime); > > - /* Now re-add the timer with the same parameters */ > - start = now(); > - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > - err(1, "%s", test_id); > + /* Now re-add the timer with the same parameters */ > + start = now(); > + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) > + err(1, "%s", test_id); > > - /* Wait for the event */ > - kev.flags |= EV_CLEAR; > - kev.fflags &= ~NOTE_USECONDS; > - kev.data = 1; > - kevent_cmp(&kev, kevent_get(kqfd)); > - stop = now(); > - elapsed = stop - start; > + /* Wait for the event */ > + kev.flags |= EV_CLEAR; > + kev.fflags &= ~NOTE_USECONDS; > + kev.data = 1; > + kevent_cmp(&kev, kevent_get(kqfd)); > + stop = now(); > + elapsed = stop - start; > > - /* Check that the timer expired after at least 1 ms. This > - * check is to make sure that the timer re-started and that > - * the event is not from the original add of the timer. > - */ > - if (elapsed < MS_TO_US(1)) > - errx(1, "early timer expiration: %ld us", elapsed); > + /* Check that the timer expired after at least 1 ms. This > + * check is to make sure that the timer re-started and that > + * the event is not from the original add of the timer. > + */ > + if (elapsed < MS_TO_US(1)) > + errx(1, "early timer expiration: %ld us", elapsed); > > - /* Make sure the re-added timer does not fire. In other words, > - * test that the event received above was the only event from > - * the add and re-add of the timer. > - */ > - mssleep(2); > - test_no_kevents_quietly(); > + /* Make sure the re-added timer does not fire. In other words, > + * test that the event received above was the only event from > + * the add and re-add of the timer. > + */ > + mssleep(2); > + test_no_kevents_quietly(); > } > > success(); > @@ -515,18 +512,18 @@ test_update_timing(void) > void > test_evfilt_timer() > { > - kqfd = kqueue(); > - test_kevent_timer_add(); > - test_kevent_timer_del(); > - test_kevent_timer_get(); > - test_oneshot(); > - test_periodic(); > - test_abstime(); > - test_update(); > - test_update_equal(); > - test_update_expired(); > - test_update_timing(); > - test_update_periodic(); > - disable_and_enable(); > - close(kqfd); > + kqfd = kqueue(); > + test_kevent_timer_add(); > + test_kevent_timer_del(); > + test_kevent_timer_get(); > + test_oneshot(); > + test_periodic(); > + test_abstime(); > + test_update(); > + test_update_equal(); > + test_update_expired(); > + test_update_timing(); > + test_update_periodic(); > + disable_and_enable(); > + close(kqfd); > } > > Modified: head/tests/sys/kqueue/libkqueue/user.c > ============================================================================== > --- head/tests/sys/kqueue/libkqueue/user.c Tue Nov 27 14:58:19 2018 (r341067) > +++ head/tests/sys/kqueue/libkqueue/user.c Tue Nov 27 15:12:34 2018 (r341068) > @@ -117,7 +117,7 @@ oneshot(void) > void > test_evfilt_user() > { > - kqfd = kqueue(); > + kqfd = kqueue(); > > add_and_delete(); > event_wait(); > @@ -125,5 +125,5 @@ test_evfilt_user() > oneshot(); > /* TODO: try different fflags operations */ > > - close(kqfd); > + close(kqfd); > } > > Modified: head/tests/sys/kqueue/libkqueue/vnode.c > ============================================================================== > --- head/tests/sys/kqueue/libkqueue/vnode.c Tue Nov 27 14:58:19 2018 (r341067) > +++ head/tests/sys/kqueue/libkqueue/vnode.c Tue Nov 27 15:12:34 2018 (r341068) > @@ -251,16 +251,16 @@ test_kevent_vnode_dispatch(void) > void > test_evfilt_vnode() > { > - kqfd = kqueue(); > - test_kevent_vnode_add(); > - test_kevent_vnode_del(); > - test_kevent_vnode_disable_and_enable(); > + kqfd = kqueue(); > + test_kevent_vnode_add(); > + test_kevent_vnode_del(); > + test_kevent_vnode_disable_and_enable(); > #if HAVE_EV_DISPATCH > - test_kevent_vnode_dispatch(); > + test_kevent_vnode_dispatch(); > #endif > - test_kevent_vnode_note_write(); > - test_kevent_vnode_note_attrib(); > - test_kevent_vnode_note_rename(); > - test_kevent_vnode_note_delete(); > - close(kqfd); > + test_kevent_vnode_note_write(); > + test_kevent_vnode_note_attrib(); > + test_kevent_vnode_note_rename(); > + test_kevent_vnode_note_delete(); > + close(kqfd); > } > From owner-svn-src-head@freebsd.org Tue Nov 27 19:00:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 921A311582E1; Tue, 27 Nov 2018 19:00:13 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D86698D79F; Tue, 27 Nov 2018 19:00:12 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: by mail-qk1-x729.google.com with SMTP id y78so4494404qka.12; Tue, 27 Nov 2018 11:00:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:to:cc:references:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3xfpRGeVij1DePzKHWbKrKnAsZHtY1sPFGNudFvSvaA=; b=KZd/e+TqwVduqHqXzoBuRoLrDjFQSZcQbqreTpfF1cG4DzYTMmUqrIn+ANAKguDvvr AiVHj2HeGXzjU7Ljiltd3afkJ0bp9fR7BMTMWqTjDpi35WIjNcN8rLxPWjQGy9kK5Ist RucP9JqOqGvW7SA3b1Q0y+w7Maam8ZiRAivzLCrqN6ih6TYj8oPHxdeSN5aokYBCcwXx 7EY1wIItShdNH9vp5b8jIvGQ+e+7EgC8PryBsks+jnwCnP+kUuys1mHStISTYKJAoRLI fiTsj1TqzLNJ3RU6BSAP97PfdR94lsLc4yHXfli5o7kY9vX3Hg1kKgwhHIiLN5h5+p1j FpuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:subject:to:cc:references:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=3xfpRGeVij1DePzKHWbKrKnAsZHtY1sPFGNudFvSvaA=; b=XJv+8q38uotIOqrDquSDu+0j7OL0sZkcMBhdLN6A2uX6gbzaS/Z+tYdSZkljnftUPX wdbdUOXplvztvPDP1wMq5RqMfZoLZTfX3gFtKodO5ZDKG5/uxG9GVHQ6j+1GCeHGbTaQ x8WHJEdqmXOS9F6iVXxzEyrABGEcYK5WCWMMRzvzFzTjH9QdwgaTG95dOW4I4V63TJVF YdWgoRz3jBdmiD92bvtq8r+tOoZbYga8mYCtswPwX43NEpHRaiIlWN7b93CO6glPiqqY cpYIcbg2o+sua0mSQ6MXEudiX2JPYcOEoA/zBtTolklNbkaAnqXbASQarjvd7spuCBcu VmDg== X-Gm-Message-State: AA+aEWZObguAES8N9MRiqwJUeb+L9Ge5Slxnpq1kCNlGDH3haugWmwWW KQi9gKXM1wGRmhimmFFlB06Yw/57 X-Google-Smtp-Source: AFSGD/WrUL5vPbbRUbopYFQtSpVXFkVPIPmGFVCoTs0HZ6r2ix28r1h9eMwifR57r5FH961mQ2LRXg== X-Received: by 2002:a37:bb82:: with SMTP id l124mr30434288qkf.188.1543345212183; Tue, 27 Nov 2018 11:00:12 -0800 (PST) Received: from dab-xps-13-9370.localdomain (c-76-104-203-143.hsd1.wa.comcast.net. [76.104.203.143]) by smtp.gmail.com with ESMTPSA id t40sm2794845qth.46.2018.11.27.11.00.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 11:00:11 -0800 (PST) Sender: David Bright From: "David A. Bright" X-Google-Original-From: "David A. Bright" Subject: Re: svn commit: r341068 - head/tests/sys/kqueue/libkqueue To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811271512.wARFCYmP092105@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=dab@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFgqQsIBCADfDUZ79qW2MKVRQl9l9zMYzppdHn+eS7KGjUP9hjmYUuX3vM0Sc5DlJ9Py 59Byucg8zo6eow1iv6NdiEPuUEYB2ujDP/kbmC397zEt6p9ldlL4PXXSJumpdZCzwz4ACYB5 ke7OCljNqbigzoZgX5DXjyjx87NfG6eWkbnEweDPmae7DGj5bwQmJPoTqvJR7Ot/R/73ix8l hph1vdl83Iqu+IDVdlXTI2Afz4UaCRdfDiXgMQIo/HABXJ90+TXG/vH37Jb0kBflql9sEaUs CcTvMrye0Wjgv3VSPZm3ZEgmR7UKR71p2MJVlVVZUH3FHQ2jDqKpCMi7F3ERlvRDktm/ABEB AAHNHkRhdmlkIEJyaWdodCA8ZGFiQGZyZWVic2Qub3JnPsLAfQQTAQoAJwUCWCpCwgIbAwUJ BaOagAULCQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRAzeMsxoQO+aqagCADDt4FbZBz3VFev TEtAjuyzCDPmPom1MBwsh6KB2J84wKOsXPmZ7vqaZ2G70fCPNowqmHq56cAbp0BD1Lf6gD+3 imeacKc/E6n+L49LOhOtQ8EUyHs/nAUmlE1PrOS1w5wmCgRjPXa5k+zxj/YMsAEFdMn6UzOl 5MIJN/zhBB5tU2bkP5hF4rVvpQ1zlnSldoBLfPlG/w1RzvOSJfunZUTSNVrKYlSjEQ7q56ud xKoLPEdr+X8kqwZilh5WBiTt7mMw7lrP6dMV/GGmDg893J6conQ1l2RN6Un1gKlc3rgdz3sh ncr786WF3cV2dFSIrO/Pn3iNRR3uJouRLdLhU0kMzsBNBFgqQsIBCAC5ABwcVerpyp5NzHBD FSbxEyPab6HFH1E4zksEGyeypU8UW5acc2ko5Ovz7CE0n21uhBtIt/Lz5Koxz0LSqqnk9jIQ L/4XVvne+8YnT+Tf9DZv9We5K0tFit/DFgCzIpxacoxLGBRNSkSzFrAepvVinTk905igdYZY fxtHrAREU4BdqBMQtbgGaewHtOLlRRr+N4wkAZlJLa7RaLn5s/EakpmCM1eR8z0fOBNJSXlW Ozqh1cvwWZ00qj0rYXwXu0fgzpREmJFS01GByFuB4xDyqfAoynxKNBJH/qAcJTp7jST8PLWe 3Tblm4acsIAPHUcABgMnZYdMQnSwwa9/W1DlABEBAAHCwGUEGAEKAA8FAlgqQsICGwwFCQWj moAACgkQM3jLMaEDvmp8hQgAzKTYmU2cf35NdrtT9C7jBDWSVSDdyKHYSAKoP+vAkC3A1HH6 wohE5JvOZ6245vgBQwFHvzh2v7jDUWmB3CrcSSMUoUIwl15mWlCdCy/C3SAknxQx+zHYmx9v uHPS1yF2l0KPS30Kc1le1GqVYi5wxnWPo+gE3MH4DDh5LdDExYveMuBgybdNxV8Qvr25UghJ HrQCT+FCISo0FActO1Z5HzdOKxQe6KTn+zKr4yKCOe4kb7GUaAX3Pt82J7bMtwRzAKLyjMJV QueL/cr+geerKKrd8FyVAgQMhdBYD3lyjK6nGssgr4Og9+QtsE2RAVH9qqhcF3kI7nxJ7EDb /d3xag== Message-ID: <74f6433b-08ed-c6b3-fd23-8bb97719b56b@FreeBSD.org> Date: Tue, 27 Nov 2018 13:00:07 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D86698D79F X-Spamd-Result: default: False [-2.84 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bright-family.net]; NEURAL_HAM_LONG(-1.00)[-0.995,0]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_TO(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[9.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; IP_SCORE(-0.65)[ipnet: 2607:f8b0::/32(-1.78), asn: 15169(-1.38), country: US(-0.09)]; FORGED_SENDER(0.30)[david@bright-family.net,dab0816@gmail.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[david@bright-family.net,dab0816@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 19:00:13 -0000 On 11/27/18 12:34 PM, Conrad Meyer wrote: > As long as we were correcting indentation whitespace, it seems like it > would have been good to go to tabs, per style(9), instead of spaces. > Or are these considered contrib code from NetBSD? A fair question. I'm not sure whether they should be considered contrib code or not. As the (vast?) majority the tab-using lines were from prior changes that I made, I thought I should return the files to their original spaces-instead-of-tabs, 4-space indent format on the theory that I should have recognized and matched the existing style in the first place. Not to mention that this change was much smaller and less disruptive; if I had converted the files to style(9), most lines in the files would have had to change. -- David Bright dab@FreeBSD.org From owner-svn-src-head@freebsd.org Tue Nov 27 19:50:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 063CB1159F56; Tue, 27 Nov 2018 19:50:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A174E69F37; Tue, 27 Nov 2018 19:50:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 828C11FFB5; Tue, 27 Nov 2018 19:50:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARJowJA041215; Tue, 27 Nov 2018 19:50:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARJowtQ041214; Tue, 27 Nov 2018 19:50:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811271950.wARJowtQ041214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Nov 2018 19:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341094 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 341094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A174E69F37 X-Spamd-Result: default: False [1.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.213,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 19:50:59 -0000 Author: kib Date: Tue Nov 27 19:50:58 2018 New Revision: 341094 URL: https://svnweb.freebsd.org/changeset/base/341094 Log: Improve sigonstack(). Avoid relying on unsigned overflow for the test. Simplify expressions to avoid duplicate check for the range. Style. Add herald comment. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18361 Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Nov 27 19:45:25 2018 (r341093) +++ head/sys/kern/kern_sig.c Tue Nov 27 19:50:58 2018 (r341094) @@ -615,20 +615,25 @@ signotify(struct thread *td) } } +/* + * Returns 1 (true) if altstack is configured for the thread, and the + * passed stack bottom address falls into the altstack range. Handles + * the 43 compat special case where the alt stack size is zero. + */ int sigonstack(size_t sp) { - struct thread *td = curthread; + struct thread *td; - return ((td->td_pflags & TDP_ALTSTACK) ? + td = curthread; + if ((td->td_pflags & TDP_ALTSTACK) == 0) + return (0); #if defined(COMPAT_43) - ((td->td_sigstk.ss_size == 0) ? - (td->td_sigstk.ss_flags & SS_ONSTACK) : - ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size)) -#else - ((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size) + if (td->td_sigstk.ss_size == 0) + return ((td->td_sigstk.ss_flags & SS_ONSTACK) != 0); #endif - : 0); + return (sp >= (size_t)td->td_sigstk.ss_sp && + sp < td->td_sigstk.ss_size + (size_t)td->td_sigstk.ss_sp); } static __inline int From owner-svn-src-head@freebsd.org Tue Nov 27 20:01:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6711D115A644; Tue, 27 Nov 2018 20:01:06 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18B4A6ABAB; Tue, 27 Nov 2018 20:01:06 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED8F520071; Tue, 27 Nov 2018 20:01:05 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARK15jx046726; Tue, 27 Nov 2018 20:01:05 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARK15Js046723; Tue, 27 Nov 2018 20:01:05 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201811272001.wARK15Js046723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 27 Nov 2018 20:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341095 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 341095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18B4A6ABAB X-Spamd-Result: default: False [1.60 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.59)[0.594,0]; NEURAL_SPAM_SHORT(0.24)[0.243,0]; NEURAL_SPAM_MEDIUM(0.76)[0.760,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 20:01:06 -0000 Author: gallatin Date: Tue Nov 27 20:01:05 2018 New Revision: 341095 URL: https://svnweb.freebsd.org/changeset/base/341095 Log: Use busdma unconditionally in iflib - Remove the complex mechanism to choose between using busdma and raw pmap_kextract at runtime. The reduced complexity makes the code easier to read and maintain. - Fix a bug in the small packet receive path where clusters were repeatedly mapped but never unmapped. We now store the cluster's bus address and avoid re-mapping the cluster each time a small packet is received. This patch fixes bugs I've seen where ixl(4) will not even respond to ping without seeing DMAR faults. I see a small improvement (14%) on packet forwarding tests using a Haswell based Xeon E5-2697 v3. Olivier sees a small regression (-3% to -6%) with lower end hardware. Reviewed by: mmacy Not objected to by: sbruno MFC after: 8 weeks Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D17901 Modified: head/sys/net/iflib.c head/sys/net/iflib_private.h Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Nov 27 19:50:58 2018 (r341094) +++ head/sys/net/iflib.c Tue Nov 27 20:01:05 2018 (r341095) @@ -92,15 +92,6 @@ __FBSDID("$FreeBSD$"); #include "ifdi_if.h" -#if defined(__i386__) || defined(__amd64__) -#include -#include -#include -#include -#include -#include -#endif - #ifdef PCI_IOV #include #endif @@ -282,24 +273,16 @@ iflib_get_sctx(if_ctx_t ctx) #define LINK_ACTIVE(ctx) ((ctx)->ifc_link_state == LINK_STATE_UP) #define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF) -#define RX_SW_DESC_MAP_CREATED (1 << 0) -#define TX_SW_DESC_MAP_CREATED (1 << 1) -#define RX_SW_DESC_INUSE (1 << 3) -#define TX_SW_DESC_MAPPED (1 << 4) - -#define M_TOOBIG M_PROTO1 - typedef struct iflib_sw_rx_desc_array { bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ struct mbuf **ifsd_m; /* pkthdr mbufs */ caddr_t *ifsd_cl; /* direct cluster pointer for rx */ - uint8_t *ifsd_flags; + bus_addr_t *ifsd_ba; /* bus addr of cluster for rx */ } iflib_rxsd_array_t; typedef struct iflib_sw_tx_desc_array { bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ struct mbuf **ifsd_m; /* pkthdr mbufs */ - uint8_t *ifsd_flags; } if_txsd_vec_t; @@ -940,9 +923,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl if_ctx_t ctx = ifp->if_softc; iflib_txq_t txq = &ctx->ifc_txqs[kring->ring_id]; - if (txq->ift_sds.ifsd_map) - bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* @@ -1024,9 +1006,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl kring->nr_hwcur = nm_i; /* synchronize the NIC ring */ - if (txq->ift_sds.ifsd_map) - bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* (re)start the tx unit up to slot nic_i (excluded) */ ctx->isc_txd_flush(ctx->ifc_softc, txq->ift_id, nic_i); @@ -1129,9 +1110,8 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl error = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); ring->slot[nm_i].len = error ? 0 : ri.iri_len - crclen; ring->slot[nm_i].flags = 0; - if (fl->ifl_sds.ifsd_map) - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, - fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, + fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); } @@ -1210,9 +1190,6 @@ iflib_netmap_txq_init(if_ctx_t ctx, iflib_txq_t txq) slot = netmap_reset(na, NR_TX, txq->ift_id, 0); if (slot == NULL) return; - if (txq->ift_sds.ifsd_map == NULL) - return; - for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxd[0]; i++) { /* @@ -1657,13 +1634,6 @@ iflib_txsd_alloc(iflib_txq_t txq) goto fail; } - if (!(txq->ift_sds.ifsd_flags = - (uint8_t *) malloc(sizeof(uint8_t) * - scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { - device_printf(dev, "Unable to allocate tx_buffer memory\n"); - err = ENOMEM; - goto fail; - } if (!(txq->ift_sds.ifsd_m = (struct mbuf **) malloc(sizeof(struct mbuf *) * scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { @@ -1673,10 +1643,6 @@ iflib_txsd_alloc(iflib_txq_t txq) } /* Create the descriptor buffer dma maps */ -#if defined(ACPI_DMAR) || (! (defined(__i386__) || defined(__amd64__))) - if ((ctx->ifc_flags & IFC_DMAR) == 0) - return (0); - if (!(txq->ift_sds.ifsd_map = (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); @@ -1691,7 +1657,6 @@ iflib_txsd_alloc(iflib_txq_t txq) goto fail; } } -#endif return (0); fail: /* We free all, it handles case where we are in the middle */ @@ -1729,10 +1694,6 @@ iflib_txq_destroy(iflib_txq_t txq) free(txq->ift_sds.ifsd_m, M_IFLIB); txq->ift_sds.ifsd_m = NULL; } - if (txq->ift_sds.ifsd_flags != NULL) { - free(txq->ift_sds.ifsd_flags, M_IFLIB); - txq->ift_sds.ifsd_flags = NULL; - } if (txq->ift_desc_tag != NULL) { bus_dma_tag_destroy(txq->ift_desc_tag); txq->ift_desc_tag = NULL; @@ -1834,13 +1795,6 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) __func__, err); goto fail; } - if (!(fl->ifl_sds.ifsd_flags = - (uint8_t *) malloc(sizeof(uint8_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { - device_printf(dev, "Unable to allocate tx_buffer memory\n"); - err = ENOMEM; - goto fail; - } if (!(fl->ifl_sds.ifsd_m = (struct mbuf **) malloc(sizeof(struct mbuf *) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { @@ -1856,11 +1810,15 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) goto fail; } - /* Create the descriptor buffer dma maps */ -#if defined(ACPI_DMAR) || (! (defined(__i386__) || defined(__amd64__))) - if ((ctx->ifc_flags & IFC_DMAR) == 0) - continue; + if (!(fl->ifl_sds.ifsd_ba = + (bus_addr_t *) malloc(sizeof(bus_addr_t) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + device_printf(dev, "Unable to allocate rx bus addr memory\n"); + err = ENOMEM; + goto fail; + } + /* Create the descriptor buffer dma maps */ if (!(fl->ifl_sds.ifsd_map = (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); @@ -1875,7 +1833,6 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) goto fail; } } -#endif } return (0); @@ -1905,13 +1862,6 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int cb_arg->nseg = nseg; } - -#ifdef ACPI_DMAR -#define IS_DMAR(ctx) (ctx->ifc_flags & IFC_DMAR) -#else -#define IS_DMAR(ctx) (0) -#endif - /** * rxq_refill - refill an rxq free-buffer list * @ctx: the iflib context @@ -1929,18 +1879,18 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun int pidx = fl->ifl_pidx; caddr_t cl, *sd_cl; struct mbuf **sd_m; - uint8_t *sd_flags; struct if_rxd_update iru; + struct rxq_refill_cb_arg cb_arg; bus_dmamap_t *sd_map; int n, i = 0; - uint64_t bus_addr; + bus_addr_t bus_addr, *sd_ba; int err; qidx_t credits; sd_m = fl->ifl_sds.ifsd_m; sd_map = fl->ifl_sds.ifsd_map; sd_cl = fl->ifl_sds.ifsd_cl; - sd_flags = fl->ifl_sds.ifsd_flags; + sd_ba = fl->ifl_sds.ifsd_ba; idx = pidx; credits = fl->ifl_credits; @@ -1970,35 +1920,15 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun if ((frag_idx < 0) || (frag_idx >= fl->ifl_size)) bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); if ((cl = sd_cl[frag_idx]) == NULL) { - if ((cl = sd_cl[frag_idx] = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) + if ((cl = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) break; -#if MEMORY_LOGGING - fl->ifl_cl_enqueued++; -#endif - } - if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { - break; - } -#if MEMORY_LOGGING - fl->ifl_m_enqueued++; -#endif - DBG_COUNTER_INC(rx_allocs); -#if defined(__i386__) || defined(__amd64__) - if (!IS_DMAR(ctx)) { - bus_addr = pmap_kextract((vm_offset_t)cl); - } else -#endif - { - struct rxq_refill_cb_arg cb_arg; - cb_arg.error = 0; MPASS(sd_map != NULL); - MPASS(sd_map[frag_idx] != NULL); err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[frag_idx], - cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); + cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], - BUS_DMASYNC_PREREAD); + BUS_DMASYNC_PREREAD); if (err != 0 || cb_arg.error) { /* @@ -2006,18 +1936,29 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun */ if (fl->ifl_zone == zone_pack) uma_zfree(fl->ifl_zone, cl); - m_free(m); - n = 0; - goto done; + break; } - bus_addr = cb_arg.seg.ds_addr; + + sd_ba[frag_idx] = bus_addr = cb_arg.seg.ds_addr; + sd_cl[frag_idx] = cl; +#if MEMORY_LOGGING + fl->ifl_cl_enqueued++; +#endif + } else { + bus_addr = sd_ba[frag_idx]; } - bit_set(fl->ifl_rx_bitmap, frag_idx); - sd_flags[frag_idx] |= RX_SW_DESC_INUSE; + bit_set(fl->ifl_rx_bitmap, frag_idx); MPASS(sd_m[frag_idx] == NULL); - sd_cl[frag_idx] = cl; + if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { + break; + } sd_m[frag_idx] = m; +#if MEMORY_LOGGING + fl->ifl_m_enqueued++; +#endif + + DBG_COUNTER_INC(rx_allocs); fl->ifl_rxd_idxs[i] = frag_idx; fl->ifl_bus_addrs[i] = bus_addr; fl->ifl_vm_addrs[i] = cl; @@ -2039,7 +1980,7 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun } } -done: + if (i) { iru.iru_pidx = pidx; iru.iru_count = i; @@ -2053,9 +1994,8 @@ done: else pidx = fl->ifl_pidx - 1; - if (sd_map) - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx); fl->ifl_fragidx = frag_idx; } @@ -2094,24 +2034,20 @@ iflib_fl_bufs_free(iflib_fl_t fl) for (i = 0; i < fl->ifl_size; i++) { struct mbuf **sd_m = &fl->ifl_sds.ifsd_m[i]; - uint8_t *sd_flags = &fl->ifl_sds.ifsd_flags[i]; caddr_t *sd_cl = &fl->ifl_sds.ifsd_cl[i]; - if (*sd_flags & RX_SW_DESC_INUSE) { - if (fl->ifl_sds.ifsd_map != NULL) { - bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; - bus_dmamap_unload(fl->ifl_desc_tag, sd_map); - // XXX: Should this get moved out? - if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) - bus_dmamap_destroy(fl->ifl_desc_tag, sd_map); - } + if (*sd_cl != NULL) { + bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; + bus_dmamap_unload(fl->ifl_desc_tag, sd_map); + if (*sd_cl != NULL) + uma_zfree(fl->ifl_zone, *sd_cl); + // XXX: Should this get moved out? + if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) + bus_dmamap_destroy(fl->ifl_desc_tag, sd_map); if (*sd_m != NULL) { m_init(*sd_m, M_NOWAIT, MT_DATA, 0); uma_zfree(zone_mbuf, *sd_m); } - if (*sd_cl != NULL) - uma_zfree(fl->ifl_zone, *sd_cl); - *sd_flags = 0; } else { MPASS(*sd_cl == NULL); MPASS(*sd_m == NULL); @@ -2125,7 +2061,6 @@ iflib_fl_bufs_free(iflib_fl_t fl) } #ifdef INVARIANTS for (i = 0; i < fl->ifl_size; i++) { - MPASS(fl->ifl_sds.ifsd_flags[i] == 0); MPASS(fl->ifl_sds.ifsd_cl[i] == NULL); MPASS(fl->ifl_sds.ifsd_m[i] == NULL); } @@ -2216,10 +2151,12 @@ iflib_rx_sds_free(iflib_rxq_t rxq) } free(fl->ifl_sds.ifsd_m, M_IFLIB); free(fl->ifl_sds.ifsd_cl, M_IFLIB); + free(fl->ifl_sds.ifsd_ba, M_IFLIB); /* XXX destroy maps first */ free(fl->ifl_sds.ifsd_map, M_IFLIB); fl->ifl_sds.ifsd_m = NULL; fl->ifl_sds.ifsd_cl = NULL; + fl->ifl_sds.ifsd_ba = NULL; fl->ifl_sds.ifsd_map = NULL; } free(rxq->ifr_fl, M_IFLIB); @@ -2488,27 +2425,23 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int #endif if (rxq->ifr_ctx->ifc_flags & IFC_PREFETCH) prefetch_pkts(fl, cidx); - if (fl->ifl_sds.ifsd_map != NULL) { - next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); - prefetch(&fl->ifl_sds.ifsd_map[next]); - map = fl->ifl_sds.ifsd_map[cidx]; - di = fl->ifl_ifdi; - next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); - prefetch(&fl->ifl_sds.ifsd_flags[next]); - bus_dmamap_sync(di->idi_tag, di->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); + prefetch(&fl->ifl_sds.ifsd_map[next]); + map = fl->ifl_sds.ifsd_map[cidx]; + di = fl->ifl_ifdi; + next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); + bus_dmamap_sync(di->idi_tag, di->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* not valid assert if bxe really does SGE from non-contiguous elements */ - MPASS(fl->ifl_cidx == cidx); - if (unload) - bus_dmamap_unload(fl->ifl_desc_tag, map); - } + MPASS(fl->ifl_cidx == cidx); + if (unload) + bus_dmamap_unload(fl->ifl_desc_tag, map); fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); if (__predict_false(fl->ifl_cidx == 0)) fl->ifl_gen = 0; - if (map != NULL) - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bit_clear(fl->ifl_rx_bitmap, cidx); } @@ -3071,147 +3004,24 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, static __noinline struct mbuf * iflib_remove_mbuf(iflib_txq_t txq) { - int ntxd, i, pidx; - struct mbuf *m, *mh, **ifsd_m; + int ntxd, pidx; + struct mbuf *m, **ifsd_m; + bus_dmamap_t *ifsd_map; - pidx = txq->ift_pidx; ifsd_m = txq->ift_sds.ifsd_m; ntxd = txq->ift_size; - mh = m = ifsd_m[pidx]; + pidx = txq->ift_pidx & (ntxd - 1); + ifsd_m = txq->ift_sds.ifsd_m; + ifsd_map = txq->ift_sds.ifsd_map; + m = ifsd_m[pidx]; ifsd_m[pidx] = NULL; + bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[pidx]); #if MEMORY_LOGGING txq->ift_dequeued++; #endif - i = 1; - - while (m) { - ifsd_m[(pidx + i) & (ntxd -1)] = NULL; -#if MEMORY_LOGGING - txq->ift_dequeued++; -#endif - m = m->m_next; - i++; - } - return (mh); + return (m); } -static int -iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag_t tag, bus_dmamap_t map, - struct mbuf **m0, bus_dma_segment_t *segs, int *nsegs, - int max_segs, int flags) -{ - if_ctx_t ctx; - if_shared_ctx_t sctx; - if_softc_ctx_t scctx; - int i, next, pidx, err, ntxd, count; - struct mbuf *m, *tmp, **ifsd_m; - - m = *m0; - - /* - * Please don't ever do this - */ - MPASS(__predict_true(m->m_len > 0)); - - ctx = txq->ift_ctx; - sctx = ctx->ifc_sctx; - scctx = &ctx->ifc_softc_ctx; - ifsd_m = txq->ift_sds.ifsd_m; - ntxd = txq->ift_size; - pidx = txq->ift_pidx; - if (map != NULL) { - uint8_t *ifsd_flags = txq->ift_sds.ifsd_flags; - - err = bus_dmamap_load_mbuf_sg(tag, map, - *m0, segs, nsegs, BUS_DMA_NOWAIT); - if (err) - return (err); - ifsd_flags[pidx] |= TX_SW_DESC_MAPPED; - count = 0; - m = *m0; - do { - if (__predict_false(m->m_len <= 0)) { - tmp = m; - m = m->m_next; - tmp->m_next = NULL; - m_free(tmp); - continue; - } - m = m->m_next; - count++; - } while (m != NULL); - if (count > *nsegs) { - ifsd_m[pidx] = *m0; - ifsd_m[pidx]->m_flags |= M_TOOBIG; - return (0); - } - m = *m0; - count = 0; - do { - next = (pidx + count) & (ntxd-1); - MPASS(ifsd_m[next] == NULL); - ifsd_m[next] = m; - count++; - tmp = m; - m = m->m_next; - } while (m != NULL); - } else { - int buflen, sgsize, maxsegsz, max_sgsize; - vm_offset_t vaddr; - vm_paddr_t curaddr; - - count = i = 0; - m = *m0; - if (m->m_pkthdr.csum_flags & CSUM_TSO) - maxsegsz = scctx->isc_tx_tso_segsize_max; - else - maxsegsz = sctx->isc_tx_maxsegsize; - - do { - if (__predict_false(m->m_len <= 0)) { - tmp = m; - m = m->m_next; - tmp->m_next = NULL; - m_free(tmp); - continue; - } - buflen = m->m_len; - vaddr = (vm_offset_t)m->m_data; - /* - * see if we can't be smarter about physically - * contiguous mappings - */ - next = (pidx + count) & (ntxd-1); - MPASS(ifsd_m[next] == NULL); -#if MEMORY_LOGGING - txq->ift_enqueued++; -#endif - ifsd_m[next] = m; - while (buflen > 0) { - if (i >= max_segs) - goto err; - max_sgsize = MIN(buflen, maxsegsz); - curaddr = pmap_kextract(vaddr); - sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); - sgsize = MIN(sgsize, max_sgsize); - segs[i].ds_addr = curaddr; - segs[i].ds_len = sgsize; - vaddr += sgsize; - buflen -= sgsize; - i++; - } - count++; - tmp = m; - m = m->m_next; - } while (m != NULL); - *nsegs = i; - } - return (0); -err: - *m0 = iflib_remove_mbuf(txq); - return (EFBIG); -} - static inline caddr_t calc_next_txd(iflib_txq_t txq, int cidx, uint8_t qid) { @@ -3282,7 +3092,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) if_shared_ctx_t sctx; if_softc_ctx_t scctx; bus_dma_segment_t *segs; - struct mbuf *m_head; + struct mbuf *m_head, **ifsd_m; void *next_txd; bus_dmamap_t map; struct if_pkt_info pi; @@ -3312,13 +3122,11 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) /* prefetch the next cache line of mbuf pointers and flags */ prefetch(&txq->ift_sds.ifsd_m[next]); - if (txq->ift_sds.ifsd_map != NULL) { - prefetch(&txq->ift_sds.ifsd_map[next]); - next = (cidx + CACHE_LINE_SIZE) & (ntxd-1); - prefetch(&txq->ift_sds.ifsd_flags[next]); - } - } else if (txq->ift_sds.ifsd_map != NULL) - map = txq->ift_sds.ifsd_map[pidx]; + prefetch(&txq->ift_sds.ifsd_map[next]); + next = (cidx + CACHE_LINE_SIZE) & (ntxd-1); + } + map = txq->ift_sds.ifsd_map[pidx]; + ifsd_m = txq->ift_sds.ifsd_m; if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { desc_tag = txq->ift_tso_desc_tag; @@ -3357,7 +3165,8 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) } retry: - err = iflib_busdma_load_mbuf_sg(txq, desc_tag, map, m_headp, segs, &nsegs, max_segs, BUS_DMA_NOWAIT); + err = bus_dmamap_load_mbuf_sg(desc_tag, map, m_head, segs, &nsegs, + BUS_DMA_NOWAIT); defrag: if (__predict_false(err)) { switch (err) { @@ -3394,7 +3203,7 @@ defrag: DBG_COUNTER_INC(encap_txd_encap_fail); return (err); } - + ifsd_m[pidx] = m_head; /* * XXX assumes a 1 to 1 relationship between segments and * descriptors - this does not hold true on all drivers, e.g. @@ -3402,8 +3211,7 @@ defrag: */ if (__predict_false(nsegs + 2 > TXQ_AVAIL(txq))) { txq->ift_no_desc_avail++; - if (map != NULL) - bus_dmamap_unload(desc_tag, map); + bus_dmamap_unload(desc_tag, map); DBG_COUNTER_INC(encap_txq_avail_fail); DBG_COUNTER_INC(encap_txd_encap_fail); if ((txq->ift_task.gt_task.ta_flags & TASK_ENQUEUED) == 0) @@ -3430,12 +3238,10 @@ defrag: #ifdef PKT_DEBUG print_pkt(&pi); #endif - if (map != NULL) - bus_dmamap_sync(desc_tag, map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(desc_tag, map, BUS_DMASYNC_PREWRITE); if ((err = ctx->isc_txd_encap(ctx->ifc_softc, &pi)) == 0) { - if (map != NULL) - bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); DBG_COUNTER_INC(tx_encap); MPASS(pi.ipi_new_pidx < txq->ift_size); @@ -3489,10 +3295,8 @@ defrag_failed: static void iflib_tx_desc_free(iflib_txq_t txq, int n) { - int hasmap; uint32_t qsize, cidx, mask, gen; struct mbuf *m, **ifsd_m; - uint8_t *ifsd_flags; bus_dmamap_t *ifsd_map; bool do_prefetch; @@ -3500,8 +3304,6 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) gen = txq->ift_gen; qsize = txq->ift_size; mask = qsize-1; - hasmap = txq->ift_sds.ifsd_map != NULL; - ifsd_flags = txq->ift_sds.ifsd_flags; ifsd_m = txq->ift_sds.ifsd_m; ifsd_map = txq->ift_sds.ifsd_map; do_prefetch = (txq->ift_ctx->ifc_flags & IFC_PREFETCH); @@ -3511,35 +3313,17 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) prefetch(ifsd_m[(cidx + 3) & mask]); prefetch(ifsd_m[(cidx + 4) & mask]); } - if (ifsd_m[cidx] != NULL) { + if ((m = ifsd_m[cidx]) != NULL) { prefetch(&ifsd_m[(cidx + CACHE_PTR_INCREMENT) & mask]); - prefetch(&ifsd_flags[(cidx + CACHE_PTR_INCREMENT) & mask]); - if (hasmap && (ifsd_flags[cidx] & TX_SW_DESC_MAPPED)) { - /* - * does it matter if it's not the TSO tag? If so we'll - * have to add the type to flags - */ - bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[cidx]); - ifsd_flags[cidx] &= ~TX_SW_DESC_MAPPED; - } - if ((m = ifsd_m[cidx]) != NULL) { - /* XXX we don't support any drivers that batch packets yet */ - MPASS(m->m_nextpkt == NULL); - /* if the number of clusters exceeds the number of segments - * there won't be space on the ring to save a pointer to each - * cluster so we simply free the list here - */ - if (m->m_flags & M_TOOBIG) { - m_freem(m); - } else { - m_free(m); - } - ifsd_m[cidx] = NULL; + bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[cidx]); + /* XXX we don't support any drivers that batch packets yet */ + MPASS(m->m_nextpkt == NULL); + m_freem(m); + ifsd_m[cidx] = NULL; #if MEMORY_LOGGING - txq->ift_dequeued++; + txq->ift_dequeued++; #endif - DBG_COUNTER_INC(tx_frees); - } + DBG_COUNTER_INC(tx_frees); } if (__predict_false(++cidx == qsize)) { cidx = 0; @@ -4538,14 +4322,6 @@ iflib_device_register(device_t dev, void *sc, if_share scctx->isc_ntxqsets = scctx->isc_ntxqsets_max; if (scctx->isc_nrxqsets == 0 || (scctx->isc_nrxqsets_max && scctx->isc_nrxqsets_max < scctx->isc_nrxqsets)) scctx->isc_nrxqsets = scctx->isc_nrxqsets_max; - -#ifdef ACPI_DMAR - if (dmar_get_dma_tag(device_get_parent(dev), dev) != NULL) - ctx->ifc_flags |= IFC_DMAR; -#elif !(defined(__i386__) || defined(__amd64__)) - /* set unconditionally for !x86 */ - ctx->ifc_flags |= IFC_DMAR; -#endif main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; Modified: head/sys/net/iflib_private.h ============================================================================== --- head/sys/net/iflib_private.h Tue Nov 27 19:50:58 2018 (r341094) +++ head/sys/net/iflib_private.h Tue Nov 27 20:01:05 2018 (r341095) @@ -34,7 +34,7 @@ #define IFC_LEGACY 0x001 #define IFC_QFLUSH 0x002 #define IFC_MULTISEG 0x004 -#define IFC_DMAR 0x008 +#define IFC_SPARE1 0x008 #define IFC_SC_ALLOCATED 0x010 #define IFC_INIT_DONE 0x020 #define IFC_PREFETCH 0x040 From owner-svn-src-head@freebsd.org Tue Nov 27 21:40:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 325DF113AF7D; Tue, 27 Nov 2018 21:40:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1F0C6FB53; Tue, 27 Nov 2018 21:40:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77BDF211D7; Tue, 27 Nov 2018 21:40:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARLepFV097985; Tue, 27 Nov 2018 21:40:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARLepTe097984; Tue, 27 Nov 2018 21:40:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811272140.wARLepTe097984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Nov 2018 21:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341096 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 341096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1F0C6FB53 X-Spamd-Result: default: False [1.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.496,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; NEURAL_SPAM_LONG(0.47)[0.465,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 21:40:52 -0000 Author: kib Date: Tue Nov 27 21:40:51 2018 New Revision: 341096 URL: https://svnweb.freebsd.org/changeset/base/341096 Log: Fix assert condition in pmap_large_unmap(). pmap_large_unmap() asserts that an unmapping request covers the entirety of a 2M or 1G page. The logic in the asserts was out of date with the loop logic. Correct the test to actually check that destroying the current superpage mapping does not unmap addresses beyond those requested by the caller. Submitted by: D Scott Phillips Reviewed by: alc MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18345 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Nov 27 20:01:05 2018 (r341095) +++ head/sys/amd64/amd64/pmap.c Tue Nov 27 21:40:51 2018 (r341096) @@ -8441,9 +8441,10 @@ pmap_large_unmap(void *svaa, vm_size_t len) KASSERT((va & PDPMASK) == 0, ("PDPMASK bit set, va %#lx pdpe %#lx pdp %#lx", va, (u_long)pdpe, pdp)); - KASSERT(len <= NBPDP, - ("len < NBPDP, sva %#lx va %#lx pdpe %#lx pdp %#lx " - "len %#lx", sva, va, (u_long)pdpe, pdp, len)); + KASSERT(va + NBPDP <= sva + len, + ("unmap covers partial 1GB page, sva %#lx va %#lx " + "pdpe %#lx pdp %#lx len %#lx", sva, va, + (u_long)pdpe, pdp, len)); *pdpe = 0; inc = NBPDP; continue; @@ -8457,9 +8458,10 @@ pmap_large_unmap(void *svaa, vm_size_t len) KASSERT((va & PDRMASK) == 0, ("PDRMASK bit set, va %#lx pde %#lx pd %#lx", va, (u_long)pde, pd)); - KASSERT(len <= NBPDR, - ("len < NBPDR, sva %#lx va %#lx pde %#lx pd %#lx " - "len %#lx", sva, va, (u_long)pde, pd, len)); + KASSERT(va + NBPDR <= sva + len, + ("unmap covers partial 2MB page, sva %#lx va %#lx " + "pde %#lx pd %#lx len %#lx", sva, va, (u_long)pde, + pd, len)); pde_store(pde, 0); inc = NBPDR; m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde)); From owner-svn-src-head@freebsd.org Tue Nov 27 21:50:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED138113BC51; Tue, 27 Nov 2018 21:50:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0EB70605; Tue, 27 Nov 2018 21:50:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 428A221268; Tue, 27 Nov 2018 21:50:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARLo0ci000867; Tue, 27 Nov 2018 21:50:00 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARLnx87000829; Tue, 27 Nov 2018 21:49:59 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201811272149.wARLnx87000829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 27 Nov 2018 21:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341097 - in head/bin/sh: . tests/errors X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in head/bin/sh: . tests/errors X-SVN-Commit-Revision: 341097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B0EB70605 X-Spamd-Result: default: False [1.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.51)[0.514,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; NEURAL_SPAM_LONG(0.51)[0.511,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 21:50:01 -0000 Author: jilles Date: Tue Nov 27 21:49:59 2018 New Revision: 341097 URL: https://svnweb.freebsd.org/changeset/base/341097 Log: sh: Use 126 and 127 exit status for failures opening a script This affects scripts named on the command line, named with a '.' special builtin and found via the PATH %func autoloading mechanism. PR: 231986 Added: head/bin/sh/tests/errors/script-error1.0 (contents, props changed) Modified: head/bin/sh/input.c head/bin/sh/sh.1 head/bin/sh/tests/errors/Makefile Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Tue Nov 27 21:40:51 2018 (r341096) +++ head/bin/sh/input.c Tue Nov 27 21:49:59 2018 (r341097) @@ -359,12 +359,16 @@ popstring(void) void setinputfile(const char *fname, int push) { + int e; int fd; int fd2; INTOFF; - if ((fd = open(fname, O_RDONLY | O_CLOEXEC)) < 0) - error("cannot open %s: %s", fname, strerror(errno)); + if ((fd = open(fname, O_RDONLY | O_CLOEXEC)) < 0) { + e = errno; + errorwithstatus(e == ENOENT || e == ENOTDIR ? 127 : 126, + "cannot open %s: %s", fname, strerror(e)); + } if (fd < 10) { fd2 = fcntl(fd, F_DUPFD_CLOEXEC, 10); close(fd); Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Tue Nov 27 21:40:51 2018 (r341096) +++ head/bin/sh/sh.1 Tue Nov 27 21:49:59 2018 (r341097) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd July 19, 2018 +.Dd November 27, 2018 .Dt SH 1 .Os .Sh NAME @@ -2819,7 +2819,11 @@ Shell database. Privileged shell profile. .El .Sh EXIT STATUS -Errors that are detected by the shell, such as a syntax error, will +If the +.Ar script +cannot be found, the exit status will be 127; +if it cannot be opened for another reason, the exit status will be 126. +Other errors that are detected by the shell, such as a syntax error, will cause the shell to exit with a non-zero exit status. If the shell is not an interactive shell, the execution of the shell file will be aborted. Modified: head/bin/sh/tests/errors/Makefile ============================================================================== --- head/bin/sh/tests/errors/Makefile Tue Nov 27 21:40:51 2018 (r341096) +++ head/bin/sh/tests/errors/Makefile Tue Nov 27 21:49:59 2018 (r341097) @@ -30,6 +30,7 @@ ${PACKAGE}FILES+= redirection-error5.0 ${PACKAGE}FILES+= redirection-error6.0 ${PACKAGE}FILES+= redirection-error7.0 ${PACKAGE}FILES+= redirection-error8.0 +${PACKAGE}FILES+= script-error1.0 ${PACKAGE}FILES+= write-error1.0 .include Added: head/bin/sh/tests/errors/script-error1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/errors/script-error1.0 Tue Nov 27 21:49:59 2018 (r341097) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +{ stderr=$(${SH} /var/empty/nosuchscript 2>&1 >&3); } 3>&1 +r=$? +[ -n "$stderr" ] && [ "$r" = 127 ] From owner-svn-src-head@freebsd.org Tue Nov 27 22:02:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C56D2113C840; Tue, 27 Nov 2018 22:02:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73D47712FB; Tue, 27 Nov 2018 22:02:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5526A215A7; Tue, 27 Nov 2018 22:02:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wARM2t28011121; Tue, 27 Nov 2018 22:02:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wARM2sAw011118; Tue, 27 Nov 2018 22:02:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811272202.wARM2sAw011118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Nov 2018 22:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341098 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 341098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73D47712FB X-Spamd-Result: default: False [1.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.59)[0.594,0]; NEURAL_SPAM_MEDIUM(0.48)[0.481,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.36)[0.355,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 22:02:56 -0000 Author: jhb Date: Tue Nov 27 22:02:54 2018 New Revision: 341098 URL: https://svnweb.freebsd.org/changeset/base/341098 Log: Add read-only sysctls for all tunables in the cxgbe(4) driver. Reviewed by: np MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18360 Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Nov 27 21:49:59 2018 (r341097) +++ head/sys/dev/cxgbe/adapter.h Tue Nov 27 22:02:54 2018 (r341098) @@ -82,6 +82,8 @@ prefetch(void *x) #define CTLTYPE_U64 CTLTYPE_QUAD #endif +SYSCTL_DECL(_hw_cxgbe); + struct adapter; typedef struct adapter adapter_t; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Nov 27 21:49:59 2018 (r341097) +++ head/sys/dev/cxgbe/t4_main.c Tue Nov 27 22:02:54 2018 (r341098) @@ -253,110 +253,150 @@ SLIST_HEAD(, uld_info) t4_uld_list; * Tunables applicable to both T4 and T5 are under hw.cxgbe. Those specific to * T5 are under hw.cxl. */ +SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, "cxgbe(4) parameters"); +SYSCTL_NODE(_hw, OID_AUTO, cxl, CTLFLAG_RD, 0, "cxgbe(4) T5+ parameters"); +SYSCTL_NODE(_hw_cxgbe, OID_AUTO, toe, CTLFLAG_RD, 0, "cxgbe(4) TOE parameters"); /* * Number of queues for tx and rx, NIC and offload. */ #define NTXQ 16 int t4_ntxq = -NTXQ; -TUNABLE_INT("hw.cxgbe.ntxq", &t4_ntxq); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, ntxq, CTLFLAG_RDTUN, &t4_ntxq, 0, + "Number of TX queues per port"); TUNABLE_INT("hw.cxgbe.ntxq10g", &t4_ntxq); /* Old name, undocumented */ #define NRXQ 8 int t4_nrxq = -NRXQ; -TUNABLE_INT("hw.cxgbe.nrxq", &t4_nrxq); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nrxq, CTLFLAG_RDTUN, &t4_nrxq, 0, + "Number of RX queues per port"); TUNABLE_INT("hw.cxgbe.nrxq10g", &t4_nrxq); /* Old name, undocumented */ #define NTXQ_VI 1 static int t4_ntxq_vi = -NTXQ_VI; -TUNABLE_INT("hw.cxgbe.ntxq_vi", &t4_ntxq_vi); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, ntxq_vi, CTLFLAG_RDTUN, &t4_ntxq_vi, 0, + "Number of TX queues per VI"); #define NRXQ_VI 1 static int t4_nrxq_vi = -NRXQ_VI; -TUNABLE_INT("hw.cxgbe.nrxq_vi", &t4_nrxq_vi); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nrxq_vi, CTLFLAG_RDTUN, &t4_nrxq_vi, 0, + "Number of RX queues per VI"); static int t4_rsrv_noflowq = 0; -TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, rsrv_noflowq, CTLFLAG_RDTUN, &t4_rsrv_noflowq, + 0, "Reserve TX queue 0 of each VI for non-flowid packets"); #if defined(TCP_OFFLOAD) || defined(RATELIMIT) #define NOFLDTXQ 8 static int t4_nofldtxq = -NOFLDTXQ; -TUNABLE_INT("hw.cxgbe.nofldtxq", &t4_nofldtxq); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq, CTLFLAG_RDTUN, &t4_nofldtxq, 0, + "Number of offload TX queues per port"); #define NOFLDRXQ 2 static int t4_nofldrxq = -NOFLDRXQ; -TUNABLE_INT("hw.cxgbe.nofldrxq", &t4_nofldrxq); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq, CTLFLAG_RDTUN, &t4_nofldrxq, 0, + "Number of offload RX queues per port"); #define NOFLDTXQ_VI 1 static int t4_nofldtxq_vi = -NOFLDTXQ_VI; -TUNABLE_INT("hw.cxgbe.nofldtxq_vi", &t4_nofldtxq_vi); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq_vi, CTLFLAG_RDTUN, &t4_nofldtxq_vi, 0, + "Number of offload TX queues per VI"); #define NOFLDRXQ_VI 1 static int t4_nofldrxq_vi = -NOFLDRXQ_VI; -TUNABLE_INT("hw.cxgbe.nofldrxq_vi", &t4_nofldrxq_vi); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq_vi, CTLFLAG_RDTUN, &t4_nofldrxq_vi, 0, + "Number of offload RX queues per VI"); #define TMR_IDX_OFLD 1 int t4_tmr_idx_ofld = TMR_IDX_OFLD; -TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_ofld", &t4_tmr_idx_ofld); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_timer_idx_ofld, CTLFLAG_RDTUN, + &t4_tmr_idx_ofld, 0, "Holdoff timer index for offload queues"); #define PKTC_IDX_OFLD (-1) int t4_pktc_idx_ofld = PKTC_IDX_OFLD; -TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_ofld", &t4_pktc_idx_ofld); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_pktc_idx_ofld, CTLFLAG_RDTUN, + &t4_pktc_idx_ofld, 0, "holdoff packet counter index for offload queues"); /* 0 means chip/fw default, non-zero number is value in microseconds */ static u_long t4_toe_keepalive_idle = 0; -TUNABLE_ULONG("hw.cxgbe.toe.keepalive_idle", &t4_toe_keepalive_idle); +SYSCTL_ULONG(_hw_cxgbe_toe, OID_AUTO, keepalive_idle, CTLFLAG_RDTUN, + &t4_toe_keepalive_idle, 0, "TOE keepalive idle timer (us)"); /* 0 means chip/fw default, non-zero number is value in microseconds */ static u_long t4_toe_keepalive_interval = 0; -TUNABLE_ULONG("hw.cxgbe.toe.keepalive_interval", &t4_toe_keepalive_interval); +SYSCTL_ULONG(_hw_cxgbe_toe, OID_AUTO, keepalive_interval, CTLFLAG_RDTUN, + &t4_toe_keepalive_interval, 0, "TOE keepalive interval timer (us)"); /* 0 means chip/fw default, non-zero number is # of keepalives before abort */ static int t4_toe_keepalive_count = 0; -TUNABLE_INT("hw.cxgbe.toe.keepalive_count", &t4_toe_keepalive_count); +SYSCTL_INT(_hw_cxgbe_toe, OID_AUTO, keepalive_count, CTLFLAG_RDTUN, + &t4_toe_keepalive_count, 0, "Number of TOE keepalive probes before abort"); /* 0 means chip/fw default, non-zero number is value in microseconds */ static u_long t4_toe_rexmt_min = 0; -TUNABLE_ULONG("hw.cxgbe.toe.rexmt_min", &t4_toe_rexmt_min); +SYSCTL_ULONG(_hw_cxgbe_toe, OID_AUTO, rexmt_min, CTLFLAG_RDTUN, + &t4_toe_rexmt_min, 0, "Minimum TOE retransmit interval (us)"); /* 0 means chip/fw default, non-zero number is value in microseconds */ static u_long t4_toe_rexmt_max = 0; -TUNABLE_ULONG("hw.cxgbe.toe.rexmt_max", &t4_toe_rexmt_max); +SYSCTL_ULONG(_hw_cxgbe_toe, OID_AUTO, rexmt_max, CTLFLAG_RDTUN, + &t4_toe_rexmt_max, 0, "Maximum TOE retransmit interval (us)"); /* 0 means chip/fw default, non-zero number is # of rexmt before abort */ static int t4_toe_rexmt_count = 0; -TUNABLE_INT("hw.cxgbe.toe.rexmt_count", &t4_toe_rexmt_count); +SYSCTL_INT(_hw_cxgbe_toe, OID_AUTO, rexmt_count, CTLFLAG_RDTUN, + &t4_toe_rexmt_count, 0, "Number of TOE retransmissions before abort"); /* -1 means chip/fw default, other values are raw backoff values to use */ static int t4_toe_rexmt_backoff[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.0", &t4_toe_rexmt_backoff[0]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.1", &t4_toe_rexmt_backoff[1]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.2", &t4_toe_rexmt_backoff[2]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.3", &t4_toe_rexmt_backoff[3]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.4", &t4_toe_rexmt_backoff[4]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.5", &t4_toe_rexmt_backoff[5]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.6", &t4_toe_rexmt_backoff[6]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.7", &t4_toe_rexmt_backoff[7]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.8", &t4_toe_rexmt_backoff[8]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.9", &t4_toe_rexmt_backoff[9]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.10", &t4_toe_rexmt_backoff[10]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.11", &t4_toe_rexmt_backoff[11]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.12", &t4_toe_rexmt_backoff[12]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.13", &t4_toe_rexmt_backoff[13]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.14", &t4_toe_rexmt_backoff[14]); -TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.15", &t4_toe_rexmt_backoff[15]); +SYSCTL_NODE(_hw_cxgbe_toe, OID_AUTO, rexmt_backoff, CTLFLAG_RD, 0, + "cxgbe(4) TOE retransmit backoff values"); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 0, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[0], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 1, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[1], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 2, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[2], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 3, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[3], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 4, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[4], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 5, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[5], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 6, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[6], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 7, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[7], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 8, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[8], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 9, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[9], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 10, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[10], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 11, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[11], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 12, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[12], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 13, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[13], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 14, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[14], 0, ""); +SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 15, CTLFLAG_RDTUN, + &t4_toe_rexmt_backoff[15], 0, ""); #endif #ifdef DEV_NETMAP #define NNMTXQ_VI 2 static int t4_nnmtxq_vi = -NNMTXQ_VI; -TUNABLE_INT("hw.cxgbe.nnmtxq_vi", &t4_nnmtxq_vi); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nnmtxq_vi, CTLFLAG_RDTUN, &t4_nnmtxq_vi, 0, + "Number of netmap TX queues per VI"); #define NNMRXQ_VI 2 static int t4_nnmrxq_vi = -NNMRXQ_VI; -TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nnmrxq_vi, CTLFLAG_RDTUN, &t4_nnmrxq_vi, 0, + "Number of netmap RX queues per VI"); #endif /* @@ -364,28 +404,33 @@ TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi); */ #define TMR_IDX 1 int t4_tmr_idx = TMR_IDX; -TUNABLE_INT("hw.cxgbe.holdoff_timer_idx", &t4_tmr_idx); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_timer_idx, CTLFLAG_RDTUN, &t4_tmr_idx, + 0, "Holdoff timer index"); TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_10G", &t4_tmr_idx); /* Old name */ #define PKTC_IDX (-1) int t4_pktc_idx = PKTC_IDX; -TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx", &t4_pktc_idx); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_pktc_idx, CTLFLAG_RDTUN, &t4_pktc_idx, + 0, "Holdoff packet counter index"); TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_10G", &t4_pktc_idx); /* Old name */ /* * Size (# of entries) of each tx and rx queue. */ unsigned int t4_qsize_txq = TX_EQ_QSIZE; -TUNABLE_INT("hw.cxgbe.qsize_txq", &t4_qsize_txq); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, qsize_txq, CTLFLAG_RDTUN, &t4_qsize_txq, 0, + "Number of descriptors in each TX queue"); unsigned int t4_qsize_rxq = RX_IQ_QSIZE; -TUNABLE_INT("hw.cxgbe.qsize_rxq", &t4_qsize_rxq); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, qsize_rxq, CTLFLAG_RDTUN, &t4_qsize_rxq, 0, + "Number of descriptors in each RX queue"); /* * Interrupt types allowed (bits 0, 1, 2 = INTx, MSI, MSI-X respectively). */ int t4_intr_types = INTR_MSIX | INTR_MSI | INTR_INTX; -TUNABLE_INT("hw.cxgbe.interrupt_types", &t4_intr_types); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, interrupt_types, CTLFLAG_RDTUN, &t4_intr_types, + 0, "Interrupt types allowed (bit 0 = INTx, 1 = MSI, 2 = MSI-X)"); /* * Configuration file. All the _CF names here are special. @@ -396,7 +441,8 @@ TUNABLE_INT("hw.cxgbe.interrupt_types", &t4_intr_types #define UWIRE_CF "uwire" #define FPGA_CF "fpga" static char t4_cfg_file[32] = DEFAULT_CF; -TUNABLE_STR("hw.cxgbe.config_file", t4_cfg_file, sizeof(t4_cfg_file)); +SYSCTL_STRING(_hw_cxgbe, OID_AUTO, config_file, CTLFLAG_RDTUN, t4_cfg_file, + sizeof(t4_cfg_file), "Firmware configuration file"); /* * PAUSE settings (bit 0, 1, 2 = rx_pause, tx_pause, pause_autoneg respectively). @@ -408,7 +454,9 @@ TUNABLE_STR("hw.cxgbe.config_file", t4_cfg_file, sizeo * Otherwise rx_pause/tx_pause are applied forcibly. */ static int t4_pause_settings = PAUSE_RX | PAUSE_TX | PAUSE_AUTONEG; -TUNABLE_INT("hw.cxgbe.pause_settings", &t4_pause_settings); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, pause_settings, CTLFLAG_RDTUN, + &t4_pause_settings, 0, + "PAUSE settings (bit 0 = rx_pause, 1 = tx_pause, 2 = pause_autoneg)"); /* * Forward Error Correction settings (bit 0, 1 = RS, BASER respectively). @@ -416,7 +464,8 @@ TUNABLE_INT("hw.cxgbe.pause_settings", &t4_pause_setti * 0 to disable FEC. */ static int t4_fec = -1; -TUNABLE_INT("hw.cxgbe.fec", &t4_fec); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, fec, CTLFLAG_RDTUN, &t4_fec, 0, + "Forward Error Correction (bit 0 = RS, bit 1 = BASER_RS)"); /* * Link autonegotiation. @@ -425,28 +474,33 @@ TUNABLE_INT("hw.cxgbe.fec", &t4_fec); * 1 to enable. */ static int t4_autoneg = -1; -TUNABLE_INT("hw.cxgbe.autoneg", &t4_autoneg); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, autoneg, CTLFLAG_RDTUN, &t4_autoneg, 0, + "Link autonegotiation"); /* * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed, * encouraged respectively). */ static unsigned int t4_fw_install = 1; -TUNABLE_INT("hw.cxgbe.fw_install", &t4_fw_install); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, fw_install, CTLFLAG_RDTUN, &t4_fw_install, 0, + "Firmware auto-install (0 = prohibited, 1 = allowed, 2 = encouraged)"); /* * ASIC features that will be used. Disable the ones you don't want so that the * chip resources aren't wasted on features that will not be used. */ static int t4_nbmcaps_allowed = 0; -TUNABLE_INT("hw.cxgbe.nbmcaps_allowed", &t4_nbmcaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nbmcaps_allowed, CTLFLAG_RDTUN, + &t4_nbmcaps_allowed, 0, "Default NBM capabilities"); static int t4_linkcaps_allowed = 0; /* No DCBX, PPP, etc. by default */ -TUNABLE_INT("hw.cxgbe.linkcaps_allowed", &t4_linkcaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, linkcaps_allowed, CTLFLAG_RDTUN, + &t4_linkcaps_allowed, 0, "Default link capabilities"); static int t4_switchcaps_allowed = FW_CAPS_CONFIG_SWITCH_INGRESS | FW_CAPS_CONFIG_SWITCH_EGRESS; -TUNABLE_INT("hw.cxgbe.switchcaps_allowed", &t4_switchcaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, switchcaps_allowed, CTLFLAG_RDTUN, + &t4_switchcaps_allowed, 0, "Default switch capabilities"); #ifdef RATELIMIT static int t4_niccaps_allowed = FW_CAPS_CONFIG_NIC | @@ -455,28 +509,37 @@ static int t4_niccaps_allowed = FW_CAPS_CONFIG_NIC | static int t4_niccaps_allowed = FW_CAPS_CONFIG_NIC | FW_CAPS_CONFIG_NIC_HASHFILTER; #endif -TUNABLE_INT("hw.cxgbe.niccaps_allowed", &t4_niccaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, niccaps_allowed, CTLFLAG_RDTUN, + &t4_niccaps_allowed, 0, "Default NIC capabilities"); static int t4_toecaps_allowed = -1; -TUNABLE_INT("hw.cxgbe.toecaps_allowed", &t4_toecaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, toecaps_allowed, CTLFLAG_RDTUN, + &t4_toecaps_allowed, 0, "Default TCP offload capabilities"); static int t4_rdmacaps_allowed = -1; -TUNABLE_INT("hw.cxgbe.rdmacaps_allowed", &t4_rdmacaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, rdmacaps_allowed, CTLFLAG_RDTUN, + &t4_rdmacaps_allowed, 0, "Default RDMA capabilities"); static int t4_cryptocaps_allowed = -1; -TUNABLE_INT("hw.cxgbe.cryptocaps_allowed", &t4_cryptocaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, cryptocaps_allowed, CTLFLAG_RDTUN, + &t4_cryptocaps_allowed, 0, "Default crypto capabilities"); static int t4_iscsicaps_allowed = -1; -TUNABLE_INT("hw.cxgbe.iscsicaps_allowed", &t4_iscsicaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, iscsicaps_allowed, CTLFLAG_RDTUN, + &t4_iscsicaps_allowed, 0, "Default iSCSI capabilities"); static int t4_fcoecaps_allowed = 0; -TUNABLE_INT("hw.cxgbe.fcoecaps_allowed", &t4_fcoecaps_allowed); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, fcoecaps_allowed, CTLFLAG_RDTUN, + &t4_fcoecaps_allowed, 0, "Default FCoE capabilities"); static int t5_write_combine = 0; -TUNABLE_INT("hw.cxl.write_combine", &t5_write_combine); +SYSCTL_INT(_hw_cxl, OID_AUTO, write_combine, CTLFLAG_RDTUN, &t5_write_combine, + 0, "Use WC instead of UC for BAR2"); static int t4_num_vis = 1; -TUNABLE_INT("hw.cxgbe.num_vis", &t4_num_vis); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, num_vis, CTLFLAG_RDTUN, &t4_num_vis, 0, + "Number of VIs per port"); + /* * PCIe Relaxed Ordering. * -1: driver should figure out a good value. @@ -485,17 +548,22 @@ TUNABLE_INT("hw.cxgbe.num_vis", &t4_num_vis); * 2: leave RO alone. */ static int pcie_relaxed_ordering = -1; -TUNABLE_INT("hw.cxgbe.pcie_relaxed_ordering", &pcie_relaxed_ordering); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, pcie_relaxed_ordering, CTLFLAG_RDTUN, + &pcie_relaxed_ordering, 0, + "PCIe Relaxed Ordering: 0 = disable, 1 = enable, 2 = leave alone"); static int t4_panic_on_fatal_err = 0; -TUNABLE_INT("hw.cxgbe.panic_on_fatal_err", &t4_panic_on_fatal_err); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, panic_on_fatal_err, CTLFLAG_RDTUN, + &t4_panic_on_fatal_err, 0, "panic on fatal firmware errors"); #ifdef TCP_OFFLOAD /* * TOE tunables. */ static int t4_cop_managed_offloading = 0; -TUNABLE_INT("hw.cxgbe.cop_managed_offloading", &t4_cop_managed_offloading); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, cop_managed_offloading, CTLFLAG_RDTUN, + &t4_cop_managed_offloading, 0, + "COP (Connection Offload Policy) controls all TOE offload"); #endif /* Functions used by VIs to obtain unique MAC addresses for each VI. */ @@ -6210,7 +6278,7 @@ cxgbe_sysctls(struct port_info *pi) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_settings", CTLTYPE_STRING | CTLFLAG_RW, pi, 0, sysctl_pause_settings, "A", - "PAUSE settings (bit 0 = rx_pause, bit 1 = tx_pause)"); + "PAUSE settings (bit 0 = rx_pause, 1 = tx_pause, 2 = pause_autoneg)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fec", CTLTYPE_STRING | CTLFLAG_RW, pi, 0, sysctl_fec, "A", "Forward Error Correction (bit 0 = RS, bit 1 = BASER_RS)"); Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Nov 27 21:49:59 2018 (r341097) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Nov 27 22:02:54 2018 (r341098) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); extern int fl_pad; /* XXXNM */ -SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, "cxgbe netmap parameters"); - /* * 0 = normal netmap rx * 1 = black hole @@ -87,7 +85,9 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CT * 1: no backpressure, drop packets for the congested queue immediately. */ static int nm_cong_drop = 1; -TUNABLE_INT("hw.cxgbe.nm_cong_drop", &nm_cong_drop); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_cong_drop, CTLFLAG_RDTUN, + &nm_cong_drop, 0, + "Congestion control for netmap rx queues (0 = backpressure, 1 = drop"); int starve_fl = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, starve_fl, CTLFLAG_RWTUN, Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Nov 27 21:49:59 2018 (r341097) +++ head/sys/dev/cxgbe/t4_sge.c Tue Nov 27 22:02:54 2018 (r341098) @@ -90,7 +90,8 @@ __FBSDID("$FreeBSD$"); * 0-7 are valid values. */ static int fl_pktshift = 0; -TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, fl_pktshift, CTLFLAG_RDTUN, &fl_pktshift, 0, + "payload DMA offset in rx buffer (bytes)"); /* * Pad ethernet payload up to this boundary. @@ -99,7 +100,8 @@ TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift); * Any power of 2 from 32 to 4096 (both inclusive) is also a valid value. */ int fl_pad = -1; -TUNABLE_INT("hw.cxgbe.fl_pad", &fl_pad); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, fl_pad, CTLFLAG_RDTUN, &fl_pad, 0, + "payload pad boundary (bytes)"); /* * Status page length. @@ -107,7 +109,8 @@ TUNABLE_INT("hw.cxgbe.fl_pad", &fl_pad); * 64 or 128 are the only other valid values. */ static int spg_len = -1; -TUNABLE_INT("hw.cxgbe.spg_len", &spg_len); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, spg_len, CTLFLAG_RDTUN, &spg_len, 0, + "status page size (bytes)"); /* * Congestion drops. @@ -116,7 +119,8 @@ TUNABLE_INT("hw.cxgbe.spg_len", &spg_len); * 1: no backpressure, drop packets for the congested queue immediately. */ static int cong_drop = 0; -TUNABLE_INT("hw.cxgbe.cong_drop", &cong_drop); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, cong_drop, CTLFLAG_RDTUN, &cong_drop, 0, + "Congestion control for RX queues (0 = backpressure, 1 = drop"); /* * Deliver multiple frames in the same free list buffer if they fit. @@ -125,7 +129,8 @@ TUNABLE_INT("hw.cxgbe.cong_drop", &cong_drop); * 1: enable buffer packing. */ static int buffer_packing = -1; -TUNABLE_INT("hw.cxgbe.buffer_packing", &buffer_packing); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, buffer_packing, CTLFLAG_RDTUN, &buffer_packing, + 0, "Enable buffer packing"); /* * Start next frame in a packed buffer at this boundary. @@ -134,7 +139,8 @@ TUNABLE_INT("hw.cxgbe.buffer_packing", &buffer_packing * T5: 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value. */ static int fl_pack = -1; -TUNABLE_INT("hw.cxgbe.fl_pack", &fl_pack); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, fl_pack, CTLFLAG_RDTUN, &fl_pack, 0, + "payload pack boundary (bytes)"); /* * Allow the driver to create mbuf(s) in a cluster allocated for rx. @@ -142,20 +148,24 @@ TUNABLE_INT("hw.cxgbe.fl_pack", &fl_pack); * 1: ok to create mbuf(s) within a cluster if there is room. */ static int allow_mbufs_in_cluster = 1; -TUNABLE_INT("hw.cxgbe.allow_mbufs_in_cluster", &allow_mbufs_in_cluster); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, allow_mbufs_in_cluster, CTLFLAG_RDTUN, + &allow_mbufs_in_cluster, 0, + "Allow driver to create mbufs within a rx cluster"); /* * Largest rx cluster size that the driver is allowed to allocate. */ static int largest_rx_cluster = MJUM16BYTES; -TUNABLE_INT("hw.cxgbe.largest_rx_cluster", &largest_rx_cluster); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, largest_rx_cluster, CTLFLAG_RDTUN, + &largest_rx_cluster, 0, "Largest rx cluster (bytes)"); /* * Size of cluster allocation that's most likely to succeed. The driver will * fall back to this size if it fails to allocate clusters larger than this. */ static int safest_rx_cluster = PAGE_SIZE; -TUNABLE_INT("hw.cxgbe.safest_rx_cluster", &safest_rx_cluster); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, safest_rx_cluster, CTLFLAG_RDTUN, + &safest_rx_cluster, 0, "Safe rx cluster (bytes)"); #ifdef RATELIMIT /* @@ -168,10 +178,12 @@ TUNABLE_INT("hw.cxgbe.safest_rx_cluster", &safest_rx_c * 3: 1us */ static int tsclk = -1; -TUNABLE_INT("hw.cxgbe.tsclk", &tsclk); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tsclk, CTLFLAG_RDTUN, &tsclk, 0, + "Control TCP timestamp rewriting when using pacing"); static int eo_max_backlog = 1024 * 1024; -TUNABLE_INT("hw.cxgbe.eo_max_backlog", &eo_max_backlog); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, eo_max_backlog, CTLFLAG_RDTUN, &eo_max_backlog, + 0, "Maximum backlog of ratelimited data per flow"); #endif /* @@ -179,19 +191,22 @@ TUNABLE_INT("hw.cxgbe.eo_max_backlog", &eo_max_backlog * 1 and 3-17 (both inclusive) are legal values. */ static int tscale = 1; -TUNABLE_INT("hw.cxgbe.tscale", &tscale); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tscale, CTLFLAG_RDTUN, &tscale, 0, + "Interrupt holdoff timer scale on T6+"); /* * Number of LRO entries in the lro_ctrl structure per rx queue. */ static int lro_entries = TCP_LRO_ENTRIES; -TUNABLE_INT("hw.cxgbe.lro_entries", &lro_entries); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, lro_entries, CTLFLAG_RDTUN, &lro_entries, 0, + "Number of LRO entries per RX queue"); /* * This enables presorting of frames before they're fed into tcp_lro_rx. */ static int lro_mbufs = 0; -TUNABLE_INT("hw.cxgbe.lro_mbufs", &lro_mbufs); +SYSCTL_INT(_hw_cxgbe, OID_AUTO, lro_mbufs, CTLFLAG_RDTUN, &lro_mbufs, 0, + "Enable presorting of LRO frames"); struct txpkts { u_int wr_type; /* type 0 or type 1 */ From owner-svn-src-head@freebsd.org Wed Nov 28 01:47:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0B41142CD7; Wed, 28 Nov 2018 01:47:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 513FF7883E; Wed, 28 Nov 2018 01:47:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 325B12395B; Wed, 28 Nov 2018 01:47:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS1l2J3024425; Wed, 28 Nov 2018 01:47:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS1l2WV024424; Wed, 28 Nov 2018 01:47:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811280147.wAS1l2WV024424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 28 Nov 2018 01:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341101 - head/stand X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 341101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 513FF7883E X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.03)[0.034,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 01:47:02 -0000 Author: jhibbits Date: Wed Nov 28 01:47:01 2018 New Revision: 341101 URL: https://svnweb.freebsd.org/changeset/base/341101 Log: powerpcspe: Don't crash the loader on ubldr with SPE instructions. -msoft-float seems to be insufficient for disabling the SPE on powerpcspe. Force it off with -mno-spe as well. This prevents a crash in ubldr on powerpcspe. Modified: head/stand/defs.mk Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Tue Nov 27 22:33:58 2018 (r341100) +++ head/stand/defs.mk Wed Nov 28 01:47:01 2018 (r341101) @@ -115,6 +115,11 @@ CFLAGS+= -march=rv64imac -mabi=lp64 CFLAGS+= -msoft-float .endif +# -msoft-float seems to be insufficient for powerpcspe +.if ${MACHINE_ARCH} == "powerpcspe" +CFLAGS+= -mno-spe +.endif + .if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 From owner-svn-src-head@freebsd.org Wed Nov 28 02:00:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D451143056; Wed, 28 Nov 2018 02:00:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16DCF79130; Wed, 28 Nov 2018 02:00:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA57823B09; Wed, 28 Nov 2018 02:00:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS20RON029953; Wed, 28 Nov 2018 02:00:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS20RIi029952; Wed, 28 Nov 2018 02:00:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811280200.wAS20RIi029952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 28 Nov 2018 02:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341102 - in head/sys/powerpc: booke mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: booke mpc85xx X-SVN-Commit-Revision: 341102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16DCF79130 X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.01)[0.009,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 02:00:28 -0000 Author: jhibbits Date: Wed Nov 28 02:00:27 2018 New Revision: 341102 URL: https://svnweb.freebsd.org/changeset/base/341102 Log: powerpc: Prepare Book-E kernels for KERNBASE != run base Book-E kernels really run at VM_MIN_KERNEL_ADDRESS, which currently happens to be the same as KERNBASE. KERNBASE is the linked address, which the loader also takes to be the physical load address. Treat KERNBASE as a physical address, not a virtual, and change virtual address references for KERNBASE to use something more appropriate. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Wed Nov 28 01:47:01 2018 (r341101) +++ head/sys/powerpc/booke/locore.S Wed Nov 28 02:00:27 2018 (r341102) @@ -113,7 +113,7 @@ __start: * - Create temp entry in the second AS (make sure it's not TLB[1]) * - Switch to temp mapping * - Map 64MB of RAM in TLB1[1] - * - Use AS=1, set EPN to KERNBASE and RPN to kernel load address + * - Use AS=0, set EPN to VM_MIN_KERNEL_ADDRESS and RPN to kernel load address * - Switch to TLB1[1] mapping * - Invalidate temp mapping * @@ -238,7 +238,7 @@ __start: mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ isync - LOAD_ADDR(%r3, KERNBASE) + LOAD_ADDR(%r3, VM_MIN_KERNEL_ADDRESS) ori %r3, %r3, (_TLB_ENTRY_SHARED | MAS2_M)@l /* WIMGE = 0b00100 */ mtspr SPR_MAS2, %r3 isync @@ -471,7 +471,7 @@ bp_kernload: mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ isync - LOAD_ADDR(%r3, KERNBASE) + LOAD_ADDR(%r3, VM_MIN_KERNEL_ADDRESS) ori %r3, %r3, (_TLB_ENTRY_SHARED | MAS2_M)@l /* WIMGE = 0b00100 */ mtspr SPR_MAS2, %r3 isync @@ -526,8 +526,8 @@ bp_kernload: 7: /* - * At this point we're running at virtual addresses KERNBASE and beyond so - * it's allowed to directly access all locations the kernel was linked + * At this point we're running at virtual addresses VM_MIN_KERNEL_ADDRESS and + * beyond so it's allowed to directly access all locations the kernel was linked * against. */ Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed Nov 28 01:47:01 2018 (r341101) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed Nov 28 02:00:27 2018 (r341102) @@ -68,6 +68,7 @@ extern void *ap_pcpu; extern vm_paddr_t kernload; /* Kernel physical load address */ extern uint8_t __boot_page[]; /* Boot page body */ extern uint32_t bp_kernload; +extern vm_offset_t __startkernel; struct cpu_release { uint32_t entry_h; @@ -346,7 +347,7 @@ mpc85xx_smp_start_cpu_epapr(platform_t plat, struct pc rel_va = rel_page + (rel_pa & PAGE_MASK); pmap_kenter(rel_page, rel_pa & ~PAGE_MASK); rel = (struct cpu_release *)rel_va; - bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload; + bptr = ((vm_paddr_t)(uintptr_t)__boot_page - __startkernel) + kernload; cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); rel->pir = pc->pc_cpuid; __asm __volatile("sync"); rel->entry_h = (bptr >> 32); @@ -415,7 +416,7 @@ mpc85xx_smp_start_cpu(platform_t plat, struct pcpu *pc /* Flush caches to have our changes hit DRAM. */ cpu_flush_dcache(__boot_page, 4096); - bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload; + bptr = ((vm_paddr_t)(uintptr_t)__boot_page - __startkernel) + kernload; KASSERT((bptr & 0xfff) == 0, ("%s: boot page is not aligned (%#jx)", __func__, (uintmax_t)bptr)); if (mpc85xx_is_qoriq()) { From owner-svn-src-head@freebsd.org Wed Nov 28 02:48:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D986D114480A; Wed, 28 Nov 2018 02:48:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A3357A972; Wed, 28 Nov 2018 02:48:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 456A32434E; Wed, 28 Nov 2018 02:48:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS2milY055486; Wed, 28 Nov 2018 02:48:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS2miqW055485; Wed, 28 Nov 2018 02:48:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811280248.wAS2miqW055485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 28 Nov 2018 02:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341103 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 341103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A3357A972 X-Spamd-Result: default: False [0.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; NEURAL_HAM_SHORT(-0.16)[-0.161,0]; NEURAL_SPAM_LONG(0.47)[0.465,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 02:48:45 -0000 Author: jhibbits Date: Wed Nov 28 02:48:43 2018 New Revision: 341103 URL: https://svnweb.freebsd.org/changeset/base/341103 Log: powerpc: Fix the powerpc64 build post-r341102 VM_MIN_KERNEL_ADDRESS is now used in locore.S, but the UL suffix isn't permitted in .S files. Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Wed Nov 28 02:00:27 2018 (r341102) +++ head/sys/powerpc/include/vmparam.h Wed Nov 28 02:48:43 2018 (r341103) @@ -106,8 +106,13 @@ #define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE #ifdef __powerpc64__ +#ifndef LOCORE #define VM_MIN_KERNEL_ADDRESS 0xe000000000000000UL #define VM_MAX_KERNEL_ADDRESS 0xe0000007ffffffffUL +#else +#define VM_MIN_KERNEL_ADDRESS 0xe000000000000000 +#define VM_MAX_KERNEL_ADDRESS 0xe0000007ffffffff +#endif #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif From owner-svn-src-head@freebsd.org Wed Nov 28 04:02:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E247511460FC; Wed, 28 Nov 2018 04:02:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE5A7CD67; Wed, 28 Nov 2018 04:02:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C7E9250F2; Wed, 28 Nov 2018 04:02:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS42Ri1096829; Wed, 28 Nov 2018 04:02:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS42R4h096828; Wed, 28 Nov 2018 04:02:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811280402.wAS42R4h096828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 28 Nov 2018 04:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341104 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 341104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FE5A7CD67 X-Spamd-Result: default: False [1.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.484,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 04:02:28 -0000 Author: jhibbits Date: Wed Nov 28 04:02:26 2018 New Revision: 341104 URL: https://svnweb.freebsd.org/changeset/base/341104 Log: powerpc/booke: Fix debug printfs in pmap Add missing '%'s so printf formats are actually handled. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed Nov 28 02:48:43 2018 (r341103) +++ head/sys/powerpc/booke/pmap.c Wed Nov 28 04:02:26 2018 (r341104) @@ -1830,8 +1830,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o copy_page_dst_va = virtual_avail; virtual_avail += PAGE_SIZE; debugf("zero_page_va = 0x%"PRI0ptrX"\n", zero_page_va); - debugf("copy_page_src_va = 0x"PRI0ptrX"\n", copy_page_src_va); - debugf("copy_page_dst_va = 0x"PRI0ptrX"\n", copy_page_dst_va); + debugf("copy_page_src_va = 0x%"PRI0ptrX"\n", copy_page_src_va); + debugf("copy_page_dst_va = 0x%"PRI0ptrX"\n", copy_page_dst_va); /* Initialize page zero/copy mutexes. */ mtx_init(&zero_page_mutex, "mmu_booke_zero_page", NULL, MTX_DEF); @@ -1840,15 +1840,15 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o /* Allocate KVA space for ptbl bufs. */ ptbl_buf_pool_vabase = virtual_avail; virtual_avail += PTBL_BUFS * PTBL_PAGES * PAGE_SIZE; - debugf("ptbl_buf_pool_vabase = 0x"PRI0ptrX" end = 0x"PRI0ptrX"\n", + debugf("ptbl_buf_pool_vabase = 0x%"PRI0ptrX" end = 0x%"PRI0ptrX"\n", ptbl_buf_pool_vabase, virtual_avail); /* Calculate corresponding physical addresses for the kernel region. */ phys_kernelend = kernload + kernsize; debugf("kernel image and allocated data:\n"); debugf(" kernload = 0x%09llx\n", (uint64_t)kernload); - debugf(" kernstart = 0x"PRI0ptrX"\n", kernstart); - debugf(" kernsize = 0x"PRI0ptrX"\n", kernsize); + debugf(" kernstart = 0x%"PRI0ptrX"\n", kernstart); + debugf(" kernsize = 0x%"PRI0ptrX"\n", kernsize); if (sizeof(phys_avail) / sizeof(phys_avail[0]) < availmem_regions_sz) panic("mmu_booke_bootstrap: phys_avail too small"); @@ -2268,7 +2268,7 @@ mmu_booke_kremove(mmu_t mmu, vm_offset_t va) { pte_t *pte; - CTR2(KTR_PMAP,"%s: s (va = 0x"PRI0ptrX")\n", __func__, va); + CTR2(KTR_PMAP,"%s: s (va = 0x%"PRI0ptrX")\n", __func__, va); KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), @@ -2725,7 +2725,7 @@ mmu_booke_activate(mmu_t mmu, struct thread *td) pmap = &td->td_proc->p_vmspace->vm_pmap; - CTR5(KTR_PMAP, "%s: s (td = %p, proc = '%s', id = %d, pmap = 0x"PRI0ptrX")", + CTR5(KTR_PMAP, "%s: s (td = %p, proc = '%s', id = %d, pmap = 0x%"PRI0ptrX")", __func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap); KASSERT((pmap != kernel_pmap), ("mmu_booke_activate: kernel_pmap!")); @@ -2761,7 +2761,7 @@ mmu_booke_deactivate(mmu_t mmu, struct thread *td) pmap = &td->td_proc->p_vmspace->vm_pmap; - CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x"PRI0ptrX, + CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x%"PRI0ptrX, __func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap); td->td_pcb->pcb_cpu.booke.dbcr0 = mfspr(SPR_DBCR0); From owner-svn-src-head@freebsd.org Wed Nov 28 05:31:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60D631148662; Wed, 28 Nov 2018 05:31:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id A2C817FF05; Wed, 28 Nov 2018 05:31:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 546E53CF340; Wed, 28 Nov 2018 16:31:35 +1100 (AEDT) Date: Wed, 28 Nov 2018 16:31:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Hibbits cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341103 - head/sys/powerpc/include In-Reply-To: <201811280248.wAS2miqW055485@repo.freebsd.org> Message-ID: <20181128151148.X1660@besplex.bde.org> References: <201811280248.wAS2miqW055485@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=MsLL-eZfpPPTZ7uyHDUA:9 a=_bZaHz0B1_H_0ylS:21 a=JgK52mJRRwLNRBAb:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: A2C817FF05 X-Spamd-Result: default: False [-1.60 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_FROM(0.00)[optusnet.com.au]; DMARC_NA(0.00)[optusnet.com.au]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.66)[0.664,0]; NEURAL_HAM_LONG(-0.96)[-0.962,0]; IP_SCORE(-0.01)[country: AU(-0.04)]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 05:31:47 -0000 On Wed, 28 Nov 2018, Justin Hibbits wrote: > Log: > powerpc: Fix the powerpc64 build post-r341102 > > VM_MIN_KERNEL_ADDRESS is now used in locore.S, but the UL suffix isn't > permitted in .S files. The UL suffix is arguably a style bug in .c files too. It was not even wrong (it had no effect) this case, but nearby code seems to be more broken. A ULL suffix would be unarguably a style bug everywhere. > Modified: head/sys/powerpc/include/vmparam.h > ============================================================================== > --- head/sys/powerpc/include/vmparam.h Wed Nov 28 02:00:27 2018 (r341102) > +++ head/sys/powerpc/include/vmparam.h Wed Nov 28 02:48:43 2018 (r341103) > @@ -106,8 +106,13 @@ > #define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE > > #ifdef __powerpc64__ > +#ifndef LOCORE > #define VM_MIN_KERNEL_ADDRESS 0xe000000000000000UL > #define VM_MAX_KERNEL_ADDRESS 0xe0000007ffffffffUL > +#else > +#define VM_MIN_KERNEL_ADDRESS 0xe000000000000000 > +#define VM_MAX_KERNEL_ADDRESS 0xe0000007ffffffff > +#endif These constants automatically have type unsigned long, since they are larger that LONG_MAX and smaller than ULONG_MAX. Thus the UL suffix had no effect except to break in asm files. This would not be true for smaller constants. Smaller constants often need to be combined or shifted back and forth, and then it may be necessary to use them as unsigned int or unsigned long constants (signed constants are better handled by implicit conversions between int and long unless they are mixed with unsigned constants). This is sometimes done using U or UL or suffixes. I don't like this. Cases where the natural type doesn't work are delicate and it is better to not hide the unnatural conversions by implicitly converting using a suffix on some constants. The correct fix is to remove the bogus UL suffixes and not add any ifdefs. On 32-bit arches, the above constants would have natural type [(long long abomination; should be deleted]. The abominatation is unavoidable, but badly written code increases it using explicit [abomination deleted] suffixes. > #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS > #endif Nearby code has mounds of unportabilities and style bugs. E.g., - VM_MIN_ADDRESS for the !LOCORE && 64-bit case has bogus UL suffixes and bogus parentheses around single tokens. It is 0, so it has natural type int, so the suffix might be needed to obfuscate conversions to unsigned long in some cases. - VM_MIN_ADDRESS for the !LOCORE && 32-bit case casts to vm_offset_t instead of hard-coding the same conversion using a suffix. The cast is more technically correct, but is an even larger syntax error -- it breaks both asm uses and uses in cpp expressions. - VM_MIN_ADDRESS already had the bogus ifdefs to support LOCORE. These are expressed in the opposite order (LOCORE is in the outer ifdef instead of the inner ifdef), which makes them more unreadable. - similarly for VM_MAXUSER_ADDRESS, plus an extra convolution to define this in terms of VM_MAXUSER_ADDRESS32 in the 32-bit case, but only for the !LOCORE case (since VM_MAXUSER_ADDRESS32 doesn't have a LOCORE ifdef). I used to like casts on constants and macros, like the ones here for vm_offset_t here, but jake@ convinced me that this was wrong in connection with PAE and sparc64 work. The wrongness is most obvious for PAE. vm_paddr_t is 64 bits for PAE, but most vm types for PAE (especially vm_offset_t) are only 32 bits. If you sprinkle [abomination deleted] suffixes or casts to uint64_t or vm_paddr_t on constants or macros, then this is too pessimal and/or confusing for most vm expressions. Sprinkling UL suffixes and vm_offset_t casts is relatively harmless only because it usually has no effect, especially on 32-bit non-PAE arches where even more types are naturally 32 bits. The i386 vmparam.h has the following style bugs in this area: - UL suffixes only for MAXTSIZ and friends - cast to vm_offset_t only for VM_MIN_KERNEL_ADDRESS - VM_MAX_KERNEL_ADDRESS and related values are encrypted through about 10 layers of macros depending on configuration variables like PAE. Most of the encryption is no longer really used, since it was mostly to make addresses depend on the user/kernel split. The encryptions mostly use signed constants and expressions, but a critical one is NPDEPTD defined in another file using sizeof(). Unsigned poisoning from this probably leaks into most macros, but the resulting types are even less clear than the resulting values since the resulting values are now documented for the only supported user/kernel split. - bogus extra parentheses only for VM_KMEM_SIZE_SCALE. The existence and default value of this macro are also wrong. They were last almost correct when the default user/kernel split was 3/1 and the physical memory size was 3 or 4 GB. The default for the macro is 3, which is closely related to the split ratio. This value works to prevent overflow in kva size calculations when the physical memory size is larger than the total kva size but less than 3 or 4 GB. Overflow still occurs for PAE since then the memory size can be larger than 4GB. Other magic properties of 3 result in the overflows giving reasonable values for the kva sizes when the memory size is 8GB or 16GB, but not when it is 12GB (because 12GB / 3 = 4GB = 0GB after overflow, and 0GB is not a useful kva size). Bruce From owner-svn-src-head@freebsd.org Wed Nov 28 06:53:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F09CB1149F76; Wed, 28 Nov 2018 06:53:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 945C5830FD; Wed, 28 Nov 2018 06:53:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 755D226C38; Wed, 28 Nov 2018 06:53:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6rfae083758; Wed, 28 Nov 2018 06:53:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6rf6s083757; Wed, 28 Nov 2018 06:53:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280653.wAS6rf6s083757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341105 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 945C5830FD X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.23)[0.231,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; NEURAL_SPAM_LONG(0.47)[0.465,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:53:42 -0000 Author: arybchik Date: Wed Nov 28 06:53:40 2018 New Revision: 341105 URL: https://svnweb.freebsd.org/changeset/base/341105 Log: sfxge(4): use correct name for frame truncation event The RX_ECC_ERR flag in RX events was misnamed, as it reported frame truncation. Use the new RX_TRUNC_ERR name for this flag. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18181 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx_regs_ef10.h Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Wed Nov 28 04:02:26 2018 (r341104) +++ head/sys/dev/sfxge/common/ef10_ev.c Wed Nov 28 06:53:40 2018 (r341105) @@ -815,8 +815,8 @@ ef10_ev_rx_packed_stream( current_id = eersp->eers_rx_read_ptr & eersp->eers_rx_mask; /* Check for errors that invalidate checksum and L3/L4 fields */ - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) { - /* RX frame truncated (error flag is misnamed) */ + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TRUNC_ERR) != 0) { + /* RX frame truncated */ EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC); flags |= EFX_DISCARD; goto deliver; @@ -953,8 +953,8 @@ ef10_ev_rx( last_used_id = (eersp->eers_rx_read_ptr - 1) & eersp->eers_rx_mask; /* Check for errors that invalidate checksum and L3/L4 fields */ - if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) { - /* RX frame truncated (error flag is misnamed) */ + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TRUNC_ERR) != 0) { + /* RX frame truncated */ EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC); flags |= EFX_DISCARD; goto deliver; Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Wed Nov 28 04:02:26 2018 (r341104) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Wed Nov 28 06:53:40 2018 (r341105) @@ -474,6 +474,8 @@ extern "C" { #define ESF_EZ_RX_ABORT_WIDTH 1 #define ESF_DZ_RX_ECC_ERR_LBN 29 #define ESF_DZ_RX_ECC_ERR_WIDTH 1 +#define ESF_DZ_RX_TRUNC_ERR_LBN 29 +#define ESF_DZ_RX_TRUNC_ERR_WIDTH 1 #define ESF_DZ_RX_CRC1_ERR_LBN 28 #define ESF_DZ_RX_CRC1_ERR_WIDTH 1 #define ESF_DZ_RX_CRC0_ERR_LBN 27 From owner-svn-src-head@freebsd.org Wed Nov 28 06:53:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912191149F9A; Wed, 28 Nov 2018 06:53:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA599831F6; Wed, 28 Nov 2018 06:53:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A58926C39; Wed, 28 Nov 2018 06:53:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6rqWp083815; Wed, 28 Nov 2018 06:53:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6rqEg083814; Wed, 28 Nov 2018 06:53:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280653.wAS6rqEg083814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341106 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA599831F6 X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.231,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:53:56 -0000 Author: arybchik Date: Wed Nov 28 06:53:51 2018 New Revision: 341106 URL: https://svnweb.freebsd.org/changeset/base/341106 Log: sfxge(4): add ef10 NIC board config method Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18182 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:53:40 2018 (r341105) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:53:51 2018 (r341106) @@ -1568,12 +1568,29 @@ fail1: return (rc); } +static __checkReturn efx_rc_t +ef10_nic_board_cfg( + __in efx_nic_t *enp) +{ + const efx_nic_ops_t *enop = enp->en_enop; + efx_rc_t rc; + if ((rc = enop->eno_board_cfg(enp)) != 0) + if (rc != EACCES) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t ef10_nic_probe( __in efx_nic_t *enp) { - const efx_nic_ops_t *enop = enp->en_enop; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_drv_cfg_t *edcp = &(enp->en_drv_cfg); efx_rc_t rc; @@ -1594,9 +1611,8 @@ ef10_nic_probe( if ((rc = efx_mcdi_drv_attach(enp, B_TRUE)) != 0) goto fail3; - if ((rc = enop->eno_board_cfg(enp)) != 0) - if (rc != EACCES) - goto fail4; + if ((rc = ef10_nic_board_cfg(enp)) != 0) + goto fail4; /* * Set default driver config limits (based on board config). From owner-svn-src-head@freebsd.org Wed Nov 28 06:54:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E4F1149FCD; Wed, 28 Nov 2018 06:54:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 569BF832A8; Wed, 28 Nov 2018 06:54:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DBF426C3A; Wed, 28 Nov 2018 06:54:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6s3OT083879; Wed, 28 Nov 2018 06:54:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6s3rr083878; Wed, 28 Nov 2018 06:54:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280654.wAS6s3rr083878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341107 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 569BF832A8 X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.231,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:54:05 -0000 Author: arybchik Date: Wed Nov 28 06:54:02 2018 New Revision: 341107 URL: https://svnweb.freebsd.org/changeset/base/341107 Log: sfxge(4): pacify false positive warning The warning says that it may be usage of possibly uninitialized value. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18183 Modified: head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:53:51 2018 (r341106) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:02 2018 (r341107) @@ -105,7 +105,7 @@ hunt_board_cfg( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint8_t mac_addr[6]; + uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); From owner-svn-src-head@freebsd.org Wed Nov 28 06:54:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DF07114A01B; Wed, 28 Nov 2018 06:54:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3973B83400; Wed, 28 Nov 2018 06:54:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CEC826C3C; Wed, 28 Nov 2018 06:54:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6sEph083941; Wed, 28 Nov 2018 06:54:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6sEfd083933; Wed, 28 Nov 2018 06:54:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280654.wAS6sEfd083933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341108 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3973B83400 X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.42)[0.424,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.229,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:54:19 -0000 Author: arybchik Date: Wed Nov 28 06:54:13 2018 New Revision: 341108 URL: https://svnweb.freebsd.org/changeset/base/341108 Log: sfxge(4): move port config to ef10 NIC board config Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18184 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 06:54:02 2018 (r341107) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 06:54:13 2018 (r341108) @@ -1201,11 +1201,6 @@ ef10_get_privilege_mask( __in efx_nic_t *enp, __out uint32_t *maskp); -extern __checkReturn efx_rc_t -ef10_external_port_mapping( - __in efx_nic_t *enp, - __in uint32_t port, - __out uint8_t *external_portp); #if EFSYS_OPT_RX_PACKED_STREAM Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:02 2018 (r341107) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:13 2018 (r341108) @@ -1494,7 +1494,7 @@ static struct ef10_external_port_map_s { }, }; - __checkReturn efx_rc_t +static __checkReturn efx_rc_t ef10_external_port_mapping( __in efx_nic_t *enp, __in uint32_t port, @@ -1573,14 +1573,33 @@ ef10_nic_board_cfg( __in efx_nic_t *enp) { const efx_nic_ops_t *enop = enp->en_enop; + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t port; efx_rc_t rc; + /* Get the (zero-based) MCDI port number */ + if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) + goto fail1; + + /* EFX MCDI interface uses one-based port numbers */ + emip->emi_port = port + 1; + + if ((rc = ef10_external_port_mapping(enp, port, + &encp->enc_external_port)) != 0) + goto fail2; + + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail1; + goto fail3; return (0); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:02 2018 (r341107) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:13 2018 (r341108) @@ -103,13 +103,11 @@ fail1: hunt_board_cfg( __in efx_nic_t *enp) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); - uint32_t port; uint32_t pf; uint32_t vf; uint32_t mask; @@ -129,28 +127,14 @@ hunt_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - - if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) - goto fail1; - /* - * NOTE: The MCDI protocol numbers ports from zero. - * The common code MCDI interface numbers ports from one. - */ - emip->emi_port = port + 1; - - if ((rc = ef10_external_port_mapping(enp, port, - &encp->enc_external_port)) != 0) - goto fail2; - - /* * Get PCIe function number from firmware (used for * per-function privilege and dynamic config info). * - PCIe PF: pf = PF number, vf = 0xffff. * - PCIe VF: pf = parent PF, vf = VF number. */ if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) - goto fail3; + goto fail1; encp->enc_pf = pf; encp->enc_vf = vf; @@ -171,7 +155,7 @@ hunt_board_cfg( rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } if (rc != 0) - goto fail4; + goto fail2; EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); @@ -182,7 +166,7 @@ hunt_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail5; + goto fail3; } encp->enc_board_type = board_type; @@ -190,11 +174,11 @@ hunt_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail6; + goto fail4; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail7; + goto fail5; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -225,7 +209,7 @@ hunt_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug35388_workaround = B_FALSE; else - goto fail8; + goto fail6; /* * If the bug41750 workaround is enabled, then do not test interrupts, @@ -244,7 +228,7 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug41750_workaround = B_FALSE; } else { - goto fail9; + goto fail7; } if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* Interrupt testing does not work for VFs. See bug50084. */ @@ -282,12 +266,12 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug26807_workaround = B_FALSE; } else { - goto fail10; + goto fail8; } /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail11; + goto fail9; /* * The Huntington timer quantum is 1536 sysclk cycles, documented for @@ -306,7 +290,7 @@ hunt_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail12; + goto fail10; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -356,13 +340,13 @@ hunt_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail13; + goto fail11; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail14; + goto fail12; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -378,7 +362,7 @@ hunt_board_cfg( encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail15; + goto fail13; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -386,10 +370,6 @@ hunt_board_cfg( return (0); -fail15: - EFSYS_PROBE(fail15); -fail14: - EFSYS_PROBE(fail14); fail13: EFSYS_PROBE(fail13); fail12: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:02 2018 (r341107) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:13 2018 (r341108) @@ -77,13 +77,11 @@ fail1: medford2_board_cfg( __in efx_nic_t *enp) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); - uint32_t port; uint32_t pf; uint32_t vf; uint32_t mask; @@ -107,27 +105,14 @@ medford2_board_cfg( encp->enc_vi_window_shift = vi_window_shift; - if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) - goto fail1; - /* - * NOTE: The MCDI protocol numbers ports from zero. - * The common code MCDI interface numbers ports from one. - */ - emip->emi_port = port + 1; - - if ((rc = ef10_external_port_mapping(enp, port, - &encp->enc_external_port)) != 0) - goto fail2; - - /* * Get PCIe function number from firmware (used for * per-function privilege and dynamic config info). * - PCIe PF: pf = PF number, vf = 0xffff. * - PCIe VF: pf = parent PF, vf = VF number. */ if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) - goto fail3; + goto fail2; encp->enc_pf = pf; encp->enc_vf = vf; @@ -156,7 +141,7 @@ medford2_board_cfg( rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } if (rc != 0) - goto fail4; + goto fail3; EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); @@ -167,7 +152,7 @@ medford2_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail5; + goto fail4; } encp->enc_board_type = board_type; @@ -175,11 +160,11 @@ medford2_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail6; + goto fail5; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail7; + goto fail6; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -223,11 +208,11 @@ medford2_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail8; + goto fail7; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail9; + goto fail8; /* * The Medford2 timer quantum is 1536 dpcpu_clk cycles, documented for @@ -239,7 +224,7 @@ medford2_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail10; + goto fail9; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -247,7 +232,7 @@ medford2_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail11; + goto fail10; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -299,13 +284,13 @@ medford2_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail12; + goto fail11; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail13; + goto fail12; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -328,14 +313,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail14; + goto fail13; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail14: - EFSYS_PROBE(fail14); fail13: EFSYS_PROBE(fail13); fail12: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:02 2018 (r341107) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:13 2018 (r341108) @@ -73,13 +73,11 @@ fail1: medford_board_cfg( __in efx_nic_t *enp) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); - uint32_t port; uint32_t pf; uint32_t vf; uint32_t mask; @@ -104,28 +102,14 @@ medford_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - - if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) - goto fail1; - /* - * NOTE: The MCDI protocol numbers ports from zero. - * The common code MCDI interface numbers ports from one. - */ - emip->emi_port = port + 1; - - if ((rc = ef10_external_port_mapping(enp, port, - &encp->enc_external_port)) != 0) - goto fail2; - - /* * Get PCIe function number from firmware (used for * per-function privilege and dynamic config info). * - PCIe PF: pf = PF number, vf = 0xffff. * - PCIe VF: pf = parent PF, vf = VF number. */ if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) - goto fail3; + goto fail1; encp->enc_pf = pf; encp->enc_vf = vf; @@ -154,7 +138,7 @@ medford_board_cfg( rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } if (rc != 0) - goto fail4; + goto fail2; EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); @@ -165,7 +149,7 @@ medford_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail5; + goto fail3; } encp->enc_board_type = board_type; @@ -173,11 +157,11 @@ medford_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail6; + goto fail4; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail7; + goto fail5; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -221,11 +205,11 @@ medford_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail8; + goto fail6; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail9; + goto fail7; /* * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for @@ -237,7 +221,7 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail10; + goto fail8; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -245,7 +229,7 @@ medford_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail11; + goto fail9; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -297,13 +281,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail12; + goto fail10; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail13; + goto fail11; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -326,16 +310,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail14; + goto fail12; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail14: - EFSYS_PROBE(fail14); -fail13: - EFSYS_PROBE(fail13); fail12: EFSYS_PROBE(fail12); fail11: From owner-svn-src-head@freebsd.org Wed Nov 28 06:54:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A534114A060; Wed, 28 Nov 2018 06:54:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DBAC8351D; Wed, 28 Nov 2018 06:54:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF9C726C3D; Wed, 28 Nov 2018 06:54:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6sQ10084003; Wed, 28 Nov 2018 06:54:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6sPAa083998; Wed, 28 Nov 2018 06:54:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280654.wAS6sPAa083998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341109 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DBAC8351D X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.42)[0.424,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.229,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:54:30 -0000 Author: arybchik Date: Wed Nov 28 06:54:25 2018 New Revision: 341109 URL: https://svnweb.freebsd.org/changeset/base/341109 Log: sfxge(4): move PF/VF config to ef10 NIC board config Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18185 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:13 2018 (r341108) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:25 2018 (r341109) @@ -1576,6 +1576,8 @@ ef10_nic_board_cfg( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint32_t port; + uint32_t pf; + uint32_t vf; efx_rc_t rc; /* Get the (zero-based) MCDI port number */ @@ -1589,13 +1591,27 @@ ef10_nic_board_cfg( &encp->enc_external_port)) != 0) goto fail2; + /* + * Get PCIe function number from firmware (used for + * per-function privilege and dynamic config info). + * - PCIe PF: pf = PF number, vf = 0xffff. + * - PCIe VF: pf = parent PF, vf = VF number. + */ + if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) + goto fail3; + + encp->enc_pf = pf; + encp->enc_vf = vf; + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail3; + goto fail4; return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:13 2018 (r341108) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:25 2018 (r341109) @@ -108,8 +108,6 @@ hunt_board_cfg( uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); - uint32_t pf; - uint32_t vf; uint32_t mask; uint32_t flags; uint32_t sysclk, dpcpu_clk; @@ -127,18 +125,6 @@ hunt_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* - * Get PCIe function number from firmware (used for - * per-function privilege and dynamic config info). - * - PCIe PF: pf = PF number, vf = 0xffff. - * - PCIe VF: pf = parent PF, vf = VF number. - */ - if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) - goto fail1; - - encp->enc_pf = pf; - encp->enc_vf = vf; - /* MAC address for this function */ if (EFX_PCI_FUNCTION_IS_PF(encp)) { rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); @@ -155,7 +141,7 @@ hunt_board_cfg( rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } if (rc != 0) - goto fail2; + goto fail1; EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); @@ -166,7 +152,7 @@ hunt_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail3; + goto fail2; } encp->enc_board_type = board_type; @@ -174,11 +160,11 @@ hunt_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail4; + goto fail3; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail5; + goto fail4; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -209,7 +195,7 @@ hunt_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug35388_workaround = B_FALSE; else - goto fail6; + goto fail5; /* * If the bug41750 workaround is enabled, then do not test interrupts, @@ -228,7 +214,7 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug41750_workaround = B_FALSE; } else { - goto fail7; + goto fail6; } if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* Interrupt testing does not work for VFs. See bug50084. */ @@ -266,12 +252,12 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug26807_workaround = B_FALSE; } else { - goto fail8; + goto fail7; } /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail9; + goto fail8; /* * The Huntington timer quantum is 1536 sysclk cycles, documented for @@ -290,7 +276,7 @@ hunt_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail10; + goto fail9; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -340,13 +326,13 @@ hunt_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail11; + goto fail10; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail12; + goto fail11; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -362,7 +348,7 @@ hunt_board_cfg( encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail13; + goto fail12; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -370,8 +356,6 @@ hunt_board_cfg( return (0); -fail13: - EFSYS_PROBE(fail13); fail12: EFSYS_PROBE(fail12); fail11: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:13 2018 (r341108) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:25 2018 (r341109) @@ -82,8 +82,6 @@ medford2_board_cfg( uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); - uint32_t pf; - uint32_t vf; uint32_t mask; uint32_t sysclk, dpcpu_clk; uint32_t base, nvec; @@ -105,18 +103,6 @@ medford2_board_cfg( encp->enc_vi_window_shift = vi_window_shift; - /* - * Get PCIe function number from firmware (used for - * per-function privilege and dynamic config info). - * - PCIe PF: pf = PF number, vf = 0xffff. - * - PCIe VF: pf = parent PF, vf = VF number. - */ - if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) - goto fail2; - - encp->enc_pf = pf; - encp->enc_vf = vf; - /* MAC address for this function */ if (EFX_PCI_FUNCTION_IS_PF(encp)) { rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); @@ -141,7 +127,7 @@ medford2_board_cfg( rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } if (rc != 0) - goto fail3; + goto fail2; EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); @@ -152,7 +138,7 @@ medford2_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail4; + goto fail3; } encp->enc_board_type = board_type; @@ -160,11 +146,11 @@ medford2_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail5; + goto fail4; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail6; + goto fail5; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -208,11 +194,11 @@ medford2_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail7; + goto fail6; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail8; + goto fail7; /* * The Medford2 timer quantum is 1536 dpcpu_clk cycles, documented for @@ -224,7 +210,7 @@ medford2_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail9; + goto fail8; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -232,7 +218,7 @@ medford2_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail10; + goto fail9; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -284,13 +270,13 @@ medford2_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail11; + goto fail10; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail12; + goto fail11; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -313,14 +299,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail13; + goto fail12; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail13: - EFSYS_PROBE(fail13); fail12: EFSYS_PROBE(fail12); fail11: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:13 2018 (r341108) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:25 2018 (r341109) @@ -78,8 +78,6 @@ medford_board_cfg( uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); - uint32_t pf; - uint32_t vf; uint32_t mask; uint32_t sysclk, dpcpu_clk; uint32_t base, nvec; @@ -102,18 +100,6 @@ medford_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* - * Get PCIe function number from firmware (used for - * per-function privilege and dynamic config info). - * - PCIe PF: pf = PF number, vf = 0xffff. - * - PCIe VF: pf = parent PF, vf = VF number. - */ - if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) - goto fail1; - - encp->enc_pf = pf; - encp->enc_vf = vf; - /* MAC address for this function */ if (EFX_PCI_FUNCTION_IS_PF(encp)) { rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); @@ -138,7 +124,7 @@ medford_board_cfg( rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } if (rc != 0) - goto fail2; + goto fail1; EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); @@ -149,7 +135,7 @@ medford_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail3; + goto fail2; } encp->enc_board_type = board_type; @@ -157,11 +143,11 @@ medford_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail4; + goto fail3; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail5; + goto fail4; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -205,11 +191,11 @@ medford_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail6; + goto fail5; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail7; + goto fail6; /* * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for @@ -221,7 +207,7 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail8; + goto fail7; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -229,7 +215,7 @@ medford_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail9; + goto fail8; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -281,13 +267,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail10; + goto fail9; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail11; + goto fail10; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -310,14 +296,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail12; + goto fail11; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail12: - EFSYS_PROBE(fail12); fail11: EFSYS_PROBE(fail11); fail10: From owner-svn-src-head@freebsd.org Wed Nov 28 06:54:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A6A5114A0A8; Wed, 28 Nov 2018 06:54:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7421835FE; Wed, 28 Nov 2018 06:54:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 928C026C3E; Wed, 28 Nov 2018 06:54:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6scIa084064; Wed, 28 Nov 2018 06:54:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6sbnc084060; Wed, 28 Nov 2018 06:54:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280654.wAS6sbnc084060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341110 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7421835FE X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.42)[0.424,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.229,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:54:40 -0000 Author: arybchik Date: Wed Nov 28 06:54:37 2018 New Revision: 341110 URL: https://svnweb.freebsd.org/changeset/base/341110 Log: sfxge(4): move MAC address config to ef10 NIC board cfg Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18186 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:25 2018 (r341109) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:37 2018 (r341110) @@ -1578,6 +1578,7 @@ ef10_nic_board_cfg( uint32_t port; uint32_t pf; uint32_t vf; + uint8_t mac_addr[6] = { 0 }; efx_rc_t rc; /* Get the (zero-based) MCDI port number */ @@ -1603,13 +1604,43 @@ ef10_nic_board_cfg( encp->enc_pf = pf; encp->enc_vf = vf; + /* MAC address for this function */ + if (EFX_PCI_FUNCTION_IS_PF(encp)) { + rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); +#if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC + /* + * Disable static config checking, ONLY for manufacturing test + * and setup at the factory, to allow the static config to be + * installed. + */ +#else /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ + if ((rc == 0) && (mac_addr[0] & 0x02)) { + /* + * If the static config does not include a global MAC + * address pool then the board may return a locally + * administered MAC address (this should only happen on + * incorrectly programmed boards). + */ + rc = EINVAL; + } +#endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ + } else { + rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); + } + if (rc != 0) + goto fail4; + + EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail4; + goto fail5; return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:25 2018 (r341109) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:37 2018 (r341110) @@ -104,7 +104,6 @@ hunt_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); @@ -125,26 +124,6 @@ hunt_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* MAC address for this function */ - if (EFX_PCI_FUNCTION_IS_PF(encp)) { - rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); - if ((rc == 0) && (mac_addr[0] & 0x02)) { - /* - * If the static config does not include a global MAC - * address pool then the board may return a locally - * administered MAC address (this should only happen on - * incorrectly programmed boards). - */ - rc = EINVAL; - } - } else { - rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); - } - if (rc != 0) - goto fail1; - - EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); - /* Board configuration */ rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); if (rc != 0) { @@ -152,7 +131,7 @@ hunt_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail2; + goto fail1; } encp->enc_board_type = board_type; @@ -160,11 +139,11 @@ hunt_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail3; + goto fail2; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail4; + goto fail3; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -195,7 +174,7 @@ hunt_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug35388_workaround = B_FALSE; else - goto fail5; + goto fail4; /* * If the bug41750 workaround is enabled, then do not test interrupts, @@ -214,7 +193,7 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug41750_workaround = B_FALSE; } else { - goto fail6; + goto fail5; } if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* Interrupt testing does not work for VFs. See bug50084. */ @@ -252,12 +231,12 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug26807_workaround = B_FALSE; } else { - goto fail7; + goto fail6; } /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail8; + goto fail7; /* * The Huntington timer quantum is 1536 sysclk cycles, documented for @@ -276,7 +255,7 @@ hunt_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail9; + goto fail8; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -326,13 +305,13 @@ hunt_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail10; + goto fail9; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail11; + goto fail10; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -348,7 +327,7 @@ hunt_board_cfg( encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail12; + goto fail11; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -356,8 +335,6 @@ hunt_board_cfg( return (0); -fail12: - EFSYS_PROBE(fail12); fail11: EFSYS_PROBE(fail11); fail10: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:25 2018 (r341109) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:37 2018 (r341110) @@ -78,7 +78,6 @@ medford2_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); @@ -103,34 +102,6 @@ medford2_board_cfg( encp->enc_vi_window_shift = vi_window_shift; - /* MAC address for this function */ - if (EFX_PCI_FUNCTION_IS_PF(encp)) { - rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); -#if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC - /* - * Disable static config checking for Medford NICs, ONLY - * for manufacturing test and setup at the factory, to - * allow the static config to be installed. - */ -#else /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ - if ((rc == 0) && (mac_addr[0] & 0x02)) { - /* - * If the static config does not include a global MAC - * address pool then the board may return a locally - * administered MAC address (this should only happen on - * incorrectly programmed boards). - */ - rc = EINVAL; - } -#endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ - } else { - rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); - } - if (rc != 0) - goto fail2; - - EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); - /* Board configuration */ rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); if (rc != 0) { @@ -138,7 +109,7 @@ medford2_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail3; + goto fail2; } encp->enc_board_type = board_type; @@ -146,11 +117,11 @@ medford2_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail4; + goto fail3; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail5; + goto fail4; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -194,11 +165,11 @@ medford2_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail6; + goto fail5; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail7; + goto fail6; /* * The Medford2 timer quantum is 1536 dpcpu_clk cycles, documented for @@ -210,7 +181,7 @@ medford2_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail8; + goto fail7; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -218,7 +189,7 @@ medford2_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail9; + goto fail8; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -270,13 +241,13 @@ medford2_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail10; + goto fail9; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail11; + goto fail10; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -299,14 +270,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail12; + goto fail11; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail12: - EFSYS_PROBE(fail12); fail11: EFSYS_PROBE(fail11); fail10: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:25 2018 (r341109) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:37 2018 (r341110) @@ -74,7 +74,6 @@ medford_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint8_t mac_addr[6] = { 0 }; uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); @@ -100,34 +99,6 @@ medford_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* MAC address for this function */ - if (EFX_PCI_FUNCTION_IS_PF(encp)) { - rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); -#if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC - /* - * Disable static config checking for Medford NICs, ONLY - * for manufacturing test and setup at the factory, to - * allow the static config to be installed. - */ -#else /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ - if ((rc == 0) && (mac_addr[0] & 0x02)) { - /* - * If the static config does not include a global MAC - * address pool then the board may return a locally - * administered MAC address (this should only happen on - * incorrectly programmed boards). - */ - rc = EINVAL; - } -#endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ - } else { - rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); - } - if (rc != 0) - goto fail1; - - EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); - /* Board configuration */ rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); if (rc != 0) { @@ -135,7 +106,7 @@ medford_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail2; + goto fail1; } encp->enc_board_type = board_type; @@ -143,11 +114,11 @@ medford_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail3; + goto fail2; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail4; + goto fail3; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -191,11 +162,11 @@ medford_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail5; + goto fail4; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail6; + goto fail5; /* * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for @@ -207,7 +178,7 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail7; + goto fail6; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -215,7 +186,7 @@ medford_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail8; + goto fail7; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -267,13 +238,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail9; + goto fail8; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail10; + goto fail9; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -296,14 +267,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail11; + goto fail10; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail11: - EFSYS_PROBE(fail11); fail10: EFSYS_PROBE(fail10); fail9: From owner-svn-src-head@freebsd.org Wed Nov 28 06:54:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37EB0114A0F0; Wed, 28 Nov 2018 06:54:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE00483725; Wed, 28 Nov 2018 06:54:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52FF126C3F; Wed, 28 Nov 2018 06:54:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6so0Q084125; Wed, 28 Nov 2018 06:54:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6sn5U084120; Wed, 28 Nov 2018 06:54:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280654.wAS6sn5U084120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341111 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE00483725 X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.42)[0.424,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.229,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:54:51 -0000 Author: arybchik Date: Wed Nov 28 06:54:49 2018 New Revision: 341111 URL: https://svnweb.freebsd.org/changeset/base/341111 Log: sfxge(4): move legacy board config to ef10 NIC board cfg Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18187 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:37 2018 (r341110) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:49 2018 (r341111) @@ -1575,6 +1575,7 @@ ef10_nic_board_cfg( const efx_nic_ops_t *enop = enp->en_enop; efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t board_type = 0; uint32_t port; uint32_t pf; uint32_t vf; @@ -1632,13 +1633,28 @@ ef10_nic_board_cfg( EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); + /* Board configuration (legacy) */ + rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); + if (rc != 0) { + /* Unprivileged functions may not be able to read board cfg */ + if (rc == EACCES) + board_type = 0; + else + goto fail5; + } + + encp->enc_board_type = board_type; + encp->enc_clk_mult = 1; /* not used for EF10 */ + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail5; + goto fail6; return (0); +fail6: + EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); fail4: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:37 2018 (r341110) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:49 2018 (r341111) @@ -104,7 +104,6 @@ hunt_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t mask; @@ -124,26 +123,13 @@ hunt_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* Board configuration */ - rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); - if (rc != 0) { - /* Unprivileged functions may not be able to read board cfg */ - if (rc == EACCES) - board_type = 0; - else - goto fail1; - } - - encp->enc_board_type = board_type; - encp->enc_clk_mult = 1; /* not used for Huntington */ - /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail2; + goto fail1; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail3; + goto fail2; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -174,7 +160,7 @@ hunt_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug35388_workaround = B_FALSE; else - goto fail4; + goto fail3; /* * If the bug41750 workaround is enabled, then do not test interrupts, @@ -193,7 +179,7 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug41750_workaround = B_FALSE; } else { - goto fail5; + goto fail4; } if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* Interrupt testing does not work for VFs. See bug50084. */ @@ -231,12 +217,12 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug26807_workaround = B_FALSE; } else { - goto fail6; + goto fail5; } /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail7; + goto fail6; /* * The Huntington timer quantum is 1536 sysclk cycles, documented for @@ -255,7 +241,7 @@ hunt_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail8; + goto fail7; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -305,13 +291,13 @@ hunt_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail9; + goto fail8; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail10; + goto fail9; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -327,7 +313,7 @@ hunt_board_cfg( encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail11; + goto fail10; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -335,8 +321,6 @@ hunt_board_cfg( return (0); -fail11: - EFSYS_PROBE(fail11); fail10: EFSYS_PROBE(fail10); fail9: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:37 2018 (r341110) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:49 2018 (r341111) @@ -78,7 +78,6 @@ medford2_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t mask; @@ -102,26 +101,13 @@ medford2_board_cfg( encp->enc_vi_window_shift = vi_window_shift; - /* Board configuration */ - rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); - if (rc != 0) { - /* Unprivileged functions may not be able to read board cfg */ - if (rc == EACCES) - board_type = 0; - else - goto fail2; - } - - encp->enc_board_type = board_type; - encp->enc_clk_mult = 1; /* not used for Medford2 */ - /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail3; + goto fail2; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail4; + goto fail3; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -165,11 +151,11 @@ medford2_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail5; + goto fail4; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail6; + goto fail5; /* * The Medford2 timer quantum is 1536 dpcpu_clk cycles, documented for @@ -181,7 +167,7 @@ medford2_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail7; + goto fail6; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -189,7 +175,7 @@ medford2_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail8; + goto fail7; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -241,13 +227,13 @@ medford2_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail9; + goto fail8; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail10; + goto fail9; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -270,14 +256,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail11; + goto fail10; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail11: - EFSYS_PROBE(fail11); fail10: EFSYS_PROBE(fail10); fail9: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:37 2018 (r341110) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:49 2018 (r341111) @@ -74,7 +74,6 @@ medford_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t board_type = 0; ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t mask; @@ -99,26 +98,13 @@ medford_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* Board configuration */ - rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); - if (rc != 0) { - /* Unprivileged functions may not be able to read board cfg */ - if (rc == EACCES) - board_type = 0; - else - goto fail1; - } - - encp->enc_board_type = board_type; - encp->enc_clk_mult = 1; /* not used for Medford */ - /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail2; + goto fail1; /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail3; + goto fail2; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -162,11 +148,11 @@ medford_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail4; + goto fail3; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail5; + goto fail4; /* * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for @@ -178,7 +164,7 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail6; + goto fail5; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -186,7 +172,7 @@ medford_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail7; + goto fail6; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -238,13 +224,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail8; + goto fail7; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail9; + goto fail8; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -267,14 +253,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail10; + goto fail9; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail10: - EFSYS_PROBE(fail10); fail9: EFSYS_PROBE(fail9); fail8: From owner-svn-src-head@freebsd.org Wed Nov 28 06:55:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A589114A133; Wed, 28 Nov 2018 06:55:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C47518385A; Wed, 28 Nov 2018 06:55:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C58A626C40; Wed, 28 Nov 2018 06:55:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6t14s084224; Wed, 28 Nov 2018 06:55:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6t1io084220; Wed, 28 Nov 2018 06:55:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280655.wAS6t1io084220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341112 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C47518385A X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.42)[0.424,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.229,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:55:03 -0000 Author: arybchik Date: Wed Nov 28 06:55:00 2018 New Revision: 341112 URL: https://svnweb.freebsd.org/changeset/base/341112 Log: sfxge(4): move PHY/link config to ef10 NIC board cfg Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18188 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:54:49 2018 (r341111) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:00 2018 (r341112) @@ -1575,6 +1575,8 @@ ef10_nic_board_cfg( const efx_nic_ops_t *enop = enp->en_enop; efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + ef10_link_state_t els; + efx_port_t *epp = &(enp->en_port); uint32_t board_type = 0; uint32_t port; uint32_t pf; @@ -1646,13 +1648,27 @@ ef10_nic_board_cfg( encp->enc_board_type = board_type; encp->enc_clk_mult = 1; /* not used for EF10 */ + /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ + if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) + goto fail6; + + /* Obtain the default PHY advertised capabilities */ + if ((rc = ef10_phy_get_link(enp, &els)) != 0) + goto fail7; + epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_adv_cap_mask = els.els_adv_cap_mask; + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail6; + goto fail8; return (0); +fail8: + EFSYS_PROBE(fail8); +fail7: + EFSYS_PROBE(fail7); fail6: EFSYS_PROBE(fail6); fail5: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:54:49 2018 (r341111) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:00 2018 (r341112) @@ -104,7 +104,6 @@ hunt_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t mask; uint32_t flags; @@ -123,16 +122,6 @@ hunt_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ - if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail1; - - /* Obtain the default PHY advertised capabilities */ - if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail2; - epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; - epp->ep_adv_cap_mask = els.els_adv_cap_mask; - /* * Enable firmware workarounds for hardware errata. * Expected responses are: @@ -160,7 +149,7 @@ hunt_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug35388_workaround = B_FALSE; else - goto fail3; + goto fail1; /* * If the bug41750 workaround is enabled, then do not test interrupts, @@ -179,7 +168,7 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug41750_workaround = B_FALSE; } else { - goto fail4; + goto fail2; } if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* Interrupt testing does not work for VFs. See bug50084. */ @@ -217,12 +206,12 @@ hunt_board_cfg( } else if ((rc == ENOTSUP) || (rc == ENOENT)) { encp->enc_bug26807_workaround = B_FALSE; } else { - goto fail5; + goto fail3; } /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail6; + goto fail4; /* * The Huntington timer quantum is 1536 sysclk cycles, documented for @@ -241,7 +230,7 @@ hunt_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail7; + goto fail5; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -291,13 +280,13 @@ hunt_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail8; + goto fail6; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail9; + goto fail7; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -313,7 +302,7 @@ hunt_board_cfg( encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail10; + goto fail8; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -321,10 +310,6 @@ hunt_board_cfg( return (0); -fail10: - EFSYS_PROBE(fail10); -fail9: - EFSYS_PROBE(fail9); fail8: EFSYS_PROBE(fail8); fail7: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:54:49 2018 (r341111) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:00 2018 (r341112) @@ -78,8 +78,6 @@ medford2_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - ef10_link_state_t els; - efx_port_t *epp = &(enp->en_port); uint32_t mask; uint32_t sysclk, dpcpu_clk; uint32_t base, nvec; @@ -101,16 +99,6 @@ medford2_board_cfg( encp->enc_vi_window_shift = vi_window_shift; - /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ - if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail2; - - /* Obtain the default PHY advertised capabilities */ - if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail3; - epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; - epp->ep_adv_cap_mask = els.els_adv_cap_mask; - /* * Enable firmware workarounds for hardware errata. * Expected responses are: @@ -151,11 +139,11 @@ medford2_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail4; + goto fail2; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail5; + goto fail3; /* * The Medford2 timer quantum is 1536 dpcpu_clk cycles, documented for @@ -167,7 +155,7 @@ medford2_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail6; + goto fail4; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -175,7 +163,7 @@ medford2_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail7; + goto fail5; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -227,13 +215,13 @@ medford2_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail8; + goto fail6; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail9; + goto fail7; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -256,16 +244,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail10; + goto fail8; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail10: - EFSYS_PROBE(fail10); -fail9: - EFSYS_PROBE(fail9); fail8: EFSYS_PROBE(fail8); fail7: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:54:49 2018 (r341111) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:00 2018 (r341112) @@ -74,8 +74,6 @@ medford_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - ef10_link_state_t els; - efx_port_t *epp = &(enp->en_port); uint32_t mask; uint32_t sysclk, dpcpu_clk; uint32_t base, nvec; @@ -98,16 +96,6 @@ medford_board_cfg( EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ - if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail1; - - /* Obtain the default PHY advertised capabilities */ - if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail2; - epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; - epp->ep_adv_cap_mask = els.els_adv_cap_mask; - /* * Enable firmware workarounds for hardware errata. * Expected responses are: @@ -148,11 +136,11 @@ medford_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail3; + goto fail1; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail4; + goto fail2; /* * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for @@ -164,7 +152,7 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail5; + goto fail3; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; @@ -172,7 +160,7 @@ medford_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail6; + goto fail4; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -224,13 +212,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail7; + goto fail5; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail8; + goto fail6; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -253,16 +241,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail9; + goto fail7; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail9: - EFSYS_PROBE(fail9); -fail8: - EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); fail6: From owner-svn-src-head@freebsd.org Wed Nov 28 06:55:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 241B2114A196; Wed, 28 Nov 2018 06:55:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A906A839A8; Wed, 28 Nov 2018 06:55:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C906C26C41; Wed, 28 Nov 2018 06:55:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6tDmT084287; Wed, 28 Nov 2018 06:55:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6tCM8084282; Wed, 28 Nov 2018 06:55:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280655.wAS6tCM8084282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341113 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A906A839A8 X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.230,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:55:16 -0000 Author: arybchik Date: Wed Nov 28 06:55:12 2018 New Revision: 341113 URL: https://svnweb.freebsd.org/changeset/base/341113 Log: sfxge(4): move datapath config to ef10 NIC board cfg Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18189 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 06:55:00 2018 (r341112) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 06:55:12 2018 (r341113) @@ -1188,10 +1188,6 @@ efx_mcdi_get_vector_cfg( __out_opt uint32_t *vf_nvecp); extern __checkReturn efx_rc_t -ef10_get_datapath_caps( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t ef10_get_vi_window_shift( __in efx_nic_t *enp, __out uint32_t *vi_window_shiftp); Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:00 2018 (r341112) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:12 2018 (r341113) @@ -1016,7 +1016,7 @@ fail1: return (rc); } - __checkReturn efx_rc_t +static __checkReturn efx_rc_t ef10_get_datapath_caps( __in efx_nic_t *enp) { @@ -1658,13 +1658,19 @@ ef10_nic_board_cfg( epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; + /* Check capabilities of running datapath firmware */ + if ((rc = ef10_get_datapath_caps(enp)) != 0) + goto fail8; + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail8; + goto fail9; return (0); +fail9: + EFSYS_PROBE(fail9); fail8: EFSYS_PROBE(fail8); fail7: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:00 2018 (r341112) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:12 2018 (r341113) @@ -228,10 +228,6 @@ hunt_board_cfg( encp->enc_bug61265_workaround = B_FALSE; /* Medford only */ - /* Check capabilities of running datapath firmware */ - if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail5; - /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */ @@ -280,13 +276,13 @@ hunt_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail6; + goto fail5; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail7; + goto fail6; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -302,7 +298,7 @@ hunt_board_cfg( encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail8; + goto fail7; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -310,8 +306,6 @@ hunt_board_cfg( return (0); -fail8: - EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); fail6: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:00 2018 (r341112) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:12 2018 (r341113) @@ -153,17 +153,13 @@ medford2_board_cfg( encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; - /* Check capabilities of running datapath firmware */ - if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail4; - /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail5; + goto fail4; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -215,13 +211,13 @@ medford2_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail6; + goto fail5; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail7; + goto fail6; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -244,14 +240,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail8; + goto fail7; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail8: - EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); fail6: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:00 2018 (r341112) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:12 2018 (r341113) @@ -150,17 +150,13 @@ medford_board_cfg( encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; - /* Check capabilities of running datapath firmware */ - if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail3; - /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail4; + goto fail3; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -212,13 +208,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail5; + goto fail4; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail6; + goto fail5; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -241,14 +237,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail7; + goto fail6; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail7: - EFSYS_PROBE(fail7); fail6: EFSYS_PROBE(fail6); fail5: From owner-svn-src-head@freebsd.org Wed Nov 28 06:55:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96CA0114A1E9; Wed, 28 Nov 2018 06:55:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3938583ADB; Wed, 28 Nov 2018 06:55:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8464426C42; Wed, 28 Nov 2018 06:55:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6tP7h084357; Wed, 28 Nov 2018 06:55:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6tOBv084352; Wed, 28 Nov 2018 06:55:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280655.wAS6tOBv084352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341114 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3938583ADB X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.230,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:55:28 -0000 Author: arybchik Date: Wed Nov 28 06:55:24 2018 New Revision: 341114 URL: https://svnweb.freebsd.org/changeset/base/341114 Log: sfxge(4): move Rx config to ef10 NIC board config Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18190 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:12 2018 (r341113) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:24 2018 (r341114) @@ -1662,6 +1662,17 @@ ef10_nic_board_cfg( if ((rc = ef10_get_datapath_caps(enp)) != 0) goto fail8; + /* Alignment for WPTR updates */ + encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + + /* + * Maximum number of exclusive RSS contexts. EF10 hardware supports 64 + * in total, but 6 are reserved for shared contexts. They are a global + * resource so not all may be available. + */ + encp->enc_rx_scale_max_exclusive_contexts = 64 - 6; + + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:12 2018 (r341113) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:24 2018 (r341114) @@ -232,16 +232,6 @@ hunt_board_cfg( encp->enc_rx_buf_align_start = 1; encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */ - /* Alignment for WPTR updates */ - encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; - - /* - * Maximum number of exclusive RSS contexts which can be allocated. The - * hardware supports 64, but 6 are reserved for shared contexts. They - * are a global resource so not all may be available. - */ - encp->enc_rx_scale_max_exclusive_contexts = 58; - encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ encp->enc_tx_dma_desc_boundary = 0; Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:12 2018 (r341113) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:24 2018 (r341114) @@ -166,16 +166,6 @@ medford2_board_cfg( } encp->enc_rx_buf_align_end = end_padding; - /* Alignment for WPTR updates */ - encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; - - /* - * Maximum number of exclusive RSS contexts which can be allocated. The - * hardware supports 64, but 6 are reserved for shared contexts. They - * are a global resource so not all may be available. - */ - encp->enc_rx_scale_max_exclusive_contexts = 58; - encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ encp->enc_tx_dma_desc_boundary = 0; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:12 2018 (r341113) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:24 2018 (r341114) @@ -163,16 +163,6 @@ medford_board_cfg( } encp->enc_rx_buf_align_end = end_padding; - /* Alignment for WPTR updates */ - encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; - - /* - * Maximum number of exclusive RSS contexts which can be allocated. The - * hardware supports 64, but 6 are reserved for shared contexts. They - * are a global resource so not all may be available. - */ - encp->enc_rx_scale_max_exclusive_contexts = 58; - encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ encp->enc_tx_dma_desc_boundary = 0; From owner-svn-src-head@freebsd.org Wed Nov 28 06:55:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A82B114A249; Wed, 28 Nov 2018 06:55:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E03B983BB4; Wed, 28 Nov 2018 06:55:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B98B26C43; Wed, 28 Nov 2018 06:55:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6tbNH084417; Wed, 28 Nov 2018 06:55:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6taJY084413; Wed, 28 Nov 2018 06:55:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280655.wAS6taJY084413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341115 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E03B983BB4 X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.230,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:55:38 -0000 Author: arybchik Date: Wed Nov 28 06:55:36 2018 New Revision: 341115 URL: https://svnweb.freebsd.org/changeset/base/341115 Log: sfxge(4): move Tx config to ef10 NIC board config Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18191 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:24 2018 (r341114) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:36 2018 (r341115) @@ -1672,6 +1672,16 @@ ef10_nic_board_cfg( */ encp->enc_rx_scale_max_exclusive_contexts = 64 - 6; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); + /* No boundary crossing limits */ + encp->enc_tx_dma_desc_boundary = 0; + + /* + * Maximum number of bytes into the frame the TCP header can start for + * firmware assisted TSO to work. + */ + encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:24 2018 (r341114) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:36 2018 (r341115) @@ -232,10 +232,6 @@ hunt_board_cfg( encp->enc_rx_buf_align_start = 1; encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */ - encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); - /* No boundary crossing limits */ - encp->enc_tx_dma_desc_boundary = 0; - /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available @@ -280,12 +276,6 @@ hunt_board_cfg( } encp->enc_intr_vec_base = base; encp->enc_intr_limit = nvec; - - /* - * Maximum number of bytes into the frame the TCP header can start for - * firmware assisted TSO to work. - */ - encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) goto fail7; Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:24 2018 (r341114) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:36 2018 (r341115) @@ -166,10 +166,6 @@ medford2_board_cfg( } encp->enc_rx_buf_align_end = end_padding; - encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); - /* No boundary crossing limits */ - encp->enc_tx_dma_desc_boundary = 0; - /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available @@ -215,12 +211,6 @@ medford2_board_cfg( } encp->enc_intr_vec_base = base; encp->enc_intr_limit = nvec; - - /* - * Maximum number of bytes into the frame the TCP header can start for - * firmware assisted TSO to work. - */ - encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; /* * Medford2 stores a single global copy of VPD, not per-PF as on Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:24 2018 (r341114) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:36 2018 (r341115) @@ -163,10 +163,6 @@ medford_board_cfg( } encp->enc_rx_buf_align_end = end_padding; - encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); - /* No boundary crossing limits */ - encp->enc_tx_dma_desc_boundary = 0; - /* * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available @@ -212,12 +208,6 @@ medford_board_cfg( } encp->enc_intr_vec_base = base; encp->enc_intr_limit = nvec; - - /* - * Maximum number of bytes into the frame the TCP header can start for - * firmware assisted TSO to work. - */ - encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; /* * Medford stores a single global copy of VPD, not per-PF as on From owner-svn-src-head@freebsd.org Wed Nov 28 06:55:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7603F114A289; Wed, 28 Nov 2018 06:55:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B3B383C92; Wed, 28 Nov 2018 06:55:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D881126C44; Wed, 28 Nov 2018 06:55:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6tmvF084479; Wed, 28 Nov 2018 06:55:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6tmW5084475; Wed, 28 Nov 2018 06:55:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280655.wAS6tmW5084475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341116 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B3B383C92 X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.230,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:55:49 -0000 Author: arybchik Date: Wed Nov 28 06:55:47 2018 New Revision: 341116 URL: https://svnweb.freebsd.org/changeset/base/341116 Log: sfxge(4): move limits config to ef10 NIC board config Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18192 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:36 2018 (r341115) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:47 2018 (r341116) @@ -1682,6 +1682,17 @@ ef10_nic_board_cfg( */ encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; + /* + * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use + * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available + * resources (allocated to this PCIe function), which is zero until + * after we have allocated VIs. + */ + encp->enc_evq_limit = 1024; + encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; + encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + + encp->enc_buftbl_limit = 0xFFFFFFFF; /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:36 2018 (r341115) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:47 2018 (r341116) @@ -233,22 +233,10 @@ hunt_board_cfg( encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */ /* - * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use - * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available - * resources (allocated to this PCIe function), which is zero until - * after we have allocated VIs. - */ - encp->enc_evq_limit = 1024; - encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; - encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; - - /* * The workaround for bug35388 uses the top bit of transmit queue * descriptor writes, preventing the use of 4096 descriptor TXQs. */ encp->enc_txq_max_ndescs = encp->enc_bug35388_workaround ? 2048 : 4096; - - encp->enc_buftbl_limit = 0xFFFFFFFF; EFX_STATIC_ASSERT(HUNT_PIOBUF_NBUFS <= EF10_MAX_PIOBUF_NBUFS); encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS; Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:36 2018 (r341115) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:47 2018 (r341116) @@ -167,23 +167,11 @@ medford2_board_cfg( encp->enc_rx_buf_align_end = end_padding; /* - * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use - * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available - * resources (allocated to this PCIe function), which is zero until - * after we have allocated VIs. - */ - encp->enc_evq_limit = 1024; - encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; - encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; - - /* * The maximum supported transmit queue size is 2048. TXQs with 4096 * descriptors are not supported as the top bit is used for vfifo * stuffing. */ encp->enc_txq_max_ndescs = 2048; - - encp->enc_buftbl_limit = 0xFFFFFFFF; EFX_STATIC_ASSERT(MEDFORD2_PIOBUF_NBUFS <= EF10_MAX_PIOBUF_NBUFS); encp->enc_piobuf_limit = MEDFORD2_PIOBUF_NBUFS; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:36 2018 (r341115) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:47 2018 (r341116) @@ -164,23 +164,11 @@ medford_board_cfg( encp->enc_rx_buf_align_end = end_padding; /* - * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use - * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available - * resources (allocated to this PCIe function), which is zero until - * after we have allocated VIs. - */ - encp->enc_evq_limit = 1024; - encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; - encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; - - /* * The maximum supported transmit queue size is 2048. TXQs with 4096 * descriptors are not supported as the top bit is used for vfifo * stuffing. */ encp->enc_txq_max_ndescs = 2048; - - encp->enc_buftbl_limit = 0xFFFFFFFF; EFX_STATIC_ASSERT(MEDFORD_PIOBUF_NBUFS <= EF10_MAX_PIOBUF_NBUFS); encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS; From owner-svn-src-head@freebsd.org Wed Nov 28 06:56:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58952114A2D0; Wed, 28 Nov 2018 06:56:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED14F83DD8; Wed, 28 Nov 2018 06:56:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FCED26C45; Wed, 28 Nov 2018 06:56:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6u0LU084543; Wed, 28 Nov 2018 06:56:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6txcG084536; Wed, 28 Nov 2018 06:55:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280655.wAS6txcG084536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341117 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED14F83DD8 X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.230,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:56:02 -0000 Author: arybchik Date: Wed Nov 28 06:55:59 2018 New Revision: 341117 URL: https://svnweb.freebsd.org/changeset/base/341117 Log: sfxge(4): move vector config to ef10 NIC board config Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18193 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:47 2018 (r341116) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:59 2018 (r341117) @@ -1578,6 +1578,7 @@ ef10_nic_board_cfg( ef10_link_state_t els; efx_port_t *epp = &(enp->en_port); uint32_t board_type = 0; + uint32_t base, nvec; uint32_t port; uint32_t pf; uint32_t vf; @@ -1694,13 +1695,27 @@ ef10_nic_board_cfg( encp->enc_buftbl_limit = 0xFFFFFFFF; + /* Get interrupt vector limits */ + if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { + if (EFX_PCI_FUNCTION_IS_PF(encp)) + goto fail9; + + /* Ignore error (cannot query vector limits from a VF). */ + base = 0; + nvec = 1024; + } + encp->enc_intr_vec_base = base; + encp->enc_intr_limit = nvec; + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail9; + goto fail10; return (0); +fail10: + EFSYS_PROBE(fail10); fail9: EFSYS_PROBE(fail9); fail8: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:47 2018 (r341116) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:59 2018 (r341117) @@ -108,7 +108,6 @@ hunt_board_cfg( uint32_t mask; uint32_t flags; uint32_t sysclk, dpcpu_clk; - uint32_t base, nvec; uint32_t bandwidth; efx_rc_t rc; @@ -253,20 +252,8 @@ hunt_board_cfg( goto fail5; encp->enc_privilege_mask = mask; - /* Get interrupt vector limits */ - if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { - if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail6; - - /* Ignore error (cannot query vector limits from a VF). */ - base = 0; - nvec = 1024; - } - encp->enc_intr_vec_base = base; - encp->enc_intr_limit = nvec; - if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail7; + goto fail6; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -274,8 +261,6 @@ hunt_board_cfg( return (0); -fail7: - EFSYS_PROBE(fail7); fail6: EFSYS_PROBE(fail6); fail5: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:47 2018 (r341116) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:59 2018 (r341117) @@ -80,7 +80,6 @@ medford2_board_cfg( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint32_t mask; uint32_t sysclk, dpcpu_clk; - uint32_t base, nvec; uint32_t end_padding; uint32_t bandwidth; uint32_t vi_window_shift; @@ -188,18 +187,6 @@ medford2_board_cfg( goto fail5; encp->enc_privilege_mask = mask; - /* Get interrupt vector limits */ - if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { - if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail6; - - /* Ignore error (cannot query vector limits from a VF). */ - base = 0; - nvec = 1024; - } - encp->enc_intr_vec_base = base; - encp->enc_intr_limit = nvec; - /* * Medford2 stores a single global copy of VPD, not per-PF as on * Huntington. @@ -208,14 +195,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail7; + goto fail6; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail7: - EFSYS_PROBE(fail7); fail6: EFSYS_PROBE(fail6); fail5: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:47 2018 (r341116) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:59 2018 (r341117) @@ -76,7 +76,6 @@ medford_board_cfg( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint32_t mask; uint32_t sysclk, dpcpu_clk; - uint32_t base, nvec; uint32_t end_padding; uint32_t bandwidth; efx_rc_t rc; @@ -185,18 +184,6 @@ medford_board_cfg( goto fail4; encp->enc_privilege_mask = mask; - /* Get interrupt vector limits */ - if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { - if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail5; - - /* Ignore error (cannot query vector limits from a VF). */ - base = 0; - nvec = 1024; - } - encp->enc_intr_vec_base = base; - encp->enc_intr_limit = nvec; - /* * Medford stores a single global copy of VPD, not per-PF as on * Huntington. @@ -205,14 +192,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail6; + goto fail5; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail6: - EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); fail4: From owner-svn-src-head@freebsd.org Wed Nov 28 06:56:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF0AA114A33A; Wed, 28 Nov 2018 06:56:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 773D683F37; Wed, 28 Nov 2018 06:56:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51CB726C46; Wed, 28 Nov 2018 06:56:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6uCb4084604; Wed, 28 Nov 2018 06:56:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6uBjt084599; Wed, 28 Nov 2018 06:56:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280656.wAS6uBjt084599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341118 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 773D683F37 X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.230,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:56:16 -0000 Author: arybchik Date: Wed Nov 28 06:56:11 2018 New Revision: 341118 URL: https://svnweb.freebsd.org/changeset/base/341118 Log: sfxge(4): move privilege config to ef10 NIC board config Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18194 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:55:59 2018 (r341117) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:56:11 2018 (r341118) @@ -1580,6 +1580,7 @@ ef10_nic_board_cfg( uint32_t board_type = 0; uint32_t base, nvec; uint32_t port; + uint32_t mask; uint32_t pf; uint32_t vf; uint8_t mac_addr[6] = { 0 }; @@ -1707,13 +1708,25 @@ ef10_nic_board_cfg( encp->enc_intr_vec_base = base; encp->enc_intr_limit = nvec; + /* + * Get the current privilege mask. Note that this may be modified + * dynamically, so this value is informational only. DO NOT use + * the privilege mask to check for sufficient privileges, as that + * can result in time-of-check/time-of-use bugs. + */ + if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) + goto fail10; + encp->enc_privilege_mask = mask; + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail10; + goto fail11; return (0); +fail11: + EFSYS_PROBE(fail11); fail10: EFSYS_PROBE(fail10); fail9: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:55:59 2018 (r341117) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:56:11 2018 (r341118) @@ -105,7 +105,6 @@ hunt_board_cfg( { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_port_t *epp = &(enp->en_port); - uint32_t mask; uint32_t flags; uint32_t sysclk, dpcpu_clk; uint32_t bandwidth; @@ -242,18 +241,8 @@ hunt_board_cfg( encp->enc_piobuf_size = HUNT_PIOBUF_SIZE; encp->enc_piobuf_min_alloc_size = HUNT_MIN_PIO_ALLOC_SIZE; - /* - * Get the current privilege mask. Note that this may be modified - * dynamically, so this value is informational only. DO NOT use - * the privilege mask to check for sufficient privileges, as that - * can result in time-of-check/time-of-use bugs. - */ - if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail5; - encp->enc_privilege_mask = mask; - if ((rc = hunt_nic_get_required_pcie_bandwidth(enp, &bandwidth)) != 0) - goto fail6; + goto fail5; encp->enc_required_pcie_bandwidth_mbps = bandwidth; /* All Huntington devices have a PCIe Gen3, 8 lane connector */ @@ -261,8 +250,6 @@ hunt_board_cfg( return (0); -fail6: - EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); fail4: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:55:59 2018 (r341117) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:56:11 2018 (r341118) @@ -78,7 +78,6 @@ medford2_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t mask; uint32_t sysclk, dpcpu_clk; uint32_t end_padding; uint32_t bandwidth; @@ -178,16 +177,6 @@ medford2_board_cfg( encp->enc_piobuf_min_alloc_size = MEDFORD2_MIN_PIO_ALLOC_SIZE; /* - * Get the current privilege mask. Note that this may be modified - * dynamically, so this value is informational only. DO NOT use - * the privilege mask to check for sufficient privileges, as that - * can result in time-of-check/time-of-use bugs. - */ - if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail5; - encp->enc_privilege_mask = mask; - - /* * Medford2 stores a single global copy of VPD, not per-PF as on * Huntington. */ @@ -195,14 +184,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail6; + goto fail5; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail6: - EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); fail4: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:55:59 2018 (r341117) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:56:11 2018 (r341118) @@ -74,7 +74,6 @@ medford_board_cfg( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t mask; uint32_t sysclk, dpcpu_clk; uint32_t end_padding; uint32_t bandwidth; @@ -175,16 +174,6 @@ medford_board_cfg( encp->enc_piobuf_min_alloc_size = MEDFORD_MIN_PIO_ALLOC_SIZE; /* - * Get the current privilege mask. Note that this may be modified - * dynamically, so this value is informational only. DO NOT use - * the privilege mask to check for sufficient privileges, as that - * can result in time-of-check/time-of-use bugs. - */ - if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail4; - encp->enc_privilege_mask = mask; - - /* * Medford stores a single global copy of VPD, not per-PF as on * Huntington. */ @@ -192,14 +181,12 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail5; + goto fail4; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail5: - EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: From owner-svn-src-head@freebsd.org Wed Nov 28 06:56:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA40114A383; Wed, 28 Nov 2018 06:56:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91C7E8401C; Wed, 28 Nov 2018 06:56:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3185B26C47; Wed, 28 Nov 2018 06:56:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6uOl2084668; Wed, 28 Nov 2018 06:56:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6uNJO084662; Wed, 28 Nov 2018 06:56:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280656.wAS6uNJO084662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341119 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91C7E8401C X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.230,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:56:25 -0000 Author: arybchik Date: Wed Nov 28 06:56:22 2018 New Revision: 341119 URL: https://svnweb.freebsd.org/changeset/base/341119 Log: sfxge(4): move VI window size config to ef10 NIC board Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18195 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 06:56:11 2018 (r341118) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 06:56:22 2018 (r341119) @@ -1187,11 +1187,6 @@ efx_mcdi_get_vector_cfg( __out_opt uint32_t *pf_nvecp, __out_opt uint32_t *vf_nvecp); -extern __checkReturn efx_rc_t -ef10_get_vi_window_shift( - __in efx_nic_t *enp, - __out uint32_t *vi_window_shiftp); - extern __checkReturn efx_rc_t ef10_get_privilege_mask( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:56:11 2018 (r341118) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 06:56:22 2018 (r341119) @@ -1202,6 +1202,37 @@ ef10_get_datapath_caps( encp->enc_tunnel_config_udp_entries_max = 0; } + /* + * Check if firmware reports the VI window mode. + * Medford2 has a variable VI window size (8K, 16K or 64K). + * Medford and Huntington have a fixed 8K VI window size. + */ + if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V3_OUT_LEN) { + uint8_t mode = + MCDI_OUT_BYTE(req, GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE); + + switch (mode) { + case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_8K: + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; + break; + case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_16K: + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_16K; + break; + case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_64K: + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_64K; + break; + default: + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_INVALID; + break; + } + } else if ((enp->en_family == EFX_FAMILY_HUNTINGTON) || + (enp->en_family == EFX_FAMILY_MEDFORD)) { + /* Huntington and Medford have fixed 8K window size */ + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; + } else { + encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_INVALID; + } + /* Check if firmware supports extended MAC stats. */ if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V4_OUT_LEN) { /* Extended stats buffer supported */ @@ -1224,71 +1255,6 @@ ef10_get_datapath_caps( fail4: EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_get_vi_window_shift( - __in efx_nic_t *enp, - __out uint32_t *vi_window_shiftp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V3_OUT_LEN)]; - uint32_t mode; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_CAPABILITIES; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CAPABILITIES_V3_OUT_LEN; - - efx_mcdi_execute_quiet(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V3_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - mode = MCDI_OUT_BYTE(req, GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE); - - switch (mode) { - case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_8K: - EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8 * 1024); - *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_8K; - break; - - case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_16K: - EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_16K == 16 * 1024); - *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_16K; - break; - - case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_64K: - EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_64K == 64 * 1024); - *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_64K; - break; - - default: - *vi_window_shiftp = EFX_VI_WINDOW_SHIFT_INVALID; - rc = EINVAL; - goto fail3; - } - - return (0); - fail3: EFSYS_PROBE(fail3); fail2: Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:56:11 2018 (r341118) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 06:56:22 2018 (r341119) @@ -110,16 +110,6 @@ hunt_board_cfg( uint32_t bandwidth; efx_rc_t rc; - /* Huntington has a fixed 8Kbyte VI window size */ - EFX_STATIC_ASSERT(ER_DZ_EVQ_RPTR_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_EVQ_TMR_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_RX_DESC_UPD_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_TX_DESC_UPD_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_TX_PIOBUF_STEP == 8192); - - EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); - encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* * Enable firmware workarounds for hardware errata. * Expected responses are: Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:56:11 2018 (r341118) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:56:22 2018 (r341119) @@ -81,7 +81,6 @@ medford2_board_cfg( uint32_t sysclk, dpcpu_clk; uint32_t end_padding; uint32_t bandwidth; - uint32_t vi_window_shift; efx_rc_t rc; /* @@ -89,14 +88,6 @@ medford2_board_cfg( * Parts of this should be shared with Huntington. */ - /* Medford2 has a variable VI window size (8K, 16K or 64K) */ - if ((rc = ef10_get_vi_window_shift(enp, &vi_window_shift)) != 0) - goto fail1; - - EFSYS_ASSERT3U(vi_window_shift, <=, EFX_VI_WINDOW_SHIFT_64K); - encp->enc_vi_window_shift = vi_window_shift; - - /* * Enable firmware workarounds for hardware errata. * Expected responses are: @@ -137,11 +128,11 @@ medford2_board_cfg( else if ((rc == ENOTSUP) || (rc == ENOENT)) encp->enc_bug61265_workaround = B_FALSE; else - goto fail2; + goto fail1; /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail3; + goto fail2; /* * The Medford2 timer quantum is 1536 dpcpu_clk cycles, documented for @@ -157,7 +148,7 @@ medford2_board_cfg( /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) { if (rc != EACCES) - goto fail4; + goto fail3; /* Assume largest tail padding size supported by hardware */ end_padding = 256; @@ -184,14 +175,12 @@ medford2_board_cfg( rc = medford2_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail5; + goto fail4; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); -fail5: - EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:56:11 2018 (r341118) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:56:22 2018 (r341119) @@ -84,16 +84,6 @@ medford_board_cfg( * Parts of this should be shared with Huntington. */ - /* Medford has a fixed 8Kbyte VI window size */ - EFX_STATIC_ASSERT(ER_DZ_EVQ_RPTR_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_EVQ_TMR_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_RX_DESC_UPD_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_TX_DESC_UPD_REG_STEP == 8192); - EFX_STATIC_ASSERT(ER_DZ_TX_PIOBUF_STEP == 8192); - - EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8192); - encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K; - /* * Enable firmware workarounds for hardware errata. * Expected responses are: From owner-svn-src-head@freebsd.org Wed Nov 28 06:56:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9164114A3D2; Wed, 28 Nov 2018 06:56:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2A48414E; Wed, 28 Nov 2018 06:56:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69C4426C50; Wed, 28 Nov 2018 06:56:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS6uZR5084726; Wed, 28 Nov 2018 06:56:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS6uZYS084724; Wed, 28 Nov 2018 06:56:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280656.wAS6uZYS084724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 06:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341120 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C2A48414E X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.231,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 06:56:37 -0000 Author: arybchik Date: Wed Nov 28 06:56:34 2018 New Revision: 341120 URL: https://svnweb.freebsd.org/changeset/base/341120 Log: sfxge(4): remove obsolete comments Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18196 Modified: head/sys/dev/sfxge/common/medford2_nic.c (contents, props changed) head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:56:22 2018 (r341119) +++ head/sys/dev/sfxge/common/medford2_nic.c Wed Nov 28 06:56:34 2018 (r341120) @@ -84,11 +84,6 @@ medford2_board_cfg( efx_rc_t rc; /* - * FIXME: Likely to be incomplete and incorrect. - * Parts of this should be shared with Huntington. - */ - - /* * Enable firmware workarounds for hardware errata. * Expected responses are: * - 0 (zero): Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:56:22 2018 (r341119) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Nov 28 06:56:34 2018 (r341120) @@ -80,11 +80,6 @@ medford_board_cfg( efx_rc_t rc; /* - * FIXME: Likely to be incomplete and incorrect. - * Parts of this should be shared with Huntington. - */ - - /* * Enable firmware workarounds for hardware errata. * Expected responses are: * - 0 (zero): From owner-svn-src-head@freebsd.org Wed Nov 28 09:22:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7583D114DAF4; Wed, 28 Nov 2018 09:22:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 137256ACC1; Wed, 28 Nov 2018 09:22:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8A35506; Wed, 28 Nov 2018 09:22:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9Mg2s061813; Wed, 28 Nov 2018 09:22:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9MgH8061812; Wed, 28 Nov 2018 09:22:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280922.wAS9MgH8061812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341122 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 137256ACC1 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:22:43 -0000 Author: arybchik Date: Wed Nov 28 09:22:42 2018 New Revision: 341122 URL: https://svnweb.freebsd.org/changeset/base/341122 Log: sfxge(4): support FEC mode settings Medford2 controllers support control and reporting of FEC modes for 25G and higher links. See SF-109306-TC for suggested usage in client code. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18197 Modified: head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Wed Nov 28 09:10:28 2018 (r341121) +++ head/sys/dev/sfxge/common/ef10_phy.c Wed Nov 28 09:22:42 2018 (r341122) @@ -61,6 +61,12 @@ mcdi_phy_decode_cap( CHECK_CAP(ASYM); CHECK_CAP(AN); CHECK_CAP(DDM); + CHECK_CAP(BASER_FEC); + CHECK_CAP(BASER_FEC_REQUESTED); + CHECK_CAP(RS_FEC); + CHECK_CAP(RS_FEC_REQUESTED); + CHECK_CAP(25G_BASER_FEC); + CHECK_CAP(25G_BASER_FEC_REQUESTED); #undef CHECK_CAP mask = 0; @@ -94,6 +100,22 @@ mcdi_phy_decode_cap( if (mcdi_cap & (1 << MC_CMD_PHY_CAP_AN_LBN)) mask |= (1 << EFX_PHY_CAP_AN); + /* FEC caps (supported on Medford2 and later) */ + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_BASER_FEC_LBN)) + mask |= (1 << EFX_PHY_CAP_BASER_FEC); + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_BASER_FEC_REQUESTED_LBN)) + mask |= (1 << EFX_PHY_CAP_BASER_FEC_REQUESTED); + + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_RS_FEC_LBN)) + mask |= (1 << EFX_PHY_CAP_RS_FEC); + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_RS_FEC_REQUESTED_LBN)) + mask |= (1 << EFX_PHY_CAP_RS_FEC_REQUESTED); + + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_25G_BASER_FEC_LBN)) + mask |= (1 << EFX_PHY_CAP_25G_BASER_FEC); + if (mcdi_cap & (1 << MC_CMD_PHY_CAP_25G_BASER_FEC_REQUESTED_LBN)) + mask |= (1 << EFX_PHY_CAP_25G_BASER_FEC_REQUESTED); + *maskp = mask; } @@ -349,6 +371,25 @@ ef10_phy_reconfigure( PHY_CAP_50000FDX, (cap_mask >> EFX_PHY_CAP_50000FDX) & 0x1); MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, PHY_CAP_100000FDX, (cap_mask >> EFX_PHY_CAP_100000FDX) & 0x1); + + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_BASER_FEC, (cap_mask >> EFX_PHY_CAP_BASER_FEC) & 0x1); + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_BASER_FEC_REQUESTED, + (cap_mask >> EFX_PHY_CAP_BASER_FEC_REQUESTED) & 0x1); + + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_RS_FEC, (cap_mask >> EFX_PHY_CAP_RS_FEC) & 0x1); + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_RS_FEC_REQUESTED, + (cap_mask >> EFX_PHY_CAP_RS_FEC_REQUESTED) & 0x1); + + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_25G_BASER_FEC, + (cap_mask >> EFX_PHY_CAP_25G_BASER_FEC) & 0x1); + MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, + PHY_CAP_25G_BASER_FEC_REQUESTED, + (cap_mask >> EFX_PHY_CAP_25G_BASER_FEC_REQUESTED) & 0x1); #if EFSYS_OPT_LOOPBACK MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_MODE, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:10:28 2018 (r341121) +++ head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:22:42 2018 (r341122) @@ -904,6 +904,12 @@ typedef enum efx_phy_cap_type_e { EFX_PHY_CAP_100000FDX, EFX_PHY_CAP_25000FDX, EFX_PHY_CAP_50000FDX, + EFX_PHY_CAP_BASER_FEC, + EFX_PHY_CAP_BASER_FEC_REQUESTED, + EFX_PHY_CAP_RS_FEC, + EFX_PHY_CAP_RS_FEC_REQUESTED, + EFX_PHY_CAP_25G_BASER_FEC, + EFX_PHY_CAP_25G_BASER_FEC_REQUESTED, EFX_PHY_CAP_NTYPES } efx_phy_cap_type_t; From owner-svn-src-head@freebsd.org Wed Nov 28 09:22:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A594C114DB1B; Wed, 28 Nov 2018 09:22:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE8E56ADB4; Wed, 28 Nov 2018 09:22:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 984A6507; Wed, 28 Nov 2018 09:22:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9MsbH061871; Wed, 28 Nov 2018 09:22:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9Msgv061870; Wed, 28 Nov 2018 09:22:54 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280922.wAS9Msgv061870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341123 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE8E56ADB4 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:22:57 -0000 Author: arybchik Date: Wed Nov 28 09:22:53 2018 New Revision: 341123 URL: https://svnweb.freebsd.org/changeset/base/341123 Log: sfxge(4): support Medford2 event timer semantics The event timer interface has changed for Medford2 - for details see bug66418 comment 9. Update the common code to use the new timer semantics for Medford2. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18198 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx_regs_ef10.h Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Wed Nov 28 09:22:42 2018 (r341122) +++ head/sys/dev/sfxge/common/ef10_ev.c Wed Nov 28 09:22:53 2018 (r341123) @@ -732,9 +732,15 @@ ef10_ev_qmoderate( EFX_BAR_VI_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, &dword, 0); } else { - EFX_POPULATE_DWORD_2(dword, + /* + * NOTE: The TMR_REL field introduced in Medford2 is + * ignored on earlier EF10 controllers. See bug66418 + * comment 9 for details. + */ + EFX_POPULATE_DWORD_3(dword, ERF_DZ_TC_TIMER_MODE, mode, - ERF_DZ_TC_TIMER_VAL, ticks); + ERF_DZ_TC_TIMER_VAL, ticks, + ERF_FZ_TC_TMR_REL_VAL, ticks); EFX_BAR_VI_WRITED(enp, ER_DZ_EVQ_TMR_REG, eep->ee_index, &dword, 0); } Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Wed Nov 28 09:22:42 2018 (r341122) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Wed Nov 28 09:22:53 2018 (r341123) @@ -184,6 +184,8 @@ extern "C" { #define ER_FZ_EVQ_TMR_REG_64K_RESET 0x0 +#define ERF_FZ_TC_TMR_REL_VAL_LBN 16 +#define ERF_FZ_TC_TMR_REL_VAL_WIDTH 14 #define ERF_FZ_TC_TIMER_MODE_LBN 14 #define ERF_FZ_TC_TIMER_MODE_WIDTH 2 #define ERF_FZ_TC_TIMER_VAL_LBN 0 @@ -202,6 +204,8 @@ extern "C" { #define ER_FZ_EVQ_TMR_REG_16K_RESET 0x0 +/* defined as ERF_FZ_TC_TMR_REL_VAL_LBN 16; */ +/* defined as ERF_FZ_TC_TMR_REL_VAL_WIDTH 14 */ /* defined as ERF_FZ_TC_TIMER_MODE_LBN 14; */ /* defined as ERF_FZ_TC_TIMER_MODE_WIDTH 2 */ /* defined as ERF_FZ_TC_TIMER_VAL_LBN 0; */ @@ -220,6 +224,8 @@ extern "C" { #define ER_DZ_EVQ_TMR_REG_RESET 0x0 +/* defined as ERF_FZ_TC_TMR_REL_VAL_LBN 16; */ +/* defined as ERF_FZ_TC_TMR_REL_VAL_WIDTH 14 */ #define ERF_DZ_TC_TIMER_MODE_LBN 14 #define ERF_DZ_TC_TIMER_MODE_WIDTH 2 #define ERF_DZ_TC_TIMER_VAL_LBN 0 From owner-svn-src-head@freebsd.org Wed Nov 28 09:23:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CF9F114DB6E; Wed, 28 Nov 2018 09:23:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 147F76AEF3; Wed, 28 Nov 2018 09:23:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD30A508; Wed, 28 Nov 2018 09:23:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9N5Uj061933; Wed, 28 Nov 2018 09:23:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9N55h061931; Wed, 28 Nov 2018 09:23:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280923.wAS9N55h061931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341124 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 147F76AEF3 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:23:11 -0000 Author: arybchik Date: Wed Nov 28 09:23:05 2018 New Revision: 341124 URL: https://svnweb.freebsd.org/changeset/base/341124 Log: sfxge(4): clarify port mode names and masks New port mode names are defined for Medford2 and later, and the existing names are aliased to them. Add comments with the numeric port mode to clarify the external port modes table. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18199 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:22:53 2018 (r341123) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:23:05 2018 (r341124) @@ -1372,11 +1372,11 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_HUNTINGTON, - (1 << TLV_PORT_MODE_10G) | - (1 << TLV_PORT_MODE_10G_10G) | - (1 << TLV_PORT_MODE_10G_10G_10G_10G), - 1, - 1 + (1U << TLV_PORT_MODE_10G) | /* mode 0 */ + (1U << TLV_PORT_MODE_10G_10G) | /* mode 2 */ + (1U << TLV_PORT_MODE_10G_10G_10G_10G), /* mode 4 */ + 1, /* ports per cage */ + 1 /* first cage */ }, /* * Modes that on Medford allocate each port number to a separate @@ -1388,10 +1388,10 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1 << TLV_PORT_MODE_10G) | - (1 << TLV_PORT_MODE_10G_10G), - 1, - 1 + (1U << TLV_PORT_MODE_10G) | /* mode 0 */ + (1U << TLV_PORT_MODE_10G_10G), /* mode 2 */ + 1, /* ports per cage */ + 1 /* first cage */ }, /* * Modes which for Huntington identify a chip variant where 2 @@ -1404,12 +1404,12 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_HUNTINGTON, - (1 << TLV_PORT_MODE_40G) | - (1 << TLV_PORT_MODE_40G_40G) | - (1 << TLV_PORT_MODE_40G_10G_10G) | - (1 << TLV_PORT_MODE_10G_10G_40G), - 2, - 1 + (1U << TLV_PORT_MODE_40G) | /* mode 1 */ + (1U << TLV_PORT_MODE_40G_40G) | /* mode 3 */ + (1U << TLV_PORT_MODE_40G_10G_10G) | /* mode 6 */ + (1U << TLV_PORT_MODE_10G_10G_40G), /* mode 7 */ + 2, /* ports per cage */ + 1 /* first cage */ }, /* * Modes that on Medford allocate 2 adjacent port numbers to each @@ -1421,13 +1421,14 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1 << TLV_PORT_MODE_40G) | - (1 << TLV_PORT_MODE_40G_40G) | - (1 << TLV_PORT_MODE_40G_10G_10G) | - (1 << TLV_PORT_MODE_10G_10G_40G) | - (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2), - 2, - 1 + (1U << TLV_PORT_MODE_40G) | /* mode 1 */ + (1U << TLV_PORT_MODE_40G_40G) | /* mode 3 */ + (1U << TLV_PORT_MODE_40G_10G_10G) | /* mode 6 */ + (1U << TLV_PORT_MODE_10G_10G_40G) | /* mode 7 */ + /* Do not use 10G_10G_10G_10G_Q1_Q2 (see bug63270) */ + (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2), /* mode 9 */ + 2, /* ports per cage */ + 1 /* first cage */ }, /* * Modes that on Medford allocate 4 adjacent port numbers to each @@ -1439,10 +1440,11 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q) | - (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q1), - 4, - 1, + (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q) | /* mode 5 */ + /* Do not use 10G_10G_10G_10G_Q1 (see bug63270) */ + (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q1), /* mode 4 */ + 4, /* ports per cage */ + 1 /* first cage */ }, /* * Modes that on Medford allocate 4 adjacent port numbers to each @@ -1454,9 +1456,9 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q2), - 4, - 2 + (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q2), /* mode 8 */ + 4, /* ports per cage */ + 2 /* first cage */ }, }; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 09:22:53 2018 (r341123) +++ head/sys/dev/sfxge/common/hunt_nic.c Wed Nov 28 09:23:05 2018 (r341124) @@ -63,7 +63,7 @@ hunt_nic_get_required_pcie_bandwidth( goto out; } - if (port_modes & (1 << TLV_PORT_MODE_40G_40G)) { + if (port_modes & (1U << TLV_PORT_MODE_40G_40G)) { /* * This needs the full PCIe bandwidth (and could use * more) - roughly 64 Gbit/s for 8 lanes of Gen3. @@ -72,9 +72,9 @@ hunt_nic_get_required_pcie_bandwidth( EFX_PCIE_LINK_SPEED_GEN3, &bandwidth)) != 0) goto fail1; } else { - if (port_modes & (1 << TLV_PORT_MODE_40G)) { + if (port_modes & (1U << TLV_PORT_MODE_40G)) { max_port_mode = TLV_PORT_MODE_40G; - } else if (port_modes & (1 << TLV_PORT_MODE_10G_10G_10G_10G)) { + } else if (port_modes & (1U << TLV_PORT_MODE_10G_10G_10G_10G)) { max_port_mode = TLV_PORT_MODE_10G_10G_10G_10G; } else { /* Assume two 10G ports */ From owner-svn-src-head@freebsd.org Wed Nov 28 09:23:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB0B7114DBAB; Wed, 28 Nov 2018 09:23:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52BFA6B018; Wed, 28 Nov 2018 09:23:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5066509; Wed, 28 Nov 2018 09:23:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9NJC3061990; Wed, 28 Nov 2018 09:23:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9NJqq061989; Wed, 28 Nov 2018 09:23:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280923.wAS9NJqq061989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341125 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52BFA6B018 X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.571,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:23:23 -0000 Author: arybchik Date: Wed Nov 28 09:23:19 2018 New Revision: 341125 URL: https://svnweb.freebsd.org/changeset/base/341125 Log: sfxge(4): group Medford external port mapping entries Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18200 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:23:05 2018 (r341124) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:23:19 2018 (r341125) @@ -1379,21 +1379,6 @@ static struct ef10_external_port_map_s { 1 /* first cage */ }, /* - * Modes that on Medford allocate each port number to a separate - * cage. - * port 0 -> cage 1 - * port 1 -> cage 2 - * port 2 -> cage 3 - * port 3 -> cage 4 - */ - { - EFX_FAMILY_MEDFORD, - (1U << TLV_PORT_MODE_10G) | /* mode 0 */ - (1U << TLV_PORT_MODE_10G_10G), /* mode 2 */ - 1, /* ports per cage */ - 1 /* first cage */ - }, - /* * Modes which for Huntington identify a chip variant where 2 * adjacent port numbers map to each cage. * SFN7x42Q (Monza): @@ -1409,6 +1394,21 @@ static struct ef10_external_port_map_s { (1U << TLV_PORT_MODE_40G_10G_10G) | /* mode 6 */ (1U << TLV_PORT_MODE_10G_10G_40G), /* mode 7 */ 2, /* ports per cage */ + 1 /* first cage */ + }, + /* + * Modes that on Medford allocate each port number to a separate + * cage. + * port 0 -> cage 1 + * port 1 -> cage 2 + * port 2 -> cage 3 + * port 3 -> cage 4 + */ + { + EFX_FAMILY_MEDFORD, + (1U << TLV_PORT_MODE_10G) | /* mode 0 */ + (1U << TLV_PORT_MODE_10G_10G), /* mode 2 */ + 1, /* ports per cage */ 1 /* first cage */ }, /* From owner-svn-src-head@freebsd.org Wed Nov 28 09:23:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77C95114DBFA; Wed, 28 Nov 2018 09:23:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A80CF6B0C8; Wed, 28 Nov 2018 09:23:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A949050A; Wed, 28 Nov 2018 09:23:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9NUYX062047; Wed, 28 Nov 2018 09:23:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9NUfH062046; Wed, 28 Nov 2018 09:23:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280923.wAS9NUfH062046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341126 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A80CF6B0C8 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:23:33 -0000 Author: arybchik Date: Wed Nov 28 09:23:30 2018 New Revision: 341126 URL: https://svnweb.freebsd.org/changeset/base/341126 Log: sfxge(4): add Medford2 support for external port numbers Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18201 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:23:19 2018 (r341125) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:23:30 2018 (r341126) @@ -1460,6 +1460,93 @@ static struct ef10_external_port_map_s { 4, /* ports per cage */ 2 /* first cage */ }, + /* + * Modes that on Medford2 allocate each port number to a separate + * cage. + * port 0 -> cage 1 + * port 1 -> cage 2 + * port 2 -> cage 3 + * port 3 -> cage 4 + */ + { + EFX_FAMILY_MEDFORD2, + (1U << TLV_PORT_MODE_1x1_NA) | /* mode 0 */ + (1U << TLV_PORT_MODE_1x4_NA) | /* mode 1 */ + (1U << TLV_PORT_MODE_1x1_1x1) | /* mode 2 */ + (1U << TLV_PORT_MODE_1x2_NA) | /* mode 10 */ + (1U << TLV_PORT_MODE_1x2_1x2) | /* mode 12 */ + (1U << TLV_PORT_MODE_1x4_1x2) | /* mode 15 */ + (1U << TLV_PORT_MODE_1x2_1x4), /* mode 16 */ + 1, /* ports per cage */ + 1 /* first cage */ + }, + /* + * FIXME: Some port modes are not representable in this mapping: + * - TLV_PORT_MODE_1x2_2x1 (mode 17): + * port 0 -> cage 1 + * port 1 -> cage 2 + * port 2 -> cage 2 + */ + /* + * Modes that on Medford2 allocate 2 adjacent port numbers to each + * cage, starting on cage 1. + * port 0 -> cage 1 + * port 1 -> cage 1 + * port 2 -> cage 2 + * port 3 -> cage 2 + */ + { + EFX_FAMILY_MEDFORD2, + (1U << TLV_PORT_MODE_1x4_1x4) | /* mode 3 */ + (1U << TLV_PORT_MODE_2x1_2x1) | /* mode 4 */ + (1U << TLV_PORT_MODE_1x4_2x1) | /* mode 6 */ + (1U << TLV_PORT_MODE_2x1_1x4) | /* mode 7 */ + (1U << TLV_PORT_MODE_2x2_NA) | /* mode 13 */ + (1U << TLV_PORT_MODE_2x1_1x2), /* mode 18 */ + 2, /* ports per cage */ + 1 /* first cage */ + }, + /* + * Modes that on Medford2 allocate 2 adjacent port numbers to each + * cage, starting on cage 2. + * port 0 -> cage 2 + * port 1 -> cage 2 + */ + { + EFX_FAMILY_MEDFORD2, + (1U << TLV_PORT_MODE_NA_2x2), /* mode 14 */ + 2, /* ports per cage */ + 2 /* first cage */ + }, + /* + * Modes that on Medford2 allocate 4 adjacent port numbers to each + * connector, starting on cage 1. + * port 0 -> cage 1 + * port 1 -> cage 1 + * port 2 -> cage 1 + * port 3 -> cage 1 + */ + { + EFX_FAMILY_MEDFORD2, + (1U << TLV_PORT_MODE_4x1_NA), /* mode 5 */ + 4, /* ports per cage */ + 1 /* first cage */ + }, + /* + * Modes that on Medford2 allocate 4 adjacent port numbers to each + * connector, starting on cage 2. + * port 0 -> cage 2 + * port 1 -> cage 2 + * port 2 -> cage 2 + * port 3 -> cage 2 + */ + { + EFX_FAMILY_MEDFORD2, + (1U << TLV_PORT_MODE_NA_4x1) | /* mode 8 */ + (1U << TLV_PORT_MODE_NA_1x2), /* mode 11 */ + 4, /* ports per cage */ + 2 /* first cage */ + }, }; static __checkReturn efx_rc_t From owner-svn-src-head@freebsd.org Wed Nov 28 09:23:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31F05114DC55; Wed, 28 Nov 2018 09:23:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA4B76B1CE; Wed, 28 Nov 2018 09:23:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97B0F50B; Wed, 28 Nov 2018 09:23:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9Nfc8062104; Wed, 28 Nov 2018 09:23:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9NfKv062103; Wed, 28 Nov 2018 09:23:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280923.wAS9NfKv062103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341127 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA4B76B1CE X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:23:43 -0000 Author: arybchik Date: Wed Nov 28 09:23:41 2018 New Revision: 341127 URL: https://svnweb.freebsd.org/changeset/base/341127 Log: sfxge(4): add Medford2 support for licensing Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18202 Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Wed Nov 28 09:23:30 2018 (r341126) +++ head/sys/dev/sfxge/common/efx_lic.c Wed Nov 28 09:23:41 2018 (r341127) @@ -192,7 +192,7 @@ static const efx_lic_ops_t __efx_lic_v2_ops = { #endif /* EFSYS_OPT_HUNTINGTON */ -#if EFSYS_OPT_MEDFORD +#if EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static __checkReturn efx_rc_t efx_mcdi_licensing_v3_update_licenses( @@ -316,7 +316,7 @@ static const efx_lic_ops_t __efx_lic_v3_ops = { efx_lic_v3_finish_partition, /* elo_finish_partition */ }; -#endif /* EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ /* V1 Licensing - used in Siena Modena only */ @@ -849,7 +849,7 @@ fail1: /* V3 Licensing - used starting from Medford family. See SF-114884-SW */ -#if EFSYS_OPT_MEDFORD +#if EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static __checkReturn efx_rc_t efx_mcdi_licensing_v3_update_licenses( @@ -859,7 +859,8 @@ efx_mcdi_licensing_v3_update_licenses( uint8_t payload[MC_CMD_LICENSING_V3_IN_LEN]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) || + (enp->en_family == EFX_FAMILY_MEDFORD2)); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING_V3; @@ -896,7 +897,8 @@ efx_mcdi_licensing_v3_report_license( MC_CMD_LICENSING_V3_OUT_LEN)]; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) || + (enp->en_family == EFX_FAMILY_MEDFORD2)); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING_V3; @@ -960,7 +962,8 @@ efx_mcdi_licensing_v3_app_state( uint32_t app_state; efx_rc_t rc; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); + EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) || + (enp->en_family == EFX_FAMILY_MEDFORD2)); (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_LICENSED_V3_APP_STATE; @@ -1292,7 +1295,7 @@ fail1: } -#endif /* EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ __checkReturn efx_rc_t efx_lic_init( @@ -1325,6 +1328,12 @@ efx_lic_init( elop = &__efx_lic_v3_ops; break; #endif /* EFSYS_OPT_MEDFORD */ + +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + elop = &__efx_lic_v3_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ default: EFSYS_ASSERT(0); From owner-svn-src-head@freebsd.org Wed Nov 28 09:23:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE4D3114DCB3; Wed, 28 Nov 2018 09:23:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88F2F6B334; Wed, 28 Nov 2018 09:23:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 054DC50D; Wed, 28 Nov 2018 09:23:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9Nqn8062164; Wed, 28 Nov 2018 09:23:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9NqnH062160; Wed, 28 Nov 2018 09:23:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280923.wAS9NqnH062160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341128 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88F2F6B334 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:23:57 -0000 Author: arybchik Date: Wed Nov 28 09:23:52 2018 New Revision: 341128 URL: https://svnweb.freebsd.org/changeset/base/341128 Log: sfxge(4): add Medford2 support for tunnel encapsulations Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18203 Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_tunnel.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Wed Nov 28 09:23:41 2018 (r341127) +++ head/sys/dev/sfxge/common/efx_check.h Wed Nov 28 09:23:52 2018 (r341128) @@ -365,8 +365,8 @@ /* Support hardware assistance for tunnels */ #if EFSYS_OPT_TUNNEL -# if !EFSYS_OPT_MEDFORD -# error "TUNNEL requires MEDFORD" +# if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "TUNNEL requires MEDFORD or MEDFORD2" # endif #endif /* EFSYS_OPT_TUNNEL */ Modified: head/sys/dev/sfxge/common/efx_tunnel.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tunnel.c Wed Nov 28 09:23:41 2018 (r341127) +++ head/sys/dev/sfxge/common/efx_tunnel.c Wed Nov 28 09:23:52 2018 (r341128) @@ -46,20 +46,20 @@ static const efx_tunnel_ops_t __efx_tunnel_dummy_ops = }; #endif /* EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON */ -#if EFSYS_OPT_MEDFORD +#if EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static __checkReturn boolean_t -medford_udp_encap_supported( +ef10_udp_encap_supported( __in efx_nic_t *enp); static __checkReturn efx_rc_t -medford_tunnel_reconfigure( +ef10_tunnel_reconfigure( __in efx_nic_t *enp); -static const efx_tunnel_ops_t __efx_tunnel_medford_ops = { - medford_udp_encap_supported, /* eto_udp_encap_supported */ - medford_tunnel_reconfigure, /* eto_reconfigure */ +static const efx_tunnel_ops_t __efx_tunnel_ef10_ops = { + ef10_udp_encap_supported, /* eto_udp_encap_supported */ + ef10_tunnel_reconfigure, /* eto_reconfigure */ }; -#endif /* EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ static __checkReturn efx_rc_t efx_mcdi_set_tunnel_encap_udp_ports( @@ -190,10 +190,16 @@ efx_tunnel_init( #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - etop = &__efx_tunnel_medford_ops; + etop = &__efx_tunnel_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ +#if EFSYS_OPT_MEDFORD2 + case EFX_FAMILY_MEDFORD2: + etop = &__efx_tunnel_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD2 */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; @@ -423,9 +429,9 @@ fail1: return (rc); } -#if EFSYS_OPT_MEDFORD +#if EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 static __checkReturn boolean_t -medford_udp_encap_supported( +ef10_udp_encap_supported( __in efx_nic_t *enp) { const efx_nic_cfg_t *encp = &enp->en_nic_cfg; @@ -439,7 +445,7 @@ medford_udp_encap_supported( } static __checkReturn efx_rc_t -medford_tunnel_reconfigure( +ef10_tunnel_reconfigure( __in efx_nic_t *enp) { efx_tunnel_cfg_t *etcp = &enp->en_tunnel_cfg; @@ -452,7 +458,7 @@ medford_tunnel_reconfigure( memcpy(&etc, etcp, sizeof (etc)); EFSYS_UNLOCK(enp->en_eslp, state); - if (medford_udp_encap_supported(enp) == B_FALSE) { + if (ef10_udp_encap_supported(enp) == B_FALSE) { /* * It is OK to apply empty UDP tunnel ports when UDP * tunnel encapsulations are not supported - just nothing @@ -487,6 +493,6 @@ fail1: return (rc); } -#endif /* EFSYS_OPT_MEDFORD */ +#endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ #endif /* EFSYS_OPT_TUNNEL */ From owner-svn-src-head@freebsd.org Wed Nov 28 09:24:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35258114DCF2; Wed, 28 Nov 2018 09:24:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC8DF6B407; Wed, 28 Nov 2018 09:24:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFDD250F; Wed, 28 Nov 2018 09:24:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9O37R062224; Wed, 28 Nov 2018 09:24:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9O3iF062223; Wed, 28 Nov 2018 09:24:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280924.wAS9O3iF062223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341129 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC8DF6B407 X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.571,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:24:05 -0000 Author: arybchik Date: Wed Nov 28 09:24:03 2018 New Revision: 341129 URL: https://svnweb.freebsd.org/changeset/base/341129 Log: sfxge(4): provide a flag for controlling CTPIO mode Either cut-through or store-and-forward mode. Submitted by: Guido Barzini Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18204 Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:23:52 2018 (r341128) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:24:03 2018 (r341129) @@ -7304,6 +7304,8 @@ #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_WIDTH 1 #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_LBN 13 #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_WIDTH 1 +#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_UTHRESH_LBN 14 +#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_UTHRESH_WIDTH 1 /* Owner ID to use if in buffer mode (zero if physical) */ #define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_OFST 20 #define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_LEN 4 From owner-svn-src-head@freebsd.org Wed Nov 28 09:24:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0096114DD49; Wed, 28 Nov 2018 09:24:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0A76B4F0; Wed, 28 Nov 2018 09:24:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B383510; Wed, 28 Nov 2018 09:24:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9OFp5062283; Wed, 28 Nov 2018 09:24:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9OEJW062281; Wed, 28 Nov 2018 09:24:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280924.wAS9OEJW062281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341130 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A0A76B4F0 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.58)[0.576,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:24:43 -0000 Author: arybchik Date: Wed Nov 28 09:24:14 2018 New Revision: 341130 URL: https://svnweb.freebsd.org/changeset/base/341130 Log: sfxge(4): add 1.3V voltage and current sensors Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18205 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:24:03 2018 (r341129) +++ head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:24:14 2018 (r341130) @@ -655,7 +655,7 @@ efx_mon_init( #define EFX_MON_STATS_PAGE_SIZE 0x100 #define EFX_MON_MASK_ELEMENT_SIZE 32 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock fcc1b6748432e1ac */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 400fdb0517af1fca */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -738,6 +738,8 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_I2V5, EFX_MON_STAT_I3V3, EFX_MON_STAT_I12V0, + EFX_MON_STAT_1_3V, + EFX_MON_STAT_I1V3, EFX_MON_NSTATS } efx_mon_stat_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Wed Nov 28 09:24:03 2018 (r341129) +++ head/sys/dev/sfxge/common/efx_mon.c Wed Nov 28 09:24:14 2018 (r341130) @@ -128,7 +128,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock a808884b01444549 */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock 8150a068198c0f96 */ static const char * const __mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -211,6 +211,8 @@ static const char * const __mon_stat_name[] = { "i2v5", "i3v3", "i12v0", + "1v3", + "i1v3", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Wed Nov 28 09:24:03 2018 (r341129) +++ head/sys/dev/sfxge/common/mcdi_mon.c Wed Nov 28 09:24:14 2018 (r341130) @@ -162,6 +162,10 @@ static const struct mcdi_sensor_map_s { STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ STAT(Px, I1V8), /* 0x51 IN_I1V8 */ STAT(Px, I2V5), /* 0x52 IN_I2V5 */ + STAT(Px, I3V3), /* 0x53 IN_I3V3 */ + STAT(Px, I12V0), /* 0x54 IN_I12V0 */ + STAT(Px, 1_3V), /* 0x55 IN_1V3 */ + STAT(Px, I1V3), /* 0x56 IN_I1V3 */ }; #define MCDI_STATIC_SENSOR_ASSERT(_field) \ From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 938BC114DD92; Wed, 28 Nov 2018 09:25:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88CE16B50B; Wed, 28 Nov 2018 09:24:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A006511; Wed, 28 Nov 2018 09:24:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9OQ4Q062340; Wed, 28 Nov 2018 09:24:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9OQ0U062339; Wed, 28 Nov 2018 09:24:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280924.wAS9OQ0U062339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341131 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88CE16B50B X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.571,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:03 -0000 Author: arybchik Date: Wed Nov 28 09:24:25 2018 New Revision: 341131 URL: https://svnweb.freebsd.org/changeset/base/341131 Log: sfxge(4): document the event type for CTPIO sends Document the TX_EV_TYPE used for TX completion events corresponding to CTPIO sends. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18206 Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:24:14 2018 (r341130) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:24:25 2018 (r341131) @@ -6751,6 +6751,10 @@ #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_LEN 1 /* enum: This is a TX completion event, not a timestamp */ #define TX_TIMESTAMP_EVENT_TX_EV_COMPLETION 0x0 +/* enum: This is a TX completion event for a CTPIO transmit. The event format + * is the same as for TX_EV_COMPLETION. + */ +#define TX_TIMESTAMP_EVENT_TX_EV_CTPIO_COMPLETION 0x11 /* enum: This is the low part of a TX timestamp event */ #define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_LO 0x51 /* enum: This is the high part of a TX timestamp event */ From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E8B114DDB7; Wed, 28 Nov 2018 09:25:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DAE36B532; Wed, 28 Nov 2018 09:24:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D488512; Wed, 28 Nov 2018 09:24:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9Obj9062397; Wed, 28 Nov 2018 09:24:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9ObUh062396; Wed, 28 Nov 2018 09:24:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280924.wAS9ObUh062396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341132 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6DAE36B532 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:06 -0000 Author: arybchik Date: Wed Nov 28 09:24:36 2018 New Revision: 341132 URL: https://svnweb.freebsd.org/changeset/base/341132 Log: sfxge(4): run genfwdef to update headers Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18207 Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Nov 28 09:24:25 2018 (r341131) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Wed Nov 28 09:24:36 2018 (r341132) @@ -58,6 +58,7 @@ * 1: dynamic configuration * 2: firmware internal use * 3: license partition + * 4: tsa configuration * * - TTT is a type, which is just a unique value. The same type value * might appear in both locations, indicating a relationship between @@ -580,6 +581,7 @@ struct tlv_global_port_mode { #define TLV_PORT_MODE_1x2_1x4 (16) /* Single 50G on mdi0, single 40G on mdi1 */ #define TLV_PORT_MODE_1x2_2x1 (17) /* Single 50G on mdi0, dual 10G/25G on mdi1 */ #define TLV_PORT_MODE_2x1_1x2 (18) /* Dual 10G/25G on mdi0, single 50G on mdi1 */ +/* Below modes are eftest only, to allow snapper explicit selection between multi-channel and LLPCS. In production, this selection is automatic and outside world should not care about LLPCS */ #define TLV_PORT_MODE_2x1_2x1_LL (19) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1, low-latency PCS */ #define TLV_PORT_MODE_4x1_NA_LL (20) /* Quad 10G/25G on mdi0, low-latency PCS */ #define TLV_PORT_MODE_NA_4x1_LL (21) /* Quad 10G/25G on mdi1, low-latency PCS */ @@ -618,6 +620,7 @@ struct tlv_global_port_mode { #define TLV_PORT_MODE_50G_40G TLV_PORT_MODE_1x2_1x4 /* Single 50G on mdi0, single 40G on mdi1 */ #define TLV_PORT_MODE_50G_25G_25G TLV_PORT_MODE_1x2_2x1 /* Single 50G on mdi0, dual 25G on mdi1 */ #define TLV_PORT_MODE_25G_25G_50G TLV_PORT_MODE_2x1_1x2 /* Dual 25G on mdi0, single 50G on mdi1 */ +/* eftest only, see comments for _LL modes above */ #define TLV_PORT_MODE_25G_25G_25G_25G_Q1_Q2_LL TLV_PORT_MODE_2x1_2x1_LL /* Dual 25G on mdi0, dual 25G on mdi1, low-latency PCS */ #define TLV_PORT_MODE_25G_25G_25G_25G_Q1_LL TLV_PORT_MODE_4x1_NA_LL /* Quad 25G on mdi0, low-latency PCS */ #define TLV_PORT_MODE_25G_25G_25G_25G_Q2_LL TLV_PORT_MODE_NA_4x1_LL /* Quad 25G on mdi1, low-latency PCS */ @@ -881,7 +884,7 @@ typedef struct tlv_license { uint8_t data[]; } tlv_license_t; -/* TSA NIC IP address configuration +/* TSA NIC IP address configuration (DEPRECATED) * * Sets the TSA NIC IP address statically via configuration tool or dynamically * via DHCP via snooping based on the mode selection (0=Static, 1=DHCP, 2=Snoop) @@ -891,7 +894,7 @@ typedef struct tlv_license { * released code yet. */ -#define TLV_TAG_TMP_TSAN_CONFIG (0x10220000) +#define TLV_TAG_TMP_TSAN_CONFIG (0x10220000) /* DEPRECATED */ #define TLV_TSAN_IP_MODE_STATIC (0) #define TLV_TSAN_IP_MODE_DHCP (1) @@ -908,7 +911,7 @@ typedef struct tlv_tsan_config { uint32_t bind_bkout; /* DEPRECATED */ } tlv_tsan_config_t; -/* TSA Controller IP address configuration +/* TSA Controller IP address configuration (DEPRECATED) * * Sets the TSA Controller IP address statically via configuration tool * @@ -917,7 +920,7 @@ typedef struct tlv_tsan_config { * released code yet. */ -#define TLV_TAG_TMP_TSAC_CONFIG (0x10230000) +#define TLV_TAG_TMP_TSAC_CONFIG (0x10230000) /* DEPRECATED */ #define TLV_MAX_TSACS (4) typedef struct tlv_tsac_config { @@ -928,7 +931,7 @@ typedef struct tlv_tsac_config { uint32_t port[TLV_MAX_TSACS]; } tlv_tsac_config_t; -/* Binding ticket +/* Binding ticket (DEPRECATED) * * Sets the TSA NIC binding ticket used for binding process between the TSA NIC * and the TSA Controller @@ -938,7 +941,7 @@ typedef struct tlv_tsac_config { * released code yet. */ -#define TLV_TAG_TMP_BINDING_TICKET (0x10240000) +#define TLV_TAG_TMP_BINDING_TICKET (0x10240000) /* DEPRECATED */ typedef struct tlv_binding_ticket { uint32_t tag; @@ -963,7 +966,7 @@ typedef struct tlv_pik_sf { uint8_t bytes[]; } tlv_pik_sf_t; -/* CA root certificate +/* CA root certificate (DEPRECATED) * * Sets the CA root certificate used for TSA Controller verfication during * TLS connection setup between the TSA NIC and the TSA Controller @@ -973,7 +976,7 @@ typedef struct tlv_pik_sf { * released code yet. */ -#define TLV_TAG_TMP_CA_ROOT_CERT (0x10260000) +#define TLV_TAG_TMP_CA_ROOT_CERT (0x10260000) /* DEPRECATED */ typedef struct tlv_ca_root_cert { uint32_t tag; From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD2ED114DE13; Wed, 28 Nov 2018 09:25:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69EA26B651; Wed, 28 Nov 2018 09:24:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C5E0514; Wed, 28 Nov 2018 09:24:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9OxNJ062510; Wed, 28 Nov 2018 09:24:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9OxBq062509; Wed, 28 Nov 2018 09:24:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280924.wAS9OxBq062509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341134 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69EA26B651 X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.571,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:33 -0000 Author: arybchik Date: Wed Nov 28 09:24:58 2018 New Revision: 341134 URL: https://svnweb.freebsd.org/changeset/base/341134 Log: sfxge(4): add bit to indicate CTPIO availability Submitted by: Guido Barzini Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18209 Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:24:47 2018 (r341133) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:24:58 2018 (r341134) @@ -9578,6 +9578,8 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_BACKGROUND_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_DB_RETURN_LBN 14 #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_DB_RETURN_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_CTPIO_LBN 15 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_CTPIO_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -9865,6 +9867,8 @@ #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_BACKGROUND_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_DB_RETURN_LBN 14 #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_DB_RETURN_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_CTPIO_LBN 15 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_CTPIO_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -10177,6 +10181,8 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_BACKGROUND_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_DB_RETURN_LBN 14 #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_DB_RETURN_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_CTPIO_LBN 15 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_CTPIO_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F387114DEAB; Wed, 28 Nov 2018 09:25:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D43166B749; Wed, 28 Nov 2018 09:25:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DFB5518; Wed, 28 Nov 2018 09:25:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9PWu2062693; Wed, 28 Nov 2018 09:25:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9PW0H062692; Wed, 28 Nov 2018 09:25:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280925.wAS9PW0H062692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341137 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D43166B749 X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.571,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:37 -0000 Author: arybchik Date: Wed Nov 28 09:25:31 2018 New Revision: 341137 URL: https://svnweb.freebsd.org/changeset/base/341137 Log: sfxge(4): add encapsulated TSOv2 capability Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18212 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:25:21 2018 (r341136) +++ head/sys/dev/sfxge/common/ef10_nic.c Wed Nov 28 09:25:31 2018 (r341137) @@ -1084,6 +1084,12 @@ ef10_get_datapath_caps( encp->enc_fw_assisted_tso_v2_n_contexts = 0; } + /* Check if the firmware supports FATSOv2 encap */ + if (CAP_FLAGS2(req, TX_TSO_V2_ENCAP)) + encp->enc_fw_assisted_tso_v2_encap_enabled = B_TRUE; + else + encp->enc_fw_assisted_tso_v2_encap_enabled = B_FALSE; + /* Check if the firmware has vadapter/vport/vswitch support */ if (CAP_FLAGS1(req, EVB)) encp->enc_datapath_cap_evb = B_TRUE; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:25:21 2018 (r341136) +++ head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:25:31 2018 (r341137) @@ -1258,6 +1258,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_tx_tso_tcp_header_offset_limit; boolean_t enc_fw_assisted_tso_enabled; boolean_t enc_fw_assisted_tso_v2_enabled; + boolean_t enc_fw_assisted_tso_v2_encap_enabled; /* Number of TSO contexts on the NIC (FATSOv2) */ uint32_t enc_fw_assisted_tso_v2_n_contexts; boolean_t enc_hw_tx_insert_vlan_enabled; From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22C4E114DDF7; Wed, 28 Nov 2018 09:25:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B62AD6B630; Wed, 28 Nov 2018 09:24:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42036513; Wed, 28 Nov 2018 09:24:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9OmCX062454; Wed, 28 Nov 2018 09:24:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9Omdc062453; Wed, 28 Nov 2018 09:24:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280924.wAS9Omdc062453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341133 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B62AD6B630 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:32 -0000 Author: arybchik Date: Wed Nov 28 09:24:47 2018 New Revision: 341133 URL: https://svnweb.freebsd.org/changeset/base/341133 Log: sfxge(4): add CTPIO statistics Submitted by: Guido Barzini Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18208 Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:24:36 2018 (r341132) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 28 09:24:47 2018 (r341133) @@ -4125,10 +4125,86 @@ #define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE2 0x65 /* enum: Number of corrected 10-bit symbol errors, lane 3 (RS-FEC only) */ #define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE3 0x66 -/* enum: This includes the final GENERATION_END */ +/* enum: This includes the space at offset 103 which is the final + * GENERATION_END in a MAC_STATS_V2 response and otherwise unused. + */ #define MC_CMD_MAC_NSTATS_V2 0x68 /* Other enum values, see field(s): */ /* MC_CMD_MAC_STATS_OUT_NO_DMA/STATISTICS */ + +/* MC_CMD_MAC_STATS_V3_OUT_DMA msgresponse */ +#define MC_CMD_MAC_STATS_V3_OUT_DMA_LEN 0 + +/* MC_CMD_MAC_STATS_V3_OUT_NO_DMA msgresponse */ +#define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_LEN (((MC_CMD_MAC_NSTATS_V3*64))>>3) +#define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_OFST 0 +#define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_LEN 8 +#define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_LO_OFST 0 +#define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_HI_OFST 4 +#define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS_V3 +/* enum: Start of CTPIO stats buffer space, Medford2 and up */ +#define MC_CMD_MAC_CTPIO_DMABUF_START 0x68 +/* enum: Number of CTPIO fallbacks because a DMA packet was in progress on the + * target VI + */ +#define MC_CMD_MAC_CTPIO_VI_BUSY_FALLBACK 0x68 +/* enum: Number of times a CTPIO send wrote beyond frame end (informational + * only) + */ +#define MC_CMD_MAC_CTPIO_LONG_WRITE_SUCCESS 0x69 +/* enum: Number of CTPIO failures because the TX doorbell was written before + * the end of the frame data + */ +#define MC_CMD_MAC_CTPIO_MISSING_DBELL_FAIL 0x6a +/* enum: Number of CTPIO failures because the internal FIFO overflowed */ +#define MC_CMD_MAC_CTPIO_OVERFLOW_FAIL 0x6b +/* enum: Number of CTPIO failures because the host did not deliver data fast + * enough to avoid MAC underflow + */ +#define MC_CMD_MAC_CTPIO_UNDERFLOW_FAIL 0x6c +/* enum: Number of CTPIO failures because the host did not deliver all the + * frame data within the timeout + */ +#define MC_CMD_MAC_CTPIO_TIMEOUT_FAIL 0x6d +/* enum: Number of CTPIO failures because the frame data arrived out of order + * or with gaps + */ +#define MC_CMD_MAC_CTPIO_NONCONTIG_WR_FAIL 0x6e +/* enum: Number of CTPIO failures because the host started a new frame before + * completing the previous one + */ +#define MC_CMD_MAC_CTPIO_FRM_CLOBBER_FAIL 0x6f +/* enum: Number of CTPIO failures because a write was not a multiple of 32 bits + * or not 32-bit aligned + */ +#define MC_CMD_MAC_CTPIO_INVALID_WR_FAIL 0x70 +/* enum: Number of CTPIO fallbacks because another VI on the same port was + * sending a CTPIO frame + */ +#define MC_CMD_MAC_CTPIO_VI_CLOBBER_FALLBACK 0x71 +/* enum: Number of CTPIO fallbacks because target VI did not have CTPIO enabled + */ +#define MC_CMD_MAC_CTPIO_UNQUALIFIED_FALLBACK 0x72 +/* enum: Number of CTPIO fallbacks because length in header was less than 29 + * bytes + */ +#define MC_CMD_MAC_CTPIO_RUNT_FALLBACK 0x73 +/* enum: Total number of successful CTPIO sends on this port */ +#define MC_CMD_MAC_CTPIO_SUCCESS 0x74 +/* enum: Total number of CTPIO fallbacks on this port */ +#define MC_CMD_MAC_CTPIO_FALLBACK 0x75 +/* enum: Total number of CTPIO poisoned frames on this port, whether erased or + * not + */ +#define MC_CMD_MAC_CTPIO_POISON 0x76 +/* enum: Total number of CTPIO erased frames on this port */ +#define MC_CMD_MAC_CTPIO_ERASE 0x77 +/* enum: This includes the space at offset 120 which is the final + * GENERATION_END in a MAC_STATS_V3 response and otherwise unused. + */ +#define MC_CMD_MAC_NSTATS_V3 0x79 +/* Other enum values, see field(s): */ +/* MC_CMD_MAC_STATS_V2_OUT_NO_DMA/STATISTICS */ /***********************************/ From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C54EF114DE36; Wed, 28 Nov 2018 09:25:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B75146B6D1; Wed, 28 Nov 2018 09:25:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80D93516; Wed, 28 Nov 2018 09:25:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9PAWY062578; Wed, 28 Nov 2018 09:25:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9PA8c062577; Wed, 28 Nov 2018 09:25:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280925.wAS9PA8c062577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341135 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B75146B6D1 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.58)[0.576,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:35 -0000 Author: arybchik Date: Wed Nov 28 09:25:09 2018 New Revision: 341135 URL: https://svnweb.freebsd.org/changeset/base/341135 Log: sfxge(4): regenerate headers to pick up CTPIO stats Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18210 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:24:58 2018 (r341134) +++ head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:25:09 2018 (r341135) @@ -351,7 +351,7 @@ efx_intr_fini( #if EFSYS_OPT_MAC_STATS -/* START MKCONFIG GENERATED EfxHeaderMacBlock 7b5f45054a3b45bc */ +/* START MKCONFIG GENERATED EfxHeaderMacBlock 7d59c0d68431a5d1 */ typedef enum efx_mac_stat_e { EFX_MAC_RX_OCTETS, EFX_MAC_RX_PKTS, @@ -440,6 +440,22 @@ typedef enum efx_mac_stat_e { EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE1, EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE2, EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE3, + EFX_MAC_CTPIO_VI_BUSY_FALLBACK, + EFX_MAC_CTPIO_LONG_WRITE_SUCCESS, + EFX_MAC_CTPIO_MISSING_DBELL_FAIL, + EFX_MAC_CTPIO_OVERFLOW_FAIL, + EFX_MAC_CTPIO_UNDERFLOW_FAIL, + EFX_MAC_CTPIO_TIMEOUT_FAIL, + EFX_MAC_CTPIO_NONCONTIG_WR_FAIL, + EFX_MAC_CTPIO_FRM_CLOBBER_FAIL, + EFX_MAC_CTPIO_INVALID_WR_FAIL, + EFX_MAC_CTPIO_VI_CLOBBER_FALLBACK, + EFX_MAC_CTPIO_UNQUALIFIED_FALLBACK, + EFX_MAC_CTPIO_RUNT_FALLBACK, + EFX_MAC_CTPIO_SUCCESS, + EFX_MAC_CTPIO_FALLBACK, + EFX_MAC_CTPIO_POISON, + EFX_MAC_CTPIO_ERASE, EFX_MAC_NSTATS } efx_mac_stat_t; Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Wed Nov 28 09:24:58 2018 (r341134) +++ head/sys/dev/sfxge/common/efx_mac.c Wed Nov 28 09:25:09 2018 (r341135) @@ -521,7 +521,7 @@ efx_mac_filter_default_rxq_clear( #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxMacStatNamesBlock 8726fc355b6e7c1a */ +/* START MKCONFIG GENERATED EfxMacStatNamesBlock 3cfa8780abd28993 */ static const char * const __efx_mac_stat_name[] = { "rx_octets", "rx_pkts", @@ -610,6 +610,22 @@ static const char * const __efx_mac_stat_name[] = { "fec_corrected_symbols_lane1", "fec_corrected_symbols_lane2", "fec_corrected_symbols_lane3", + "ctpio_vi_busy_fallback", + "ctpio_long_write_success", + "ctpio_missing_dbell_fail", + "ctpio_overflow_fail", + "ctpio_underflow_fail", + "ctpio_timeout_fail", + "ctpio_noncontig_wr_fail", + "ctpio_frm_clobber_fail", + "ctpio_invalid_wr_fail", + "ctpio_vi_clobber_fallback", + "ctpio_unqualified_fallback", + "ctpio_runt_fallback", + "ctpio_success", + "ctpio_fallback", + "ctpio_poison", + "ctpio_erase", }; /* END MKCONFIG GENERATED EfxMacStatNamesBlock */ From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E20C114DE76; Wed, 28 Nov 2018 09:25:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3C956B707; Wed, 28 Nov 2018 09:25:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84EAB517; Wed, 28 Nov 2018 09:25:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9PLmS062635; Wed, 28 Nov 2018 09:25:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9PLAd062634; Wed, 28 Nov 2018 09:25:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280925.wAS9PLAd062634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341136 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3C956B707 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:36 -0000 Author: arybchik Date: Wed Nov 28 09:25:21 2018 New Revision: 341136 URL: https://svnweb.freebsd.org/changeset/base/341136 Log: sfxge(4): support CTPIO stats Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18211 Modified: head/sys/dev/sfxge/common/ef10_mac.c Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Wed Nov 28 09:25:09 2018 (r341135) +++ head/sys/dev/sfxge/common/ef10_mac.c Wed Nov 28 09:25:21 2018 (r341136) @@ -950,6 +950,61 @@ ef10_mac_stats_update( EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE3]), &value); + if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS_V3) + goto done; + + /* CTPIO exceptions */ + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_VI_BUSY_FALLBACK, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_VI_BUSY_FALLBACK]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_LONG_WRITE_SUCCESS, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_LONG_WRITE_SUCCESS]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_MISSING_DBELL_FAIL, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_MISSING_DBELL_FAIL]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_OVERFLOW_FAIL, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_OVERFLOW_FAIL]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_UNDERFLOW_FAIL, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_UNDERFLOW_FAIL]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_TIMEOUT_FAIL, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_TIMEOUT_FAIL]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_NONCONTIG_WR_FAIL, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_NONCONTIG_WR_FAIL]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_FRM_CLOBBER_FAIL, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_FRM_CLOBBER_FAIL]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_INVALID_WR_FAIL, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_INVALID_WR_FAIL]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_VI_CLOBBER_FALLBACK, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_VI_CLOBBER_FALLBACK]), + &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_UNQUALIFIED_FALLBACK, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_UNQUALIFIED_FALLBACK]), + &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_RUNT_FALLBACK, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_RUNT_FALLBACK]), &value); + + /* CTPIO per-port stats */ + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_SUCCESS, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_SUCCESS]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_FALLBACK, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_FALLBACK]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_POISON, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_POISON]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_ERASE, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_ERASE]), &value); + done: /* Read START generation counter */ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp)); From owner-svn-src-head@freebsd.org Wed Nov 28 09:25:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700A3114DF6F; Wed, 28 Nov 2018 09:25:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F5A26B8B6; Wed, 28 Nov 2018 09:25:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB149521; Wed, 28 Nov 2018 09:25:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAS9Pi1S062755; Wed, 28 Nov 2018 09:25:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAS9PhOo062750; Wed, 28 Nov 2018 09:25:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811280925.wAS9PhOo062750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Nov 2018 09:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341138 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 341138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F5A26B8B6 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 09:25:47 -0000 Author: arybchik Date: Wed Nov 28 09:25:43 2018 New Revision: 341138 URL: https://svnweb.freebsd.org/changeset/base/341138 Log: sfxge(4): add outer IP ID parameter to TSOv2 descriptor Set outer_ip_id in the TX option descriptor for encapsulated packets. Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18213 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 09:25:31 2018 (r341137) +++ head/sys/dev/sfxge/common/ef10_impl.h Wed Nov 28 09:25:43 2018 (r341138) @@ -782,6 +782,7 @@ extern void ef10_tx_qdesc_tso2_create( __in efx_txq_t *etp, __in uint16_t ipv4_id, + __in uint16_t outer_ipv4_id, __in uint32_t tcp_seq, __in uint16_t tcp_mss, __out_ecount(count) efx_desc_t *edp, Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Wed Nov 28 09:25:31 2018 (r341137) +++ head/sys/dev/sfxge/common/ef10_tx.c Wed Nov 28 09:25:43 2018 (r341138) @@ -650,6 +650,7 @@ ef10_tx_qdesc_tso_create( ef10_tx_qdesc_tso2_create( __in efx_txq_t *etp, __in uint16_t ipv4_id, + __in uint16_t outer_ipv4_id, __in uint32_t tcp_seq, __in uint16_t tcp_mss, __out_ecount(count) efx_desc_t *edp, @@ -671,13 +672,14 @@ ef10_tx_qdesc_tso2_create( ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A, ESF_DZ_TX_TSO_IP_ID, ipv4_id, ESF_DZ_TX_TSO_TCP_SEQNO, tcp_seq); - EFX_POPULATE_QWORD_4(edp[1].ed_eq, + EFX_POPULATE_QWORD_5(edp[1].ed_eq, ESF_DZ_TX_DESC_IS_OPT, 1, ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_TSO, ESF_DZ_TX_TSO_OPTION_TYPE, ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B, - ESF_DZ_TX_TSO_TCP_MSS, tcp_mss); + ESF_DZ_TX_TSO_TCP_MSS, tcp_mss, + ESF_DZ_TX_TSO_OUTER_IPID, outer_ipv4_id); } void Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:25:31 2018 (r341137) +++ head/sys/dev/sfxge/common/efx.h Wed Nov 28 09:25:43 2018 (r341138) @@ -2323,6 +2323,7 @@ extern void efx_tx_qdesc_tso2_create( __in efx_txq_t *etp, __in uint16_t ipv4_id, + __in uint16_t outer_ipv4_id, __in uint32_t tcp_seq, __in uint16_t tcp_mss, __out_ecount(count) efx_desc_t *edp, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Nov 28 09:25:31 2018 (r341137) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Nov 28 09:25:43 2018 (r341138) @@ -145,7 +145,7 @@ typedef struct efx_tx_ops_s { uint32_t, uint8_t, efx_desc_t *); void (*etxo_qdesc_tso2_create)(efx_txq_t *, uint16_t, - uint32_t, uint16_t, + uint16_t, uint32_t, uint16_t, efx_desc_t *, int); void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t, efx_desc_t *); Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Wed Nov 28 09:25:31 2018 (r341137) +++ head/sys/dev/sfxge/common/efx_tx.c Wed Nov 28 09:25:43 2018 (r341138) @@ -654,6 +654,7 @@ efx_tx_qdesc_tso_create( efx_tx_qdesc_tso2_create( __in efx_txq_t *etp, __in uint16_t ipv4_id, + __in uint16_t outer_ipv4_id, __in uint32_t tcp_seq, __in uint16_t mss, __out_ecount(count) efx_desc_t *edp, @@ -665,7 +666,8 @@ efx_tx_qdesc_tso2_create( EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); EFSYS_ASSERT(etxop->etxo_qdesc_tso2_create != NULL); - etxop->etxo_qdesc_tso2_create(etp, ipv4_id, tcp_seq, mss, edp, count); + etxop->etxo_qdesc_tso2_create(etp, ipv4_id, outer_ipv4_id, + tcp_seq, mss, edp, count); } void Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Wed Nov 28 09:25:31 2018 (r341137) +++ head/sys/dev/sfxge/sfxge_tx.c Wed Nov 28 09:25:43 2018 (r341138) @@ -1176,6 +1176,7 @@ static int tso_start_new_packet(struct sfxge_txq *txq, desc = &txq->pend_desc[txq->n_pend_desc]; efx_tx_qdesc_tso2_create(txq->common, tso->packet_id, + 0, tso->seqnum, tso->seg_size, desc, From owner-svn-src-head@freebsd.org Wed Nov 28 13:25:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A4AD115441A; Wed, 28 Nov 2018 13:25:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E204A73D49; Wed, 28 Nov 2018 13:25:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C385C2CBC; Wed, 28 Nov 2018 13:25:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASDPAj1085795; Wed, 28 Nov 2018 13:25:10 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASDPAG5085794; Wed, 28 Nov 2018 13:25:10 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201811281325.wASDPAG5085794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 28 Nov 2018 13:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341140 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 341140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E204A73D49 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.31)[0.309,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; NEURAL_SPAM_LONG(0.47)[0.465,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 13:25:11 -0000 Author: sbruno Date: Wed Nov 28 13:25:10 2018 New Revision: 341140 URL: https://svnweb.freebsd.org/changeset/base/341140 Log: Add CAPABILITIES to the ERL kernel config so that tools that have been modified with Capsicum work on this target platform. This came up after the conversion of wc(8). Modified: head/sys/mips/conf/ERL Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Wed Nov 28 11:58:40 2018 (r341139) +++ head/sys/mips/conf/ERL Wed Nov 28 13:25:10 2018 (r341140) @@ -91,6 +91,8 @@ options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel options TMPFS # Temporary file system +options CAPABILITY_MODE # Capsicum capability mode +options CAPABILITIES # Capsicum capabilities # Debugging for use in -current #options KDB # Enable kernel debugger support. From owner-svn-src-head@freebsd.org Wed Nov 28 13:25:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C25411154465; Wed, 28 Nov 2018 13:25:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65C7973E37; Wed, 28 Nov 2018 13:25:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CBE22CBD; Wed, 28 Nov 2018 13:25:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASDPN7l085850; Wed, 28 Nov 2018 13:25:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASDPNOv085849; Wed, 28 Nov 2018 13:25:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811281325.wASDPNOv085849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 28 Nov 2018 13:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341141 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 341141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65C7973E37 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.309,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 13:25:23 -0000 Author: manu Date: Wed Nov 28 13:25:22 2018 New Revision: 341141 URL: https://svnweb.freebsd.org/changeset/base/341141 Log: rk_clk_composite: Fix set_mux Pointy Hat: manu Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.c Wed Nov 28 13:25:10 2018 (r341140) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.c Wed Nov 28 13:25:22 2018 (r341141) @@ -126,7 +126,7 @@ rk_clk_composite_set_mux(struct clknode *clk, int inde DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, &val); - val &= ~(sc->mux_mask >> sc->mux_shift); + val &= ~sc->mux_mask; val |= index << sc->mux_shift; WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); From owner-svn-src-head@freebsd.org Wed Nov 28 13:53:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A030F115517F; Wed, 28 Nov 2018 13:53:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39DC974F6D; Wed, 28 Nov 2018 13:53:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AC1E318A; Wed, 28 Nov 2018 13:53:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASDrjXd000977; Wed, 28 Nov 2018 13:53:45 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASDriwE000969; Wed, 28 Nov 2018 13:53:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811281353.wASDriwE000969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 28 Nov 2018 13:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341142 - in head/sys: arm64/rockchip conf modules/rockchip modules/rockchip/rk805 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/rockchip conf modules/rockchip modules/rockchip/rk805 X-SVN-Commit-Revision: 341142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 39DC974F6D X-Spamd-Result: default: False [1.27 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.42)[0.424,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.296,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 13:53:45 -0000 Author: manu Date: Wed Nov 28 13:53:43 2018 New Revision: 341142 URL: https://svnweb.freebsd.org/changeset/base/341142 Log: Add RK805 PMIC Support RK805 is the companion PMIC for RK3328 SoC. Add a driver for it with most of it's regulators supported. MFC after: 1 month Added: head/sys/arm64/rockchip/rk805.c (contents, props changed) head/sys/arm64/rockchip/rk805reg.h (contents, props changed) head/sys/modules/rockchip/rk805/ head/sys/modules/rockchip/rk805/Makefile (contents, props changed) Modified: head/sys/conf/files.arm64 head/sys/modules/rockchip/Makefile Added: head/sys/arm64/rockchip/rk805.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk805.c Wed Nov 28 13:53:43 2018 (r341142) @@ -0,0 +1,422 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +#include "regdev_if.h" + +MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); + +static struct ofw_compat_data compat_data[] = { + {"rockchip,rk805", 1}, + {NULL, 0} +}; + +struct rk805_regdef { + intptr_t id; + char *name; + uint8_t enable_reg; + uint8_t enable_mask; + uint8_t voltage_reg; + uint8_t voltage_mask; + int voltage_min; + int voltage_max; + int voltage_step; + int voltage_nstep; +}; + +struct rk805_reg_sc { + struct regnode *regnode; + device_t base_dev; + struct rk805_regdef *def; + phandle_t xref; + struct regnode_std_param *param; +}; + +struct rk805_softc { + device_t dev; + struct mtx mtx; + struct resource * res[1]; + void * intrcookie; + struct intr_config_hook intr_hook; + + struct rk805_reg_sc **regs; + int nregs; +}; + +static struct rk805_regdef rk805_regdefs[] = { + { + .id = RK805_DCDC1, + .name = "DCDC_REG1", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x11, + .voltage_reg = RK805_DCDC1_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1450000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + .id = RK805_DCDC2, + .name = "DCDC_REG2", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x22, + .voltage_reg = RK805_DCDC2_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1450000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + .id = RK805_DCDC3, + .name = "DCDC_REG3", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x44, + }, + { + .id = RK805_DCDC4, + .name = "DCDC_REG4", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x88, + .voltage_reg = RK805_DCDC4_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 800000, + .voltage_max = 3500000, + .voltage_step = 100000, + .voltage_nstep = 28, + }, +}; + +static int +rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + + return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT)); +} + +static int +rk805_write(device_t dev, uint8_t reg, uint8_t data) +{ + struct iic_msg msg; + uint8_t buf[2]; + + buf[0] = reg; + buf[1] = data; + msg.slave = iicbus_get_addr(dev); + msg.flags = IIC_M_WR; + msg.buf = buf; + msg.len = sizeof(buf); + + return (iicbus_transfer_excl(dev, &msg, 1, IIC_INTRWAIT)); +} + +static int +rk805_regnode_init(struct regnode *regnode) +{ + return (0); +} + +static int +rk805_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct rk805_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + rk805_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (enable) + val |= sc->def->enable_mask; + else + val &= ~sc->def->enable_mask; + rk805_write(sc->base_dev, sc->def->enable_reg, val); + + *udelay = 0; + + return (0); +} + +static void +rk805_regnode_reg_to_voltage(struct rk805_reg_sc *sc, uint8_t val, int *uv) +{ + if (val < sc->def->voltage_nstep) + *uv = sc->def->voltage_min + val * sc->def->voltage_step; + else + *uv = sc->def->voltage_min + + (sc->def->voltage_nstep * sc->def->voltage_step); +} + +static int +rk805_regnode_voltage_to_reg(struct rk805_reg_sc *sc, int min_uvolt, + int max_uvolt, uint8_t *val) +{ + uint8_t nval; + int nstep, uvolt; + + nval = 0; + uvolt = sc->def->voltage_min; + + for (nstep = 0; nstep < sc->def->voltage_nstep && uvolt < min_uvolt; + nstep++) { + ++nval; + uvolt += sc->def->voltage_step; + } + if (uvolt > max_uvolt) + return (EINVAL); + + *val = nval; + return (0); +} + +static int +rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct rk805_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + if (rk805_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + return (ERANGE); + + rk805_write(sc->base_dev, sc->def->voltage_reg, val); + + *udelay = 0; + + return (0); +} + +static int +rk805_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct rk805_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + rk805_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); + + return (0); +} + +static regnode_method_t rk805_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, rk805_regnode_init), + REGNODEMETHOD(regnode_enable, rk805_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, rk805_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, rk805_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(rk805_regnode, rk805_regnode_class, rk805_regnode_methods, + sizeof(struct rk805_reg_sc), regnode_class); + +static struct rk805_reg_sc * +rk805_reg_attach(device_t dev, phandle_t node, + struct rk805_regdef *def) +{ + struct rk805_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + + memset(&initdef, 0, sizeof(initdef)); + if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + if (initdef.std_param.min_uvolt == 0) + initdef.std_param.min_uvolt = def->voltage_min; + if (initdef.std_param.max_uvolt == 0) + initdef.std_param.max_uvolt = def->voltage_max; + initdef.id = def->id; + initdef.ofw_node = node; + regnode = regnode_create(dev, &rk805_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->def = def; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + regnode_register(regnode); + + return (reg_sc); +} + +static int +rk805_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "RockChip RK805 PMIC"); + return (BUS_PROBE_DEFAULT); +} + +static void +rk805_start(void *pdev) +{ + struct rk805_softc *sc; + device_t dev; + uint8_t data[2]; + int err; + + dev = pdev; + sc = device_get_softc(dev); + sc->dev = dev; + + if (bootverbose) { + err = rk805_read(dev, 0x17, data, 1); + if (err != 0) { + device_printf(dev, "Cannot read chip name reg\n"); + return; + } + err = rk805_read(dev, 0x18, data + 1, 1); + if (err != 0) { + device_printf(dev, "Cannot read chip version reg\n"); + return; + } + device_printf(dev, "Chip Name: %x\n", + data[0] << 4 | ((data[1] >> 4) & 0xf)); + device_printf(dev, "Chip Version: %x\n", data[1] & 0xf); + } + + config_intrhook_disestablish(&sc->intr_hook); +} + +static int +rk805_attach(device_t dev) +{ + struct rk805_softc *sc; + struct rk805_reg_sc *reg; + struct rk805_regdef *regdefs; + phandle_t rnode, child; + int i; + + sc = device_get_softc(dev); + + sc->intr_hook.ich_func = rk805_start; + sc->intr_hook.ich_arg = dev; + + if (config_intrhook_establish(&sc->intr_hook) != 0) + return (ENOMEM); + + sc->regs = malloc(sizeof(struct rk805_reg_sc *) * sc->nregs, + M_RK805_REG, M_WAITOK | M_ZERO); + + regdefs = rk805_regdefs; + sc->nregs = nitems(rk805_regdefs); + + rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); + if (rnode > 0) { + for (i = 0; i < sc->nregs; i++) { + child = ofw_bus_find_child(rnode, + regdefs[i].name); + if (child == 0) + continue; + reg = rk805_reg_attach(dev, child, ®defs[i]); + if (reg == NULL) { + device_printf(dev, + "cannot attach regulator %s\n", + regdefs[i].name); + continue; + } + sc->regs[i] = reg; + if (bootverbose) + device_printf(dev, "Regulator %s attached\n", + regdefs[i].name); + } + } + + return (0); +} + +static int +rk805_detach(device_t dev) +{ + + /* We cannot detach regulators */ + return (EBUSY); +} + +static device_method_t rk805_methods[] = { + DEVMETHOD(device_probe, rk805_probe), + DEVMETHOD(device_attach, rk805_attach), + DEVMETHOD(device_detach, rk805_detach), + + DEVMETHOD_END +}; + +static driver_t rk805_driver = { + "rk805_pmu", + rk805_methods, + sizeof(struct rk805_softc), +}; + +static devclass_t rk805_devclass; + +EARLY_DRIVER_MODULE(rk805, iicbus, rk805_driver, rk805_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_DEPEND(rk805, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(rk805, 1); Added: head/sys/arm64/rockchip/rk805reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk805reg.h Wed Nov 28 13:53:43 2018 (r341142) @@ -0,0 +1,72 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#ifndef _RK805REG_H_ +#define _RK805REG_H_ + +#define RK805_CHIP_NAME 0x17 +#define RK805_CHIP_VER 0x18 +#define RK805_OTP_VER 0x19 + +#define RK805_DCDC_EN 0x23 +#define RK805_SLEEP_DCDC_EN 0x25 +#define RK805_SLEEP_LDO_EN 0x26 +#define RK805_LDO_EN 0x27 +#define RK805_SLEEP_LDO_LP_EN 0x2A + +#define RK805_DCDC1_CONFIG 0x2E +#define RK805_DCDC1_ON_VSEL 0x2F +#define RK805_DCDC1_SLEEP_VSEL 0x30 +#define RK805_DCDC2_CONFIG 0x32 +#define RK805_DCDC2_ON_VSEL 0x33 +#define RK805_DCDC2_SLEEP_VSEL 0x34 +#define RK805_DCDC3_CONFIG 0x36 +#define RK805_DCDC4_CONFIG 0x37 +#define RK805_DCDC4_ON_VSEL 0x38 +#define RK805_DCDC4_SLEEP_VSEL 0x39 +#define RK805_LDO1_ON_VSEL 0x3B +#define RK805_LDO1_SLEEP_VSEL 0x3C +#define RK805_LDO2_ON_VSEL 0x3D +#define RK805_LDO2_SLEEP_VSEL 0x3E +#define RK805_LDO3_ON_VSEL 0x3F +#define RK805_LDO3_SLEEP_VSEL 0x40 + +enum rk805_regulator { + RK805_DCDC1, + RK805_DCDC2, + RK805_DCDC3, + RK805_DCDC4, + RK805_LDO1, + RK805_LDO2, + RK805_LDO3, +}; + +#endif /* _RK805REG_H_ */ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Nov 28 13:25:22 2018 (r341141) +++ head/sys/conf/files.arm64 Wed Nov 28 13:53:43 2018 (r341142) @@ -253,6 +253,7 @@ cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrac cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" arm64/rockchip/rk_i2c.c optional rk_i2c fdt soc_rockchip_rk3328 +arm64/rockchip/rk805.c optional rk805 fdt soc_rockchip_rk3328 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 arm64/rockchip/rk_pinctrl.c optional fdt soc_rockchip_rk3328 arm64/rockchip/rk_gpio.c optional fdt soc_rockchip_rk3328 Modified: head/sys/modules/rockchip/Makefile ============================================================================== --- head/sys/modules/rockchip/Makefile Wed Nov 28 13:25:22 2018 (r341141) +++ head/sys/modules/rockchip/Makefile Wed Nov 28 13:53:43 2018 (r341142) @@ -3,5 +3,6 @@ SUBDIR = \ rk_i2c \ + rk805 .include Added: head/sys/modules/rockchip/rk805/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/rockchip/rk805/Makefile Wed Nov 28 13:53:43 2018 (r341142) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm64/rockchip + +KMOD= rk805 +SRCS= rk805.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + iicbus_if.h \ + regnode_if.h \ + regdev_if.h \ + ofw_bus_if.h \ + opt_platform.h \ + +.include From owner-svn-src-head@freebsd.org Wed Nov 28 13:54:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B836115526A; Wed, 28 Nov 2018 13:54:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3F317511E; Wed, 28 Nov 2018 13:54:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C507F318B; Wed, 28 Nov 2018 13:54:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASDsdHY001057; Wed, 28 Nov 2018 13:54:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASDsdLP001056; Wed, 28 Nov 2018 13:54:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811281354.wASDsdLP001056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 28 Nov 2018 13:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341143 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 341143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3F317511E X-Spamd-Result: default: False [1.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_SHORT(0.28)[0.277,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 13:54:40 -0000 Author: manu Date: Wed Nov 28 13:54:39 2018 New Revision: 341143 URL: https://svnweb.freebsd.org/changeset/base/341143 Log: arm64: Add rk_i2c and rk805 to GENERIC MFC after: 1 month Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Nov 28 13:53:43 2018 (r341142) +++ head/sys/arm64/conf/GENERIC Wed Nov 28 13:54:39 2018 (r341143) @@ -209,6 +209,7 @@ device bcm2835_bsc # Broadcom BCM283x I2C bus device iicbus device iic device twsi # Allwinner I2C controller +device rk_i2c # RockChip I2C controller # Clock and reset controllers device aw_ccu # Allwinner clock controller @@ -225,6 +226,7 @@ device aw_wdog # Allwinner Watchdog # Power management controllers device axp81x # X-Powers AXP81x PMIC +device rk805 # RockChip RK805 PMIC # EFUSE device aw_sid # Allwinner Secure ID EFUSE From owner-svn-src-head@freebsd.org Wed Nov 28 14:07:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEBB511559A9; Wed, 28 Nov 2018 14:07:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DBB675ABB; Wed, 28 Nov 2018 14:07:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EB3E3323; Wed, 28 Nov 2018 14:07:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASE7ZAZ006456; Wed, 28 Nov 2018 14:07:35 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASE7ZvZ006455; Wed, 28 Nov 2018 14:07:35 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811281407.wASE7ZvZ006455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 28 Nov 2018 14:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341144 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 341144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DBB675ABB X-Spamd-Result: default: False [1.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.28)[0.277,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 14:07:35 -0000 Author: vmaffione Date: Wed Nov 28 14:07:34 2018 New Revision: 341144 URL: https://svnweb.freebsd.org/changeset/base/341144 Log: netmap: set IFCAP_NETMAP in if_capabilities Revision r307394 removed (by mistake) the code that sets IFCAP_NETMAP in if_capabilities on netmap_attach. This patch reverts this change. Reviewed by: np Approved by: gnn (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17987 Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Wed Nov 28 13:54:39 2018 (r341143) +++ head/sys/dev/netmap/netmap_freebsd.c Wed Nov 28 14:07:34 2018 (r341144) @@ -1549,6 +1549,7 @@ out: void nm_os_onattach(struct ifnet *ifp) { + ifp->if_capabilities |= IFCAP_NETMAP; } void From owner-svn-src-head@freebsd.org Wed Nov 28 15:30:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E865011575C0; Wed, 28 Nov 2018 15:29:59 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE8F785C1; Wed, 28 Nov 2018 15:29:59 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7100144A4; Wed, 28 Nov 2018 15:29:59 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASFTxPm047742; Wed, 28 Nov 2018 15:29:59 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASFTxES047740; Wed, 28 Nov 2018 15:29:59 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811281529.wASFTxES047740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 28 Nov 2018 15:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341145 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 341145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8FE8F785C1 X-Spamd-Result: default: False [1.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.47)[0.475,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 15:30:00 -0000 Author: vmaffione Date: Wed Nov 28 15:29:58 2018 New Revision: 341145 URL: https://svnweb.freebsd.org/changeset/base/341145 Log: cxgbe: revert r309725 After the fix contained in r341144, cxgbe does not need anymore to set the IFCAP_NETMAP flag manually. Reviewed by: np Approved by: gnn (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17987 Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Nov 28 14:07:34 2018 (r341144) +++ head/sys/dev/cxgbe/t4_main.c Wed Nov 28 15:29:58 2018 (r341145) @@ -1633,10 +1633,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) if (vi->nofldrxq != 0) ifp->if_capabilities |= IFCAP_TOE; #endif -#ifdef DEV_NETMAP - if (vi->nnmrxq != 0) - ifp->if_capabilities |= IFCAP_NETMAP; -#endif #ifdef RATELIMIT if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0) { ifp->if_capabilities |= IFCAP_TXRTLMT; @@ -1656,7 +1652,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP - if (ifp->if_capabilities & IFCAP_NETMAP) + if (vi->nnmrxq != 0) cxgbe_nm_attach(vi); #endif sb = sbuf_new_auto(); Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Wed Nov 28 14:07:34 2018 (r341144) +++ head/sys/dev/cxgbe/t4_netmap.c Wed Nov 28 15:29:58 2018 (r341145) @@ -982,7 +982,7 @@ cxgbe_nm_attach(struct vi_info *vi) na.nm_register = cxgbe_netmap_reg; na.num_tx_rings = vi->nnmtxq; na.num_rx_rings = vi->nnmrxq; - netmap_attach(&na); + netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */ } void From owner-svn-src-head@freebsd.org Wed Nov 28 16:00:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC511158670; Wed, 28 Nov 2018 16:00:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63A357A190; Wed, 28 Nov 2018 16:00:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C3EC49BA; Wed, 28 Nov 2018 16:00:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASG0rGj064288; Wed, 28 Nov 2018 16:00:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASG0qFS064284; Wed, 28 Nov 2018 16:00:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811281600.wASG0qFS064284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 28 Nov 2018 16:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341148 - in head/sys/powerpc: aim include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include powerpc X-SVN-Commit-Revision: 341148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63A357A190 X-Spamd-Result: default: False [1.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.36)[0.364,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.487,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 16:00:54 -0000 Author: jhibbits Date: Wed Nov 28 16:00:52 2018 New Revision: 341148 URL: https://svnweb.freebsd.org/changeset/base/341148 Log: powerpc: Don't include KERNBASE in genassym, it's unnecessary A related future change, which changes KERNBASE for Book-E for some reason causes a "KERNBASE redefined" error with assym.inc, even though it only changed the value of KERNBASE and nothing else. Since machine/vmparam.h is already included in booke/locore.S, and the requisite guards are already in place for properly handling KERNBASE in vmparam.h, just remove it from genassym, and include vmparam.h in the AIM locore files. Modified: head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/include/vmparam.h head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Wed Nov 28 15:34:46 2018 (r341147) +++ head/sys/powerpc/aim/locore32.S Wed Nov 28 16:00:52 2018 (r341148) @@ -33,6 +33,7 @@ #include #include #include +#include #include "opt_platform.h" /* Locate the per-CPU data structure */ Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Wed Nov 28 15:34:46 2018 (r341147) +++ head/sys/powerpc/aim/locore64.S Wed Nov 28 16:00:52 2018 (r341148) @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef _CALL_ELF .abiversion _CALL_ELF Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Wed Nov 28 15:34:46 2018 (r341147) +++ head/sys/powerpc/include/vmparam.h Wed Nov 28 16:00:52 2018 (r341148) @@ -117,7 +117,7 @@ #endif #ifdef AIM -#define KERNBASE 0x00100100UL /* start of kernel virtual */ +#define KERNBASE 0x00100100 /* start of kernel virtual */ #ifndef __powerpc64__ #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT) Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Wed Nov 28 15:34:46 2018 (r341147) +++ head/sys/powerpc/powerpc/genassym.c Wed Nov 28 16:00:52 2018 (r341148) @@ -225,7 +225,6 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); -ASSYM(KERNBASE, KERNBASE); ASSYM(DMAP_BASE_ADDRESS, DMAP_BASE_ADDRESS); ASSYM(MAXCOMLEN, MAXCOMLEN); From owner-svn-src-head@freebsd.org Wed Nov 28 17:37:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082B41137603; Wed, 28 Nov 2018 17:37:19 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1F577E59D; Wed, 28 Nov 2018 17:37:18 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 830F059DE; Wed, 28 Nov 2018 17:37:18 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASHbIax015132; Wed, 28 Nov 2018 17:37:18 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASHbIOQ015130; Wed, 28 Nov 2018 17:37:18 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811281737.wASHbIOQ015130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 28 Nov 2018 17:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341156 - in head/sys/dev: ixgbe ixl X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head/sys/dev: ixgbe ixl X-SVN-Commit-Revision: 341156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1F577E59D X-Spamd-Result: default: False [1.13 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_SHORT(0.42)[0.421,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 17:37:19 -0000 Author: shurd Date: Wed Nov 28 17:37:17 2018 New Revision: 341156 URL: https://svnweb.freebsd.org/changeset/base/341156 Log: Fix first-packet completion The first packet after the ring is initialized was never completed as isc_txd_credits_update() would not include it in the count of completed packets. This caused netmap to never complete a batch. See PR 233022 for more details. This is the same fix as the r340310 for e1000 PR: 233607 Reported by: lev Reviewed by: lev MFC after: 3 days Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D18368 Modified: head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Wed Nov 28 17:31:34 2018 (r341155) +++ head/sys/dev/ixgbe/ix_txrx.c Wed Nov 28 17:37:17 2018 (r341156) @@ -297,6 +297,8 @@ ixgbe_isc_txd_credits_update(void *arg, uint16_t txqid ntxd = scctx->isc_ntxd[0]; do { delta = (int32_t)cur - (int32_t)prev; + if (prev == 0 && cur == 0) + delta += 1; if (delta < 0) delta += ntxd; Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Wed Nov 28 17:31:34 2018 (r341155) +++ head/sys/dev/ixl/ixl_txrx.c Wed Nov 28 17:37:17 2018 (r341156) @@ -516,7 +516,13 @@ ixl_isc_txd_credits_update_dwb(void *arg, uint16_t txq ntxd = scctx->isc_ntxd[0]; do { delta = (int32_t)cur - (int32_t)prev; + /* + * XXX This appears to be a hack for first-packet. + * A correct fix would prevent prev == cur in the first place. + */ MPASS(prev == 0 || delta != 0); + if (prev == 0 && cur == 0) + delta += 1; if (delta < 0) delta += ntxd; #if 0 From owner-svn-src-head@freebsd.org Wed Nov 28 18:09:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C7E311385E6; Wed, 28 Nov 2018 18:09:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D32F780280; Wed, 28 Nov 2018 18:09:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B06205EDD; Wed, 28 Nov 2018 18:09:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASI9hFZ030988; Wed, 28 Nov 2018 18:09:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASI9hdw030985; Wed, 28 Nov 2018 18:09:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201811281809.wASI9hdw030985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 28 Nov 2018 18:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341160 - in head/stand/i386: common gptboot zfsboot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/stand/i386: common gptboot zfsboot X-SVN-Commit-Revision: 341160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D32F780280 X-Spamd-Result: default: False [1.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.495,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; NEURAL_SPAM_LONG(0.51)[0.511,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 18:09:44 -0000 Author: ian Date: Wed Nov 28 18:09:42 2018 New Revision: 341160 URL: https://svnweb.freebsd.org/changeset/base/341160 Log: Add comments describing the bootargs handoff between loader(8) and gptboot or zfsboot, when loader(8) is the BTX loader. No functional changes. Modified: head/stand/i386/common/bootargs.h head/stand/i386/gptboot/gptboot.c head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/common/bootargs.h ============================================================================== --- head/stand/i386/common/bootargs.h Wed Nov 28 18:06:16 2018 (r341159) +++ head/stand/i386/common/bootargs.h Wed Nov 28 18:09:42 2018 (r341160) @@ -43,6 +43,24 @@ #ifndef __ASSEMBLER__ +/* + * This struct describes the contents of the stack on entry to btxldr.S. This + * is the data that follows the return address, so it begins at 4(%esp). On + * the sending side, this data is passed as individual args to __exec(). On the + * receiving side, code in btxldr.S copies the data from the entry stack to a + * known fixed location in the new address space. Then, btxcsu.S sets the + * global variable __args to point to that known fixed location before calling + * main(), which casts __args to a struct bootargs pointer to access the data. + * The btxldr.S code is aware of KARGS_FLAGS_EXTARG, and if it's set, the extra + * args data is copied along with the other bootargs from the entry stack to the + * fixed location in the new address space. + * + * The bootinfo field is actually a pointer to a bootinfo struct that has been + * converted to uint32_t using VTOP(). On the receiving side it must be + * converted back to a pointer using PTOV(). Code in btxldr.S is aware of this + * field and if it's non-NULL it copies the data it points to into another known + * fixed location, and adjusts the bootinfo field to point to that new location. + */ struct bootargs { uint32_t howto; Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Wed Nov 28 18:06:16 2018 (r341159) +++ head/stand/i386/gptboot/gptboot.c Wed Nov 28 18:09:42 2018 (r341160) @@ -487,6 +487,12 @@ load(void) geliargs.keybuf_sentinel = KEYBUF_SENTINEL; geliargs.keybuf = gelibuf; #endif + /* + * Note that the geliargs struct is passed by value, not by pointer. + * Code in btxldr.S copies the values from the entry stack to a fixed + * location within loader(8) at startup due to the presence of the + * KARGS_FLAGS_EXTARG flag. + */ __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[gdsk.dsk.type], gdsk.dsk.part + 1, gdsk.dsk.unit, 0xff), #ifdef LOADER_GELI_SUPPORT Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Wed Nov 28 18:06:16 2018 (r341159) +++ head/stand/i386/zfsboot/zfsboot.c Wed Nov 28 18:09:42 2018 (r341160) @@ -1005,6 +1005,11 @@ load(void) zfsargs.primary_vdev = primary_vdev->v_guid; else printf("failed to detect primary vdev\n"); + /* + * Note that the zfsargs struct is passed by value, not by pointer. Code in + * btxldr.S copies the values from the entry stack to a fixed location + * within loader(8) at startup due to the presence of KARGS_FLAGS_EXTARG. + */ __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), bootdev, KARGS_FLAGS_ZFS | KARGS_FLAGS_EXTARG, From owner-svn-src-head@freebsd.org Wed Nov 28 19:17:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BBF2113A323; Wed, 28 Nov 2018 19:17:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C868182DCA; Wed, 28 Nov 2018 19:17:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A67E76A61; Wed, 28 Nov 2018 19:17:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASJHSJC066550; Wed, 28 Nov 2018 19:17:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASJHSXP066547; Wed, 28 Nov 2018 19:17:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811281917.wASJHSXP066547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 28 Nov 2018 19:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341162 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 341162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C868182DCA X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.17)[-0.165,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; NEURAL_SPAM_LONG(0.51)[0.511,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 19:17:29 -0000 Author: glebius Date: Wed Nov 28 19:17:27 2018 New Revision: 341162 URL: https://svnweb.freebsd.org/changeset/base/341162 Log: For not offpage zones the slab is placed at the end of page. Keg's uk_pgoff is calculated to guarantee that struct uma_slab is placed at pointer size alignment. Calculation of real struct uma_slab size is done in keg_ctor() and yet again in keg_large_init(), to check if we need an extra page. This calculation can actually be performed at compile time. - Add SIZEOF_UMA_SLAB macro to calculate size of struct uma_slab placed at an end of a page with alignment requirement. - Use SIZEOF_UMA_SLAB in keg_ctor() and in keg_large_init(). This is a not a functional change. - Use SIZEOF_UMA_SLAB in UMA_SLAB_SPACE definition and in keg_small_init(). This is a potential bugfix, but in reality I don't think there are any systems affected, since compiler aligns struct uma_slab anyway. Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Nov 28 18:42:42 2018 (r341161) +++ head/sys/vm/uma_core.c Wed Nov 28 19:17:27 2018 (r341162) @@ -1453,7 +1453,7 @@ keg_small_init(uma_keg_t keg) if (keg->uk_flags & UMA_ZONE_OFFPAGE) shsize = 0; else - shsize = sizeof(struct uma_slab); + shsize = SIZEOF_UMA_SLAB; if (rsize <= slabsize - shsize) keg->uk_ipers = (slabsize - shsize) / rsize; @@ -1523,7 +1523,6 @@ keg_small_init(uma_keg_t keg) static void keg_large_init(uma_keg_t keg) { - u_int shsize; KASSERT(keg != NULL, ("Keg is null in keg_large_init")); KASSERT((keg->uk_flags & UMA_ZFLAG_CACHEONLY) == 0, @@ -1536,23 +1535,17 @@ keg_large_init(uma_keg_t keg) keg->uk_rsize = keg->uk_size; /* Check whether we have enough space to not do OFFPAGE. */ - if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0) { - shsize = sizeof(struct uma_slab); - if (shsize & UMA_ALIGN_PTR) - shsize = (shsize & ~UMA_ALIGN_PTR) + - (UMA_ALIGN_PTR + 1); - - if (PAGE_SIZE * keg->uk_ppera - keg->uk_rsize < shsize) { - /* - * We can't do OFFPAGE if we're internal, in which case - * we need an extra page per allocation to contain the - * slab header. - */ - if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) == 0) - keg->uk_flags |= UMA_ZONE_OFFPAGE; - else - keg->uk_ppera++; - } + if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0 && + PAGE_SIZE * keg->uk_ppera - keg->uk_rsize < SIZEOF_UMA_SLAB) { + /* + * We can't do OFFPAGE if we're internal, in which case + * we need an extra page per allocation to contain the + * slab header. + */ + if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) == 0) + keg->uk_flags |= UMA_ZONE_OFFPAGE; + else + keg->uk_ppera++; } if ((keg->uk_flags & UMA_ZONE_OFFPAGE) && @@ -1693,20 +1686,11 @@ keg_ctor(void *mem, int size, void *udata, int flags) /* * If we're putting the slab header in the actual page we need to - * figure out where in each page it goes. This calculates a right - * justified offset into the memory on an ALIGN_PTR boundary. + * figure out where in each page it goes. See SIZEOF_UMA_SLAB + * macro definition. */ if (!(keg->uk_flags & UMA_ZONE_OFFPAGE)) { - u_int totsize; - - /* Size of the slab struct and free list */ - totsize = sizeof(struct uma_slab); - - if (totsize & UMA_ALIGN_PTR) - totsize = (totsize & ~UMA_ALIGN_PTR) + - (UMA_ALIGN_PTR + 1); - keg->uk_pgoff = (PAGE_SIZE * keg->uk_ppera) - totsize; - + keg->uk_pgoff = (PAGE_SIZE * keg->uk_ppera) - SIZEOF_UMA_SLAB; /* * The only way the following is possible is if with our * UMA_ALIGN_PTR adjustments we are now bigger than @@ -1714,13 +1698,10 @@ keg_ctor(void *mem, int size, void *udata, int flags) * mathematically possible for all cases, so we make * sure here anyway. */ - totsize = keg->uk_pgoff + sizeof(struct uma_slab); - if (totsize > PAGE_SIZE * keg->uk_ppera) { - printf("zone %s ipers %d rsize %d size %d\n", - zone->uz_name, keg->uk_ipers, keg->uk_rsize, - keg->uk_size); - panic("UMA slab won't fit."); - } + KASSERT(keg->uk_pgoff + sizeof(struct uma_slab) <= + PAGE_SIZE * keg->uk_ppera, + ("zone %s ipers %d rsize %d size %d slab won't fit", + zone->uz_name, keg->uk_ipers, keg->uk_rsize, keg->uk_size)); } if (keg->uk_flags & UMA_ZONE_HASH) Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Nov 28 18:42:42 2018 (r341161) +++ head/sys/vm/uma_int.h Wed Nov 28 19:17:27 2018 (r341162) @@ -139,9 +139,17 @@ #define UMA_MAX_WASTE 10 /* - * Size of memory in a not offpage slab available for actual items. + * Actual size of uma_slab when it is placed at an end of a page + * with pointer sized alignment requirement. */ -#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) +#define SIZEOF_UMA_SLAB ((sizeof(struct uma_slab) & UMA_ALIGN_PTR) ? \ + (sizeof(struct uma_slab) & ~UMA_ALIGN_PTR) + \ + (UMA_ALIGN_PTR + 1) : sizeof(struct uma_slab)) + +/* + * Size of memory in a not offpage single page slab available for actual items. + */ +#define UMA_SLAB_SPACE (PAGE_SIZE - SIZEOF_UMA_SLAB) /* * I doubt there will be many cases where this is exceeded. This is the initial From owner-svn-src-head@freebsd.org Wed Nov 28 19:54:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 607D4113BD94; Wed, 28 Nov 2018 19:54:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05B1A8664B; Wed, 28 Nov 2018 19:54:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAD6E70F1; Wed, 28 Nov 2018 19:54:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASJs2rp091762; Wed, 28 Nov 2018 19:54:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASJs2QB091761; Wed, 28 Nov 2018 19:54:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201811281954.wASJs2QB091761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 28 Nov 2018 19:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341163 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 341163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05B1A8664B X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_SHORT(0.36)[0.361,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 19:54:03 -0000 Author: glebius Date: Wed Nov 28 19:54:02 2018 New Revision: 341163 URL: https://svnweb.freebsd.org/changeset/base/341163 Log: Fix yet another edge case in uma_startup_count(). If zone size fits into several pages, but leaves no space for struct uma_slab at the end we miscalculate number of pages by one. Totally mimic keg_large_init() math here to cover that problem. Reported by: gallatin Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Nov 28 19:17:27 2018 (r341162) +++ head/sys/vm/uma_core.c Wed Nov 28 19:54:02 2018 (r341163) @@ -1991,10 +1991,17 @@ uma_startup_count(int vm_zones) #endif /* Memory for the rest of startup zones, UMA and VM, ... */ - if (zsize > UMA_SLAB_SPACE) - pages += (zones + vm_zones) * - howmany(roundup2(zsize, UMA_BOOT_ALIGN), UMA_SLAB_SIZE); - else if (roundup2(zsize, UMA_BOOT_ALIGN) > UMA_SLAB_SPACE) + if (zsize > UMA_SLAB_SPACE) { + /* See keg_large_init(). */ + u_int ppera; + + ppera = howmany(roundup2(zsize, UMA_BOOT_ALIGN), PAGE_SIZE); + if (PAGE_SIZE * ppera - roundup2(zsize, UMA_BOOT_ALIGN) < + SIZEOF_UMA_SLAB) + ppera++; + pages += (zones + vm_zones) * ppera; + } else if (roundup2(zsize, UMA_BOOT_ALIGN) > UMA_SLAB_SPACE) + /* See keg_small_init() special case for uk_ppera = 1. */ pages += zones; else pages += howmany(zones, From owner-svn-src-head@freebsd.org Wed Nov 28 20:03:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B323113C19D; Wed, 28 Nov 2018 20:03:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F5C886D68; Wed, 28 Nov 2018 20:03:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FF48729C; Wed, 28 Nov 2018 20:03:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wASK3sn9097233; Wed, 28 Nov 2018 20:03:54 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wASK3rcn097230; Wed, 28 Nov 2018 20:03:53 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201811282003.wASK3rcn097230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 28 Nov 2018 20:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341164 - in head/bin/sh: . tests/expansion X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in head/bin/sh: . tests/expansion X-SVN-Commit-Revision: 341164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F5C886D68 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.36)[0.361,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.47)[0.465,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 20:03:54 -0000 Author: jilles Date: Wed Nov 28 20:03:53 2018 New Revision: 341164 URL: https://svnweb.freebsd.org/changeset/base/341164 Log: sh: Fix ${param?} default error message If word in ${param?word} is missing, the shell shall write a default error message. So expanding ${param?} when param is not set should write an error message like sh: param: parameter not set This was broken by r316417. PR: 233585 Added: head/bin/sh/tests/expansion/question2.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/tests/expansion/Makefile Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Nov 28 19:54:02 2018 (r341163) +++ head/bin/sh/expand.c Wed Nov 28 20:03:53 2018 (r341164) @@ -623,10 +623,11 @@ static const char * subevalvar_misc(const char *p, struct nodelist **restrict argbackq, const char *var, int subtype, int startloc, int varflags) { + const char *end; char *startp; int amount; - p = argstr(p, argbackq, EXP_TILDE, NULL); + end = argstr(p, argbackq, EXP_TILDE, NULL); STACKSTRNUL(expdest); startp = stackblock() + startloc; @@ -635,7 +636,7 @@ subevalvar_misc(const char *p, struct nodelist **restr setvar(var, startp, 0); amount = startp - expdest; STADJUST(amount, expdest); - return p; + return end; case VSQUESTION: if (*p != CTLENDVAR) { Modified: head/bin/sh/tests/expansion/Makefile ============================================================================== --- head/bin/sh/tests/expansion/Makefile Wed Nov 28 19:54:02 2018 (r341163) +++ head/bin/sh/tests/expansion/Makefile Wed Nov 28 20:03:53 2018 (r341164) @@ -86,6 +86,7 @@ ${PACKAGE}FILES+= plus-minus7.0 ${PACKAGE}FILES+= plus-minus8.0 ${PACKAGE}FILES+= plus-minus9.0 ${PACKAGE}FILES+= question1.0 +${PACKAGE}FILES+= question2.0 ${PACKAGE}FILES+= readonly1.0 ${PACKAGE}FILES+= redir1.0 ${PACKAGE}FILES+= set-u1.0 Added: head/bin/sh/tests/expansion/question2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/question2.0 Wed Nov 28 20:03:53 2018 (r341164) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +unset dummyvar +msg=`(: ${dummyvar?}) 2>&1` +r=$? +[ "$r" != 0 ] && case $msg in +*dummyvar?* | *?dummyvar*) : ;; +*) + printf 'Bad message: [%s]\n' "$msg" + exit 1 +esac From owner-svn-src-head@freebsd.org Wed Nov 28 23:42:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C63631140FD8; Wed, 28 Nov 2018 23:42:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA3F8CF91; Wed, 28 Nov 2018 23:42:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt1-x832.google.com with SMTP id y20so32991qtm.13; Wed, 28 Nov 2018 15:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iqIJUM7FXxcRsce00oI88z03xGchVAdgCK6ip1DYyVc=; b=j7ct+UOHevB8leES7et319zBbrkfc74FBg2DLGYuoradxZZImaTFAn/IdeJRI2MOp5 XRfJ166odWiU75C6D1s5BvCs9h/RKFqVcyt91dsUi2uR3FCMxLE+FshEQbR7OgFqPwIy SDbOGUKcNkTTyjjqcAeWZJ89r5ywh8dLzgkFted9/mdg2HMT9IifWl7W1GWoL4aVqvVC uwbxYTwKigEznBu9RGLAiJ0xEobyqCKrmyZr69BEuftKcsz7Rj7dEK2rSZZl2Y2Xk+3J Adz+jwKKuoF7GBsI8ypqoMXt75DjrhjM6vC9xVo81KTyipeZpyObh1DElEAzld/8x6vb 3mlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iqIJUM7FXxcRsce00oI88z03xGchVAdgCK6ip1DYyVc=; b=hhEQmblQuhpvY9ePPOMWPpeIMRYnhd7UWQ7zUz/vcilNy7oC7BU7LSEwdX8TvWKiRW Ad5Bq9Sa9zNawFtgIiWMdXvpW9QpH8zUGlJG8fuEd3oEJk/gI8nUC3PG6AFwTpcIG0Qt 7CatYSM6RIh09frk41ft+l9BdS4Lx9r1MMJAE+qGAXcHwynSfszkzChRgPHzdSMJ1bnH cbigvHzd3xaRdTU7kFyt+Vnhqr6bj2w3TvqO9DGQE+bLI9yUd5pw6iUZ4KRicww1mlhG c8+fD128XXOzeL7tcSLe3R1XZTUJvLdunlFwJTksTRsJoPIfIlSl8bTms38hkGYBCKWJ hh2g== X-Gm-Message-State: AA+aEWZUQF7Kf0RhtnEYbjVG+jgTJWHrO9/vVSbNrKKN1WSe3xqXNrYQ zjjKsb4ow9UIpWymsYjtQb1GaMpumLxjq1kma2TvDw== X-Google-Smtp-Source: AFSGD/W7wRoErQwOJ708ThCC17yJ7TXvnbArVOLcawtQ8Sq88/c8wWTfdKSb2T6rM+2JLTNV0/Gxfbu6eNXY0ISlSls= X-Received: by 2002:a0c:8b64:: with SMTP id d36mr36663171qvc.233.1543448549505; Wed, 28 Nov 2018 15:42:29 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac8:784:0:0:0:0:0 with HTTP; Wed, 28 Nov 2018 15:42:28 -0800 (PST) In-Reply-To: <8cae923a-2b14-c16b-23e7-e6eb7e9a8c3a@FreeBSD.org> References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> <8cae923a-2b14-c16b-23e7-e6eb7e9a8c3a@FreeBSD.org> From: Mateusz Guzik Date: Thu, 29 Nov 2018 00:42:28 +0100 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: John Baldwin Cc: Warner Losh , Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0DA3F8CF91 X-Spamd-Result: default: False [-4.63 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-0.65)[ipnet: 2607:f8b0::/32(-1.80), asn: 15169(-1.36), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 23:42:31 -0000 On 11/26/18, John Baldwin wrote: > On 11/22/18 9:28 AM, Mateusz Guzik wrote: >> diff --git a/sys/sys/systm.h b/sys/sys/systm.h >> index a1b98c5660c..fab94ee7979 100644 >> --- a/sys/sys/systm.h >> +++ b/sys/sys/systm.h >> @@ -523,7 +523,11 @@ int alloc_unr_specific(struct unrhdr *uh, u_int >> item); >> int alloc_unrl(struct unrhdr *uh); >> void free_unr(struct unrhdr *uh, u_int item); >> >> -#if defined(__mips__) || defined(__powerpc__) >> +#if defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) >> +#define UNR64_LOCKED >> +#endif > > This would perhaps be shorter as: > > #if defined(__mips__) && defined(__mips_o32) > >> + >> +#if defined(__powerpc__) && !defined(__powerpc64__) >> #define UNR64_LOCKED >> #endif > > It's not clear to me why this isn't just conditional on LP64 though. > If 32-bit riscv existed in FreeBSD it would also not have this. If we > really care that much about i386 and 32-bit arm you could write it as: > > #if !(defined(__LP64__) || defined(__i386__) || defined(__arm__)) > > (I'm not sure we care that much though and think we could just use __LP64__ > alone and call it a day.) > There will be future optimizations which would be defeated for platforms resorting to the lock, but playing around it may not be worth it. That said, if noone objects I'll just __LP64__ as suggested: diff --git a/sys/sys/systm.h b/sys/sys/systm.h index a1b98c5660c..b250c54033c 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -523,7 +523,7 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); -#if defined(__mips__) || defined(__powerpc__) +#ifndef __LP64__ #define UNR64_LOCKED #endif -- Mateusz Guzik From owner-svn-src-head@freebsd.org Thu Nov 29 01:15:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB7C1143E22; Thu, 29 Nov 2018 01:15:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1A996A170; Thu, 29 Nov 2018 01:15:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AA1812566; Thu, 29 Nov 2018 01:15:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT1Ft8N055544; Thu, 29 Nov 2018 01:15:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT1FrY9055533; Thu, 29 Nov 2018 01:15:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811290115.wAT1FrY9055533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Nov 2018 01:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341172 - in head/sys: conf dev/cxgbe dev/cxgbe/tom modules/cxgbe/if_cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: conf dev/cxgbe dev/cxgbe/tom modules/cxgbe/if_cxgbe X-SVN-Commit-Revision: 341172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1A996A170 X-Spamd-Result: default: False [1.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.81)[0.814,0]; NEURAL_SPAM_MEDIUM(0.47)[0.474,0]; NEURAL_SPAM_LONG(0.63)[0.632,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 01:15:56 -0000 Author: jhb Date: Thu Nov 29 01:15:53 2018 New Revision: 341172 URL: https://svnweb.freebsd.org/changeset/base/341172 Log: Move CLIP table handling out of TOM and into the base driver. - Store the clip table in 'struct adapter' instead of in the TOM softc. - Init the clip table during attach and teardown during detach. - While here, add a dev...misc.clip sysctl to dump the CLIP table. This does mean that we update the clip table even if TOE is not enabled, but non-TOE things need the CLIP table anyway. Reviewed by: np, Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18010 Added: head/sys/dev/cxgbe/t4_clip.c (contents, props changed) head/sys/dev/cxgbe/t4_clip.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h head/sys/modules/cxgbe/if_cxgbe/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Nov 29 01:05:21 2018 (r341171) +++ head/sys/conf/files Thu Nov 29 01:15:53 2018 (r341172) @@ -1382,6 +1382,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb pci \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" +dev/cxgbe/t4_clip.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_filter.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_if.m optional cxgbe pci Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Nov 29 01:05:21 2018 (r341171) +++ head/sys/dev/cxgbe/adapter.h Thu Nov 29 01:15:53 2018 (r341172) @@ -771,6 +771,8 @@ struct devnames { const char *vf_ifnet_name; }; +struct clip_entry; + struct adapter { SLIST_ENTRY(adapter) link; device_t dev; @@ -816,6 +818,10 @@ struct adapter { struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[MAX_NCHAN]; /* channel -> port */ + + struct mtx clip_table_lock; + TAILQ_HEAD(, clip_entry) clip_table; + int clip_gen; void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; Added: head/sys/dev/cxgbe/t4_clip.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/t4_clip.c Thu Nov 29 01:15:53 2018 (r341172) @@ -0,0 +1,382 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2012 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common/common.h" +#include "t4_clip.h" + +static int add_lip(struct adapter *, struct in6_addr *); +static int delete_lip(struct adapter *, struct in6_addr *); +static struct clip_entry *search_lip(struct adapter *, struct in6_addr *); +static void update_clip(struct adapter *, void *); +static void t4_clip_task(void *, int); +static void update_clip_table(struct adapter *); + +static int in6_ifaddr_gen; +static eventhandler_tag ifaddr_evhandler; +static struct timeout_task clip_task; + +static int +add_lip(struct adapter *sc, struct in6_addr *lip) +{ + struct fw_clip_cmd c; + + ASSERT_SYNCHRONIZED_OP(sc); + mtx_assert(&sc->clip_table_lock, MA_OWNED); + + memset(&c, 0, sizeof(c)); + c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | + F_FW_CMD_WRITE); + c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_ALLOC | FW_LEN16(c)); + c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; + c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; + + return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); +} + +static int +delete_lip(struct adapter *sc, struct in6_addr *lip) +{ + struct fw_clip_cmd c; + + ASSERT_SYNCHRONIZED_OP(sc); + mtx_assert(&sc->clip_table_lock, MA_OWNED); + + memset(&c, 0, sizeof(c)); + c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | + F_FW_CMD_READ); + c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_FREE | FW_LEN16(c)); + c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; + c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; + + return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); +} + +static struct clip_entry * +search_lip(struct adapter *sc, struct in6_addr *lip) +{ + struct clip_entry *ce; + + mtx_assert(&sc->clip_table_lock, MA_OWNED); + + TAILQ_FOREACH(ce, &sc->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + return (ce); + } + + return (NULL); +} + +struct clip_entry * +t4_hold_lip(struct adapter *sc, struct in6_addr *lip, struct clip_entry *ce) +{ + + mtx_lock(&sc->clip_table_lock); + if (ce == NULL) + ce = search_lip(sc, lip); + if (ce != NULL) + ce->refcount++; + mtx_unlock(&sc->clip_table_lock); + + return (ce); +} + +void +t4_release_lip(struct adapter *sc, struct clip_entry *ce) +{ + + mtx_lock(&sc->clip_table_lock); + KASSERT(search_lip(sc, &ce->lip) == ce, + ("%s: CLIP entry %p p not in CLIP table.", __func__, ce)); + KASSERT(ce->refcount > 0, + ("%s: CLIP entry %p has refcount 0", __func__, ce)); + --ce->refcount; + mtx_unlock(&sc->clip_table_lock); +} + +void +t4_init_clip_table(struct adapter *sc) +{ + + mtx_init(&sc->clip_table_lock, "CLIP table lock", NULL, MTX_DEF); + TAILQ_INIT(&sc->clip_table); + sc->clip_gen = -1; + + /* + * Don't bother forcing an update of the clip table when the + * adapter is initialized. Before an interface can be used it + * must be assigned an address which will trigger the event + * handler to update the table. + */ +} + +static void +update_clip(struct adapter *sc, void *arg __unused) +{ + + if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4clip")) + return; + + if (mtx_initialized(&sc->clip_table_lock)) + update_clip_table(sc); + + end_synchronized_op(sc, LOCK_HELD); +} + +static void +t4_clip_task(void *arg, int count) +{ + + t4_iterate(update_clip, NULL); +} + +static void +update_clip_table(struct adapter *sc) +{ + struct rm_priotracker in6_ifa_tracker; + struct in6_ifaddr *ia; + struct in6_addr *lip, tlip; + TAILQ_HEAD(, clip_entry) stale; + struct clip_entry *ce, *ce_temp; + struct vi_info *vi; + int rc, gen, i, j; + uintptr_t last_vnet; + + ASSERT_SYNCHRONIZED_OP(sc); + + IN6_IFADDR_RLOCK(&in6_ifa_tracker); + mtx_lock(&sc->clip_table_lock); + + gen = atomic_load_acq_int(&in6_ifaddr_gen); + if (gen == sc->clip_gen) + goto done; + + TAILQ_INIT(&stale); + TAILQ_CONCAT(&stale, &sc->clip_table, link); + + /* + * last_vnet optimizes the common cases where all if_vnet = NULL (no + * VIMAGE) or all if_vnet = vnet0. + */ + last_vnet = (uintptr_t)(-1); + for_each_port(sc, i) + for_each_vi(sc->port[i], j, vi) { + if (last_vnet == (uintptr_t)vi->ifp->if_vnet) + continue; + + /* XXX: races with if_vmove */ + CURVNET_SET(vi->ifp->if_vnet); + CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + lip = &ia->ia_addr.sin6_addr; + + KASSERT(!IN6_IS_ADDR_MULTICAST(lip), + ("%s: mcast address in in6_ifaddr list", __func__)); + + if (IN6_IS_ADDR_LOOPBACK(lip)) + continue; + if (IN6_IS_SCOPE_EMBED(lip)) { + /* Remove the embedded scope */ + tlip = *lip; + lip = &tlip; + in6_clearscope(lip); + } + /* + * XXX: how to weed out the link local address for the + * loopback interface? It's fe80::1 usually (always?). + */ + + /* + * If it's in the main list then we already know it's + * not stale. + */ + TAILQ_FOREACH(ce, &sc->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + goto next; + } + + /* + * If it's in the stale list we should move it to the + * main list. + */ + TAILQ_FOREACH(ce, &stale, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { + TAILQ_REMOVE(&stale, ce, link); + TAILQ_INSERT_TAIL(&sc->clip_table, ce, + link); + goto next; + } + } + + /* A new IP6 address; add it to the CLIP table */ + ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); + memcpy(&ce->lip, lip, sizeof(ce->lip)); + ce->refcount = 0; + rc = add_lip(sc, lip); + if (rc == 0) + TAILQ_INSERT_TAIL(&sc->clip_table, ce, link); + else { + char ip[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &ce->lip, &ip[0], + sizeof(ip)); + log(LOG_ERR, "%s: could not add %s (%d)\n", + __func__, ip, rc); + free(ce, M_CXGBE); + } +next: + continue; + } + CURVNET_RESTORE(); + last_vnet = (uintptr_t)vi->ifp->if_vnet; + } + + /* + * Remove stale addresses (those no longer in V_in6_ifaddrhead) that are + * no longer referenced by the driver. + */ + TAILQ_FOREACH_SAFE(ce, &stale, link, ce_temp) { + if (ce->refcount == 0) { + rc = delete_lip(sc, &ce->lip); + if (rc == 0) { + TAILQ_REMOVE(&stale, ce, link); + free(ce, M_CXGBE); + } else { + char ip[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &ce->lip, &ip[0], + sizeof(ip)); + log(LOG_ERR, "%s: could not delete %s (%d)\n", + __func__, ip, rc); + } + } + } + /* The ones that are still referenced need to stay in the CLIP table */ + TAILQ_CONCAT(&sc->clip_table, &stale, link); + + sc->clip_gen = gen; +done: + mtx_unlock(&sc->clip_table_lock); + IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); +} + +void +t4_destroy_clip_table(struct adapter *sc) +{ + struct clip_entry *ce, *ce_temp; + + if (mtx_initialized(&sc->clip_table_lock)) { + mtx_lock(&sc->clip_table_lock); + TAILQ_FOREACH_SAFE(ce, &sc->clip_table, link, ce_temp) { + KASSERT(ce->refcount == 0, + ("%s: CLIP entry %p still in use (%d)", __func__, + ce, ce->refcount)); + TAILQ_REMOVE(&sc->clip_table, ce, link); + delete_lip(sc, &ce->lip); + free(ce, M_CXGBE); + } + mtx_unlock(&sc->clip_table_lock); + mtx_destroy(&sc->clip_table_lock); + } +} + +static void +t4_tom_ifaddr_event(void *arg __unused, struct ifnet *ifp) +{ + + atomic_add_rel_int(&in6_ifaddr_gen, 1); + taskqueue_enqueue_timeout(taskqueue_thread, &clip_task, -hz / 4); +} + +int +sysctl_clip(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct clip_entry *ce; + struct sbuf *sb; + int rc, header = 0; + char ip[INET6_ADDRSTRLEN]; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + mtx_lock(&sc->clip_table_lock); + TAILQ_FOREACH(ce, &sc->clip_table, link) { + if (header == 0) { + sbuf_printf(sb, "%-40s %-5s", "IP address", "Users"); + header = 1; + } + inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip)); + + sbuf_printf(sb, "\n%-40s %5u", ip, ce->refcount); + } + mtx_unlock(&sc->clip_table_lock); + + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + +void +t4_clip_modload(void) +{ + + TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL); + ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event, + t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); +} + +void +t4_clip_modunload(void) +{ + + EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); + taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); +} Added: head/sys/dev/cxgbe/t4_clip.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/t4_clip.h Thu Nov 29 01:15:53 2018 (r341172) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2012 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __T4_CLIP_H +#define __T4_CLIP_H + +struct clip_entry { + TAILQ_ENTRY(clip_entry) link; + struct in6_addr lip; /* local IPv6 address */ + u_int refcount; +}; + +void t4_clip_modload(void); +void t4_clip_modunload(void); +void t4_init_clip_table(struct adapter *); +void t4_destroy_clip_table(struct adapter *); +struct clip_entry *t4_hold_lip(struct adapter *, struct in6_addr *, + struct clip_entry *); +void t4_release_lip(struct adapter *, struct clip_entry *); + +int sysctl_clip(SYSCTL_HANDLER_ARGS); + +#endif /* __T4_CLIP_H */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Nov 29 01:05:21 2018 (r341171) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 29 01:15:53 2018 (r341172) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_regs.h" #include "common/t4_regs_values.h" #include "cudbg/cudbg.h" +#include "t4_clip.h" #include "t4_ioctl.h" #include "t4_l2t.h" #include "t4_mp_ring.h" @@ -1221,6 +1222,7 @@ t4_attach(device_t dev) #ifdef RATELIMIT t4_init_etid_table(sc); #endif + t4_init_clip_table(sc); if (sc->vres.key.size != 0) sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start, sc->vres.key.size, 32, 0, M_FIRSTFIT | M_WAITOK); @@ -1511,6 +1513,7 @@ t4_detach_common(device_t dev) #endif if (sc->key_map) vmem_destroy(sc->key_map); + t4_destroy_clip_table(sc); #if defined(TCP_OFFLOAD) || defined(RATELIMIT) free(sc->sge.ofld_txq, M_CXGBE); @@ -5964,6 +5967,10 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_smt, "A", "hardware source MAC table"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "clip", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_clip, "A", "active CLIP table entries"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "lb_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_lb_stats, "A", "loopback statistics"); @@ -10520,6 +10527,7 @@ mod_event(module_t mod, int cmd, void *arg) sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); SLIST_INIT(&t4_uld_list); #endif + t4_clip_modload(); t4_tracer_modload(); tweak_tunables(); } @@ -10559,6 +10567,7 @@ mod_event(module_t mod, int cmd, void *arg) if (t4_sge_extfree_refs() == 0) { t4_tracer_modunload(); + t4_clip_modunload(); #ifdef TCP_OFFLOAD sx_destroy(&t4_uld_list_lock); #endif Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Nov 29 01:05:21 2018 (r341171) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Nov 29 01:15:53 2018 (r341172) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_msg.h" #include "common/t4_regs.h" #include "common/t4_regs_values.h" +#include "t4_clip.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -316,7 +317,6 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct sockaddr *nam) { struct adapter *sc = tod->tod_softc; - struct tom_data *td = tod_td(tod); struct toepcb *toep = NULL; struct wrqe *wr = NULL; struct ifnet *rt_ifp = rt->rt_ifp; @@ -409,7 +409,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru if ((inp->inp_vflag & INP_IPV6) == 0) DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); - toep->ce = hold_lip(td, &inp->in6p_laddr, NULL); + toep->ce = t4_hold_lip(sc, &inp->in6p_laddr, NULL); if (toep->ce == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOENT); @@ -496,7 +496,7 @@ failed: if (toep->l2te) t4_l2t_release(toep->l2te); if (toep->ce) - release_lip(td, toep->ce); + t4_release_lip(sc, toep->ce); free_toepcb(toep); } Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 29 01:05:21 2018 (r341171) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 29 01:15:53 2018 (r341172) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" +#include "t4_clip.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -212,9 +213,7 @@ alloc_lctx(struct adapter *sc, struct inpcb *inp, stru if (inp->inp_vflag & INP_IPV6 && !IN6_ARE_ADDR_EQUAL(&in6addr_any, &inp->in6p_laddr)) { - struct tom_data *td = sc->tom_softc; - - lctx->ce = hold_lip(td, &inp->in6p_laddr, NULL); + lctx->ce = t4_hold_lip(sc, &inp->in6p_laddr, NULL); if (lctx->ce == NULL) { free(lctx, M_CXGBE); return (NULL); @@ -238,7 +237,6 @@ static int free_lctx(struct adapter *sc, struct listen_ctx *lctx) { struct inpcb *inp = lctx->inp; - struct tom_data *td = sc->tom_softc; INP_WLOCK_ASSERT(inp); KASSERT(lctx->refcount == 0, @@ -251,7 +249,7 @@ free_lctx(struct adapter *sc, struct listen_ctx *lctx) __func__, lctx->stid, lctx, lctx->inp); if (lctx->ce) - release_lip(td, lctx->ce); + t4_release_lip(sc, lctx->ce); free_stid(sc, lctx); free(lctx, M_CXGBE); @@ -1675,7 +1673,7 @@ reset: MPASS(so->so_vnet == lctx->vnet); toep->vnet = lctx->vnet; if (inc.inc_flags & INC_ISIPV6) - toep->ce = hold_lip(sc->tom_softc, &inc.inc6_laddr, lctx->ce); + toep->ce = t4_hold_lip(sc, &inc.inc6_laddr, lctx->ce); /* * This is for the unlikely case where the syncache entry that we added Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Nov 29 01:05:21 2018 (r341171) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Nov 29 01:15:53 2018 (r341172) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_regs.h" #include "common/t4_regs_values.h" #include "common/t4_tcb.h" +#include "t4_clip.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" #include "tom/t4_tls.h" @@ -99,21 +100,9 @@ static struct uld_info tom_uld_info = { static void release_offload_resources(struct toepcb *); static int alloc_tid_tabs(struct tid_info *); static void free_tid_tabs(struct tid_info *); -static int add_lip(struct adapter *, struct in6_addr *); -static int delete_lip(struct adapter *, struct in6_addr *); -static struct clip_entry *search_lip(struct tom_data *, struct in6_addr *); -static void init_clip_table(struct adapter *, struct tom_data *); -static void update_clip(struct adapter *, void *); -static void t4_clip_task(void *, int); -static void update_clip_table(struct adapter *, struct tom_data *); -static void destroy_clip_table(struct adapter *, struct tom_data *); static void free_tom_data(struct adapter *, struct tom_data *); static void reclaim_wr_resources(void *, int); -static int in6_ifaddr_gen; -static eventhandler_tag ifaddr_evhandler; -static struct timeout_task clip_task; - struct toepcb * alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags) { @@ -315,7 +304,7 @@ release_offload_resources(struct toepcb *toep) } if (toep->ce) - release_lip(td, toep->ce); + t4_release_lip(sc, toep->ce); if (toep->tc_idx != -1) t4_release_cl_rl(sc, toep->vi->pi->port_id, toep->tc_idx); @@ -822,267 +811,7 @@ failed: return (rc); } -static int -add_lip(struct adapter *sc, struct in6_addr *lip) -{ - struct fw_clip_cmd c; - - ASSERT_SYNCHRONIZED_OP(sc); - /* mtx_assert(&td->clip_table_lock, MA_OWNED); */ - - memset(&c, 0, sizeof(c)); - c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | - F_FW_CMD_WRITE); - c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_ALLOC | FW_LEN16(c)); - c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; - c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; - - return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); -} - -static int -delete_lip(struct adapter *sc, struct in6_addr *lip) -{ - struct fw_clip_cmd c; - - ASSERT_SYNCHRONIZED_OP(sc); - /* mtx_assert(&td->clip_table_lock, MA_OWNED); */ - - memset(&c, 0, sizeof(c)); - c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | - F_FW_CMD_READ); - c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_FREE | FW_LEN16(c)); - c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; - c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; - - return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); -} - -static struct clip_entry * -search_lip(struct tom_data *td, struct in6_addr *lip) -{ - struct clip_entry *ce; - - mtx_assert(&td->clip_table_lock, MA_OWNED); - - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - return (ce); - } - - return (NULL); -} - -struct clip_entry * -hold_lip(struct tom_data *td, struct in6_addr *lip, struct clip_entry *ce) -{ - - mtx_lock(&td->clip_table_lock); - if (ce == NULL) - ce = search_lip(td, lip); - if (ce != NULL) - ce->refcount++; - mtx_unlock(&td->clip_table_lock); - - return (ce); -} - -void -release_lip(struct tom_data *td, struct clip_entry *ce) -{ - - mtx_lock(&td->clip_table_lock); - KASSERT(search_lip(td, &ce->lip) == ce, - ("%s: CLIP entry %p p not in CLIP table.", __func__, ce)); - KASSERT(ce->refcount > 0, - ("%s: CLIP entry %p has refcount 0", __func__, ce)); - --ce->refcount; - mtx_unlock(&td->clip_table_lock); -} - static void -init_clip_table(struct adapter *sc, struct tom_data *td) -{ - - ASSERT_SYNCHRONIZED_OP(sc); - - mtx_init(&td->clip_table_lock, "CLIP table lock", NULL, MTX_DEF); - TAILQ_INIT(&td->clip_table); - td->clip_gen = -1; - - update_clip_table(sc, td); -} - -static void -update_clip(struct adapter *sc, void *arg __unused) -{ - - if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4tomuc")) - return; - - if (uld_active(sc, ULD_TOM)) - update_clip_table(sc, sc->tom_softc); - - end_synchronized_op(sc, LOCK_HELD); -} - -static void -t4_clip_task(void *arg, int count) -{ - - t4_iterate(update_clip, NULL); -} - -static void -update_clip_table(struct adapter *sc, struct tom_data *td) -{ - struct rm_priotracker in6_ifa_tracker; - struct in6_ifaddr *ia; - struct in6_addr *lip, tlip; - struct clip_head stale; - struct clip_entry *ce, *ce_temp; - struct vi_info *vi; - int rc, gen, i, j; - uintptr_t last_vnet; - - ASSERT_SYNCHRONIZED_OP(sc); - - IN6_IFADDR_RLOCK(&in6_ifa_tracker); - mtx_lock(&td->clip_table_lock); - - gen = atomic_load_acq_int(&in6_ifaddr_gen); - if (gen == td->clip_gen) - goto done; - - TAILQ_INIT(&stale); - TAILQ_CONCAT(&stale, &td->clip_table, link); - - /* - * last_vnet optimizes the common cases where all if_vnet = NULL (no - * VIMAGE) or all if_vnet = vnet0. - */ - last_vnet = (uintptr_t)(-1); - for_each_port(sc, i) - for_each_vi(sc->port[i], j, vi) { - if (last_vnet == (uintptr_t)vi->ifp->if_vnet) - continue; - - /* XXX: races with if_vmove */ - CURVNET_SET(vi->ifp->if_vnet); - CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - lip = &ia->ia_addr.sin6_addr; - - KASSERT(!IN6_IS_ADDR_MULTICAST(lip), - ("%s: mcast address in in6_ifaddr list", __func__)); - - if (IN6_IS_ADDR_LOOPBACK(lip)) - continue; - if (IN6_IS_SCOPE_EMBED(lip)) { - /* Remove the embedded scope */ - tlip = *lip; - lip = &tlip; - in6_clearscope(lip); - } - /* - * XXX: how to weed out the link local address for the - * loopback interface? It's fe80::1 usually (always?). - */ - - /* - * If it's in the main list then we already know it's - * not stale. - */ - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - goto next; - } - - /* - * If it's in the stale list we should move it to the - * main list. - */ - TAILQ_FOREACH(ce, &stale, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { - TAILQ_REMOVE(&stale, ce, link); - TAILQ_INSERT_TAIL(&td->clip_table, ce, - link); - goto next; - } - } - - /* A new IP6 address; add it to the CLIP table */ - ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); - memcpy(&ce->lip, lip, sizeof(ce->lip)); - ce->refcount = 0; - rc = add_lip(sc, lip); - if (rc == 0) - TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], - sizeof(ip)); - log(LOG_ERR, "%s: could not add %s (%d)\n", - __func__, ip, rc); - free(ce, M_CXGBE); - } -next: - continue; - } - CURVNET_RESTORE(); - last_vnet = (uintptr_t)vi->ifp->if_vnet; - } - - /* - * Remove stale addresses (those no longer in V_in6_ifaddrhead) that are - * no longer referenced by the driver. - */ - TAILQ_FOREACH_SAFE(ce, &stale, link, ce_temp) { - if (ce->refcount == 0) { - rc = delete_lip(sc, &ce->lip); - if (rc == 0) { - TAILQ_REMOVE(&stale, ce, link); - free(ce, M_CXGBE); - } else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], - sizeof(ip)); - log(LOG_ERR, "%s: could not delete %s (%d)\n", - __func__, ip, rc); - } - } - } - /* The ones that are still referenced need to stay in the CLIP table */ - TAILQ_CONCAT(&td->clip_table, &stale, link); - - td->clip_gen = gen; -done: - mtx_unlock(&td->clip_table_lock); - IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); -} - -static void -destroy_clip_table(struct adapter *sc, struct tom_data *td) -{ - struct clip_entry *ce, *ce_temp; - - if (mtx_initialized(&td->clip_table_lock)) { - mtx_lock(&td->clip_table_lock); - TAILQ_FOREACH_SAFE(ce, &td->clip_table, link, ce_temp) { - KASSERT(ce->refcount == 0, - ("%s: CLIP entry %p still in use (%d)", __func__, - ce, ce->refcount)); - TAILQ_REMOVE(&td->clip_table, ce, link); - delete_lip(sc, &ce->lip); - free(ce, M_CXGBE); - } - mtx_unlock(&td->clip_table_lock); - mtx_destroy(&td->clip_table_lock); - } -} - -static void free_tom_data(struct adapter *sc, struct tom_data *td) { @@ -1094,7 +823,6 @@ free_tom_data(struct adapter *sc, struct tom_data *td) ("%s: lctx hash table is not empty.", __func__)); t4_free_ppod_region(&td->pr); - destroy_clip_table(sc, td); if (td->listen_mask != 0) hashdestroy(td->listen_hash, M_CXGBE, td->listen_mask); @@ -1369,9 +1097,6 @@ t4_tom_activate(struct adapter *sc) t4_set_reg_field(sc, A_ULP_RX_TDDP_TAGMASK, V_TDDPTAGMASK(M_TDDPTAGMASK), td->pr.pr_tag_mask); - /* CLIP table for IPv6 offload */ - init_clip_table(sc, td); - /* toedev ops */ tod = &td->tod; init_toedev(tod); @@ -1449,14 +1174,6 @@ t4_tom_deactivate(struct adapter *sc) return (rc); } -static void -t4_tom_ifaddr_event(void *arg __unused, struct ifnet *ifp) -{ - - atomic_add_rel_int(&in6_ifaddr_gen, 1); - taskqueue_enqueue_timeout(taskqueue_thread, &clip_task, -hz / 4); -} - static int t4_aio_queue_tom(struct socket *so, struct kaiocb *job) { @@ -1524,10 +1241,6 @@ t4_tom_mod_load(void) toe6_protosw.pr_ctloutput = t4_ctloutput_tom; toe6_protosw.pr_usrreqs = &toe6_usrreqs; - TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL); - ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event, - t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); - return (t4_register_uld(&tom_uld_info)); } @@ -1551,11 +1264,6 @@ t4_tom_mod_unload(void) if (t4_unregister_uld(&tom_uld_info) == EBUSY) return (EBUSY); - - if (ifaddr_evhandler) { - EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); - taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); - } t4_tls_mod_unload(); t4_ddp_mod_unload(); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 29 01:05:21 2018 (r341171) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Nov 29 01:15:53 2018 (r341172) @@ -259,13 +259,6 @@ struct listen_ctx { TAILQ_HEAD(, synq_entry) synq; }; -struct clip_entry { - TAILQ_ENTRY(clip_entry) link; - struct in6_addr lip; /* local IPv6 address */ - u_int refcount; -}; - -TAILQ_HEAD(clip_head, clip_entry); struct tom_data { struct toedev tod; @@ -280,10 +273,6 @@ struct tom_data { struct ppod_region pr; - struct mtx clip_table_lock; - struct clip_head clip_table; - int clip_gen; - /* WRs that will not be sent to the chip because L2 resolution failed */ struct mtx unsent_wr_lock; STAILQ_HEAD(, wrqe) unsent_wr_list; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Nov 29 02:52:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39CCD1149B00; Thu, 29 Nov 2018 02:52:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D25826EB54; Thu, 29 Nov 2018 02:52:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 993B2136F6; Thu, 29 Nov 2018 02:52:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT2q9Vb004205; Thu, 29 Nov 2018 02:52:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT2q8GQ004200; Thu, 29 Nov 2018 02:52:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290252.wAT2q8GQ004200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 02:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341176 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 341176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D25826EB54 X-Spamd-Result: default: False [1.60 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; NEURAL_SPAM_SHORT(0.78)[0.783,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 02:52:10 -0000 Author: mjg Date: Thu Nov 29 02:52:08 2018 New Revision: 341176 URL: https://svnweb.freebsd.org/changeset/base/341176 Log: proc: create a dedicated lock for zombproc to ligthen the load on allproc_lock waitpid always takes proctree to evaluate the list, but only takes allproc if it can reap. With this patch allproc is no longer taken, which helps during poudriere -j 128. Discussed with: kib Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/kern/kern_racct.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Nov 29 01:31:12 2018 (r341175) +++ head/sys/kern/kern_exit.c Thu Nov 29 02:52:08 2018 (r341176) @@ -432,8 +432,10 @@ exit1(struct thread *td, int rval, int signo) * Move proc from allproc queue to zombproc. */ sx_xlock(&allproc_lock); + sx_xlock(&zombproc_lock); LIST_REMOVE(p, p_list); LIST_INSERT_HEAD(&zombproc, p, p_list); + sx_xunlock(&zombproc_lock); sx_xunlock(&allproc_lock); /* @@ -871,9 +873,9 @@ proc_reap(struct thread *td, struct proc *p, int *stat * Remove other references to this process to ensure we have an * exclusive reference. */ - sx_xlock(&allproc_lock); + sx_xlock(&zombproc_lock); LIST_REMOVE(p, p_list); /* off zombproc */ - sx_xunlock(&allproc_lock); + sx_xunlock(&zombproc_lock); sx_xlock(PIDHASHLOCK(p->p_pid)); LIST_REMOVE(p, p_hash); sx_xunlock(PIDHASHLOCK(p->p_pid)); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Nov 29 01:31:12 2018 (r341175) +++ head/sys/kern/kern_fork.c Thu Nov 29 02:52:08 2018 (r341176) @@ -238,6 +238,7 @@ fork_findpid(int flags) struct proc *p; int trypid; static int pidchecked = 0; + bool locked_zomb = false; /* * Requires allproc_lock in order to iterate over the list @@ -318,6 +319,10 @@ again: } if (!doingzomb) { doingzomb = 1; + if (!locked_zomb) { + sx_slock(&zombproc_lock); + locked_zomb = true; + } p = LIST_FIRST(&zombproc); goto again; } @@ -330,6 +335,9 @@ again: pidchecked = 0; else lastpid = trypid; + + if (locked_zomb) + sx_sunlock(&zombproc_lock); return (trypid); } Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Nov 29 01:31:12 2018 (r341175) +++ head/sys/kern/kern_proc.c Thu Nov 29 02:52:08 2018 (r341176) @@ -125,6 +125,7 @@ u_long pgrphash; struct proclist allproc; struct proclist zombproc; struct sx __exclusive_cache_line allproc_lock; +struct sx __exclusive_cache_line zombproc_lock; struct sx __exclusive_cache_line proctree_lock; struct mtx __exclusive_cache_line ppeers_lock; uma_zone_t proc_zone; @@ -177,6 +178,7 @@ procinit(void) u_long i; sx_init(&allproc_lock, "allproc"); + sx_init(&zombproc_lock, "zombproc"); sx_init(&proctree_lock, "proctree"); mtx_init(&ppeers_lock, "p_peers", NULL, MTX_DEF); LIST_INIT(&allproc); @@ -1194,14 +1196,14 @@ zpfind(pid_t pid) { struct proc *p; - sx_slock(&allproc_lock); + sx_slock(&zombproc_lock); LIST_FOREACH(p, &zombproc, p_list) { if (p->p_pid == pid) { PROC_LOCK(p); break; } } - sx_sunlock(&allproc_lock); + sx_sunlock(&zombproc_lock); return (p); } Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Thu Nov 29 01:31:12 2018 (r341175) +++ head/sys/kern/kern_racct.c Thu Nov 29 02:52:08 2018 (r341176) @@ -1228,11 +1228,13 @@ racctd(void) sx_slock(&allproc_lock); + sx_slock(&zombproc_lock); LIST_FOREACH(p, &zombproc, p_list) { PROC_LOCK(p); racct_set(p, RACCT_PCTCPU, 0); PROC_UNLOCK(p); } + sx_sunlock(&zombproc_lock); FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Nov 29 01:31:12 2018 (r341175) +++ head/sys/sys/proc.h Thu Nov 29 02:52:08 2018 (r341176) @@ -959,6 +959,7 @@ extern u_long pgrphash; extern struct sx allproc_lock; extern int allproc_gen; +extern struct sx zombproc_lock; extern struct sx proctree_lock; extern struct mtx ppeers_lock; extern struct proc proc0; /* Process slot for swapper. */ From owner-svn-src-head@freebsd.org Thu Nov 29 03:39:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28454114C017; Thu, 29 Nov 2018 03:39:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8AE57080F; Thu, 29 Nov 2018 03:39:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9986C13F6B; Thu, 29 Nov 2018 03:39:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT3dBZ3027973; Thu, 29 Nov 2018 03:39:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT3dBqf027972; Thu, 29 Nov 2018 03:39:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811290339.wAT3dBqf027972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 29 Nov 2018 03:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341177 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 341177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8AE57080F X-Spamd-Result: default: False [1.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.478,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.47)[0.465,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 03:39:12 -0000 Author: jhibbits Date: Thu Nov 29 03:39:11 2018 New Revision: 341177 URL: https://svnweb.freebsd.org/changeset/base/341177 Log: Fix thread creation in PowerPC64 ELFv2 processes. Summary: Currently, the upcall used to create threads assumes ELFv1. Instead, we should check which sysentvec is in use on the process and act accordingly. This makes ELFv2 threaded processes work. Submitted by: git_bdragon.rtk0.net Differential Revision: https://reviews.freebsd.org/D18330 Modified: head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Thu Nov 29 02:52:08 2018 (r341176) +++ head/sys/powerpc/powerpc/exec_machdep.c Thu Nov 29 03:39:11 2018 (r341177) @@ -124,6 +124,10 @@ static int grab_mcontext32(struct thread *td, mcontext static int grab_mcontext(struct thread *, mcontext_t *, int); +#ifdef __powerpc64__ +extern struct sysentvec elf64_freebsd_sysvec_v2; +#endif + void sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { @@ -1014,11 +1018,18 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * #endif } else { #ifdef __powerpc64__ - register_t entry_desc[3]; - (void)copyin((void *)entry, entry_desc, sizeof(entry_desc)); - tf->srr0 = entry_desc[0]; - tf->fixreg[2] = entry_desc[1]; - tf->fixreg[11] = entry_desc[2]; + if (td->td_proc->p_sysent == &elf64_freebsd_sysvec_v2) { + tf->srr0 = (register_t)entry; + /* ELFv2 ABI requires that the global entry point be in r12. */ + tf->fixreg[12] = (register_t)entry; + } + else { + register_t entry_desc[3]; + (void)copyin((void *)entry, entry_desc, sizeof(entry_desc)); + tf->srr0 = entry_desc[0]; + tf->fixreg[2] = entry_desc[1]; + tf->fixreg[11] = entry_desc[2]; + } tf->srr1 = psl_userset | PSL_FE_DFLT; #endif } From owner-svn-src-head@freebsd.org Thu Nov 29 03:57:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67599114CC28; Thu, 29 Nov 2018 03:57:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A2D07132B; Thu, 29 Nov 2018 03:57:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC8CE142AC; Thu, 29 Nov 2018 03:57:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT3v6G1038319; Thu, 29 Nov 2018 03:57:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT3v6E9038318; Thu, 29 Nov 2018 03:57:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811290357.wAT3v6E9038318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 29 Nov 2018 03:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341179 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 341179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A2D07132B X-Spamd-Result: default: False [1.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_SHORT(0.48)[0.478,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 03:57:07 -0000 Author: jhibbits Date: Thu Nov 29 03:57:06 2018 New Revision: 341179 URL: https://svnweb.freebsd.org/changeset/base/341179 Log: Allow truss to operate on ELFv2 processes. Summary: Currently, truss doesn't work on ELFv2 processes due to not recognizing the ABI. Since there's no special handling needed here, just adding a PROCABI struct for it is sufficient to get it working. Submitted by: git_bdragon.rtk0.net Differential Revision: https://reviews.freebsd.org/D18352 Modified: head/usr.bin/truss/powerpc64-freebsd.c Modified: head/usr.bin/truss/powerpc64-freebsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-freebsd.c Thu Nov 29 03:44:02 2018 (r341178) +++ head/usr.bin/truss/powerpc64-freebsd.c Thu Nov 29 03:57:06 2018 (r341179) @@ -117,3 +117,14 @@ static struct procabi powerpc64_freebsd = { }; PROCABI(powerpc64_freebsd); + +static struct procabi powerpc64_freebsd_elfv2 = { + "FreeBSD ELF64 V2", + SYSDECODE_ABI_FREEBSD, + powerpc64_fetch_args, + powerpc64_fetch_retval, + STAILQ_HEAD_INITIALIZER(powerpc64_freebsd_elfv2.extra_syscalls), + { NULL } +}; + +PROCABI(powerpc64_freebsd_elfv2); From owner-svn-src-head@freebsd.org Thu Nov 29 03:44:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC4C8114C36D; Thu, 29 Nov 2018 03:44:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 266BA70C99; Thu, 29 Nov 2018 03:44:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E197314107; Thu, 29 Nov 2018 03:44:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT3i2R3032662; Thu, 29 Nov 2018 03:44:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT3i2Ai032661; Thu, 29 Nov 2018 03:44:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290344.wAT3i2Ai032661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 03:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341178 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 341178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 266BA70C99 X-Spamd-Result: default: False [1.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.500,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; NEURAL_SPAM_LONG(0.51)[0.511,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 03:44:04 -0000 Author: mjg Date: Thu Nov 29 03:44:02 2018 New Revision: 341178 URL: https://svnweb.freebsd.org/changeset/base/341178 Log: Tidy up hardclock. - use fcmpset for updating ticks - move (rarely used) itimer handling to a dedicated function Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Thu Nov 29 03:39:11 2018 (r341177) +++ head/sys/kern/kern_clock.c Thu Nov 29 03:44:02 2018 (r341178) @@ -421,6 +421,36 @@ initclocks(void *dummy) #endif } +static __noinline void +hardclock_itimer(struct thread *td, struct pstats *pstats, int cnt, int usermode) +{ + struct proc *p; + int flags; + + flags = 0; + p = td->td_proc; + if (usermode && + timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value)) { + PROC_ITIMLOCK(p); + if (itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], + tick * cnt) == 0) + flags |= TDF_ALRMPEND | TDF_ASTPENDING; + PROC_ITIMUNLOCK(p); + } + if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value)) { + PROC_ITIMLOCK(p); + if (itimerdecr(&pstats->p_timer[ITIMER_PROF], + tick * cnt) == 0) + flags |= TDF_PROFPEND | TDF_ASTPENDING; + PROC_ITIMUNLOCK(p); + } + if (flags != 0) { + thread_lock(td); + td->td_flags |= flags; + thread_unlock(td); + } +} + void hardclock(int cnt, int usermode) { @@ -428,15 +458,14 @@ hardclock(int cnt, int usermode) struct thread *td = curthread; struct proc *p = td->td_proc; int *t = DPCPU_PTR(pcputicks); - int flags, global, newticks; - int i; + int global, i, newticks; /* * Update per-CPU and possibly global ticks values. */ *t += cnt; + global = ticks; do { - global = ticks; newticks = *t - global; if (newticks <= 0) { if (newticks < -1) @@ -444,33 +473,16 @@ hardclock(int cnt, int usermode) newticks = 0; break; } - } while (!atomic_cmpset_int(&ticks, global, *t)); + } while (!atomic_fcmpset_int(&ticks, &global, *t)); /* * Run current process's virtual and profile time, as needed. */ pstats = p->p_stats; - flags = 0; - if (usermode && - timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value)) { - PROC_ITIMLOCK(p); - if (itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], - tick * cnt) == 0) - flags |= TDF_ALRMPEND | TDF_ASTPENDING; - PROC_ITIMUNLOCK(p); - } - if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value)) { - PROC_ITIMLOCK(p); - if (itimerdecr(&pstats->p_timer[ITIMER_PROF], - tick * cnt) == 0) - flags |= TDF_PROFPEND | TDF_ASTPENDING; - PROC_ITIMUNLOCK(p); - } - if (flags != 0) { - thread_lock(td); - td->td_flags |= flags; - thread_unlock(td); - } + if (__predict_false( + timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value) || + timevalisset(&pstats->p_timer[ITIMER_PROF].it_value))) + hardclock_itimer(td, pstats, cnt, usermode); #ifdef HWPMC_HOOKS if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid))) From owner-svn-src-head@freebsd.org Thu Nov 29 04:48:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 771A0114EDDC; Thu, 29 Nov 2018 04:48:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1878372C1A; Thu, 29 Nov 2018 04:48:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA15314B4A; Thu, 29 Nov 2018 04:48:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT4mMxM063451; Thu, 29 Nov 2018 04:48:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT4mMIe063450; Thu, 29 Nov 2018 04:48:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290448.wAT4mMIe063450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 04:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341180 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 341180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1878372C1A X-Spamd-Result: default: False [1.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.478,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.47)[0.465,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 04:48:23 -0000 Author: mjg Date: Thu Nov 29 04:48:22 2018 New Revision: 341180 URL: https://svnweb.freebsd.org/changeset/base/341180 Log: Annotate td_cowgen check as unlikely. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Thu Nov 29 03:57:06 2018 (r341179) +++ head/sys/kern/subr_syscall.c Thu Nov 29 04:48:22 2018 (r341180) @@ -66,7 +66,7 @@ syscallenter(struct thread *td) sa = &td->td_sa; td->td_pticks = 0; - if (td->td_cowgen != p->p_cowgen) + if (__predict_false(td->td_cowgen != p->p_cowgen)) thread_cow_update(td); traced = (p->p_flag & P_TRACED) != 0; if (traced || td->td_dbgflags & TDB_USERWR) { From owner-svn-src-head@freebsd.org Thu Nov 29 05:08:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973C0114FCB8; Thu, 29 Nov 2018 05:08:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE927375B; Thu, 29 Nov 2018 05:08:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18AA514EA7; Thu, 29 Nov 2018 05:08:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT58kFW073604; Thu, 29 Nov 2018 05:08:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT58kPR073602; Thu, 29 Nov 2018 05:08:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290508.wAT58kPR073602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 05:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341181 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 341181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AE927375B X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.46)[0.458,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 05:08:47 -0000 Author: mjg Date: Thu Nov 29 05:08:46 2018 New Revision: 341181 URL: https://svnweb.freebsd.org/changeset/base/341181 Log: Deinline racct throttling out of syscall exit path. racct is not enabled by default and even when it is enabled processes are typically not throttled. The order of checks is left unchanged since racct_enable will be annotated as __read_frequently, while checking for the flag in the processes would probably require an extra fetch. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c head/sys/kern/subr_trap.c head/sys/sys/racct.h Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Thu Nov 29 04:48:22 2018 (r341180) +++ head/sys/kern/kern_racct.c Thu Nov 29 05:08:46 2018 (r341181) @@ -1087,6 +1087,22 @@ racct_move(struct racct *dest, struct racct *src) RACCT_UNLOCK(); } +void +racct_proc_throttled(struct proc *p) +{ + + ASSERT_RACCT_ENABLED(); + + PROC_LOCK(p); + while (p->p_throttled != 0) { + msleep(p->p_racct, &p->p_mtx, 0, "racct", + p->p_throttled < 0 ? 0 : p->p_throttled); + if (p->p_throttled > 0) + p->p_throttled = 0; + } + PROC_UNLOCK(p); +} + /* * Make the process sleep in userret() for 'timeout' ticks. Setting * timeout to -1 makes it sleep until woken up by racct_proc_wakeup(). Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Thu Nov 29 04:48:22 2018 (r341180) +++ head/sys/kern/subr_trap.c Thu Nov 29 05:08:46 2018 (r341181) @@ -198,16 +198,8 @@ userret(struct thread *td, struct trapframe *frame) (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); #endif #ifdef RACCT - if (racct_enable && p->p_throttled != 0) { - PROC_LOCK(p); - while (p->p_throttled != 0) { - msleep(p->p_racct, &p->p_mtx, 0, "racct", - p->p_throttled < 0 ? 0 : p->p_throttled); - if (p->p_throttled > 0) - p->p_throttled = 0; - } - PROC_UNLOCK(p); - } + if (__predict_false(racct_enable && p->p_throttled != 0)) + racct_proc_throttled(p); #endif } Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Thu Nov 29 04:48:22 2018 (r341180) +++ head/sys/sys/racct.h Thu Nov 29 05:08:46 2018 (r341181) @@ -194,6 +194,7 @@ void racct_proc_exit(struct proc *p); void racct_proc_ucred_changed(struct proc *p, struct ucred *oldcred, struct ucred *newcred); void racct_move(struct racct *dest, struct racct *src); +void racct_proc_throttled(struct proc *p); void racct_proc_throttle(struct proc *p, int timeout); #else From owner-svn-src-head@freebsd.org Thu Nov 29 05:17:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155D11150274; Thu, 29 Nov 2018 05:17:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF5B373CB6; Thu, 29 Nov 2018 05:17:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C085815048; Thu, 29 Nov 2018 05:17:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT5HGBY078666; Thu, 29 Nov 2018 05:17:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT5HGYq078664; Thu, 29 Nov 2018 05:17:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290517.wAT5HGYq078664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 05:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341182 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 341182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF5B373CB6 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 05:17:18 -0000 Author: mjg Date: Thu Nov 29 05:17:16 2018 New Revision: 341182 URL: https://svnweb.freebsd.org/changeset/base/341182 Log: Convert racct_enable to bool and annotate as __read_frequently Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c head/sys/sys/racct.h Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Thu Nov 29 05:08:46 2018 (r341181) +++ head/sys/kern/kern_racct.c Thu Nov 29 05:17:16 2018 (r341182) @@ -74,13 +74,13 @@ FEATURE(racct, "Resource Accounting"); */ static int pcpu_threshold = 1; #ifdef RACCT_DEFAULT_TO_DISABLED -int racct_enable = 0; +bool __read_frequently racct_enable = false; #else -int racct_enable = 1; +bool __read_frequently racct_enable = true; #endif SYSCTL_NODE(_kern, OID_AUTO, racct, CTLFLAG_RW, 0, "Resource Accounting"); -SYSCTL_UINT(_kern_racct, OID_AUTO, enable, CTLFLAG_RDTUN, &racct_enable, +SYSCTL_BOOL(_kern_racct, OID_AUTO, enable, CTLFLAG_RDTUN, &racct_enable, 0, "Enable RACCT/RCTL"); SYSCTL_UINT(_kern_racct, OID_AUTO, pcpu_threshold, CTLFLAG_RW, &pcpu_threshold, 0, "Processes with higher %cpu usage than this value can be throttled."); Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Thu Nov 29 05:08:46 2018 (r341181) +++ head/sys/sys/racct.h Thu Nov 29 05:17:16 2018 (r341182) @@ -91,7 +91,7 @@ struct ucred; #define RACCT_DECAYING 0x20 extern int racct_types[]; -extern int racct_enable; +extern bool racct_enable; #define ASSERT_RACCT_ENABLED() KASSERT(racct_enable, \ ("%s called with !racct_enable", __func__)) From owner-svn-src-head@freebsd.org Thu Nov 29 06:29:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6A701153074; Thu, 29 Nov 2018 06:29:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB37761DB; Thu, 29 Nov 2018 06:29:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D54A15C11; Thu, 29 Nov 2018 06:29:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6TQRH014257; Thu, 29 Nov 2018 06:29:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6TP2T014251; Thu, 29 Nov 2018 06:29:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290629.wAT6TP2T014251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341183 - in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys: conf dev/sfxge/common modules/sfxge X-SVN-Commit-Revision: 341183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EB37761DB X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_SHORT(0.48)[0.484,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:29:27 -0000 Author: arybchik Date: Thu Nov 29 06:29:24 2018 New Revision: 341183 URL: https://svnweb.freebsd.org/changeset/base/341183 Log: sfxge(4): add firmware image layout option Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18214 Added: head/sys/dev/sfxge/common/ef10_image.c (contents, props changed) head/sys/dev/sfxge/common/ef10_signed_image_layout.h (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_check.h head/sys/modules/sfxge/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Nov 29 05:17:16 2018 (r341182) +++ head/sys/conf/files.amd64 Thu Nov 29 06:29:24 2018 (r341183) @@ -413,6 +413,7 @@ dev/qlnx/qlnxe/qlnx_os.c optional qlnxe pci \ compile-with "${LINUXKPI_C}" dev/sfxge/common/ef10_ev.c optional sfxge pci dev/sfxge/common/ef10_filter.c optional sfxge pci +dev/sfxge/common/ef10_image.c optional sfxge pci dev/sfxge/common/ef10_intr.c optional sfxge pci dev/sfxge/common/ef10_mac.c optional sfxge pci dev/sfxge/common/ef10_mcdi.c optional sfxge pci Added: head/sys/dev/sfxge/common/ef10_image.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/ef10_image.c Thu Nov 29 06:29:24 2018 (r341183) @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017-2018 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "efx.h" +#include "efx_impl.h" + +#if EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 + +#if EFSYS_OPT_IMAGE_LAYOUT + +#include "ef10_signed_image_layout.h" + + + +#endif /* EFSYS_OPT_IMAGE_LAYOUT */ + +#endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Added: head/sys/dev/sfxge/common/ef10_signed_image_layout.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/ef10_signed_image_layout.h Thu Nov 29 06:29:24 2018 (r341183) @@ -0,0 +1,104 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + * + * $FreeBSD$ + */ + +/* + * This is NOT the original source file. Do NOT edit it. + * To update the image layout headers, please edit the copy in + * the sfregistry repo and then, in that repo, + * "make layout_headers" or "make export" to + * regenerate and export all types of headers. + */ + +/* + * These structures define the layouts for the signed firmware image binary + * saved in NVRAM. The original image is in the Cryptographic message + * syntax (CMS) format which contains the bootable firmware binary plus the + * signatures. The entire image is written into NVRAM to enable the firmware + * to validate the signatures. However, the bootrom still requires the + * bootable-image to start at offset 0 of the NVRAM partition. Hence the image + * is parsed upfront by host utilities (sfupdate) and written into nvram as + * 'signed_image_chunks' described by a header. + * + * This file is used by the MC as well as host-utilities (sfupdate). + */ + +#ifndef _SYS_EF10_SIGNED_IMAGE_LAYOUT_H +#define _SYS_EF10_SIGNED_IMAGE_LAYOUT_H + +/* Signed image chunk type identifiers */ +enum { + SIGNED_IMAGE_CHUNK_CMS_HEADER, /* CMS header describing the signed data */ + SIGNED_IMAGE_CHUNK_REFLASH_HEADER, /* Reflash header */ + SIGNED_IMAGE_CHUNK_IMAGE, /* Bootable binary image */ + SIGNED_IMAGE_CHUNK_REFLASH_TRAILER, /* Reflash trailer */ + SIGNED_IMAGE_CHUNK_SIGNATURE, /* Remaining contents of the signed image, + * including the certifiates and signature */ + NUM_SIGNED_IMAGE_CHUNKS, +}; + +/* Magic */ +#define SIGNED_IMAGE_CHUNK_HDR_MAGIC 0xEF105161 /* EF10 SIGned Image */ + +/* Initial version definition - version 1 */ +#define SIGNED_IMAGE_CHUNK_HDR_VERSION 0x1 + +/* Header length is 32 bytes */ +#define SIGNED_IMAGE_CHUNK_HDR_LEN 32 + +/* + * Structure describing the header of each chunk of signed image + * as stored in NVRAM. + */ +typedef struct signed_image_chunk_hdr_e { + /* + * Magic field to recognise a valid entry + * should match SIGNED_IMAGE_CHUNK_HDR_MAGIC + */ + uint32_t magic; + /* Version number of this header */ + uint32_t version; + /* Chunk type identifier */ + uint32_t id; + /* Chunk offset */ + uint32_t offset; + /* Chunk length */ + uint32_t len; + /* + * Reserved for future expansion of this structure - always + * set to zeros + */ + uint32_t reserved[3]; +} signed_image_chunk_hdr_t; + +#endif /* _SYS_EF10_SIGNED_IMAGE_LAYOUT_H */ Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Nov 29 05:17:16 2018 (r341182) +++ head/sys/dev/sfxge/common/efsys.h Thu Nov 29 06:29:24 2018 (r341183) @@ -267,6 +267,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_VPD 1 #define EFSYS_OPT_NVRAM 1 #define EFSYS_OPT_BOOTCFG 0 +#define EFSYS_OPT_IMAGE_LAYOUT 0 #define EFSYS_OPT_DIAG 0 #define EFSYS_OPT_RX_SCALE 1 Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Thu Nov 29 05:17:16 2018 (r341182) +++ head/sys/dev/sfxge/common/efx_check.h Thu Nov 29 06:29:24 2018 (r341183) @@ -208,6 +208,13 @@ # endif #endif /* EFSYS_OPT_NVRAM */ +#if EFSYS_OPT_IMAGE_LAYOUT +/* Support signed image layout handling */ +# if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) +# error "IMAGE_LAYOUT requires MEDFORD or MEDFORD2" +# endif +#endif /* EFSYS_OPT_IMAGE_LAYOUT */ + #ifdef EFSYS_OPT_NVRAM_FALCON_BOOTROM # error "NVRAM_FALCON_BOOTROM is obsolete and is not supported." #endif Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Thu Nov 29 05:17:16 2018 (r341182) +++ head/sys/modules/sfxge/Makefile Thu Nov 29 06:29:24 2018 (r341183) @@ -30,9 +30,9 @@ SRCS+= siena_mac.c siena_mcdi.c siena_nic.c siena_nvra SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h -SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c ef10_mcdi.c ef10_nic.c -SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c ef10_vpd.c -SRCS+= ef10_impl.h +SRCS+= ef10_ev.c ef10_filter.c ef10_image.c ef10_intr.c ef10_mac.c ef10_mcdi.c +SRCS+= ef10_nic.c ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c ef10_vpd.c +SRCS+= ef10_impl.h ef10_signed_image_layout.h SRCS+= hunt_nic.c SRCS+= hunt_impl.h From owner-svn-src-head@freebsd.org Thu Nov 29 06:41:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AEA31153735; Thu, 29 Nov 2018 06:41:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF2176927; Thu, 29 Nov 2018 06:41:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CB5715F15; Thu, 29 Nov 2018 06:41:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6fgB6023768; Thu, 29 Nov 2018 06:41:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6ffjk023767; Thu, 29 Nov 2018 06:41:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290641.wAT6ffjk023767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341184 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BF2176927 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.59)[0.594,0]; NEURAL_SPAM_MEDIUM(0.42)[0.421,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.509,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:41:42 -0000 Author: arybchik Date: Thu Nov 29 06:41:41 2018 New Revision: 341184 URL: https://svnweb.freebsd.org/changeset/base/341184 Log: sfxge(4): add signed image layout support Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18215 Modified: head/sys/dev/sfxge/common/ef10_image.c (contents, props changed) head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_image.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_image.c Thu Nov 29 06:29:24 2018 (r341183) +++ head/sys/dev/sfxge/common/ef10_image.c Thu Nov 29 06:41:41 2018 (r341184) @@ -40,7 +40,873 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_IMAGE_LAYOUT -#include "ef10_signed_image_layout.h" +/* + * Utility routines to support limited parsing of ASN.1 tags. This is not a + * general purpose ASN.1 parser, but is sufficient to locate the required + * objects in a signed image with CMS headers. + */ + +/* DER encodings for ASN.1 tags (see ITU-T X.690) */ +#define ASN1_TAG_INTEGER (0x02) +#define ASN1_TAG_OCTET_STRING (0x04) +#define ASN1_TAG_OBJ_ID (0x06) +#define ASN1_TAG_SEQUENCE (0x30) +#define ASN1_TAG_SET (0x31) + +#define ASN1_TAG_IS_PRIM(tag) ((tag & 0x20) == 0) + +#define ASN1_TAG_PRIM_CONTEXT(n) (0x80 + (n)) +#define ASN1_TAG_CONS_CONTEXT(n) (0xA0 + (n)) + +typedef struct efx_asn1_cursor_s { + uint8_t *buffer; + uint32_t length; + + uint8_t tag; + uint32_t hdr_size; + uint32_t val_size; +} efx_asn1_cursor_t; + + +/* Parse header of DER encoded ASN.1 TLV and match tag */ +static __checkReturn efx_rc_t +efx_asn1_parse_header_match_tag( + __inout efx_asn1_cursor_t *cursor, + __in uint8_t tag) +{ + efx_rc_t rc; + + if (cursor == NULL || cursor->buffer == NULL || cursor->length < 2) { + rc = EINVAL; + goto fail1; + } + + cursor->tag = cursor->buffer[0]; + if (cursor->tag != tag) { + /* Tag not matched */ + rc = ENOENT; + goto fail2; + } + + if ((cursor->tag & 0x1F) == 0x1F) { + /* Long tag format not used in CMS syntax */ + rc = EINVAL; + goto fail3; + } + + if ((cursor->buffer[1] & 0x80) == 0) { + /* Short form: length is 0..127 */ + cursor->hdr_size = 2; + cursor->val_size = cursor->buffer[1]; + } else { + /* Long form: length encoded as [0x80+nbytes][length bytes] */ + uint32_t nbytes = cursor->buffer[1] & 0x7F; + uint32_t offset; + + if (nbytes == 0) { + /* Indefinite length not allowed in DER encoding */ + rc = EINVAL; + goto fail4; + } + if (2 + nbytes > cursor->length) { + /* Header length overflows image buffer */ + rc = EINVAL; + goto fail6; + } + if (nbytes > sizeof (uint32_t)) { + /* Length encoding too big */ + rc = E2BIG; + goto fail5; + } + cursor->hdr_size = 2 + nbytes; + cursor->val_size = 0; + for (offset = 2; offset < cursor->hdr_size; offset++) { + cursor->val_size = + (cursor->val_size << 8) | cursor->buffer[offset]; + } + } + + if ((cursor->hdr_size + cursor->val_size) > cursor->length) { + /* Length overflows image buffer */ + rc = E2BIG; + goto fail7; + } + + return (0); + +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* Enter nested ASN.1 TLV (contained in value of current TLV) */ +static __checkReturn efx_rc_t +efx_asn1_enter_tag( + __inout efx_asn1_cursor_t *cursor, + __in uint8_t tag) +{ + efx_rc_t rc; + + if (cursor == NULL) { + rc = EINVAL; + goto fail1; + } + + if (ASN1_TAG_IS_PRIM(tag)) { + /* Cannot enter a primitive tag */ + rc = ENOTSUP; + goto fail2; + } + rc = efx_asn1_parse_header_match_tag(cursor, tag); + if (rc != 0) { + /* Invalid TLV or wrong tag */ + goto fail3; + } + + /* Limit cursor range to nested TLV */ + cursor->buffer += cursor->hdr_size; + cursor->length = cursor->val_size; + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Check that the current ASN.1 TLV matches the given tag and value. + * Advance cursor to next TLV on a successful match. + */ +static __checkReturn efx_rc_t +efx_asn1_match_tag_value( + __inout efx_asn1_cursor_t *cursor, + __in uint8_t tag, + __in const void *valp, + __in uint32_t val_size) +{ + efx_rc_t rc; + + if (cursor == NULL) { + rc = EINVAL; + goto fail1; + } + rc = efx_asn1_parse_header_match_tag(cursor, tag); + if (rc != 0) { + /* Invalid TLV or wrong tag */ + goto fail2; + } + if (cursor->val_size != val_size) { + /* Value size is different */ + rc = EINVAL; + goto fail3; + } + if (memcmp(cursor->buffer + cursor->hdr_size, valp, val_size) != 0) { + /* Value content is different */ + rc = EINVAL; + goto fail4; + } + cursor->buffer += cursor->hdr_size + cursor->val_size; + cursor->length -= cursor->hdr_size + cursor->val_size; + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* Advance cursor to next TLV */ +static __checkReturn efx_rc_t +efx_asn1_skip_tag( + __inout efx_asn1_cursor_t *cursor, + __in uint8_t tag) +{ + efx_rc_t rc; + + if (cursor == NULL) { + rc = EINVAL; + goto fail1; + } + + rc = efx_asn1_parse_header_match_tag(cursor, tag); + if (rc != 0) { + /* Invalid TLV or wrong tag */ + goto fail2; + } + cursor->buffer += cursor->hdr_size + cursor->val_size; + cursor->length -= cursor->hdr_size + cursor->val_size; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* Return pointer to value octets and value size from current TLV */ +static __checkReturn efx_rc_t +efx_asn1_get_tag_value( + __inout efx_asn1_cursor_t *cursor, + __in uint8_t tag, + __out uint8_t **valp, + __out uint32_t *val_sizep) +{ + efx_rc_t rc; + + if (cursor == NULL || valp == NULL || val_sizep == NULL) { + rc = EINVAL; + goto fail1; + } + + rc = efx_asn1_parse_header_match_tag(cursor, tag); + if (rc != 0) { + /* Invalid TLV or wrong tag */ + goto fail2; + } + *valp = cursor->buffer + cursor->hdr_size; + *val_sizep = cursor->val_size; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + +/* + * Utility routines for parsing CMS headers (see RFC2315, PKCS#7) + */ + +/* OID 1.2.840.113549.1.7.2 */ +static const uint8_t PKCS7_SignedData[] = +{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02 }; + +/* OID 1.2.840.113549.1.7.1 */ +static const uint8_t PKCS7_Data[] = +{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01 }; + +/* SignedData structure version */ +static const uint8_t SignedData_Version[] = +{ 0x03 }; + +/* + * Check for a valid image in signed image format. This uses CMS syntax + * (see RFC2315, PKCS#7) to provide signatures, and certificates required + * to validate the signatures. The encapsulated content is in unsigned image + * format (reflash header, image code, trailer checksum). + */ +static __checkReturn efx_rc_t +efx_check_signed_image_header( + __in void *bufferp, + __in uint32_t buffer_size, + __out uint32_t *content_offsetp, + __out uint32_t *content_lengthp) +{ + efx_asn1_cursor_t cursor; + uint8_t *valp; + uint32_t val_size; + efx_rc_t rc; + + if (content_offsetp == NULL || content_lengthp == NULL) { + rc = EINVAL; + goto fail1; + } + cursor.buffer = (uint8_t *)bufferp; + cursor.length = buffer_size; + + /* ContextInfo */ + rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); + if (rc != 0) + goto fail2; + + /* ContextInfo.contentType */ + rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_OBJ_ID, + PKCS7_SignedData, sizeof (PKCS7_SignedData)); + if (rc != 0) + goto fail3; + + /* ContextInfo.content */ + rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_CONS_CONTEXT(0)); + if (rc != 0) + goto fail4; + + /* SignedData */ + rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); + if (rc != 0) + goto fail5; + + /* SignedData.version */ + rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_INTEGER, + SignedData_Version, sizeof (SignedData_Version)); + if (rc != 0) + goto fail6; + + /* SignedData.digestAlgorithms */ + rc = efx_asn1_skip_tag(&cursor, ASN1_TAG_SET); + if (rc != 0) + goto fail7; + + /* SignedData.encapContentInfo */ + rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); + if (rc != 0) + goto fail8; + + /* SignedData.encapContentInfo.econtentType */ + rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_OBJ_ID, + PKCS7_Data, sizeof (PKCS7_Data)); + if (rc != 0) + goto fail9; + + /* SignedData.encapContentInfo.econtent */ + rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_CONS_CONTEXT(0)); + if (rc != 0) + goto fail10; + + /* + * The octet string contains the image header, image code bytes and + * image trailer CRC (same as unsigned image layout). + */ + valp = NULL; + val_size = 0; + rc = efx_asn1_get_tag_value(&cursor, ASN1_TAG_OCTET_STRING, + &valp, &val_size); + if (rc != 0) + goto fail11; + + if ((valp == NULL) || (val_size == 0)) { + rc = EINVAL; + goto fail12; + } + if (valp < (uint8_t *)bufferp) { + rc = EINVAL; + goto fail13; + } + if ((valp + val_size) > ((uint8_t *)bufferp + buffer_size)) { + rc = EINVAL; + goto fail14; + } + + *content_offsetp = (uint32_t)(valp - (uint8_t *)bufferp); + *content_lengthp = val_size; + + return (0); + +fail14: + EFSYS_PROBE(fail14); +fail13: + EFSYS_PROBE(fail13); +fail12: + EFSYS_PROBE(fail12); +fail11: + EFSYS_PROBE(fail11); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); +fail8: + EFSYS_PROBE(fail8); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +efx_check_unsigned_image( + __in void *bufferp, + __in uint32_t buffer_size) +{ + efx_image_header_t *header; + efx_image_trailer_t *trailer; + uint32_t crc; + efx_rc_t rc; + + EFX_STATIC_ASSERT(sizeof (*header) == EFX_IMAGE_HEADER_SIZE); + EFX_STATIC_ASSERT(sizeof (*trailer) == EFX_IMAGE_TRAILER_SIZE); + + /* Must have at least enough space for required image header fields */ + if (buffer_size < (EFX_FIELD_OFFSET(efx_image_header_t, eih_size) + + sizeof (header->eih_size))) { + rc = ENOSPC; + goto fail1; + } + header = (efx_image_header_t *)bufferp; + + if (header->eih_magic != EFX_IMAGE_HEADER_MAGIC) { + rc = EINVAL; + goto fail2; + } + + /* + * Check image header version is same or higher than lowest required + * version. + */ + if (header->eih_version < EFX_IMAGE_HEADER_VERSION) { + rc = EINVAL; + goto fail3; + } + + /* Buffer must have space for image header, code and image trailer. */ + if (buffer_size < (header->eih_size + header->eih_code_size + + EFX_IMAGE_TRAILER_SIZE)) { + rc = ENOSPC; + goto fail4; + } + + /* Check CRC from image buffer matches computed CRC. */ + trailer = (efx_image_trailer_t *)((uint8_t *)header + + header->eih_size + header->eih_code_size); + + crc = efx_crc32_calculate(0, (uint8_t *)header, + (header->eih_size + header->eih_code_size)); + + if (trailer->eit_crc != crc) { + rc = EINVAL; + goto fail5; + } + + return (0); + +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_check_reflash_image( + __in void *bufferp, + __in uint32_t buffer_size, + __out efx_image_info_t *infop) +{ + efx_image_format_t format = EFX_IMAGE_FORMAT_NO_IMAGE; + uint32_t image_offset; + uint32_t image_size; + void *imagep; + efx_rc_t rc; + + + EFSYS_ASSERT(infop != NULL); + if (infop == NULL) { + rc = EINVAL; + goto fail1; + } + memset(infop, 0, sizeof (*infop)); + + if (bufferp == NULL || buffer_size == 0) { + rc = EINVAL; + goto fail2; + } + + /* + * Check if the buffer contains an image in signed format, and if so, + * locate the image header. + */ + rc = efx_check_signed_image_header(bufferp, buffer_size, + &image_offset, &image_size); + if (rc == 0) { + /* + * Buffer holds signed image format. Check that the encapsulated + * content is in unsigned image format. + */ + format = EFX_IMAGE_FORMAT_SIGNED; + } else { + /* Check if the buffer holds image in unsigned image format */ + format = EFX_IMAGE_FORMAT_UNSIGNED; + image_offset = 0; + image_size = buffer_size; + } + if (image_offset + image_size > buffer_size) { + rc = E2BIG; + goto fail3; + } + imagep = (uint8_t *)bufferp + image_offset; + + /* Check unsigned image layout (image header, code, image trailer) */ + rc = efx_check_unsigned_image(imagep, image_size); + if (rc != 0) + goto fail4; + + /* Return image details */ + infop->eii_format = format; + infop->eii_imagep = bufferp; + infop->eii_image_size = buffer_size; + infop->eii_headerp = (efx_image_header_t *)imagep; + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); + infop->eii_format = EFX_IMAGE_FORMAT_INVALID; + infop->eii_imagep = NULL; + infop->eii_image_size = 0; + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_build_signed_image_write_buffer( + __out_bcount(buffer_size) + uint8_t *bufferp, + __in uint32_t buffer_size, + __in efx_image_info_t *infop, + __out efx_image_header_t **headerpp) +{ + signed_image_chunk_hdr_t chunk_hdr; + uint32_t hdr_offset; + struct { + uint32_t offset; + uint32_t size; + } cms_header, image_header, code, image_trailer, signature; + efx_rc_t rc; + + EFSYS_ASSERT((infop != NULL) && (headerpp != NULL)); + + if ((bufferp == NULL) || (buffer_size == 0) || + (infop == NULL) || (headerpp == NULL)) { + /* Invalid arguments */ + rc = EINVAL; + goto fail1; + } + if ((infop->eii_format != EFX_IMAGE_FORMAT_SIGNED) || + (infop->eii_imagep == NULL) || + (infop->eii_headerp == NULL) || + ((uint8_t *)infop->eii_headerp < (uint8_t *)infop->eii_imagep) || + (infop->eii_image_size < EFX_IMAGE_HEADER_SIZE) || + ((size_t)((uint8_t *)infop->eii_headerp - infop->eii_imagep) > + (infop->eii_image_size - EFX_IMAGE_HEADER_SIZE))) { + /* Invalid image info */ + rc = EINVAL; + goto fail2; + } + + /* Locate image chunks in original signed image */ + cms_header.offset = 0; + cms_header.size = + (uint32_t)((uint8_t *)infop->eii_headerp - infop->eii_imagep); + if ((cms_header.size > buffer_size) || + (cms_header.offset > (buffer_size - cms_header.size))) { + rc = EINVAL; + goto fail3; + } + + image_header.offset = cms_header.offset + cms_header.size; + image_header.size = infop->eii_headerp->eih_size; + if ((image_header.size > buffer_size) || + (image_header.offset > (buffer_size - image_header.size))) { + rc = EINVAL; + goto fail4; + } + + code.offset = image_header.offset + image_header.size; + code.size = infop->eii_headerp->eih_code_size; + if ((code.size > buffer_size) || + (code.offset > (buffer_size - code.size))) { + rc = EINVAL; + goto fail5; + } + + image_trailer.offset = code.offset + code.size; + image_trailer.size = EFX_IMAGE_TRAILER_SIZE; + if ((image_trailer.size > buffer_size) || + (image_trailer.offset > (buffer_size - image_trailer.size))) { + rc = EINVAL; + goto fail6; + } + + signature.offset = image_trailer.offset + image_trailer.size; + signature.size = (uint32_t)(infop->eii_image_size - signature.offset); + if ((signature.size > buffer_size) || + (signature.offset > (buffer_size - signature.size))) { + rc = EINVAL; + goto fail7; + } + + EFSYS_ASSERT3U(infop->eii_image_size, ==, cms_header.size + + image_header.size + code.size + image_trailer.size + + signature.size); + + /* BEGIN CSTYLED */ + /* + * Build signed image partition, inserting chunk headers. + * + * Signed Image: Image in NVRAM partition: + * + * +-----------------+ +-----------------+ + * | CMS header | | mcfw.update |<----+ + * +-----------------+ | | | + * | reflash header | +-----------------+ | + * +-----------------+ | chunk header: |-->--|-+ + * | mcfw.update | | REFLASH_TRAILER | | | + * | | +-----------------+ | | + * +-----------------+ +-->| CMS header | | | + * | reflash trailer | | +-----------------+ | | + * +-----------------+ | | chunk header: |->-+ | | + * | signature | | | REFLASH_HEADER | | | | + * +-----------------+ | +-----------------+ | | | + * | | reflash header |<--+ | | + * | +-----------------+ | | + * | | chunk header: |-->--+ | + * | | IMAGE | | + * | +-----------------+ | + * | | reflash trailer |<------+ + * | +-----------------+ + * | | chunk header: | + * | | SIGNATURE |->-+ + * | +-----------------+ | + * | | signature |<--+ + * | +-----------------+ + * | | ...unused... | + * | +-----------------+ + * +-<-| chunk header: | + * >-->| CMS_HEADER | + * +-----------------+ + * + * Each chunk header gives the partition offset and length of the image + * chunk's data. The image chunk data is immediately followed by the + * chunk header for the next chunk. + * + * The data chunk for the firmware code must be at the start of the + * partition (needed for the bootloader). The first chunk header in the + * chain (for the CMS header) is stored at the end of the partition. The + * chain of chunk headers maintains the same logical order of image + * chunks as the original signed image file. This set of constraints + * results in the layout used for the data chunks and chunk headers. + */ + /* END CSTYLED */ + memset(bufferp, 0xFF, buffer_size); + + EFX_STATIC_ASSERT(sizeof (chunk_hdr) == SIGNED_IMAGE_CHUNK_HDR_LEN); + memset(&chunk_hdr, 0, SIGNED_IMAGE_CHUNK_HDR_LEN); + + /* + * CMS header + */ + if (buffer_size < SIGNED_IMAGE_CHUNK_HDR_LEN) { + rc = ENOSPC; + goto fail8; + } + hdr_offset = buffer_size - SIGNED_IMAGE_CHUNK_HDR_LEN; + + chunk_hdr.magic = SIGNED_IMAGE_CHUNK_HDR_MAGIC; + chunk_hdr.version = SIGNED_IMAGE_CHUNK_HDR_VERSION; + chunk_hdr.id = SIGNED_IMAGE_CHUNK_CMS_HEADER; + chunk_hdr.offset = code.size + SIGNED_IMAGE_CHUNK_HDR_LEN; + chunk_hdr.len = cms_header.size; + + memcpy(bufferp + hdr_offset, &chunk_hdr, sizeof (chunk_hdr)); + + if ((chunk_hdr.len > buffer_size) || + (chunk_hdr.offset > (buffer_size - chunk_hdr.len))) { + rc = ENOSPC; + goto fail9; + } + memcpy(bufferp + chunk_hdr.offset, + infop->eii_imagep + cms_header.offset, + cms_header.size); + + /* + * Image header + */ + hdr_offset = chunk_hdr.offset + chunk_hdr.len; + if (hdr_offset > (buffer_size - SIGNED_IMAGE_CHUNK_HDR_LEN)) { + rc = ENOSPC; + goto fail10; + } + chunk_hdr.magic = SIGNED_IMAGE_CHUNK_HDR_MAGIC; + chunk_hdr.version = SIGNED_IMAGE_CHUNK_HDR_VERSION; + chunk_hdr.id = SIGNED_IMAGE_CHUNK_REFLASH_HEADER; + chunk_hdr.offset = hdr_offset + SIGNED_IMAGE_CHUNK_HDR_LEN; + chunk_hdr.len = image_header.size; + + memcpy(bufferp + hdr_offset, &chunk_hdr, SIGNED_IMAGE_CHUNK_HDR_LEN); + + if ((chunk_hdr.len > buffer_size) || + (chunk_hdr.offset > (buffer_size - chunk_hdr.len))) { + rc = ENOSPC; + goto fail11; + } + memcpy(bufferp + chunk_hdr.offset, + infop->eii_imagep + image_header.offset, + image_header.size); + + *headerpp = (efx_image_header_t *)(bufferp + chunk_hdr.offset); + + /* + * Firmware code + */ + hdr_offset = chunk_hdr.offset + chunk_hdr.len; + if (hdr_offset > (buffer_size - SIGNED_IMAGE_CHUNK_HDR_LEN)) { + rc = ENOSPC; + goto fail12; + } + chunk_hdr.magic = SIGNED_IMAGE_CHUNK_HDR_MAGIC; + chunk_hdr.version = SIGNED_IMAGE_CHUNK_HDR_VERSION; + chunk_hdr.id = SIGNED_IMAGE_CHUNK_IMAGE; + chunk_hdr.offset = 0; + chunk_hdr.len = code.size; + + memcpy(bufferp + hdr_offset, &chunk_hdr, SIGNED_IMAGE_CHUNK_HDR_LEN); + + if ((chunk_hdr.len > buffer_size) || + (chunk_hdr.offset > (buffer_size - chunk_hdr.len))) { + rc = ENOSPC; + goto fail13; + } + memcpy(bufferp + chunk_hdr.offset, + infop->eii_imagep + code.offset, + code.size); + + /* + * Image trailer (CRC) + */ + chunk_hdr.magic = SIGNED_IMAGE_CHUNK_HDR_MAGIC; + chunk_hdr.version = SIGNED_IMAGE_CHUNK_HDR_VERSION; + chunk_hdr.id = SIGNED_IMAGE_CHUNK_REFLASH_TRAILER; + chunk_hdr.offset = hdr_offset + SIGNED_IMAGE_CHUNK_HDR_LEN; + chunk_hdr.len = image_trailer.size; + + hdr_offset = code.size; + if (hdr_offset > (buffer_size - SIGNED_IMAGE_CHUNK_HDR_LEN)) { + rc = ENOSPC; + goto fail14; + } + + memcpy(bufferp + hdr_offset, &chunk_hdr, SIGNED_IMAGE_CHUNK_HDR_LEN); + + if ((chunk_hdr.len > buffer_size) || + (chunk_hdr.offset > (buffer_size - chunk_hdr.len))) { + rc = ENOSPC; + goto fail15; + } + memcpy((uint8_t *)bufferp + chunk_hdr.offset, + infop->eii_imagep + image_trailer.offset, + image_trailer.size); + + /* + * Signature + */ + hdr_offset = chunk_hdr.offset + chunk_hdr.len; + if (hdr_offset > (buffer_size - SIGNED_IMAGE_CHUNK_HDR_LEN)) { + rc = ENOSPC; + goto fail16; + } + chunk_hdr.magic = SIGNED_IMAGE_CHUNK_HDR_MAGIC; + chunk_hdr.version = SIGNED_IMAGE_CHUNK_HDR_VERSION; + chunk_hdr.id = SIGNED_IMAGE_CHUNK_SIGNATURE; + chunk_hdr.offset = chunk_hdr.offset + SIGNED_IMAGE_CHUNK_HDR_LEN; + chunk_hdr.len = signature.size; + + memcpy(bufferp + hdr_offset, &chunk_hdr, SIGNED_IMAGE_CHUNK_HDR_LEN); + + if ((chunk_hdr.len > buffer_size) || + (chunk_hdr.offset > (buffer_size - chunk_hdr.len))) { + rc = ENOSPC; + goto fail17; + } + memcpy(bufferp + chunk_hdr.offset, + infop->eii_imagep + signature.offset, + signature.size); + + return (0); + +fail17: + EFSYS_PROBE(fail17); +fail16: + EFSYS_PROBE(fail16); +fail15: + EFSYS_PROBE(fail15); +fail14: + EFSYS_PROBE(fail14); +fail13: + EFSYS_PROBE(fail13); +fail12: + EFSYS_PROBE(fail12); +fail11: + EFSYS_PROBE(fail11); +fail10: + EFSYS_PROBE(fail10); +fail9: + EFSYS_PROBE(fail9); +fail8: + EFSYS_PROBE(fail8); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:29:24 2018 (r341183) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:41:41 2018 (r341184) @@ -1595,6 +1595,93 @@ efx_bootcfg_write( #endif /* EFSYS_OPT_BOOTCFG */ +#if EFSYS_OPT_IMAGE_LAYOUT + +#include "ef10_signed_image_layout.h" + +/* + * Image header used in unsigned and signed image layouts (see SF-102785-PS). + * + * NOTE: + * The image header format is extensible. However, older drivers require an + * exact match of image header version and header length when validating and + * writing firmware images. + * + * To avoid breaking backward compatibility, we use the upper bits of the + * controller version fields to contain an extra version number used for + * combined bootROM and UEFI ROM images on EF10 and later (to hold the UEFI ROM + * version). See bug39254 and SF-102785-PS for details. + */ +typedef struct efx_image_header_s { + uint32_t eih_magic; + uint32_t eih_version; + uint32_t eih_type; + uint32_t eih_subtype; + uint32_t eih_code_size; + uint32_t eih_size; + union { + uint32_t eih_controller_version_min; + struct { + uint16_t eih_controller_version_min_short; + uint8_t eih_extra_version_a; + uint8_t eih_extra_version_b; + }; + }; + union { + uint32_t eih_controller_version_max; + struct { + uint16_t eih_controller_version_max_short; + uint8_t eih_extra_version_c; + uint8_t eih_extra_version_d; + }; + }; + uint16_t eih_code_version_a; + uint16_t eih_code_version_b; + uint16_t eih_code_version_c; + uint16_t eih_code_version_d; +} efx_image_header_t; + +#define EFX_IMAGE_HEADER_SIZE (40) +#define EFX_IMAGE_HEADER_VERSION (4) +#define EFX_IMAGE_HEADER_MAGIC (0x106F1A5) + + +typedef struct efx_image_trailer_s { + uint32_t eit_crc; +} efx_image_trailer_t; + +#define EFX_IMAGE_TRAILER_SIZE (4) + +typedef enum efx_image_format_e { + EFX_IMAGE_FORMAT_NO_IMAGE, + EFX_IMAGE_FORMAT_INVALID, + EFX_IMAGE_FORMAT_UNSIGNED, + EFX_IMAGE_FORMAT_SIGNED, +} efx_image_format_t; + +typedef struct efx_image_info_s { + efx_image_format_t eii_format; + uint8_t * eii_imagep; + size_t eii_image_size; + efx_image_header_t * eii_headerp; +} efx_image_info_t; + +extern __checkReturn efx_rc_t +efx_check_reflash_image( + __in void *bufferp, + __in uint32_t buffer_size, + __out efx_image_info_t *infop); + +extern __checkReturn efx_rc_t +efx_build_signed_image_write_buffer( + __out_bcount(buffer_size) + uint8_t *bufferp, + __in uint32_t buffer_size, + __in efx_image_info_t *infop, + __out efx_image_header_t **headerpp); + +#endif /* EFSYS_OPT_IMAGE_LAYOUT */ + #if EFSYS_OPT_DIAG typedef enum efx_pattern_type_t { From owner-svn-src-head@freebsd.org Thu Nov 29 06:41:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F36A1153758; Thu, 29 Nov 2018 06:41:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3085776A28; Thu, 29 Nov 2018 06:41:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F5C615F24; Thu, 29 Nov 2018 06:41:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6frWq023826; Thu, 29 Nov 2018 06:41:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6frPI023824; Thu, 29 Nov 2018 06:41:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290641.wAT6frPI023824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341185 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3085776A28 X-Spamd-Result: default: False [1.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.632,0]; NEURAL_SPAM_MEDIUM(0.47)[0.474,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.534,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:41:56 -0000 Author: arybchik Date: Thu Nov 29 06:41:53 2018 New Revision: 341185 URL: https://svnweb.freebsd.org/changeset/base/341185 Log: sfxge(4): sync MCDI headers and TLV layout Regenerate MCDI and TLV layout headers from firmwaresrc to pick up DPDK firmware variant and related Rx queue and filtering extensions. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18216 Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Nov 29 06:41:41 2018 (r341184) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Nov 29 06:41:53 2018 (r341185) @@ -434,6 +434,7 @@ struct tlv_firmware_options { #define TLV_FIRMWARE_VARIANT_PACKED_STREAM_HASH_MODE_1 \ MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 #define TLV_FIRMWARE_VARIANT_RULES_ENGINE MC_CMD_FW_RULES_ENGINE +#define TLV_FIRMWARE_VARIANT_DPDK MC_CMD_FW_DPDK }; /* Voltage settings @@ -562,6 +563,17 @@ struct tlv_global_port_mode { uint32_t length; uint32_t port_mode; #define TLV_PORT_MODE_DEFAULT (0xffffffff) /* Default for given platform */ + +/* Huntington port modes */ +#define TLV_PORT_MODE_10G (0) +#define TLV_PORT_MODE_40G (1) +#define TLV_PORT_MODE_10G_10G (2) +#define TLV_PORT_MODE_40G_40G (3) +#define TLV_PORT_MODE_10G_10G_10G_10G (4) +#define TLV_PORT_MODE_40G_10G_10G (6) +#define TLV_PORT_MODE_10G_10G_40G (7) + +/* Medford (and later) port modes */ #define TLV_PORT_MODE_1x1_NA (0) /* Single 10G/25G on mdi0 */ #define TLV_PORT_MODE_1x4_NA (1) /* Single 100G/40G on mdi0 */ #define TLV_PORT_MODE_NA_1x4 (22) /* Single 100G/40G on mdi1 */ @@ -569,8 +581,8 @@ struct tlv_global_port_mode { #define TLV_PORT_MODE_NA_1x2 (11) /* Single 50G on mdi1 */ #define TLV_PORT_MODE_1x1_1x1 (2) /* Single 10G/25G on mdi0, single 10G/25G on mdi1 */ #define TLV_PORT_MODE_1x4_1x4 (3) /* Single 40G on mdi0, single 40G on mdi1 */ -#define TLV_PORT_MODE_2x1_2x1 (4) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1 - WARNING: bug3720: On Newport only, this is actually Quad 10G on mdi0 */ -#define TLV_PORT_MODE_4x1_NA (5) /* Quad 10G/25G on mdi0 */ +#define TLV_PORT_MODE_2x1_2x1 (5) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1 */ +#define TLV_PORT_MODE_4x1_NA (4) /* Quad 10G/25G on mdi0 */ #define TLV_PORT_MODE_NA_4x1 (8) /* Quad 10G/25G on mdi1 */ #define TLV_PORT_MODE_1x4_2x1 (6) /* Single 40G on mdi0, dual 10G/25G on mdi1 */ #define TLV_PORT_MODE_2x1_1x4 (7) /* Dual 10G/25G on mdi0, single 40G on mdi1 */ @@ -581,7 +593,13 @@ struct tlv_global_port_mode { #define TLV_PORT_MODE_1x2_1x4 (16) /* Single 50G on mdi0, single 40G on mdi1 */ #define TLV_PORT_MODE_1x2_2x1 (17) /* Single 50G on mdi0, dual 10G/25G on mdi1 */ #define TLV_PORT_MODE_2x1_1x2 (18) /* Dual 10G/25G on mdi0, single 50G on mdi1 */ -/* Below modes are eftest only, to allow snapper explicit selection between multi-channel and LLPCS. In production, this selection is automatic and outside world should not care about LLPCS */ + +/* Snapper-only Medford2 port modes. + * These modes are eftest only, to allow snapper explicit + * selection between multi-channel and LLPCS. In production, + * this selection is automatic and outside world should not + * care about LLPCS. + */ #define TLV_PORT_MODE_2x1_2x1_LL (19) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1, low-latency PCS */ #define TLV_PORT_MODE_4x1_NA_LL (20) /* Quad 10G/25G on mdi0, low-latency PCS */ #define TLV_PORT_MODE_NA_4x1_LL (21) /* Quad 10G/25G on mdi1, low-latency PCS */ @@ -590,42 +608,13 @@ struct tlv_global_port_mode { #define TLV_PORT_MODE_BUG63720_DO_NOT_USE (9) /* bug63720: Do not use */ #define TLV_PORT_MODE_MAX TLV_PORT_MODE_1x1_1x1_LL -/* Deprecated aliases */ -#define TLV_PORT_MODE_10G TLV_PORT_MODE_1x1_NA -#define TLV_PORT_MODE_40G TLV_PORT_MODE_1x4_NA -#define TLV_PORT_MODE_10G_10G TLV_PORT_MODE_1x1_1x1 -#define TLV_PORT_MODE_40G_40G TLV_PORT_MODE_1x4_1x4 -#define TLV_PORT_MODE_10G_10G_10G_10G TLV_PORT_MODE_2x1_2x1 -#define TLV_PORT_MODE_10G_10G_10G_10G_Q1 TLV_PORT_MODE_2x1_2x1 /* bug63720: Do not use */ -#define TLV_PORT_MODE_10G_10G_10G_10G_Q TLV_PORT_MODE_4x1_NA -#define TLV_PORT_MODE_40G_10G_10G TLV_PORT_MODE_1x4_2x1 -#define TLV_PORT_MODE_10G_10G_40G TLV_PORT_MODE_2x1_1x4 -#define TLV_PORT_MODE_10G_10G_10G_10G_Q2 TLV_PORT_MODE_NA_4x1 -#define TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2 TLV_PORT_MODE_BUG63720_DO_NOT_USE /* bug63720: Do not use */ -#define TLV_PORT_MODE_25G TLV_PORT_MODE_1x1_NA /* Single 25G on mdi0 */ -#define TLV_PORT_MODE_100G_Q1 TLV_PORT_MODE_1x4_NA /* Single 100G on mdi0 */ -#define TLV_PORT_MODE_100G_Q2 TLV_PORT_MODE_NA_1x4 /* Single 100G on mdi1 */ -#define TLV_PORT_MODE_50G_Q1 TLV_PORT_MODE_1x2_NA /* Single 50G on mdi0 */ -#define TLV_PORT_MODE_50G_Q2 TLV_PORT_MODE_NA_1x2 /* Single 50G on mdi1 */ -#define TLV_PORT_MODE_25G_25G TLV_PORT_MODE_1x1_1x1 /* Single 25G on mdi0, single 25G on mdi1 */ -#define TLV_PORT_MODE_25G_25G_25G_25G_Q1_Q2 TLV_PORT_MODE_2x1_2x1 /* Dual 25G on mdi0, dual 25G on mdi1 */ -#define TLV_PORT_MODE_25G_25G_25G_25G_Q1 TLV_PORT_MODE_4x1_NA /* Quad 25G on mdi0 */ -#define TLV_PORT_MODE_25G_25G_25G_25G_Q2 TLV_PORT_MODE_NA_4x1 /* Quad 25G on mdi1 */ -#define TLV_PORT_MODE_40G_25G_25G TLV_PORT_MODE_1x4_2x1 /* Single 40G on mdi0, dual 25G on mdi1 */ -#define TLV_PORT_MODE_25G_25G_40G TLV_PORT_MODE_2x1_1x4 /* Dual 25G on mdi0, single 40G on mdi1 */ -#define TLV_PORT_MODE_50G_50G_Q1_Q2 TLV_PORT_MODE_1x2_1x2 /* Single 50G on mdi0, single 50G on mdi1 */ -#define TLV_PORT_MODE_50G_50G_Q1 TLV_PORT_MODE_2x2_NA /* Dual 50G on mdi0 */ -#define TLV_PORT_MODE_50G_50G_Q2 TLV_PORT_MODE_NA_2x2 /* Dual 50G on mdi1 */ -#define TLV_PORT_MODE_40G_50G TLV_PORT_MODE_1x4_1x2 /* Single 40G on mdi0, single 50G on mdi1 */ -#define TLV_PORT_MODE_50G_40G TLV_PORT_MODE_1x2_1x4 /* Single 50G on mdi0, single 40G on mdi1 */ -#define TLV_PORT_MODE_50G_25G_25G TLV_PORT_MODE_1x2_2x1 /* Single 50G on mdi0, dual 25G on mdi1 */ -#define TLV_PORT_MODE_25G_25G_50G TLV_PORT_MODE_2x1_1x2 /* Dual 25G on mdi0, single 50G on mdi1 */ -/* eftest only, see comments for _LL modes above */ -#define TLV_PORT_MODE_25G_25G_25G_25G_Q1_Q2_LL TLV_PORT_MODE_2x1_2x1_LL /* Dual 25G on mdi0, dual 25G on mdi1, low-latency PCS */ -#define TLV_PORT_MODE_25G_25G_25G_25G_Q1_LL TLV_PORT_MODE_4x1_NA_LL /* Quad 25G on mdi0, low-latency PCS */ -#define TLV_PORT_MODE_25G_25G_25G_25G_Q2_LL TLV_PORT_MODE_NA_4x1_LL /* Quad 25G on mdi1, low-latency PCS */ -#define TLV_PORT_MODE_25G_LL TLV_PORT_MODE_1x1_NA_LL /* Single 10G/25G on mdi0, low-latency PCS */ -#define TLV_PORT_MODE_25G_25G_LL TLV_PORT_MODE_1x1_1x1_LL /* Single 10G/25G on mdi0, single 10G/25G on mdi1, low-latency PCS */ +/* Deprecated Medford aliases - DO NOT USE IN NEW CODE */ +#define TLV_PORT_MODE_10G_10G_10G_10G_Q (5) +#define TLV_PORT_MODE_10G_10G_10G_10G_Q1 (4) +#define TLV_PORT_MODE_10G_10G_10G_10G_Q2 (8) +#define TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2 (9) + +#define TLV_PORT_MODE_MAX TLV_PORT_MODE_1x1_1x1_LL }; /* Type of the v-switch created implicitly by the firmware */ Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Nov 29 06:41:41 2018 (r341184) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Nov 29 06:41:53 2018 (r341185) @@ -340,11 +340,18 @@ #define SIENA_MC_BOOTROM_COPYCODE_VEC (0x800 - 3 * 0x4) #define HUNT_MC_BOOTROM_COPYCODE_VEC (0x8000 - 3 * 0x4) #define MEDFORD_MC_BOOTROM_COPYCODE_VEC (0x10000 - 3 * 0x4) -/* Points to the recovery mode entry point. */ +/* Points to the recovery mode entry point. Misnamed but kept for compatibility. */ #define SIENA_MC_BOOTROM_NOFLASH_VEC (0x800 - 2 * 0x4) #define HUNT_MC_BOOTROM_NOFLASH_VEC (0x8000 - 2 * 0x4) #define MEDFORD_MC_BOOTROM_NOFLASH_VEC (0x10000 - 2 * 0x4) +/* Points to the recovery mode entry point. Same as above, but the right name. */ +#define SIENA_MC_BOOTROM_RECOVERY_VEC (0x800 - 2 * 0x4) +#define HUNT_MC_BOOTROM_RECOVERY_VEC (0x8000 - 2 * 0x4) +#define MEDFORD_MC_BOOTROM_RECOVERY_VEC (0x10000 - 2 * 0x4) +/* Points to noflash mode entry point. */ +#define MEDFORD_MC_BOOTROM_REAL_NOFLASH_VEC (0x10000 - 4 * 0x4) + /* The command set exported by the boot ROM (MCDI v0) */ #define MC_CMD_GET_VERSION_V0_SUPPORTED_FUNCS { \ (1 << MC_CMD_READ32) | \ @@ -416,6 +423,8 @@ #define MCDI_EVENT_LINKCHANGE_LP_CAP_WIDTH 16 #define MCDI_EVENT_LINKCHANGE_SPEED_LBN 16 #define MCDI_EVENT_LINKCHANGE_SPEED_WIDTH 4 +/* enum: Link is down or link speed could not be determined */ +#define MCDI_EVENT_LINKCHANGE_SPEED_UNKNOWN 0x0 /* enum: 100Mbs */ #define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1 /* enum: 1Gbs */ @@ -2742,6 +2751,8 @@ * support */ #define MC_CMD_FW_RULES_ENGINE 0x5 +/* enum: Prefer to use firmware with additional DPDK support */ +#define MC_CMD_FW_DPDK 0x6 /* enum: Only this option is allowed for non-admin functions */ #define MC_CMD_FW_DONT_CARE 0xffffffff @@ -6715,6 +6726,12 @@ #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM_40G 0x800 /* enum: Capture SolarSystem 1G */ #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM_1G 0x1000 +/* enum: ScaleOut Onload */ +#define LICENSED_APP_ID_SCALEOUT_ONLOAD 0x2000 +/* enum: SCS Network Analytics Dashboard */ +#define LICENSED_APP_ID_DSHBRD 0x4000 +/* enum: SolarCapture Trading Analytics */ +#define LICENSED_APP_ID_SCATRD 0x8000 #define LICENSED_APP_ID_ID_LBN 0 #define LICENSED_APP_ID_ID_WIDTH 32 @@ -6781,6 +6798,12 @@ #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_40G_WIDTH 1 #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_1G_LBN 12 #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_1G_WIDTH 1 +#define LICENSED_V3_APPS_SCALEOUT_ONLOAD_LBN 13 +#define LICENSED_V3_APPS_SCALEOUT_ONLOAD_WIDTH 1 +#define LICENSED_V3_APPS_DSHBRD_LBN 14 +#define LICENSED_V3_APPS_DSHBRD_WIDTH 1 +#define LICENSED_V3_APPS_SCATRD_LBN 15 +#define LICENSED_V3_APPS_SCATRD_WIDTH 1 #define LICENSED_V3_APPS_MASK_LBN 0 #define LICENSED_V3_APPS_MASK_WIDTH 64 @@ -6831,6 +6854,14 @@ * is the same as for TX_EV_COMPLETION. */ #define TX_TIMESTAMP_EVENT_TX_EV_CTPIO_COMPLETION 0x11 +/* enum: This is the low part of a TX timestamp for a CTPIO transmission. The + * event format is the same as for TX_EV_TSTAMP_LO + */ +#define TX_TIMESTAMP_EVENT_TX_EV_CTPIO_TS_LO 0x12 +/* enum: This is the high part of a TX timestamp for a CTPIO transmission. The + * event format is the same as for TX_EV_TSTAMP_HI + */ +#define TX_TIMESTAMP_EVENT_TX_EV_CTPIO_TS_HI 0x13 /* enum: This is the low part of a TX timestamp event */ #define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_LO 0x51 /* enum: This is the high part of a TX timestamp event */ @@ -7203,11 +7234,15 @@ /* Size, in entries */ #define MC_CMD_INIT_RXQ_EXT_IN_SIZE_OFST 0 #define MC_CMD_INIT_RXQ_EXT_IN_SIZE_LEN 4 -/* The EVQ to send events to. This is an index originally specified to INIT_EVQ +/* The EVQ to send events to. This is an index originally specified to + * INIT_EVQ. If DMA_MODE == PACKED_STREAM this must be equal to INSTANCE. */ #define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_OFST 4 #define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_LEN 4 -/* The value to put in the event data. Check hardware spec. for valid range. */ +/* The value to put in the event data. Check hardware spec. for valid range. + * This field is ignored if DMA_MODE == EQUAL_STRIDE_PACKED_STREAM or DMA_MODE + * == PACKED_STREAM. + */ #define MC_CMD_INIT_RXQ_EXT_IN_LABEL_OFST 8 #define MC_CMD_INIT_RXQ_EXT_IN_LABEL_LEN 4 /* Desired instance. Must be set to a specific instance, which is a function @@ -7238,6 +7273,13 @@ #define MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET 0x0 /* enum: Pack multiple packets into large descriptors (for SolarCapture) */ #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM 0x1 +/* enum: Pack multiple packets into large descriptors using the format designed + * to maximise packet rate. This mode uses 1 "bucket" per descriptor with + * multiple fixed-size packet buffers within each bucket. For a full + * description see SF-119419-TC. This mode is only supported by "dpdk" datapath + * firmware. + */ +#define MC_CMD_INIT_RXQ_EXT_IN_EQUAL_STRIDE_PACKED_STREAM 0x2 #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_LBN 14 #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_WIDTH 1 #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE_LBN 15 @@ -7267,13 +7309,123 @@ #define MC_CMD_INIT_RXQ_EXT_IN_SNAPSHOT_LENGTH_OFST 540 #define MC_CMD_INIT_RXQ_EXT_IN_SNAPSHOT_LENGTH_LEN 4 +/* MC_CMD_INIT_RXQ_V3_IN msgrequest */ +#define MC_CMD_INIT_RXQ_V3_IN_LEN 560 +/* Size, in entries */ +#define MC_CMD_INIT_RXQ_V3_IN_SIZE_OFST 0 +#define MC_CMD_INIT_RXQ_V3_IN_SIZE_LEN 4 +/* The EVQ to send events to. This is an index originally specified to + * INIT_EVQ. If DMA_MODE == PACKED_STREAM this must be equal to INSTANCE. + */ +#define MC_CMD_INIT_RXQ_V3_IN_TARGET_EVQ_OFST 4 +#define MC_CMD_INIT_RXQ_V3_IN_TARGET_EVQ_LEN 4 +/* The value to put in the event data. Check hardware spec. for valid range. + * This field is ignored if DMA_MODE == EQUAL_STRIDE_PACKED_STREAM or DMA_MODE + * == PACKED_STREAM. + */ +#define MC_CMD_INIT_RXQ_V3_IN_LABEL_OFST 8 +#define MC_CMD_INIT_RXQ_V3_IN_LABEL_LEN 4 +/* Desired instance. Must be set to a specific instance, which is a function + * local queue index. + */ +#define MC_CMD_INIT_RXQ_V3_IN_INSTANCE_OFST 12 +#define MC_CMD_INIT_RXQ_V3_IN_INSTANCE_LEN 4 +/* There will be more flags here. */ +#define MC_CMD_INIT_RXQ_V3_IN_FLAGS_OFST 16 +#define MC_CMD_INIT_RXQ_V3_IN_FLAGS_LEN 4 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_BUFF_MODE_LBN 0 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_BUFF_MODE_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_HDR_SPLIT_LBN 1 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_HDR_SPLIT_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_TIMESTAMP_LBN 2 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_TIMESTAMP_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_CRC_MODE_LBN 3 +#define MC_CMD_INIT_RXQ_V3_IN_CRC_MODE_WIDTH 4 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_CHAIN_LBN 7 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_CHAIN_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_PREFIX_LBN 8 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_PREFIX_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_DISABLE_SCATTER_LBN 9 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_DISABLE_SCATTER_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_DMA_MODE_LBN 10 +#define MC_CMD_INIT_RXQ_V3_IN_DMA_MODE_WIDTH 4 +/* enum: One packet per descriptor (for normal networking) */ +#define MC_CMD_INIT_RXQ_V3_IN_SINGLE_PACKET 0x0 +/* enum: Pack multiple packets into large descriptors (for SolarCapture) */ +#define MC_CMD_INIT_RXQ_V3_IN_PACKED_STREAM 0x1 +/* enum: Pack multiple packets into large descriptors using the format designed + * to maximise packet rate. This mode uses 1 "bucket" per descriptor with + * multiple fixed-size packet buffers within each bucket. For a full + * description see SF-119419-TC. This mode is only supported by "dpdk" datapath + * firmware. + */ +#define MC_CMD_INIT_RXQ_V3_IN_EQUAL_STRIDE_PACKED_STREAM 0x2 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_SNAPSHOT_MODE_LBN 14 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_SNAPSHOT_MODE_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_PACKED_STREAM_BUFF_SIZE_LBN 15 +#define MC_CMD_INIT_RXQ_V3_IN_PACKED_STREAM_BUFF_SIZE_WIDTH 3 +#define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_1M 0x0 /* enum */ +#define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_512K 0x1 /* enum */ +#define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_256K 0x2 /* enum */ +#define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_128K 0x3 /* enum */ +#define MC_CMD_INIT_RXQ_V3_IN_PS_BUFF_64K 0x4 /* enum */ +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_WANT_OUTER_CLASSES_LBN 18 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_WANT_OUTER_CLASSES_WIDTH 1 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_FORCE_EV_MERGING_LBN 19 +#define MC_CMD_INIT_RXQ_V3_IN_FLAG_FORCE_EV_MERGING_WIDTH 1 +/* Owner ID to use if in buffer mode (zero if physical) */ +#define MC_CMD_INIT_RXQ_V3_IN_OWNER_ID_OFST 20 +#define MC_CMD_INIT_RXQ_V3_IN_OWNER_ID_LEN 4 +/* The port ID associated with the v-adaptor which should contain this DMAQ. */ +#define MC_CMD_INIT_RXQ_V3_IN_PORT_ID_OFST 24 +#define MC_CMD_INIT_RXQ_V3_IN_PORT_ID_LEN 4 +/* 64-bit address of 4k of 4k-aligned host memory buffer */ +#define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_OFST 28 +#define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_LEN 8 +#define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_LO_OFST 28 +#define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_HI_OFST 32 +#define MC_CMD_INIT_RXQ_V3_IN_DMA_ADDR_NUM 64 +/* Maximum length of packet to receive, if SNAPSHOT_MODE flag is set */ +#define MC_CMD_INIT_RXQ_V3_IN_SNAPSHOT_LENGTH_OFST 540 +#define MC_CMD_INIT_RXQ_V3_IN_SNAPSHOT_LENGTH_LEN 4 +/* The number of packet buffers that will be contained within each + * EQUAL_STRIDE_PACKED_STREAM format bucket supplied by the driver. This field + * is ignored unless DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + */ +#define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_BUFFERS_PER_BUCKET_OFST 544 +#define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_BUFFERS_PER_BUCKET_LEN 4 +/* The length in bytes of the area in each packet buffer that can be written to + * by the adapter. This is used to store the packet prefix and the packet + * payload. This length does not include any end padding added by the driver. + * This field is ignored unless DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + */ +#define MC_CMD_INIT_RXQ_V3_IN_ES_MAX_DMA_LEN_OFST 548 +#define MC_CMD_INIT_RXQ_V3_IN_ES_MAX_DMA_LEN_LEN 4 +/* The length in bytes of a single packet buffer within a + * EQUAL_STRIDE_PACKED_STREAM format bucket. This field is ignored unless + * DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + */ +#define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_STRIDE_OFST 552 +#define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_STRIDE_LEN 4 +/* The maximum time in nanoseconds that the datapath will be backpressured if + * there are no RX descriptors available. If the timeout is reached and there + * are still no descriptors then the packet will be dropped. A timeout of 0 + * means the datapath will never be blocked. This field is ignored unless + * DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + */ +#define MC_CMD_INIT_RXQ_V3_IN_ES_HEAD_OF_LINE_BLOCK_TIMEOUT_OFST 556 +#define MC_CMD_INIT_RXQ_V3_IN_ES_HEAD_OF_LINE_BLOCK_TIMEOUT_LEN 4 + /* MC_CMD_INIT_RXQ_OUT msgresponse */ #define MC_CMD_INIT_RXQ_OUT_LEN 0 /* MC_CMD_INIT_RXQ_EXT_OUT msgresponse */ #define MC_CMD_INIT_RXQ_EXT_OUT_LEN 0 +/* MC_CMD_INIT_RXQ_V3_OUT msgresponse */ +#define MC_CMD_INIT_RXQ_V3_OUT_LEN 0 + /***********************************/ /* MC_CMD_INIT_TXQ */ @@ -8189,6 +8341,273 @@ #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_OFST 156 #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_LEN 16 +/* MC_CMD_FILTER_OP_V3_IN msgrequest: FILTER_OP extension to support additional + * filter actions for Intel's DPDK (Data Plane Development Kit, dpdk.org) via + * its rte_flow API. This extension is only useful with the sfc_efx driver + * included as part of DPDK, used in conjunction with the dpdk datapath + * firmware variant. + */ +#define MC_CMD_FILTER_OP_V3_IN_LEN 180 +/* identifies the type of operation requested */ +#define MC_CMD_FILTER_OP_V3_IN_OP_OFST 0 +#define MC_CMD_FILTER_OP_V3_IN_OP_LEN 4 +/* Enum values, see field(s): */ +/* MC_CMD_FILTER_OP_IN/OP */ +/* filter handle (for remove / unsubscribe operations) */ +#define MC_CMD_FILTER_OP_V3_IN_HANDLE_OFST 4 +#define MC_CMD_FILTER_OP_V3_IN_HANDLE_LEN 8 +#define MC_CMD_FILTER_OP_V3_IN_HANDLE_LO_OFST 4 +#define MC_CMD_FILTER_OP_V3_IN_HANDLE_HI_OFST 8 +/* The port ID associated with the v-adaptor which should contain this filter. + */ +#define MC_CMD_FILTER_OP_V3_IN_PORT_ID_OFST 12 +#define MC_CMD_FILTER_OP_V3_IN_PORT_ID_LEN 4 +/* fields to include in match criteria */ +#define MC_CMD_FILTER_OP_V3_IN_MATCH_FIELDS_OFST 16 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_FIELDS_LEN 4 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_IP_LBN 0 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_IP_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_IP_LBN 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_IP_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_MAC_LBN 2 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_MAC_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_PORT_LBN 3 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_SRC_PORT_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_MAC_LBN 4 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_MAC_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_PORT_LBN 5 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_DST_PORT_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_ETHER_TYPE_LBN 6 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_ETHER_TYPE_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_INNER_VLAN_LBN 7 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_INNER_VLAN_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_OUTER_VLAN_LBN 8 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_OUTER_VLAN_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IP_PROTO_LBN 9 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IP_PROTO_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_FWDEF0_LBN 10 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_FWDEF0_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_VNI_OR_VSID_LBN 11 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_VNI_OR_VSID_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_IP_LBN 12 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_IP_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_IP_LBN 13 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_IP_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_MAC_LBN 14 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_MAC_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_PORT_LBN 15 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_SRC_PORT_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_MAC_LBN 16 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_MAC_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_PORT_LBN 17 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_DST_PORT_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_ETHER_TYPE_LBN 18 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_ETHER_TYPE_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_INNER_VLAN_LBN 19 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_INNER_VLAN_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_OUTER_VLAN_LBN 20 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_OUTER_VLAN_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_IP_PROTO_LBN 21 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_IP_PROTO_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF0_LBN 22 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF0_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF1_LBN 23 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_FWDEF1_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_LBN 24 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_LBN 25 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1 +/* receive destination */ +#define MC_CMD_FILTER_OP_V3_IN_RX_DEST_OFST 20 +#define MC_CMD_FILTER_OP_V3_IN_RX_DEST_LEN 4 +/* enum: drop packets */ +#define MC_CMD_FILTER_OP_V3_IN_RX_DEST_DROP 0x0 +/* enum: receive to host */ +#define MC_CMD_FILTER_OP_V3_IN_RX_DEST_HOST 0x1 +/* enum: receive to MC */ +#define MC_CMD_FILTER_OP_V3_IN_RX_DEST_MC 0x2 +/* enum: loop back to TXDP 0 */ +#define MC_CMD_FILTER_OP_V3_IN_RX_DEST_TX0 0x3 +/* enum: loop back to TXDP 1 */ +#define MC_CMD_FILTER_OP_V3_IN_RX_DEST_TX1 0x4 +/* receive queue handle (for multiple queue modes, this is the base queue) */ +#define MC_CMD_FILTER_OP_V3_IN_RX_QUEUE_OFST 24 +#define MC_CMD_FILTER_OP_V3_IN_RX_QUEUE_LEN 4 +/* receive mode */ +#define MC_CMD_FILTER_OP_V3_IN_RX_MODE_OFST 28 +#define MC_CMD_FILTER_OP_V3_IN_RX_MODE_LEN 4 +/* enum: receive to just the specified queue */ +#define MC_CMD_FILTER_OP_V3_IN_RX_MODE_SIMPLE 0x0 +/* enum: receive to multiple queues using RSS context */ +#define MC_CMD_FILTER_OP_V3_IN_RX_MODE_RSS 0x1 +/* enum: receive to multiple queues using .1p mapping */ +#define MC_CMD_FILTER_OP_V3_IN_RX_MODE_DOT1P_MAPPING 0x2 +/* enum: install a filter entry that will never match; for test purposes only + */ +#define MC_CMD_FILTER_OP_V3_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000 +/* RSS context (for RX_MODE_RSS) or .1p mapping handle (for + * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or + * MC_CMD_DOT1P_MAPPING_ALLOC. + */ +#define MC_CMD_FILTER_OP_V3_IN_RX_CONTEXT_OFST 32 +#define MC_CMD_FILTER_OP_V3_IN_RX_CONTEXT_LEN 4 +/* transmit domain (reserved; set to 0) */ +#define MC_CMD_FILTER_OP_V3_IN_TX_DOMAIN_OFST 36 +#define MC_CMD_FILTER_OP_V3_IN_TX_DOMAIN_LEN 4 +/* transmit destination (either set the MAC and/or PM bits for explicit + * control, or set this field to TX_DEST_DEFAULT for sensible default + * behaviour) + */ +#define MC_CMD_FILTER_OP_V3_IN_TX_DEST_OFST 40 +#define MC_CMD_FILTER_OP_V3_IN_TX_DEST_LEN 4 +/* enum: request default behaviour (based on filter type) */ +#define MC_CMD_FILTER_OP_V3_IN_TX_DEST_DEFAULT 0xffffffff +#define MC_CMD_FILTER_OP_V3_IN_TX_DEST_MAC_LBN 0 +#define MC_CMD_FILTER_OP_V3_IN_TX_DEST_MAC_WIDTH 1 +#define MC_CMD_FILTER_OP_V3_IN_TX_DEST_PM_LBN 1 +#define MC_CMD_FILTER_OP_V3_IN_TX_DEST_PM_WIDTH 1 +/* source MAC address to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_SRC_MAC_OFST 44 +#define MC_CMD_FILTER_OP_V3_IN_SRC_MAC_LEN 6 +/* source port to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_SRC_PORT_OFST 50 +#define MC_CMD_FILTER_OP_V3_IN_SRC_PORT_LEN 2 +/* destination MAC address to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_DST_MAC_OFST 52 +#define MC_CMD_FILTER_OP_V3_IN_DST_MAC_LEN 6 +/* destination port to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_DST_PORT_OFST 58 +#define MC_CMD_FILTER_OP_V3_IN_DST_PORT_LEN 2 +/* Ethernet type to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_ETHER_TYPE_OFST 60 +#define MC_CMD_FILTER_OP_V3_IN_ETHER_TYPE_LEN 2 +/* Inner VLAN tag to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_INNER_VLAN_OFST 62 +#define MC_CMD_FILTER_OP_V3_IN_INNER_VLAN_LEN 2 +/* Outer VLAN tag to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_OUTER_VLAN_OFST 64 +#define MC_CMD_FILTER_OP_V3_IN_OUTER_VLAN_LEN 2 +/* IP protocol to match (in low byte; set high byte to 0) */ +#define MC_CMD_FILTER_OP_V3_IN_IP_PROTO_OFST 66 +#define MC_CMD_FILTER_OP_V3_IN_IP_PROTO_LEN 2 +/* Firmware defined register 0 to match (reserved; set to 0) */ +#define MC_CMD_FILTER_OP_V3_IN_FWDEF0_OFST 68 +#define MC_CMD_FILTER_OP_V3_IN_FWDEF0_LEN 4 +/* VNI (for VXLAN/Geneve, when IP protocol is UDP) or VSID (for NVGRE, when IP + * protocol is GRE) to match (as bytes in network order; set last byte to 0 for + * VXLAN/NVGRE, or 1 for Geneve) + */ +#define MC_CMD_FILTER_OP_V3_IN_VNI_OR_VSID_OFST 72 +#define MC_CMD_FILTER_OP_V3_IN_VNI_OR_VSID_LEN 4 +#define MC_CMD_FILTER_OP_V3_IN_VNI_VALUE_LBN 0 +#define MC_CMD_FILTER_OP_V3_IN_VNI_VALUE_WIDTH 24 +#define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_LBN 24 +#define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_WIDTH 8 +/* enum: Match VXLAN traffic with this VNI */ +#define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_VXLAN 0x0 +/* enum: Match Geneve traffic with this VNI */ +#define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_GENEVE 0x1 +/* enum: Reserved for experimental development use */ +#define MC_CMD_FILTER_OP_V3_IN_VNI_TYPE_EXPERIMENTAL 0xfe +#define MC_CMD_FILTER_OP_V3_IN_VSID_VALUE_LBN 0 +#define MC_CMD_FILTER_OP_V3_IN_VSID_VALUE_WIDTH 24 +#define MC_CMD_FILTER_OP_V3_IN_VSID_TYPE_LBN 24 +#define MC_CMD_FILTER_OP_V3_IN_VSID_TYPE_WIDTH 8 +/* enum: Match NVGRE traffic with this VSID */ +#define MC_CMD_FILTER_OP_V3_IN_VSID_TYPE_NVGRE 0x0 +/* source IP address to match (as bytes in network order; set last 12 bytes to + * 0 for IPv4 address) + */ +#define MC_CMD_FILTER_OP_V3_IN_SRC_IP_OFST 76 +#define MC_CMD_FILTER_OP_V3_IN_SRC_IP_LEN 16 +/* destination IP address to match (as bytes in network order; set last 12 + * bytes to 0 for IPv4 address) + */ +#define MC_CMD_FILTER_OP_V3_IN_DST_IP_OFST 92 +#define MC_CMD_FILTER_OP_V3_IN_DST_IP_LEN 16 +/* VXLAN/NVGRE inner frame source MAC address to match (as bytes in network + * order) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_MAC_OFST 108 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_MAC_LEN 6 +/* VXLAN/NVGRE inner frame source port to match (as bytes in network order) */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_PORT_OFST 114 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_PORT_LEN 2 +/* VXLAN/NVGRE inner frame destination MAC address to match (as bytes in + * network order) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_MAC_OFST 116 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_MAC_LEN 6 +/* VXLAN/NVGRE inner frame destination port to match (as bytes in network + * order) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_PORT_OFST 122 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_PORT_LEN 2 +/* VXLAN/NVGRE inner frame Ethernet type to match (as bytes in network order) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_ETHER_TYPE_OFST 124 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_ETHER_TYPE_LEN 2 +/* VXLAN/NVGRE inner frame Inner VLAN tag to match (as bytes in network order) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_INNER_VLAN_OFST 126 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_INNER_VLAN_LEN 2 +/* VXLAN/NVGRE inner frame Outer VLAN tag to match (as bytes in network order) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_OUTER_VLAN_OFST 128 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_OUTER_VLAN_LEN 2 +/* VXLAN/NVGRE inner frame IP protocol to match (in low byte; set high byte to + * 0) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_IP_PROTO_OFST 130 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_IP_PROTO_LEN 2 +/* VXLAN/NVGRE inner frame Firmware defined register 0 to match (reserved; set + * to 0) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF0_OFST 132 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF0_LEN 4 +/* VXLAN/NVGRE inner frame Firmware defined register 1 to match (reserved; set + * to 0) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF1_OFST 136 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_FWDEF1_LEN 4 +/* VXLAN/NVGRE inner frame source IP address to match (as bytes in network + * order; set last 12 bytes to 0 for IPv4 address) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_IP_OFST 140 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_SRC_IP_LEN 16 +/* VXLAN/NVGRE inner frame destination IP address to match (as bytes in network + * order; set last 12 bytes to 0 for IPv4 address) + */ +#define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_IP_OFST 156 +#define MC_CMD_FILTER_OP_V3_IN_IFRM_DST_IP_LEN 16 +/* Set an action for all packets matching this filter. The DPDK driver and dpdk + * f/w variant use their own specific delivery structures, which are documented + * in the DPDK Firmware Driver Interface (SF-119419-TC). Requesting anything + * other than MATCH_ACTION_NONE when the NIC is running another f/w variant + * will cause the filter insertion to fail with ENOTSUP. + */ +#define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_OFST 172 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_LEN 4 +/* enum: do nothing extra */ +#define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_NONE 0x0 +/* enum: Set the match flag in the packet prefix for packets matching the + * filter (only with dpdk firmware, otherwise fails with ENOTSUP). Used to + * support the DPDK rte_flow "FLAG" action. + */ +#define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_FLAG 0x1 +/* enum: Insert MATCH_MARK_VALUE into the packet prefix for packets matching + * the filter (only with dpdk firmware, otherwise fails with ENOTSUP). Used to + * support the DPDK rte_flow "MARK" action. + */ +#define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_MARK 0x2 +/* the mark value for MATCH_ACTION_MARK */ +#define MC_CMD_FILTER_OP_V3_IN_MATCH_MARK_VALUE_OFST 176 +#define MC_CMD_FILTER_OP_V3_IN_MATCH_MARK_VALUE_LEN 4 + /* MC_CMD_FILTER_OP_OUT msgresponse */ #define MC_CMD_FILTER_OP_OUT_LEN 12 /* identifies the type of operation requested */ @@ -9219,6 +9638,8 @@ #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_PACKED_STREAM 0x2 /* enum: Rules engine RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_RULES_ENGINE 0x5 +/* enum: Packet rate RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_DPDK 0x6 /* enum: BIST RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_BIST 0x10a /* enum: RXDP Test firmware image 1 */ @@ -9252,6 +9673,8 @@ #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_HIGH_PACKET_RATE 0x3 /* enum: Rules engine TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_RULES_ENGINE 0x5 +/* enum: Packet rate TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_TXDP_DPDK 0x6 /* enum: BIST TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_BIST 0x12d /* enum: TXDP Test firmware image 1 */ @@ -9296,6 +9719,10 @@ #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine RX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* enum: RX PD firmware parsing but not filtering network overlay tunnel @@ -9335,6 +9762,10 @@ #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine TX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* Hardware capabilities of NIC */ @@ -9421,6 +9852,8 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_PACKED_STREAM 0x2 /* enum: Rules engine RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_RULES_ENGINE 0x5 +/* enum: Packet rate RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_DPDK 0x6 /* enum: BIST RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_BIST 0x10a /* enum: RXDP Test firmware image 1 */ @@ -9454,6 +9887,8 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_HIGH_PACKET_RATE 0x3 /* enum: Rules engine TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_RULES_ENGINE 0x5 +/* enum: Packet rate TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_DPDK 0x6 /* enum: BIST TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_BIST 0x12d /* enum: TXDP Test firmware image 1 */ @@ -9498,6 +9933,10 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine RX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* enum: RX PD firmware parsing but not filtering network overlay tunnel @@ -9537,6 +9976,10 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine TX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* Hardware capabilities of NIC */ @@ -9580,6 +10023,18 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCDI_DB_RETURN_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_CTPIO_LBN 15 #define MC_CMD_GET_CAPABILITIES_V2_OUT_CTPIO_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_SUPPORT_LBN 16 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_SUPPORT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_BOUND_LBN 17 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TSA_BOUND_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_SF_ADAPTER_AUTHENTICATION_LBN 18 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_SF_ADAPTER_AUTHENTICATION_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_FLAG_LBN 19 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_FLAG_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_MARK_LBN 20 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_MARK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -9710,6 +10165,8 @@ #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_PACKED_STREAM 0x2 /* enum: Rules engine RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_RULES_ENGINE 0x5 +/* enum: Packet rate RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_DPDK 0x6 /* enum: BIST RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_BIST 0x10a /* enum: RXDP Test firmware image 1 */ @@ -9743,6 +10200,8 @@ #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_HIGH_PACKET_RATE 0x3 /* enum: Rules engine TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_RULES_ENGINE 0x5 +/* enum: Packet rate TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_DPDK 0x6 /* enum: BIST TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_BIST 0x12d /* enum: TXDP Test firmware image 1 */ @@ -9787,6 +10246,10 @@ #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine RX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* enum: RX PD firmware parsing but not filtering network overlay tunnel @@ -9826,6 +10289,10 @@ #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine TX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* Hardware capabilities of NIC */ @@ -9869,6 +10336,18 @@ #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCDI_DB_RETURN_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V3_OUT_CTPIO_LBN 15 #define MC_CMD_GET_CAPABILITIES_V3_OUT_CTPIO_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_SUPPORT_LBN 16 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_SUPPORT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_BOUND_LBN 17 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_TSA_BOUND_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_SF_ADAPTER_AUTHENTICATION_LBN 18 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_SF_ADAPTER_AUTHENTICATION_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_FLAG_LBN 19 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_FLAG_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_MARK_LBN 20 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_MARK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -10024,6 +10503,8 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_PACKED_STREAM 0x2 /* enum: Rules engine RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_RULES_ENGINE 0x5 +/* enum: Packet rate RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_DPDK 0x6 /* enum: BIST RXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_BIST 0x10a /* enum: RXDP Test firmware image 1 */ @@ -10057,6 +10538,8 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_HIGH_PACKET_RATE 0x3 /* enum: Rules engine TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_RULES_ENGINE 0x5 +/* enum: Packet rate TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_DPDK 0x6 /* enum: BIST TXDP firmware */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXDP_BIST 0x12d /* enum: TXDP Test firmware image 1 */ @@ -10101,6 +10584,10 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine RX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* enum: RX PD firmware parsing but not filtering network overlay tunnel @@ -10140,6 +10627,10 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 /* enum: Rules engine TX PD production firmware */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: reserved value - do not use (bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_RESERVED_9 0x9 +/* enum: Packet rate TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_DPDK 0xa /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ #define MC_CMD_GET_CAPABILITIES_V4_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe /* Hardware capabilities of NIC */ @@ -10183,6 +10674,18 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_MCDI_DB_RETURN_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V4_OUT_CTPIO_LBN 15 #define MC_CMD_GET_CAPABILITIES_V4_OUT_CTPIO_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_SUPPORT_LBN 16 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_SUPPORT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_BOUND_LBN 17 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_TSA_BOUND_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_SF_ADAPTER_AUTHENTICATION_LBN 18 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_SF_ADAPTER_AUTHENTICATION_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_FLAG_LBN 19 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_FLAG_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_MARK_LBN 20 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_MARK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -12208,6 +12711,10 @@ #define MC_CMD_KR_TUNE_IN_POLL_EYE_PLOT 0x6 /* enum: Read Figure Of Merit (eye quality, higher is better). */ #define MC_CMD_KR_TUNE_IN_READ_FOM 0x7 +/* enum: Start/stop link training frames */ +#define MC_CMD_KR_TUNE_IN_LINK_TRAIN_RUN 0x8 +/* enum: Issue KR link training command (control training coefficients) */ +#define MC_CMD_KR_TUNE_IN_LINK_TRAIN_CMD 0x9 /* Align the arguments to 32 bits */ #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_OFST 1 #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_LEN 3 @@ -12278,34 +12785,54 @@ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_POLE 0xc /* enum: CTLE peaking (0-31, Medford2) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_PEAK 0xd -/* enum: DFE Tap1 - even path (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap1 - even path (Medford2 - 6 bit signed (-29 - +29)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP1_EVEN 0xe -/* enum: DFE Tap1 - odd path (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap1 - odd path (Medford2 - 6 bit signed (-29 - +29)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP1_ODD 0xf -/* enum: DFE Tap2 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap2 (Medford2 - 6 bit signed (-20 - +20)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP2 0x10 -/* enum: DFE Tap3 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap3 (Medford2 - 6 bit signed (-20 - +20)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP3 0x11 -/* enum: DFE Tap4 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap4 (Medford2 - 6 bit signed (-20 - +20)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP4 0x12 -/* enum: DFE Tap5 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap5 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP5 0x13 -/* enum: DFE Tap6 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap6 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP6 0x14 -/* enum: DFE Tap7 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap7 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP7 0x15 -/* enum: DFE Tap8 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap8 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP8 0x16 -/* enum: DFE Tap9 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap9 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP9 0x17 -/* enum: DFE Tap10 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap10 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP10 0x18 -/* enum: DFE Tap11 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap11 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP11 0x19 -/* enum: DFE Tap12 (Medford2 - 0-63, sign-magnitude (-31 - +31)) */ +/* enum: DFE Tap12 (Medford2 - 6 bit signed (-24 - +24)) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_DFE_TAP12 0x1a -/* enum: I/Q clk offset (Medford2 - 0-5, sign-magnitude (-5 - +5)) */ +/* enum: I/Q clk offset (Medford2 - 4 bit signed (-5 - +5))) */ #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_IQ_OFF 0x1b +/* enum: Negative h1 polarity data sampler offset calibration code, even path + * (Medford2 - 6 bit signed (-29 - +29))) + */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1N_OFF_EVEN 0x1c +/* enum: Negative h1 polarity data sampler offset calibration code, odd path + * (Medford2 - 6 bit signed (-29 - +29))) + */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1N_OFF_ODD 0x1d +/* enum: Positive h1 polarity data sampler offset calibration code, even path + * (Medford2 - 6 bit signed (-29 - +29))) + */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1P_OFF_EVEN 0x1e +/* enum: Positive h1 polarity data sampler offset calibration code, odd path + * (Medford2 - 6 bit signed (-29 - +29))) + */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_H1P_OFF_ODD 0x1f +/* enum: CDR calibration loop code (Medford2) */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CDR_PVT 0x20 +/* enum: CDR integral loop code (Medford2) */ +#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CDR_INTEG 0x21 #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8 #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 3 #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */ @@ -12482,9 +13009,12 @@ /* Align the arguments to 32 bits */ #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_KR_TUNE_RSVD_OFST 1 #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_KR_TUNE_RSVD_LEN 3 -/* Port-relative lane to scan eye on */ #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_OFST 4 #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_LEN 4 +#define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_NUM_LBN 0 +#define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_NUM_WIDTH 8 +#define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_ABS_REL_LBN 31 +#define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_LANE_ABS_REL_WIDTH 1 /* Scan duration / cycle count */ #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_BER_OFST 8 #define MC_CMD_KR_TUNE_START_EYE_PLOT_V2_IN_BER_LEN 4 @@ -12520,13 +13050,92 @@ #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_RSVD_LEN 3 #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_OFST 4 #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_LEN 4 +#define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_NUM_LBN 0 +#define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_NUM_WIDTH 8 +#define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_ABS_REL_LBN 31 +#define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_ABS_REL_WIDTH 1 /* MC_CMD_KR_TUNE_READ_FOM_OUT msgresponse */ #define MC_CMD_KR_TUNE_READ_FOM_OUT_LEN 4 #define MC_CMD_KR_TUNE_READ_FOM_OUT_FOM_OFST 0 #define MC_CMD_KR_TUNE_READ_FOM_OUT_FOM_LEN 4 +/* MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN msgrequest */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_LEN 8 +/* Requested operation */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_OP_OFST 0 +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_OP_LEN 1 +/* Align the arguments to 32 bits */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_RSVD_OFST 1 +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_KR_TUNE_RSVD_LEN 3 +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_RUN_OFST 4 +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_RUN_LEN 4 +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_STOP 0x0 /* enum */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_RUN_IN_START 0x1 /* enum */ +/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN msgrequest */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_LEN 28 +/* Requested operation */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_OP_OFST 0 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_OP_LEN 1 +/* Align the arguments to 32 bits */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_RSVD_OFST 1 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_KR_TUNE_RSVD_LEN 3 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_LANE_OFST 4 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_LANE_LEN 4 +/* Set INITIALIZE state */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_INITIALIZE_OFST 8 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_INITIALIZE_LEN 4 +/* Set PRESET state */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_PRESET_OFST 12 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_PRESET_LEN 4 +/* C(-1) request */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CM1_OFST 16 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CM1_LEN 4 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_REQ_HOLD 0x0 /* enum */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_REQ_INCREMENT 0x1 /* enum */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_REQ_DECREMENT 0x2 /* enum */ +/* C(0) request */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_C0_OFST 20 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_C0_LEN 4 +/* Enum values, see field(s): */ +/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */ +/* C(+1) request */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CP1_OFST 24 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN_CP1_LEN 4 +/* Enum values, see field(s): */ +/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */ + +/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT msgresponse */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_LEN 24 +/* C(-1) status */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_STATUS_OFST 0 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_STATUS_LEN 4 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_NOT_UPDATED 0x0 /* enum */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_UPDATED 0x1 /* enum */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_MINIMUM 0x2 /* enum */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_STATUS_MAXIMUM 0x3 /* enum */ +/* C(0) status */ +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_STATUS_OFST 4 +#define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_STATUS_LEN 4 +/* Enum values, see field(s): */ +/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT/CM1 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Nov 29 06:42:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E46115378E; Thu, 29 Nov 2018 06:42:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96ABB76B5F; Thu, 29 Nov 2018 06:42:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1171A15F34; Thu, 29 Nov 2018 06:42:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6g4fn024583; Thu, 29 Nov 2018 06:42:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6g4tX024582; Thu, 29 Nov 2018 06:42:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290642.wAT6g4tX024582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341186 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96ABB76B5F X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:42:09 -0000 Author: arybchik Date: Thu Nov 29 06:42:04 2018 New Revision: 341186 URL: https://svnweb.freebsd.org/changeset/base/341186 Log: sfxge(4): support filters for encapsulated packets This adds filters for encapsulated packets to the list returned by ef10_filter_supported_filters(). Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18217 Modified: head/sys/dev/sfxge/common/ef10_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:41:53 2018 (r341185) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:42:04 2018 (r341186) @@ -922,6 +922,7 @@ efx_mcdi_get_parser_disp_info( __in efx_nic_t *enp, __out_ecount(buffer_length) uint32_t *buffer, __in size_t buffer_length, + __in boolean_t encap, __out size_t *list_lengthp) { efx_mcdi_req_t req; @@ -938,7 +939,8 @@ efx_mcdi_get_parser_disp_info( req.emr_out_buf = payload; req.emr_out_length = MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX; - MCDI_IN_SET_DWORD(req, GET_PARSER_DISP_INFO_OUT_OP, + MCDI_IN_SET_DWORD(req, GET_PARSER_DISP_INFO_OUT_OP, encap ? + MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_ENCAP_RX_MATCHES : MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_RX_MATCHES); efx_mcdi_execute(enp, &req); @@ -998,30 +1000,68 @@ ef10_filter_supported_filters( __in size_t buffer_length, __out size_t *list_lengthp) { - + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); size_t mcdi_list_length; + size_t mcdi_encap_list_length; size_t list_length; uint32_t i; + uint32_t next_buf_idx; + size_t next_buf_length; efx_rc_t rc; + boolean_t no_space = B_FALSE; efx_filter_match_flags_t all_filter_flags = (EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT | EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT | EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_INNER_VID | EFX_FILTER_MATCH_OUTER_VID | EFX_FILTER_MATCH_IP_PROTO | + EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST | + EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST | EFX_FILTER_MATCH_UNKNOWN_MCAST_DST | EFX_FILTER_MATCH_UNKNOWN_UCAST_DST); - rc = efx_mcdi_get_parser_disp_info(enp, buffer, buffer_length, - &mcdi_list_length); + /* + * Two calls to MC_CMD_GET_PARSER_DISP_INFO are needed: one to get the + * list of supported filters for ordinary packets, and then another to + * get the list of supported filters for encapsulated packets. + */ + rc = efx_mcdi_get_parser_disp_info(enp, buffer, buffer_length, B_FALSE, + &mcdi_list_length); if (rc != 0) { - if (rc == ENOSPC) { - /* Pass through mcdi_list_length for the list length */ - *list_lengthp = mcdi_list_length; + if (rc == ENOSPC) + no_space = B_TRUE; + else + goto fail1; + } + + if (no_space) { + next_buf_idx = 0; + next_buf_length = 0; + } else { + EFSYS_ASSERT(mcdi_list_length <= buffer_length); + next_buf_idx = mcdi_list_length; + next_buf_length = buffer_length - mcdi_list_length; + } + + if (encp->enc_tunnel_encapsulations_supported != 0) { + rc = efx_mcdi_get_parser_disp_info(enp, &buffer[next_buf_idx], + next_buf_length, B_TRUE, &mcdi_encap_list_length); + if (rc != 0) { + if (rc == ENOSPC) + no_space = B_TRUE; + else + goto fail2; } - goto fail1; + } else { + mcdi_encap_list_length = 0; } + if (no_space) { + *list_lengthp = mcdi_list_length + mcdi_encap_list_length; + rc = ENOSPC; + goto fail3; + } + /* * The static assertions in ef10_filter_init() ensure that the values of * the EFX_FILTER_MATCH flags match those used by MCDI, so they don't @@ -1032,9 +1072,10 @@ ef10_filter_supported_filters( * of the matches is preserved as they are ordered from highest to * lowest priority. */ - EFSYS_ASSERT(mcdi_list_length <= buffer_length); + EFSYS_ASSERT(mcdi_list_length + mcdi_encap_list_length <= + buffer_length); list_length = 0; - for (i = 0; i < mcdi_list_length; i++) { + for (i = 0; i < mcdi_list_length + mcdi_encap_list_length; i++) { if ((buffer[i] & ~all_filter_flags) == 0) { buffer[list_length] = buffer[i]; list_length++; @@ -1045,6 +1086,10 @@ ef10_filter_supported_filters( return (0); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Thu Nov 29 06:42:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A6E11537F3; Thu, 29 Nov 2018 06:42:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CCB976C21; Thu, 29 Nov 2018 06:42:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B50115F41; Thu, 29 Nov 2018 06:42:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6gGJu024641; Thu, 29 Nov 2018 06:42:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6gFRR024640; Thu, 29 Nov 2018 06:42:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290642.wAT6gFRR024640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341187 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CCB976C21 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:42:18 -0000 Author: arybchik Date: Thu Nov 29 06:42:15 2018 New Revision: 341187 URL: https://svnweb.freebsd.org/changeset/base/341187 Log: sfxge(4): support VNI/VSID and inner frame local MAC This supports VNI/VSID and inner frame local MAC fields to match in VXLAN, GENEVE, or NVGRE packets. Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18218 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:42:04 2018 (r341186) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:42:15 2018 (r341187) @@ -146,6 +146,10 @@ ef10_filter_init( MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_VNI_OR_VSID == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_VNI_OR_VSID)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_LOC_MAC == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_MAC)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST == @@ -319,6 +323,12 @@ efx_mcdi_filter_op_add( rc = EINVAL; goto fail2; } + + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_VNI_OR_VSID), + spec->efs_vni_or_vsid, EFX_VNI_OR_VSID_LEN); + + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_IFRM_DST_MAC), + spec->efs_ifrm_loc_mac, EFX_MAC_ADDR_LEN); } efx_mcdi_execute(enp, &req); @@ -442,6 +452,12 @@ ef10_filter_equal( return (B_FALSE); if (left->efs_encap_type != right->efs_encap_type) return (B_FALSE); + if (memcmp(left->efs_vni_or_vsid, right->efs_vni_or_vsid, + EFX_VNI_OR_VSID_LEN)) + return (B_FALSE); + if (memcmp(left->efs_ifrm_loc_mac, right->efs_ifrm_loc_mac, + EFX_MAC_ADDR_LEN)) + return (B_FALSE); return (B_TRUE); @@ -1015,6 +1031,8 @@ ef10_filter_supported_filters( EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT | EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_INNER_VID | EFX_FILTER_MATCH_OUTER_VID | EFX_FILTER_MATCH_IP_PROTO | + EFX_FILTER_MATCH_VNI_OR_VSID | + EFX_FILTER_MATCH_IFRM_LOC_MAC | EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST | EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST | EFX_FILTER_MATCH_UNKNOWN_MCAST_DST | Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:42:04 2018 (r341186) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:42:15 2018 (r341187) @@ -482,6 +482,8 @@ typedef enum efx_link_mode_e { #define EFX_MAC_ADDR_LEN 6 +#define EFX_VNI_OR_VSID_LEN 3 + #define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t *)_address)[0] & 0x01) #define EFX_MAC_MULTICAST_LIST_MAX 256 @@ -2504,6 +2506,10 @@ typedef uint8_t efx_filter_flags_t; #define EFX_FILTER_MATCH_OUTER_VID 0x00000100 /* Match by IP transport protocol */ #define EFX_FILTER_MATCH_IP_PROTO 0x00000200 +/* Match by VNI or VSID */ +#define EFX_FILTER_MATCH_VNI_OR_VSID 0x00000800 +/* For encapsulated packets, match by inner frame local MAC address */ +#define EFX_FILTER_MATCH_IFRM_LOC_MAC 0x00010000 /* For encapsulated packets, match all multicast inner frames */ #define EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x01000000 /* For encapsulated packets, match all unicast inner frames */ @@ -2550,6 +2556,8 @@ typedef struct efx_filter_spec_s { uint16_t efs_rem_port; efx_oword_t efs_rem_host; efx_oword_t efs_loc_host; + uint8_t efs_vni_or_vsid[EFX_VNI_OR_VSID_LEN]; + uint8_t efs_ifrm_loc_mac[EFX_MAC_ADDR_LEN]; } efx_filter_spec_t; From owner-svn-src-head@freebsd.org Thu Nov 29 06:42:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C880F115382C; Thu, 29 Nov 2018 06:42:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CD4176D37; Thu, 29 Nov 2018 06:42:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E2D615F58; Thu, 29 Nov 2018 06:42:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6gRrl024699; Thu, 29 Nov 2018 06:42:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6gRjl024695; Thu, 29 Nov 2018 06:42:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290642.wAT6gRjl024695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341188 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CD4176D37 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:42:29 -0000 Author: arybchik Date: Thu Nov 29 06:42:26 2018 New Revision: 341188 URL: https://svnweb.freebsd.org/changeset/base/341188 Log: sfxge(4): support VXLAN filter creation Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18219 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:42:15 2018 (r341187) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:42:26 2018 (r341188) @@ -2653,6 +2653,13 @@ efx_filter_spec_set_encap_type( __in efx_tunnel_protocol_t encap_type, __in efx_filter_inner_frame_match_t inner_frame_match); +extern __checkReturn efx_rc_t +efx_filter_spec_set_vxlan_full( + __inout efx_filter_spec_t *spec, + __in const uint8_t *vxlan_id, + __in const uint8_t *inner_addr, + __in const uint8_t *outer_addr); + #if EFSYS_OPT_RX_SCALE extern __checkReturn efx_rc_t efx_filter_spec_set_rss_context( Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Thu Nov 29 06:42:15 2018 (r341187) +++ head/sys/dev/sfxge/common/efx_filter.c Thu Nov 29 06:42:26 2018 (r341188) @@ -497,6 +497,42 @@ fail1: return (rc); } +/* + * Specify inner and outer Ethernet address and VXLAN ID in filter + * specification. + */ + __checkReturn efx_rc_t +efx_filter_spec_set_vxlan_full( + __inout efx_filter_spec_t *spec, + __in const uint8_t *vxlan_id, + __in const uint8_t *inner_addr, + __in const uint8_t *outer_addr) +{ + EFSYS_ASSERT3P(spec, !=, NULL); + EFSYS_ASSERT3P(vxlan_id, !=, NULL); + EFSYS_ASSERT3P(inner_addr, !=, NULL); + EFSYS_ASSERT3P(outer_addr, !=, NULL); + + if ((inner_addr == NULL) && (outer_addr == NULL)) + return (EINVAL); + + if (vxlan_id != NULL) { + spec->efs_match_flags |= EFX_FILTER_MATCH_VNI_OR_VSID; + memcpy(spec->efs_vni_or_vsid, vxlan_id, EFX_VNI_OR_VSID_LEN); + } + if (outer_addr != NULL) { + spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC; + memcpy(spec->efs_loc_mac, outer_addr, EFX_MAC_ADDR_LEN); + } + if (inner_addr != NULL) { + spec->efs_match_flags |= EFX_FILTER_MATCH_IFRM_LOC_MAC; + memcpy(spec->efs_ifrm_loc_mac, inner_addr, EFX_MAC_ADDR_LEN); + } + spec->efs_encap_type = EFX_TUNNEL_PROTOCOL_VXLAN; + + return (0); +} + #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t efx_filter_spec_set_rss_context( From owner-svn-src-head@freebsd.org Thu Nov 29 06:42:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6334C1153875; Thu, 29 Nov 2018 06:42:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0331276E96; Thu, 29 Nov 2018 06:42:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E19A815F5E; Thu, 29 Nov 2018 06:42:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6gcI3024756; Thu, 29 Nov 2018 06:42:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6gcP3024752; Thu, 29 Nov 2018 06:42:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290642.wAT6gcP3024752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341189 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0331276E96 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:42:42 -0000 Author: arybchik Date: Thu Nov 29 06:42:38 2018 New Revision: 341189 URL: https://svnweb.freebsd.org/changeset/base/341189 Log: sfxge(4): distinguish filters for encapsulated packets Add filter match flag to distinguish filters applied only to encapsulated packets. Match flags set should allow to determine whether a filter is supported or not. The problem is that if specification has supported set outer match flags and specified encapsulation without any inner flags, check says that it is supported, and filter insertion is performed. However, there is no filtering of the encapsulated traffic. A new flag is added to solve this problem and separate the filters for the encapsulated packets. Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18220 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:42:26 2018 (r341188) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:42:38 2018 (r341189) @@ -201,6 +201,7 @@ efx_mcdi_filter_op_add( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, MC_CMD_FILTER_OP_EXT_OUT_LEN)]; + efx_filter_match_flags_t match_flags; efx_rc_t rc; memset(payload, 0, sizeof (payload)); @@ -210,6 +211,12 @@ efx_mcdi_filter_op_add( req.emr_out_buf = payload; req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; + /* + * Remove match flag for encapsulated filters that does not correspond + * to the MCDI match flags + */ + match_flags = spec->efs_match_flags & ~EFX_FILTER_MATCH_ENCAP_TYPE; + switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REPLACE: MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO, @@ -230,7 +237,7 @@ efx_mcdi_filter_op_add( MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_MATCH_FIELDS, - spec->efs_match_flags); + match_flags); MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST, MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, @@ -1035,13 +1042,17 @@ ef10_filter_supported_filters( EFX_FILTER_MATCH_IFRM_LOC_MAC | EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST | EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST | + EFX_FILTER_MATCH_ENCAP_TYPE | EFX_FILTER_MATCH_UNKNOWN_MCAST_DST | EFX_FILTER_MATCH_UNKNOWN_UCAST_DST); /* * Two calls to MC_CMD_GET_PARSER_DISP_INFO are needed: one to get the * list of supported filters for ordinary packets, and then another to - * get the list of supported filters for encapsulated packets. + * get the list of supported filters for encapsulated packets. To + * distinguish the second list from the first, the + * EFX_FILTER_MATCH_ENCAP_TYPE flag is added to each filter for + * encapsulated packets. */ rc = efx_mcdi_get_parser_disp_info(enp, buffer, buffer_length, B_FALSE, &mcdi_list_length); @@ -1069,6 +1080,10 @@ ef10_filter_supported_filters( no_space = B_TRUE; else goto fail2; + } else { + for (i = next_buf_idx; + i < next_buf_idx + mcdi_encap_list_length; i++) + buffer[i] |= EFX_FILTER_MATCH_ENCAP_TYPE; } } else { mcdi_encap_list_length = 0; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:42:26 2018 (r341188) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:42:38 2018 (r341189) @@ -2514,6 +2514,11 @@ typedef uint8_t efx_filter_flags_t; #define EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x01000000 /* For encapsulated packets, match all unicast inner frames */ #define EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST 0x02000000 +/* + * Match by encap type, this flag does not correspond to + * the MCDI match flags and any unoccupied value may be used + */ +#define EFX_FILTER_MATCH_ENCAP_TYPE 0x20000000 /* Match otherwise-unmatched multicast and broadcast packets */ #define EFX_FILTER_MATCH_UNKNOWN_MCAST_DST 0x40000000 /* Match otherwise-unmatched unicast packets */ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Thu Nov 29 06:42:26 2018 (r341188) +++ head/sys/dev/sfxge/common/efx_filter.c Thu Nov 29 06:42:38 2018 (r341189) @@ -447,7 +447,7 @@ efx_filter_spec_set_encap_type( __in efx_tunnel_protocol_t encap_type, __in efx_filter_inner_frame_match_t inner_frame_match) { - uint32_t match_flags = 0; + uint32_t match_flags = EFX_FILTER_MATCH_ENCAP_TYPE; uint8_t ip_proto; efx_rc_t rc; @@ -528,6 +528,7 @@ efx_filter_spec_set_vxlan_full( spec->efs_match_flags |= EFX_FILTER_MATCH_IFRM_LOC_MAC; memcpy(spec->efs_ifrm_loc_mac, inner_addr, EFX_MAC_ADDR_LEN); } + spec->efs_match_flags |= EFX_FILTER_MATCH_ENCAP_TYPE; spec->efs_encap_type = EFX_TUNNEL_PROTOCOL_VXLAN; return (0); From owner-svn-src-head@freebsd.org Thu Nov 29 06:42:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F28CC11538B8; Thu, 29 Nov 2018 06:42:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94D6F76FAD; Thu, 29 Nov 2018 06:42:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA8E715F5F; Thu, 29 Nov 2018 06:42:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6gnWq024812; Thu, 29 Nov 2018 06:42:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6gnrF024811; Thu, 29 Nov 2018 06:42:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290642.wAT6gnrF024811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341190 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94D6F76FAD X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:42:53 -0000 Author: arybchik Date: Thu Nov 29 06:42:49 2018 New Revision: 341190 URL: https://svnweb.freebsd.org/changeset/base/341190 Log: sfxge(4): support drop filters on EF10 family NICs Add support for filters which drop packets when forming MCDI request for a filter. Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18221 Modified: head/sys/dev/sfxge/common/ef10_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:42:38 2018 (r341189) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:42:49 2018 (r341190) @@ -238,10 +238,15 @@ efx_mcdi_filter_op_add( EVB_PORT_ID_ASSIGNED); MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_MATCH_FIELDS, match_flags); - MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST, - MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); - MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, - spec->efs_dmaq_id); + if (spec->efs_dmaq_id == EFX_FILTER_SPEC_RX_DMAQ_ID_DROP) { + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST, + MC_CMD_FILTER_OP_EXT_IN_RX_DEST_DROP); + } else { + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST, + MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, + spec->efs_dmaq_id); + } #if EFSYS_OPT_RX_SCALE if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) { From owner-svn-src-head@freebsd.org Thu Nov 29 06:43:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB7211153903; Thu, 29 Nov 2018 06:43:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 518ED770A3; Thu, 29 Nov 2018 06:43:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0CD515F60; Thu, 29 Nov 2018 06:43:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6h1M1024879; Thu, 29 Nov 2018 06:43:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6h0f7024874; Thu, 29 Nov 2018 06:43:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290643.wAT6h0f7024874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341191 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 341191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 518ED770A3 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:43:02 -0000 Author: arybchik Date: Thu Nov 29 06:43:00 2018 New Revision: 341191 URL: https://svnweb.freebsd.org/changeset/base/341191 Log: sfxge(4): support choosing firmware variant Submitted by: Gautam Dawar Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18222 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:42:49 2018 (r341190) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:43:00 2018 (r341191) @@ -157,9 +157,22 @@ efx_nic_create( __in efsys_lock_t *eslp, __deref_out efx_nic_t **enpp); +/* EFX_FW_VARIANT codes map one to one on MC_CMD_FW codes */ +typedef enum efx_fw_variant_e { + EFX_FW_VARIANT_FULL_FEATURED, + EFX_FW_VARIANT_LOW_LATENCY, + EFX_FW_VARIANT_PACKED_STREAM, + EFX_FW_VARIANT_HIGH_TX_RATE, + EFX_FW_VARIANT_PACKED_STREAM_HASH_MODE_1, + EFX_FW_VARIANT_RULES_ENGINE, + EFX_FW_VARIANT_DPDK, + EFX_FW_VARIANT_DONT_CARE = 0xffffffff +} efx_fw_variant_t; + extern __checkReturn efx_rc_t efx_nic_probe( - __in efx_nic_t *enp); + __in efx_nic_t *enp, + __in efx_fw_variant_t efv); extern __checkReturn efx_rc_t efx_nic_init( Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:42:49 2018 (r341190) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:43:00 2018 (r341191) @@ -675,6 +675,7 @@ struct efx_nic_s { const efx_ev_ops_t *en_eevop; const efx_tx_ops_t *en_etxop; const efx_rx_ops_t *en_erxop; + efx_fw_variant_t efv; #if EFSYS_OPT_FILTER efx_filter_t en_filter; const efx_filter_ops_t *en_efop; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Nov 29 06:42:49 2018 (r341190) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Nov 29 06:43:00 2018 (r341191) @@ -1293,13 +1293,19 @@ efx_mcdi_drv_attach( req.emr_out_length = MC_CMD_DRV_ATTACH_EXT_OUT_LEN; /* - * Use DONT_CARE for the datapath firmware type to ensure that the - * driver can attach to an unprivileged function. The datapath firmware - * type to use is controlled by the 'sfboot' utility. + * Typically, client drivers use DONT_CARE for the datapath firmware + * type to ensure that the driver can attach to an unprivileged + * function. The datapath firmware type to use is controlled by the + * 'sfboot' utility. + * If a client driver wishes to attach with a specific datapath firmware + * type, that can be passed in second argument of efx_nic_probe API. One + * such example is the ESXi native driver that attempts attaching with + * FULL_FEATURED datapath firmware type first and fall backs to + * DONT_CARE datapath firmware type if MC_CMD_DRV_ATTACH fails. */ MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_NEW_STATE, attach ? 1 : 0); MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_UPDATE, 1); - MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_FIRMWARE_ID, MC_CMD_FW_DONT_CARE); + MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_FIRMWARE_ID, enp->efv); efx_mcdi_execute(enp, &req); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Nov 29 06:42:49 2018 (r341190) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Nov 29 06:43:00 2018 (r341191) @@ -319,7 +319,8 @@ fail1: __checkReturn efx_rc_t efx_nic_probe( - __in efx_nic_t *enp) + __in efx_nic_t *enp, + __in efx_fw_variant_t efv) { const efx_nic_ops_t *enop; efx_rc_t rc; @@ -330,7 +331,27 @@ efx_nic_probe( #endif /* EFSYS_OPT_MCDI */ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_PROBE)); + /* Ensure FW variant codes match with MC_CMD_FW codes */ + EFX_STATIC_ASSERT(EFX_FW_VARIANT_FULL_FEATURED == + MC_CMD_FW_FULL_FEATURED); + EFX_STATIC_ASSERT(EFX_FW_VARIANT_LOW_LATENCY == + MC_CMD_FW_LOW_LATENCY); + EFX_STATIC_ASSERT(EFX_FW_VARIANT_PACKED_STREAM == + MC_CMD_FW_PACKED_STREAM); + EFX_STATIC_ASSERT(EFX_FW_VARIANT_HIGH_TX_RATE == + MC_CMD_FW_HIGH_TX_RATE); + EFX_STATIC_ASSERT(EFX_FW_VARIANT_PACKED_STREAM_HASH_MODE_1 == + MC_CMD_FW_PACKED_STREAM_HASH_MODE_1); + EFX_STATIC_ASSERT(EFX_FW_VARIANT_RULES_ENGINE == + MC_CMD_FW_RULES_ENGINE); + EFX_STATIC_ASSERT(EFX_FW_VARIANT_DPDK == + MC_CMD_FW_DPDK); + EFX_STATIC_ASSERT(EFX_FW_VARIANT_DONT_CARE == + (int)MC_CMD_FW_DONT_CARE); + enop = enp->en_enop; + enp->efv = efv; + if ((rc = enop->eno_probe(enp)) != 0) goto fail1; Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Thu Nov 29 06:42:49 2018 (r341190) +++ head/sys/dev/sfxge/sfxge.c Thu Nov 29 06:43:00 2018 (r341191) @@ -748,7 +748,7 @@ sfxge_create(struct sfxge_softc *sc) /* Probe the NIC and build the configuration data area. */ DBGPRINT(sc->dev, "nic_probe..."); - if ((error = efx_nic_probe(enp)) != 0) + if ((error = efx_nic_probe(enp, EFX_FW_VARIANT_DONT_CARE)) != 0) goto fail5; if (!ISP2(sfxge_rx_ring_entries) || From owner-svn-src-head@freebsd.org Thu Nov 29 06:43:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C8CE115396B; Thu, 29 Nov 2018 06:43:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42AFF771ED; Thu, 29 Nov 2018 06:43:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02C8315F62; Thu, 29 Nov 2018 06:43:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6hCJv024937; Thu, 29 Nov 2018 06:43:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6hCAp024935; Thu, 29 Nov 2018 06:43:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290643.wAT6hCAp024935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341192 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42AFF771ED X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:43:15 -0000 Author: arybchik Date: Thu Nov 29 06:43:12 2018 New Revision: 341192 URL: https://svnweb.freebsd.org/changeset/base/341192 Log: sfxge(4): add values for RxDPCPU firmware id recognition Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18223 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:43:00 2018 (r341191) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:43:12 2018 (r341192) @@ -1322,6 +1322,13 @@ extern const efx_nic_cfg_t * efx_nic_cfg_get( __in efx_nic_t *enp); +/* RxDPCPU firmware id values by which FW variant can be identified */ +#define EFX_RXDP_FULL_FEATURED_FW_ID 0x0 +#define EFX_RXDP_LOW_LATENCY_FW_ID 0x1 +#define EFX_RXDP_PACKED_STREAM_FW_ID 0x2 +#define EFX_RXDP_RULES_ENGINE_FW_ID 0x5 +#define EFX_RXDP_DPDK_FW_ID 0x6 + typedef struct efx_nic_fw_info_s { /* Basic FW version information */ uint16_t enfi_mc_fw_version[4]; Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Nov 29 06:43:00 2018 (r341191) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Nov 29 06:43:12 2018 (r341192) @@ -636,6 +636,18 @@ efx_nic_get_fw_version( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); + /* Ensure RXDP_FW_ID codes match with MC_CMD_GET_CAPABILITIES codes */ + EFX_STATIC_ASSERT(EFX_RXDP_FULL_FEATURED_FW_ID == + MC_CMD_GET_CAPABILITIES_OUT_RXDP); + EFX_STATIC_ASSERT(EFX_RXDP_LOW_LATENCY_FW_ID == + MC_CMD_GET_CAPABILITIES_OUT_RXDP_LOW_LATENCY); + EFX_STATIC_ASSERT(EFX_RXDP_PACKED_STREAM_FW_ID == + MC_CMD_GET_CAPABILITIES_OUT_RXDP_PACKED_STREAM); + EFX_STATIC_ASSERT(EFX_RXDP_RULES_ENGINE_FW_ID == + MC_CMD_GET_CAPABILITIES_OUT_RXDP_RULES_ENGINE); + EFX_STATIC_ASSERT(EFX_RXDP_DPDK_FW_ID == + MC_CMD_GET_CAPABILITIES_OUT_RXDP_DPDK); + rc = efx_mcdi_version(enp, mc_fw_version, NULL, NULL); if (rc != 0) goto fail2; From owner-svn-src-head@freebsd.org Thu Nov 29 06:43:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B020811539D5; Thu, 29 Nov 2018 06:43:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B671772F1; Thu, 29 Nov 2018 06:43:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2112415F63; Thu, 29 Nov 2018 06:43:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6hOvF024997; Thu, 29 Nov 2018 06:43:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6hODt024995; Thu, 29 Nov 2018 06:43:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290643.wAT6hODt024995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341193 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B671772F1 X-Spamd-Result: default: False [1.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.632,0]; NEURAL_SPAM_MEDIUM(0.47)[0.474,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.534,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:43:26 -0000 Author: arybchik Date: Thu Nov 29 06:43:23 2018 New Revision: 341193 URL: https://svnweb.freebsd.org/changeset/base/341193 Log: sfxge(4): update MCDI headers Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18224 Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h head/sys/dev/sfxge/common/efx_regs_mcdi_aoe.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Nov 29 06:43:12 2018 (r341192) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Nov 29 06:43:23 2018 (r341193) @@ -301,7 +301,8 @@ #define MC_CMD_ERR_NO_PRIVILEGE 0x1013 /* Workaround 26807 could not be turned on/off because some functions * have already installed filters. See the comment at - * MC_CMD_WORKAROUND_BUG26807. */ + * MC_CMD_WORKAROUND_BUG26807. + * May also returned for other operations such as sub-variant switching. */ #define MC_CMD_ERR_FILTERS_PRESENT 0x1014 /* The clock whose frequency you've attempted to set set * doesn't exist on this NIC */ @@ -320,6 +321,10 @@ * away. This is distinct from MC_CMD_ERR_DATAPATH_DISABLED in that the * datapath absence may be temporary*/ #define MC_CMD_ERR_NO_DATAPATH 0x1019 +/* The operation could not complete because some VIs are allocated */ +#define MC_CMD_ERR_VIS_PRESENT 0x101a +/* The operation could not complete because some PIO buffers are allocated */ +#define MC_CMD_ERR_PIOBUFS_PRESENT 0x101b #define MC_CMD_ERR_CODE_OFST 0 @@ -404,7 +409,7 @@ #define MCDI_EVENT_LEVEL_LBN 33 #define MCDI_EVENT_LEVEL_WIDTH 3 /* enum: Info. */ -#define MCDI_EVENT_LEVEL_INFO 0x0 +#define MCDI_EVENT_LEVEL_INFO 0x0 /* enum: Warning. */ #define MCDI_EVENT_LEVEL_WARN 0x1 /* enum: Error. */ @@ -424,21 +429,21 @@ #define MCDI_EVENT_LINKCHANGE_SPEED_LBN 16 #define MCDI_EVENT_LINKCHANGE_SPEED_WIDTH 4 /* enum: Link is down or link speed could not be determined */ -#define MCDI_EVENT_LINKCHANGE_SPEED_UNKNOWN 0x0 +#define MCDI_EVENT_LINKCHANGE_SPEED_UNKNOWN 0x0 /* enum: 100Mbs */ -#define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1 +#define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1 /* enum: 1Gbs */ -#define MCDI_EVENT_LINKCHANGE_SPEED_1G 0x2 +#define MCDI_EVENT_LINKCHANGE_SPEED_1G 0x2 /* enum: 10Gbs */ -#define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3 +#define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3 /* enum: 40Gbs */ -#define MCDI_EVENT_LINKCHANGE_SPEED_40G 0x4 +#define MCDI_EVENT_LINKCHANGE_SPEED_40G 0x4 /* enum: 25Gbs */ -#define MCDI_EVENT_LINKCHANGE_SPEED_25G 0x5 +#define MCDI_EVENT_LINKCHANGE_SPEED_25G 0x5 /* enum: 50Gbs */ -#define MCDI_EVENT_LINKCHANGE_SPEED_50G 0x6 +#define MCDI_EVENT_LINKCHANGE_SPEED_50G 0x6 /* enum: 100Gbs */ -#define MCDI_EVENT_LINKCHANGE_SPEED_100G 0x7 +#define MCDI_EVENT_LINKCHANGE_SPEED_100G 0x7 #define MCDI_EVENT_LINKCHANGE_FCNTL_LBN 20 #define MCDI_EVENT_LINKCHANGE_FCNTL_WIDTH 4 #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_LBN 24 @@ -645,23 +650,23 @@ /* enum: Transmit error */ #define MCDI_EVENT_CODE_TX_ERR 0xb /* enum: Tx flush has completed */ -#define MCDI_EVENT_CODE_TX_FLUSH 0xc +#define MCDI_EVENT_CODE_TX_FLUSH 0xc /* enum: PTP packet received timestamp */ -#define MCDI_EVENT_CODE_PTP_RX 0xd +#define MCDI_EVENT_CODE_PTP_RX 0xd /* enum: PTP NIC failure */ -#define MCDI_EVENT_CODE_PTP_FAULT 0xe +#define MCDI_EVENT_CODE_PTP_FAULT 0xe /* enum: PTP PPS event */ -#define MCDI_EVENT_CODE_PTP_PPS 0xf +#define MCDI_EVENT_CODE_PTP_PPS 0xf /* enum: Rx flush has completed */ -#define MCDI_EVENT_CODE_RX_FLUSH 0x10 +#define MCDI_EVENT_CODE_RX_FLUSH 0x10 /* enum: Receive error */ #define MCDI_EVENT_CODE_RX_ERR 0x11 /* enum: AOE fault */ -#define MCDI_EVENT_CODE_AOE 0x12 +#define MCDI_EVENT_CODE_AOE 0x12 /* enum: Network port calibration failed (VCAL). */ -#define MCDI_EVENT_CODE_VCAL_FAIL 0x13 +#define MCDI_EVENT_CODE_VCAL_FAIL 0x13 /* enum: HW PPS event */ -#define MCDI_EVENT_CODE_HW_PPS 0x14 +#define MCDI_EVENT_CODE_HW_PPS 0x14 /* enum: The MC has rebooted (huntington and later, siena uses CODE_REBOOT and * a different format) */ @@ -693,7 +698,7 @@ /* enum: Artificial event generated by host and posted via MC for test * purposes. */ -#define MCDI_EVENT_CODE_TESTGEN 0xfa +#define MCDI_EVENT_CODE_TESTGEN 0xfa #define MCDI_EVENT_CMDDONE_DATA_OFST 0 #define MCDI_EVENT_CMDDONE_DATA_LEN 4 #define MCDI_EVENT_CMDDONE_DATA_LBN 0 @@ -823,7 +828,7 @@ #define FCDI_EVENT_LEVEL_LBN 33 #define FCDI_EVENT_LEVEL_WIDTH 3 /* enum: Info. */ -#define FCDI_EVENT_LEVEL_INFO 0x0 +#define FCDI_EVENT_LEVEL_INFO 0x0 /* enum: Warning. */ #define FCDI_EVENT_LEVEL_WARN 0x1 /* enum: Error. */ @@ -955,7 +960,7 @@ #define MUM_EVENT_LEVEL_LBN 33 #define MUM_EVENT_LEVEL_WIDTH 3 /* enum: Info. */ -#define MUM_EVENT_LEVEL_INFO 0x0 +#define MUM_EVENT_LEVEL_INFO 0x0 /* enum: Warning. */ #define MUM_EVENT_LEVEL_WARN 0x1 /* enum: Error. */ @@ -1100,7 +1105,7 @@ #define MC_CMD_COPYCODE 0x3 #undef MC_CMD_0x3_PRIVILEGE_CTG -#define MC_CMD_0x3_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0x3_PRIVILEGE_CTG SRIOV_CTG_ADMIN_TSA_UNBOUND /* MC_CMD_COPYCODE_IN msgrequest */ #define MC_CMD_COPYCODE_IN_LEN 16 @@ -1187,7 +1192,7 @@ #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_OFST 0 #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_LEN 4 /* enum: indicates that the MC wasn't flash booted */ -#define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_NULL 0xdeadbeef +#define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_NULL 0xdeadbeef #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_OFST 4 #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_LEN 4 #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_LBN 0 @@ -1607,11 +1612,10 @@ #define MC_CMD_PTP_IN_MANFTEST_PACKET_TEST_ENABLE_OFST 8 #define MC_CMD_PTP_IN_MANFTEST_PACKET_TEST_ENABLE_LEN 4 -/* MC_CMD_PTP_IN_RESET_STATS msgrequest */ +/* MC_CMD_PTP_IN_RESET_STATS msgrequest: Reset PTP statistics */ #define MC_CMD_PTP_IN_RESET_STATS_LEN 8 /* MC_CMD_PTP_IN_CMD_OFST 0 */ /* MC_CMD_PTP_IN_CMD_LEN 4 */ -/* Reset PTP statistics */ /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */ /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */ @@ -1762,11 +1766,10 @@ /* enum: External. */ #define MC_CMD_PTP_CLK_SRC_EXTERNAL 0x1 -/* MC_CMD_PTP_IN_RST_CLK msgrequest */ +/* MC_CMD_PTP_IN_RST_CLK msgrequest: Reset value of Timer Reg. */ #define MC_CMD_PTP_IN_RST_CLK_LEN 8 /* MC_CMD_PTP_IN_CMD_OFST 0 */ /* MC_CMD_PTP_IN_CMD_LEN 4 */ -/* Reset value of Timer Reg. */ /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */ /* MC_CMD_PTP_IN_PERIPH_ID_LEN 4 */ @@ -2246,7 +2249,7 @@ #define MC_CMD_HP 0x54 #undef MC_CMD_0x54_PRIVILEGE_CTG -#define MC_CMD_0x54_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0x54_PRIVILEGE_CTG SRIOV_CTG_ADMIN_TSA_UNBOUND /* MC_CMD_HP_IN msgrequest */ #define MC_CMD_HP_IN_LEN 16 @@ -2589,28 +2592,51 @@ #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_LEN 4 #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_OFST 4 #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_LEN 32 -/* See MC_CMD_CAPABILITIES */ +/* Capabilities for Siena Port0 (see struct MC_CMD_CAPABILITIES). Unused on + * EF10 and later (use MC_CMD_GET_CAPABILITIES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT0_OFST 36 #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT0_LEN 4 -/* See MC_CMD_CAPABILITIES */ +/* Capabilities for Siena Port1 (see struct MC_CMD_CAPABILITIES). Unused on + * EF10 and later (use MC_CMD_GET_CAPABILITIES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT1_OFST 40 #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT1_LEN 4 +/* Base MAC address for Siena Port0. Unused on EF10 and later (use + * MC_CMD_GET_MAC_ADDRESSES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_OFST 44 #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_LEN 6 +/* Base MAC address for Siena Port1. Unused on EF10 and later (use + * MC_CMD_GET_MAC_ADDRESSES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_OFST 50 #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_LEN 6 +/* Size of MAC address pool for Siena Port0. Unused on EF10 and later (use + * MC_CMD_GET_MAC_ADDRESSES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT0_OFST 56 #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT0_LEN 4 +/* Size of MAC address pool for Siena Port1. Unused on EF10 and later (use + * MC_CMD_GET_MAC_ADDRESSES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT1_OFST 60 #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT1_LEN 4 +/* Increment between addresses in MAC address pool for Siena Port0. Unused on + * EF10 and later (use MC_CMD_GET_MAC_ADDRESSES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT0_OFST 64 #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT0_LEN 4 +/* Increment between addresses in MAC address pool for Siena Port1. Unused on + * EF10 and later (use MC_CMD_GET_MAC_ADDRESSES). + */ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_OFST 68 #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_LEN 4 -/* This field contains a 16-bit value for each of the types of NVRAM area. The - * values are defined in the firmware/mc/platform/.c file for a specific board - * type, but otherwise have no meaning to the MC; they are used by the driver - * to manage selection of appropriate firmware updates. +/* Siena only. This field contains a 16-bit value for each of the types of + * NVRAM area. The values are defined in the firmware/mc/platform/.c file for a + * specific board type, but otherwise have no meaning to the MC; they are used + * by the driver to manage selection of appropriate firmware updates. Unused on + * EF10 and later (use MC_CMD_NVRAM_METADATA). */ #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST 72 #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN 2 @@ -2727,8 +2753,14 @@ #define MC_CMD_DRV_ATTACH_IN_NEW_STATE_LEN 4 #define MC_CMD_DRV_ATTACH_LBN 0 #define MC_CMD_DRV_ATTACH_WIDTH 1 +#define MC_CMD_DRV_ATTACH_IN_ATTACH_LBN 0 +#define MC_CMD_DRV_ATTACH_IN_ATTACH_WIDTH 1 #define MC_CMD_DRV_PREBOOT_LBN 1 #define MC_CMD_DRV_PREBOOT_WIDTH 1 +#define MC_CMD_DRV_ATTACH_IN_PREBOOT_LBN 1 +#define MC_CMD_DRV_ATTACH_IN_PREBOOT_WIDTH 1 +#define MC_CMD_DRV_ATTACH_IN_SUBVARIANT_AWARE_LBN 2 +#define MC_CMD_DRV_ATTACH_IN_SUBVARIANT_AWARE_WIDTH 1 /* 1 to set new state, or 0 to just report the existing state */ #define MC_CMD_DRV_ATTACH_IN_UPDATE_OFST 4 #define MC_CMD_DRV_ATTACH_IN_UPDATE_LEN 4 @@ -2753,8 +2785,12 @@ #define MC_CMD_FW_RULES_ENGINE 0x5 /* enum: Prefer to use firmware with additional DPDK support */ #define MC_CMD_FW_DPDK 0x6 +/* enum: Prefer to use "l3xudp" custom datapath firmware (see SF-119495-PD and + * bug69716) + */ +#define MC_CMD_FW_L3XUDP 0x7 /* enum: Only this option is allowed for non-admin functions */ -#define MC_CMD_FW_DONT_CARE 0xffffffff +#define MC_CMD_FW_DONT_CARE 0xffffffff /* MC_CMD_DRV_ATTACH_OUT msgresponse */ #define MC_CMD_DRV_ATTACH_OUT_LEN 4 @@ -3101,7 +3137,7 @@ #define MC_CMD_START_BIST 0x25 #undef MC_CMD_0x25_PRIVILEGE_CTG -#define MC_CMD_0x25_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0x25_PRIVILEGE_CTG SRIOV_CTG_ADMIN_TSA_UNBOUND /* MC_CMD_START_BIST_IN msgrequest */ #define MC_CMD_START_BIST_IN_LEN 4 @@ -3141,7 +3177,7 @@ #define MC_CMD_POLL_BIST 0x26 #undef MC_CMD_0x26_PRIVILEGE_CTG -#define MC_CMD_0x26_PRIVILEGE_CTG SRIOV_CTG_ADMIN +#define MC_CMD_0x26_PRIVILEGE_CTG SRIOV_CTG_ADMIN_TSA_UNBOUND /* MC_CMD_POLL_BIST_IN msgrequest */ #define MC_CMD_POLL_BIST_IN_LEN 0 @@ -3342,83 +3378,83 @@ #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LO_OFST 0 #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_HI_OFST 4 /* enum: None. */ -#define MC_CMD_LOOPBACK_NONE 0x0 +#define MC_CMD_LOOPBACK_NONE 0x0 /* enum: Data. */ -#define MC_CMD_LOOPBACK_DATA 0x1 +#define MC_CMD_LOOPBACK_DATA 0x1 /* enum: GMAC. */ -#define MC_CMD_LOOPBACK_GMAC 0x2 +#define MC_CMD_LOOPBACK_GMAC 0x2 /* enum: XGMII. */ #define MC_CMD_LOOPBACK_XGMII 0x3 /* enum: XGXS. */ -#define MC_CMD_LOOPBACK_XGXS 0x4 +#define MC_CMD_LOOPBACK_XGXS 0x4 /* enum: XAUI. */ -#define MC_CMD_LOOPBACK_XAUI 0x5 +#define MC_CMD_LOOPBACK_XAUI 0x5 /* enum: GMII. */ -#define MC_CMD_LOOPBACK_GMII 0x6 +#define MC_CMD_LOOPBACK_GMII 0x6 /* enum: SGMII. */ -#define MC_CMD_LOOPBACK_SGMII 0x7 +#define MC_CMD_LOOPBACK_SGMII 0x7 /* enum: XGBR. */ -#define MC_CMD_LOOPBACK_XGBR 0x8 +#define MC_CMD_LOOPBACK_XGBR 0x8 /* enum: XFI. */ -#define MC_CMD_LOOPBACK_XFI 0x9 +#define MC_CMD_LOOPBACK_XFI 0x9 /* enum: XAUI Far. */ -#define MC_CMD_LOOPBACK_XAUI_FAR 0xa +#define MC_CMD_LOOPBACK_XAUI_FAR 0xa /* enum: GMII Far. */ -#define MC_CMD_LOOPBACK_GMII_FAR 0xb +#define MC_CMD_LOOPBACK_GMII_FAR 0xb /* enum: SGMII Far. */ -#define MC_CMD_LOOPBACK_SGMII_FAR 0xc +#define MC_CMD_LOOPBACK_SGMII_FAR 0xc /* enum: XFI Far. */ -#define MC_CMD_LOOPBACK_XFI_FAR 0xd +#define MC_CMD_LOOPBACK_XFI_FAR 0xd /* enum: GPhy. */ -#define MC_CMD_LOOPBACK_GPHY 0xe +#define MC_CMD_LOOPBACK_GPHY 0xe /* enum: PhyXS. */ -#define MC_CMD_LOOPBACK_PHYXS 0xf +#define MC_CMD_LOOPBACK_PHYXS 0xf /* enum: PCS. */ -#define MC_CMD_LOOPBACK_PCS 0x10 +#define MC_CMD_LOOPBACK_PCS 0x10 /* enum: PMA-PMD. */ -#define MC_CMD_LOOPBACK_PMAPMD 0x11 +#define MC_CMD_LOOPBACK_PMAPMD 0x11 /* enum: Cross-Port. */ -#define MC_CMD_LOOPBACK_XPORT 0x12 +#define MC_CMD_LOOPBACK_XPORT 0x12 /* enum: XGMII-Wireside. */ -#define MC_CMD_LOOPBACK_XGMII_WS 0x13 +#define MC_CMD_LOOPBACK_XGMII_WS 0x13 /* enum: XAUI Wireside. */ -#define MC_CMD_LOOPBACK_XAUI_WS 0x14 +#define MC_CMD_LOOPBACK_XAUI_WS 0x14 /* enum: XAUI Wireside Far. */ -#define MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15 +#define MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15 /* enum: XAUI Wireside near. */ -#define MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16 +#define MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16 /* enum: GMII Wireside. */ -#define MC_CMD_LOOPBACK_GMII_WS 0x17 +#define MC_CMD_LOOPBACK_GMII_WS 0x17 /* enum: XFI Wireside. */ -#define MC_CMD_LOOPBACK_XFI_WS 0x18 +#define MC_CMD_LOOPBACK_XFI_WS 0x18 /* enum: XFI Wireside Far. */ -#define MC_CMD_LOOPBACK_XFI_WS_FAR 0x19 +#define MC_CMD_LOOPBACK_XFI_WS_FAR 0x19 /* enum: PhyXS Wireside. */ -#define MC_CMD_LOOPBACK_PHYXS_WS 0x1a +#define MC_CMD_LOOPBACK_PHYXS_WS 0x1a /* enum: PMA lanes MAC-Serdes. */ -#define MC_CMD_LOOPBACK_PMA_INT 0x1b +#define MC_CMD_LOOPBACK_PMA_INT 0x1b /* enum: KR Serdes Parallel (Encoder). */ -#define MC_CMD_LOOPBACK_SD_NEAR 0x1c +#define MC_CMD_LOOPBACK_SD_NEAR 0x1c /* enum: KR Serdes Serial. */ -#define MC_CMD_LOOPBACK_SD_FAR 0x1d +#define MC_CMD_LOOPBACK_SD_FAR 0x1d /* enum: PMA lanes MAC-Serdes Wireside. */ -#define MC_CMD_LOOPBACK_PMA_INT_WS 0x1e +#define MC_CMD_LOOPBACK_PMA_INT_WS 0x1e /* enum: KR Serdes Parallel Wireside (Full PCS). */ -#define MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f +#define MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f /* enum: KR Serdes Parallel Wireside (Sym Aligner to TX). */ -#define MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20 +#define MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20 /* enum: KR Serdes Parallel Wireside (Deserializer to Serializer). */ -#define MC_CMD_LOOPBACK_SD_FEP_WS 0x21 +#define MC_CMD_LOOPBACK_SD_FEP_WS 0x21 /* enum: KR Serdes Serial Wireside. */ -#define MC_CMD_LOOPBACK_SD_FES_WS 0x22 +#define MC_CMD_LOOPBACK_SD_FES_WS 0x22 /* enum: Near side of AOE Siena side port */ -#define MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23 +#define MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23 /* enum: Medford Wireside datapath loopback */ -#define MC_CMD_LOOPBACK_DATA_WS 0x24 +#define MC_CMD_LOOPBACK_DATA_WS 0x24 /* enum: Force link up without setting up any physical loopback (snapper use * only) */ -#define MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25 +#define MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25 /* Supported loopbacks. */ #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_OFST 8 #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LEN 8 @@ -3458,83 +3494,83 @@ #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100M_LO_OFST 0 #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_100M_HI_OFST 4 /* enum: None. */ -/* MC_CMD_LOOPBACK_NONE 0x0 */ +/* MC_CMD_LOOPBACK_NONE 0x0 */ /* enum: Data. */ -/* MC_CMD_LOOPBACK_DATA 0x1 */ +/* MC_CMD_LOOPBACK_DATA 0x1 */ /* enum: GMAC. */ -/* MC_CMD_LOOPBACK_GMAC 0x2 */ +/* MC_CMD_LOOPBACK_GMAC 0x2 */ /* enum: XGMII. */ /* MC_CMD_LOOPBACK_XGMII 0x3 */ /* enum: XGXS. */ -/* MC_CMD_LOOPBACK_XGXS 0x4 */ +/* MC_CMD_LOOPBACK_XGXS 0x4 */ /* enum: XAUI. */ -/* MC_CMD_LOOPBACK_XAUI 0x5 */ +/* MC_CMD_LOOPBACK_XAUI 0x5 */ /* enum: GMII. */ -/* MC_CMD_LOOPBACK_GMII 0x6 */ +/* MC_CMD_LOOPBACK_GMII 0x6 */ /* enum: SGMII. */ -/* MC_CMD_LOOPBACK_SGMII 0x7 */ +/* MC_CMD_LOOPBACK_SGMII 0x7 */ /* enum: XGBR. */ -/* MC_CMD_LOOPBACK_XGBR 0x8 */ +/* MC_CMD_LOOPBACK_XGBR 0x8 */ /* enum: XFI. */ -/* MC_CMD_LOOPBACK_XFI 0x9 */ +/* MC_CMD_LOOPBACK_XFI 0x9 */ /* enum: XAUI Far. */ -/* MC_CMD_LOOPBACK_XAUI_FAR 0xa */ +/* MC_CMD_LOOPBACK_XAUI_FAR 0xa */ /* enum: GMII Far. */ -/* MC_CMD_LOOPBACK_GMII_FAR 0xb */ +/* MC_CMD_LOOPBACK_GMII_FAR 0xb */ /* enum: SGMII Far. */ -/* MC_CMD_LOOPBACK_SGMII_FAR 0xc */ +/* MC_CMD_LOOPBACK_SGMII_FAR 0xc */ /* enum: XFI Far. */ -/* MC_CMD_LOOPBACK_XFI_FAR 0xd */ +/* MC_CMD_LOOPBACK_XFI_FAR 0xd */ /* enum: GPhy. */ -/* MC_CMD_LOOPBACK_GPHY 0xe */ +/* MC_CMD_LOOPBACK_GPHY 0xe */ /* enum: PhyXS. */ -/* MC_CMD_LOOPBACK_PHYXS 0xf */ +/* MC_CMD_LOOPBACK_PHYXS 0xf */ /* enum: PCS. */ -/* MC_CMD_LOOPBACK_PCS 0x10 */ +/* MC_CMD_LOOPBACK_PCS 0x10 */ /* enum: PMA-PMD. */ -/* MC_CMD_LOOPBACK_PMAPMD 0x11 */ +/* MC_CMD_LOOPBACK_PMAPMD 0x11 */ /* enum: Cross-Port. */ -/* MC_CMD_LOOPBACK_XPORT 0x12 */ +/* MC_CMD_LOOPBACK_XPORT 0x12 */ /* enum: XGMII-Wireside. */ -/* MC_CMD_LOOPBACK_XGMII_WS 0x13 */ +/* MC_CMD_LOOPBACK_XGMII_WS 0x13 */ /* enum: XAUI Wireside. */ -/* MC_CMD_LOOPBACK_XAUI_WS 0x14 */ +/* MC_CMD_LOOPBACK_XAUI_WS 0x14 */ /* enum: XAUI Wireside Far. */ -/* MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15 */ +/* MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15 */ /* enum: XAUI Wireside near. */ -/* MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16 */ +/* MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16 */ /* enum: GMII Wireside. */ -/* MC_CMD_LOOPBACK_GMII_WS 0x17 */ +/* MC_CMD_LOOPBACK_GMII_WS 0x17 */ /* enum: XFI Wireside. */ -/* MC_CMD_LOOPBACK_XFI_WS 0x18 */ +/* MC_CMD_LOOPBACK_XFI_WS 0x18 */ /* enum: XFI Wireside Far. */ -/* MC_CMD_LOOPBACK_XFI_WS_FAR 0x19 */ +/* MC_CMD_LOOPBACK_XFI_WS_FAR 0x19 */ /* enum: PhyXS Wireside. */ -/* MC_CMD_LOOPBACK_PHYXS_WS 0x1a */ +/* MC_CMD_LOOPBACK_PHYXS_WS 0x1a */ /* enum: PMA lanes MAC-Serdes. */ -/* MC_CMD_LOOPBACK_PMA_INT 0x1b */ +/* MC_CMD_LOOPBACK_PMA_INT 0x1b */ /* enum: KR Serdes Parallel (Encoder). */ -/* MC_CMD_LOOPBACK_SD_NEAR 0x1c */ +/* MC_CMD_LOOPBACK_SD_NEAR 0x1c */ /* enum: KR Serdes Serial. */ -/* MC_CMD_LOOPBACK_SD_FAR 0x1d */ +/* MC_CMD_LOOPBACK_SD_FAR 0x1d */ /* enum: PMA lanes MAC-Serdes Wireside. */ -/* MC_CMD_LOOPBACK_PMA_INT_WS 0x1e */ +/* MC_CMD_LOOPBACK_PMA_INT_WS 0x1e */ /* enum: KR Serdes Parallel Wireside (Full PCS). */ -/* MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f */ +/* MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f */ /* enum: KR Serdes Parallel Wireside (Sym Aligner to TX). */ -/* MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20 */ +/* MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20 */ /* enum: KR Serdes Parallel Wireside (Deserializer to Serializer). */ -/* MC_CMD_LOOPBACK_SD_FEP_WS 0x21 */ +/* MC_CMD_LOOPBACK_SD_FEP_WS 0x21 */ /* enum: KR Serdes Serial Wireside. */ -/* MC_CMD_LOOPBACK_SD_FES_WS 0x22 */ +/* MC_CMD_LOOPBACK_SD_FES_WS 0x22 */ /* enum: Near side of AOE Siena side port */ -/* MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23 */ +/* MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23 */ /* enum: Medford Wireside datapath loopback */ -/* MC_CMD_LOOPBACK_DATA_WS 0x24 */ +/* MC_CMD_LOOPBACK_DATA_WS 0x24 */ /* enum: Force link up without setting up any physical loopback (snapper use * only) */ -/* MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25 */ +/* MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25 */ /* Supported loopbacks. */ #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_1G_OFST 8 #define MC_CMD_GET_LOOPBACK_MODES_OUT_V2_1G_LEN 8 @@ -3701,9 +3737,9 @@ /* Set LED state. */ #define MC_CMD_SET_ID_LED_IN_STATE_OFST 0 #define MC_CMD_SET_ID_LED_IN_STATE_LEN 4 -#define MC_CMD_LED_OFF 0x0 /* enum */ -#define MC_CMD_LED_ON 0x1 /* enum */ -#define MC_CMD_LED_DEFAULT 0x2 /* enum */ +#define MC_CMD_LED_OFF 0x0 /* enum */ +#define MC_CMD_LED_ON 0x1 /* enum */ +#define MC_CMD_LED_DEFAULT 0x2 /* enum */ /* MC_CMD_SET_ID_LED_OUT msgresponse */ #define MC_CMD_SET_ID_LED_OUT_LEN 0 @@ -3855,53 +3891,53 @@ #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_LEN 4 #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_PHY_NSTATS /* enum: OUI. */ -#define MC_CMD_OUI 0x0 +#define MC_CMD_OUI 0x0 /* enum: PMA-PMD Link Up. */ -#define MC_CMD_PMA_PMD_LINK_UP 0x1 +#define MC_CMD_PMA_PMD_LINK_UP 0x1 /* enum: PMA-PMD RX Fault. */ -#define MC_CMD_PMA_PMD_RX_FAULT 0x2 +#define MC_CMD_PMA_PMD_RX_FAULT 0x2 /* enum: PMA-PMD TX Fault. */ -#define MC_CMD_PMA_PMD_TX_FAULT 0x3 +#define MC_CMD_PMA_PMD_TX_FAULT 0x3 /* enum: PMA-PMD Signal */ -#define MC_CMD_PMA_PMD_SIGNAL 0x4 +#define MC_CMD_PMA_PMD_SIGNAL 0x4 /* enum: PMA-PMD SNR A. */ -#define MC_CMD_PMA_PMD_SNR_A 0x5 +#define MC_CMD_PMA_PMD_SNR_A 0x5 /* enum: PMA-PMD SNR B. */ -#define MC_CMD_PMA_PMD_SNR_B 0x6 +#define MC_CMD_PMA_PMD_SNR_B 0x6 /* enum: PMA-PMD SNR C. */ -#define MC_CMD_PMA_PMD_SNR_C 0x7 +#define MC_CMD_PMA_PMD_SNR_C 0x7 /* enum: PMA-PMD SNR D. */ -#define MC_CMD_PMA_PMD_SNR_D 0x8 +#define MC_CMD_PMA_PMD_SNR_D 0x8 /* enum: PCS Link Up. */ -#define MC_CMD_PCS_LINK_UP 0x9 +#define MC_CMD_PCS_LINK_UP 0x9 /* enum: PCS RX Fault. */ -#define MC_CMD_PCS_RX_FAULT 0xa +#define MC_CMD_PCS_RX_FAULT 0xa /* enum: PCS TX Fault. */ -#define MC_CMD_PCS_TX_FAULT 0xb +#define MC_CMD_PCS_TX_FAULT 0xb /* enum: PCS BER. */ -#define MC_CMD_PCS_BER 0xc +#define MC_CMD_PCS_BER 0xc /* enum: PCS Block Errors. */ -#define MC_CMD_PCS_BLOCK_ERRORS 0xd +#define MC_CMD_PCS_BLOCK_ERRORS 0xd /* enum: PhyXS Link Up. */ -#define MC_CMD_PHYXS_LINK_UP 0xe +#define MC_CMD_PHYXS_LINK_UP 0xe /* enum: PhyXS RX Fault. */ -#define MC_CMD_PHYXS_RX_FAULT 0xf +#define MC_CMD_PHYXS_RX_FAULT 0xf /* enum: PhyXS TX Fault. */ -#define MC_CMD_PHYXS_TX_FAULT 0x10 +#define MC_CMD_PHYXS_TX_FAULT 0x10 /* enum: PhyXS Align. */ -#define MC_CMD_PHYXS_ALIGN 0x11 +#define MC_CMD_PHYXS_ALIGN 0x11 /* enum: PhyXS Sync. */ -#define MC_CMD_PHYXS_SYNC 0x12 +#define MC_CMD_PHYXS_SYNC 0x12 /* enum: AN link-up. */ -#define MC_CMD_AN_LINK_UP 0x13 +#define MC_CMD_AN_LINK_UP 0x13 /* enum: AN Complete. */ -#define MC_CMD_AN_COMPLETE 0x14 +#define MC_CMD_AN_COMPLETE 0x14 /* enum: AN 10GBaseT Status. */ -#define MC_CMD_AN_10GBT_STATUS 0x15 +#define MC_CMD_AN_10GBT_STATUS 0x15 /* enum: Clause 22 Link-Up. */ -#define MC_CMD_CL22_LINK_UP 0x16 +#define MC_CMD_CL22_LINK_UP 0x16 /* enum: (Last entry) */ -#define MC_CMD_PHY_NSTATS 0x17 +#define MC_CMD_PHY_NSTATS 0x17 /***********************************/ @@ -3964,139 +4000,139 @@ #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_LO_OFST 0 #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_HI_OFST 4 #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS -#define MC_CMD_MAC_GENERATION_START 0x0 /* enum */ -#define MC_CMD_MAC_DMABUF_START 0x1 /* enum */ -#define MC_CMD_MAC_TX_PKTS 0x1 /* enum */ -#define MC_CMD_MAC_TX_PAUSE_PKTS 0x2 /* enum */ -#define MC_CMD_MAC_TX_CONTROL_PKTS 0x3 /* enum */ -#define MC_CMD_MAC_TX_UNICAST_PKTS 0x4 /* enum */ -#define MC_CMD_MAC_TX_MULTICAST_PKTS 0x5 /* enum */ -#define MC_CMD_MAC_TX_BROADCAST_PKTS 0x6 /* enum */ -#define MC_CMD_MAC_TX_BYTES 0x7 /* enum */ -#define MC_CMD_MAC_TX_BAD_BYTES 0x8 /* enum */ -#define MC_CMD_MAC_TX_LT64_PKTS 0x9 /* enum */ -#define MC_CMD_MAC_TX_64_PKTS 0xa /* enum */ -#define MC_CMD_MAC_TX_65_TO_127_PKTS 0xb /* enum */ -#define MC_CMD_MAC_TX_128_TO_255_PKTS 0xc /* enum */ -#define MC_CMD_MAC_TX_256_TO_511_PKTS 0xd /* enum */ -#define MC_CMD_MAC_TX_512_TO_1023_PKTS 0xe /* enum */ -#define MC_CMD_MAC_TX_1024_TO_15XX_PKTS 0xf /* enum */ -#define MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS 0x10 /* enum */ -#define MC_CMD_MAC_TX_GTJUMBO_PKTS 0x11 /* enum */ -#define MC_CMD_MAC_TX_BAD_FCS_PKTS 0x12 /* enum */ -#define MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS 0x13 /* enum */ -#define MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS 0x14 /* enum */ -#define MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS 0x15 /* enum */ -#define MC_CMD_MAC_TX_LATE_COLLISION_PKTS 0x16 /* enum */ -#define MC_CMD_MAC_TX_DEFERRED_PKTS 0x17 /* enum */ -#define MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS 0x18 /* enum */ -#define MC_CMD_MAC_TX_NON_TCPUDP_PKTS 0x19 /* enum */ -#define MC_CMD_MAC_TX_MAC_SRC_ERR_PKTS 0x1a /* enum */ -#define MC_CMD_MAC_TX_IP_SRC_ERR_PKTS 0x1b /* enum */ -#define MC_CMD_MAC_RX_PKTS 0x1c /* enum */ -#define MC_CMD_MAC_RX_PAUSE_PKTS 0x1d /* enum */ -#define MC_CMD_MAC_RX_GOOD_PKTS 0x1e /* enum */ -#define MC_CMD_MAC_RX_CONTROL_PKTS 0x1f /* enum */ -#define MC_CMD_MAC_RX_UNICAST_PKTS 0x20 /* enum */ -#define MC_CMD_MAC_RX_MULTICAST_PKTS 0x21 /* enum */ -#define MC_CMD_MAC_RX_BROADCAST_PKTS 0x22 /* enum */ -#define MC_CMD_MAC_RX_BYTES 0x23 /* enum */ -#define MC_CMD_MAC_RX_BAD_BYTES 0x24 /* enum */ -#define MC_CMD_MAC_RX_64_PKTS 0x25 /* enum */ -#define MC_CMD_MAC_RX_65_TO_127_PKTS 0x26 /* enum */ -#define MC_CMD_MAC_RX_128_TO_255_PKTS 0x27 /* enum */ -#define MC_CMD_MAC_RX_256_TO_511_PKTS 0x28 /* enum */ -#define MC_CMD_MAC_RX_512_TO_1023_PKTS 0x29 /* enum */ -#define MC_CMD_MAC_RX_1024_TO_15XX_PKTS 0x2a /* enum */ -#define MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS 0x2b /* enum */ -#define MC_CMD_MAC_RX_GTJUMBO_PKTS 0x2c /* enum */ -#define MC_CMD_MAC_RX_UNDERSIZE_PKTS 0x2d /* enum */ -#define MC_CMD_MAC_RX_BAD_FCS_PKTS 0x2e /* enum */ -#define MC_CMD_MAC_RX_OVERFLOW_PKTS 0x2f /* enum */ -#define MC_CMD_MAC_RX_FALSE_CARRIER_PKTS 0x30 /* enum */ -#define MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS 0x31 /* enum */ -#define MC_CMD_MAC_RX_ALIGN_ERROR_PKTS 0x32 /* enum */ -#define MC_CMD_MAC_RX_LENGTH_ERROR_PKTS 0x33 /* enum */ -#define MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS 0x34 /* enum */ -#define MC_CMD_MAC_RX_JABBER_PKTS 0x35 /* enum */ -#define MC_CMD_MAC_RX_NODESC_DROPS 0x36 /* enum */ -#define MC_CMD_MAC_RX_LANES01_CHAR_ERR 0x37 /* enum */ -#define MC_CMD_MAC_RX_LANES23_CHAR_ERR 0x38 /* enum */ -#define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */ -#define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */ -#define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */ +#define MC_CMD_MAC_GENERATION_START 0x0 /* enum */ +#define MC_CMD_MAC_DMABUF_START 0x1 /* enum */ +#define MC_CMD_MAC_TX_PKTS 0x1 /* enum */ +#define MC_CMD_MAC_TX_PAUSE_PKTS 0x2 /* enum */ +#define MC_CMD_MAC_TX_CONTROL_PKTS 0x3 /* enum */ +#define MC_CMD_MAC_TX_UNICAST_PKTS 0x4 /* enum */ +#define MC_CMD_MAC_TX_MULTICAST_PKTS 0x5 /* enum */ +#define MC_CMD_MAC_TX_BROADCAST_PKTS 0x6 /* enum */ +#define MC_CMD_MAC_TX_BYTES 0x7 /* enum */ +#define MC_CMD_MAC_TX_BAD_BYTES 0x8 /* enum */ +#define MC_CMD_MAC_TX_LT64_PKTS 0x9 /* enum */ +#define MC_CMD_MAC_TX_64_PKTS 0xa /* enum */ +#define MC_CMD_MAC_TX_65_TO_127_PKTS 0xb /* enum */ +#define MC_CMD_MAC_TX_128_TO_255_PKTS 0xc /* enum */ +#define MC_CMD_MAC_TX_256_TO_511_PKTS 0xd /* enum */ +#define MC_CMD_MAC_TX_512_TO_1023_PKTS 0xe /* enum */ +#define MC_CMD_MAC_TX_1024_TO_15XX_PKTS 0xf /* enum */ +#define MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS 0x10 /* enum */ +#define MC_CMD_MAC_TX_GTJUMBO_PKTS 0x11 /* enum */ +#define MC_CMD_MAC_TX_BAD_FCS_PKTS 0x12 /* enum */ +#define MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS 0x13 /* enum */ +#define MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS 0x14 /* enum */ +#define MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS 0x15 /* enum */ +#define MC_CMD_MAC_TX_LATE_COLLISION_PKTS 0x16 /* enum */ +#define MC_CMD_MAC_TX_DEFERRED_PKTS 0x17 /* enum */ +#define MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS 0x18 /* enum */ +#define MC_CMD_MAC_TX_NON_TCPUDP_PKTS 0x19 /* enum */ +#define MC_CMD_MAC_TX_MAC_SRC_ERR_PKTS 0x1a /* enum */ +#define MC_CMD_MAC_TX_IP_SRC_ERR_PKTS 0x1b /* enum */ +#define MC_CMD_MAC_RX_PKTS 0x1c /* enum */ +#define MC_CMD_MAC_RX_PAUSE_PKTS 0x1d /* enum */ +#define MC_CMD_MAC_RX_GOOD_PKTS 0x1e /* enum */ +#define MC_CMD_MAC_RX_CONTROL_PKTS 0x1f /* enum */ +#define MC_CMD_MAC_RX_UNICAST_PKTS 0x20 /* enum */ +#define MC_CMD_MAC_RX_MULTICAST_PKTS 0x21 /* enum */ +#define MC_CMD_MAC_RX_BROADCAST_PKTS 0x22 /* enum */ +#define MC_CMD_MAC_RX_BYTES 0x23 /* enum */ +#define MC_CMD_MAC_RX_BAD_BYTES 0x24 /* enum */ +#define MC_CMD_MAC_RX_64_PKTS 0x25 /* enum */ +#define MC_CMD_MAC_RX_65_TO_127_PKTS 0x26 /* enum */ +#define MC_CMD_MAC_RX_128_TO_255_PKTS 0x27 /* enum */ +#define MC_CMD_MAC_RX_256_TO_511_PKTS 0x28 /* enum */ +#define MC_CMD_MAC_RX_512_TO_1023_PKTS 0x29 /* enum */ +#define MC_CMD_MAC_RX_1024_TO_15XX_PKTS 0x2a /* enum */ +#define MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS 0x2b /* enum */ +#define MC_CMD_MAC_RX_GTJUMBO_PKTS 0x2c /* enum */ +#define MC_CMD_MAC_RX_UNDERSIZE_PKTS 0x2d /* enum */ +#define MC_CMD_MAC_RX_BAD_FCS_PKTS 0x2e /* enum */ +#define MC_CMD_MAC_RX_OVERFLOW_PKTS 0x2f /* enum */ +#define MC_CMD_MAC_RX_FALSE_CARRIER_PKTS 0x30 /* enum */ +#define MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS 0x31 /* enum */ +#define MC_CMD_MAC_RX_ALIGN_ERROR_PKTS 0x32 /* enum */ +#define MC_CMD_MAC_RX_LENGTH_ERROR_PKTS 0x33 /* enum */ +#define MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS 0x34 /* enum */ +#define MC_CMD_MAC_RX_JABBER_PKTS 0x35 /* enum */ +#define MC_CMD_MAC_RX_NODESC_DROPS 0x36 /* enum */ +#define MC_CMD_MAC_RX_LANES01_CHAR_ERR 0x37 /* enum */ +#define MC_CMD_MAC_RX_LANES23_CHAR_ERR 0x38 /* enum */ +#define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */ +#define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */ +#define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */ /* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS * capability only. */ -#define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c +#define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c /* enum: PM discard_bb_overflow counter. Valid for EF10 with * PM_AND_RXDP_COUNTERS capability only. */ -#define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d +#define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d /* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS * capability only. */ -#define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e +#define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e /* enum: PM discard_vfifo_full counter. Valid for EF10 with * PM_AND_RXDP_COUNTERS capability only. */ -#define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f +#define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f /* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS * capability only. */ -#define MC_CMD_MAC_PM_TRUNC_QBB 0x40 +#define MC_CMD_MAC_PM_TRUNC_QBB 0x40 /* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS * capability only. */ -#define MC_CMD_MAC_PM_DISCARD_QBB 0x41 +#define MC_CMD_MAC_PM_DISCARD_QBB 0x41 /* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS * capability only. */ -#define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42 +#define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42 /* enum: RXDP counter: Number of packets dropped due to the queue being * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. */ -#define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43 +#define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43 /* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10 * with PM_AND_RXDP_COUNTERS capability only. */ -#define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45 +#define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45 /* enum: RXDP counter: Number of non-host packets. Valid for EF10 with * PM_AND_RXDP_COUNTERS capability only. */ -#define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46 +#define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46 /* enum: RXDP counter: Number of times an hlb descriptor fetch was performed. * Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. */ -#define MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS 0x47 +#define MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS 0x47 /* enum: RXDP counter: Number of times the DPCPU waited for an existing * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. */ -#define MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS 0x48 -#define MC_CMD_MAC_VADAPTER_RX_DMABUF_START 0x4c /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS 0x4c /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES 0x4d /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS 0x4e /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES 0x4f /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS 0x50 /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES 0x51 /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS 0x52 /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_BAD_BYTES 0x53 /* enum */ -#define MC_CMD_MAC_VADAPTER_RX_OVERFLOW 0x54 /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_DMABUF_START 0x57 /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS 0x57 /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES 0x58 /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS 0x59 /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES 0x5a /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS 0x5b /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES 0x5c /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS 0x5d /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_BAD_BYTES 0x5e /* enum */ -#define MC_CMD_MAC_VADAPTER_TX_OVERFLOW 0x5f /* enum */ +#define MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS 0x48 +#define MC_CMD_MAC_VADAPTER_RX_DMABUF_START 0x4c /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS 0x4c /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES 0x4d /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS 0x4e /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES 0x4f /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS 0x50 /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES 0x51 /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS 0x52 /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_BAD_BYTES 0x53 /* enum */ +#define MC_CMD_MAC_VADAPTER_RX_OVERFLOW 0x54 /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_DMABUF_START 0x57 /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS 0x57 /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES 0x58 /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS 0x59 /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES 0x5a /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS 0x5b /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES 0x5c /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS 0x5d /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_BAD_BYTES 0x5e /* enum */ +#define MC_CMD_MAC_VADAPTER_TX_OVERFLOW 0x5f /* enum */ /* enum: Start of GMAC stats buffer space, for Siena only. */ -#define MC_CMD_GMAC_DMABUF_START 0x40 +#define MC_CMD_GMAC_DMABUF_START 0x40 /* enum: End of GMAC stats buffer space, for Siena only. */ -#define MC_CMD_GMAC_DMABUF_END 0x5f +#define MC_CMD_GMAC_DMABUF_END 0x5f /* enum: GENERATION_END value, used together with GENERATION_START to verify * consistency of DMAd data. For legacy firmware / drivers without extended * stats (more precisely, when DMA_LEN == MC_CMD_MAC_NSTATS * @@ -4108,7 +4144,7 @@ * sizeof(uint64_t). See SF-109306-TC, Section 9.2 for details. */ #define MC_CMD_MAC_GENERATION_END 0x60 -#define MC_CMD_MAC_NSTATS 0x61 /* enum */ +#define MC_CMD_MAC_NSTATS 0x61 /* enum */ /* MC_CMD_MAC_STATS_V2_OUT_DMA msgresponse */ #define MC_CMD_MAC_STATS_V2_OUT_DMA_LEN 0 @@ -4121,25 +4157,25 @@ #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_STATISTICS_HI_OFST 4 #define MC_CMD_MAC_STATS_V2_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS_V2 /* enum: Start of FEC stats buffer space, Medford2 and up */ -#define MC_CMD_MAC_FEC_DMABUF_START 0x61 +#define MC_CMD_MAC_FEC_DMABUF_START 0x61 /* enum: Number of uncorrected FEC codewords on link (RS-FEC only for Medford2) */ -#define MC_CMD_MAC_FEC_UNCORRECTED_ERRORS 0x61 +#define MC_CMD_MAC_FEC_UNCORRECTED_ERRORS 0x61 /* enum: Number of corrected FEC codewords on link (RS-FEC only for Medford2) */ -#define MC_CMD_MAC_FEC_CORRECTED_ERRORS 0x62 +#define MC_CMD_MAC_FEC_CORRECTED_ERRORS 0x62 /* enum: Number of corrected 10-bit symbol errors, lane 0 (RS-FEC only) */ -#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE0 0x63 +#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE0 0x63 /* enum: Number of corrected 10-bit symbol errors, lane 1 (RS-FEC only) */ -#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE1 0x64 +#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE1 0x64 /* enum: Number of corrected 10-bit symbol errors, lane 2 (RS-FEC only) */ -#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE2 0x65 +#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE2 0x65 /* enum: Number of corrected 10-bit symbol errors, lane 3 (RS-FEC only) */ -#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE3 0x66 +#define MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE3 0x66 /* enum: This includes the space at offset 103 which is the final * GENERATION_END in a MAC_STATS_V2 response and otherwise unused. */ -#define MC_CMD_MAC_NSTATS_V2 0x68 +#define MC_CMD_MAC_NSTATS_V2 0x68 /* Other enum values, see field(s): */ /* MC_CMD_MAC_STATS_OUT_NO_DMA/STATISTICS */ @@ -4154,66 +4190,66 @@ #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_HI_OFST 4 #define MC_CMD_MAC_STATS_V3_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS_V3 /* enum: Start of CTPIO stats buffer space, Medford2 and up */ -#define MC_CMD_MAC_CTPIO_DMABUF_START 0x68 +#define MC_CMD_MAC_CTPIO_DMABUF_START 0x68 /* enum: Number of CTPIO fallbacks because a DMA packet was in progress on the * target VI */ -#define MC_CMD_MAC_CTPIO_VI_BUSY_FALLBACK 0x68 +#define MC_CMD_MAC_CTPIO_VI_BUSY_FALLBACK 0x68 /* enum: Number of times a CTPIO send wrote beyond frame end (informational * only) */ -#define MC_CMD_MAC_CTPIO_LONG_WRITE_SUCCESS 0x69 +#define MC_CMD_MAC_CTPIO_LONG_WRITE_SUCCESS 0x69 /* enum: Number of CTPIO failures because the TX doorbell was written before * the end of the frame data */ -#define MC_CMD_MAC_CTPIO_MISSING_DBELL_FAIL 0x6a +#define MC_CMD_MAC_CTPIO_MISSING_DBELL_FAIL 0x6a /* enum: Number of CTPIO failures because the internal FIFO overflowed */ -#define MC_CMD_MAC_CTPIO_OVERFLOW_FAIL 0x6b +#define MC_CMD_MAC_CTPIO_OVERFLOW_FAIL 0x6b /* enum: Number of CTPIO failures because the host did not deliver data fast * enough to avoid MAC underflow */ -#define MC_CMD_MAC_CTPIO_UNDERFLOW_FAIL 0x6c +#define MC_CMD_MAC_CTPIO_UNDERFLOW_FAIL 0x6c /* enum: Number of CTPIO failures because the host did not deliver all the * frame data within the timeout */ -#define MC_CMD_MAC_CTPIO_TIMEOUT_FAIL 0x6d +#define MC_CMD_MAC_CTPIO_TIMEOUT_FAIL 0x6d /* enum: Number of CTPIO failures because the frame data arrived out of order * or with gaps */ -#define MC_CMD_MAC_CTPIO_NONCONTIG_WR_FAIL 0x6e +#define MC_CMD_MAC_CTPIO_NONCONTIG_WR_FAIL 0x6e /* enum: Number of CTPIO failures because the host started a new frame before * completing the previous one */ -#define MC_CMD_MAC_CTPIO_FRM_CLOBBER_FAIL 0x6f +#define MC_CMD_MAC_CTPIO_FRM_CLOBBER_FAIL 0x6f /* enum: Number of CTPIO failures because a write was not a multiple of 32 bits * or not 32-bit aligned */ -#define MC_CMD_MAC_CTPIO_INVALID_WR_FAIL 0x70 +#define MC_CMD_MAC_CTPIO_INVALID_WR_FAIL 0x70 /* enum: Number of CTPIO fallbacks because another VI on the same port was * sending a CTPIO frame */ -#define MC_CMD_MAC_CTPIO_VI_CLOBBER_FALLBACK 0x71 +#define MC_CMD_MAC_CTPIO_VI_CLOBBER_FALLBACK 0x71 /* enum: Number of CTPIO fallbacks because target VI did not have CTPIO enabled */ -#define MC_CMD_MAC_CTPIO_UNQUALIFIED_FALLBACK 0x72 +#define MC_CMD_MAC_CTPIO_UNQUALIFIED_FALLBACK 0x72 /* enum: Number of CTPIO fallbacks because length in header was less than 29 * bytes */ -#define MC_CMD_MAC_CTPIO_RUNT_FALLBACK 0x73 +#define MC_CMD_MAC_CTPIO_RUNT_FALLBACK 0x73 /* enum: Total number of successful CTPIO sends on this port */ -#define MC_CMD_MAC_CTPIO_SUCCESS 0x74 +#define MC_CMD_MAC_CTPIO_SUCCESS 0x74 /* enum: Total number of CTPIO fallbacks on this port */ -#define MC_CMD_MAC_CTPIO_FALLBACK 0x75 +#define MC_CMD_MAC_CTPIO_FALLBACK 0x75 /* enum: Total number of CTPIO poisoned frames on this port, whether erased or * not */ -#define MC_CMD_MAC_CTPIO_POISON 0x76 +#define MC_CMD_MAC_CTPIO_POISON 0x76 /* enum: Total number of CTPIO erased frames on this port */ -#define MC_CMD_MAC_CTPIO_ERASE 0x77 +#define MC_CMD_MAC_CTPIO_ERASE 0x77 /* enum: This includes the space at offset 120 which is the final * GENERATION_END in a MAC_STATS_V3 response and otherwise unused. */ -#define MC_CMD_MAC_NSTATS_V3 0x79 +#define MC_CMD_MAC_NSTATS_V3 0x79 /* Other enum values, see field(s): */ /* MC_CMD_MAC_STATS_V2_OUT_NO_DMA/STATISTICS */ @@ -4323,25 +4359,25 @@ #define MC_CMD_WOL_FILTER_SET_IN_LEN 192 #define MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 #define MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_LEN 4 -#define MC_CMD_FILTER_MODE_SIMPLE 0x0 /* enum */ +#define MC_CMD_FILTER_MODE_SIMPLE 0x0 /* enum */ #define MC_CMD_FILTER_MODE_STRUCTURED 0xffffffff /* enum */ /* A type value of 1 is unused. */ #define MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 #define MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_LEN 4 /* enum: Magic */ -#define MC_CMD_WOL_TYPE_MAGIC 0x0 +#define MC_CMD_WOL_TYPE_MAGIC 0x0 /* enum: MS Windows Magic */ #define MC_CMD_WOL_TYPE_WIN_MAGIC 0x2 /* enum: IPv4 Syn */ -#define MC_CMD_WOL_TYPE_IPV4_SYN 0x3 +#define MC_CMD_WOL_TYPE_IPV4_SYN 0x3 /* enum: IPv6 Syn */ -#define MC_CMD_WOL_TYPE_IPV6_SYN 0x4 +#define MC_CMD_WOL_TYPE_IPV6_SYN 0x4 /* enum: Bitmap */ -#define MC_CMD_WOL_TYPE_BITMAP 0x5 +#define MC_CMD_WOL_TYPE_BITMAP 0x5 /* enum: Link */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Nov 29 06:43:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBE831153A40; Thu, 29 Nov 2018 06:43:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 749577743F; Thu, 29 Nov 2018 06:43:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C57BF15F64; Thu, 29 Nov 2018 06:43:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6hZg4025057; Thu, 29 Nov 2018 06:43:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6hZgq025054; Thu, 29 Nov 2018 06:43:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290643.wAT6hZgq025054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341194 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 749577743F X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:43:39 -0000 Author: arybchik Date: Thu Nov 29 06:43:34 2018 New Revision: 341194 URL: https://svnweb.freebsd.org/changeset/base/341194 Log: sfxge(4): add firmware subvariant aware driver option FW subvariants allow to tweak NIC global features. For example, if no drivers require checksumming on transmit, it may be disabled in FW to increase packet rate. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18225 Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Nov 29 06:43:23 2018 (r341193) +++ head/sys/dev/sfxge/common/efsys.h Thu Nov 29 06:43:34 2018 (r341194) @@ -287,6 +287,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_TUNNEL 0 +#define EFSYS_OPT_FW_SUBVARIANT_AWARE 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t; Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Thu Nov 29 06:43:23 2018 (r341193) +++ head/sys/dev/sfxge/common/efx_check.h Thu Nov 29 06:43:34 2018 (r341194) @@ -377,4 +377,11 @@ # endif #endif /* EFSYS_OPT_TUNNEL */ +#if EFSYS_OPT_FW_SUBVARIANT_AWARE +/* Advertise that the driver is firmware subvariant aware */ +# if !(EFSYS_OPT_MEDFORD2) +# error "FW_SUBVARIANT_AWARE requires MEDFORD2" +# endif +#endif + #endif /* _SYS_EFX_CHECK_H */ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Nov 29 06:43:23 2018 (r341193) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Nov 29 06:43:34 2018 (r341194) @@ -1303,7 +1303,9 @@ efx_mcdi_drv_attach( * FULL_FEATURED datapath firmware type first and fall backs to * DONT_CARE datapath firmware type if MC_CMD_DRV_ATTACH fails. */ - MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_NEW_STATE, attach ? 1 : 0); + MCDI_IN_POPULATE_DWORD_2(req, DRV_ATTACH_IN_NEW_STATE, + DRV_ATTACH_IN_ATTACH, attach ? 1 : 0, + DRV_ATTACH_IN_SUBVARIANT_AWARE, EFSYS_OPT_FW_SUBVARIANT_AWARE); MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_UPDATE, 1); MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_FIRMWARE_ID, enp->efv); From owner-svn-src-head@freebsd.org Thu Nov 29 06:43:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B93B41153A84; Thu, 29 Nov 2018 06:43:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E1A277551; Thu, 29 Nov 2018 06:43:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BCB215F65; Thu, 29 Nov 2018 06:43:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6hlm0025116; Thu, 29 Nov 2018 06:43:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6hkxA025113; Thu, 29 Nov 2018 06:43:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290643.wAT6hkxA025113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341195 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E1A277551 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:43:50 -0000 Author: arybchik Date: Thu Nov 29 06:43:46 2018 New Revision: 341195 URL: https://svnweb.freebsd.org/changeset/base/341195 Log: sfxge(4): report no Tx checksum FW subvariant support Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18226 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:43:34 2018 (r341194) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:43:46 2018 (r341195) @@ -1135,6 +1135,12 @@ ef10_get_datapath_caps( else encp->enc_rx_var_packed_stream_supported = B_FALSE; + /* Check if the firmware supports FW subvariant w/o Tx checksumming */ + if (CAP_FLAGS2(req, FW_SUBVARIANT_NO_TX_CSUM)) + encp->enc_fw_subvariant_no_tx_csum_supported = B_TRUE; + else + encp->enc_fw_subvariant_no_tx_csum_supported = B_FALSE; + /* Check if the firmware supports set mac with running filters */ if (CAP_FLAGS1(req, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED)) encp->enc_allow_set_mac_with_installed_filters = B_TRUE; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:43:34 2018 (r341194) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:43:46 2018 (r341195) @@ -1287,6 +1287,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_init_evq_v2_supported; boolean_t enc_rx_packed_stream_supported; boolean_t enc_rx_var_packed_stream_supported; + boolean_t enc_fw_subvariant_no_tx_csum_supported; boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; uint32_t enc_tunnel_encapsulations_supported; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:43:34 2018 (r341194) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:43:46 2018 (r341195) @@ -178,6 +178,7 @@ siena_board_cfg( encp->enc_allow_set_mac_with_installed_filters = B_TRUE; encp->enc_rx_packed_stream_supported = B_FALSE; encp->enc_rx_var_packed_stream_supported = B_FALSE; + encp->enc_fw_subvariant_no_tx_csum_supported = B_FALSE; /* Siena supports two 10G ports, and 8 lanes of PCIe Gen2 */ encp->enc_required_pcie_bandwidth_mbps = 2 * 10000; From owner-svn-src-head@freebsd.org Thu Nov 29 06:44:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C9281153ADF; Thu, 29 Nov 2018 06:44:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D651C77680; Thu, 29 Nov 2018 06:44:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE0B15F67; Thu, 29 Nov 2018 06:43:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6hwU2025178; Thu, 29 Nov 2018 06:43:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6hw5A025174; Thu, 29 Nov 2018 06:43:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290643.wAT6hw5A025174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341196 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D651C77680 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:44:01 -0000 Author: arybchik Date: Thu Nov 29 06:43:57 2018 New Revision: 341196 URL: https://svnweb.freebsd.org/changeset/base/341196 Log: sfxge(4): support FW subvariant choice If DPDK application or OS does not need checksumming on transmit, it may be disabled in firmware to achieve higher packet rates. Choice must be done before VIS allocation and is allowed if no other non-preboot and firmware subvariant-unaware drivers are attached. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18227 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:43:46 2018 (r341195) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:43:57 2018 (r341196) @@ -1193,6 +1193,22 @@ ef10_get_privilege_mask( __in efx_nic_t *enp, __out uint32_t *maskp); +#if EFSYS_OPT_FW_SUBVARIANT_AWARE + +extern __checkReturn efx_rc_t +efx_mcdi_get_nic_global( + __in efx_nic_t *enp, + __in uint32_t key, + __out uint32_t *valuep); + +extern __checkReturn efx_rc_t +efx_mcdi_set_nic_global( + __in efx_nic_t *enp, + __in uint32_t key, + __in uint32_t value); + +#endif /* EFSYS_OPT_FW_SUBVARIANT_AWARE */ + #if EFSYS_OPT_RX_PACKED_STREAM Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:43:46 2018 (r341195) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:43:57 2018 (r341196) @@ -2324,5 +2324,87 @@ fail1: #endif /* EFSYS_OPT_DIAG */ +#if EFSYS_OPT_FW_SUBVARIANT_AWARE + + __checkReturn efx_rc_t +efx_mcdi_get_nic_global( + __in efx_nic_t *enp, + __in uint32_t key, + __out uint32_t *valuep) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_NIC_GLOBAL_IN_LEN, + MC_CMD_GET_NIC_GLOBAL_OUT_LEN)]; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_NIC_GLOBAL; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_NIC_GLOBAL_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_NIC_GLOBAL_OUT_LEN; + + MCDI_IN_SET_DWORD(req, GET_NIC_GLOBAL_IN_KEY, key); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used != MC_CMD_GET_NIC_GLOBAL_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + *valuep = MCDI_OUT_DWORD(req, GET_NIC_GLOBAL_OUT_VALUE); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_mcdi_set_nic_global( + __in efx_nic_t *enp, + __in uint32_t key, + __in uint32_t value) +{ + efx_mcdi_req_t req; + uint8_t payload[MC_CMD_SET_NIC_GLOBAL_IN_LEN]; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_SET_NIC_GLOBAL; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_SET_NIC_GLOBAL_IN_LEN; + req.emr_out_buf = NULL; + req.emr_out_length = 0; + + MCDI_IN_SET_DWORD(req, SET_NIC_GLOBAL_IN_KEY, key); + MCDI_IN_SET_DWORD(req, SET_NIC_GLOBAL_IN_VALUE, value); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_FW_SUBVARIANT_AWARE */ #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:43:46 2018 (r341195) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:43:57 2018 (r341196) @@ -2891,6 +2891,38 @@ efx_tunnel_reconfigure( #endif /* EFSYS_OPT_TUNNEL */ +#if EFSYS_OPT_FW_SUBVARIANT_AWARE + +/** + * Firmware subvariant choice options. + * + * It may be switched to no Tx checksum if attached drivers are either + * preboot or firmware subvariant aware and no VIS are allocated. + * If may be always switched to default explicitly using set request or + * implicitly if unaware driver is attaching. If switching is done when + * a driver is attached, it gets MC_REBOOT event and should recreate its + * datapath. + * + * See SF-119419-TC DPDK Firmware Driver Interface and + * SF-109306-TC EF10 for Driver Writers for details. + */ +typedef enum efx_nic_fw_subvariant_e { + EFX_NIC_FW_SUBVARIANT_DEFAULT = 0, + EFX_NIC_FW_SUBVARIANT_NO_TX_CSUM = 1, + EFX_NIC_FW_SUBVARIANT_NTYPES +} efx_nic_fw_subvariant_t; + +extern __checkReturn efx_rc_t +efx_nic_get_fw_subvariant( + __in efx_nic_t *enp, + __out efx_nic_fw_subvariant_t *subvariantp); + +extern __checkReturn efx_rc_t +efx_nic_set_fw_subvariant( + __in efx_nic_t *enp, + __in efx_nic_fw_subvariant_t subvariant); + +#endif /* EFSYS_OPT_FW_SUBVARIANT_AWARE */ #ifdef __cplusplus } Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Nov 29 06:43:46 2018 (r341195) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Nov 29 06:43:57 2018 (r341196) @@ -976,6 +976,82 @@ fail1: return (rc); } +#if EFSYS_OPT_FW_SUBVARIANT_AWARE + + __checkReturn efx_rc_t +efx_nic_get_fw_subvariant( + __in efx_nic_t *enp, + __out efx_nic_fw_subvariant_t *subvariantp) +{ + efx_rc_t rc; + uint32_t value; + + rc = efx_mcdi_get_nic_global(enp, + MC_CMD_SET_NIC_GLOBAL_IN_FIRMWARE_SUBVARIANT, &value); + if (rc != 0) + goto fail1; + + /* Mapping is not required since values match MCDI */ + EFX_STATIC_ASSERT(EFX_NIC_FW_SUBVARIANT_DEFAULT == + MC_CMD_SET_NIC_GLOBAL_IN_FW_SUBVARIANT_DEFAULT); + EFX_STATIC_ASSERT(EFX_NIC_FW_SUBVARIANT_NO_TX_CSUM == + MC_CMD_SET_NIC_GLOBAL_IN_FW_SUBVARIANT_NO_TX_CSUM); + + switch (value) { + case MC_CMD_SET_NIC_GLOBAL_IN_FW_SUBVARIANT_DEFAULT: + case MC_CMD_SET_NIC_GLOBAL_IN_FW_SUBVARIANT_NO_TX_CSUM: + *subvariantp = value; + break; + default: + rc = EINVAL; + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_nic_set_fw_subvariant( + __in efx_nic_t *enp, + __in efx_nic_fw_subvariant_t subvariant) +{ + efx_rc_t rc; + + switch (subvariant) { + case EFX_NIC_FW_SUBVARIANT_DEFAULT: + case EFX_NIC_FW_SUBVARIANT_NO_TX_CSUM: + /* Mapping is not required since values match MCDI */ + break; + default: + rc = EINVAL; + goto fail1; + } + + rc = efx_mcdi_set_nic_global(enp, + MC_CMD_SET_NIC_GLOBAL_IN_FIRMWARE_SUBVARIANT, subvariant); + if (rc != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_FW_SUBVARIANT_AWARE */ __checkReturn efx_rc_t efx_nic_check_pcie_link_speed( From owner-svn-src-head@freebsd.org Thu Nov 29 06:44:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D71361153B3C; Thu, 29 Nov 2018 06:44:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 753BD777A8; Thu, 29 Nov 2018 06:44:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E424315F68; Thu, 29 Nov 2018 06:44:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6i9Ig025258; Thu, 29 Nov 2018 06:44:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6i90s025257; Thu, 29 Nov 2018 06:44:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290644.wAT6i90s025257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341197 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 753BD777A8 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:44:13 -0000 Author: arybchik Date: Thu Nov 29 06:44:09 2018 New Revision: 341197 URL: https://svnweb.freebsd.org/changeset/base/341197 Log: sfxge(4): fix comparison always true warning Loopback type used as bit index has efx_loopback_type_t type which is enum. clang complains that it is always true when it is compared with qword (64 bit) bits number boundary. Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18228 Modified: head/sys/dev/sfxge/common/efx_port.c Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Thu Nov 29 06:43:57 2018 (r341196) +++ head/sys/dev/sfxge/common/efx_port.c Thu Nov 29 06:44:09 2018 (r341197) @@ -149,7 +149,7 @@ efx_port_loopback_set( EFSYS_ASSERT(link_mode < EFX_LINK_NMODES); if (EFX_TEST_QWORD_BIT(encp->enc_loopback_types[link_mode], - loopback_type) == 0) { + (int)loopback_type) == 0) { rc = ENOTSUP; goto fail1; } From owner-svn-src-head@freebsd.org Thu Nov 29 06:44:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 443331153B99; Thu, 29 Nov 2018 06:44:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6BE0778D8; Thu, 29 Nov 2018 06:44:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6C0C15F6D; Thu, 29 Nov 2018 06:44:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6iKlM025314; Thu, 29 Nov 2018 06:44:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6iKSj025313; Thu, 29 Nov 2018 06:44:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290644.wAT6iKSj025313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341198 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6BE0778D8 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:44:24 -0000 Author: arybchik Date: Thu Nov 29 06:44:20 2018 New Revision: 341198 URL: https://svnweb.freebsd.org/changeset/base/341198 Log: sfxge(4): cope with clang warning on negative shift clang 4.0.1-6 on Ubuntu generates false positive warning that shift is negative. It is done regardless of the fact that the branch is not taken because of previous check. The warning is generate in EFX_INSERT_NATIVE32 used by EFX_INSERT_FIELD_NATIVE32. All similar cases are fixed as well. It is undesirable to suppress the warning completely. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18229 Modified: head/sys/dev/sfxge/common/efx_types.h Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Thu Nov 29 06:44:09 2018 (r341197) +++ head/sys/dev/sfxge/common/efx_types.h Thu Nov 29 06:44:20 2018 (r341198) @@ -357,6 +357,16 @@ extern int fix_lint; #endif /* + * Saturation arithmetic subtract with minimum equal to zero. + * + * Use saturating arithmetic to ensure a non-negative result. This + * avoids undefined behaviour (and compiler warnings) when used as a + * shift count. + */ +#define EFX_SSUB(_val, _sub) \ + ((_val) > (_sub) ? ((_val) - (_sub)) : 0) + +/* * Extract bit field portion [low,high) from the native-endian element * which contains bits [min,max). * @@ -375,8 +385,8 @@ extern int fix_lint; ((FIX_LINT(_low > _max) || FIX_LINT(_high < _min)) ? \ 0U : \ ((_low > _min) ? \ - ((_element) >> (_low - _min)) : \ - ((_element) << (_min - _low)))) + ((_element) >> EFX_SSUB(_low, _min)) : \ + ((_element) << EFX_SSUB(_min, _low)))) /* * Extract bit field portion [low,high) from the 64-bit little-endian @@ -565,29 +575,29 @@ extern int fix_lint; (((_low > _max) || (_high < _min)) ? \ 0U : \ ((_low > _min) ? \ - (((uint64_t)(_value)) << (_low - _min)) : \ - (((uint64_t)(_value)) >> (_min - _low)))) + (((uint64_t)(_value)) << EFX_SSUB(_low, _min)) :\ + (((uint64_t)(_value)) >> EFX_SSUB(_min, _low)))) #define EFX_INSERT_NATIVE32(_min, _max, _low, _high, _value) \ (((_low > _max) || (_high < _min)) ? \ 0U : \ ((_low > _min) ? \ - (((uint32_t)(_value)) << (_low - _min)) : \ - (((uint32_t)(_value)) >> (_min - _low)))) + (((uint32_t)(_value)) << EFX_SSUB(_low, _min)) :\ + (((uint32_t)(_value)) >> EFX_SSUB(_min, _low)))) #define EFX_INSERT_NATIVE16(_min, _max, _low, _high, _value) \ (((_low > _max) || (_high < _min)) ? \ 0U : \ (uint16_t)((_low > _min) ? \ - ((_value) << (_low - _min)) : \ - ((_value) >> (_min - _low)))) + ((_value) << EFX_SSUB(_low, _min)) : \ + ((_value) >> EFX_SSUB(_min, _low)))) #define EFX_INSERT_NATIVE8(_min, _max, _low, _high, _value) \ (((_low > _max) || (_high < _min)) ? \ 0U : \ (uint8_t)((_low > _min) ? \ - ((_value) << (_low - _min)) : \ - ((_value) >> (_min - _low)))) + ((_value) << EFX_SSUB(_low, _min)) : \ + ((_value) >> EFX_SSUB(_min, _low)))) /* * Construct bit field portion @@ -1316,22 +1326,22 @@ extern int fix_lint; #define EFX_SHIFT64(_bit, _base) \ (((_bit) >= (_base) && (_bit) < (_base) + 64) ? \ - ((uint64_t)1 << ((_bit) - (_base))) : \ + ((uint64_t)1 << EFX_SSUB((_bit), (_base))) : \ 0U) #define EFX_SHIFT32(_bit, _base) \ (((_bit) >= (_base) && (_bit) < (_base) + 32) ? \ - ((uint32_t)1 << ((_bit) - (_base))) : \ + ((uint32_t)1 << EFX_SSUB((_bit),(_base))) : \ 0U) #define EFX_SHIFT16(_bit, _base) \ (((_bit) >= (_base) && (_bit) < (_base) + 16) ? \ - (uint16_t)(1 << ((_bit) - (_base))) : \ + (uint16_t)(1 << EFX_SSUB((_bit), (_base))) : \ 0U) #define EFX_SHIFT8(_bit, _base) \ (((_bit) >= (_base) && (_bit) < (_base) + 8) ? \ - (uint8_t)(1 << ((_bit) - (_base))) : \ + (uint8_t)(1 << EFX_SSUB((_bit), (_base))) : \ 0U) #define EFX_SET_OWORD_BIT64(_oword, _bit) \ From owner-svn-src-head@freebsd.org Thu Nov 29 06:44:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53A5E1153BF0; Thu, 29 Nov 2018 06:44:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDED377991; Thu, 29 Nov 2018 06:44:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1286615F82; Thu, 29 Nov 2018 06:44:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6iSAp025373; Thu, 29 Nov 2018 06:44:28 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6iS9D025370; Thu, 29 Nov 2018 06:44:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290644.wAT6iS9D025370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341199 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDED377991 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.484,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:44:31 -0000 Author: arybchik Date: Thu Nov 29 06:44:28 2018 New Revision: 341199 URL: https://svnweb.freebsd.org/changeset/base/341199 Log: sfxge(4): add a new means to control RSS hash Currently, libefx has no support for additional RSS modes available with later controllers. In order to support this, libefx should be able to list available hash configurations. This patch provides basic infrastructure for the new interface. The client drivers will be able to query the list of supported hash configurations for a particular hash algorithm. Also, it will be possible to configure hashing by means of new definitions. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18230 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:44:20 2018 (r341198) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:44:28 2018 (r341199) @@ -325,11 +325,32 @@ efx_mcdi_rss_context_set_flags( __in uint32_t rss_context, __in efx_rx_hash_type_t type) { + efx_rx_hash_type_t type_ipv4; + efx_rx_hash_type_t type_ipv4_tcp; + efx_rx_hash_type_t type_ipv6; + efx_rx_hash_type_t type_ipv6_tcp; efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN, MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN)]; efx_rc_t rc; + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV4_TCP_LBN == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_LBN); + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV4_TCP_WIDTH == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_WIDTH); + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV4_LBN == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_LBN); + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV4_WIDTH == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_WIDTH); + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV6_TCP_LBN == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_LBN); + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV6_TCP_WIDTH == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_WIDTH); + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV6_LBN == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_LBN); + EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV6_WIDTH == + MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_WIDTH); + if (rss_context == EF10_RSS_CONTEXT_INVALID) { rc = EINVAL; goto fail1; @@ -345,15 +366,20 @@ efx_mcdi_rss_context_set_flags( MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID, rss_context); + type_ipv4 = EFX_RX_HASH(IPV4, 2TUPLE) | EFX_RX_HASH(IPV4_TCP, 2TUPLE); + type_ipv4_tcp = EFX_RX_HASH(IPV4_TCP, 4TUPLE); + type_ipv6 = EFX_RX_HASH(IPV6, 2TUPLE) | EFX_RX_HASH(IPV6_TCP, 2TUPLE); + type_ipv6_tcp = EFX_RX_HASH(IPV6_TCP, 4TUPLE); + MCDI_IN_POPULATE_DWORD_4(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN, - (type & EFX_RX_HASH_IPV4) ? 1 : 0, + ((type & type_ipv4) == type_ipv4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN, - (type & EFX_RX_HASH_TCPIPV4) ? 1 : 0, + ((type & type_ipv4_tcp) == type_ipv4_tcp) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN, - (type & EFX_RX_HASH_IPV6) ? 1 : 0, + ((type & type_ipv6) == type_ipv6) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN, - (type & EFX_RX_HASH_TCPIPV6) ? 1 : 0); + ((type & type_ipv6_tcp) == type_ipv6_tcp) ? 1 : 0); efx_mcdi_execute(enp, &req); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:44:20 2018 (r341198) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:44:28 2018 (r341199) @@ -2098,11 +2098,30 @@ typedef enum efx_rx_hash_alg_e { EFX_RX_HASHALG_TOEPLITZ } efx_rx_hash_alg_t; +/* + * Legacy hash type flags. + * + * They represent standard tuples for distinct traffic classes. + */ #define EFX_RX_HASH_IPV4 (1U << 0) #define EFX_RX_HASH_TCPIPV4 (1U << 1) #define EFX_RX_HASH_IPV6 (1U << 2) #define EFX_RX_HASH_TCPIPV6 (1U << 3) +#define EFX_RX_HASH_LEGACY_MASK \ + (EFX_RX_HASH_IPV4 | \ + EFX_RX_HASH_TCPIPV4 | \ + EFX_RX_HASH_IPV6 | \ + EFX_RX_HASH_TCPIPV6) + +/* + * The type of the argument used by efx_rx_scale_mode_set() to + * provide a means for the client drivers to configure hashing. + * + * A properly constructed value can either be: + * - a combination of legacy flags + * - a combination of EFX_RX_HASH() flags + */ typedef unsigned int efx_rx_hash_type_t; typedef enum efx_rx_hash_support_e { @@ -2120,6 +2139,77 @@ typedef enum efx_rx_scale_context_type_e { EFX_RX_SCALE_EXCLUSIVE, /* Writable key/indirection table */ EFX_RX_SCALE_SHARED /* Read-only key/indirection table */ } efx_rx_scale_context_type_t; + +/* + * Traffic classes eligible for hash computation. + * + * Select packet headers used in computing the receive hash. + * This uses the same encoding as the RSS_MODES field of + * MC_CMD_RSS_CONTEXT_SET_FLAGS. + */ +#define EFX_RX_CLASS_IPV4_TCP_LBN 8 +#define EFX_RX_CLASS_IPV4_TCP_WIDTH 4 +#define EFX_RX_CLASS_IPV4_LBN 16 +#define EFX_RX_CLASS_IPV4_WIDTH 4 +#define EFX_RX_CLASS_IPV6_TCP_LBN 20 +#define EFX_RX_CLASS_IPV6_TCP_WIDTH 4 +#define EFX_RX_CLASS_IPV6_LBN 28 +#define EFX_RX_CLASS_IPV6_WIDTH 4 + +#define EFX_RX_NCLASSES 4 + +/* + * Ancillary flags used to construct generic hash tuples. + * This uses the same encoding as RSS_MODE_HASH_SELECTOR. + */ +#define EFX_RX_CLASS_HASH_SRC_ADDR (1U << 0) +#define EFX_RX_CLASS_HASH_DST_ADDR (1U << 1) +#define EFX_RX_CLASS_HASH_SRC_PORT (1U << 2) +#define EFX_RX_CLASS_HASH_DST_PORT (1U << 3) + +/* + * Generic hash tuples. + * + * They express combinations of packet fields + * which can contribute to the hash value for + * a particular traffic class. + */ +#define EFX_RX_CLASS_HASH_DISABLE 0 + +#define EFX_RX_CLASS_HASH_2TUPLE \ + (EFX_RX_CLASS_HASH_SRC_ADDR | \ + EFX_RX_CLASS_HASH_DST_ADDR) + +#define EFX_RX_CLASS_HASH_4TUPLE \ + (EFX_RX_CLASS_HASH_SRC_ADDR | \ + EFX_RX_CLASS_HASH_DST_ADDR | \ + EFX_RX_CLASS_HASH_SRC_PORT | \ + EFX_RX_CLASS_HASH_DST_PORT) + +#define EFX_RX_CLASS_HASH_NTUPLES 3 + +/* + * Hash flag constructor. + * + * Resulting flags encode hash tuples for specific traffic classes. + * The client drivers are encouraged to use these flags to form + * a hash type value. + */ +#define EFX_RX_HASH(_class, _tuple) \ + EFX_INSERT_FIELD_NATIVE32(0, 31, \ + EFX_RX_CLASS_##_class, EFX_RX_CLASS_HASH_##_tuple) + +/* + * The maximum number of EFX_RX_HASH() flags. + */ +#define EFX_RX_HASH_NFLAGS (EFX_RX_NCLASSES * EFX_RX_CLASS_HASH_NTUPLES) + +extern __checkReturn efx_rc_t +efx_rx_scale_hash_flags_get( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t hash_alg, + __inout_ecount(EFX_RX_HASH_NFLAGS) unsigned int *flagsp, + __out unsigned int *nflagsp); extern __checkReturn efx_rc_t efx_rx_hash_default_support_get( Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:44:20 2018 (r341198) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:44:28 2018 (r341199) @@ -323,6 +323,61 @@ fail1: #endif /* EFSYS_OPT_RX_SCATTER */ #if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +efx_rx_scale_hash_flags_get( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t hash_alg, + __inout_ecount(EFX_RX_HASH_NFLAGS) unsigned int *flagsp, + __out unsigned int *nflagsp) +{ + unsigned int *entryp = flagsp; + efx_rc_t rc; + + if (flagsp == NULL || nflagsp == NULL) { + rc = EINVAL; + goto fail1; + } + +#define LIST_FLAGS(_entryp, _class, _l4_hashing) \ + do { \ + if (_l4_hashing) \ + *(_entryp++) = EFX_RX_HASH(_class, 4TUPLE); \ + \ + *(_entryp++) = EFX_RX_HASH(_class, 2TUPLE); \ + *(_entryp++) = EFX_RX_HASH(_class, DISABLE); \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + + switch (hash_alg) { + case EFX_RX_HASHALG_TOEPLITZ: + LIST_FLAGS(entryp, IPV4_TCP, B_TRUE); + LIST_FLAGS(entryp, IPV6_TCP, B_TRUE); + LIST_FLAGS(entryp, IPV4, B_FALSE); + LIST_FLAGS(entryp, IPV6, B_FALSE); + break; + + default: + rc = EINVAL; + goto fail2; + } + +#undef LIST_FLAGS + + *nflagsp = (unsigned int)(entryp - flagsp); + EFSYS_ASSERT3U(*nflagsp, <=, EFX_RX_HASH_NFLAGS); + + return (0); + +fail2: + EFSYS_PROBE(fail2); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t efx_rx_hash_default_support_get( __in efx_nic_t *enp, @@ -454,19 +509,80 @@ efx_rx_scale_mode_set( __in boolean_t insert) { const efx_rx_ops_t *erxop = enp->en_erxop; + unsigned int type_flags[EFX_RX_HASH_NFLAGS]; + unsigned int type_nflags; + efx_rx_hash_type_t type_check; + unsigned int i; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); + /* + * Legacy flags and modern bits cannot be + * used at the same time in the hash type. + */ + if ((type & EFX_RX_HASH_LEGACY_MASK) && + (type & ~EFX_RX_HASH_LEGACY_MASK)) { + rc = EINVAL; + goto fail1; + } + + /* + * Translate legacy flags to the new representation + * so that chip-specific handlers will consider the + * new flags only. + */ + if (type & EFX_RX_HASH_IPV4) { + type |= EFX_RX_HASH(IPV4, 2TUPLE); + type |= EFX_RX_HASH(IPV4_TCP, 2TUPLE); + } + + if (type & EFX_RX_HASH_TCPIPV4) + type |= EFX_RX_HASH(IPV4_TCP, 4TUPLE); + + if (type & EFX_RX_HASH_IPV6) { + type |= EFX_RX_HASH(IPV6, 2TUPLE); + type |= EFX_RX_HASH(IPV6_TCP, 2TUPLE); + } + + if (type & EFX_RX_HASH_TCPIPV6) + type |= EFX_RX_HASH(IPV6_TCP, 4TUPLE); + + type &= ~EFX_RX_HASH_LEGACY_MASK; + type_check = type; + + /* + * Get the list of supported hash flags and sanitise the input. + */ + rc = efx_rx_scale_hash_flags_get(enp, alg, type_flags, &type_nflags); + if (rc != 0) + goto fail2; + + for (i = 0; i < type_nflags; ++i) { + if ((type_check & type_flags[i]) == type_flags[i]) + type_check &= ~(type_flags[i]); + } + + if (type_check != 0) { + rc = EINVAL; + goto fail3; + } + if (erxop->erxo_scale_mode_set != NULL) { if ((rc = erxop->erxo_scale_mode_set(enp, rss_context, alg, type, insert)) != 0) - goto fail1; + goto fail4; } return (0); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -806,7 +922,7 @@ siena_rx_scatter_enable( efx_rc_t rc; nbuf32 = buf_size / 32; - if ((nbuf32 == 0) || + IF ((NBUF32 == 0) || (nbuf32 >= (1 << FRF_BZ_RX_USR_BUF_SIZE_WIDTH)) || ((buf_size % 32) != 0)) { rc = EINVAL; @@ -910,6 +1026,10 @@ siena_rx_scale_mode_set( __in efx_rx_hash_type_t type, __in boolean_t insert) { + efx_rx_hash_type_t type_ipv4 = EFX_RX_HASH(IPV4, 2TUPLE); + efx_rx_hash_type_t type_ipv4_tcp = EFX_RX_HASH(IPV4_TCP, 4TUPLE); + efx_rx_hash_type_t type_ipv6 = EFX_RX_HASH(IPV6, 2TUPLE); + efx_rx_hash_type_t type_ipv6_tcp = EFX_RX_HASH(IPV6_TCP, 4TUPLE); efx_rc_t rc; if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { @@ -924,12 +1044,12 @@ siena_rx_scale_mode_set( case EFX_RX_HASHALG_TOEPLITZ: EFX_RX_TOEPLITZ_IPV4_HASH(enp, insert, - type & EFX_RX_HASH_IPV4, - type & EFX_RX_HASH_TCPIPV4); + (type & type_ipv4) == type_ipv4, + (type & type_ipv4_tcp) == type_ipv4_tcp); EFX_RX_TOEPLITZ_IPV6_HASH(enp, - type & EFX_RX_HASH_IPV6, - type & EFX_RX_HASH_TCPIPV6, + (type & type_ipv6) == type_ipv6, + (type & type_ipv6_tcp) == type_ipv6_tcp, rc); if (rc != 0) goto fail2; From owner-svn-src-head@freebsd.org Thu Nov 29 06:44:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FE351153C50; Thu, 29 Nov 2018 06:44:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07E3B77B01; Thu, 29 Nov 2018 06:44:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3116F15FA9; Thu, 29 Nov 2018 06:44:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6ifbO025434; Thu, 29 Nov 2018 06:44:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6ieUV025427; Thu, 29 Nov 2018 06:44:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290644.wAT6ieUV025427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341200 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 07E3B77B01 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.484,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:44:45 -0000 Author: arybchik Date: Thu Nov 29 06:44:39 2018 New Revision: 341200 URL: https://svnweb.freebsd.org/changeset/base/341200 Log: sfxge(4): support more RSS hash configurations Modern firmwares on EF10 adapters have support for more traffic classes eligible for hash computation. Also, it has become possible to adjust hashing per individual class and select distinct packet fields which will be able to contribute to the hash value. This patch adds support for the mentioned features. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18231 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:44:28 2018 (r341199) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:44:39 2018 (r341200) @@ -1068,6 +1068,12 @@ ef10_get_datapath_caps( } encp->enc_rx_prefix_size = 14; + /* Check if the firmware supports additional RSS modes */ + if (CAP_FLAGS1(req, ADDITIONAL_RSS_MODES)) + encp->enc_rx_scale_additional_modes_supported = B_TRUE; + else + encp->enc_rx_scale_additional_modes_supported = B_FALSE; + /* Check if the firmware supports TSO */ if (CAP_FLAGS1(req, TX_TSO)) encp->enc_fw_assisted_tso_enabled = B_TRUE; Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:44:28 2018 (r341199) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:44:39 2018 (r341200) @@ -325,10 +325,12 @@ efx_mcdi_rss_context_set_flags( __in uint32_t rss_context, __in efx_rx_hash_type_t type) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_rx_hash_type_t type_ipv4; efx_rx_hash_type_t type_ipv4_tcp; efx_rx_hash_type_t type_ipv6; efx_rx_hash_type_t type_ipv6_tcp; + efx_rx_hash_type_t modes; efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN, MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN)]; @@ -366,12 +368,35 @@ efx_mcdi_rss_context_set_flags( MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID, rss_context); - type_ipv4 = EFX_RX_HASH(IPV4, 2TUPLE) | EFX_RX_HASH(IPV4_TCP, 2TUPLE); + type_ipv4 = EFX_RX_HASH(IPV4, 2TUPLE) | EFX_RX_HASH(IPV4_TCP, 2TUPLE) | + EFX_RX_HASH(IPV4_UDP, 2TUPLE); type_ipv4_tcp = EFX_RX_HASH(IPV4_TCP, 4TUPLE); - type_ipv6 = EFX_RX_HASH(IPV6, 2TUPLE) | EFX_RX_HASH(IPV6_TCP, 2TUPLE); + type_ipv6 = EFX_RX_HASH(IPV6, 2TUPLE) | EFX_RX_HASH(IPV6_TCP, 2TUPLE) | + EFX_RX_HASH(IPV6_UDP, 2TUPLE); type_ipv6_tcp = EFX_RX_HASH(IPV6_TCP, 4TUPLE); - MCDI_IN_POPULATE_DWORD_4(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, + /* + * Create a copy of the original hash type. + * The copy will be used to fill in RSS_MODE bits and + * may be cleared beforehand. The original variable + * and, thus, EN bits will remain unaffected. + */ + modes = type; + + /* + * If the firmware lacks support for additional modes, RSS_MODE + * fields must contain zeros, otherwise the operation will fail. + */ + if (encp->enc_rx_scale_additional_modes_supported == B_FALSE) + modes = 0; + +#define EXTRACT_RSS_MODE(_type, _class) \ + (EFX_EXTRACT_NATIVE(_type, 0, 31, \ + EFX_LOW_BIT(EFX_RX_CLASS_##_class), \ + EFX_HIGH_BIT(EFX_RX_CLASS_##_class)) & \ + EFX_MASK32(EFX_RX_CLASS_##_class)) + + MCDI_IN_POPULATE_DWORD_10(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN, ((type & type_ipv4) == type_ipv4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN, @@ -379,7 +404,21 @@ efx_mcdi_rss_context_set_flags( RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN, ((type & type_ipv6) == type_ipv6) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN, - ((type & type_ipv6_tcp) == type_ipv6_tcp) ? 1 : 0); + ((type & type_ipv6_tcp) == type_ipv6_tcp) ? 1 : 0, + RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE, + EXTRACT_RSS_MODE(modes, IPV4_TCP), + RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE, + EXTRACT_RSS_MODE(modes, IPV4_UDP), + RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE, + EXTRACT_RSS_MODE(modes, IPV4), + RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE, + EXTRACT_RSS_MODE(modes, IPV6_TCP), + RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE, + EXTRACT_RSS_MODE(modes, IPV6_UDP), + RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE, + EXTRACT_RSS_MODE(modes, IPV6)); + +#undef EXTRACT_RSS_MODE efx_mcdi_execute(enp, &req); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:44:28 2018 (r341199) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:44:39 2018 (r341200) @@ -1220,6 +1220,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_buf_align_start; uint32_t enc_rx_buf_align_end; uint32_t enc_rx_scale_max_exclusive_contexts; + boolean_t enc_rx_scale_additional_modes_supported; #if EFSYS_OPT_LOOPBACK efx_qword_t enc_loopback_types[EFX_LINK_NMODES]; #endif /* EFSYS_OPT_LOOPBACK */ @@ -2149,14 +2150,18 @@ typedef enum efx_rx_scale_context_type_e { */ #define EFX_RX_CLASS_IPV4_TCP_LBN 8 #define EFX_RX_CLASS_IPV4_TCP_WIDTH 4 +#define EFX_RX_CLASS_IPV4_UDP_LBN 12 +#define EFX_RX_CLASS_IPV4_UDP_WIDTH 4 #define EFX_RX_CLASS_IPV4_LBN 16 #define EFX_RX_CLASS_IPV4_WIDTH 4 #define EFX_RX_CLASS_IPV6_TCP_LBN 20 #define EFX_RX_CLASS_IPV6_TCP_WIDTH 4 +#define EFX_RX_CLASS_IPV6_UDP_LBN 24 +#define EFX_RX_CLASS_IPV6_UDP_WIDTH 4 #define EFX_RX_CLASS_IPV6_LBN 28 #define EFX_RX_CLASS_IPV6_WIDTH 4 -#define EFX_RX_NCLASSES 4 +#define EFX_RX_NCLASSES 6 /* * Ancillary flags used to construct generic hash tuples. @@ -2176,17 +2181,28 @@ typedef enum efx_rx_scale_context_type_e { */ #define EFX_RX_CLASS_HASH_DISABLE 0 +#define EFX_RX_CLASS_HASH_1TUPLE_SRC EFX_RX_CLASS_HASH_SRC_ADDR +#define EFX_RX_CLASS_HASH_1TUPLE_DST EFX_RX_CLASS_HASH_DST_ADDR + #define EFX_RX_CLASS_HASH_2TUPLE \ (EFX_RX_CLASS_HASH_SRC_ADDR | \ EFX_RX_CLASS_HASH_DST_ADDR) +#define EFX_RX_CLASS_HASH_2TUPLE_SRC \ + (EFX_RX_CLASS_HASH_SRC_ADDR | \ + EFX_RX_CLASS_HASH_SRC_PORT) + +#define EFX_RX_CLASS_HASH_2TUPLE_DST \ + (EFX_RX_CLASS_HASH_DST_ADDR | \ + EFX_RX_CLASS_HASH_DST_PORT) + #define EFX_RX_CLASS_HASH_4TUPLE \ (EFX_RX_CLASS_HASH_SRC_ADDR | \ EFX_RX_CLASS_HASH_DST_ADDR | \ EFX_RX_CLASS_HASH_SRC_PORT | \ EFX_RX_CLASS_HASH_DST_PORT) -#define EFX_RX_CLASS_HASH_NTUPLES 3 +#define EFX_RX_CLASS_HASH_NTUPLES 7 /* * Hash flag constructor. Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:44:28 2018 (r341199) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:44:39 2018 (r341200) @@ -330,6 +330,8 @@ efx_rx_scale_hash_flags_get( __inout_ecount(EFX_RX_HASH_NFLAGS) unsigned int *flagsp, __out unsigned int *nflagsp) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; + boolean_t additional_modes; unsigned int *entryp = flagsp; efx_rc_t rc; @@ -338,12 +340,28 @@ efx_rx_scale_hash_flags_get( goto fail1; } -#define LIST_FLAGS(_entryp, _class, _l4_hashing) \ + additional_modes = encp->enc_rx_scale_additional_modes_supported; + +#define LIST_FLAGS(_entryp, _class, _l4_hashing, _additional_modes) \ do { \ - if (_l4_hashing) \ + if (_l4_hashing) { \ *(_entryp++) = EFX_RX_HASH(_class, 4TUPLE); \ \ + if (_additional_modes) { \ + *(_entryp++) = \ + EFX_RX_HASH(_class, 2TUPLE_DST); \ + *(_entryp++) = \ + EFX_RX_HASH(_class, 2TUPLE_SRC); \ + } \ + } \ + \ *(_entryp++) = EFX_RX_HASH(_class, 2TUPLE); \ + \ + if (_additional_modes) { \ + *(_entryp++) = EFX_RX_HASH(_class, 1TUPLE_DST); \ + *(_entryp++) = EFX_RX_HASH(_class, 1TUPLE_SRC); \ + } \ + \ *(_entryp++) = EFX_RX_HASH(_class, DISABLE); \ \ _NOTE(CONSTANTCONDITION) \ @@ -351,10 +369,16 @@ efx_rx_scale_hash_flags_get( switch (hash_alg) { case EFX_RX_HASHALG_TOEPLITZ: - LIST_FLAGS(entryp, IPV4_TCP, B_TRUE); - LIST_FLAGS(entryp, IPV6_TCP, B_TRUE); - LIST_FLAGS(entryp, IPV4, B_FALSE); - LIST_FLAGS(entryp, IPV6, B_FALSE); + LIST_FLAGS(entryp, IPV4_TCP, B_TRUE, additional_modes); + LIST_FLAGS(entryp, IPV6_TCP, B_TRUE, additional_modes); + + if (additional_modes) { + LIST_FLAGS(entryp, IPV4_UDP, B_TRUE, additional_modes); + LIST_FLAGS(entryp, IPV6_UDP, B_TRUE, additional_modes); + } + + LIST_FLAGS(entryp, IPV4, B_FALSE, additional_modes); + LIST_FLAGS(entryp, IPV6, B_FALSE, additional_modes); break; default: @@ -536,6 +560,7 @@ efx_rx_scale_mode_set( if (type & EFX_RX_HASH_IPV4) { type |= EFX_RX_HASH(IPV4, 2TUPLE); type |= EFX_RX_HASH(IPV4_TCP, 2TUPLE); + type |= EFX_RX_HASH(IPV4_UDP, 2TUPLE); } if (type & EFX_RX_HASH_TCPIPV4) @@ -544,6 +569,7 @@ efx_rx_scale_mode_set( if (type & EFX_RX_HASH_IPV6) { type |= EFX_RX_HASH(IPV6, 2TUPLE); type |= EFX_RX_HASH(IPV6_TCP, 2TUPLE); + type |= EFX_RX_HASH(IPV6_UDP, 2TUPLE); } if (type & EFX_RX_HASH_TCPIPV6) Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:44:28 2018 (r341199) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:44:39 2018 (r341200) @@ -147,6 +147,9 @@ siena_board_cfg( /* There is one RSS context per function */ encp->enc_rx_scale_max_exclusive_contexts = 1; + /* There is no support for additional RSS modes */ + encp->enc_rx_scale_additional_modes_supported = B_FALSE; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(FSF_AZ_TX_KER_BYTE_COUNT); /* Fragments must not span 4k boundaries. */ encp->enc_tx_dma_desc_boundary = 4096; From owner-svn-src-head@freebsd.org Thu Nov 29 06:44:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EFAB1153C97; Thu, 29 Nov 2018 06:44:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFF7E77C2F; Thu, 29 Nov 2018 06:44:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39D2715FB2; Thu, 29 Nov 2018 06:44:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6ir2s025496; Thu, 29 Nov 2018 06:44:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6iqQc025491; Thu, 29 Nov 2018 06:44:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290644.wAT6iqQc025491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341201 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFF7E77C2F X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:44:58 -0000 Author: arybchik Date: Thu Nov 29 06:44:51 2018 New Revision: 341201 URL: https://svnweb.freebsd.org/changeset/base/341201 Log: sfxge(4): honour packed stream RSS restriction Packed stream firmware variant on EF10 adapters has a number of properties which must be taken into account: - Only one exclusive RSS context is available per port. - Only IP addresses can contribute to the hash value. Huntington and Medford have one more limitation which is important for the drivers capable of packed stream: - Hash algorithm is non-standard (i.e. non-Toeplitz). This implies XORing together source + destination IP addresses (or last four bytes in the case of IPv6) and using the result as the input to a Toeplitz hash. This patch provides a number of improvements in order to treat the mentioned limitations in the common code. If the firmware variant is packed stream, the list of supported hash tuples will include less variants, and the maximum number of RSS contexts will be set to one. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18232 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:44:39 2018 (r341200) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:44:51 2018 (r341201) @@ -1266,11 +1266,63 @@ ef10_get_datapath_caps( else encp->enc_fec_counters = B_FALSE; + if (CAP_FLAGS1(req, RX_RSS_LIMITED)) { + /* Only one exclusive RSS context is available per port. */ + encp->enc_rx_scale_max_exclusive_contexts = 1; + + switch (enp->en_family) { + case EFX_FAMILY_MEDFORD2: + encp->enc_rx_scale_hash_alg_mask = + (1U << EFX_RX_HASHALG_TOEPLITZ); + break; + + case EFX_FAMILY_MEDFORD: + case EFX_FAMILY_HUNTINGTON: + /* + * Packed stream firmware variant maintains a + * non-standard algorithm for hash computation. + * It implies explicit XORing together + * source + destination IP addresses (or last + * four bytes in the case of IPv6) and using the + * resulting value as the input to a Toeplitz hash. + */ + encp->enc_rx_scale_hash_alg_mask = + (1U << EFX_RX_HASHALG_PACKED_STREAM); + break; + + default: + rc = EINVAL; + goto fail5; + } + + /* Port numbers cannot contribute to the hash value */ + encp->enc_rx_scale_l4_hash_supported = B_FALSE; + } else { + /* + * Maximum number of exclusive RSS contexts. + * EF10 hardware supports 64 in total, but 6 are reserved + * for shared contexts. They are a global resource so + * not all may be available. + */ + encp->enc_rx_scale_max_exclusive_contexts = 64 - 6; + + encp->enc_rx_scale_hash_alg_mask = + (1U << EFX_RX_HASHALG_TOEPLITZ); + + /* + * It is possible to use port numbers as + * the input data for hash computation. + */ + encp->enc_rx_scale_l4_hash_supported = B_TRUE; + } + #undef CAP_FLAGS1 #undef CAP_FLAGS2 return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: @@ -1739,13 +1791,6 @@ ef10_nic_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; - - /* - * Maximum number of exclusive RSS contexts. EF10 hardware supports 64 - * in total, but 6 are reserved for shared contexts. They are a global - * resource so not all may be available. - */ - encp->enc_rx_scale_max_exclusive_contexts = 64 - 6; encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:44:39 2018 (r341200) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:44:51 2018 (r341201) @@ -643,12 +643,13 @@ ef10_rx_scale_mode_set( __in efx_rx_hash_type_t type, __in boolean_t insert) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_rc_t rc; - EFSYS_ASSERT3U(alg, ==, EFX_RX_HASHALG_TOEPLITZ); EFSYS_ASSERT3U(insert, ==, B_TRUE); - if ((alg != EFX_RX_HASHALG_TOEPLITZ) || (insert == B_FALSE)) { + if ((encp->enc_rx_scale_hash_alg_mask & (1U << alg)) == 0 || + insert == B_FALSE) { rc = EINVAL; goto fail1; } @@ -797,6 +798,7 @@ ef10_rx_prefix_hash( _NOTE(ARGUNUSED(enp)) switch (func) { + case EFX_RX_HASHALG_PACKED_STREAM: case EFX_RX_HASHALG_TOEPLITZ: return (buffer[0] | (buffer[1] << 8) | Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:44:39 2018 (r341200) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:44:51 2018 (r341201) @@ -1220,6 +1220,16 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_buf_align_start; uint32_t enc_rx_buf_align_end; uint32_t enc_rx_scale_max_exclusive_contexts; + /* + * Mask of supported hash algorithms. + * Hash algorithm types are used as the bit indices. + */ + uint32_t enc_rx_scale_hash_alg_mask; + /* + * Indicates whether port numbers can be included to the + * input data for hash computation. + */ + boolean_t enc_rx_scale_l4_hash_supported; boolean_t enc_rx_scale_additional_modes_supported; #if EFSYS_OPT_LOOPBACK efx_qword_t enc_loopback_types[EFX_LINK_NMODES]; @@ -2096,7 +2106,9 @@ efx_rx_scatter_enable( typedef enum efx_rx_hash_alg_e { EFX_RX_HASHALG_LFSR = 0, - EFX_RX_HASHALG_TOEPLITZ + EFX_RX_HASHALG_TOEPLITZ, + EFX_RX_HASHALG_PACKED_STREAM, + EFX_RX_NHASHALGS } efx_rx_hash_alg_t; /* Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:44:39 2018 (r341200) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:44:51 2018 (r341201) @@ -331,6 +331,7 @@ efx_rx_scale_hash_flags_get( __out unsigned int *nflagsp) { efx_nic_cfg_t *encp = &enp->en_nic_cfg; + boolean_t l4; boolean_t additional_modes; unsigned int *entryp = flagsp; efx_rc_t rc; @@ -340,6 +341,7 @@ efx_rx_scale_hash_flags_get( goto fail1; } + l4 = encp->enc_rx_scale_l4_hash_supported; additional_modes = encp->enc_rx_scale_additional_modes_supported; #define LIST_FLAGS(_entryp, _class, _l4_hashing, _additional_modes) \ @@ -368,13 +370,20 @@ efx_rx_scale_hash_flags_get( } while (B_FALSE) switch (hash_alg) { + case EFX_RX_HASHALG_PACKED_STREAM: + if ((encp->enc_rx_scale_hash_alg_mask & (1U << hash_alg)) == 0) + break; + /* FALLTHRU */ case EFX_RX_HASHALG_TOEPLITZ: - LIST_FLAGS(entryp, IPV4_TCP, B_TRUE, additional_modes); - LIST_FLAGS(entryp, IPV6_TCP, B_TRUE, additional_modes); + if ((encp->enc_rx_scale_hash_alg_mask & (1U << hash_alg)) == 0) + break; + LIST_FLAGS(entryp, IPV4_TCP, l4, additional_modes); + LIST_FLAGS(entryp, IPV6_TCP, l4, additional_modes); + if (additional_modes) { - LIST_FLAGS(entryp, IPV4_UDP, B_TRUE, additional_modes); - LIST_FLAGS(entryp, IPV6_UDP, B_TRUE, additional_modes); + LIST_FLAGS(entryp, IPV4_UDP, l4, additional_modes); + LIST_FLAGS(entryp, IPV6_UDP, l4, additional_modes); } LIST_FLAGS(entryp, IPV4, B_FALSE, additional_modes); Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:44:39 2018 (r341200) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:44:51 2018 (r341201) @@ -147,6 +147,15 @@ siena_board_cfg( /* There is one RSS context per function */ encp->enc_rx_scale_max_exclusive_contexts = 1; + encp->enc_rx_scale_hash_alg_mask |= (1U << EFX_RX_HASHALG_LFSR); + encp->enc_rx_scale_hash_alg_mask |= (1U << EFX_RX_HASHALG_TOEPLITZ); + + /* + * It is always possible to use port numbers + * as the input data for hash computation. + */ + encp->enc_rx_scale_l4_hash_supported = B_TRUE; + /* There is no support for additional RSS modes */ encp->enc_rx_scale_additional_modes_supported = B_FALSE; From owner-svn-src-head@freebsd.org Thu Nov 29 06:45:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4634B1153CF1; Thu, 29 Nov 2018 06:45:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDE3477D47; Thu, 29 Nov 2018 06:45:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E19415FB3; Thu, 29 Nov 2018 06:45:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6j4Gf025566; Thu, 29 Nov 2018 06:45:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6j4M7025565; Thu, 29 Nov 2018 06:45:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290645.wAT6j4M7025565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341202 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDE3477D47 X-Spamd-Result: default: False [1.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.63)[0.632,0]; NEURAL_SPAM_MEDIUM(0.47)[0.474,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.534,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:45:09 -0000 Author: arybchik Date: Thu Nov 29 06:45:04 2018 New Revision: 341202 URL: https://svnweb.freebsd.org/changeset/base/341202 Log: sfxge(4): update autogenerated MCDI and TLV headers Equal stride super-buffer is a new name instead of deprecated equal stride packed stream to avoid confusion with previous packed stream. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18233 Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Nov 29 06:44:51 2018 (r341201) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Thu Nov 29 06:45:04 2018 (r341202) @@ -30,6 +30,14 @@ * $FreeBSD$ */ +/* + * This is NOT the original source file. Do NOT edit it. + * To update the tlv layout, please edit the copy in + * the sfregistry repo and then, in that repo, + * "make tlv_headers" or "make export" to + * regenerate and export all types of headers. + */ + /* These structures define the layouts for the TLV items stored in static and * dynamic configuration partitions in NVRAM for EF10 (Huntington etc.). * @@ -435,6 +443,7 @@ struct tlv_firmware_options { MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 #define TLV_FIRMWARE_VARIANT_RULES_ENGINE MC_CMD_FW_RULES_ENGINE #define TLV_FIRMWARE_VARIANT_DPDK MC_CMD_FW_DPDK +#define TLV_FIRMWARE_VARIANT_L3XUDP MC_CMD_FW_L3XUDP }; /* Voltage settings @@ -518,6 +527,17 @@ struct tlv_0v9_atb_target { uint16_t reserved; }; +/* Factory settings for amplitude calibration of the PCIE TX serdes */ +#define TLV_TAG_TX_PCIE_AMP_CONFIG (0x00220000) +struct tlv_pcie_tx_amp_config { + uint32_t tag; + uint32_t length; + uint8_t quad_tx_imp2k[4]; + uint8_t quad_tx_imp50[4]; + uint8_t lane_amp[16]; +}; + + /* Global PCIe configuration, second revision. This represents the visible PFs * by a bitmap rather than having the number of the highest visible one. As such * it can (for a 16-PF chip) represent a superset of what TLV_TAG_GLOBAL_PCIE_CONFIG @@ -851,20 +871,6 @@ struct tlv_tx_event_merging_config { #define TLV_TX_EVENT_MERGING_TIMEOUT_NS_DEFAULT (0xffffffff) #define TLV_TX_EVENT_MERGING_QEMPTY_TIMEOUT_NS_DEFAULT (0xffffffff) -/* BIU mode - * - * Medford2 tag for selecting VI window decode (see values below) - */ -#define TLV_TAG_BIU_VI_WINDOW_MODE (0x10280000) -struct tlv_biu_vi_window_mode { - uint32_t tag; - uint32_t length; - uint8_t mode; -#define TLV_BIU_VI_WINDOW_MODE_8K 0 /* 8k per VI, CTPIO not mapped, medford/hunt compatible */ -#define TLV_BIU_VI_WINDOW_MODE_16K 1 /* 16k per VI, CTPIO mapped */ -#define TLV_BIU_VI_WINDOW_MODE_64K 2 /* 64k per VI, CTPIO mapped, POWER-friendly */ -}; - #define TLV_TAG_LICENSE (0x30800000) typedef struct tlv_license { @@ -985,6 +991,47 @@ struct tlv_tx_vfifo_ull_mode { uint32_t length; uint8_t mode; #define TLV_TX_VFIFO_ULL_MODE_DEFAULT 0 +}; + +/* BIU mode + * + * Medford2 tag for selecting VI window decode (see values below) + */ +#define TLV_TAG_BIU_VI_WINDOW_MODE (0x10280000) +struct tlv_biu_vi_window_mode { + uint32_t tag; + uint32_t length; + uint8_t mode; +#define TLV_BIU_VI_WINDOW_MODE_8K 0 /* 8k per VI, CTPIO not mapped, medford/hunt compatible */ +#define TLV_BIU_VI_WINDOW_MODE_16K 1 /* 16k per VI, CTPIO mapped */ +#define TLV_BIU_VI_WINDOW_MODE_64K 2 /* 64k per VI, CTPIO mapped, POWER-friendly */ +}; + +/* FastPD mode + * + * Medford2 tag for configuring the FastPD mode (see values below) + */ +#define TLV_TAG_FASTPD_MODE(port) (0x10290000 + (port)) +struct tlv_fastpd_mode { + uint32_t tag; + uint32_t length; + uint8_t mode; +#define TLV_FASTPD_MODE_SOFT_ALL 0 /* All packets to the SoftPD */ +#define TLV_FASTPD_MODE_FAST_ALL 1 /* All packets to the FastPD */ +#define TLV_FASTPD_MODE_FAST_SUPPORTED 2 /* Supported packet types to the FastPD; everything else to the SoftPD */ +}; + +/* L3xUDP datapath firmware UDP port configuration + * + * Sets the list of UDP ports on which the encapsulation will be handled. + * The number of ports in the list is implied by the length of the TLV item. + */ +#define TLV_TAG_L3XUDP_PORTS (0x102a0000) +struct tlv_l3xudp_ports { + uint32_t tag; + uint32_t length; + uint16_t ports[]; +#define TLV_TAG_L3XUDP_PORTS_MAX_NUM_PORTS 16 }; #endif /* CI_MGMT_TLV_LAYOUT_H */ Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Nov 29 06:44:51 2018 (r341201) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Thu Nov 29 06:45:04 2018 (r341202) @@ -2761,6 +2761,8 @@ #define MC_CMD_DRV_ATTACH_IN_PREBOOT_WIDTH 1 #define MC_CMD_DRV_ATTACH_IN_SUBVARIANT_AWARE_LBN 2 #define MC_CMD_DRV_ATTACH_IN_SUBVARIANT_AWARE_WIDTH 1 +#define MC_CMD_DRV_ATTACH_IN_WANT_VI_SPREADING_LBN 3 +#define MC_CMD_DRV_ATTACH_IN_WANT_VI_SPREADING_WIDTH 1 /* 1 to set new state, or 0 to just report the existing state */ #define MC_CMD_DRV_ATTACH_IN_UPDATE_OFST 4 #define MC_CMD_DRV_ATTACH_IN_UPDATE_LEN 4 @@ -2789,6 +2791,12 @@ * bug69716) */ #define MC_CMD_FW_L3XUDP 0x7 +/* enum: Requests that the MC keep whatever datapath firmware is currently + * running. It's used for test purposes, where we want to be able to shmboot + * special test firmware variants. This option is only recognised in eftest + * (i.e. non-production) builds. + */ +#define MC_CMD_FW_KEEP_CURRENT_EFTEST_ONLY 0xfffffffe /* enum: Only this option is allowed for non-admin functions */ #define MC_CMD_FW_DONT_CARE 0xffffffff @@ -2818,6 +2826,11 @@ * refers to the Sorrento external FPGA port. */ #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_NO_ACTIVE_PORT 0x3 +/* enum: If set, indicates that VI spreading is currently enabled. Will always + * indicate the current state, regardless of the value in the WANT_VI_SPREADING + * input. + */ +#define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_VI_SPREADING_ENABLED 0x4 /***********************************/ @@ -3621,7 +3634,38 @@ /* Enum values, see field(s): */ /* 100M */ +/* AN_TYPE structuredef: Auto-negotiation types defined in IEEE802.3 */ +#define AN_TYPE_LEN 4 +#define AN_TYPE_TYPE_OFST 0 +#define AN_TYPE_TYPE_LEN 4 +/* enum: None, AN disabled or not supported */ +#define MC_CMD_AN_NONE 0x0 +/* enum: Clause 28 - BASE-T */ +#define MC_CMD_AN_CLAUSE28 0x1 +/* enum: Clause 37 - BASE-X */ +#define MC_CMD_AN_CLAUSE37 0x2 +/* enum: Clause 73 - BASE-R startup protocol for backplane and copper cable + * assemblies. Includes Clause 72/Clause 92 link-training. + */ +#define MC_CMD_AN_CLAUSE73 0x3 +#define AN_TYPE_TYPE_LBN 0 +#define AN_TYPE_TYPE_WIDTH 32 +/* FEC_TYPE structuredef: Forward error correction types defined in IEEE802.3 + */ +#define FEC_TYPE_LEN 4 +#define FEC_TYPE_TYPE_OFST 0 +#define FEC_TYPE_TYPE_LEN 4 +/* enum: No FEC */ +#define MC_CMD_FEC_NONE 0x0 +/* enum: Clause 74 BASE-R FEC (a.k.a Firecode) */ +#define MC_CMD_FEC_BASER 0x1 +/* enum: Clause 91/Clause 108 Reed-Solomon FEC */ +#define MC_CMD_FEC_RS 0x2 +#define FEC_TYPE_TYPE_LBN 0 +#define FEC_TYPE_TYPE_WIDTH 32 + + /***********************************/ /* MC_CMD_GET_LINK * Read the unified MAC/PHY link state. Locks required: None Return code: 0, @@ -3637,10 +3681,14 @@ /* MC_CMD_GET_LINK_OUT msgresponse */ #define MC_CMD_GET_LINK_OUT_LEN 28 -/* near-side advertised capabilities */ +/* Near-side advertised capabilities. Refer to + * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions. + */ #define MC_CMD_GET_LINK_OUT_CAP_OFST 0 #define MC_CMD_GET_LINK_OUT_CAP_LEN 4 -/* link-partner advertised capabilities */ +/* Link-partner advertised capabilities. Refer to + * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions. + */ #define MC_CMD_GET_LINK_OUT_LP_CAP_OFST 4 #define MC_CMD_GET_LINK_OUT_LP_CAP_LEN 4 /* Autonegotiated speed in mbit/s. The link may still be down even if this @@ -3683,7 +3731,98 @@ #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_LBN 3 #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_WIDTH 1 +/* MC_CMD_GET_LINK_OUT_V2 msgresponse: Extended link state information */ +#define MC_CMD_GET_LINK_OUT_V2_LEN 44 +/* Near-side advertised capabilities. Refer to + * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions. + */ +#define MC_CMD_GET_LINK_OUT_V2_CAP_OFST 0 +#define MC_CMD_GET_LINK_OUT_V2_CAP_LEN 4 +/* Link-partner advertised capabilities. Refer to + * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions. + */ +#define MC_CMD_GET_LINK_OUT_V2_LP_CAP_OFST 4 +#define MC_CMD_GET_LINK_OUT_V2_LP_CAP_LEN 4 +/* Autonegotiated speed in mbit/s. The link may still be down even if this + * reads non-zero. + */ +#define MC_CMD_GET_LINK_OUT_V2_LINK_SPEED_OFST 8 +#define MC_CMD_GET_LINK_OUT_V2_LINK_SPEED_LEN 4 +/* Current loopback setting. */ +#define MC_CMD_GET_LINK_OUT_V2_LOOPBACK_MODE_OFST 12 +#define MC_CMD_GET_LINK_OUT_V2_LOOPBACK_MODE_LEN 4 +/* Enum values, see field(s): */ +/* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */ +#define MC_CMD_GET_LINK_OUT_V2_FLAGS_OFST 16 +#define MC_CMD_GET_LINK_OUT_V2_FLAGS_LEN 4 +#define MC_CMD_GET_LINK_OUT_V2_LINK_UP_LBN 0 +#define MC_CMD_GET_LINK_OUT_V2_LINK_UP_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_FULL_DUPLEX_LBN 1 +#define MC_CMD_GET_LINK_OUT_V2_FULL_DUPLEX_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_BPX_LINK_LBN 2 +#define MC_CMD_GET_LINK_OUT_V2_BPX_LINK_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_PHY_LINK_LBN 3 +#define MC_CMD_GET_LINK_OUT_V2_PHY_LINK_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_RX_LBN 6 +#define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_RX_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_TX_LBN 7 +#define MC_CMD_GET_LINK_OUT_V2_LINK_FAULT_TX_WIDTH 1 +/* This returns the negotiated flow control value. */ +#define MC_CMD_GET_LINK_OUT_V2_FCNTL_OFST 20 +#define MC_CMD_GET_LINK_OUT_V2_FCNTL_LEN 4 +/* Enum values, see field(s): */ +/* MC_CMD_SET_MAC/MC_CMD_SET_MAC_IN/FCNTL */ +#define MC_CMD_GET_LINK_OUT_V2_MAC_FAULT_OFST 24 +#define MC_CMD_GET_LINK_OUT_V2_MAC_FAULT_LEN 4 +/* MC_CMD_MAC_FAULT_XGMII_LOCAL_LBN 0 */ +/* MC_CMD_MAC_FAULT_XGMII_LOCAL_WIDTH 1 */ +/* MC_CMD_MAC_FAULT_XGMII_REMOTE_LBN 1 */ +/* MC_CMD_MAC_FAULT_XGMII_REMOTE_WIDTH 1 */ +/* MC_CMD_MAC_FAULT_SGMII_REMOTE_LBN 2 */ +/* MC_CMD_MAC_FAULT_SGMII_REMOTE_WIDTH 1 */ +/* MC_CMD_MAC_FAULT_PENDING_RECONFIG_LBN 3 */ +/* MC_CMD_MAC_FAULT_PENDING_RECONFIG_WIDTH 1 */ +/* True local device capabilities (taking into account currently used PMD/MDI, + * e.g. plugged-in module). In general, subset of + * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP, but may include extra _FEC_REQUEST + * bits, if the PMD requires FEC. 0 if unknown (e.g. module unplugged). Equal + * to SUPPORTED_CAP for non-pluggable PMDs. Refer to + * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions. + */ +#define MC_CMD_GET_LINK_OUT_V2_LD_CAP_OFST 28 +#define MC_CMD_GET_LINK_OUT_V2_LD_CAP_LEN 4 +/* Auto-negotiation type used on the link */ +#define MC_CMD_GET_LINK_OUT_V2_AN_TYPE_OFST 32 +#define MC_CMD_GET_LINK_OUT_V2_AN_TYPE_LEN 4 +/* Enum values, see field(s): */ +/* AN_TYPE/TYPE */ +/* Forward error correction used on the link */ +#define MC_CMD_GET_LINK_OUT_V2_FEC_TYPE_OFST 36 +#define MC_CMD_GET_LINK_OUT_V2_FEC_TYPE_LEN 4 +/* Enum values, see field(s): */ +/* FEC_TYPE/TYPE */ +#define MC_CMD_GET_LINK_OUT_V2_EXT_FLAGS_OFST 40 +#define MC_CMD_GET_LINK_OUT_V2_EXT_FLAGS_LEN 4 +#define MC_CMD_GET_LINK_OUT_V2_PMD_MDI_CONNECTED_LBN 0 +#define MC_CMD_GET_LINK_OUT_V2_PMD_MDI_CONNECTED_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_PMD_READY_LBN 1 +#define MC_CMD_GET_LINK_OUT_V2_PMD_READY_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_PMD_LINK_UP_LBN 2 +#define MC_CMD_GET_LINK_OUT_V2_PMD_LINK_UP_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_PMA_LINK_UP_LBN 3 +#define MC_CMD_GET_LINK_OUT_V2_PMA_LINK_UP_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_PCS_LOCK_LBN 4 +#define MC_CMD_GET_LINK_OUT_V2_PCS_LOCK_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_ALIGN_LOCK_LBN 5 +#define MC_CMD_GET_LINK_OUT_V2_ALIGN_LOCK_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_HI_BER_LBN 6 +#define MC_CMD_GET_LINK_OUT_V2_HI_BER_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_FEC_LOCK_LBN 7 +#define MC_CMD_GET_LINK_OUT_V2_FEC_LOCK_WIDTH 1 +#define MC_CMD_GET_LINK_OUT_V2_AN_DONE_LBN 8 +#define MC_CMD_GET_LINK_OUT_V2_AN_DONE_WIDTH 1 + /***********************************/ /* MC_CMD_SET_LINK * Write the unified MAC/PHY link configuration. Locks required: None. Return @@ -3696,7 +3835,9 @@ /* MC_CMD_SET_LINK_IN msgrequest */ #define MC_CMD_SET_LINK_IN_LEN 16 -/* ??? */ +/* Near-side advertised capabilities. Refer to + * MC_CMD_GET_PHY_CFG_OUT/SUPPORTED_CAP for bit definitions. + */ #define MC_CMD_SET_LINK_IN_CAP_OFST 0 #define MC_CMD_SET_LINK_IN_CAP_LEN 4 /* Flags */ @@ -4253,7 +4394,38 @@ /* Other enum values, see field(s): */ /* MC_CMD_MAC_STATS_V2_OUT_NO_DMA/STATISTICS */ +/* MC_CMD_MAC_STATS_V4_OUT_DMA msgresponse */ +#define MC_CMD_MAC_STATS_V4_OUT_DMA_LEN 0 +/* MC_CMD_MAC_STATS_V4_OUT_NO_DMA msgresponse */ +#define MC_CMD_MAC_STATS_V4_OUT_NO_DMA_LEN (((MC_CMD_MAC_NSTATS_V4*64))>>3) +#define MC_CMD_MAC_STATS_V4_OUT_NO_DMA_STATISTICS_OFST 0 +#define MC_CMD_MAC_STATS_V4_OUT_NO_DMA_STATISTICS_LEN 8 +#define MC_CMD_MAC_STATS_V4_OUT_NO_DMA_STATISTICS_LO_OFST 0 +#define MC_CMD_MAC_STATS_V4_OUT_NO_DMA_STATISTICS_HI_OFST 4 +#define MC_CMD_MAC_STATS_V4_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS_V4 +/* enum: Start of V4 stats buffer space */ +#define MC_CMD_MAC_V4_DMABUF_START 0x79 +/* enum: RXDP counter: Number of packets truncated because scattering was + * disabled. + */ +#define MC_CMD_MAC_RXDP_SCATTER_DISABLED_TRUNC 0x79 +/* enum: RXDP counter: Number of times the RXDP head of line blocked waiting + * for descriptors. Will be zero unless RXDP_HLB_IDLE capability is set. + */ +#define MC_CMD_MAC_RXDP_HLB_IDLE 0x7a +/* enum: RXDP counter: Number of times the RXDP timed out while head of line + * blocking. Will be zero unless RXDP_HLB_IDLE capability is set. + */ +#define MC_CMD_MAC_RXDP_HLB_TIMEOUT 0x7b +/* enum: This includes the space at offset 124 which is the final + * GENERATION_END in a MAC_STATS_V4 response and otherwise unused. + */ +#define MC_CMD_MAC_NSTATS_V4 0x7d +/* Other enum values, see field(s): */ +/* MC_CMD_MAC_STATS_V3_OUT_NO_DMA/STATISTICS */ + + /***********************************/ /* MC_CMD_SRIOV * to be documented @@ -7333,7 +7505,7 @@ #define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_OFST 4 #define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_LEN 4 /* The value to put in the event data. Check hardware spec. for valid range. - * This field is ignored if DMA_MODE == EQUAL_STRIDE_PACKED_STREAM or DMA_MODE + * This field is ignored if DMA_MODE == EQUAL_STRIDE_SUPER_BUFFER or DMA_MODE * == PACKED_STREAM. */ #define MC_CMD_INIT_RXQ_EXT_IN_LABEL_OFST 8 @@ -7372,6 +7544,8 @@ * description see SF-119419-TC. This mode is only supported by "dpdk" datapath * firmware. */ +#define MC_CMD_INIT_RXQ_EXT_IN_EQUAL_STRIDE_SUPER_BUFFER 0x2 +/* enum: Deprecated name for EQUAL_STRIDE_SUPER_BUFFER. */ #define MC_CMD_INIT_RXQ_EXT_IN_EQUAL_STRIDE_PACKED_STREAM 0x2 #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_LBN 14 #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_WIDTH 1 @@ -7413,7 +7587,7 @@ #define MC_CMD_INIT_RXQ_V3_IN_TARGET_EVQ_OFST 4 #define MC_CMD_INIT_RXQ_V3_IN_TARGET_EVQ_LEN 4 /* The value to put in the event data. Check hardware spec. for valid range. - * This field is ignored if DMA_MODE == EQUAL_STRIDE_PACKED_STREAM or DMA_MODE + * This field is ignored if DMA_MODE == EQUAL_STRIDE_SUPER_BUFFER or DMA_MODE * == PACKED_STREAM. */ #define MC_CMD_INIT_RXQ_V3_IN_LABEL_OFST 8 @@ -7452,6 +7626,8 @@ * description see SF-119419-TC. This mode is only supported by "dpdk" datapath * firmware. */ +#define MC_CMD_INIT_RXQ_V3_IN_EQUAL_STRIDE_SUPER_BUFFER 0x2 +/* enum: Deprecated name for EQUAL_STRIDE_SUPER_BUFFER. */ #define MC_CMD_INIT_RXQ_V3_IN_EQUAL_STRIDE_PACKED_STREAM 0x2 #define MC_CMD_INIT_RXQ_V3_IN_FLAG_SNAPSHOT_MODE_LBN 14 #define MC_CMD_INIT_RXQ_V3_IN_FLAG_SNAPSHOT_MODE_WIDTH 1 @@ -7482,21 +7658,21 @@ #define MC_CMD_INIT_RXQ_V3_IN_SNAPSHOT_LENGTH_OFST 540 #define MC_CMD_INIT_RXQ_V3_IN_SNAPSHOT_LENGTH_LEN 4 /* The number of packet buffers that will be contained within each - * EQUAL_STRIDE_PACKED_STREAM format bucket supplied by the driver. This field - * is ignored unless DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + * EQUAL_STRIDE_SUPER_BUFFER format bucket supplied by the driver. This field + * is ignored unless DMA_MODE == EQUAL_STRIDE_SUPER_BUFFER. */ #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_BUFFERS_PER_BUCKET_OFST 544 #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_BUFFERS_PER_BUCKET_LEN 4 /* The length in bytes of the area in each packet buffer that can be written to * by the adapter. This is used to store the packet prefix and the packet * payload. This length does not include any end padding added by the driver. - * This field is ignored unless DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + * This field is ignored unless DMA_MODE == EQUAL_STRIDE_SUPER_BUFFER. */ #define MC_CMD_INIT_RXQ_V3_IN_ES_MAX_DMA_LEN_OFST 548 #define MC_CMD_INIT_RXQ_V3_IN_ES_MAX_DMA_LEN_LEN 4 /* The length in bytes of a single packet buffer within a - * EQUAL_STRIDE_PACKED_STREAM format bucket. This field is ignored unless - * DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + * EQUAL_STRIDE_SUPER_BUFFER format bucket. This field is ignored unless + * DMA_MODE == EQUAL_STRIDE_SUPER_BUFFER. */ #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_STRIDE_OFST 552 #define MC_CMD_INIT_RXQ_V3_IN_ES_PACKET_STRIDE_LEN 4 @@ -7504,7 +7680,7 @@ * there are no RX descriptors available. If the timeout is reached and there * are still no descriptors then the packet will be dropped. A timeout of 0 * means the datapath will never be blocked. This field is ignored unless - * DMA_MODE == EQUAL_STRIDE_PACKED_STREAM. + * DMA_MODE == EQUAL_STRIDE_SUPER_BUFFER. */ #define MC_CMD_INIT_RXQ_V3_IN_ES_HEAD_OF_LINE_BLOCK_TIMEOUT_OFST 556 #define MC_CMD_INIT_RXQ_V3_IN_ES_HEAD_OF_LINE_BLOCK_TIMEOUT_LEN 4 @@ -8697,7 +8873,10 @@ * support the DPDK rte_flow "MARK" action. */ #define MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_MARK 0x2 -/* the mark value for MATCH_ACTION_MARK */ +/* the mark value for MATCH_ACTION_MARK. Requesting a value larger than the + * maximum (obtained from MC_CMD_GET_CAPABILITIES_V5/FILTER_ACTION_MARK_MAX) + * will cause the filter insertion to fail with EINVAL. + */ #define MC_CMD_FILTER_OP_V3_IN_MATCH_MARK_VALUE_OFST 176 #define MC_CMD_FILTER_OP_V3_IN_MATCH_MARK_VALUE_LEN 4 @@ -10126,12 +10305,18 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_FLAG_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_MARK_LBN 20 #define MC_CMD_GET_CAPABILITIES_V2_OUT_FILTER_ACTION_MARK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_SUPER_BUFFER_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_SUPER_BUFFER_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21 #define MC_CMD_GET_CAPABILITIES_V2_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_L3XUDP_SUPPORT_LBN 22 #define MC_CMD_GET_CAPABILITIES_V2_OUT_L3XUDP_SUPPORT_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_FW_SUBVARIANT_NO_TX_CSUM_LBN 23 #define MC_CMD_GET_CAPABILITIES_V2_OUT_FW_SUBVARIANT_NO_TX_CSUM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VI_SPREADING_LBN 24 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_VI_SPREADING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_HLB_IDLE_LBN 25 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_HLB_IDLE_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -10443,12 +10628,18 @@ #define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_FLAG_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_MARK_LBN 20 #define MC_CMD_GET_CAPABILITIES_V3_OUT_FILTER_ACTION_MARK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_SUPER_BUFFER_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_SUPER_BUFFER_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21 #define MC_CMD_GET_CAPABILITIES_V3_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V3_OUT_L3XUDP_SUPPORT_LBN 22 #define MC_CMD_GET_CAPABILITIES_V3_OUT_L3XUDP_SUPPORT_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V3_OUT_FW_SUBVARIANT_NO_TX_CSUM_LBN 23 #define MC_CMD_GET_CAPABILITIES_V3_OUT_FW_SUBVARIANT_NO_TX_CSUM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_SPREADING_LBN 24 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_SPREADING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_HLB_IDLE_LBN 25 +#define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_HLB_IDLE_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -10785,12 +10976,18 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_FLAG_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_MARK_LBN 20 #define MC_CMD_GET_CAPABILITIES_V4_OUT_FILTER_ACTION_MARK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_SUPER_BUFFER_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_SUPER_BUFFER_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21 #define MC_CMD_GET_CAPABILITIES_V4_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V4_OUT_L3XUDP_SUPPORT_LBN 22 #define MC_CMD_GET_CAPABILITIES_V4_OUT_L3XUDP_SUPPORT_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V4_OUT_FW_SUBVARIANT_NO_TX_CSUM_LBN 23 #define MC_CMD_GET_CAPABILITIES_V4_OUT_FW_SUBVARIANT_NO_TX_CSUM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_SPREADING_LBN 24 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_VI_SPREADING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_HLB_IDLE_LBN 25 +#define MC_CMD_GET_CAPABILITIES_V4_OUT_RXDP_HLB_IDLE_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -10880,7 +11077,368 @@ #define MC_CMD_GET_CAPABILITIES_V4_OUT_MAC_STATS_NUM_STATS_OFST 76 #define MC_CMD_GET_CAPABILITIES_V4_OUT_MAC_STATS_NUM_STATS_LEN 2 +/* MC_CMD_GET_CAPABILITIES_V5_OUT msgresponse */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_LEN 84 +/* First word of flags. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FLAGS1_OFST 0 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FLAGS1_LEN 4 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VPORT_RECONFIGURE_LBN 3 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VPORT_RECONFIGURE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_STRIPING_LBN 4 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_STRIPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VADAPTOR_QUERY_LBN 5 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VADAPTOR_QUERY_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_DRV_ATTACH_PREBOOT_LBN 7 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_DRV_ATTACH_PREBOOT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_FORCE_EVENT_MERGING_LBN 8 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_SET_MAC_ENHANCED_LBN 9 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_SET_MAC_ENHANCED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_MAC_SECURITY_FILTERING_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_ADDITIONAL_RSS_MODES_LBN 13 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_ADDITIONAL_RSS_MODES_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_QBB_LBN 14 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_QBB_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_RSS_LIMITED_LBN 16 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_RSS_LIMITED_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PACKED_STREAM_LBN 17 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PACKED_STREAM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_INCLUDE_FCS_LBN 18 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_INCLUDE_FCS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_VLAN_INSERTION_LBN 19 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_VLAN_INSERTION_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_VLAN_STRIPPING_LBN 20 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_VLAN_STRIPPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PREFIX_LEN_0_LBN 22 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PREFIX_LEN_0_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PREFIX_LEN_14_LBN 23 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_PREFIX_LEN_14_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_TIMESTAMP_LBN 24 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_TIMESTAMP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_BATCHING_LBN 25 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_BATCHING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MCAST_FILTER_CHAINING_LBN 26 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MCAST_FILTER_CHAINING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_PM_AND_RXDP_COUNTERS_LBN 27 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_DISABLE_SCATTER_LBN 28 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_DISABLE_SCATTER_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVB_LBN 30 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVB_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VXLAN_NVGRE_LBN 31 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VXLAN_NVGRE_WIDTH 1 +/* RxDPCPU firmware id. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_DPCPU_FW_ID_OFST 4 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_DPCPU_FW_ID_LEN 2 +/* enum: Standard RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP 0x0 +/* enum: Low latency RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_LOW_LATENCY 0x1 +/* enum: Packed stream RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_PACKED_STREAM 0x2 +/* enum: Rules engine RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_RULES_ENGINE 0x5 +/* enum: DPDK RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_DPDK 0x6 +/* enum: BIST RXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_BIST 0x10a +/* enum: RXDP Test firmware image 1 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101 +/* enum: RXDP Test firmware image 2 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102 +/* enum: RXDP Test firmware image 3 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103 +/* enum: RXDP Test firmware image 4 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104 +/* enum: RXDP Test firmware image 5 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_BACKPRESSURE 0x105 +/* enum: RXDP Test firmware image 6 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106 +/* enum: RXDP Test firmware image 7 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107 +/* enum: RXDP Test firmware image 8 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_DISABLE_DL 0x108 +/* enum: RXDP Test firmware image 9 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b +/* enum: RXDP Test firmware image 10 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_TEST_FW_SLOW 0x10c +/* TxDPCPU firmware id. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_DPCPU_FW_ID_OFST 6 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_DPCPU_FW_ID_LEN 2 +/* enum: Standard TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP 0x0 +/* enum: Low latency TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_LOW_LATENCY 0x1 +/* enum: High packet rate TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_HIGH_PACKET_RATE 0x3 +/* enum: Rules engine TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_RULES_ENGINE 0x5 +/* enum: DPDK TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_DPDK 0x6 +/* enum: BIST TXDP firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_BIST 0x12d +/* enum: TXDP Test firmware image 1 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_TEST_FW_TSO_EDIT 0x101 +/* enum: TXDP Test firmware image 2 */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102 +/* enum: TXDP CSR bus test firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXDP_TEST_FW_CSR 0x103 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_VERSION_OFST 8 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_VERSION_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_VERSION_REV_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_VERSION_REV_WIDTH 12 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_VERSION_TYPE_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4 +/* enum: reserved value - do not use (may indicate alternative interpretation + * of REV field in future) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_RESERVED 0x0 +/* enum: Trivial RX PD firmware for early Huntington development (Huntington + * development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1 +/* enum: RX PD firmware with approximately Siena-compatible behaviour + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2 +/* enum: Full featured RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_VSWITCH 0x3 +/* enum: siena_compat variant RX PD firmware using PM rather than MAC + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 +/* enum: Low latency RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5 +/* enum: Packed stream RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6 +/* enum: RX PD firmware handling layer 2 only for high packet rate performance + * tests (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: Custom firmware variant (see SF-119495-PD and bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_L3XUDP 0x9 +/* enum: DPDK RX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_DPDK 0xa +/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe +/* enum: RX PD firmware parsing but not filtering network overlay tunnel + * encapsulations (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_VERSION_OFST 10 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_VERSION_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_VERSION_REV_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_VERSION_REV_WIDTH 12 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_VERSION_TYPE_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4 +/* enum: reserved value - do not use (may indicate alternative interpretation + * of REV field in future) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_RESERVED 0x0 +/* enum: Trivial TX PD firmware for early Huntington development (Huntington + * development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1 +/* enum: TX PD firmware with approximately Siena-compatible behaviour + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2 +/* enum: Full featured TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_FULL_FEATURED 0x3 +/* enum: (deprecated original name for the FULL_FEATURED variant) */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_VSWITCH 0x3 +/* enum: siena_compat variant TX PD firmware using PM rather than MAC + * (Huntington development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */ +/* enum: TX PD firmware handling layer 2 only for high packet rate performance + * tests (Medford development only) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7 +/* enum: Rules engine TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8 +/* enum: Custom firmware variant (see SF-119495-PD and bug69716) */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_L3XUDP 0x9 +/* enum: DPDK TX PD production firmware */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_DPDK 0xa +/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe +/* Hardware capabilities of NIC */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_HW_CAPABILITIES_OFST 12 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_HW_CAPABILITIES_LEN 4 +/* Licensed capabilities */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_LICENSE_CAPABILITIES_OFST 16 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_LICENSE_CAPABILITIES_LEN 4 +/* Second word of flags. Not present on older firmware (check the length). */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FLAGS2_OFST 20 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FLAGS2_LEN 4 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_V2_LBN 0 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_V2_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_V2_ENCAP_LBN 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_V2_ENCAP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVQ_TIMER_CTRL_LBN 2 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVQ_TIMER_CTRL_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVENT_CUT_THROUGH_LBN 3 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EVENT_CUT_THROUGH_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_CUT_THROUGH_LBN 4 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_CUT_THROUGH_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_VFIFO_ULL_MODE_LBN 5 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_VFIFO_ULL_MODE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_INIT_EVQ_V2_LBN 7 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_INIT_EVQ_V2_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_MAC_TIMESTAMPING_LBN 8 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_MAC_TIMESTAMPING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TIMESTAMP_LBN 9 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TIMESTAMP_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_SNIFF_LBN 10 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_SNIFF_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_SNIFF_LBN 11 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_SNIFF_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MCDI_BACKGROUND_LBN 13 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MCDI_BACKGROUND_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MCDI_DB_RETURN_LBN 14 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MCDI_DB_RETURN_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_CTPIO_LBN 15 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_CTPIO_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TSA_SUPPORT_LBN 16 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TSA_SUPPORT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TSA_BOUND_LBN 17 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TSA_BOUND_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_SF_ADAPTER_AUTHENTICATION_LBN 18 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_SF_ADAPTER_AUTHENTICATION_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FILTER_ACTION_FLAG_LBN 19 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FILTER_ACTION_FLAG_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FILTER_ACTION_MARK_LBN 20 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FILTER_ACTION_MARK_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EQUAL_STRIDE_SUPER_BUFFER_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EQUAL_STRIDE_SUPER_BUFFER_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EQUAL_STRIDE_PACKED_STREAM_LBN 21 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_EQUAL_STRIDE_PACKED_STREAM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_L3XUDP_SUPPORT_LBN 22 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_L3XUDP_SUPPORT_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FW_SUBVARIANT_NO_TX_CSUM_LBN 23 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FW_SUBVARIANT_NO_TX_CSUM_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VI_SPREADING_LBN 24 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VI_SPREADING_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_HLB_IDLE_LBN 25 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RXDP_HLB_IDLE_WIDTH 1 +/* Number of FATSOv2 contexts per datapath supported by this NIC. Not present + * on older firmware (check the length). + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2 +/* One byte per PF containing the number of the external port assigned to this + * PF, indexed by PF number. Special values indicate that a PF is either not + * present or not assigned. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16 +/* enum: The caller is not permitted to access information on this PF. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_ACCESS_NOT_PERMITTED 0xff +/* enum: PF does not exist. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_PF_NOT_PRESENT 0xfe +/* enum: PF does exist but is not assigned to any external port. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_PF_NOT_ASSIGNED 0xfd +/* enum: This value indicates that PF is assigned, but it cannot be expressed + * in this field. It is intended for a possible future situation where a more + * complex scheme of PFs to ports mapping is being used. The future driver + * should look for a new field supporting the new scheme. The current/old + * driver should treat this value as PF_NOT_ASSIGNED. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc +/* One byte per PF containing the number of its VFs, indexed by PF number. A + * special value indicates that a PF is not present. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_VFS_PER_PF_OFST 42 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_VFS_PER_PF_LEN 1 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_VFS_PER_PF_NUM 16 +/* enum: The caller is not permitted to access information on this PF. */ +/* MC_CMD_GET_CAPABILITIES_V5_OUT_ACCESS_NOT_PERMITTED 0xff */ +/* enum: PF does not exist. */ +/* MC_CMD_GET_CAPABILITIES_V5_OUT_PF_NOT_PRESENT 0xfe */ +/* Number of VIs available for each external port */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_VIS_PER_PORT_OFST 58 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_VIS_PER_PORT_LEN 2 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_VIS_PER_PORT_NUM 4 +/* Size of RX descriptor cache expressed as binary logarithm The actual size + * equals (2 ^ RX_DESC_CACHE_SIZE) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_DESC_CACHE_SIZE_OFST 66 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_RX_DESC_CACHE_SIZE_LEN 1 +/* Size of TX descriptor cache expressed as binary logarithm The actual size + * equals (2 ^ TX_DESC_CACHE_SIZE) + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_DESC_CACHE_SIZE_OFST 67 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_TX_DESC_CACHE_SIZE_LEN 1 +/* Total number of available PIO buffers */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_PIO_BUFFS_OFST 68 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_NUM_PIO_BUFFS_LEN 2 +/* Size of a single PIO buffer */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_SIZE_PIO_BUFF_OFST 70 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_SIZE_PIO_BUFF_LEN 2 +/* On chips later than Medford the amount of address space assigned to each VI + * is configurable. This is a global setting that the driver must query to + * discover the VI to address mapping. Cut-through PIO (CTPIO) is not available + * with 8k VI windows. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VI_WINDOW_MODE_OFST 72 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VI_WINDOW_MODE_LEN 1 +/* enum: Each VI occupies 8k as on Huntington and Medford. PIO is at offset 4k. + * CTPIO is not mapped. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VI_WINDOW_MODE_8K 0x0 +/* enum: Each VI occupies 16k. PIO is at offset 4k. CTPIO is at offset 12k. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VI_WINDOW_MODE_16K 0x1 +/* enum: Each VI occupies 64k. PIO is at offset 4k. CTPIO is at offset 12k. */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VI_WINDOW_MODE_64K 0x2 +/* Number of vFIFOs per adapter that can be used for VFIFO Stuffing + * (SF-115995-SW) in the present configuration of firmware and port mode. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VFIFO_STUFFING_NUM_VFIFOS_OFST 73 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VFIFO_STUFFING_NUM_VFIFOS_LEN 1 +/* Number of buffers per adapter that can be used for VFIFO Stuffing + * (SF-115995-SW) in the present configuration of firmware and port mode. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_OFST 74 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_VFIFO_STUFFING_NUM_CP_BUFFERS_LEN 2 +/* Entry count in the MAC stats array, including the final GENERATION_END + * entry. For MAC stats DMA, drivers should allocate a buffer large enough to + * hold at least this many 64-bit stats values, if they wish to receive all + * available stats. If the buffer is shorter than MAC_STATS_NUM_STATS * 8, the + * stats array returned will be truncated. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MAC_STATS_NUM_STATS_OFST 76 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_MAC_STATS_NUM_STATS_LEN 2 +/* Maximum supported value for MC_CMD_FILTER_OP_V3/MATCH_MARK_VALUE. This field + * will only be non-zero if MC_CMD_GET_CAPABILITIES/FILTER_ACTION_MARK is set. + */ +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FILTER_ACTION_MARK_MAX_OFST 80 +#define MC_CMD_GET_CAPABILITIES_V5_OUT_FILTER_ACTION_MARK_MAX_LEN 4 + /***********************************/ /* MC_CMD_V2_EXTN * Encapsulation for a v2 extended command @@ -13224,12 +13782,12 @@ #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_STATUS_OFST 4 #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_C0_STATUS_LEN 4 /* Enum values, see field(s): */ -/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT/CM1 */ +/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */ /* C(+1) status */ #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CP1_STATUS_OFST 8 #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CP1_STATUS_LEN 4 /* Enum values, see field(s): */ -/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT/CM1 */ +/* MC_CMD_KR_TUNE_LINK_TRAIN_CMD_IN/CM1 */ /* C(-1) value */ #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_VALUE_OFST 12 #define MC_CMD_KR_TUNE_LINK_TRAIN_CMD_OUT_CM1_VALUE_LEN 4 @@ -17542,5 +18100,65 @@ * description with possible error codes. */ #define MC_CMD_SET_NIC_GLOBAL_IN_FW_SUBVARIANT_NO_TX_CSUM 0x1 + + +/***********************************/ +/* MC_CMD_LTSSM_TRACE_POLL + * Medford2 hardware has support for logging all LTSSM state transitions to a + * hardware buffer. When built with WITH_LTSSM_TRACE=1, the firmware will + * periodially dump the contents of this hardware buffer to an internal + * firmware buffer for later extraction. + */ +#define MC_CMD_LTSSM_TRACE_POLL 0x12f +#undef MC_CMD_0x12f_PRIVILEGE_CTG + +#define MC_CMD_0x12f_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_LTSSM_TRACE_POLL_IN msgrequest: Read transitions from the firmware + * internal buffer. + */ +#define MC_CMD_LTSSM_TRACE_POLL_IN_LEN 4 +/* The maximum number of row that the caller can accept. The format of each row + * is defined in MC_CMD_LTSSM_TRACE_POLL_OUT. + */ +#define MC_CMD_LTSSM_TRACE_POLL_IN_MAX_ROW_COUNT_OFST 0 +#define MC_CMD_LTSSM_TRACE_POLL_IN_MAX_ROW_COUNT_LEN 4 + +/* MC_CMD_LTSSM_TRACE_POLL_OUT msgresponse */ +#define MC_CMD_LTSSM_TRACE_POLL_OUT_LENMIN 16 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_LENMAX 248 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_LEN(num) (8+8*(num)) +#define MC_CMD_LTSSM_TRACE_POLL_OUT_FLAGS_OFST 0 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_FLAGS_LEN 4 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_HW_BUFFER_OVERFLOW_LBN 0 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_HW_BUFFER_OVERFLOW_WIDTH 1 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_FW_BUFFER_OVERFLOW_LBN 1 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_FW_BUFFER_OVERFLOW_WIDTH 1 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_CONTINUES_LBN 31 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_CONTINUES_WIDTH 1 +/* The number of rows present in this response. */ +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROW_COUNT_OFST 4 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROW_COUNT_LEN 4 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROWS_OFST 8 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROWS_LEN 8 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROWS_LO_OFST 8 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROWS_HI_OFST 12 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROWS_MINNUM 0 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_ROWS_MAXNUM 30 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_LTSSM_STATE_LBN 0 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_LTSSM_STATE_WIDTH 6 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_RDLH_LINK_UP_LBN 6 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_RDLH_LINK_UP_WIDTH 1 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_WAKE_N_LBN 7 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_WAKE_N_WIDTH 1 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_TIMESTAMP_PS_LBN 8 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_TIMESTAMP_PS_WIDTH 24 +/* The time of the LTSSM transition. Times are reported as fractional + * microseconds since MC boot (wrapping at 2^32us). The fractional part is + * reported in picoseconds. 0 <= TIMESTAMP_PS < 1000000 timestamp in seconds = + * ((TIMESTAMP_US + TIMESTAMP_PS / 1000000) / 1000000) + */ +#define MC_CMD_LTSSM_TRACE_POLL_OUT_TIMESTAMP_US_OFST 12 +#define MC_CMD_LTSSM_TRACE_POLL_OUT_TIMESTAMP_US_LEN 4 #endif /* _SIENA_MC_DRIVER_PCOL_H */ From owner-svn-src-head@freebsd.org Thu Nov 29 06:45:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C251153D51; Thu, 29 Nov 2018 06:45:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5764877E44; Thu, 29 Nov 2018 06:45:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69C9315FB8; Thu, 29 Nov 2018 06:45:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6jGYo025624; Thu, 29 Nov 2018 06:45:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6jFAI025620; Thu, 29 Nov 2018 06:45:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290645.wAT6jFAI025620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341203 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5764877E44 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:45:19 -0000 Author: arybchik Date: Thu Nov 29 06:45:15 2018 New Revision: 341203 URL: https://svnweb.freebsd.org/changeset/base/341203 Log: sfxge(4): make RxQ type data an union The type is an internal interface. Single integer is insufficient to carry RxQ type-specific information in the case of equal stride super-buffer Rx mode (packet buffers per bucket, maximum DMA length, packet stride, head of line block timeout). Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18234 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:45:04 2018 (r341202) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:45:15 2018 (r341203) @@ -993,13 +993,15 @@ extern void ef10_rx_qenable( __in efx_rxq_t *erp); +union efx_rxq_type_data_u; + extern __checkReturn efx_rc_t ef10_rx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in uint32_t type_data, + __in const union efx_rxq_type_data_u *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:45:04 2018 (r341202) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:45:15 2018 (r341203) @@ -1027,7 +1027,7 @@ ef10_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in uint32_t type_data, + __in const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -1066,7 +1066,7 @@ ef10_rx_qcreate( break; #if EFSYS_OPT_RX_PACKED_STREAM case EFX_RXQ_TYPE_PACKED_STREAM: - switch (type_data) { + switch (type_data->ertd_packed_stream.eps_buf_size) { case EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M: ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; break; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:45:04 2018 (r341202) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:45:15 2018 (r341203) @@ -157,6 +157,16 @@ typedef struct efx_tx_ops_s { #endif } efx_tx_ops_t; +typedef union efx_rxq_type_data_u { + /* Dummy member to have non-empty union if no options are enabled */ + uint32_t ertd_dummy; +#if EFSYS_OPT_RX_PACKED_STREAM + struct { + uint32_t eps_buf_size; + } ertd_packed_stream; +#endif +} efx_rxq_type_data_t; + typedef struct efx_rx_ops_s { efx_rc_t (*erxo_init)(efx_nic_t *); void (*erxo_fini)(efx_nic_t *); @@ -193,7 +203,8 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_qflush)(efx_rxq_t *); void (*erxo_qenable)(efx_rxq_t *); efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, - unsigned int, efx_rxq_type_t, uint32_t, + unsigned int, efx_rxq_type_t, + const efx_rxq_type_data_t *, efsys_mem_t *, size_t, uint32_t, unsigned int, efx_evq_t *, efx_rxq_t *); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:45:04 2018 (r341202) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:45:15 2018 (r341203) @@ -136,7 +136,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in uint32_t type_data, + __in const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -780,7 +780,7 @@ efx_rx_qcreate_internal( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in uint32_t type_data, + __in const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -841,8 +841,8 @@ efx_rx_qcreate( __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp) { - return efx_rx_qcreate_internal(enp, index, label, type, 0, esmp, ndescs, - id, flags, eep, erpp); + return efx_rx_qcreate_internal(enp, index, label, type, NULL, + esmp, ndescs, id, flags, eep, erpp); } #if EFSYS_OPT_RX_PACKED_STREAM @@ -858,8 +858,14 @@ efx_rx_qcreate_packed_stream( __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp) { + efx_rxq_type_data_t type_data; + + memset(&type_data, 0, sizeof (type_data)); + + type_data.ertd_packed_stream.eps_buf_size = ps_buf_size; + return efx_rx_qcreate_internal(enp, index, label, - EFX_RXQ_TYPE_PACKED_STREAM, ps_buf_size, esmp, ndescs, + EFX_RXQ_TYPE_PACKED_STREAM, &type_data, esmp, ndescs, 0 /* id unused on EF10 */, EFX_RXQ_FLAG_NONE, eep, erpp); } @@ -1510,7 +1516,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in uint32_t type_data, + __in const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, From owner-svn-src-head@freebsd.org Thu Nov 29 06:45:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA6A01153D98; Thu, 29 Nov 2018 06:45:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C6B577F72; Thu, 29 Nov 2018 06:45:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D09E015FBD; Thu, 29 Nov 2018 06:45:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6jReG025686; Thu, 29 Nov 2018 06:45:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6jRRJ025683; Thu, 29 Nov 2018 06:45:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290645.wAT6jRRJ025683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341204 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C6B577F72 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:45:32 -0000 Author: arybchik Date: Thu Nov 29 06:45:26 2018 New Revision: 341204 URL: https://svnweb.freebsd.org/changeset/base/341204 Log: sfxge(4): detect equal stride super-buffer support Equal stride super-buffer Rx mode is supported on Medford2 by DPDK firmware variant. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18235 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:45:15 2018 (r341203) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:45:26 2018 (r341204) @@ -1141,6 +1141,12 @@ ef10_get_datapath_caps( else encp->enc_rx_var_packed_stream_supported = B_FALSE; + /* Check if the firmware supports equal stride super-buffer mode */ + if (CAP_FLAGS2(req, EQUAL_STRIDE_SUPER_BUFFER)) + encp->enc_rx_es_super_buffer_supported = B_TRUE; + else + encp->enc_rx_es_super_buffer_supported = B_FALSE; + /* Check if the firmware supports FW subvariant w/o Tx checksumming */ if (CAP_FLAGS2(req, FW_SUBVARIANT_NO_TX_CSUM)) encp->enc_fw_subvariant_no_tx_csum_supported = B_TRUE; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:45:15 2018 (r341203) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:45:26 2018 (r341204) @@ -1298,6 +1298,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_init_evq_v2_supported; boolean_t enc_rx_packed_stream_supported; boolean_t enc_rx_var_packed_stream_supported; + boolean_t enc_rx_es_super_buffer_supported; boolean_t enc_fw_subvariant_no_tx_csum_supported; boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:45:15 2018 (r341203) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:45:26 2018 (r341204) @@ -190,6 +190,7 @@ siena_board_cfg( encp->enc_allow_set_mac_with_installed_filters = B_TRUE; encp->enc_rx_packed_stream_supported = B_FALSE; encp->enc_rx_var_packed_stream_supported = B_FALSE; + encp->enc_rx_es_super_buffer_supported = B_FALSE; encp->enc_fw_subvariant_no_tx_csum_supported = B_FALSE; /* Siena supports two 10G ports, and 8 lanes of PCIe Gen2 */ From owner-svn-src-head@freebsd.org Thu Nov 29 06:45:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25E3C1153DE3; Thu, 29 Nov 2018 06:45:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B34B780A2; Thu, 29 Nov 2018 06:45:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56F7415FC6; Thu, 29 Nov 2018 06:45:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6ject025751; Thu, 29 Nov 2018 06:45:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6jcs6025743; Thu, 29 Nov 2018 06:45:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290645.wAT6jcs6025743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341205 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B34B780A2 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.55)[0.554,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.484,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:45:43 -0000 Author: arybchik Date: Thu Nov 29 06:45:38 2018 New Revision: 341205 URL: https://svnweb.freebsd.org/changeset/base/341205 Log: sfxge(4): support equal stride super-buffer Rx mode Equal stride super-buffer Rx mode is supported by DPDK firmware variant. One Rx descriptor provides many Rx buffers to firmware. Rx buffers follow each other with specified stride. Also it supports head of line blocking with timeout to address drops when no Rx descriptors are available. So it gives extra time to the driver to provide Rx descriptors before drop. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18236 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/ef10_ev.c Thu Nov 29 06:45:38 2018 (r341205) @@ -776,7 +776,7 @@ ef10_ev_qstats_update( } #endif /* EFSYS_OPT_QSTATS */ -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER static __checkReturn boolean_t ef10_ev_rx_packed_stream( @@ -815,7 +815,18 @@ ef10_ev_rx_packed_stream( if (new_buffer) { flags |= EFX_PKT_PACKED_STREAM_NEW_BUFFER; +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * If both packed stream and equal stride super-buffer + * modes are compiled in, in theory credits should be + * be maintained for packed stream only, but right now + * these modes are not distinguished in the event queue + * Rx queue state and it is OK to increment the counter + * regardless (it might be event cheaper than branching + * since neighbour structure member are updated as well). + */ eersp->eers_rx_packed_stream_credits++; +#endif eersp->eers_rx_read_ptr++; } current_id = eersp->eers_rx_read_ptr & eersp->eers_rx_mask; @@ -857,7 +868,7 @@ deliver: return (should_abort); } -#endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#endif /* EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER */ static __checkReturn boolean_t ef10_ev_rx( @@ -891,7 +902,7 @@ ef10_ev_rx( label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); eersp = &eep->ee_rxq_state[label]; -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER /* * Packed stream events are very different, * so handle them separately @@ -1391,8 +1402,9 @@ ef10_ev_rxlabel_init( __in efx_rxq_type_t type) { efx_evq_rxq_state_t *eersp; -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER boolean_t packed_stream = (type == EFX_RXQ_TYPE_PACKED_STREAM); + boolean_t es_super_buffer = (type == EFX_RXQ_TYPE_ES_SUPER_BUFFER); #endif _NOTE(ARGUNUSED(type)) @@ -1414,9 +1426,11 @@ ef10_ev_rxlabel_init( eersp->eers_rx_read_ptr = 0; #endif eersp->eers_rx_mask = erp->er_mask; -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER eersp->eers_rx_stream_npackets = 0; - eersp->eers_rx_packed_stream = packed_stream; + eersp->eers_rx_packed_stream = packed_stream || es_super_buffer; +#endif +#if EFSYS_OPT_RX_PACKED_STREAM if (packed_stream) { eersp->eers_rx_packed_stream_credits = (eep->ee_mask + 1) / EFX_DIV_ROUND_UP(EFX_RX_PACKED_STREAM_MEM_PER_CREDIT, @@ -1450,9 +1464,11 @@ ef10_ev_rxlabel_fini( eersp->eers_rx_read_ptr = 0; eersp->eers_rx_mask = 0; -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER eersp->eers_rx_stream_npackets = 0; eersp->eers_rx_packed_stream = B_FALSE; +#endif +#if EFSYS_OPT_RX_PACKED_STREAM eersp->eers_rx_packed_stream_credits = 0; #endif } Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:45:38 2018 (r341205) @@ -1242,6 +1242,16 @@ efx_mcdi_set_nic_global( #endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#if EFSYS_OPT_RX_ES_SUPER_BUFFER + +/* + * Maximum DMA length and buffer stride alignment. + * (see SF-119419-TC, 3.2) + */ +#define EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT 64 + +#endif + #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 29 06:45:38 2018 (r341205) @@ -48,12 +48,16 @@ efx_mcdi_init_rxq( __in efsys_mem_t *esmp, __in boolean_t disable_scatter, __in boolean_t want_inner_classes, - __in uint32_t ps_bufsize) + __in uint32_t ps_bufsize, + __in uint32_t es_bufs_per_desc, + __in uint32_t es_max_dma_len, + __in uint32_t es_buf_stride, + __in uint32_t hol_block_timeout) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_INIT_RXQ_EXT_IN_LEN, - MC_CMD_INIT_RXQ_EXT_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_INIT_RXQ_V3_IN_LEN, + MC_CMD_INIT_RXQ_V3_OUT_LEN)]; int npages = EFX_RXQ_NBUFS(ndescs); int i; efx_qword_t *dma_addr; @@ -71,6 +75,8 @@ efx_mcdi_init_rxq( if (ps_bufsize > 0) dma_mode = MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM; + else if (es_bufs_per_desc > 0) + dma_mode = MC_CMD_INIT_RXQ_V3_IN_EQUAL_STRIDE_SUPER_BUFFER; else dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET; @@ -97,9 +103,9 @@ efx_mcdi_init_rxq( (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_RXQ; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_INIT_RXQ_EXT_IN_LEN; + req.emr_in_length = MC_CMD_INIT_RXQ_V3_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_INIT_RXQ_EXT_OUT_LEN; + req.emr_out_length = MC_CMD_INIT_RXQ_V3_OUT_LEN; MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_SIZE, ndescs); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_TARGET_EVQ, target_evq); @@ -119,6 +125,19 @@ efx_mcdi_init_rxq( MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_OWNER_ID, 0); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); + if (es_bufs_per_desc > 0) { + MCDI_IN_SET_DWORD(req, + INIT_RXQ_V3_IN_ES_PACKET_BUFFERS_PER_BUCKET, + es_bufs_per_desc); + MCDI_IN_SET_DWORD(req, + INIT_RXQ_V3_IN_ES_MAX_DMA_LEN, es_max_dma_len); + MCDI_IN_SET_DWORD(req, + INIT_RXQ_V3_IN_ES_PACKET_STRIDE, es_buf_stride); + MCDI_IN_SET_DWORD(req, + INIT_RXQ_V3_IN_ES_HEAD_OF_LINE_BLOCK_TIMEOUT, + hol_block_timeout); + } + dma_addr = MCDI_IN2(req, efx_qword_t, INIT_RXQ_IN_DMA_ADDR); addr = EFSYS_MEM_ADDR(esmp); @@ -1040,6 +1059,10 @@ ef10_rx_qcreate( boolean_t disable_scatter; boolean_t want_inner_classes; unsigned int ps_buf_size; + uint32_t es_bufs_per_desc = 0; + uint32_t es_max_dma_len = 0; + uint32_t es_buf_stride = 0; + uint32_t hol_block_timeout = 0; _NOTE(ARGUNUSED(id, erp, type_data)) @@ -1088,6 +1111,19 @@ ef10_rx_qcreate( } break; #endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#if EFSYS_OPT_RX_ES_SUPER_BUFFER + case EFX_RXQ_TYPE_ES_SUPER_BUFFER: + ps_buf_size = 0; + es_bufs_per_desc = + type_data->ertd_es_super_buffer.eessb_bufs_per_desc; + es_max_dma_len = + type_data->ertd_es_super_buffer.eessb_max_dma_len; + es_buf_stride = + type_data->ertd_es_super_buffer.eessb_buf_stride; + hol_block_timeout = + type_data->ertd_es_super_buffer.eessb_hol_block_timeout; + break; +#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ default: rc = ENOTSUP; goto fail4; @@ -1111,6 +1147,27 @@ ef10_rx_qcreate( EFSYS_ASSERT(ps_buf_size == 0); #endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#if EFSYS_OPT_RX_ES_SUPER_BUFFER + if (es_bufs_per_desc > 0) { + if (encp->enc_rx_es_super_buffer_supported == B_FALSE) { + rc = ENOTSUP; + goto fail7; + } + if (!IS_P2ALIGNED(es_max_dma_len, + EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { + rc = EINVAL; + goto fail8; + } + if (!IS_P2ALIGNED(es_buf_stride, + EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { + rc = EINVAL; + goto fail9; + } + } +#else /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ + EFSYS_ASSERT(es_bufs_per_desc == 0); +#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ + /* Scatter can only be disabled if the firmware supports doing so */ if (flags & EFX_RXQ_FLAG_SCATTER) disable_scatter = B_FALSE; @@ -1124,8 +1181,9 @@ ef10_rx_qcreate( if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index, esmp, disable_scatter, want_inner_classes, - ps_buf_size)) != 0) - goto fail7; + ps_buf_size, es_bufs_per_desc, es_max_dma_len, + es_buf_stride, hol_block_timeout)) != 0) + goto fail10; erp->er_eep = eep; erp->er_label = label; @@ -1136,8 +1194,16 @@ ef10_rx_qcreate( return (0); +fail10: + EFSYS_PROBE(fail10); +#if EFSYS_OPT_RX_ES_SUPER_BUFFER +fail9: + EFSYS_PROBE(fail9); +fail8: + EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); +#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ #if EFSYS_OPT_RX_PACKED_STREAM fail6: EFSYS_PROBE(fail6); Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/efsys.h Thu Nov 29 06:45:38 2018 (r341205) @@ -285,6 +285,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_RX_PACKED_STREAM 0 +#define EFSYS_OPT_RX_ES_SUPER_BUFFER 0 + #define EFSYS_OPT_TUNNEL 0 #define EFSYS_OPT_FW_SUBVARIANT_AWARE 0 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:45:38 2018 (r341205) @@ -1893,7 +1893,7 @@ typedef __checkReturn boolean_t __in uint32_t size, __in uint16_t flags); -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER /* * Packed stream mode is documented in SF-112241-TC. @@ -1903,6 +1903,13 @@ typedef __checkReturn boolean_t * packets are put there in a continuous stream. * The main advantage of such an approach is that RX queue refilling * happens much less frequently. + * + * Equal stride packed stream mode is documented in SF-119419-TC. + * The general idea is to utilize advantages of the packed stream, + * but avoid indirection in packets representation. + * The main advantage of such an approach is that RX queue refilling + * happens much less frequently and packets buffers are independent + * from upper layers point of view. */ typedef __checkReturn boolean_t @@ -2003,7 +2010,7 @@ typedef __checkReturn boolean_t typedef struct efx_ev_callbacks_s { efx_initialized_ev_t eec_initialized; efx_rx_ev_t eec_rx; -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER efx_rx_ps_ev_t eec_rx_ps; #endif efx_tx_ev_t eec_tx; @@ -2310,6 +2317,7 @@ efx_pseudo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, EFX_RXQ_TYPE_PACKED_STREAM, + EFX_RXQ_TYPE_ES_SUPER_BUFFER, EFX_RXQ_NTYPES } efx_rxq_type_t; @@ -2358,6 +2366,28 @@ efx_rx_qcreate_packed_stream( __in uint32_t ps_buf_size, __in efsys_mem_t *esmp, __in size_t ndescs, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp); + +#endif + +#if EFSYS_OPT_RX_ES_SUPER_BUFFER + +/* Maximum head-of-line block timeout in nanoseconds */ +#define EFX_RXQ_ES_SUPER_BUFFER_HOL_BLOCK_MAX (400U * 1000 * 1000) + +extern __checkReturn efx_rc_t +efx_rx_qcreate_es_super_buffer( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in uint32_t n_bufs_per_desc, + __in uint32_t max_dma_len, + __in uint32_t buf_stride, + __in uint32_t hol_block_timeout, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in unsigned int flags, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp); Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/efx_check.h Thu Nov 29 06:45:38 2018 (r341205) @@ -370,6 +370,13 @@ # endif #endif +#if EFSYS_OPT_RX_ES_SUPER_BUFFER +/* Support equal stride super-buffer mode */ +# if !(EFSYS_OPT_MEDFORD2) +# error "ES_SUPER_BUFFER requires MEDFORD2" +# endif +#endif + /* Support hardware assistance for tunnels */ #if EFSYS_OPT_TUNNEL # if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2) Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:45:38 2018 (r341205) @@ -165,6 +165,14 @@ typedef union efx_rxq_type_data_u { uint32_t eps_buf_size; } ertd_packed_stream; #endif +#if EFSYS_OPT_RX_ES_SUPER_BUFFER + struct { + uint32_t eessb_bufs_per_desc; + uint32_t eessb_max_dma_len; + uint32_t eessb_buf_stride; + uint32_t eessb_hol_block_timeout; + } ertd_es_super_buffer; +#endif } efx_rxq_type_data_t; typedef struct efx_rx_ops_s { @@ -763,9 +771,11 @@ typedef boolean_t (*efx_ev_handler_t)(efx_evq_t *, efx typedef struct efx_evq_rxq_state_s { unsigned int eers_rx_read_ptr; unsigned int eers_rx_mask; -#if EFSYS_OPT_RX_PACKED_STREAM +#if EFSYS_OPT_RX_PACKED_STREAM || EFSYS_OPT_RX_ES_SUPER_BUFFER unsigned int eers_rx_stream_npackets; boolean_t eers_rx_packed_stream; +#endif +#if EFSYS_OPT_RX_PACKED_STREAM unsigned int eers_rx_packed_stream_credits; #endif } efx_evq_rxq_state_t; Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:45:26 2018 (r341204) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Nov 29 06:45:38 2018 (r341205) @@ -871,6 +871,58 @@ efx_rx_qcreate_packed_stream( #endif +#if EFSYS_OPT_RX_ES_SUPER_BUFFER + + __checkReturn efx_rc_t +efx_rx_qcreate_es_super_buffer( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in uint32_t n_bufs_per_desc, + __in uint32_t max_dma_len, + __in uint32_t buf_stride, + __in uint32_t hol_block_timeout, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in unsigned int flags, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp) +{ + efx_rc_t rc; + efx_rxq_type_data_t type_data; + + if (hol_block_timeout > EFX_RXQ_ES_SUPER_BUFFER_HOL_BLOCK_MAX) { + rc = EINVAL; + goto fail1; + } + + memset(&type_data, 0, sizeof (type_data)); + + type_data.ertd_es_super_buffer.eessb_bufs_per_desc = n_bufs_per_desc; + type_data.ertd_es_super_buffer.eessb_max_dma_len = max_dma_len; + type_data.ertd_es_super_buffer.eessb_buf_stride = buf_stride; + type_data.ertd_es_super_buffer.eessb_hol_block_timeout = + hol_block_timeout; + + rc = efx_rx_qcreate_internal(enp, index, label, + EFX_RXQ_TYPE_ES_SUPER_BUFFER, &type_data, esmp, ndescs, + 0 /* id unused on EF10 */, flags, eep, erpp); + if (rc != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif + + void efx_rx_qdestroy( __in efx_rxq_t *erp) From owner-svn-src-head@freebsd.org Thu Nov 29 06:45:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BB101153E4E; Thu, 29 Nov 2018 06:45:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B4DE781F5; Thu, 29 Nov 2018 06:45:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B0DB15FC8; Thu, 29 Nov 2018 06:45:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6jpB1025807; Thu, 29 Nov 2018 06:45:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6jpkO025806; Thu, 29 Nov 2018 06:45:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290645.wAT6jpkO025806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341206 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B4DE781F5 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:45:54 -0000 Author: arybchik Date: Thu Nov 29 06:45:50 2018 New Revision: 341206 URL: https://svnweb.freebsd.org/changeset/base/341206 Log: sfxge(4): add equal stride super-buffer prefix layout Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18237 Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Thu Nov 29 06:45:38 2018 (r341205) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Thu Nov 29 06:45:50 2018 (r341206) @@ -726,6 +726,21 @@ extern "C" { #define ES_DZ_PS_RX_PREFIX_ORIG_LEN_LBN 48 #define ES_DZ_PS_RX_PREFIX_ORIG_LEN_WIDTH 16 +/* Equal stride super-buffer RX packet prefix (see SF-119419-TC) */ +#define ES_EZ_ESSB_RX_PREFIX_LEN 8 +#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_LBN 0 +#define ES_EZ_ESSB_RX_PREFIX_DATA_LEN_WIDTH 16 +#define ES_EZ_ESSB_RX_PREFIX_MARK_LBN 16 +#define ES_EZ_ESSB_RX_PREFIX_MARK_WIDTH 8 +#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_LBN 28 +#define ES_EZ_ESSB_RX_PREFIX_HASH_VALID_WIDTH 1 +#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_LBN 29 +#define ES_EZ_ESSB_RX_PREFIX_MARK_VALID_WIDTH 1 +#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_LBN 30 +#define ES_EZ_ESSB_RX_PREFIX_MATCH_FLAG_WIDTH 1 +#define ES_EZ_ESSB_RX_PREFIX_HASH_LBN 32 +#define ES_EZ_ESSB_RX_PREFIX_HASH_WIDTH 32 + /* * An extra flag for the packed stream mode, * signalling the start of a new buffer From owner-svn-src-head@freebsd.org Thu Nov 29 06:46:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 173091153EAD; Thu, 29 Nov 2018 06:46:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9DC078308; Thu, 29 Nov 2018 06:46:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B564215FCD; Thu, 29 Nov 2018 06:46:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6k2jK025870; Thu, 29 Nov 2018 06:46:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6k2rw025867; Thu, 29 Nov 2018 06:46:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290646.wAT6k2rw025867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341207 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9DC078308 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:46:05 -0000 Author: arybchik Date: Thu Nov 29 06:46:01 2018 New Revision: 341207 URL: https://svnweb.freebsd.org/changeset/base/341207 Log: sfxge(4): get actions MARK and FLAG support Filter actions MARK and FLAG are supported on Medford2 by DPDK firmware variant. Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18238 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:45:50 2018 (r341206) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:01 2018 (r341207) @@ -1321,6 +1321,16 @@ ef10_get_datapath_caps( */ encp->enc_rx_scale_l4_hash_supported = B_TRUE; } + /* Check if the firmware supports "FLAG" and "MARK" filter actions */ + if (CAP_FLAGS2(req, FILTER_ACTION_FLAG)) + encp->enc_filter_action_flag_supported = B_TRUE; + else + encp->enc_filter_action_flag_supported = B_FALSE; + + if (CAP_FLAGS2(req, FILTER_ACTION_MARK)) + encp->enc_filter_action_mark_supported = B_TRUE; + else + encp->enc_filter_action_mark_supported = B_FALSE; #undef CAP_FLAGS1 #undef CAP_FLAGS2 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:45:50 2018 (r341206) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:01 2018 (r341207) @@ -1321,6 +1321,9 @@ typedef struct efx_nic_cfg_s { /* Firmware support for extended MAC_STATS buffer */ uint32_t enc_mac_stats_nstats; boolean_t enc_fec_counters; + /* Firmware support for "FLAG" and "MARK" filter actions */ + boolean_t enc_filter_action_flag_supported; + boolean_t enc_filter_action_mark_supported; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:45:50 2018 (r341206) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:46:01 2018 (r341207) @@ -201,6 +201,9 @@ siena_board_cfg( encp->enc_mac_stats_nstats = MC_CMD_MAC_NSTATS; + encp->enc_filter_action_flag_supported = B_FALSE; + encp->enc_filter_action_mark_supported = B_FALSE; + return (0); fail2: From owner-svn-src-head@freebsd.org Thu Nov 29 06:46:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DE8D1153EFE; Thu, 29 Nov 2018 06:46:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B730E783ED; Thu, 29 Nov 2018 06:46:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21C5215FD2; Thu, 29 Nov 2018 06:46:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6kB3T025926; Thu, 29 Nov 2018 06:46:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6kAkT025924; Thu, 29 Nov 2018 06:46:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290646.wAT6kAkT025924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341208 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B730E783ED X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:46:14 -0000 Author: arybchik Date: Thu Nov 29 06:46:10 2018 New Revision: 341208 URL: https://svnweb.freebsd.org/changeset/base/341208 Log: sfxge(4): support MARK and FLAG actions in filters This patch adds support for DPDK rte_flow "MARK" and "FLAG" filter actions to filters on EF10 family NICs. Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18239 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:46:01 2018 (r341207) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:46:10 2018 (r341208) @@ -199,7 +199,7 @@ efx_mcdi_filter_op_add( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, + uint8_t payload[MAX(MC_CMD_FILTER_OP_V3_IN_LEN, MC_CMD_FILTER_OP_EXT_OUT_LEN)]; efx_filter_match_flags_t match_flags; efx_rc_t rc; @@ -207,7 +207,7 @@ efx_mcdi_filter_op_add( memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; + req.emr_in_length = MC_CMD_FILTER_OP_V3_IN_LEN; req.emr_out_buf = payload; req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; @@ -343,16 +343,37 @@ efx_mcdi_filter_op_add( spec->efs_ifrm_loc_mac, EFX_MAC_ADDR_LEN); } + /* + * Set the "MARK" or "FLAG" action for all packets matching this filter + * if necessary (only useful with equal stride packed stream Rx mode + * which provide the information in pseudo-header). + * These actions require MC_CMD_FILTER_OP_V3_IN msgrequest. + */ + if ((spec->efs_flags & EFX_FILTER_FLAG_ACTION_MARK) && + (spec->efs_flags & EFX_FILTER_FLAG_ACTION_FLAG)) { + rc = EINVAL; + goto fail3; + } + if (spec->efs_flags & EFX_FILTER_FLAG_ACTION_MARK) { + MCDI_IN_SET_DWORD(req, FILTER_OP_V3_IN_MATCH_ACTION, + MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_MARK); + MCDI_IN_SET_DWORD(req, FILTER_OP_V3_IN_MATCH_MARK_VALUE, + spec->efs_mark); + } else if (spec->efs_flags & EFX_FILTER_FLAG_ACTION_FLAG) { + MCDI_IN_SET_DWORD(req, FILTER_OP_V3_IN_MATCH_ACTION, + MC_CMD_FILTER_OP_V3_IN_MATCH_ACTION_FLAG); + } + efx_mcdi_execute(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail3; + goto fail4; } if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; - goto fail4; + goto fail5; } handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO); @@ -360,6 +381,8 @@ efx_mcdi_filter_op_add( return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:01 2018 (r341207) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:10 2018 (r341208) @@ -2651,6 +2651,10 @@ efx_tx_qdestroy( #define EFX_FILTER_FLAG_RX 0x08 /* Filter is for TX */ #define EFX_FILTER_FLAG_TX 0x10 +/* Set match flag on the received packet */ +#define EFX_FILTER_FLAG_ACTION_FLAG 0x20 +/* Set match mark on the received packet */ +#define EFX_FILTER_FLAG_ACTION_MARK 0x40 typedef uint8_t efx_filter_flags_t; @@ -2723,6 +2727,8 @@ typedef struct efx_filter_spec_s { efx_filter_flags_t efs_flags; uint16_t efs_dmaq_id; uint32_t efs_rss_context; + uint32_t efs_mark; + /* Fields below here are hashed for software filter lookup */ uint16_t efs_outer_vid; uint16_t efs_inner_vid; uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Thu Nov 29 06:46:01 2018 (r341207) +++ head/sys/dev/sfxge/common/efx_filter.c Thu Nov 29 06:46:10 2018 (r341208) @@ -103,12 +103,33 @@ efx_filter_insert( __inout efx_filter_spec_t *spec) { const efx_filter_ops_t *efop = enp->en_efop; + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + efx_rc_t rc; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER); EFSYS_ASSERT3P(spec, !=, NULL); EFSYS_ASSERT3U(spec->efs_flags, &, EFX_FILTER_FLAG_RX); + if ((spec->efs_flags & EFX_FILTER_FLAG_ACTION_MARK) && + !encp->enc_filter_action_mark_supported) { + rc = ENOTSUP; + goto fail1; + } + + if ((spec->efs_flags & EFX_FILTER_FLAG_ACTION_FLAG) && + !encp->enc_filter_action_flag_supported) { + rc = ENOTSUP; + goto fail2; + } + return (efop->efo_add(enp, spec, B_FALSE)); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } __checkReturn efx_rc_t From owner-svn-src-head@freebsd.org Thu Nov 29 06:46:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 903701153F6B; Thu, 29 Nov 2018 06:46:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5681178550; Thu, 29 Nov 2018 06:46:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83AB315FD6; Thu, 29 Nov 2018 06:46:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6kM6f025985; Thu, 29 Nov 2018 06:46:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6kLW6025982; Thu, 29 Nov 2018 06:46:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290646.wAT6kLW6025982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341209 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5681178550 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:46:28 -0000 Author: arybchik Date: Thu Nov 29 06:46:21 2018 New Revision: 341209 URL: https://svnweb.freebsd.org/changeset/base/341209 Log: sfxge(4): get max supported value for action MARK The mark value for MATCH_ACTION_MARK has a maximum value. Requesting a value larger than the maximum will cause the filter insertion to fail with EINVAL. This patch allows the driver to check the value at the filter validation. Submitted by: Roman Zhukov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18240 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:10 2018 (r341208) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:21 2018 (r341209) @@ -1023,7 +1023,7 @@ ef10_get_datapath_caps( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V4_OUT_LEN)]; + MC_CMD_GET_CAPABILITIES_V5_OUT_LEN)]; efx_rc_t rc; if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) @@ -1035,7 +1035,7 @@ ef10_get_datapath_caps( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CAPABILITIES_V4_OUT_LEN; + req.emr_out_length = MC_CMD_GET_CAPABILITIES_V5_OUT_LEN; efx_mcdi_execute_quiet(enp, &req); @@ -1331,6 +1331,13 @@ ef10_get_datapath_caps( encp->enc_filter_action_mark_supported = B_TRUE; else encp->enc_filter_action_mark_supported = B_FALSE; + + /* Get maximum supported value for "MARK" filter action */ + if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V5_OUT_LEN) + encp->enc_filter_action_mark_max = MCDI_OUT_DWORD(req, + GET_CAPABILITIES_V5_OUT_FILTER_ACTION_MARK_MAX); + else + encp->enc_filter_action_mark_max = 0; #undef CAP_FLAGS1 #undef CAP_FLAGS2 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:10 2018 (r341208) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:21 2018 (r341209) @@ -1324,6 +1324,7 @@ typedef struct efx_nic_cfg_s { /* Firmware support for "FLAG" and "MARK" filter actions */ boolean_t enc_filter_action_flag_supported; boolean_t enc_filter_action_mark_supported; + uint32_t enc_filter_action_mark_max; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:46:10 2018 (r341208) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 29 06:46:21 2018 (r341209) @@ -203,6 +203,7 @@ siena_board_cfg( encp->enc_filter_action_flag_supported = B_FALSE; encp->enc_filter_action_mark_supported = B_FALSE; + encp->enc_filter_action_mark_max = 0; return (0); From owner-svn-src-head@freebsd.org Thu Nov 29 06:46:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D99B1153F9F; Thu, 29 Nov 2018 06:46:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E467378667; Thu, 29 Nov 2018 06:46:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4C1515FDC; Thu, 29 Nov 2018 06:46:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6kXFd026045; Thu, 29 Nov 2018 06:46:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6kXTY026044; Thu, 29 Nov 2018 06:46:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290646.wAT6kXTY026044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341210 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E467378667 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:46:39 -0000 Author: arybchik Date: Thu Nov 29 06:46:33 2018 New Revision: 341210 URL: https://svnweb.freebsd.org/changeset/base/341210 Log: sfxge(4): generate Medford2 RxDP stats Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18241 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:21 2018 (r341209) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:33 2018 (r341210) @@ -364,7 +364,7 @@ efx_intr_fini( #if EFSYS_OPT_MAC_STATS -/* START MKCONFIG GENERATED EfxHeaderMacBlock 7d59c0d68431a5d1 */ +/* START MKCONFIG GENERATED EfxHeaderMacBlock ea466a9bc8789994 */ typedef enum efx_mac_stat_e { EFX_MAC_RX_OCTETS, EFX_MAC_RX_PKTS, @@ -469,6 +469,9 @@ typedef enum efx_mac_stat_e { EFX_MAC_CTPIO_FALLBACK, EFX_MAC_CTPIO_POISON, EFX_MAC_CTPIO_ERASE, + EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC, + EFX_MAC_RXDP_HLB_IDLE, + EFX_MAC_RXDP_HLB_TIMEOUT, EFX_MAC_NSTATS } efx_mac_stat_t; Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Thu Nov 29 06:46:21 2018 (r341209) +++ head/sys/dev/sfxge/common/efx_mac.c Thu Nov 29 06:46:33 2018 (r341210) @@ -521,7 +521,7 @@ efx_mac_filter_default_rxq_clear( #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED EfxMacStatNamesBlock 3cfa8780abd28993 */ +/* START MKCONFIG GENERATED EfxMacStatNamesBlock 1a45a82fcfb30c1b */ static const char * const __efx_mac_stat_name[] = { "rx_octets", "rx_pkts", @@ -626,6 +626,9 @@ static const char * const __efx_mac_stat_name[] = { "ctpio_fallback", "ctpio_poison", "ctpio_erase", + "rxdp_scatter_disabled_trunc", + "rxdp_hlb_idle", + "rxdp_hlb_timeout", }; /* END MKCONFIG GENERATED EfxMacStatNamesBlock */ From owner-svn-src-head@freebsd.org Thu Nov 29 06:46:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1BA61153FE5; Thu, 29 Nov 2018 06:46:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D57327874D; Thu, 29 Nov 2018 06:46:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F72515FE1; Thu, 29 Nov 2018 06:46:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6kiGO026102; Thu, 29 Nov 2018 06:46:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6kieO026101; Thu, 29 Nov 2018 06:46:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290646.wAT6kieO026101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341211 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D57327874D X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:46:47 -0000 Author: arybchik Date: Thu Nov 29 06:46:44 2018 New Revision: 341211 URL: https://svnweb.freebsd.org/changeset/base/341211 Log: sfxge(4): support RxDP scatter disabled truncate counter Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18242 Modified: head/sys/dev/sfxge/common/ef10_mac.c Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:46:33 2018 (r341210) +++ head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:46:44 2018 (r341211) @@ -560,8 +560,21 @@ ef10_mac_stats_get_mask( goto fail7; } + if (encp->enc_mac_stats_nstats >= MC_CMD_MAC_NSTATS_V4) { + const struct efx_mac_stats_range ef10_rxdp_sdt[] = { + { EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC, + EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC }, + }; + + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_rxdp_sdt, EFX_ARRAY_SIZE(ef10_rxdp_sdt))) != 0) + goto fail8; + } + return (0); +fail8: + EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); fail6: @@ -1004,6 +1017,14 @@ ef10_mac_stats_update( EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_ERASE, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_ERASE]), &value); + + if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS_V4) + goto done; + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_SCATTER_DISABLED_TRUNC, + &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC]), + &value); done: /* Read START generation counter */ From owner-svn-src-head@freebsd.org Thu Nov 29 06:46:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D40BB1154035; Thu, 29 Nov 2018 06:46:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8520478865; Thu, 29 Nov 2018 06:46:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF55915FE6; Thu, 29 Nov 2018 06:46:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6ktJo026161; Thu, 29 Nov 2018 06:46:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6ktDn026158; Thu, 29 Nov 2018 06:46:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290646.wAT6ktDn026158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341212 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8520478865 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:46:59 -0000 Author: arybchik Date: Thu Nov 29 06:46:55 2018 New Revision: 341212 URL: https://svnweb.freebsd.org/changeset/base/341212 Log: sfxge(4): add Medford2 head-of-line blocking stats These stats are availble on Medford2 DPDK firmware variant which support equal stride super-buffer Rx mode. RXDP_HLB_IDLE capability bit is set when the stats are available. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18243 Modified: head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:46:44 2018 (r341211) +++ head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:46:55 2018 (r341212) @@ -571,8 +571,19 @@ ef10_mac_stats_get_mask( goto fail8; } + if (encp->enc_hlb_counters) { + const struct efx_mac_stats_range ef10_hlb[] = { + { EFX_MAC_RXDP_HLB_IDLE, EFX_MAC_RXDP_HLB_TIMEOUT }, + }; + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_hlb, EFX_ARRAY_SIZE(ef10_hlb))) != 0) + goto fail9; + } + return (0); +fail9: + EFSYS_PROBE(fail9); fail8: EFSYS_PROBE(fail8); fail7: @@ -1025,6 +1036,13 @@ ef10_mac_stats_update( &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC]), &value); + + /* Head-of-line blocking */ + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_IDLE, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_IDLE]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_TIMEOUT, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_TIMEOUT]), &value); done: /* Read START generation counter */ Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:44 2018 (r341211) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:55 2018 (r341212) @@ -1272,6 +1272,12 @@ ef10_get_datapath_caps( else encp->enc_fec_counters = B_FALSE; + /* Check if the firmware provides head-of-line blocking counters */ + if (CAP_FLAGS2(req, RXDP_HLB_IDLE)) + encp->enc_hlb_counters = B_TRUE; + else + encp->enc_hlb_counters = B_FALSE; + if (CAP_FLAGS1(req, RX_RSS_LIMITED)) { /* Only one exclusive RSS context is available per port. */ encp->enc_rx_scale_max_exclusive_contexts = 1; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:44 2018 (r341211) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:55 2018 (r341212) @@ -1324,6 +1324,7 @@ typedef struct efx_nic_cfg_s { /* Firmware support for extended MAC_STATS buffer */ uint32_t enc_mac_stats_nstats; boolean_t enc_fec_counters; + boolean_t enc_hlb_counters; /* Firmware support for "FLAG" and "MARK" filter actions */ boolean_t enc_filter_action_flag_supported; boolean_t enc_filter_action_mark_supported; From owner-svn-src-head@freebsd.org Thu Nov 29 06:47:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E29811540A4; Thu, 29 Nov 2018 06:47:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2DD678E5E; Thu, 29 Nov 2018 06:47:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C75715FEF; Thu, 29 Nov 2018 06:47:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6l80U026227; Thu, 29 Nov 2018 06:47:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6l7Hf026221; Thu, 29 Nov 2018 06:47:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290647.wAT6l7Hf026221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341213 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2DD678E5E X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_SHORT(0.46)[0.458,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:47:26 -0000 Author: arybchik Date: Thu Nov 29 06:47:06 2018 New Revision: 341213 URL: https://svnweb.freebsd.org/changeset/base/341213 Log: sfxge(4): fix PreFAST warnings because of unused return Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18244 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx_port.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:46:55 2018 (r341212) +++ head/sys/dev/sfxge/common/ef10_filter.c Thu Nov 29 06:47:06 2018 (r341213) @@ -1171,12 +1171,15 @@ ef10_filter_insert_unicast( efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr); + rc = efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, + addr); + if (rc != 0) + goto fail1; rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]); if (rc != 0) - goto fail1; + goto fail2; eftp->eft_unicst_filter_count++; EFSYS_ASSERT(eftp->eft_unicst_filter_count <= @@ -1184,6 +1187,8 @@ ef10_filter_insert_unicast( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -1202,11 +1207,13 @@ ef10_filter_insert_all_unicast( efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_uc_def(&spec); + rc = efx_filter_spec_set_uc_def(&spec); + if (rc != 0) + goto fail1; rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]); if (rc != 0) - goto fail1; + goto fail2; eftp->eft_unicst_filter_count++; EFSYS_ASSERT(eftp->eft_unicst_filter_count <= @@ -1214,6 +1221,8 @@ ef10_filter_insert_all_unicast( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -1255,9 +1264,21 @@ ef10_filter_insert_multicast_list( filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_eth_local(&spec, + rc = efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, &addrs[i * EFX_MAC_ADDR_LEN]); + if (rc != 0) { + if (rollback == B_TRUE) { + /* Only stop upon failure if told to rollback */ + goto rollback; + } else { + /* + * Don't try to add a filter with a corrupt + * specification. + */ + continue; + } + } rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &filter_index); @@ -1280,8 +1301,12 @@ ef10_filter_insert_multicast_list( eftp->eft_default_rxq); EFX_MAC_BROADCAST_ADDR_SET(addr); - efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, - addr); + rc = efx_filter_spec_set_eth_local(&spec, + EFX_FILTER_SPEC_VID_UNSPEC, addr); + if ((rc != 0) && (rollback == B_TRUE)) { + /* Only stop upon failure if told to rollback */ + goto rollback; + } rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &filter_index); @@ -1329,12 +1354,14 @@ ef10_filter_insert_all_multicast( efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_mc_def(&spec); + rc = efx_filter_spec_set_mc_def(&spec); + if (rc != 0) + goto fail1; rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &eftp->eft_mulcst_filter_indexes[0]); if (rc != 0) - goto fail1; + goto fail2; eftp->eft_mulcst_filter_count = 1; eftp->eft_using_all_mulcst = B_TRUE; @@ -1345,6 +1372,8 @@ ef10_filter_insert_all_multicast( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:46:55 2018 (r341212) +++ head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:47:06 2018 (r341213) @@ -439,7 +439,7 @@ ef10_mac_filter_default_rxq_clear( ef10_filter_default_rxq_clear(enp); - efx_filter_reconfigure(enp, epp->ep_mac_addr, + (void) efx_filter_reconfigure(enp, epp->ep_mac_addr, epp->ep_all_unicst, epp->ep_mulcst, epp->ep_all_mulcst, epp->ep_brdcst, epp->ep_mulcst_addr_list, Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:55 2018 (r341212) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:47:06 2018 (r341213) @@ -833,7 +833,7 @@ fail1: for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; - efx_mcdi_free_piobuf(enp, *handlep); + (void) efx_mcdi_free_piobuf(enp, *handlep); *handlep = EFX_PIOBUF_HANDLE_INVALID; } enp->en_arch.ef10.ena_piobuf_count = 0; @@ -850,7 +850,7 @@ ef10_nic_free_piobufs( for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; - efx_mcdi_free_piobuf(enp, *handlep); + (void) efx_mcdi_free_piobuf(enp, *handlep); *handlep = EFX_PIOBUF_HANDLE_INVALID; } enp->en_arch.ef10.ena_piobuf_count = 0; Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Thu Nov 29 06:46:55 2018 (r341212) +++ head/sys/dev/sfxge/common/ef10_nvram.c Thu Nov 29 06:47:06 2018 (r341213) @@ -1835,7 +1835,7 @@ ef10_nvram_partn_write_segment_tlv( goto fail7; /* Unlock the partition */ - ef10_nvram_partn_unlock(enp, partn, NULL); + (void) ef10_nvram_partn_unlock(enp, partn, NULL); EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data); @@ -1850,7 +1850,7 @@ fail5: fail4: EFSYS_PROBE(fail4); - ef10_nvram_partn_unlock(enp, partn, NULL); + (void) ef10_nvram_partn_unlock(enp, partn, NULL); fail3: EFSYS_PROBE(fail3); Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Thu Nov 29 06:46:55 2018 (r341212) +++ head/sys/dev/sfxge/common/ef10_tx.c Thu Nov 29 06:47:06 2018 (r341213) @@ -305,7 +305,7 @@ ef10_tx_qpio_enable( fail3: EFSYS_PROBE(fail3); - ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); + (void) ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); fail2: EFSYS_PROBE(fail2); etp->et_pio_size = 0; @@ -323,10 +323,12 @@ ef10_tx_qpio_disable( if (etp->et_pio_size != 0) { /* Unlink the piobuf from this TXQ */ - ef10_nic_pio_unlink(enp, etp->et_index); + if (ef10_nic_pio_unlink(enp, etp->et_index) != 0) + return; /* Free the sub-allocated PIO block */ - ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); + (void) ef10_nic_pio_free(enp, etp->et_pio_bufnum, + etp->et_pio_blknum); etp->et_pio_size = 0; etp->et_pio_write_offset = 0; } Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Thu Nov 29 06:46:55 2018 (r341212) +++ head/sys/dev/sfxge/common/efx_port.c Thu Nov 29 06:47:06 2018 (r341213) @@ -66,7 +66,7 @@ efx_port_init( epp->ep_emop->emo_reconfigure(enp); /* Pick up current phy capababilities */ - efx_port_poll(enp, NULL); + (void) efx_port_poll(enp, NULL); /* * Turn on the PHY if available, otherwise reset it, and From owner-svn-src-head@freebsd.org Thu Nov 29 06:47:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 126A711540B3; Thu, 29 Nov 2018 06:47:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C07578E8B; Thu, 29 Nov 2018 06:47:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 040A415FF0; Thu, 29 Nov 2018 06:47:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6lJn4026287; Thu, 29 Nov 2018 06:47:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6lJeH026284; Thu, 29 Nov 2018 06:47:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290647.wAT6lJeH026284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341214 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C07578E8B X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:47:26 -0000 Author: arybchik Date: Thu Nov 29 06:47:19 2018 New Revision: 341214 URL: https://svnweb.freebsd.org/changeset/base/341214 Log: sfxge(4): fix SAL annotation for input buffers Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18245 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:47:06 2018 (r341213) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 29 06:47:19 2018 (r341214) @@ -456,7 +456,7 @@ ef10_nvram_partn_read( __in efx_nic_t *enp, __in uint32_t partn, __in unsigned int offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size); extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Thu Nov 29 06:47:06 2018 (r341213) +++ head/sys/dev/sfxge/common/ef10_nvram.c Thu Nov 29 06:47:19 2018 (r341214) @@ -2027,7 +2027,7 @@ ef10_nvram_partn_write( __in efx_nic_t *enp, __in uint32_t partn, __in unsigned int offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size) { size_t chunk; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:47:06 2018 (r341213) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Nov 29 06:47:19 2018 (r341214) @@ -611,7 +611,7 @@ efx_mcdi_nvram_write( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size); __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Thu Nov 29 06:47:06 2018 (r341213) +++ head/sys/dev/sfxge/common/efx_nvram.c Thu Nov 29 06:47:19 2018 (r341214) @@ -894,7 +894,7 @@ efx_mcdi_nvram_write( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size) { efx_mcdi_req_t req; From owner-svn-src-head@freebsd.org Thu Nov 29 06:47:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93F5115410C; Thu, 29 Nov 2018 06:47:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44B2078FC6; Thu, 29 Nov 2018 06:47:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFE5E15FF5; Thu, 29 Nov 2018 06:47:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6lUUu026344; Thu, 29 Nov 2018 06:47:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6lUrx026343; Thu, 29 Nov 2018 06:47:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290647.wAT6lUrx026343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341215 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44B2078FC6 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:47:33 -0000 Author: arybchik Date: Thu Nov 29 06:47:30 2018 New Revision: 341215 URL: https://svnweb.freebsd.org/changeset/base/341215 Log: sfxge(4): fix build because of no declaration Functions declared in mcdi_mon.h are implemented in mcdi_mon.c. The build fails if compiler options require declaration before definition. Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18246 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Thu Nov 29 06:47:19 2018 (r341214) +++ head/sys/dev/sfxge/common/mcdi_mon.c Thu Nov 29 06:47:30 2018 (r341215) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" +#include "mcdi_mon.h" #if EFSYS_OPT_MON_MCDI From owner-svn-src-head@freebsd.org Thu Nov 29 06:47:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AB1D1154168; Thu, 29 Nov 2018 06:47:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2547790D9; Thu, 29 Nov 2018 06:47:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 247B715FFA; Thu, 29 Nov 2018 06:47:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6lgXM026402; Thu, 29 Nov 2018 06:47:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6lfDN026400; Thu, 29 Nov 2018 06:47:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290647.wAT6lfDN026400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341216 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C2547790D9 X-Spamd-Result: default: False [1.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.47)[0.465,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.430,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:47:44 -0000 Author: arybchik Date: Thu Nov 29 06:47:41 2018 New Revision: 341216 URL: https://svnweb.freebsd.org/changeset/base/341216 Log: sfxge(4): add more definitions of partitions Add definitions of dynamic config and expansion ROM backup partitions. Submitted by: Paul Fox Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18247 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Thu Nov 29 06:47:30 2018 (r341215) +++ head/sys/dev/sfxge/common/ef10_nvram.c Thu Nov 29 06:47:41 2018 (r341216) @@ -2195,6 +2195,8 @@ static ef10_parttbl_entry_t medford2_parttbl[] = { PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), PARTN_MAP_ENTRY(EXPANSION_UEFI, ALL, UEFIROM), PARTN_MAP_ENTRY(MUM_FIRMWARE, ALL, MUM_FIRMWARE), + PARTN_MAP_ENTRY(DYNCONFIG_DEFAULTS, ALL, DYNCONFIG_DEFAULTS), + PARTN_MAP_ENTRY(ROMCONFIG_DEFAULTS, ALL, ROMCONFIG_DEFAULTS), }; static __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:47:30 2018 (r341215) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:47:41 2018 (r341216) @@ -1511,6 +1511,8 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_LICENSE, EFX_NVRAM_UEFIROM, EFX_NVRAM_MUM_FIRMWARE, + EFX_NVRAM_DYNCONFIG_DEFAULTS, + EFX_NVRAM_ROMCONFIG_DEFAULTS, EFX_NVRAM_NTYPES, } efx_nvram_type_t; From owner-svn-src-head@freebsd.org Thu Nov 29 08:37:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD364115843D; Thu, 29 Nov 2018 08:37:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 705FA7D78B; Thu, 29 Nov 2018 08:37:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B62C17212; Thu, 29 Nov 2018 08:37:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT8bYG1082041; Thu, 29 Nov 2018 08:37:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT8bXJF082039; Thu, 29 Nov 2018 08:37:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290837.wAT8bXJF082039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 08:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341218 - head/sys/security/audit X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/security/audit X-SVN-Commit-Revision: 341218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 705FA7D78B X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.249,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 08:37:35 -0000 Author: mjg Date: Thu Nov 29 08:37:33 2018 New Revision: 341218 URL: https://svnweb.freebsd.org/changeset/base/341218 Log: audit: change audit_syscalls_enabled type to bool So that it fits better in __read_frequently. Sponsored by: The FreeBSD Foundation Modified: head/sys/security/audit/audit.c head/sys/security/audit/audit.h Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Thu Nov 29 07:41:05 2018 (r341217) +++ head/sys/security/audit/audit.c Thu Nov 29 08:37:33 2018 (r341218) @@ -103,7 +103,7 @@ int audit_trail_suspended; #ifdef KDTRACE_HOOKS u_int audit_dtrace_enabled; #endif -int __read_frequently audit_syscalls_enabled; +bool __read_frequently audit_syscalls_enabled; /* * Flags controlling behavior in low storage situations. Should we panic if @@ -216,13 +216,13 @@ audit_syscalls_enabled_update(void) mtx_lock(&audit_mtx); #ifdef KDTRACE_HOOKS if (audit_dtrace_enabled) - audit_syscalls_enabled = 1; + audit_syscalls_enabled = true; else { #endif if (audit_trail_enabled && !audit_trail_suspended) - audit_syscalls_enabled = 1; + audit_syscalls_enabled = true; else - audit_syscalls_enabled = 0; + audit_syscalls_enabled = false; #ifdef KDTRACE_HOOKS } #endif @@ -336,7 +336,7 @@ audit_init(void) audit_trail_enabled = 0; audit_trail_suspended = 0; - audit_syscalls_enabled = 0; + audit_syscalls_enabled = false; audit_panic_on_write_fail = 0; audit_fail_stop = 0; audit_in_failure = 0; Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Thu Nov 29 07:41:05 2018 (r341217) +++ head/sys/security/audit/audit.h Thu Nov 29 08:37:33 2018 (r341218) @@ -71,7 +71,7 @@ extern u_int audit_dtrace_enabled; extern int audit_trail_enabled; extern int audit_trail_suspended; -extern int audit_syscalls_enabled; +extern bool audit_syscalls_enabled; void audit_syscall_enter(unsigned short code, struct thread *td); void audit_syscall_exit(int error, struct thread *td); From owner-svn-src-head@freebsd.org Thu Nov 29 08:53:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 388C31158B2B; Thu, 29 Nov 2018 08:53:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D24317E1DF; Thu, 29 Nov 2018 08:53:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B340E1753E; Thu, 29 Nov 2018 08:53:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT8rdJm092314; Thu, 29 Nov 2018 08:53:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT8rdds092312; Thu, 29 Nov 2018 08:53:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290853.wAT8rdds092312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 08:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341219 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 341219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D24317E1DF X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.249,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 08:53:40 -0000 Author: mjg Date: Thu Nov 29 08:53:39 2018 New Revision: 341219 URL: https://svnweb.freebsd.org/changeset/base/341219 Log: fd: unify fd range check across the routines While here annotate out of range as unlikely. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Nov 29 08:37:33 2018 (r341218) +++ head/sys/kern/kern_descrip.c Thu Nov 29 08:53:39 2018 (r341219) @@ -2637,7 +2637,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights #endif fdt = fdp->fd_files; - if ((u_int)fd >= fdt->fdt_nfiles) + if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) return (EBADF); /* * Fetch the descriptor locklessly. We avoid fdrop() races by Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Thu Nov 29 08:37:33 2018 (r341218) +++ head/sys/sys/filedesc.h Thu Nov 29 08:53:39 2018 (r341219) @@ -208,7 +208,7 @@ fget_locked(struct filedesc *fdp, int fd) FILEDESC_LOCK_ASSERT(fdp); - if (fd < 0 || fd > fdp->fd_lastfile) + if (__predict_false((u_int)fd >= fdp->fd_nfiles)) return (NULL); return (fdp->fd_ofiles[fd].fde_file); @@ -221,11 +221,11 @@ fdeget_locked(struct filedesc *fdp, int fd) FILEDESC_LOCK_ASSERT(fdp); - if (fd < 0 || fd > fdp->fd_lastfile) + if (__predict_false((u_int)fd >= fdp->fd_nfiles)) return (NULL); fde = &fdp->fd_ofiles[fd]; - if (fde->fde_file == NULL) + if (__predict_false(fde->fde_file == NULL)) return (NULL); return (fde); From owner-svn-src-head@freebsd.org Thu Nov 29 09:04:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91F191159143; Thu, 29 Nov 2018 09:04:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 342657E8A7; Thu, 29 Nov 2018 09:04:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14135176EE; Thu, 29 Nov 2018 09:04:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT94AGG097636; Thu, 29 Nov 2018 09:04:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT94APb097635; Thu, 29 Nov 2018 09:04:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290904.wAT94APb097635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 09:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341220 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 341220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 342657E8A7 X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.249,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.31)[0.307,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 09:04:11 -0000 Author: mjg Date: Thu Nov 29 09:04:10 2018 New Revision: 341220 URL: https://svnweb.freebsd.org/changeset/base/341220 Log: vfs: drop spurious memcpy in stat Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Nov 29 08:53:39 2018 (r341219) +++ head/sys/kern/vfs_syscalls.c Thu Nov 29 09:04:10 2018 (r341220) @@ -2277,7 +2277,6 @@ kern_statat(struct thread *td, int flag, int fd, const void (*hook)(struct vnode *vp, struct stat *sbp)) { struct nameidata nd; - struct stat sb; int error; if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0) @@ -2290,13 +2289,13 @@ kern_statat(struct thread *td, int flag, int fd, const if ((error = namei(&nd)) != 0) return (error); - error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td); + error = vn_stat(nd.ni_vp, sbp, td->td_ucred, NOCRED, td); if (error == 0) { - SDT_PROBE2(vfs, , stat, mode, path, sb.st_mode); - if (S_ISREG(sb.st_mode)) + SDT_PROBE2(vfs, , stat, mode, path, sbp->st_mode); + if (S_ISREG(sbp->st_mode)) SDT_PROBE2(vfs, , stat, reg, path, pathseg); if (__predict_false(hook != NULL)) - hook(nd.ni_vp, &sb); + hook(nd.ni_vp, sbp); } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); @@ -2308,10 +2307,9 @@ kern_statat(struct thread *td, int flag, int fd, const sb.st_ctim_ext = 0; sb.st_btim_ext = 0; #endif - *sbp = sb; #ifdef KTRACE if (KTRPOINT(td, KTR_STRUCT)) - ktrstat(&sb); + ktrstat(sbp); #endif return (0); } From owner-svn-src-head@freebsd.org Thu Nov 29 09:19:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E14E5115970D; Thu, 29 Nov 2018 09:19:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E3507F54F; Thu, 29 Nov 2018 09:19:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EB65178A6; Thu, 29 Nov 2018 09:19:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT9JnNN002862; Thu, 29 Nov 2018 09:19:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT9Jn7b002861; Thu, 29 Nov 2018 09:19:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290919.wAT9Jn7b002861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 09:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341221 - head/sys/security/audit X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/security/audit X-SVN-Commit-Revision: 341221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E3507F54F X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.249,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 09:19:50 -0000 Author: mjg Date: Thu Nov 29 09:19:48 2018 New Revision: 341221 URL: https://svnweb.freebsd.org/changeset/base/341221 Log: audit: predict AUDITING_TD as false By default it is compiled in and disabled. Sponsored by: The FreeBSD Foundation Modified: head/sys/security/audit/audit.h Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Thu Nov 29 09:04:10 2018 (r341220) +++ head/sys/security/audit/audit.h Thu Nov 29 09:19:48 2018 (r341221) @@ -150,7 +150,7 @@ void audit_thread_free(struct thread *td); * Define macros to wrap the audit_arg_* calls by checking the global * audit_syscalls_enabled flag before performing the actual call. */ -#define AUDITING_TD(td) ((td)->td_pflags & TDP_AUDITREC) +#define AUDITING_TD(td) (__predict_false((td)->td_pflags & TDP_AUDITREC)) #define AUDIT_ARG_ADDR(addr) do { \ if (AUDITING_TD(curthread)) \ From owner-svn-src-head@freebsd.org Thu Nov 29 09:33:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 092ED1159D01; Thu, 29 Nov 2018 09:33:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A17507FE84; Thu, 29 Nov 2018 09:32:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A4117BD4; Thu, 29 Nov 2018 09:32:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT9WxII013145; Thu, 29 Nov 2018 09:32:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT9WxNt013144; Thu, 29 Nov 2018 09:32:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290932.wAT9WxNt013144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 09:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341222 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 341222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A17507FE84 X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.25)[0.249,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 09:33:00 -0000 Author: mjg Date: Thu Nov 29 09:32:59 2018 New Revision: 341222 URL: https://svnweb.freebsd.org/changeset/base/341222 Log: cache: retire cache_enter compat schim It was added over 6 years ago for binary compat. cache_enter macro remains as it expands to cache_enter_time. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Nov 29 09:19:48 2018 (r341221) +++ head/sys/kern/vfs_cache.c Thu Nov 29 09:32:59 2018 (r341222) @@ -2452,19 +2452,6 @@ vn_commname(struct vnode *vp, char *buf, u_int buflen) return (0); } -/* ABI compat shims for old kernel modules. */ -#undef cache_enter - -void cache_enter(struct vnode *dvp, struct vnode *vp, - struct componentname *cnp); - -void -cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) -{ - - cache_enter_time(dvp, vp, cnp, NULL, NULL); -} - /* * This function updates path string to vnode's full global path * and checks the size of the new path string against the pathlen argument. From owner-svn-src-head@freebsd.org Thu Nov 29 09:54:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEBC7115A7C3; Thu, 29 Nov 2018 09:54:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BFF980B92; Thu, 29 Nov 2018 09:54:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677C317F1F; Thu, 29 Nov 2018 09:54:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT9sS4g023288; Thu, 29 Nov 2018 09:54:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT9sSVX023287; Thu, 29 Nov 2018 09:54:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811290954.wAT9sSVX023287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Nov 2018 09:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341223 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 341223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8BFF980B92 X-Spamd-Result: default: False [0.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.28)[0.284,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.31)[0.307,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 09:54:29 -0000 Author: mjg Date: Thu Nov 29 09:54:27 2018 New Revision: 341223 URL: https://svnweb.freebsd.org/changeset/base/341223 Log: vfs: fix i386 build after r341220 Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Nov 29 09:32:59 2018 (r341222) +++ head/sys/kern/vfs_syscalls.c Thu Nov 29 09:54:27 2018 (r341223) @@ -2302,10 +2302,10 @@ kern_statat(struct thread *td, int flag, int fd, const if (error != 0) return (error); #ifdef __STAT_TIME_T_EXT - sb.st_atim_ext = 0; - sb.st_mtim_ext = 0; - sb.st_ctim_ext = 0; - sb.st_btim_ext = 0; + sbp->st_atim_ext = 0; + sbp->st_mtim_ext = 0; + sbp->st_ctim_ext = 0; + sbp->st_btim_ext = 0; #endif #ifdef KTRACE if (KTRPOINT(td, KTR_STRUCT)) From owner-svn-src-head@freebsd.org Thu Nov 29 10:56:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA584115BF11; Thu, 29 Nov 2018 10:56:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D54A9832FE; Thu, 29 Nov 2018 10:56:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wATAuMA9001115 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 Nov 2018 12:56:25 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wATAuMA9001115 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wATAuMgS001114; Thu, 29 Nov 2018 12:56:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Nov 2018 12:56:22 +0200 From: Konstantin Belousov To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341177 - head/sys/powerpc/powerpc Message-ID: <20181129105622.GL2378@kib.kiev.ua> References: <201811290339.wAT3dBqf027972@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811290339.wAT3dBqf027972@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: D54A9832FE X-Spamd-Result: default: False [-5.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; IP_SCORE(-2.12)[ip: (-2.51), ipnet: 2001:470::/32(-4.50), asn: 6939(-3.49), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 10:56:38 -0000 On Thu, Nov 29, 2018 at 03:39:11AM +0000, Justin Hibbits wrote: > Author: jhibbits > Date: Thu Nov 29 03:39:11 2018 > New Revision: 341177 > URL: https://svnweb.freebsd.org/changeset/base/341177 > > Log: > Fix thread creation in PowerPC64 ELFv2 processes. > > Summary: > Currently, the upcall used to create threads assumes ELFv1. > > Instead, we should check which sysentvec is in use on the process and act > accordingly. > > This makes ELFv2 threaded processes work. > > Submitted by: git_bdragon.rtk0.net > Differential Revision: https://reviews.freebsd.org/D18330 > > Modified: > head/sys/powerpc/powerpc/exec_machdep.c > > Modified: head/sys/powerpc/powerpc/exec_machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/exec_machdep.c Thu Nov 29 02:52:08 2018 (r341176) > +++ head/sys/powerpc/powerpc/exec_machdep.c Thu Nov 29 03:39:11 2018 (r341177) > @@ -124,6 +124,10 @@ static int grab_mcontext32(struct thread *td, mcontext > > static int grab_mcontext(struct thread *, mcontext_t *, int); > > +#ifdef __powerpc64__ > +extern struct sysentvec elf64_freebsd_sysvec_v2; > +#endif > + > void > sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) > { > @@ -1014,11 +1018,18 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * > #endif > } else { > #ifdef __powerpc64__ > - register_t entry_desc[3]; > - (void)copyin((void *)entry, entry_desc, sizeof(entry_desc)); > - tf->srr0 = entry_desc[0]; > - tf->fixreg[2] = entry_desc[1]; > - tf->fixreg[11] = entry_desc[2]; > + if (td->td_proc->p_sysent == &elf64_freebsd_sysvec_v2) { I recommend you to not do this, instead add a new sv_flag to indicate ELFv2 for PPC. We already have almost machine-specific flags like ia32. > + tf->srr0 = (register_t)entry; > + /* ELFv2 ABI requires that the global entry point be in r12. */ > + tf->fixreg[12] = (register_t)entry; > + } > + else { > + register_t entry_desc[3]; > + (void)copyin((void *)entry, entry_desc, sizeof(entry_desc)); > + tf->srr0 = entry_desc[0]; > + tf->fixreg[2] = entry_desc[1]; > + tf->fixreg[11] = entry_desc[2]; > + } > tf->srr1 = psl_userset | PSL_FE_DFLT; > #endif > } From owner-svn-src-head@freebsd.org Thu Nov 29 14:21:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0681113D887; Thu, 29 Nov 2018 14:21:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7880B6D810; Thu, 29 Nov 2018 14:21:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AA061AA39; Thu, 29 Nov 2018 14:21:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATEL2Ha058320; Thu, 29 Nov 2018 14:21:02 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATEL2q5058319; Thu, 29 Nov 2018 14:21:02 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811291421.wATEL2q5058319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 29 Nov 2018 14:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341231 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 341231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7880B6D810 X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.12)[-0.119,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 14:21:03 -0000 Author: tsoome Date: Thu Nov 29 14:21:01 2018 New Revision: 341231 URL: https://svnweb.freebsd.org/changeset/base/341231 Log: loader: command_bcache() should print unsigned values All bcache counters are unsigned. Modified: head/stand/common/bcache.c Modified: head/stand/common/bcache.c ============================================================================== --- head/stand/common/bcache.c Thu Nov 29 13:58:41 2018 (r341230) +++ head/stand/common/bcache.c Thu Nov 29 14:21:01 2018 (r341231) @@ -476,12 +476,12 @@ command_bcache(int argc, char *argv[]) return(CMD_ERROR); } - printf("\ncache blocks: %d\n", bcache_total_nblks); - printf("cache blocksz: %d\n", bcache_blksize); - printf("cache readahead: %d\n", bcache_rablks); - printf("unit cache blocks: %d\n", bcache_unit_nblks); - printf("cached units: %d\n", bcache_units); - printf("%d ops %d bypasses %d hits %d misses\n", bcache_ops, + printf("\ncache blocks: %u\n", bcache_total_nblks); + printf("cache blocksz: %u\n", bcache_blksize); + printf("cache readahead: %u\n", bcache_rablks); + printf("unit cache blocks: %u\n", bcache_unit_nblks); + printf("cached units: %u\n", bcache_units); + printf("%u ops %d bypasses %u hits %u misses\n", bcache_ops, bcache_bypasses, bcache_hits, bcache_misses); return(CMD_OK); } From owner-svn-src-head@freebsd.org Thu Nov 29 14:21:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB300113D97A; Thu, 29 Nov 2018 14:21:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DD1B6D9FF; Thu, 29 Nov 2018 14:21:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EDAE1AB50; Thu, 29 Nov 2018 14:21:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATELRaZ059322; Thu, 29 Nov 2018 14:21:27 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATELQbx059318; Thu, 29 Nov 2018 14:21:26 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811291421.wATELQbx059318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 14:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341232 - in head/usr.bin: . trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head/usr.bin: . trim X-SVN-Commit-Revision: 341232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6DD1B6D9FF X-Spamd-Result: default: False [0.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.10)[-0.100,0]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 14:21:28 -0000 Author: eugen Date: Thu Nov 29 14:21:26 2018 New Revision: 341232 URL: https://svnweb.freebsd.org/changeset/base/341232 Log: Add new small tool trim(1) to delete contents for blocks on flash based storage devices that use wear-leveling algorithms. Reviewed by: hackers@ MFC after: 1 month Added: head/usr.bin/trim/ head/usr.bin/trim/Makefile (contents, props changed) head/usr.bin/trim/trim.1 (contents, props changed) head/usr.bin/trim/trim.c (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Nov 29 14:21:01 2018 (r341231) +++ head/usr.bin/Makefile Thu Nov 29 14:21:26 2018 (r341232) @@ -159,6 +159,7 @@ SUBDIR= alias \ touch \ tput \ tr \ + trim \ true \ truncate \ tset \ Added: head/usr.bin/trim/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/trim/Makefile Thu Nov 29 14:21:26 2018 (r341232) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= trim +LIBADD= util + +.include Added: head/usr.bin/trim/trim.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/trim/trim.1 Thu Nov 29 14:21:26 2018 (r341232) @@ -0,0 +1,166 @@ +.\" +.\" Copyright (c) 2018 Eugene Grosbein . +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 29, 2018 +.Dt TRIM 1 +.Os +.Sh NAME +.Nm trim +.Nd erase device blocks that have no needed contents +.Sh SYNOPSIS +.Nm +.Op Fl Nfqv +.Fl [ [lo] Xo +.Bk -words +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t ] +.Sm on +.Xc +.Ek +.Bk -words +.Op Fl r Ar rfile +.Ek +.Ar device ... +.Sh DESCRIPTION +The +.Nm +utility erases specified region of the device. +It is only relevant for flash based storage devices that use wear-leveling +algorithms. +.Sy All erased data is lost. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl N +Do not actually erase anything but show what it would do (dry run). +Implies +.Fl v . +This is the default. Overrides +.Fl f . +.It Fl f +Perform the operation. Overrides +.Fl N . +.It Fl l Xo +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t +.Sm on +.Xc +.It Fl o Xo +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t +.Sm on +.Xc +Specify the length +.Fl l +of the region to trim or its offset +.Fl o +from the beginning of the device. +.Sy The whole device is erased by default +unless one or both of these options are presented. +.Pp +The argument may be suffixed with one of +.Cm K , +.Cm M , +.Cm G +or +.Cm T +(either upper or lower case) to indicate a multiple of +Kilobytes, Megabytes, Gigabytes or Terabytes +respectively. +.It Fl q +Do not output anything except of possible error messages (quiet mode). +Overrides +.Fl v . +.It Fl r Ar rfile +Uses the length of given +.Ar rfile +as length of the region to erase. +.Sy The whole device is erased by default. +.It Fl v +Show offset and length of actual region being erased, in bytes. +.El +.Pp +Later options override previous ones. +.Pp +Note that actual success of the operation depends of underlying +device driver such as +.Xr ada 4 , +.Xr da 4 +and others. +Refer to corresponding manual pages for detail on possible caveats +in low level support for ATA TRIM or SCSI UNMAP commands. +.Sh EXIT STATUS +.Ex -std +If the final erase operation fails for an argument, the +.Nm +utility returns exit code 1. +It can also return one of the exit codes defined in +.Xr sysexits 3 , +as follows: +.Bl -tag -width ".Dv EX_UNAVAILABLE" +.It Dv EX_USAGE +The specified offset or length of the region is incorrect. +.It Dv EX_OSERR +There is no enough memory to proceed. +.It Dv EX_NOINPUT +The specified +.Ar rfile +cannot be opened (perhaps, it does not exist). +.It Dv EX_IOERR +The specified +.Ar rfile +cannot be examined for its size due to some system input/output error. +.It Dv EX_DATAERR +The specified +.Ar rfile +is not regular file, directory nor special device, so its size +cannot be examined. +.It Dv EX_UNAVAILABLE +The specified +.Ar rfile +is special device file not supporting DIOCGMEDIASIZE +.Xr ioctl 2 +(probably not a disk), so its size cannot be examined. +.El +.Sh SEE ALSO +.Xr ada 4 , +.Xr da 4 , +.Xr ioctl 2 , +.Xr sysexits 3 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +utility was written by +.An Eugene Grosbein Aq Mt eugen@FreeBSD.org . Added: head/usr.bin/trim/trim.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/trim/trim.c Thu Nov 29 14:21:26 2018 (r341232) @@ -0,0 +1,211 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Eugene Grosbein . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const char rcsid[] = + "$FreeBSD$"; + +static int trim(char *path, off_t offset, off_t length, int dryrun, int verbose); +static off_t getsize(char *path); +static void usage(char *name) __dead2; + +int +main(int argc, char **argv) +{ + off_t offset, length; + uint64_t usz; + int dryrun, error, verbose; + char *fname, *name; + char ch; + + error = 0; + length = offset = 0; + name = argv[0]; + dryrun = verbose = 1; + + while ((ch = getopt(argc, argv, "Nfl:o:qr:v")) != -1) + switch (ch) { + case 'N': + dryrun = 1; + verbose = 1; + break; + case 'f': + dryrun = 0; + break; + case 'l': + case 'o': + if (expand_number(optarg, &usz) == -1 || + (off_t)usz < 0 || + (usz == 0 && ch == 'l')) + errx(EX_USAGE, + "invalid %s of the region: `%s'", + ch == 'o' ? "offset" : "length", + optarg); + if (ch == 'o') + offset = (off_t)usz; + else + length = (off_t)usz; + break; + case 'q': + verbose = 0; + break; + case 'r': + if ((length = getsize(optarg)) == 0) + errx(EX_USAGE, + "invalid zero length reference file" + " for the region: `%s'", optarg); + break; + case 'v': + verbose = 1; + break; + default: + usage(name); + /* NOTREACHED */ + } + + argv += optind; + argc -= optind; + + if (argc < 1) + usage(name); + + while ((fname = *argv++) != NULL) + if (trim(fname, offset, length, dryrun, verbose) < 0) + error++; + + return (error ? EXIT_FAILURE : EXIT_SUCCESS); +} + +static off_t +getsize(char *path) +{ + struct stat sb; + char *tstr; + off_t mediasize; + int fd; + + if ((fd = open(path, O_RDONLY | O_DIRECT)) < 0) { + if (errno == ENOENT && path[0] != '/') { + if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) + errx(EX_OSERR, "no memory"); + fd = open(tstr, O_RDONLY | O_DIRECT); + free(tstr); + } + } + + if (fd < 0) + err(EX_NOINPUT, "`%s'", path); + + if (fstat(fd, &sb) < 0) + err(EX_IOERR, "`%s'", path); + + if (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode)) { + close(fd); + return (sb.st_size); + } + + if (!S_ISCHR(sb.st_mode) && !S_ISBLK(sb.st_mode)) + errx(EX_DATAERR, + "invalid type of the file " + "(not regular, directory nor special device): `%s'", + path); + + if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) + errx(EX_UNAVAILABLE, + "ioctl(DIOCGMEDIASIZE) failed, probably not a disk: " + "`%s'", path); + close(fd); + + return (mediasize); +} + +static int +trim(char *path, off_t offset, off_t length, int dryrun, int verbose) +{ + off_t arg[2]; + char *tstr; + int error, fd; + + if (length == 0) + length = getsize(path); + + if (verbose) + printf("trim `%s' offset %ju length %ju\n", + path, (uintmax_t)offset, (uintmax_t)length); + + if (dryrun) { + printf("dry run: add -f to actually perform the operation\n"); + return (0); + } + + if ((fd = open(path, O_WRONLY | O_DIRECT)) < 0) { + if (errno == ENOENT && path[0] != '/') { + if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) + errx(EX_OSERR, "no memory"); + fd = open(tstr, O_WRONLY | O_DIRECT); + free(tstr); + } + } + + if (fd < 0) + err(EX_NOINPUT, "`%s'", path); + + arg[0] = offset; + arg[1] = length; + + error = ioctl(fd, DIOCGDELETE, arg); + if (error < 0) + warn("ioctl(DIOCGDELETE) failed for `%s'", path); + + close(fd); + return (error); +} + +static void +usage(char *name) +{ + (void)fprintf(stderr, + "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t]] [-r rfile] [-Nfqv] device ...\n", + name); + exit(EX_USAGE); +} From owner-svn-src-head@freebsd.org Thu Nov 29 14:49:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 861CE113F887; Thu, 29 Nov 2018 14:49:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DDFC6EECA; Thu, 29 Nov 2018 14:49:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EBFD1AEE6; Thu, 29 Nov 2018 14:49:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATEnX3b072819; Thu, 29 Nov 2018 14:49:33 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATEnXIY072818; Thu, 29 Nov 2018 14:49:33 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811291449.wATEnXIY072818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 14:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341233 - head/usr.bin/trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.bin/trim X-SVN-Commit-Revision: 341233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DDFC6EECA X-Spamd-Result: default: False [0.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.002,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 14:49:34 -0000 Author: eugen Date: Thu Nov 29 14:49:33 2018 New Revision: 341233 URL: https://svnweb.freebsd.org/changeset/base/341233 Log: trim(1): unbreak build after r341232 for platforms using gcc and not clang MFC after: 1 month Modified: head/usr.bin/trim/trim.c Modified: head/usr.bin/trim/trim.c ============================================================================== --- head/usr.bin/trim/trim.c Thu Nov 29 14:21:26 2018 (r341232) +++ head/usr.bin/trim/trim.c Thu Nov 29 14:49:33 2018 (r341233) @@ -42,8 +42,10 @@ #include #include +#ifndef lint static const char rcsid[] = "$FreeBSD$"; +#endif /* not lint */ static int trim(char *path, off_t offset, off_t length, int dryrun, int verbose); static off_t getsize(char *path); @@ -54,9 +56,8 @@ main(int argc, char **argv) { off_t offset, length; uint64_t usz; - int dryrun, error, verbose; + int ch, dryrun, error, verbose; char *fname, *name; - char ch; error = 0; length = offset = 0; From owner-svn-src-head@freebsd.org Thu Nov 29 16:08:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155891142513; Thu, 29 Nov 2018 16:08:18 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8B8F728C3; Thu, 29 Nov 2018 16:08:17 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 854D51BC5E; Thu, 29 Nov 2018 16:08:17 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATG8HlJ014273; Thu, 29 Nov 2018 16:08:17 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATG8H8V014270; Thu, 29 Nov 2018 16:08:17 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811291608.wATG8H8V014270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 16:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341243 - in head: usr.bin usr.bin/trim usr.sbin usr.sbin/trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head: usr.bin usr.bin/trim usr.sbin usr.sbin/trim X-SVN-Commit-Revision: 341243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8B8F728C3 X-Spamd-Result: default: False [0.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.28)[0.276,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:08:18 -0000 Author: eugen Date: Thu Nov 29 16:08:16 2018 New Revision: 341243 URL: https://svnweb.freebsd.org/changeset/base/341243 Log: Move trim(1) from usr.bin to usr.sbin to become trim(8). Requested by: se MFC after: 1 month Added: head/usr.sbin/trim/ - copied from r341242, head/usr.bin/trim/ Deleted: head/usr.bin/trim/ Modified: head/usr.bin/Makefile head/usr.sbin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Nov 29 15:58:14 2018 (r341242) +++ head/usr.bin/Makefile Thu Nov 29 16:08:16 2018 (r341243) @@ -159,7 +159,6 @@ SUBDIR= alias \ touch \ tput \ tr \ - trim \ true \ truncate \ tset \ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Nov 29 15:58:14 2018 (r341242) +++ head/usr.sbin/Makefile Thu Nov 29 16:08:16 2018 (r341243) @@ -91,6 +91,7 @@ SUBDIR= adduser \ tcpdrop \ tcpdump \ traceroute \ + trim \ trpt \ tzsetup \ ugidfw \ From owner-svn-src-head@freebsd.org Thu Nov 29 16:09:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3613411425BE; Thu, 29 Nov 2018 16:09:25 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B421C72A34; Thu, 29 Nov 2018 16:09:24 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D9871BC61; Thu, 29 Nov 2018 16:09:24 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATG9Osq014372; Thu, 29 Nov 2018 16:09:24 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATG9ONt014371; Thu, 29 Nov 2018 16:09:24 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811291609.wATG9ONt014371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 16:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341244 - head/usr.sbin/trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/trim X-SVN-Commit-Revision: 341244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B421C72A34 X-Spamd-Result: default: False [0.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_SHORT(0.29)[0.291,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:09:25 -0000 Author: eugen Date: Thu Nov 29 16:09:24 2018 New Revision: 341244 URL: https://svnweb.freebsd.org/changeset/base/341244 Log: Rename trim.1 to trim.8 too. MFC after: 1 month Added: head/usr.sbin/trim/trim.8 - copied unchanged from r341243, head/usr.sbin/trim/trim.1 Deleted: head/usr.sbin/trim/trim.1 Copied: head/usr.sbin/trim/trim.8 (from r341243, head/usr.sbin/trim/trim.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/trim/trim.8 Thu Nov 29 16:09:24 2018 (r341244, copy of r341243, head/usr.sbin/trim/trim.1) @@ -0,0 +1,166 @@ +.\" +.\" Copyright (c) 2018 Eugene Grosbein . +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 29, 2018 +.Dt TRIM 1 +.Os +.Sh NAME +.Nm trim +.Nd erase device blocks that have no needed contents +.Sh SYNOPSIS +.Nm +.Op Fl Nfqv +.Fl [ [lo] Xo +.Bk -words +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t ] +.Sm on +.Xc +.Ek +.Bk -words +.Op Fl r Ar rfile +.Ek +.Ar device ... +.Sh DESCRIPTION +The +.Nm +utility erases specified region of the device. +It is only relevant for flash based storage devices that use wear-leveling +algorithms. +.Sy All erased data is lost. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl N +Do not actually erase anything but show what it would do (dry run). +Implies +.Fl v . +This is the default. Overrides +.Fl f . +.It Fl f +Perform the operation. Overrides +.Fl N . +.It Fl l Xo +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t +.Sm on +.Xc +.It Fl o Xo +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t +.Sm on +.Xc +Specify the length +.Fl l +of the region to trim or its offset +.Fl o +from the beginning of the device. +.Sy The whole device is erased by default +unless one or both of these options are presented. +.Pp +The argument may be suffixed with one of +.Cm K , +.Cm M , +.Cm G +or +.Cm T +(either upper or lower case) to indicate a multiple of +Kilobytes, Megabytes, Gigabytes or Terabytes +respectively. +.It Fl q +Do not output anything except of possible error messages (quiet mode). +Overrides +.Fl v . +.It Fl r Ar rfile +Uses the length of given +.Ar rfile +as length of the region to erase. +.Sy The whole device is erased by default. +.It Fl v +Show offset and length of actual region being erased, in bytes. +.El +.Pp +Later options override previous ones. +.Pp +Note that actual success of the operation depends of underlying +device driver such as +.Xr ada 4 , +.Xr da 4 +and others. +Refer to corresponding manual pages for detail on possible caveats +in low level support for ATA TRIM or SCSI UNMAP commands. +.Sh EXIT STATUS +.Ex -std +If the final erase operation fails for an argument, the +.Nm +utility returns exit code 1. +It can also return one of the exit codes defined in +.Xr sysexits 3 , +as follows: +.Bl -tag -width ".Dv EX_UNAVAILABLE" +.It Dv EX_USAGE +The specified offset or length of the region is incorrect. +.It Dv EX_OSERR +There is no enough memory to proceed. +.It Dv EX_NOINPUT +The specified +.Ar rfile +cannot be opened (perhaps, it does not exist). +.It Dv EX_IOERR +The specified +.Ar rfile +cannot be examined for its size due to some system input/output error. +.It Dv EX_DATAERR +The specified +.Ar rfile +is not regular file, directory nor special device, so its size +cannot be examined. +.It Dv EX_UNAVAILABLE +The specified +.Ar rfile +is special device file not supporting DIOCGMEDIASIZE +.Xr ioctl 2 +(probably not a disk), so its size cannot be examined. +.El +.Sh SEE ALSO +.Xr ada 4 , +.Xr da 4 , +.Xr ioctl 2 , +.Xr sysexits 3 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +utility was written by +.An Eugene Grosbein Aq Mt eugen@FreeBSD.org . From owner-svn-src-head@freebsd.org Thu Nov 29 16:10:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1F8211426A4; Thu, 29 Nov 2018 16:10:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94C0C72BF1; Thu, 29 Nov 2018 16:10:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75D551BC79; Thu, 29 Nov 2018 16:10:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATGAtWg014511; Thu, 29 Nov 2018 16:10:55 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATGAtcg014510; Thu, 29 Nov 2018 16:10:55 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811291610.wATGAtcg014510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 16:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341245 - head/usr.sbin/trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/trim X-SVN-Commit-Revision: 341245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94C0C72BF1 X-Spamd-Result: default: False [0.72 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.28)[0.278,0]; NEURAL_SPAM_MEDIUM(0.19)[0.186,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.260,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:10:56 -0000 Author: eugen Date: Thu Nov 29 16:10:54 2018 New Revision: 341245 URL: https://svnweb.freebsd.org/changeset/base/341245 Log: trim(8): fix Makefile after rename from trim(1). MFC after: 1 month Modified: head/usr.sbin/trim/Makefile Modified: head/usr.sbin/trim/Makefile ============================================================================== --- head/usr.sbin/trim/Makefile Thu Nov 29 16:09:24 2018 (r341244) +++ head/usr.sbin/trim/Makefile Thu Nov 29 16:10:54 2018 (r341245) @@ -1,6 +1,7 @@ # $FreeBSD$ PROG= trim +MAN= trim.8 LIBADD= util .include From owner-svn-src-head@freebsd.org Thu Nov 29 16:13:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FCE61142924; Thu, 29 Nov 2018 16:13:47 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A807073005; Thu, 29 Nov 2018 16:13:46 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88FBD1BDF5; Thu, 29 Nov 2018 16:13:46 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATGDkmM019636; Thu, 29 Nov 2018 16:13:46 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATGDkKO019635; Thu, 29 Nov 2018 16:13:46 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811291613.wATGDkKO019635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 29 Nov 2018 16:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341246 - head/usr.sbin/trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/trim X-SVN-Commit-Revision: 341246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A807073005 X-Spamd-Result: default: False [0.72 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.260,0]; NEURAL_SPAM_MEDIUM(0.19)[0.186,0]; NEURAL_SPAM_LONG(0.28)[0.278,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:13:47 -0000 Author: eugen Date: Thu Nov 29 16:13:46 2018 New Revision: 341246 URL: https://svnweb.freebsd.org/changeset/base/341246 Log: trim.8: fix contents after rename from trim.1 MFC after: 1 month Modified: head/usr.sbin/trim/trim.8 Modified: head/usr.sbin/trim/trim.8 ============================================================================== --- head/usr.sbin/trim/trim.8 Thu Nov 29 16:10:54 2018 (r341245) +++ head/usr.sbin/trim/trim.8 Thu Nov 29 16:13:46 2018 (r341246) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .Dd November 29, 2018 -.Dt TRIM 1 +.Dt TRIM 8 .Os .Sh NAME .Nm trim From owner-svn-src-head@freebsd.org Thu Nov 29 16:25:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A3D31142CEC for ; Thu, 29 Nov 2018 16:25:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B03AB736CD for ; Thu, 29 Nov 2018 16:25:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x835.google.com with SMTP id y20so2570609qtm.13 for ; Thu, 29 Nov 2018 08:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QQyHxEi/4wPejAfq+DK8DytiFvsdI7KGd9Rd+7wXqiA=; b=Ip3+d9ENWEf9m1eznkbNm5XzqZYEh+27EaDwYyXtfWkUQfDGovWfZB4Vu1ckX3krJl CltpcUgWiaaA0u2RfNpqW2IxDEH017jb9ZotBKJHNZKocfQkMSWfby+mBlw/s7klLyFb 2y7l1gdHnCqHVU3PjJ+HGC6c/rJiqj3Z9DqNjdZS8nUv8qQE4YCvJo59FLzeecVZolrf 9xAFC8UAV7WtxBWdi2uDBLhdeBSSGV9TNRZ4n97I7bvHMKz1FGGZa4cdzQDIr3eqvuhq oYMTr4TVEPST0BDNRYrl8mYgu+LDmwJ6yN4/lFJaOiBjss9w7sJmowmKff7eYVXUKl+9 9vjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QQyHxEi/4wPejAfq+DK8DytiFvsdI7KGd9Rd+7wXqiA=; b=QaMmSpv6dnmDn898sQN0dqJtzENihhr/xPcsnSx9AdjMd+bZ+qVzkGQyXeR6x77ZUm 8WK4LPhg6gFTuiX1KiKERzlCl5UUJng7zuQg2M2hd1BFpDGK+5bwOm3lkQ/riRK4r067 6YGbCTrm3uMitWN1KAQ6ZF4n6ErsU+90AmiTOGZakw1Q8PoptEdZrfCmIUzg4dDU4UQp UpZj0vN09XT/ZD0p3AFhqeMUA8d8DqWs+2QNnrIqd7nMKerwbHarpfuvA8XcSdJmwPi0 wltObBNtT2JtJC7PZy9kadZY11avEtAqbdnmGyAgfD9rTAfo3i5tHRPpfA6wZl/A5WEh kzhQ== X-Gm-Message-State: AA+aEWY9S+AdaNHYNptEyUNs7tmgrCgvr6xS2wKzgOMp/4fwE3vhIaaa BVKTZvJIkWPqFtVnL4sIM8ae+cHA+Q1X4Ag8yuP2nz4w X-Google-Smtp-Source: AFSGD/Vpm8JMWe9wa9/MGnFOkuLS0OpMhEn/fUMIw20W1F0Q7MZ07zy8S7N6YSAeRCO3GlRrnwd0G5xG+7LDQ3+OSGM= X-Received: by 2002:a0c:bd15:: with SMTP id m21mr2049681qvg.57.1543508741159; Thu, 29 Nov 2018 08:25:41 -0800 (PST) MIME-Version: 1.0 References: <201811291421.wATELQbx059318@repo.freebsd.org> In-Reply-To: <201811291421.wATELQbx059318@repo.freebsd.org> From: Warner Losh Date: Thu, 29 Nov 2018 09:25:30 -0700 Message-ID: Subject: Re: svn commit: r341232 - in head/usr.bin: . trim To: Eugene Grosbein Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: B03AB736CD X-Spamd-Result: default: False [-3.62 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[5.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.33), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:25:42 -0000 On Thu, Nov 29, 2018 at 7:21 AM Eugene Grosbein wrote: > Author: eugen > Date: Thu Nov 29 14:21:26 2018 > New Revision: 341232 > URL: https://svnweb.freebsd.org/changeset/base/341232 > > Log: > Add new small tool trim(1) to delete contents for blocks on flash > based storage devices that use wear-leveling algorithms. > > Reviewed by: hackers@ > I gave only my preliminary comments there. There were many other things that I'd planned on commenting on once this hit Phabricator. Since there were no revised version posted, it was hard to do a line-by-line review. It was at most commented upon by hackers@. The discussion for a name was good there, but since the code wasn't ever posted there (just a pointer to it), it was hard to do a real review. Warner From owner-svn-src-head@freebsd.org Thu Nov 29 16:27:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EFAC1142EB6 for ; Thu, 29 Nov 2018 16:27:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC68773905 for ; Thu, 29 Nov 2018 16:27:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x835.google.com with SMTP id l11so2642112qtp.0 for ; Thu, 29 Nov 2018 08:27:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X5Lex0gDd5Hm9JlwmnmXJK8dZysGHWIllzfXyh5afjs=; b=WJHaLo9gjqnFUuk4beU68l4hNup+BOfHm+LGFvJZeoLPTZfiQOnZ/x5IgB/MPFpzGj XK31X/KPfBjdpCAbopWLJXT3XdmymMkG06JQw5iMSYabg9D1nD0aBDTtWI5rcHVu6vFz iZCMYFvjyT1HDfzU2RsmklsHaV5NQCojS2TAlrC/rVvnKNYpDv+NuKzAAmvBJOUTVTJF U4z6gwV/7AmOMz5J3aiuuQYbOemJvu152IqSgqTmm0TtHRy9LHZMCDTXIMrrGAaH6Frn nIJn1+uzbAHEXnBsAjhseuO1p7jOh7APN1YuhmLpOMfKpR0RQeFbWjn6TOauFxNyg7tY aKrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X5Lex0gDd5Hm9JlwmnmXJK8dZysGHWIllzfXyh5afjs=; b=KIKtgWFyXDlBaUd58FIprRWZWvLN/nXmgI4ZwVl6WzbkG4pNAfZofWycABGMdfGu6l PVgnkaT0VDT2fjyy1QEEmqMTcOzcw/WFdhTO5p9M6E6X5DCWGJxk3AwnSwi0lfwIzKTj JSgoIezXfdHbGKb9Tj5u7FBdYousTy4ZYDHrx0cvE//kOHEBnLdWrECV6WI5A5Zn3aVQ CxffP3qYY6rbxrVX0FpN3vhpw+klFU1oYhrjdyII+1X8H7KUvukoXKqtfmeQpDvufB3B Sl8Dro13bK3eobESjlZCix47oNEzu70Bx8WebSb7K6LKBgMsOivx5AMNQsruvJLvJPgN F7/A== X-Gm-Message-State: AA+aEWalnwXkqLNqCL4tl16jplD+5UgoY3eSjhO5TQqPxWtkCGFhV6Kg gISp/aQJIKjYN+DRy2kzvcWQdWXXWb/8r8XpBDzvPw== X-Google-Smtp-Source: AFSGD/WvZNBC9cjAWvj87QfuMPAJeNTkeXv50PUus8oi+t+8+iprbTffqeHxSrZMyXUXYAEhZGcMFbY5xir92kh1WmA= X-Received: by 2002:ac8:4294:: with SMTP id o20mr2103600qtl.118.1543508865427; Thu, 29 Nov 2018 08:27:45 -0800 (PST) MIME-Version: 1.0 References: <201811291449.wATEnXIY072818@repo.freebsd.org> In-Reply-To: <201811291449.wATEnXIY072818@repo.freebsd.org> From: Warner Losh Date: Thu, 29 Nov 2018 09:27:34 -0700 Message-ID: Subject: Re: svn commit: r341233 - head/usr.bin/trim To: Eugene Grosbein Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: EC68773905 X-Spamd-Result: default: False [-3.62 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[5.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.33), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:27:46 -0000 On Thu, Nov 29, 2018 at 7:49 AM Eugene Grosbein wrote: > Author: eugen > Date: Thu Nov 29 14:49:33 2018 > New Revision: 341233 > URL: https://svnweb.freebsd.org/changeset/base/341233 > > Log: > trim(1): unbreak build after r341232 for platforms using gcc and not > clang > > MFC after: 1 month > > Modified: > head/usr.bin/trim/trim.c > > Modified: head/usr.bin/trim/trim.c > > ============================================================================== > --- head/usr.bin/trim/trim.c Thu Nov 29 14:21:26 2018 (r341232) > +++ head/usr.bin/trim/trim.c Thu Nov 29 14:49:33 2018 (r341233) > @@ -42,8 +42,10 @@ > #include > #include > > +#ifndef lint > static const char rcsid[] = > "$FreeBSD$"; > +#endif /* not lint */ > This is spelled FBSDID("$FreeBSD"); It's one of the many issues I have with the code. Should I just fix them? Warner From owner-svn-src-head@freebsd.org Thu Nov 29 16:31:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7B1C11431B8; Thu, 29 Nov 2018 16:31:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F78673B88; Thu, 29 Nov 2018 16:31:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D2F11C0ED; Thu, 29 Nov 2018 16:31:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATGV2ou027280; Thu, 29 Nov 2018 16:31:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATGV2Bk027279; Thu, 29 Nov 2018 16:31:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811291631.wATGV2Bk027279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 16:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341247 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 341247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F78673B88 X-Spamd-Result: default: False [0.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.28)[0.276,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:31:02 -0000 Author: markj Date: Thu Nov 29 16:31:01 2018 New Revision: 341247 URL: https://svnweb.freebsd.org/changeset/base/341247 Log: Update the free page count when blacklisting pages. Otherwise the free page count will not accurately reflect the physical page allocator's state. On 11 this can trigger panics in vm_page_alloc() since the allocator state and free page count are updated atomically and we expect them to stay in sync. On 12 the bug would manifest as threads looping in vm_page_alloc(). PR: 231296 Reported by: mav, wollman, Rainer Duffner, Josh Gitlin Reviewed by: alc, kib, mav MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18374 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Nov 29 16:13:46 2018 (r341246) +++ head/sys/vm/vm_page.c Thu Nov 29 16:31:01 2018 (r341247) @@ -355,7 +355,8 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose) vm_domain_free_lock(vmd); ret = vm_phys_unfree_page(m); vm_domain_free_unlock(vmd); - if (ret) { + if (ret != 0) { + vm_domain_freecnt_inc(vmd, -1); TAILQ_INSERT_TAIL(&blacklist_head, m, listq); if (verbose) printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); From owner-svn-src-head@freebsd.org Thu Nov 29 16:49:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 463421144250; Thu, 29 Nov 2018 16:49:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC9097587B; Thu, 29 Nov 2018 16:49:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA7251C33A; Thu, 29 Nov 2018 16:49:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATGnuSZ037787; Thu, 29 Nov 2018 16:49:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATGnuXT037786; Thu, 29 Nov 2018 16:49:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811291649.wATGnuXT037786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Nov 2018 16:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341248 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 341248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC9097587B X-Spamd-Result: default: False [0.23 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.33)[-0.327,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.25)[0.247,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 16:49:57 -0000 Author: markj Date: Thu Nov 29 16:49:56 2018 New Revision: 341248 URL: https://svnweb.freebsd.org/changeset/base/341248 Log: Fix age_old_log() after r337468. We can no longer use sizeof() to get the path buffer's size. Apply a straightforward fix for now with the aim of MFCing soon. PR: 233633 Submitted by: Katsuyuki Miyoshi MFC after: 3 days Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Thu Nov 29 16:31:01 2018 (r341247) +++ head/usr.sbin/newsyslog/newsyslog.c Thu Nov 29 16:49:56 2018 (r341248) @@ -2426,6 +2426,7 @@ age_old_log(const char *file) const char *logfile_suffix; static unsigned int suffix_maxlen = 0; char *tmp; + size_t tmpsiz; time_t mtime; int c; @@ -2435,33 +2436,34 @@ age_old_log(const char *file) strlen(compress_type[c].suffix)); } - tmp = alloca(MAXPATHLEN + sizeof(".0") + suffix_maxlen + 1); + tmpsiz = MAXPATHLEN + sizeof(".0") + suffix_maxlen + 1; + tmp = alloca(tmpsiz); if (archtodir) { char *p; /* build name of archive directory into tmp */ if (*archdirname == '/') { /* absolute */ - strlcpy(tmp, archdirname, sizeof(tmp)); + strlcpy(tmp, archdirname, tmpsiz); } else { /* relative */ /* get directory part of logfile */ - strlcpy(tmp, file, sizeof(tmp)); + strlcpy(tmp, file, tmpsiz); if ((p = strrchr(tmp, '/')) == NULL) tmp[0] = '\0'; else *(p + 1) = '\0'; - strlcat(tmp, archdirname, sizeof(tmp)); + strlcat(tmp, archdirname, tmpsiz); } - strlcat(tmp, "/", sizeof(tmp)); + strlcat(tmp, "/", tmpsiz); /* get filename part of logfile */ if ((p = strrchr(file, '/')) == NULL) - strlcat(tmp, file, sizeof(tmp)); + strlcat(tmp, file, tmpsiz); else - strlcat(tmp, p + 1, sizeof(tmp)); + strlcat(tmp, p + 1, tmpsiz); } else { - (void) strlcpy(tmp, file, sizeof(tmp)); + (void) strlcpy(tmp, file, tmpsiz); } if (timefnamefmt != NULL) { @@ -2469,11 +2471,11 @@ age_old_log(const char *file) if (mtime == -1) return (-1); } else { - strlcat(tmp, ".0", sizeof(tmp)); + strlcat(tmp, ".0", tmpsiz); logfile_suffix = get_logfile_suffix(tmp); if (logfile_suffix == NULL) return (-1); - (void) strlcat(tmp, logfile_suffix, sizeof(tmp)); + (void) strlcat(tmp, logfile_suffix, tmpsiz); if (stat(tmp, &sb) < 0) return (-1); mtime = sb.st_mtime; From owner-svn-src-head@freebsd.org Thu Nov 29 17:04:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0869F1144CF7; Thu, 29 Nov 2018 17:04:42 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from webmail5.jnielsen.net (webmail5.jnielsen.net [69.87.218.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "webmail2.jnielsen.net", Issuer "freebsdsolutions.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD617683D; Thu, 29 Nov 2018 17:04:38 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from [192.168.2.173] (stealth.jnielsen.net [68.69.164.122]) (authenticated bits=0) by webmail5.jnielsen.net (8.15.2/8.15.2) with ESMTPSA id wATGjPMw050826 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 Nov 2018 09:45:28 -0700 (MST) (envelope-from lists@jnielsen.net) X-Authentication-Warning: webmail5.jnielsen.net: Host stealth.jnielsen.net [68.69.164.122] claimed to be [192.168.2.173] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r341232 - in head/usr.bin: . trim From: John Nielsen X-Mailer: iPhone Mail (16B92) In-Reply-To: <201811291421.wATELQbx059318@repo.freebsd.org> Date: Thu, 29 Nov 2018 09:45:25 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9812F670-DD3D-4A56-A826-28B4A055F488@jnielsen.net> References: <201811291421.wATELQbx059318@repo.freebsd.org> To: Eugene Grosbein X-Rspamd-Queue-Id: 0AD617683D X-Spamd-Result: default: False [-1.96 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[jnielsen.net]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.96)[-0.959,0]; MX_GOOD(-0.01)[mx0.freebsdsolutions.net,mx1.freebsdsolutions.net,mx2.freebsdsolutions.net,mx3.freebsdsolutions.net]; NEURAL_HAM_SHORT(-0.19)[-0.190,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)]; ASN(0.00)[asn:6364, ipnet:69.87.218.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 17:04:42 -0000 > On Nov 29, 2018, at 7:21 AM, Eugene Grosbein wrote: >=20 > Author: eugen > Date: Thu Nov 29 14:21:26 2018 > New Revision: 341232 > URL: https://svnweb.freebsd.org/changeset/base/341232 >=20 > Log: > Add new small tool trim(1) to delete contents for blocks on flash > based storage devices that use wear-leveling algorithms. >=20 > [snip] > +.Sh DESCRIPTION > +The > +.Nm > +utility erases specified region of the device. > +It is only relevant for flash based storage devices that use wear-levelin= g > +algorithms. I=E2=80=99m curious, would this also be useful for virtual disks or SAN/NAS d= evices backed by thinly-provisioned storage? From owner-svn-src-head@freebsd.org Thu Nov 29 17:13:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5181511450DF; Thu, 29 Nov 2018 17:13:53 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ABBF676F81; Thu, 29 Nov 2018 17:13:52 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wATHDjWY017817 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Nov 2018 18:13:46 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: lists@jnielsen.net Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wATHDid5089379 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 30 Nov 2018 00:13:45 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r341232 - in head/usr.bin: . trim To: John Nielsen References: <201811291421.wATELQbx059318@repo.freebsd.org> <9812F670-DD3D-4A56-A826-28B4A055F488@jnielsen.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <39f2c6b4-1d84-1324-217d-12dd5c2573b8@freebsd.org> Date: Fri, 30 Nov 2018 00:13:33 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <9812F670-DD3D-4A56-A826-28B4A055F488@jnielsen.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: ABBF676F81 X-Spamd-Result: default: False [-0.45 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.42)[-0.416,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; NEURAL_SPAM_SHORT(0.28)[0.280,0]; NEURAL_HAM_LONG(-0.31)[-0.309,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 17:13:53 -0000 29.11.2018 23:45, John Nielsen wrote: > I’m curious, would this also be useful for virtual disks or SAN/NAS devices backed by thinly-provisioned storage? It won't work for for files residing on UFS/ZFS, if you mean that. And you can verify that easily: just make extra file and try to trim it to see "Inappropriate ioctl for device" error. It might work for iSCSI attached devices, I'm not sure. From owner-svn-src-head@freebsd.org Thu Nov 29 17:27:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05C3B1145596; Thu, 29 Nov 2018 17:27:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E8507773E; Thu, 29 Nov 2018 17:27:03 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id v10so2186117ios.13; Thu, 29 Nov 2018 09:27:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=7aUp3U77+vc6lJKDp2HbQ7AksrmgibpWVG07vDlEBtE=; b=cW41MVZY0jHFfYk9HJ1x/QeiwaJfPa+B6HoIY0egvg1WAnZtQp+bP2RB7ENsO/KP4r ds3TJeKvCUF6W5BxXji9qJvf7F76mzfYka7rrh8Ixuz/czh8zRyEOxqk/7gONihO0pYH Ssxv1nkqFJ/zGFV3THynzMveSCg+yPmP8wE3nYuxdVpn+0wLXmJHycLpYQ7BnQ/VVf54 YrOjbbOu0CF02y25Do+mfqlzteHXbVAXPG3ksWHQC2t0vuw18UXYlr0RS+YUnKADVali kj3aN3jM1+nuZfP5Aqdb7bYk7Ohyb2gXo9Xo1e4UiWWtlA7ETSm7PDo85K90psS7jJdW PIdA== X-Gm-Message-State: AA+aEWZ3kcKLpocytd9p6pjhPDTq0bbRB/dC1xqoKkjs0QUa8ElpX6DK VHUsrjhZcJhITQr+ebYef2eNdTu1 X-Google-Smtp-Source: AFSGD/X1s3gN7yLw43Iug2bzsKNhr8gJ+SvOwdnSn1mpR3tC9mag7l+xE034IiY9c40p1Yt99RKDmw== X-Received: by 2002:a6b:c815:: with SMTP id y21mr1844728iof.98.1543512416751; Thu, 29 Nov 2018 09:26:56 -0800 (PST) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com. [209.85.166.41]) by smtp.gmail.com with ESMTPSA id c25sm952955ioa.86.2018.11.29.09.26.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 09:26:56 -0800 (PST) Received: by mail-io1-f41.google.com with SMTP id g8so2196082iop.10; Thu, 29 Nov 2018 09:26:56 -0800 (PST) X-Received: by 2002:a5d:94cc:: with SMTP id y12mr1844387ior.233.1543512415978; Thu, 29 Nov 2018 09:26:55 -0800 (PST) MIME-Version: 1.0 References: <201811291421.wATELQbx059318@repo.freebsd.org> In-Reply-To: <201811291421.wATELQbx059318@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 29 Nov 2018 09:26:45 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r341232 - in head/usr.bin: . trim To: eugen@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 5E8507773E X-Spamd-Result: default: False [-5.82 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-2.83)[ip: (-9.24), ipnet: 209.85.128.0/17(-3.47), asn: 15169(-1.32), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; RCVD_IN_DNSWL_NONE(0.00)[45.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 17:27:04 -0000 Hi Eugene, On Thu, Nov 29, 2018 at 6:22 AM Eugene Grosbein wrote: > > Author: eugen > Date: Thu Nov 29 14:21:26 2018 > New Revision: 341232 > URL: https://svnweb.freebsd.org/changeset/base/341232 > > Log: > Add new small tool trim(1) to delete contents for blocks on flash > based storage devices that use wear-leveling algorithms. > > Reviewed by: hackers@ > MFC after: 1 month As much as I also want a tool like this, please back out the commit for now. It was never code reviewed; that's what the "Reviewed by:" annotation means. It was *discussed*, but not universally approved, on hackers@. I think this should probably be backed out and at least given basic code review first. I volunteer to do that in a timely fashion myself; there is at least one glaring issue in the tool just scanning the code. It should have some basic review before anything like "MFC after" is suggested and we commit to basically adding a userspace API. At least Warner, and possibly others, should be on the review as well. Thanks, Conrad From owner-svn-src-head@freebsd.org Thu Nov 29 17:52:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69C4C1146A44 for ; Thu, 29 Nov 2018 17:52:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8B1794EF for ; Thu, 29 Nov 2018 17:52:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id n32so2928535qte.11 for ; Thu, 29 Nov 2018 09:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OWS6j1Hdc2MAuGlnVTG/JkzKtZHoAnfE+wHwJVotBiQ=; b=hz8NGhMCv/MxpUqqn0nBtG2YTB/scuBz91crcG7bxI6mdIDKZfI9q15FQkRpOEp2RG uHzUTXQ0wCVxjHj2CRA0cIlyECDg19Xh9JV7vREZU18GwiiMHP0Anf1o30HLJ8tEXmqq tCIkvZf39pZcaa7pXWR9lKatyPKIK8OOuv2G+214QiP5qQUEx57wvpkejzpnUfLCCgiu 2fewTIU5x2wFVPg9SyG1grqSphfBMhG5d0klLNWuLN/s+uGCdDx3wZAAgW/OTXpq12dQ /aIHTEBPZt0UxRKagBTIHxiKpkOkmKfNJtuH4o66vCKNsrLbZbsqHsHRvd5BEJKcV7Ts D1iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OWS6j1Hdc2MAuGlnVTG/JkzKtZHoAnfE+wHwJVotBiQ=; b=s6Db84j2aRZHBL14+7IXi+3mbqowmqyPfPDRb2T+gambzL33iYGaYf0SchjuKGrTpF Bzl/NUVcNQCp2iOzjvoiQTSPzD9oQMbwqZWYFspNAOjEz92/kIWffgj561Kh14h7X+fB XVcONAhqY4PeNmRzT41W1EQWvHH8bqC66nzAeH+ypO207m7GPYgeKu8Nd9h7NUlgdonF oodcQd436NtRjp76D+URQKcxK9tZN8TzwVpZoX9B0H7CqJZE5HinSHrNFeiySTUDuHqM hEIylQCYVHmtgM9Y/ekkoS2jVxjLvebV1NW5K/DDr+ejNIITkGq7l6MtIM61dVsPI1vg GL8A== X-Gm-Message-State: AA+aEWY4d7b+SDnevPxYe6S/8aOEMl5l1CbB1a3VdHPx/NumRr7+/jTc m1ch8be9KobBGdkvHpuFzre0zwm1crEL4A6HrFCuzQ== X-Google-Smtp-Source: AFSGD/UmN2VRCfeRIf7RajhvlISzKg4DJgOYOzZ4Z0nF8gxlM8x3Eq6p4hUM/xIfaTxKyZDQMWQt7zyGDMPyFbPrW+A= X-Received: by 2002:a0c:9549:: with SMTP id m9mr2413408qvm.214.1543513967055; Thu, 29 Nov 2018 09:52:47 -0800 (PST) MIME-Version: 1.0 References: <201811291421.wATELQbx059318@repo.freebsd.org> <9812F670-DD3D-4A56-A826-28B4A055F488@jnielsen.net> In-Reply-To: <9812F670-DD3D-4A56-A826-28B4A055F488@jnielsen.net> From: Warner Losh Date: Thu, 29 Nov 2018 10:52:35 -0700 Message-ID: Subject: Re: svn commit: r341232 - in head/usr.bin: . trim To: lists@jnielsen.net Cc: Eugene Grosbein , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 8F8B1794EF X-Spamd-Result: default: False [-3.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.984,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[b.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.87)[-0.873,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.75), asn: 15169(-1.33), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 17:52:48 -0000 On Thu, Nov 29, 2018 at 10:04 AM John Nielsen wrote: > > On Nov 29, 2018, at 7:21 AM, Eugene Grosbein wrote: > > > > Author: eugen > > Date: Thu Nov 29 14:21:26 2018 > > New Revision: 341232 > > URL: https://svnweb.freebsd.org/changeset/base/341232 > > > > Log: > > Add new small tool trim(1) to delete contents for blocks on flash > > based storage devices that use wear-leveling algorithms. > > > > [snip] > > > +.Sh DESCRIPTION > > +The > > +.Nm > > +utility erases specified region of the device. > > +It is only relevant for flash based storage devices that use > wear-leveling > > +algorithms. > > I=E2=80=99m curious, would this also be useful for virtual disks or SAN/N= AS > devices backed by thinly-provisioned storage? > Yes. It is. Any device that supports BIO_DELETE the trim will work on. It could work on files within a filesystem, but not in its current state. ftruncate, however, is a better match there. None of the filesystems support the DIOCDELETE ioctl. Warner From owner-svn-src-head@freebsd.org Thu Nov 29 18:08:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFE51114761C; Thu, 29 Nov 2018 18:08:11 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2011A7A7C3; Thu, 29 Nov 2018 18:08:11 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wATI82fD018281 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Nov 2018 19:08:03 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wATI80xc090690 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 30 Nov 2018 01:08:01 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r341232 - in head/usr.bin: . trim To: Warner Losh , lists@jnielsen.net References: <201811291421.wATELQbx059318@repo.freebsd.org> <9812F670-DD3D-4A56-A826-28B4A055F488@jnielsen.net> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <505717d1-ffad-5241-2dae-deb2e9900335@freebsd.org> Date: Fri, 30 Nov 2018 01:07:49 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 2011A7A7C3 X-Spamd-Result: default: False [-0.15 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.17)[-0.172,0]; NEURAL_SPAM_SHORT(0.28)[0.282,0]; NEURAL_HAM_LONG(-0.26)[-0.262,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 18:08:11 -0000 30.11.2018 0:52, Warner Losh wrote: > It could work on files within a filesystem, but not in its current state. ftruncate, however, is a better match there. None of the filesystems support the DIOCDELETE ioctl. However, both of UFS and ZFS issue BIO_DELETE while freeing their fs blocks, do they? From owner-svn-src-head@freebsd.org Thu Nov 29 18:10:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E073D114784B; Thu, 29 Nov 2018 18:10:22 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 66E247AAFB; Thu, 29 Nov 2018 18:10:22 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wATIAEDa018315 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Nov 2018 19:10:15 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wATIAED8090712 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 30 Nov 2018 01:10:14 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r341232 - in head/usr.bin: . trim To: Warner Losh References: <201811291421.wATELQbx059318@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <06bcdfa2-1aab-a819-f4a1-f91b49992140@freebsd.org> Date: Fri, 30 Nov 2018 01:10:03 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 66E247AAFB X-Spamd-Result: default: False [-0.40 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.14)[-0.138,0]; NEURAL_SPAM_SHORT(0.07)[0.074,0]; NEURAL_HAM_LONG(-0.34)[-0.335,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 18:10:23 -0000 29.11.2018 23:25, Warner Losh wrote: > There were many other things that I'd planned on commenting on once this hit Phabricator. Is it possible to upload the whole new file to Phabricator and not as silly "diff" against /dev/null? From owner-svn-src-head@freebsd.org Thu Nov 29 18:10:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A181E11478BA for ; Thu, 29 Nov 2018 18:10:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDA857AC05 for ; Thu, 29 Nov 2018 18:10:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id d19so3002247qtq.9 for ; Thu, 29 Nov 2018 10:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0YlnCdCTDaEMHrm9x/JE9wGD0jTg4EYlcIdfXTP3iXw=; b=I13Dga9xHycWjSOFvnzZEstmXynbURsQFwmOltLK3Fx5otS7qtfrMPg7NKqv2AiPcR wM4Q2JXPOb0F0j/BUxi4wY53kA8uiYj1U23cSTiTTBTHuFZoUn5jc890lsC22/xWWrxz E1yQz6H6DdjtwVAiUbsGLC8OAGan6ScqT8abytgJNBy2d9X9QDSPI0tFOkSGQLqRN7zX 944CNXWaSsONPMtJ+5QTidwIR1QTFHTbJBVRU5dwIUwKWFquJgpDJB2i0KOocUzcI0gu tpEe5xXTXJoirfoM/Q3MIxeXQRQ4r/7phQF995nWEDOsaSXQF+Y80p/INSrDOPu0wdpg cQTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0YlnCdCTDaEMHrm9x/JE9wGD0jTg4EYlcIdfXTP3iXw=; b=EY+MSzduUvJjGOOeIsK5fC42uKz6xVB9joLvzK0E1K7BzmD1rHBszIpxOU7N205TzQ U5DrWMZLY6gyLdl8q0UgnbD9JICw3RhFW6IFPFi24BgajINmVCFPuSRo2fBi2INrS+TS 93gFvl92wWgzyzrJMYucrYjwg95dFvmDpkb3eh140qiG7pfPy01jaT8unAiENxf1k1cA reCtgLv2OOZ9/EiVmkl2rW2Y1DMIyXddokFwDCYQliPBeAu71zkCckmJLe+S8Nax+Lng I4CL9KVdEzFMTEnzef5UGDGaHA32u5HhC7QEBIK1wzExscRKoTOMEp51dSCnTafiTcyH 61Bg== X-Gm-Message-State: AA+aEWZTrQY2qiX5wwB8agBAxVX1N0w4W5Ea42alV98cVtWlB25NFhq5 VmiILm4wYSWiRvAmdgTjrnNsDLHmpcdnkLBLJNRdfQ== X-Google-Smtp-Source: AFSGD/WjBpDN8m8NQb95xZDqIGzgCvGsLU2bwiOgepEU495a/M0hIjWVb6FxGMZjJFjbUPV3ZCbwrKnfCQOVtmpJphE= X-Received: by 2002:a0c:f143:: with SMTP id y3mr2476581qvl.21.1543515038160; Thu, 29 Nov 2018 10:10:38 -0800 (PST) MIME-Version: 1.0 References: <201811291421.wATELQbx059318@repo.freebsd.org> <9812F670-DD3D-4A56-A826-28B4A055F488@jnielsen.net> <505717d1-ffad-5241-2dae-deb2e9900335@freebsd.org> In-Reply-To: <505717d1-ffad-5241-2dae-deb2e9900335@freebsd.org> From: Warner Losh Date: Thu, 29 Nov 2018 11:10:26 -0700 Message-ID: Subject: Re: svn commit: r341232 - in head/usr.bin: . trim To: Eugene Grosbein Cc: lists@jnielsen.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: DDA857AC05 X-Spamd-Result: default: False [-3.57 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[a.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.32), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 18:10:39 -0000 On Thu, Nov 29, 2018 at 11:08 AM Eugene Grosbein wrote: > 30.11.2018 0:52, Warner Losh wrote: > > > It could work on files within a filesystem, but not in its current > state. ftruncate, however, is a better match there. None of the filesystems > support the DIOCDELETE ioctl. > > However, both of UFS and ZFS issue BIO_DELETE while freeing their fs > blocks, do they? > Yes. They do. You can't just open a file that's backed by ufs/zfs and issue the DIOCGDELETE ioctl. ZFS devices, though, do honor it. Warner From owner-svn-src-head@freebsd.org Thu Nov 29 18:10:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A0D1147910; Thu, 29 Nov 2018 18:10:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55BAD7AE1F; Thu, 29 Nov 2018 18:10:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 6560C10AFD2; Thu, 29 Nov 2018 13:10:50 -0500 (EST) Subject: Re: svn commit: r341233 - head/usr.bin/trim To: Eugene Grosbein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811291449.wATEnXIY072818@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <144de643-bcdc-7044-7ca0-26175117f4ea@FreeBSD.org> Date: Thu, 29 Nov 2018 10:10:49 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201811291449.wATEnXIY072818@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 29 Nov 2018 13:10:50 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 55BAD7AE1F X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.10)[-0.103,0]; NEURAL_SPAM_LONG(0.17)[0.173,0]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; NEURAL_SPAM_SHORT(0.37)[0.369,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 18:10:53 -0000 On 11/29/18 6:49 AM, Eugene Grosbein wrote: > Author: eugen > Date: Thu Nov 29 14:49:33 2018 > New Revision: 341233 > URL: https://svnweb.freebsd.org/changeset/base/341233 > > Log: > trim(1): unbreak build after r341232 for platforms using gcc and not clang > > MFC after: 1 month > > Modified: > head/usr.bin/trim/trim.c > > Modified: head/usr.bin/trim/trim.c > ============================================================================== > --- head/usr.bin/trim/trim.c Thu Nov 29 14:21:26 2018 (r341232) > +++ head/usr.bin/trim/trim.c Thu Nov 29 14:49:33 2018 (r341233) > @@ -42,8 +42,10 @@ > #include > #include > > +#ifndef lint > static const char rcsid[] = > "$FreeBSD$"; > +#endif /* not lint */ This is spelled __FBSDID("$FreeBSD$"); in FreeBSD sources. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Thu Nov 29 18:36:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C602F114897C for ; Thu, 29 Nov 2018 18:36:21 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBCD47C2DB for ; Thu, 29 Nov 2018 18:36:20 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ot1-f44.google.com with SMTP id u16so2700515otk.8 for ; Thu, 29 Nov 2018 10:36:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zYITn0rfyjDUchjHibYdFZP36AuTbJKkKsyWXm5J0P4=; b=MlQ3OuH1RBNOXzP59zQRkMaOLAK6HfH+CYxmQaPRRo4eH4QXI1FGqAWFLqz7nEmsAQ lk+BA9Sby63eBklVj9P84o3XtdY8eFRqY4agBKHjqk5034dOpjwLrKwoWLg0/cpUZh0w d6ReZECfW2IXuhtUtmLoBQkt59jSUispdgn7qI6ssXxjDOe7ijHaQ2iLEsLk7sH8yHfl lRtZx9bRa/TGMEB3sTebdYyLsrhreN4+yP6N4YVSS3fvC7B/lpv/uD3qn3VCwDBgrgg+ 4hfybwmSt7Ev7Ug//1qwg7UJM8Nvtbt7XHS3+ehUBHW8YSriO2J4kJSlDzrVMaX7wR/3 wjxQ== X-Gm-Message-State: AA+aEWbIVyfgNUs/1OThj8ZJ02l9LRkffkivPFVA2I9a2z7VligFKaAF xX1GGx30xVPDTQRtu9Pn756t15HzSsJjqbCl8KCT2S8JjpQ= X-Google-Smtp-Source: AFSGD/XRNhePHXZ7vn3whkpPtk/10TS6BkyK6qnn83k3EYLrEgwFpXQ4tuu8h5QwSwlqxritr5ccngWBOTTDFwUDI7c= X-Received: by 2002:a9d:3387:: with SMTP id u7mr1716866otc.81.1543516573989; Thu, 29 Nov 2018 10:36:13 -0800 (PST) MIME-Version: 1.0 References: <201811291421.wATELQbx059318@repo.freebsd.org> In-Reply-To: <201811291421.wATELQbx059318@repo.freebsd.org> From: Maxim Sobolev Date: Thu, 29 Nov 2018 10:36:02 -0800 Message-ID: Subject: Re: svn: head/usr.bin: . trim To: eugen@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: CBCD47C2DB X-Spamd-Result: default: False [-3.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[44.210.85.209.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; RCVD_IN_DNSWL_NONE(0.00)[44.210.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.97)[ipnet: 209.85.128.0/17(-3.46), asn: 15169(-1.32), country: US(-0.09)]; FORGED_SENDER(0.30)[sobomax@freebsd.org,sobomax@sippysoft.com]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[sobomax@freebsd.org,sobomax@sippysoft.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 18:36:22 -0000 Interesting. I have a similar functionality implemented as an option for the dd utility in my pipeline (conv=erase). -Max On Thu, Nov 29, 2018 at 6:21 AM Eugene Grosbein wrote: > Author: eugen > Date: Thu Nov 29 14:21:26 2018 > New Revision: 341232 > URL: https://svnweb.freebsd.org/changeset/base/341232 > > Log: > Add new small tool trim(1) to delete contents for blocks on flash > based storage devices that use wear-leveling algorithms. > > Reviewed by: hackers@ > MFC after: 1 month > > Added: > head/usr.bin/trim/ > head/usr.bin/trim/Makefile (contents, props changed) > head/usr.bin/trim/trim.1 (contents, props changed) > head/usr.bin/trim/trim.c (contents, props changed) > Modified: > head/usr.bin/Makefile > > Modified: head/usr.bin/Makefile > > ============================================================================== > --- head/usr.bin/Makefile Thu Nov 29 14:21:01 2018 (r341231) > +++ head/usr.bin/Makefile Thu Nov 29 14:21:26 2018 (r341232) > @@ -159,6 +159,7 @@ SUBDIR= alias \ > touch \ > tput \ > tr \ > + trim \ > true \ > truncate \ > tset \ > > Added: head/usr.bin/trim/Makefile > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/trim/Makefile Thu Nov 29 14:21:26 2018 (r341232) > @@ -0,0 +1,6 @@ > +# $FreeBSD$ > + > +PROG= trim > +LIBADD= util > + > +.include > > Added: head/usr.bin/trim/trim.1 > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/trim/trim.1 Thu Nov 29 14:21:26 2018 (r341232) > @@ -0,0 +1,166 @@ > +.\" > +.\" Copyright (c) 2018 Eugene Grosbein . > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the > distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE > LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE > GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd November 29, 2018 > +.Dt TRIM 1 > +.Os > +.Sh NAME > +.Nm trim > +.Nd erase device blocks that have no needed contents > +.Sh SYNOPSIS > +.Nm > +.Op Fl Nfqv > +.Fl [ [lo] Xo > +.Bk -words > +.Sm off > +.Ar offset > +.Op Cm K | k | M | m | G | g | T | t ] > +.Sm on > +.Xc > +.Ek > +.Bk -words > +.Op Fl r Ar rfile > +.Ek > +.Ar device ... > +.Sh DESCRIPTION > +The > +.Nm > +utility erases specified region of the device. > +It is only relevant for flash based storage devices that use wear-leveling > +algorithms. > +.Sy All erased data is lost. > +.Pp > +The following options are available: > +.Bl -tag -width indent > +.It Fl N > +Do not actually erase anything but show what it would do (dry run). > +Implies > +.Fl v . > +This is the default. Overrides > +.Fl f . > +.It Fl f > +Perform the operation. Overrides > +.Fl N . > +.It Fl l Xo > +.Sm off > +.Ar offset > +.Op Cm K | k | M | m | G | g | T | t > +.Sm on > +.Xc > +.It Fl o Xo > +.Sm off > +.Ar offset > +.Op Cm K | k | M | m | G | g | T | t > +.Sm on > +.Xc > +Specify the length > +.Fl l > +of the region to trim or its offset > +.Fl o > +from the beginning of the device. > +.Sy The whole device is erased by default > +unless one or both of these options are presented. > +.Pp > +The argument may be suffixed with one of > +.Cm K , > +.Cm M , > +.Cm G > +or > +.Cm T > +(either upper or lower case) to indicate a multiple of > +Kilobytes, Megabytes, Gigabytes or Terabytes > +respectively. > +.It Fl q > +Do not output anything except of possible error messages (quiet mode). > +Overrides > +.Fl v . > +.It Fl r Ar rfile > +Uses the length of given > +.Ar rfile > +as length of the region to erase. > +.Sy The whole device is erased by default. > +.It Fl v > +Show offset and length of actual region being erased, in bytes. > +.El > +.Pp > +Later options override previous ones. > +.Pp > +Note that actual success of the operation depends of underlying > +device driver such as > +.Xr ada 4 , > +.Xr da 4 > +and others. > +Refer to corresponding manual pages for detail on possible caveats > +in low level support for ATA TRIM or SCSI UNMAP commands. > +.Sh EXIT STATUS > +.Ex -std > +If the final erase operation fails for an argument, the > +.Nm > +utility returns exit code 1. > +It can also return one of the exit codes defined in > +.Xr sysexits 3 , > +as follows: > +.Bl -tag -width ".Dv EX_UNAVAILABLE" > +.It Dv EX_USAGE > +The specified offset or length of the region is incorrect. > +.It Dv EX_OSERR > +There is no enough memory to proceed. > +.It Dv EX_NOINPUT > +The specified > +.Ar rfile > +cannot be opened (perhaps, it does not exist). > +.It Dv EX_IOERR > +The specified > +.Ar rfile > +cannot be examined for its size due to some system input/output error. > +.It Dv EX_DATAERR > +The specified > +.Ar rfile > +is not regular file, directory nor special device, so its size > +cannot be examined. > +.It Dv EX_UNAVAILABLE > +The specified > +.Ar rfile > +is special device file not supporting DIOCGMEDIASIZE > +.Xr ioctl 2 > +(probably not a disk), so its size cannot be examined. > +.El > +.Sh SEE ALSO > +.Xr ada 4 , > +.Xr da 4 , > +.Xr ioctl 2 , > +.Xr sysexits 3 > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 12.0 . > +.Sh AUTHORS > +The > +.Nm > +utility was written by > +.An Eugene Grosbein Aq Mt eugen@FreeBSD.org . > > Added: head/usr.bin/trim/trim.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/trim/trim.c Thu Nov 29 14:21:26 2018 (r341232) > @@ -0,0 +1,211 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2018 Eugene Grosbein . > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + */ > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +static const char rcsid[] = > + "$FreeBSD$"; > + > +static int trim(char *path, off_t offset, off_t length, int dryrun, > int verbose); > +static off_t getsize(char *path); > +static void usage(char *name) __dead2; > + > +int > +main(int argc, char **argv) > +{ > + off_t offset, length; > + uint64_t usz; > + int dryrun, error, verbose; > + char *fname, *name; > + char ch; > + > + error = 0; > + length = offset = 0; > + name = argv[0]; > + dryrun = verbose = 1; > + > + while ((ch = getopt(argc, argv, "Nfl:o:qr:v")) != -1) > + switch (ch) { > + case 'N': > + dryrun = 1; > + verbose = 1; > + break; > + case 'f': > + dryrun = 0; > + break; > + case 'l': > + case 'o': > + if (expand_number(optarg, &usz) == -1 || > + (off_t)usz < 0 || > + (usz == 0 && ch == 'l')) > + errx(EX_USAGE, > + "invalid %s of the region: `%s'", > + ch == 'o' ? "offset" : "length", > + optarg); > + if (ch == 'o') > + offset = (off_t)usz; > + else > + length = (off_t)usz; > + break; > + case 'q': > + verbose = 0; > + break; > + case 'r': > + if ((length = getsize(optarg)) == 0) > + errx(EX_USAGE, > + "invalid zero length reference > file" > + " for the region: `%s'", optarg); > + break; > + case 'v': > + verbose = 1; > + break; > + default: > + usage(name); > + /* NOTREACHED */ > + } > + > + argv += optind; > + argc -= optind; > + > + if (argc < 1) > + usage(name); > + > + while ((fname = *argv++) != NULL) > + if (trim(fname, offset, length, dryrun, verbose) < 0) > + error++; > + > + return (error ? EXIT_FAILURE : EXIT_SUCCESS); > +} > + > +static off_t > +getsize(char *path) > +{ > + struct stat sb; > + char *tstr; > + off_t mediasize; > + int fd; > + > + if ((fd = open(path, O_RDONLY | O_DIRECT)) < 0) { > + if (errno == ENOENT && path[0] != '/') { > + if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) > + errx(EX_OSERR, "no memory"); > + fd = open(tstr, O_RDONLY | O_DIRECT); > + free(tstr); > + } > + } > + > + if (fd < 0) > + err(EX_NOINPUT, "`%s'", path); > + > + if (fstat(fd, &sb) < 0) > + err(EX_IOERR, "`%s'", path); > + > + if (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode)) { > + close(fd); > + return (sb.st_size); > + } > + > + if (!S_ISCHR(sb.st_mode) && !S_ISBLK(sb.st_mode)) > + errx(EX_DATAERR, > + "invalid type of the file " > + "(not regular, directory nor special device): > `%s'", > + path); > + > + if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) > + errx(EX_UNAVAILABLE, > + "ioctl(DIOCGMEDIASIZE) failed, probably not a > disk: " > + "`%s'", path); > + close(fd); > + > + return (mediasize); > +} > + > +static int > +trim(char *path, off_t offset, off_t length, int dryrun, int verbose) > +{ > + off_t arg[2]; > + char *tstr; > + int error, fd; > + > + if (length == 0) > + length = getsize(path); > + > + if (verbose) > + printf("trim `%s' offset %ju length %ju\n", > + path, (uintmax_t)offset, (uintmax_t)length); > + > + if (dryrun) { > + printf("dry run: add -f to actually perform the > operation\n"); > + return (0); > + } > + > + if ((fd = open(path, O_WRONLY | O_DIRECT)) < 0) { > + if (errno == ENOENT && path[0] != '/') { > + if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) > + errx(EX_OSERR, "no memory"); > + fd = open(tstr, O_WRONLY | O_DIRECT); > + free(tstr); > + } > + } > + > + if (fd < 0) > + err(EX_NOINPUT, "`%s'", path); > + > + arg[0] = offset; > + arg[1] = length; > + > + error = ioctl(fd, DIOCGDELETE, arg); > + if (error < 0) > + warn("ioctl(DIOCGDELETE) failed for `%s'", path); > + > + close(fd); > + return (error); > +} > + > +static void > +usage(char *name) > +{ > + (void)fprintf(stderr, > + "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t]] [-r rfile] [-Nfqv] > device ...\n", > + name); > + exit(EX_USAGE); > +} > > From owner-svn-src-head@freebsd.org Thu Nov 29 18:37:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ED311148A5E; Thu, 29 Nov 2018 18:37:51 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D572E7C48C; Thu, 29 Nov 2018 18:37:50 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4E171D5AF; Thu, 29 Nov 2018 18:37:50 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATIbott096051; Thu, 29 Nov 2018 18:37:50 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATIbmRi096041; Thu, 29 Nov 2018 18:37:48 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201811291837.wATIbmRi096041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Thu, 29 Nov 2018 18:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341253 - in head/stand: common i386/libi386 libsa uboot/lib X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head/stand: common i386/libi386 libsa uboot/lib X-SVN-Commit-Revision: 341253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D572E7C48C X-Spamd-Result: default: False [0.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.30)[0.304,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; NEURAL_SPAM_LONG(0.34)[0.335,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 18:37:51 -0000 Author: sobomax Date: Thu Nov 29 18:37:48 2018 New Revision: 341253 URL: https://svnweb.freebsd.org/changeset/base/341253 Log: The libstand's panic() appends its own '\n' to the message, so that users of the API don't need to supply one. MFC after: 2 weeks Modified: head/stand/common/interp_forth.c head/stand/i386/libi386/biosdisk.c head/stand/libsa/arp.c head/stand/libsa/assert.c head/stand/libsa/bzipfs.c head/stand/libsa/netif.c head/stand/libsa/sbrk.c head/stand/uboot/lib/copy.c head/stand/uboot/lib/net.c Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/common/interp_forth.c Thu Nov 29 18:37:48 2018 (r341253) @@ -144,7 +144,7 @@ bf_command(FICL_VM *vm) printf("%s\n", command_errmsg); break; case CMD_FATAL: - panic("%s\n", command_errmsg); + panic("%s", command_errmsg); } free(line); Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/i386/libi386/biosdisk.c Thu Nov 29 18:37:48 2018 (r341253) @@ -646,7 +646,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s } if (V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize == 0) - panic("BUG: Real mode buffer is too small\n"); + panic("BUG: Real mode buffer is too small"); bbuf = PTOV(V86_IO_BUFFER); rest = size; Modified: head/stand/libsa/arp.c ============================================================================== --- head/stand/libsa/arp.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/libsa/arp.c Thu Nov 29 18:37:48 2018 (r341253) @@ -120,7 +120,7 @@ arpwhohas(struct iodesc *d, struct in_addr addr) arpsend, &wbuf.data, sizeof(wbuf.data), arprecv, &pkt, (void **)&ah, NULL); if (i == -1) { - panic("arp: no response for %s\n", + panic("arp: no response for %s", inet_ntoa(addr)); } Modified: head/stand/libsa/assert.c ============================================================================== --- head/stand/libsa/assert.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/libsa/assert.c Thu Nov 29 18:37:48 2018 (r341253) @@ -35,10 +35,10 @@ void __assert(const char *func, const char *file, int line, const char *expression) { if (func == NULL) - panic("Assertion failed: (%s), file %s, line %d.\n", + panic("Assertion failed: (%s), file %s, line %d.", expression, file, line); else panic( - "Assertion failed: (%s), function %s, file %s, line %d.\n", + "Assertion failed: (%s), function %s, file %s, line %d.", expression, func, file, line); } Modified: head/stand/libsa/bzipfs.c ============================================================================== --- head/stand/libsa/bzipfs.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/libsa/bzipfs.c Thu Nov 29 18:37:48 2018 (r341253) @@ -360,7 +360,7 @@ bzf_stat(struct open_file *f, struct stat *sb) void bz_internal_error(int errorcode) { - panic("bzipfs: critical error %d in bzip2 library occured\n", errorcode); + panic("bzipfs: critical error %d in bzip2 library occured", errorcode); } #ifdef REGRESSION Modified: head/stand/libsa/netif.c ============================================================================== --- head/stand/libsa/netif.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/libsa/netif.c Thu Nov 29 18:37:48 2018 (r341253) @@ -182,7 +182,7 @@ netif_attach(struct netif *nif, struct iodesc *desc, v desc->io_netif = nif; #ifdef PARANOID if (drv->netif_init == NULL) - panic("%s%d: no netif_init support\n", drv->netif_bname, + panic("%s%d: no netif_init support", drv->netif_bname, nif->nif_unit); #endif drv->netif_init(desc, machdep_hint); @@ -201,7 +201,7 @@ netif_detach(struct netif *nif) #endif #ifdef PARANOID if (drv->netif_end == NULL) - panic("%s%d: no netif_end support\n", drv->netif_bname, + panic("%s%d: no netif_end support", drv->netif_bname, nif->nif_unit); #endif drv->netif_end(nif); @@ -222,7 +222,7 @@ netif_get(struct iodesc *desc, void **pkt, time_t timo #endif #ifdef PARANOID if (drv->netif_get == NULL) - panic("%s%d: no netif_get support\n", drv->netif_bname, + panic("%s%d: no netif_get support", drv->netif_bname, nif->nif_unit); #endif rv = drv->netif_get(desc, pkt, timo); @@ -249,7 +249,7 @@ netif_put(struct iodesc *desc, void *pkt, size_t len) #endif #ifdef PARANOID if (drv->netif_put == NULL) - panic("%s%d: no netif_put support\n", drv->netif_bname, + panic("%s%d: no netif_put support", drv->netif_bname, nif->nif_unit); #endif rv = drv->netif_put(desc, pkt, len); Modified: head/stand/libsa/sbrk.c ============================================================================== --- head/stand/libsa/sbrk.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/libsa/sbrk.c Thu Nov 29 18:37:48 2018 (r341253) @@ -53,7 +53,7 @@ sbrk(int incr) char *ret; if (heapbase == 0) - panic("No heap setup\n"); + panic("No heap setup"); if ((heapsize + incr) <= maxheap) { ret = (char *)heapbase + heapsize; Modified: head/stand/uboot/lib/copy.c ============================================================================== --- head/stand/uboot/lib/copy.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/uboot/lib/copy.c Thu Nov 29 18:37:48 2018 (r341253) @@ -133,7 +133,7 @@ uboot_loadaddr(u_int type, void *data, uint64_t addr) } } if (biggest_size == 0) - panic("Not enough DRAM to load kernel\n"); + panic("Not enough DRAM to load kernel"); #if 0 printf("Loading kernel into region 0x%08jx-0x%08jx (%ju MiB)\n", (uintmax_t)biggest_block, Modified: head/stand/uboot/lib/net.c ============================================================================== --- head/stand/uboot/lib/net.c Thu Nov 29 18:02:35 2018 (r341252) +++ head/stand/uboot/lib/net.c Thu Nov 29 18:37:48 2018 (r341253) @@ -324,7 +324,7 @@ net_init(struct iodesc *desc, void *machdep_hint) sc = nif->nif_devdata = &uboot_softc; if ((err = ub_dev_open(sc->sc_handle)) != 0) - panic("%s%d: initialisation failed with error %d\n", + panic("%s%d: initialisation failed with error %d", nif->nif_driver->netif_bname, nif->nif_unit, err); /* Get MAC address */ @@ -359,6 +359,6 @@ net_end(struct netif *nif) int err; if ((err = ub_dev_close(sc->sc_handle)) != 0) - panic("%s%d: net_end failed with error %d\n", + panic("%s%d: net_end failed with error %d", nif->nif_driver->netif_bname, nif->nif_unit, err); } From owner-svn-src-head@freebsd.org Thu Nov 29 19:06:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC28F1149C3F; Thu, 29 Nov 2018 19:06:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C4907DC3A; Thu, 29 Nov 2018 19:06:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B8181DABE; Thu, 29 Nov 2018 19:06:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATJ66nT011805; Thu, 29 Nov 2018 19:06:06 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATJ666x011804; Thu, 29 Nov 2018 19:06:06 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811291906.wATJ666x011804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 29 Nov 2018 19:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341254 - head/sys/dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/clk X-SVN-Commit-Revision: 341254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C4907DC3A X-Spamd-Result: default: False [0.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.306,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 19:06:06 -0000 Author: manu Date: Thu Nov 29 19:06:05 2018 New Revision: 341254 URL: https://svnweb.freebsd.org/changeset/base/341254 Log: extres: clk: Fix clk_set_assigned ofw_bus_parse_xref_list_get_length doesn't returns the number of elements, fix this. While here when setting the clock to the assigned freqeuncy, allow the clock driver to round down or up the frequency as sometimes the exact frequency cannot be obtain. Modified: head/sys/dev/extres/clk/clk.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Thu Nov 29 18:37:48 2018 (r341253) +++ head/sys/dev/extres/clk/clk.c Thu Nov 29 19:06:05 2018 (r341254) @@ -1297,7 +1297,7 @@ clk_set_assigned_rates(device_t dev, clk_t clk, uint32 { int rv; - rv = clk_set_freq(clk, freq, 0); + rv = clk_set_freq(clk, freq, CLK_SET_ROUND_DOWN | CLK_SET_ROUND_UP); if (rv != 0) { device_printf(dev, "Failed to set %s to a frequency of %u\n", clk_get_name(clk), freq); @@ -1330,9 +1330,9 @@ clk_set_assigned(device_t dev, phandle_t node) if (nrates <= 0) nrates = 0; - nparents = ofw_bus_parse_xref_list_get_length(node, - "assigned-clock-parents", "#clock-cells", &nparents); - + if (ofw_bus_parse_xref_list_get_length(node, + "assigned-clock-parents", "#clock-cells", &nparents) != 0) + nparents = -1; for (i = 0; i < nclocks; i++) { /* First get the clock we are supposed to modify */ rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks", From owner-svn-src-head@freebsd.org Thu Nov 29 19:10:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40EA71149F09; Thu, 29 Nov 2018 19:10:49 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D6E57E019; Thu, 29 Nov 2018 19:10:48 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 9785ff3a; Thu, 29 Nov 2018 20:10:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=vGLCJJOu03f1 muIC7ZhuT1mpXqY=; b=P9tVMHQv/0pqLF3QTdL1t//B1bkCQOoS0L6759OqIiQo o43qpDccPoxwXaCRaNllbGUzC2cTFLNcQinALyEE8SL78QQ8+urzhHbRB/79V+Kx sM9jQlG++yJ8zpfU/0jYY2m5VssbVt6UnrSysucjwTwleqAtqrAE2H8Q4YJ9JMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=Hd3qmo QW0RaU63QPEhO9IcTQdRIiKhJYpYvGSlkX/M8Gr7GyO5tKmXWw8bxdQZlXCJ1sGx nPxna/hZ5nqNlo/MQRTIdqI08naJ5SyyZD5S5Nuj+KKWnxTi74+I8QXrI49vJW1t KQ6ASdSyn6yWI/tNA9VqwCM4JuFlvuqTZzLHI= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 07fd0337 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 29 Nov 2018 20:10:47 +0100 (CET) Date: Thu, 29 Nov 2018 20:10:46 +0100 From: Emmanuel Vadot To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341254 - head/sys/dev/extres/clk Message-Id: <20181129201046.2f697637d45bf300a7e8341a@bidouilliste.com> In-Reply-To: <201811291906.wATJ666x011804@repo.freebsd.org> References: <201811291906.wATJ666x011804@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5D6E57E019 X-Spamd-Result: default: False [-0.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com]; NEURAL_HAM_MEDIUM(-0.97)[-0.966,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[bidouilliste.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.92)[-0.923,0]; NEURAL_SPAM_SHORT(0.69)[0.693,0]; DKIM_TRACE(0.00)[bidouilliste.com:+]; MX_GOOD(-0.01)[cached: mx-backup.blih.net]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.14)[ipnet: 212.83.160.0/19(0.74), asn: 12876(-0.02), country: FR(-0.02)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 19:10:49 -0000 On Thu, 29 Nov 2018 19:06:06 +0000 (UTC) Emmanuel Vadot wrote: > Author: manu > Date: Thu Nov 29 19:06:05 2018 > New Revision: 341254 > URL: https://svnweb.freebsd.org/changeset/base/341254 > > Log: > extres: clk: Fix clk_set_assigned > > ofw_bus_parse_xref_list_get_length doesn't returns the number of elements, fix this. > While here when setting the clock to the assigned freqeuncy, allow the clock > driver to round down or up the frequency as sometimes the exact frequency cannot > be obtain. MFC After: 3 days > Modified: > head/sys/dev/extres/clk/clk.c > > Modified: head/sys/dev/extres/clk/clk.c > ============================================================================== > --- head/sys/dev/extres/clk/clk.c Thu Nov 29 18:37:48 2018 (r341253) > +++ head/sys/dev/extres/clk/clk.c Thu Nov 29 19:06:05 2018 (r341254) > @@ -1297,7 +1297,7 @@ clk_set_assigned_rates(device_t dev, clk_t clk, uint32 > { > int rv; > > - rv = clk_set_freq(clk, freq, 0); > + rv = clk_set_freq(clk, freq, CLK_SET_ROUND_DOWN | CLK_SET_ROUND_UP); > if (rv != 0) { > device_printf(dev, "Failed to set %s to a frequency of %u\n", > clk_get_name(clk), freq); > @@ -1330,9 +1330,9 @@ clk_set_assigned(device_t dev, phandle_t node) > if (nrates <= 0) > nrates = 0; > > - nparents = ofw_bus_parse_xref_list_get_length(node, > - "assigned-clock-parents", "#clock-cells", &nparents); > - > + if (ofw_bus_parse_xref_list_get_length(node, > + "assigned-clock-parents", "#clock-cells", &nparents) != 0) > + nparents = -1; > for (i = 0; i < nclocks; i++) { > /* First get the clock we are supposed to modify */ > rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks", -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Nov 29 19:11:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C6E41149F71; Thu, 29 Nov 2018 19:11:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307C07E311; Thu, 29 Nov 2018 19:11:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 135781DB43; Thu, 29 Nov 2018 19:11:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATJBZ5X012875; Thu, 29 Nov 2018 19:11:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATJBZte012874; Thu, 29 Nov 2018 19:11:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811291911.wATJBZte012874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 29 Nov 2018 19:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341255 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 341255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 307C07E311 X-Spamd-Result: default: False [0.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.306,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 19:11:36 -0000 Author: manu Date: Thu Nov 29 19:11:35 2018 New Revision: 341255 URL: https://svnweb.freebsd.org/changeset/base/341255 Log: arm64: rockchip: armclk: Do not change parent freq if CLK_SET_DRYRUN is set MFC after: 3 days Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_armclk.c Thu Nov 29 19:06:05 2018 (r341254) +++ head/sys/arm64/rockchip/clk/rk_clk_armclk.c Thu Nov 29 19:11:35 2018 (r341255) @@ -163,17 +163,17 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f if (rate == sc->nrates) return (0); - err = clknode_set_freq(p_main, best_p, 0, 1); - if (err != 0) - printf("Cannot set %s to %lu\n", - clknode_get_name(p_main), - best_p); - if ((flags & CLK_SET_DRYRUN) != 0) { *fout = best; *stop = 1; return (0); } + + err = clknode_set_freq(p_main, best_p, 0, 1); + if (err != 0) + printf("Cannot set %s to %lu\n", + clknode_get_name(p_main), + best_p); DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, &val); From owner-svn-src-head@freebsd.org Thu Nov 29 19:13:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4408114A1A5; Thu, 29 Nov 2018 19:13:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E82A7E598; Thu, 29 Nov 2018 19:13:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E2B31DC7F; Thu, 29 Nov 2018 19:13:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATJDAbW016707; Thu, 29 Nov 2018 19:13:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATJDADO016706; Thu, 29 Nov 2018 19:13:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811291913.wATJDADO016706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 29 Nov 2018 19:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341256 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 341256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E82A7E598 X-Spamd-Result: default: False [0.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.31)[0.306,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 19:13:11 -0000 Author: kib Date: Thu Nov 29 19:13:10 2018 New Revision: 341256 URL: https://svnweb.freebsd.org/changeset/base/341256 Log: If BENEATH is specified, always latch the topping directory vnode. It is possible that we started with a relative path but during the lookup, found an absolute symlink. In this case, BENEATH handling code needs the latch, but it is too late to calculate it. While there, somewhat improve the assertions. Clear the NI_LCF_LATCH flag when the latch vnode is released, so that asserts know the state. Assert that there is a latch if we entered beneath+abs path mode, after the starting point is processed. Reported by: wulf With more input from: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Nov 29 19:11:35 2018 (r341255) +++ head/sys/kern/vfs_lookup.c Thu Nov 29 19:13:10 2018 (r341256) @@ -202,8 +202,10 @@ nameicap_cleanup(struct nameidata *ndp, bool clean_lat vdrop(nt->dp); uma_zfree(nt_zone, nt); } - if (clean_latch && (ndp->ni_lcf & NI_LCF_LATCH) != 0) + if (clean_latch && (ndp->ni_lcf & NI_LCF_LATCH) != 0) { + ndp->ni_lcf &= ~NI_LCF_LATCH; vrele(ndp->ni_beneath_latch); + } } /* @@ -446,7 +448,7 @@ namei(struct nameidata *ndp) if (error == 0 && dp->v_type != VDIR) error = ENOTDIR; } - if (error == 0 && (ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) { + if (error == 0 && (cnp->cn_flags & BENEATH) != 0) { if (ndp->ni_dirfd == AT_FDCWD) { ndp->ni_beneath_latch = fdp->fd_cdir; vrefact(ndp->ni_beneath_latch); @@ -471,6 +473,8 @@ namei(struct nameidata *ndp) vrele(dp); goto out; } + MPASS((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_LATCH)) != + NI_LCF_BENEATH_ABS); if (((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && lookup_cap_dotdot != 0) || ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0 && From owner-svn-src-head@freebsd.org Thu Nov 29 19:28:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ECF4114A879; Thu, 29 Nov 2018 19:28:02 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 117237F26E; Thu, 29 Nov 2018 19:28:02 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E21521DE17; Thu, 29 Nov 2018 19:28:01 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATJS1IO021890; Thu, 29 Nov 2018 19:28:01 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATJS1mP021888; Thu, 29 Nov 2018 19:28:01 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201811291928.wATJS1mP021888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Thu, 29 Nov 2018 19:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341257 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 341257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 117237F26E X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 19:28:02 -0000 Author: sobomax Date: Thu Nov 29 19:28:01 2018 New Revision: 341257 URL: https://svnweb.freebsd.org/changeset/base/341257 Log: Replace hand-crafted naive byte-by-byte zero block detection routine with macro based around memcmp(). The latter is expected to be some 8 times faster on a modern 64-bit architectures. In practice, throughput of doing conv=sparse from /dev/zero to /dev/null went up some 5-fold here from 1.9GB/sec to 9.7GB/sec with this change (bs=128k). MFC after: 2 weeks Modified: head/bin/dd/dd.c head/bin/dd/dd.h Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Thu Nov 29 19:13:10 2018 (r341256) +++ head/bin/dd/dd.c Thu Nov 29 19:28:01 2018 (r341257) @@ -511,7 +511,7 @@ void dd_out(int force) { u_char *outp; - size_t cnt, i, n; + size_t cnt, n; ssize_t nw; static int warned; int sparse; @@ -544,12 +544,8 @@ dd_out(int force) do { sparse = 0; if (ddflags & C_SPARSE) { - sparse = 1; /* Is buffer sparse? */ - for (i = 0; i < cnt; i++) - if (outp[i] != 0) { - sparse = 0; - break; - } + /* Is buffer sparse? */ + sparse = BISZERO(outp, cnt); } if (sparse && !force) { pending += cnt; Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Thu Nov 29 19:13:10 2018 (r341256) +++ head/bin/dd/dd.h Thu Nov 29 19:28:01 2018 (r341257) @@ -103,3 +103,7 @@ typedef struct { #define C_PROGRESS 0x40000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) + +#define BISZERO(p, s) ((s) > 0 && *((const char *)p) == 0 && !memcmp( \ + (const void *)(p), (const void *) \ + ((const char *)p + 1), (s) - 1)) From owner-svn-src-head@freebsd.org Thu Nov 29 21:00:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB87114CBA1; Thu, 29 Nov 2018 21:00:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF86B82A4B; Thu, 29 Nov 2018 21:00:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B06CE1ECFC; Thu, 29 Nov 2018 21:00:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATL0vor069313; Thu, 29 Nov 2018 21:00:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATL0u2O069306; Thu, 29 Nov 2018 21:00:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811292100.wATL0u2O069306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 29 Nov 2018 21:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341263 - in head/sys: compat/cloudabi32 compat/cloudabi64 compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/cloudabi32 compat/cloudabi64 compat/freebsd32 kern sys X-SVN-Commit-Revision: 341263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF86B82A4B X-Spamd-Result: default: False [1.02 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.296,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 21:00:58 -0000 Author: brooks Date: Thu Nov 29 21:00:56 2018 New Revision: 341263 URL: https://svnweb.freebsd.org/changeset/base/341263 Log: Add helper functions to copy strings into struct image_args. Given a zeroed struct image_args with an allocated buf member, exec_args_add_fname() must be called to install a file name (or NULL). Then zero or more calls to exec_args_add_env() followed by zero or more calls to exec_args_add_env(). exec_args_adjust_args() may be called after args and/or env to allow an interpreter to be prepended to the argument list. To allow code reuse when adding arg and env variables, begin_envv should be accessed with the accessor exec_args_get_begin_envv() which handles the case when no environment entries have been added. Use these functions to simplify exec_copyin_args() and freebsd32_exec_copyin_args(). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15468 Modified: head/sys/compat/cloudabi32/cloudabi32_module.c head/sys/compat/cloudabi64/cloudabi64_module.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/imgact_binmisc.c head/sys/kern/imgact_shell.c head/sys/kern/kern_exec.c head/sys/sys/imgact.h Modified: head/sys/compat/cloudabi32/cloudabi32_module.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_module.c Thu Nov 29 20:59:18 2018 (r341262) +++ head/sys/compat/cloudabi32/cloudabi32_module.c Thu Nov 29 21:00:56 2018 (r341263) @@ -54,7 +54,7 @@ cloudabi32_copyout_strings(struct image_params *imgp) /* Copy out program arguments. */ args = imgp->args; - len = args->begin_envv - args->begin_argv; + len = exec_args_get_begin_envv(args) - args->begin_argv; begin = rounddown2(imgp->sysent->sv_usrstack - len, sizeof(register_t)); copyout(args->begin_argv, (void *)begin, len); return ((register_t *)begin); @@ -109,7 +109,8 @@ cloudabi32_fixup(register_t **stack_base, struct image * exec_copyin_data_fds(). Undo this by reducing the length. */ args = (Elf32_Auxargs *)imgp->auxargs; - argdatalen = imgp->args->begin_envv - imgp->args->begin_argv; + argdatalen = exec_args_get_begin_envv(imgp->args) - + imgp->args->begin_argv; if (argdatalen > 0) --argdatalen; Modified: head/sys/compat/cloudabi64/cloudabi64_module.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_module.c Thu Nov 29 20:59:18 2018 (r341262) +++ head/sys/compat/cloudabi64/cloudabi64_module.c Thu Nov 29 21:00:56 2018 (r341263) @@ -54,7 +54,7 @@ cloudabi64_copyout_strings(struct image_params *imgp) /* Copy out program arguments. */ args = imgp->args; - len = args->begin_envv - args->begin_argv; + len = exec_args_get_begin_envv(args) - args->begin_argv; begin = rounddown2(imgp->sysent->sv_usrstack - len, sizeof(register_t)); copyout(args->begin_argv, (void *)begin, len); return ((register_t *)begin); @@ -109,7 +109,8 @@ cloudabi64_fixup(register_t **stack_base, struct image * exec_copyin_data_fds(). Undo this by reducing the length. */ args = (Elf64_Auxargs *)imgp->auxargs; - argdatalen = imgp->args->begin_envv - imgp->args->begin_argv; + argdatalen = exec_args_get_begin_envv(imgp->args) - + imgp->args->begin_argv; if (argdatalen > 0) --argdatalen; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Nov 29 20:59:18 2018 (r341262) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Nov 29 21:00:56 2018 (r341263) @@ -337,7 +337,6 @@ freebsd32_exec_copyin_args(struct image_args *args, co { char *argp, *envp; u_int32_t *p32, arg; - size_t length; int error; bzero(args, sizeof(*args)); @@ -355,20 +354,10 @@ freebsd32_exec_copyin_args(struct image_args *args, co /* * Copy the file name. */ - if (fname != NULL) { - args->fname = args->buf; - error = (segflg == UIO_SYSSPACE) ? - copystr(fname, args->fname, PATH_MAX, &length) : - copyinstr(fname, args->fname, PATH_MAX, &length); - if (error != 0) - goto err_exit; - } else - length = 0; + error = exec_args_add_fname(args, fname, segflg); + if (error != 0) + goto err_exit; - args->begin_argv = args->buf + length; - args->endp = args->begin_argv; - args->stringspace = ARG_MAX; - /* * extract arguments first */ @@ -380,19 +369,11 @@ freebsd32_exec_copyin_args(struct image_args *args, co if (arg == 0) break; argp = PTRIN(arg); - error = copyinstr(argp, args->endp, args->stringspace, &length); - if (error) { - if (error == ENAMETOOLONG) - error = E2BIG; + error = exec_args_add_arg(args, argp, UIO_USERSPACE); + if (error != 0) goto err_exit; - } - args->stringspace -= length; - args->endp += length; - args->argc++; } - args->begin_envv = args->endp; - /* * extract environment strings */ @@ -405,16 +386,9 @@ freebsd32_exec_copyin_args(struct image_args *args, co if (arg == 0) break; envp = PTRIN(arg); - error = copyinstr(envp, args->endp, args->stringspace, - &length); - if (error) { - if (error == ENAMETOOLONG) - error = E2BIG; + error = exec_args_add_env(args, envp, UIO_USERSPACE); + if (error != 0) goto err_exit; - } - args->stringspace -= length; - args->endp += length; - args->envc++; } } Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Thu Nov 29 20:59:18 2018 (r341262) +++ head/sys/kern/imgact_binmisc.c Thu Nov 29 21:00:56 2018 (r341263) @@ -649,21 +649,12 @@ imgact_binmisc_exec(struct image_params *imgp) s++; } - /* Check to make sure we won't overrun the stringspace. */ - if (offset > imgp->args->stringspace) { + /* Make room for the interpreter */ + error = exec_args_adjust_args(imgp->args, 0, offset); + if (error != 0) { sx_sunlock(&interp_list_sx); - error = E2BIG; goto done; } - - /* Make room for the interpreter */ - bcopy(imgp->args->begin_argv, imgp->args->begin_argv + offset, - imgp->args->endp - imgp->args->begin_argv); - - /* Adjust everything by the offset. */ - imgp->args->begin_envv += offset; - imgp->args->endp += offset; - imgp->args->stringspace -= offset; /* Add the new argument(s) in the count. */ imgp->args->argc += ibe->ibe_interp_argcnt; Modified: head/sys/kern/imgact_shell.c ============================================================================== --- head/sys/kern/imgact_shell.c Thu Nov 29 20:59:18 2018 (r341262) +++ head/sys/kern/imgact_shell.c Thu Nov 29 21:00:56 2018 (r341263) @@ -196,19 +196,12 @@ exec_shell_imgact(struct image_params *imgp) length = (imgp->args->argc == 0) ? 0 : strlen(imgp->args->begin_argv) + 1; /* bytes to delete */ - if (offset > imgp->args->stringspace + length) { + error = exec_args_adjust_args(imgp->args, length, offset); + if (error != 0) { if (sname != NULL) sbuf_delete(sname); - return (E2BIG); + return (error); } - - bcopy(imgp->args->begin_argv + length, imgp->args->begin_argv + offset, - imgp->args->endp - (imgp->args->begin_argv + length)); - - offset -= length; /* calculate actual adjustment */ - imgp->args->begin_envv += offset; - imgp->args->endp += offset; - imgp->args->stringspace -= offset; /* * If there was no arg[0] when we started, then the interpreter_name Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Nov 29 20:59:18 2018 (r341262) +++ head/sys/kern/kern_exec.c Thu Nov 29 21:00:56 2018 (r341263) @@ -345,9 +345,9 @@ kern_execve(struct thread *td, struct image_args *args { AUDIT_ARG_ARGV(args->begin_argv, args->argc, - args->begin_envv - args->begin_argv); - AUDIT_ARG_ENVV(args->begin_envv, args->envc, - args->endp - args->begin_envv); + exec_args_get_begin_envv(args) - args->begin_argv); + AUDIT_ARG_ENVV(exec_args_get_begin_envv(args), args->envc, + args->endp - exec_args_get_begin_envv(args)); return (do_execve(td, args, mac_p)); } @@ -717,7 +717,7 @@ interpret: /* * Malloc things before we need locks. */ - i = imgp->args->begin_envv - imgp->args->begin_argv; + i = exec_args_get_begin_envv(imgp->args) - imgp->args->begin_argv; /* Cache arguments if they fit inside our allowance */ if (ps_arg_cache_limit >= i + sizeof(struct pargs)) { newargs = pargs_alloc(i); @@ -1171,9 +1171,8 @@ int exec_copyin_args(struct image_args *args, const char *fname, enum uio_seg segflg, char **argv, char **envv) { - u_long argp, envp; + u_long arg, env; int error; - size_t length; bzero(args, sizeof(*args)); if (argv == NULL) @@ -1190,67 +1189,43 @@ exec_copyin_args(struct image_args *args, const char * /* * Copy the file name. */ - if (fname != NULL) { - args->fname = args->buf; - error = (segflg == UIO_SYSSPACE) ? - copystr(fname, args->fname, PATH_MAX, &length) : - copyinstr(fname, args->fname, PATH_MAX, &length); - if (error != 0) - goto err_exit; - } else - length = 0; + error = exec_args_add_fname(args, fname, segflg); + if (error != 0) + goto err_exit; - args->begin_argv = args->buf + length; - args->endp = args->begin_argv; - args->stringspace = ARG_MAX; - /* * extract arguments first */ for (;;) { - error = fueword(argv++, &argp); + error = fueword(argv++, &arg); if (error == -1) { error = EFAULT; goto err_exit; } - if (argp == 0) + if (arg == 0) break; - error = copyinstr((void *)(uintptr_t)argp, args->endp, - args->stringspace, &length); - if (error != 0) { - if (error == ENAMETOOLONG) - error = E2BIG; + error = exec_args_add_arg(args, (char *)(uintptr_t)arg, + UIO_USERSPACE); + if (error != 0) goto err_exit; - } - args->stringspace -= length; - args->endp += length; - args->argc++; } - args->begin_envv = args->endp; - /* * extract environment strings */ if (envv) { for (;;) { - error = fueword(envv++, &envp); + error = fueword(envv++, &env); if (error == -1) { error = EFAULT; goto err_exit; } - if (envp == 0) + if (env == 0) break; - error = copyinstr((void *)(uintptr_t)envp, - args->endp, args->stringspace, &length); - if (error != 0) { - if (error == ENAMETOOLONG) - error = E2BIG; + error = exec_args_add_env(args, + (char *)(uintptr_t)env, UIO_USERSPACE); + if (error != 0) goto err_exit; - } - args->stringspace -= length; - args->endp += length; - args->envc++; } } @@ -1305,8 +1280,6 @@ exec_copyin_data_fds(struct thread *td, struct image_a /* No argument buffer provided. */ args->endp = args->begin_argv; } - /* There are no environment variables. */ - args->begin_envv = args->endp; /* Create new file descriptor table. */ kfds = malloc(fdslen * sizeof(int), M_TEMP, M_WAITOK); @@ -1460,6 +1433,126 @@ exec_free_args(struct image_args *args) } if (args->fdp != NULL) fdescfree_remapped(args->fdp); +} + +/* + * A set to functions to fill struct image args. + * + * NOTE: exec_args_add_fname() must be called (possibly with a NULL + * fname) before the other functions. All exec_args_add_arg() calls must + * be made before any exec_args_add_env() calls. exec_args_adjust_args() + * may be called any time after exec_args_add_fname(). + * + * exec_args_add_fname() - install path to be executed + * exec_args_add_arg() - append an argument string + * exec_args_add_env() - append an env string + * exec_args_adjust_args() - adjust location of the argument list to + * allow new arguments to be prepended + */ +int +exec_args_add_fname(struct image_args *args, const char *fname, + enum uio_seg segflg) +{ + int error; + size_t length; + + KASSERT(args->fname == NULL, ("fname already appended")); + KASSERT(args->endp == NULL, ("already appending to args")); + + if (fname != NULL) { + args->fname = args->buf; + error = segflg == UIO_SYSSPACE ? + copystr(fname, args->fname, PATH_MAX, &length) : + copyinstr(fname, args->fname, PATH_MAX, &length); + if (error != 0) + return (error == ENAMETOOLONG ? E2BIG : error); + } else + length = 0; + + /* Set up for _arg_*()/_env_*() */ + args->endp = args->buf + length; + /* begin_argv must be set and kept updated */ + args->begin_argv = args->endp; + KASSERT(exec_map_entry_size - length >= ARG_MAX, + ("too little space remaining for arguments %zu < %zu", + exec_map_entry_size - length, (size_t)ARG_MAX)); + args->stringspace = ARG_MAX; + + return (0); +} + +static int +exec_args_add_str(struct image_args *args, const char *str, + enum uio_seg segflg, int *countp) +{ + int error; + size_t length; + + KASSERT(args->endp != NULL, ("endp not initialized")); + KASSERT(args->begin_argv != NULL, ("begin_argp not initialized")); + + error = (segflg == UIO_SYSSPACE) ? + copystr(str, args->endp, args->stringspace, &length) : + copyinstr(str, args->endp, args->stringspace, &length); + if (error != 0) + return (error == ENAMETOOLONG ? E2BIG : error); + args->stringspace -= length; + args->endp += length; + (*countp)++; + + return (0); +} + +int +exec_args_add_arg(struct image_args *args, const char *argp, + enum uio_seg segflg) +{ + + KASSERT(args->envc == 0, ("appending args after env")); + + return (exec_args_add_str(args, argp, segflg, &args->argc)); +} + +int +exec_args_add_env(struct image_args *args, const char *envp, + enum uio_seg segflg) +{ + + if (args->envc == 0) + args->begin_envv = args->endp; + + return (exec_args_add_str(args, envp, segflg, &args->envc)); +} + +int +exec_args_adjust_args(struct image_args *args, size_t consume, ssize_t extend) +{ + ssize_t offset; + + KASSERT(args->endp != NULL, ("endp not initialized")); + KASSERT(args->begin_argv != NULL, ("begin_argp not initialized")); + + offset = extend - consume; + if (args->stringspace < offset) + return (E2BIG); + memmove(args->begin_argv + extend, args->begin_argv + consume, + args->endp - args->begin_argv + consume); + if (args->envc > 0) + args->begin_envv += offset; + args->endp += offset; + args->stringspace -= offset; + return (0); +} + +char * +exec_args_get_begin_envv(struct image_args *args) +{ + + KASSERT(args->endp != NULL, ("endp not initialized")); + + if (args->envc > 0) + return (args->begin_envv); + return (args->endp); } /* Modified: head/sys/sys/imgact.h ============================================================================== --- head/sys/sys/imgact.h Thu Nov 29 20:59:18 2018 (r341262) +++ head/sys/sys/imgact.h Thu Nov 29 21:00:56 2018 (r341263) @@ -46,7 +46,8 @@ struct image_args { char *buf; /* pointer to string buffer */ void *bufkva; /* cookie for string buffer KVA */ char *begin_argv; /* beginning of argv in buf */ - char *begin_envv; /* beginning of envv in buf */ + char *begin_envv; /* (interal use only) beginning of envv in buf, + * access with exec_args_get_begin_envv(). */ char *endp; /* current `end' pointer of arg & env strings */ char *fname; /* pointer to filename of executable (system space) */ char *fname_buf; /* pointer to optional malloc(M_TEMP) buffer */ @@ -96,6 +97,15 @@ struct thread; struct vmspace; int exec_alloc_args(struct image_args *); +int exec_args_add_arg(struct image_args *args, const char *argp, + enum uio_seg segflg); +int exec_args_add_env(struct image_args *args, const char *envp, + enum uio_seg segflg); +int exec_args_add_fname(struct image_args *args, const char *fname, + enum uio_seg segflg); +int exec_args_adjust_args(struct image_args *args, size_t consume, + ssize_t extend); +char *exec_args_get_begin_envv(struct image_args *args); int exec_check_permissions(struct image_params *); register_t *exec_copyout_strings(struct image_params *); void exec_free_args(struct image_args *); From owner-svn-src-head@freebsd.org Thu Nov 29 21:20:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0470A114D43A; Thu, 29 Nov 2018 21:20:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B538378E; Thu, 29 Nov 2018 21:20:54 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 547C21F187; Thu, 29 Nov 2018 21:20:54 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATLKs2P078679; Thu, 29 Nov 2018 21:20:54 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATLKsY1078678; Thu, 29 Nov 2018 21:20:54 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811292120.wATLKsY1078678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 29 Nov 2018 21:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341265 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72B538378E X-Spamd-Result: default: False [0.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.332,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 21:20:55 -0000 Author: cy Date: Thu Nov 29 21:20:53 2018 New Revision: 341265 URL: https://svnweb.freebsd.org/changeset/base/341265 Log: Remove an old comment/code and replace with a comment that directly references a NetBSD commit. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Nov 29 21:10:18 2018 (r341264) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Nov 29 21:20:53 2018 (r341265) @@ -542,12 +542,7 @@ ipf_send_icmp_err(type, fin, dst) code = fin->fin_icode; #ifdef USE_INET6 -#if 0 - /* XXX Fix an off by one error: s/>/>=/ - was: - if ((code < 0) || (code > sizeof(icmptoicmp6unreach)/sizeof(int))) - Fix obtained from NetBSD ip_fil_netbsd.c r1.4: */ -#endif + /* See NetBSD ip_fil_netbsd.c r1.4: */ if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int))) return -1; #endif From owner-svn-src-head@freebsd.org Thu Nov 29 22:35:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27457114F3FF; Thu, 29 Nov 2018 22:35:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0CF386357; Thu, 29 Nov 2018 22:35:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83E141FD8A; Thu, 29 Nov 2018 22:35:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATMZOcY020516; Thu, 29 Nov 2018 22:35:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATMZOrJ020514; Thu, 29 Nov 2018 22:35:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811292235.wATMZOrJ020514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 29 Nov 2018 22:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341268 - in head/sys: dts/arm64/overlays modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: dts/arm64/overlays modules/dtb/allwinner X-SVN-Commit-Revision: 341268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0CF386357 X-Spamd-Result: default: False [0.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.04)[0.041,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 22:35:25 -0000 Author: manu Date: Thu Nov 29 22:35:23 2018 New Revision: 341268 URL: https://svnweb.freebsd.org/changeset/base/341268 Log: arm64: allwinner: Add a dtbo to have cpu operating points This enables cpufreq on A64 boards. MFC after: 1 month Added: head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso (contents, props changed) Modified: head/sys/modules/dtb/allwinner/Makefile Added: head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Thu Nov 29 22:35:23 2018 (r341268) @@ -0,0 +1,72 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&{/} { + cpu0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-648000000 { + opp-hz = /bits/ 64 <648000000>; + opp-microvolt = <1040000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1100000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-912000000 { + opp-hz = /bits/ 64 <912000000>; + opp-microvolt = <1120000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-960000000 { + opp-hz = /bits/ 64 <960000000>; + opp-microvolt = <1160000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1200000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1056000000 { + opp-hz = /bits/ 64 <1056000000>; + opp-microvolt = <1240000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1104000000 { + opp-hz = /bits/ 64 <1104000000>; + opp-microvolt = <1260000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + opp-1152000000 { + opp-hz = /bits/ 64 <1152000000>; + opp-microvolt = <1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + }; +}; + +&{/cpus/cpu@0} { + operating-points-v2 = <&cpu0_opp_table>; + clocks = <&ccu 1>; + cpu-supply = <®_dcdc2>; +}; + +&{/cpus/cpu@1} { + operating-points-v2 = <&cpu0_opp_table>; +}; + +&{/cpus/cpu@2} { + operating-points-v2 = <&cpu0_opp_table>; +}; + +&{/cpus/cpu@3} { + operating-points-v2 = <&cpu0_opp_table>; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Thu Nov 29 22:00:20 2018 (r341267) +++ head/sys/modules/dtb/allwinner/Makefile Thu Nov 29 22:35:23 2018 (r341268) @@ -44,7 +44,8 @@ DTS= \ allwinner/sun50i-a64-sopine-baseboard.dts \ allwinner/sun50i-h5-orangepi-pc2.dts -DTSO= sun50i-a64-sid.dtso \ +DTSO= sun50i-a64-opp.dtso \ + sun50i-a64-sid.dtso \ sun50i-a64-ths.dtso \ sun50i-a64-timer.dtso From owner-svn-src-head@freebsd.org Thu Nov 29 22:36:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19F20114F4AD; Thu, 29 Nov 2018 22:36:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B683F864DB; Thu, 29 Nov 2018 22:36:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 960211FD8C; Thu, 29 Nov 2018 22:36:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATMab69020605; Thu, 29 Nov 2018 22:36:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATMaaer020603; Thu, 29 Nov 2018 22:36:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811292236.wATMaaer020603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 29 Nov 2018 22:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341269 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 341269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B683F864DB X-Spamd-Result: default: False [0.60 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.039,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 22:36:38 -0000 Author: manu Date: Thu Nov 29 22:36:36 2018 New Revision: 341269 URL: https://svnweb.freebsd.org/changeset/base/341269 Log: release: arm64: Add opp dtbo to PINE* boards MFC after: 1 month Modified: head/release/arm64/PINE64-LTS.conf head/release/arm64/PINE64.conf head/release/arm64/PINEBOOK.conf Modified: head/release/arm64/PINE64-LTS.conf ============================================================================== --- head/release/arm64/PINE64-LTS.conf Thu Nov 29 22:35:23 2018 (r341268) +++ head/release/arm64/PINE64-LTS.conf Thu Nov 29 22:36:36 2018 (r341269) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64-LTS" arm_install_uboot() { Modified: head/release/arm64/PINE64.conf ============================================================================== --- head/release/arm64/PINE64.conf Thu Nov 29 22:35:23 2018 (r341268) +++ head/release/arm64/PINE64.conf Thu Nov 29 22:36:36 2018 (r341269) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64" arm_install_uboot() { Modified: head/release/arm64/PINEBOOK.conf ============================================================================== --- head/release/arm64/PINEBOOK.conf Thu Nov 29 22:35:23 2018 (r341268) +++ head/release/arm64/PINEBOOK.conf Thu Nov 29 22:36:36 2018 (r341269) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINEBOOK" arm_install_uboot() { From owner-svn-src-head@freebsd.org Thu Nov 29 23:14:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13D2911500C5; Thu, 29 Nov 2018 23:14:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFB698809C; Thu, 29 Nov 2018 23:14:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7491020436; Thu, 29 Nov 2018 23:14:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wATNEtbm040882; Thu, 29 Nov 2018 23:14:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wATNEsM3040880; Thu, 29 Nov 2018 23:14:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811292314.wATNEsM3040880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Nov 2018 23:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341270 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 341270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFB698809C X-Spamd-Result: default: False [0.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_SHORT(0.04)[0.041,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:14:56 -0000 Author: jhb Date: Thu Nov 29 23:14:54 2018 New Revision: 341270 URL: https://svnweb.freebsd.org/changeset/base/341270 Log: Make most of the CLIP code conditional on #ifdef INET6. This fixes builds of kernels without INET6 such as LINT-NOINET6. Reported by: arybchik Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18384 Modified: head/sys/dev/cxgbe/t4_clip.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_clip.c ============================================================================== --- head/sys/dev/cxgbe/t4_clip.c Thu Nov 29 22:36:36 2018 (r341269) +++ head/sys/dev/cxgbe/t4_clip.c Thu Nov 29 23:14:54 2018 (r341270) @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include @@ -47,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "t4_clip.h" +#if defined(INET6) static int add_lip(struct adapter *, struct in6_addr *); static int delete_lip(struct adapter *, struct in6_addr *); static struct clip_entry *search_lip(struct adapter *, struct in6_addr *); @@ -108,11 +112,13 @@ search_lip(struct adapter *sc, struct in6_addr *lip) return (NULL); } +#endif struct clip_entry * t4_hold_lip(struct adapter *sc, struct in6_addr *lip, struct clip_entry *ce) { +#ifdef INET6 mtx_lock(&sc->clip_table_lock); if (ce == NULL) ce = search_lip(sc, lip); @@ -121,12 +127,16 @@ t4_hold_lip(struct adapter *sc, struct in6_addr *lip, mtx_unlock(&sc->clip_table_lock); return (ce); +#else + return (NULL); +#endif } void t4_release_lip(struct adapter *sc, struct clip_entry *ce) { +#ifdef INET6 mtx_lock(&sc->clip_table_lock); KASSERT(search_lip(sc, &ce->lip) == ce, ("%s: CLIP entry %p p not in CLIP table.", __func__, ce)); @@ -134,8 +144,10 @@ t4_release_lip(struct adapter *sc, struct clip_entry * ("%s: CLIP entry %p has refcount 0", __func__, ce)); --ce->refcount; mtx_unlock(&sc->clip_table_lock); +#endif } +#ifdef INET6 void t4_init_clip_table(struct adapter *sc) { @@ -380,3 +392,4 @@ t4_clip_modunload(void) EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); } +#endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Nov 29 22:36:36 2018 (r341269) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 29 23:14:54 2018 (r341270) @@ -1222,7 +1222,9 @@ t4_attach(device_t dev) #ifdef RATELIMIT t4_init_etid_table(sc); #endif +#ifdef INET6 t4_init_clip_table(sc); +#endif if (sc->vres.key.size != 0) sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start, sc->vres.key.size, 32, 0, M_FIRSTFIT | M_WAITOK); @@ -1513,7 +1515,9 @@ t4_detach_common(device_t dev) #endif if (sc->key_map) vmem_destroy(sc->key_map); +#ifdef INET6 t4_destroy_clip_table(sc); +#endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) free(sc->sge.ofld_txq, M_CXGBE); @@ -5967,9 +5971,11 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_smt, "A", "hardware source MAC table"); +#ifdef INET6 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "clip", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_clip, "A", "active CLIP table entries"); +#endif SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "lb_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, @@ -10527,7 +10533,9 @@ mod_event(module_t mod, int cmd, void *arg) sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); SLIST_INIT(&t4_uld_list); #endif +#ifdef INET6 t4_clip_modload(); +#endif t4_tracer_modload(); tweak_tunables(); } @@ -10567,7 +10575,9 @@ mod_event(module_t mod, int cmd, void *arg) if (t4_sge_extfree_refs() == 0) { t4_tracer_modunload(); +#ifdef INET6 t4_clip_modunload(); +#endif #ifdef TCP_OFFLOAD sx_destroy(&t4_uld_list_lock); #endif From owner-svn-src-head@freebsd.org Fri Nov 30 00:45:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 594461152245; Fri, 30 Nov 2018 00:45:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F280A8A957; Fri, 30 Nov 2018 00:45:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D379421313; Fri, 30 Nov 2018 00:45:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU0jA0H087057; Fri, 30 Nov 2018 00:45:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU0jA5t087056; Fri, 30 Nov 2018 00:45:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811300045.wAU0jA5t087056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Nov 2018 00:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341272 - in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 341272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F280A8A957 X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.22)[0.217,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 00:45:11 -0000 Author: mjg Date: Fri Nov 30 00:45:10 2018 New Revision: 341272 URL: https://svnweb.freebsd.org/changeset/base/341272 Log: amd64: tidy up copying backwards in memmove For non-ERMS case the code used handle possible trailing bytes with movsb first and then followed it up with movsq. This also happened to alter how calculations were done for other cases. Handle the tail with regular movs, just like when copying forward. Use leaq to calculate the right offset from the get go, instead of doing separate add and sub. This adjusts the offset for non-rep cases so that they can be used to handle the tail. The routine is still a work in progress. Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/amd64/string/memmove.S head/sys/amd64/amd64/support.S Modified: head/lib/libc/amd64/string/memmove.S ============================================================================== --- head/lib/libc/amd64/string/memmove.S Fri Nov 30 00:00:51 2018 (r341271) +++ head/lib/libc/amd64/string/memmove.S Fri Nov 30 00:45:10 2018 (r341272) @@ -150,24 +150,24 @@ __FBSDID("$FreeBSD$"); */ ALIGN_TEXT 2: - addq %rcx,%rdi - addq %rcx,%rsi + cmpq $256,%rcx + ja 2256f + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi + cmpq $32,%rcx jb 2016f - cmpq $256,%rcx - ja 2256f - 2032: + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) movq -16(%rsi),%rdx movq %rdx,-16(%rdi) movq -24(%rsi),%rdx movq %rdx,-24(%rdi) - movq -32(%rsi),%rdx - movq %rdx,-32(%rdi) leaq -32(%rsi),%rsi leaq -32(%rdi),%rdi subq $32,%rcx @@ -181,10 +181,10 @@ __FBSDID("$FreeBSD$"); 2016: cmpb $16,%cl jl 2008f + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) - movq -16(%rsi),%rdx - movq %rdx,-16(%rdi) subb $16,%cl jz 2000f leaq -16(%rsi),%rsi @@ -192,8 +192,8 @@ __FBSDID("$FreeBSD$"); 2008: cmpb $8,%cl jl 2004f - movq -8(%rsi),%rdx - movq %rdx,-8(%rdi) + movq (%rsi),%rdx + movq %rdx,(%rdi) subb $8,%cl jz 2000f leaq -8(%rsi),%rsi @@ -201,8 +201,8 @@ __FBSDID("$FreeBSD$"); 2004: cmpb $4,%cl jl 2002f - movl -4(%rsi),%edx - movl %edx,-4(%rdi) + movl 4(%rsi),%edx + movl %edx,4(%rdi) subb $4,%cl jz 2000f leaq -4(%rsi),%rsi @@ -210,8 +210,8 @@ __FBSDID("$FreeBSD$"); 2002: cmpb $2,%cl jl 2001f - movw -2(%rsi),%dx - movw %dx,-2(%rdi) + movw 6(%rsi),%dx + movw %dx,6(%rdi) subb $2,%cl jz 2000f leaq -2(%rsi),%rsi @@ -219,33 +219,31 @@ __FBSDID("$FreeBSD$"); 2001: cmpb $1,%cl jl 2000f - movb -1(%rsi),%dl - movb %dl,-1(%rdi) + movb 7(%rsi),%dl + movb %dl,7(%rdi) 2000: \end ret ALIGN_TEXT 2256: - decq %rdi - decq %rsi std .if \erms == 1 + leaq -1(%rdi,%rcx),%rdi + leaq -1(%rsi,%rcx),%rsi rep movsb + cld .else - andq $7,%rcx /* any fractional bytes? */ - je 3f - rep - movsb -3: - movq %rdx,%rcx /* copy remainder by 32-bit words */ + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi shrq $3,%rcx - subq $7,%rsi - subq $7,%rdi rep movsq -.endif cld + movq %rdx,%rcx + andb $7,%cl + jne 2004b +.endif \end ret .endif Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Fri Nov 30 00:00:51 2018 (r341271) +++ head/sys/amd64/amd64/support.S Fri Nov 30 00:45:10 2018 (r341272) @@ -313,24 +313,24 @@ END(memcmp) */ ALIGN_TEXT 2: - addq %rcx,%rdi - addq %rcx,%rsi + cmpq $256,%rcx + ja 2256f + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi + cmpq $32,%rcx jb 2016f - cmpq $256,%rcx - ja 2256f - 2032: + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) movq -16(%rsi),%rdx movq %rdx,-16(%rdi) movq -24(%rsi),%rdx movq %rdx,-24(%rdi) - movq -32(%rsi),%rdx - movq %rdx,-32(%rdi) leaq -32(%rsi),%rsi leaq -32(%rdi),%rdi subq $32,%rcx @@ -344,10 +344,10 @@ END(memcmp) 2016: cmpb $16,%cl jl 2008f + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) - movq -16(%rsi),%rdx - movq %rdx,-16(%rdi) subb $16,%cl jz 2000f leaq -16(%rsi),%rsi @@ -355,8 +355,8 @@ END(memcmp) 2008: cmpb $8,%cl jl 2004f - movq -8(%rsi),%rdx - movq %rdx,-8(%rdi) + movq (%rsi),%rdx + movq %rdx,(%rdi) subb $8,%cl jz 2000f leaq -8(%rsi),%rsi @@ -364,8 +364,8 @@ END(memcmp) 2004: cmpb $4,%cl jl 2002f - movl -4(%rsi),%edx - movl %edx,-4(%rdi) + movl 4(%rsi),%edx + movl %edx,4(%rdi) subb $4,%cl jz 2000f leaq -4(%rsi),%rsi @@ -373,8 +373,8 @@ END(memcmp) 2002: cmpb $2,%cl jl 2001f - movw -2(%rsi),%dx - movw %dx,-2(%rdi) + movw 6(%rsi),%dx + movw %dx,6(%rdi) subb $2,%cl jz 2000f leaq -2(%rsi),%rsi @@ -382,33 +382,31 @@ END(memcmp) 2001: cmpb $1,%cl jl 2000f - movb -1(%rsi),%dl - movb %dl,-1(%rdi) + movb 7(%rsi),%dl + movb %dl,7(%rdi) 2000: \end ret ALIGN_TEXT 2256: - decq %rdi - decq %rsi std .if \erms == 1 + leaq -1(%rdi,%rcx),%rdi + leaq -1(%rsi,%rcx),%rsi rep movsb + cld .else - andq $7,%rcx /* any fractional bytes? */ - je 3f - rep - movsb -3: - movq %rdx,%rcx /* copy remainder by 32-bit words */ + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi shrq $3,%rcx - subq $7,%rsi - subq $7,%rdi rep movsq -.endif cld + movq %rdx,%rcx + andb $7,%cl + jne 2004b +.endif \end ret .endif From owner-svn-src-head@freebsd.org Fri Nov 30 00:47:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8AA11523C0; Fri, 30 Nov 2018 00:47:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A362E8AB1D; Fri, 30 Nov 2018 00:47:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8479C2131C; Fri, 30 Nov 2018 00:47:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU0lbtf087200; Fri, 30 Nov 2018 00:47:37 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU0lbhD087197; Fri, 30 Nov 2018 00:47:37 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811300047.wAU0lbhD087197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Nov 2018 00:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341273 - in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 341273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A362E8AB1D X-Spamd-Result: default: False [0.78 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.221,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 00:47:38 -0000 Author: mjg Date: Fri Nov 30 00:47:36 2018 New Revision: 341273 URL: https://svnweb.freebsd.org/changeset/base/341273 Log: amd64: remove stale attribution for memmove work While the routine started as expanded bcopy, it is now entirely rewritten. Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/amd64/string/memmove.S head/sys/amd64/amd64/support.S Modified: head/lib/libc/amd64/string/memmove.S ============================================================================== --- head/lib/libc/amd64/string/memmove.S Fri Nov 30 00:45:10 2018 (r341272) +++ head/lib/libc/amd64/string/memmove.S Fri Nov 30 00:47:36 2018 (r341273) @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); /* * memmove(dst, src, cnt) * rdi, rsi, rdx - * Contains parts of bcopy written by: - * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ /* Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Fri Nov 30 00:45:10 2018 (r341272) +++ head/sys/amd64/amd64/support.S Fri Nov 30 00:47:36 2018 (r341273) @@ -197,8 +197,6 @@ END(memcmp) /* * memmove(dst, src, cnt) * rdi, rsi, rdx - * Adapted from bcopy written by: - * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ /* From owner-svn-src-head@freebsd.org Fri Nov 30 01:01:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BE51152C26; Fri, 30 Nov 2018 01:01:37 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14ADA8B574; Fri, 30 Nov 2018 01:01:37 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D314B10655; Fri, 30 Nov 2018 01:01:36 +0000 (UTC) Date: Fri, 30 Nov 2018 01:01:36 +0000 From: Alexey Dokuchaev To: Maxim Sobolev Cc: eugen@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn: head/usr.bin: . trim Message-ID: <20181130010136.GA58183@FreeBSD.org> References: <201811291421.wATELQbx059318@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 14ADA8B574 X-Spamd-Result: default: False [1.38 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.69)[0.689,0]; NEURAL_SPAM_MEDIUM(0.57)[0.567,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_SPAM_SHORT(0.12)[0.121,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 01:01:37 -0000 On Thu, Nov 29, 2018 at 10:36:02AM -0800, Maxim Sobolev wrote: > Interesting. I have a similar functionality implemented as an option for > the dd utility in my pipeline (conv=erase). Which probably makes a better place rather than adding 4-letter program, commonly named ("trim" is a simple word), into global namespace. :-/ ./danfe From owner-svn-src-head@freebsd.org Fri Nov 30 01:17:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29BF41153264; Fri, 30 Nov 2018 01:17:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 18FE48BD6E; Fri, 30 Nov 2018 01:17:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id SXQggUPbXjQc4SXQigvKol; Thu, 29 Nov 2018 18:17:17 -0700 X-Authority-Analysis: v=2.3 cv=bOrH382Z c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=JHtHm7312UAA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=I21NcKeRvEbt6w69HQIA:9 a=d8mgZ6dutBKbNO5t:21 a=Ubcuinu_7DKAosZR:21 a=CjuIK1q_8ugA:10 a=kLJpBxloqi5Y8mSFuKkA:9 a=7bwgoUhTf3Bgj05M:21 a=li0Bwg3SBWcDNX6j:21 a=ATwXOqeJCQ7okddq:21 a=_W_S_7VecoQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from [25.168.136.212] (unknown [24.114.43.138]) by spqr.komquats.com (Postfix) with ESMTPSA id 42B641D27; Thu, 29 Nov 2018 17:17:13 -0800 (PST) MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn: head/usr.bin: . trim Date: Thu, 29 Nov 2018 17:17:17 -0800 To: Alexey Dokuchaev , Maxim Sobolev CC: "eugen@freebsd.org" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Message-Id: <20181130011713.42B641D27@spqr.komquats.com> X-CMAE-Envelope: MS4wfEEpaaJPGvYhLqSEROQi19fX6zLO50Cpn8IkG6GuOlRciyXwcXsuzLnMdKnCiPi6IJjy26ldOpVd9j3K7TTOOvqJnbVq/+nT/rUYicqkXVuvYcvW9pmt du/BUkGH84UMsabhciBsDaI3499rkXrlF6kH7JMNHmaCP7qaphcT2e9aljFAexa0aojc0mbQtooEnJSjO0hVCC3PQ8qQghqPTmozZuFrrS6X7yUp/GBs9k6K 67ZizWkPzFl21/+HgunEUGYXXaDCcCjdv6V0cwIIBUeQaMaBtqXb9JAR6u20jFsfUKGImJT+VlDqUEGUrN931+Ea6nYtB6XsmNFGNODj9cQFsCnXW6pIYNRW RGCdSGxg X-Rspamd-Queue-Id: 18FE48BD6E X-Spamd-Result: default: False [-3.09 / 15.00]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.86)[-0.856,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[9.134.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-1.02)[ipnet: 64.59.128.0/20(-2.80), asn: 6327(-2.24), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 01:17:26 -0000 Agreed. --- Sent using a tiny phone keyboard. Apologies for any typos and autocorrect. Also, this old phone only supports top post. Apologies. Cy Schubert or The need of the many outweighs the greed of the few. --- -----Original Message----- From: Alexey Dokuchaev Sent: 29/11/2018 17:01 To: Maxim Sobolev Cc: eugen@freebsd.org; svn-src-head@freebsd.org; svn-src-all@freebsd.org; s= rc-committers Subject: Re: svn: head/usr.bin: . trim On Thu, Nov 29, 2018 at 10:36:02AM -0800, Maxim Sobolev wrote: > Interesting. I have a similar functionality implemented as an option for > the dd utility in my pipeline (conv=3Derase). Which probably makes a better place rather than adding 4-letter program, commonly named ("trim" is a simple word), into global namespace. :-/ ./danfe From owner-svn-src-head@freebsd.org Fri Nov 30 02:14:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AB7E1154A87; Fri, 30 Nov 2018 02:14:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1EA8E01C; Fri, 30 Nov 2018 02:14:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBA2E221CA; Fri, 30 Nov 2018 02:14:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU2EfZt033295; Fri, 30 Nov 2018 02:14:41 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU2Ef4C033294; Fri, 30 Nov 2018 02:14:41 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201811300214.wAU2Ef4C033294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 30 Nov 2018 02:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341276 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 341276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D1EA8E01C X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.55)[0.546,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 02:14:42 -0000 Author: sobomax Date: Fri Nov 30 02:14:41 2018 New Revision: 341276 URL: https://svnweb.freebsd.org/changeset/base/341276 Log: When handling CMD_CRIT error set command_errmsg to NULL after we dump it out, so that it does not result in error message printed twice. OK load doodoo can't find 'doodoo' can't find 'doodoo' OK MFC after: 2 weeks Modified: head/stand/common/interp_forth.c Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Fri Nov 30 02:06:30 2018 (r341275) +++ head/stand/common/interp_forth.c Fri Nov 30 02:14:41 2018 (r341276) @@ -142,6 +142,7 @@ bf_command(FICL_VM *vm) switch (result) { case CMD_CRIT: printf("%s\n", command_errmsg); + command_errmsg = NULL; break; case CMD_FATAL: panic("%s", command_errmsg); From owner-svn-src-head@freebsd.org Fri Nov 30 02:16:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22CD61154B9B for ; Fri, 30 Nov 2018 02:16:41 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D8518E1C5 for ; Fri, 30 Nov 2018 02:16:40 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ot1-f46.google.com with SMTP id s5so3778034oth.7 for ; Thu, 29 Nov 2018 18:16:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SyPuh764IV1TTOUALS8UwD7kRRbTl8zRJFL1vuuVU0w=; b=oZjemGwTc41j6Pi3iDO41bymONcSTueGUiU1LF9W5atQ69+tukF54QEjWjAPQkUjph X9NyJvMQ+Dms1ZxWVlt/6U9a53IRf8i4VlokrH5aP16dDsIltrYs2rSPV4EsBPnGRsMm qpE73UGOeXtIaV7leAYdKKcd8yfsCetwZxnBjrMOiYUArJFKyzoDvngMZGOssDITY/Ei TGBB0UJo66i7Yx8Ph8QCpqXA0kwBThfP/Nn60ZujsIRy5/mTIY8BSSlZk9q326tdRGkT UOPhHuYur/VF+dbRy/1t4qa1wxbRyrPg6DiNJVjTeV18xShLvsV+xrUNvHOCisW0LtkX 7jnQ== X-Gm-Message-State: AA+aEWaHLdS509+EuKnDYrecV0r3JViS4gUKAvwpyUc9dO4kojVzlNBe bXCeNbHcwkL5SNruZ3K/D9oMk62HSNpjugHX3eMl8g== X-Google-Smtp-Source: AFSGD/XhMGqe7Q/JCcEdHzJFTOLKUyh7ENs8ecR21CDH4jck4GtyL2t3VyW4590lrzdqU/wXYaIcFKXNLWcr/M8Hh9M= X-Received: by 2002:a9d:6a4:: with SMTP id 33mr2386782otx.347.1543544194209; Thu, 29 Nov 2018 18:16:34 -0800 (PST) MIME-Version: 1.0 References: <201811291421.wATELQbx059318@repo.freebsd.org> <20181130010136.GA58183@FreeBSD.org> In-Reply-To: <20181130010136.GA58183@FreeBSD.org> From: Maxim Sobolev Date: Thu, 29 Nov 2018 18:16:22 -0800 Message-ID: Subject: Re: svn: head/usr.bin: . trim To: Alexey Dokuchaev Cc: eugen@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-Rspamd-Queue-Id: 7D8518E1C5 X-Spamd-Result: default: False [-3.92 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[46.210.85.209.rep.mailspike.net : 127.0.0.18]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; RCVD_IN_DNSWL_NONE(0.00)[46.210.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.97)[ipnet: 209.85.128.0/17(-3.42), asn: 15169(-1.34), country: US(-0.09)]; FORGED_SENDER(0.30)[sobomax@freebsd.org,sobomax@sippysoft.com]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[sobomax@freebsd.org,sobomax@sippysoft.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 02:16:41 -0000 For those interested, dd(1) patch is here: https://reviews.freebsd.org/D18382 Feedback is much appreciated. Thanks! -Max On Thu, Nov 29, 2018 at 5:01 PM Alexey Dokuchaev wrote: > On Thu, Nov 29, 2018 at 10:36:02AM -0800, Maxim Sobolev wrote: > > Interesting. I have a similar functionality implemented as an option for > > the dd utility in my pipeline (conv=erase). > > Which probably makes a better place rather than adding 4-letter program, > commonly named ("trim" is a simple word), into global namespace. :-/ > > ./danfe > > From owner-svn-src-head@freebsd.org Fri Nov 30 03:02:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75A5011557EA; Fri, 30 Nov 2018 03:02:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFAC58F52D; Fri, 30 Nov 2018 03:01:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B218822A1A; Fri, 30 Nov 2018 03:01:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU31XM3056550; Fri, 30 Nov 2018 03:01:33 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU31X5o056547; Fri, 30 Nov 2018 03:01:33 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811300301.wAU31X5o056547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 30 Nov 2018 03:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341277 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 341277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFAC58F52D X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.55)[0.546,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 03:02:23 -0000 Author: vangyzen Date: Fri Nov 30 03:01:32 2018 New Revision: 341277 URL: https://svnweb.freebsd.org/changeset/base/341277 Log: _thr_setthreaded() cannot fail; change return type to void Also remove logic to avoid unnecessary stores to the global variable. Thread creation and destruction are heavy enough that any supposed savings is in the noise. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libthr/thread/thr_create.c head/lib/libthr/thread/thr_kern.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_create.c ============================================================================== --- head/lib/libthr/thread/thr_create.c Fri Nov 30 02:14:41 2018 (r341276) +++ head/lib/libthr/thread/thr_create.c Fri Nov 30 03:01:32 2018 (r341277) @@ -73,8 +73,7 @@ _pthread_create(pthread_t * __restrict thread, */ if (_thr_isthreaded() == 0) { _malloc_first_thread(); - if (_thr_setthreaded(1)) - return (EAGAIN); + _thr_setthreaded(1); } curthread = _get_curthread(); Modified: head/lib/libthr/thread/thr_kern.c ============================================================================== --- head/lib/libthr/thread/thr_kern.c Fri Nov 30 02:14:41 2018 (r341276) +++ head/lib/libthr/thread/thr_kern.c Fri Nov 30 03:01:32 2018 (r341277) @@ -53,14 +53,10 @@ static struct wake_addr default_wake_addr; * This is called when the first thread (other than the initial * thread) is created. */ -int +void _thr_setthreaded(int threaded) { - if (((threaded == 0) ^ (__isthreaded == 0)) == 0) - return (0); - __isthreaded = threaded; - return (0); } void Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Fri Nov 30 02:14:41 2018 (r341276) +++ head/lib/libthr/thread/thr_private.h Fri Nov 30 03:01:32 2018 (r341277) @@ -776,7 +776,7 @@ extern struct pthread *_single_thread __hidden; * Function prototype definitions. */ __BEGIN_DECLS -int _thr_setthreaded(int) __hidden; +void _thr_setthreaded(int) __hidden; int _mutex_cv_lock(struct pthread_mutex *, int, bool) __hidden; int _mutex_cv_unlock(struct pthread_mutex *, int *, int *) __hidden; int _mutex_cv_attach(struct pthread_mutex *, int) __hidden; From owner-svn-src-head@freebsd.org Fri Nov 30 03:03:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69A0D1155B60; Fri, 30 Nov 2018 03:03:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34C0D8F840; Fri, 30 Nov 2018 03:02:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1339E22A82; Fri, 30 Nov 2018 03:02:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU32nmS059987; Fri, 30 Nov 2018 03:02:49 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU32n7s059985; Fri, 30 Nov 2018 03:02:49 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811300302.wAU32n7s059985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 30 Nov 2018 03:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341278 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 341278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 34C0D8F840 X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.55)[0.546,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 03:03:22 -0000 Author: vangyzen Date: Fri Nov 30 03:02:49 2018 New Revision: 341278 URL: https://svnweb.freebsd.org/changeset/base/341278 Log: Use _thr_isthreaded() and _thr_setthreaded() wrappers ...instead of directly using the global variable. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_spinlock.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Fri Nov 30 03:01:32 2018 (r341277) +++ head/lib/libthr/thread/thr_fork.c Fri Nov 30 03:02:49 2018 (r341278) @@ -219,9 +219,9 @@ __thr_fork(void) _thr_rwl_rdlock(&_thr_atfork_lock); if (was_threaded) { - __isthreaded = 1; + _thr_setthreaded(1); _malloc_postfork(); - __isthreaded = 0; + _thr_setthreaded(0); } /* Ready to continue, unblock signals. */ Modified: head/lib/libthr/thread/thr_spinlock.c ============================================================================== --- head/lib/libthr/thread/thr_spinlock.c Fri Nov 30 03:01:32 2018 (r341277) +++ head/lib/libthr/thread/thr_spinlock.c Fri Nov 30 03:02:49 2018 (r341278) @@ -58,7 +58,7 @@ static int initialized; static void init_spinlock(spinlock_t *lck); /* - * These are for compatability only. Spinlocks of this type + * These are for compatibility only. Spinlocks of this type * are deprecated. */ @@ -76,7 +76,7 @@ __thr_spinlock(spinlock_t *lck) { struct spinlock_extra *_extra; - if (!__isthreaded) + if (!_thr_isthreaded()) PANIC("Spinlock called when not threaded."); if (!initialized) PANIC("Spinlocks not initialized."); From owner-svn-src-head@freebsd.org Fri Nov 30 04:15:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 157601157446; Fri, 30 Nov 2018 04:15:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADFB96B77E; Fri, 30 Nov 2018 04:15:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83F80235F6; Fri, 30 Nov 2018 04:15:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU4FgnF095478; Fri, 30 Nov 2018 04:15:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU4Fglc095477; Fri, 30 Nov 2018 04:15:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811300415.wAU4Fglc095477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 30 Nov 2018 04:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341279 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADFB96B77E X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.29)[0.294,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 04:15:43 -0000 Author: cy Date: Fri Nov 30 04:15:42 2018 New Revision: 341279 URL: https://svnweb.freebsd.org/changeset/base/341279 Log: Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ is defined in net/if.h, therefore the condition is never met and confusing to those who follow. MFC after: 1 month Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Fri Nov 30 03:02:49 2018 (r341278) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Fri Nov 30 04:15:42 2018 (r341279) @@ -1411,10 +1411,6 @@ typedef struct tcpiphdr tcpiphdr_t; #undef ICMP_MAXTYPE #define ICMP_MAXTYPE 18 -#ifndef IFNAMSIZ -#define IFNAMSIZ 16 -#endif - #ifndef LOG_FTP # define LOG_FTP (11<<3) #endif From owner-svn-src-head@freebsd.org Fri Nov 30 04:15:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D4A2115746F; Fri, 30 Nov 2018 04:15:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC4736B891; Fri, 30 Nov 2018 04:15:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 927B1235F8; Fri, 30 Nov 2018 04:15:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU4FuO8095532; Fri, 30 Nov 2018 04:15:56 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU4Fu25095531; Fri, 30 Nov 2018 04:15:56 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811300415.wAU4Fu25095531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 30 Nov 2018 04:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341280 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC4736B891 X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.29)[0.294,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 04:15:57 -0000 Author: cy Date: Fri Nov 30 04:15:56 2018 New Revision: 341280 URL: https://svnweb.freebsd.org/changeset/base/341280 Log: Clean up a rather useless conditional structure member definition. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Fri Nov 30 04:15:42 2018 (r341279) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Fri Nov 30 04:15:56 2018 (r341280) @@ -1026,11 +1026,7 @@ typedef struct iplog { #define IPLOG_SIZE sizeof(iplog_t) typedef struct ipflog { -#if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \ - (defined(OpenBSD) && (OpenBSD >= 199603)) -#else - u_int fl_unit; -#endif + u_int fl_unit; u_32_t fl_rule; u_32_t fl_flags; u_32_t fl_lflags; From owner-svn-src-head@freebsd.org Fri Nov 30 04:18:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328DF11575E6; Fri, 30 Nov 2018 04:18:32 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C904E6BA7F; Fri, 30 Nov 2018 04:18:31 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5C41235FC; Fri, 30 Nov 2018 04:18:31 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU4IVPx095670; Fri, 30 Nov 2018 04:18:31 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU4IV61095669; Fri, 30 Nov 2018 04:18:31 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811300418.wAU4IV61095669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 30 Nov 2018 04:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341281 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 341281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C904E6BA7F X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.29)[0.294,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 04:18:32 -0000 Author: vangyzen Date: Fri Nov 30 04:18:31 2018 New Revision: 341281 URL: https://svnweb.freebsd.org/changeset/base/341281 Log: Add assertions and comment to vm_object_vnode() Reviewed by: kib MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D2724 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Nov 30 04:15:56 2018 (r341280) +++ head/sys/vm/vm_object.c Fri Nov 30 04:18:31 2018 (r341281) @@ -2306,16 +2306,28 @@ next_page: } } +/* + * Return the vnode for the given object, or NULL if none exists. + * For tmpfs objects, the function may return NULL if there is + * no vnode allocated at the time of the call. + */ struct vnode * vm_object_vnode(vm_object_t object) { + struct vnode *vp; VM_OBJECT_ASSERT_LOCKED(object); - if (object->type == OBJT_VNODE) - return (object->handle); - if (object->type == OBJT_SWAP && (object->flags & OBJ_TMPFS) != 0) - return (object->un_pager.swp.swp_tmpfs); - return (NULL); + if (object->type == OBJT_VNODE) { + vp = object->handle; + KASSERT(vp != NULL, ("%s: OBJT_VNODE has no vnode", __func__)); + } else if (object->type == OBJT_SWAP && + (object->flags & OBJ_TMPFS) != 0) { + vp = object->un_pager.swp.swp_tmpfs; + KASSERT(vp != NULL, ("%s: OBJT_TMPFS has no vnode", __func__)); + } else { + vp = NULL; + } + return (vp); } static int From owner-svn-src-head@freebsd.org Fri Nov 30 04:59:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4DDA1157FF7; Fri, 30 Nov 2018 04:59:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 876E76C8C3; Fri, 30 Nov 2018 04:59:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B3C23CDA; Fri, 30 Nov 2018 04:59:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU4xiZI016059; Fri, 30 Nov 2018 04:59:44 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU4xhtC016056; Fri, 30 Nov 2018 04:59:43 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811300459.wAU4xhtC016056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 30 Nov 2018 04:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341282 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 341282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 876E76C8C3 X-Spamd-Result: default: False [0.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.303,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 04:59:45 -0000 Author: vangyzen Date: Fri Nov 30 04:59:43 2018 New Revision: 341282 URL: https://svnweb.freebsd.org/changeset/base/341282 Log: Include path for tmpfs objects in vm.objects sysctl This applies the fix in r283924 to the vm.objects sysctl added by r283624 so the output will include the vnode information (i.e. path) for tmpfs objects. Reviewed by: kib, dab MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D2724 Modified: head/sys/kern/kern_proc.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Nov 30 04:18:31 2018 (r341281) +++ head/sys/kern/kern_proc.c Fri Nov 30 04:59:43 2018 (r341282) @@ -2219,43 +2219,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) freepath = NULL; fullpath = ""; if (lobj) { - vp = NULL; - switch (lobj->type) { - case OBJT_DEFAULT: - kve->kve_type = KVME_TYPE_DEFAULT; - break; - case OBJT_VNODE: - kve->kve_type = KVME_TYPE_VNODE; - vp = lobj->handle; - vref(vp); - break; - case OBJT_SWAP: - if ((lobj->flags & OBJ_TMPFS_NODE) != 0) { - kve->kve_type = KVME_TYPE_VNODE; - if ((lobj->flags & OBJ_TMPFS) != 0) { - vp = lobj->un_pager.swp.swp_tmpfs; - vref(vp); - } - } else { - kve->kve_type = KVME_TYPE_SWAP; - } - break; - case OBJT_DEVICE: - kve->kve_type = KVME_TYPE_DEVICE; - break; - case OBJT_PHYS: - kve->kve_type = KVME_TYPE_PHYS; - break; - case OBJT_DEAD: - kve->kve_type = KVME_TYPE_DEAD; - break; - case OBJT_SG: - kve->kve_type = KVME_TYPE_SG; - break; - default: + kve->kve_type = vm_object_kvme_type(lobj, &vp); + if (kve->kve_type == KVME_TYPE_MGTDEVICE) kve->kve_type = KVME_TYPE_UNKNOWN; - break; - } + if (vp != NULL) + vref(vp); if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); @@ -2463,46 +2431,9 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, s freepath = NULL; fullpath = ""; if (lobj != NULL) { - vp = NULL; - switch (lobj->type) { - case OBJT_DEFAULT: - kve->kve_type = KVME_TYPE_DEFAULT; - break; - case OBJT_VNODE: - kve->kve_type = KVME_TYPE_VNODE; - vp = lobj->handle; + kve->kve_type = vm_object_kvme_type(lobj, &vp); + if (vp != NULL) vref(vp); - break; - case OBJT_SWAP: - if ((lobj->flags & OBJ_TMPFS_NODE) != 0) { - kve->kve_type = KVME_TYPE_VNODE; - if ((lobj->flags & OBJ_TMPFS) != 0) { - vp = lobj->un_pager.swp.swp_tmpfs; - vref(vp); - } - } else { - kve->kve_type = KVME_TYPE_SWAP; - } - break; - case OBJT_DEVICE: - kve->kve_type = KVME_TYPE_DEVICE; - break; - case OBJT_PHYS: - kve->kve_type = KVME_TYPE_PHYS; - break; - case OBJT_DEAD: - kve->kve_type = KVME_TYPE_DEAD; - break; - case OBJT_SG: - kve->kve_type = KVME_TYPE_SG; - break; - case OBJT_MGTDEVICE: - kve->kve_type = KVME_TYPE_MGTDEVICE; - break; - default: - kve->kve_type = KVME_TYPE_UNKNOWN; - break; - } if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Nov 30 04:18:31 2018 (r341281) +++ head/sys/vm/vm_object.c Fri Nov 30 04:59:43 2018 (r341282) @@ -2330,6 +2330,41 @@ vm_object_vnode(vm_object_t object) return (vp); } +/* + * Return the kvme type of the given object. + * If vpp is not NULL, set it to the object's vm_object_vnode() or NULL. + */ +int +vm_object_kvme_type(vm_object_t object, struct vnode **vpp) +{ + + VM_OBJECT_ASSERT_LOCKED(object); + if (vpp != NULL) + *vpp = vm_object_vnode(object); + switch (object->type) { + case OBJT_DEFAULT: + return (KVME_TYPE_DEFAULT); + case OBJT_VNODE: + return (KVME_TYPE_VNODE); + case OBJT_SWAP: + if ((object->flags & OBJ_TMPFS_NODE) != 0) + return (KVME_TYPE_VNODE); + return (KVME_TYPE_SWAP); + case OBJT_DEVICE: + return (KVME_TYPE_DEVICE); + case OBJT_PHYS: + return (KVME_TYPE_PHYS); + case OBJT_DEAD: + return (KVME_TYPE_DEAD); + case OBJT_SG: + return (KVME_TYPE_SG); + case OBJT_MGTDEVICE: + return (KVME_TYPE_MGTDEVICE); + default: + return (KVME_TYPE_UNKNOWN); + } +} + static int sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) { @@ -2404,38 +2439,9 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) kvo->kvo_vn_fsid_freebsd11 = 0; freepath = NULL; fullpath = ""; - vp = NULL; - switch (obj->type) { - case OBJT_DEFAULT: - kvo->kvo_type = KVME_TYPE_DEFAULT; - break; - case OBJT_VNODE: - kvo->kvo_type = KVME_TYPE_VNODE; - vp = obj->handle; + kvo->kvo_type = vm_object_kvme_type(obj, &vp); + if (vp != NULL) vref(vp); - break; - case OBJT_SWAP: - kvo->kvo_type = KVME_TYPE_SWAP; - break; - case OBJT_DEVICE: - kvo->kvo_type = KVME_TYPE_DEVICE; - break; - case OBJT_PHYS: - kvo->kvo_type = KVME_TYPE_PHYS; - break; - case OBJT_DEAD: - kvo->kvo_type = KVME_TYPE_DEAD; - break; - case OBJT_SG: - kvo->kvo_type = KVME_TYPE_SG; - break; - case OBJT_MGTDEVICE: - kvo->kvo_type = KVME_TYPE_MGTDEVICE; - break; - default: - kvo->kvo_type = KVME_TYPE_UNKNOWN; - break; - } VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { vn_fullpath(curthread, vp, &fullpath, &freepath); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Fri Nov 30 04:18:31 2018 (r341281) +++ head/sys/vm/vm_object.h Fri Nov 30 04:59:43 2018 (r341282) @@ -263,6 +263,8 @@ extern struct vm_object kernel_object_store; #define VM_OBJECT_WUNLOCK(object) \ rw_wunlock(&(object)->lock) +struct vnode; + /* * The object must be locked or thread private. */ @@ -328,6 +330,7 @@ void vm_object_destroy (vm_object_t); void vm_object_terminate (vm_object_t); void vm_object_set_writeable_dirty (vm_object_t); void vm_object_init (void); +int vm_object_kvme_type(vm_object_t object, struct vnode **vpp); void vm_object_madvise(vm_object_t, vm_pindex_t, vm_pindex_t, int); boolean_t vm_object_page_clean(vm_object_t object, vm_ooffset_t start, vm_ooffset_t end, int flags); From owner-svn-src-head@freebsd.org Fri Nov 30 05:50:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 601E61158DD0; Fri, 30 Nov 2018 05:50:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0609B6DB34; Fri, 30 Nov 2018 05:50:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB196244F7; Fri, 30 Nov 2018 05:50:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU5o2ab041053; Fri, 30 Nov 2018 05:50:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU5o2iP041047; Fri, 30 Nov 2018 05:50:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300550.wAU5o2iP041047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 05:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341283 - in head/sys: dev/sfxge/common modules/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys: dev/sfxge/common modules/sfxge X-SVN-Commit-Revision: 341283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0609B6DB34 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 05:50:03 -0000 Author: arybchik Date: Fri Nov 30 05:50:01 2018 New Revision: 341283 URL: https://svnweb.freebsd.org/changeset/base/341283 Log: sfxge(4): move empty efsys definitions to EFX headers Move empty definitions for platform-specific annotations from efsys.h to EFX headers. Submitted by: Martin Harvey Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18248 Added: head/sys/dev/sfxge/common/efx_annote.h (contents, props changed) Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/modules/sfxge/Makefile Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Fri Nov 30 04:59:43 2018 (r341282) +++ head/sys/dev/sfxge/common/efsys.h Fri Nov 30 05:50:01 2018 (r341283) @@ -77,11 +77,6 @@ extern "C" { #define memmove(d, s, l) bcopy(s, d, l) #endif -/* FreeBSD equivalents of Solaris things */ -#ifndef _NOTE -#define _NOTE(s) -#endif - #ifndef B_FALSE #define B_FALSE FALSE #endif @@ -198,40 +193,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma bus_dmamap_load_mbuf_sg(tag, map, m, seg, &nsegstmp, 0); #endif } - -/* Modifiers used for Windows builds */ -#define __in -#define __in_opt -#define __in_ecount(_n) -#define __in_ecount_opt(_n) -#define __in_bcount(_n) -#define __in_bcount_opt(_n) - -#define __out -#define __out_opt -#define __out_ecount(_n) -#define __out_ecount_opt(_n) -#define __out_bcount(_n) -#define __out_bcount_opt(_n) -#define __out_bcount_part(_n, _l) -#define __out_bcount_part_opt(_n, _l) - -#define __deref_out - -#define __inout -#define __inout_opt -#define __inout_ecount(_n) -#define __inout_ecount_opt(_n) -#define __inout_bcount(_n) -#define __inout_bcount_opt(_n) -#define __inout_bcount_full_opt(_n) - -#define __deref_out_bcount_opt(n) - -#define __checkReturn -#define __success(_x) - -#define __drv_when(_p, _c) /* Code inclusion options */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 04:59:43 2018 (r341282) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 05:50:01 2018 (r341283) @@ -35,6 +35,7 @@ #ifndef _SYS_EFX_H #define _SYS_EFX_H +#include "efx_annote.h" #include "efsys.h" #include "efx_check.h" #include "efx_phy_ids.h" Added: head/sys/dev/sfxge/common/efx_annote.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/efx_annote.h Fri Nov 30 05:50:01 2018 (r341283) @@ -0,0 +1,129 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Solarflare Communications Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + * + * $FreeBSD$ + */ + +#ifndef _SYS_EFX_ANNOTE_H +#define _SYS_EFX_ANNOTE_H + +#if defined(_WIN32) || defined(_WIN64) +#define EFX_HAVE_WINDOWS_ANNOTATIONS 1 +#else +#define EFX_HAVE_WINDOWS_ANNOTATIONS 0 +#endif /* defined(_WIN32) || defined(_WIN64) */ + +#if defined(__sun) +#define EFX_HAVE_SOLARIS_ANNOTATIONS 1 +#else +#define EFX_HAVE_SOLARIS_ANNOTATIONS 0 +#endif /* defined(__sun) */ + +#if !EFX_HAVE_WINDOWS_ANNOTATIONS + +/* Ignore Windows SAL annotations on other platforms */ +#define __in +#define __in_opt +#define __in_ecount(_n) +#define __in_ecount_opt(_n) +#define __in_bcount(_n) +#define __in_bcount_opt(_n) + +#define __out +#define __out_opt +#define __out_ecount(_n) +#define __out_ecount_opt(_n) +#define __out_bcount(_n) +#define __out_bcount_opt(_n) +#define __out_bcount_part(_n, _l) +#define __out_bcount_part_opt(_n, _l) + +#define __deref_out + +#define __inout +#define __inout_opt +#define __inout_ecount(_n) +#define __inout_ecount_opt(_n) +#define __inout_bcount(_n) +#define __inout_bcount_opt(_n) +#define __inout_bcount_full_opt(_n) + +#define __deref_out_bcount_opt(n) + +#define __checkReturn +#define __success(_x) + +#define __drv_when(_p, _c) + +#endif /* !EFX_HAVE_WINDOWS_ANNOTATIONS */ + +#if !EFX_HAVE_SOLARIS_ANNOTATIONS + +#if EFX_HAVE_WINDOWS_ANNOTATIONS + +/* + * Support some SunOS/Solaris style _NOTE() annotations + * + * At present with the facilities provided in the WDL and the SAL we can only + * easily act upon _NOTE(ARGUNUSED(arglist)) annotations. + * + * Intermediate macros to expand individual _NOTE annotation types into + * something the WDK or SAL can understand. They shouldn't be used directly, + * for example EFX_NOTE_ARGUNUSED() is only used as an intermediate step on the + * transformation of _NOTE(ARGUNSED(arg1, arg2)) into + * UNREFERENCED_PARAMETER((arg1, arg2)); + */ +#define EFX_NOTE_ALIGNMENT(_fname, _n) +#define EFX_NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__)); +#define EFX_NOTE_CONSTANTCONDITION +#define EFX_NOTE_CONSTCOND +#define EFX_NOTE_EMPTY +#define EFX_NOTE_FALLTHROUGH +#define EFX_NOTE_FALLTHRU +#define EFX_NOTE_LINTED(_msg) +#define EFX_NOTE_NOTREACHED +#define EFX_NOTE_PRINTFLIKE(_n) +#define EFX_NOTE_SCANFLIKE(_n) +#define EFX_NOTE_VARARGS(_n) + +#define _NOTE(_annotation) EFX_NOTE_ ## _annotation + +#else + +/* Ignore Solaris annotations on other platforms */ + +#define _NOTE(_annotation) + +#endif /* EFX_HAVE_WINDOWS_ANNOTATIONS */ + +#endif /* !EFX_HAVE_SOLARIS_ANNOTATIONS */ + +#endif /* _SYS_EFX_ANNOTE_H */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri Nov 30 04:59:43 2018 (r341282) +++ head/sys/modules/sfxge/Makefile Fri Nov 30 05:50:01 2018 (r341283) @@ -19,7 +19,8 @@ SRCS+= efx_mcdi.c efx_mon.c efx_nic.c SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tunnel.c SRCS+= efx_tx.c efx_vpd.c efx_filter.c efx_hash.c SRCS+= efsys.h -SRCS+= efx.h efx_check.h efx_impl.h efx_mcdi.h efx_regs.h efx_regs_ef10.h +SRCS+= efx.h efx_annote.h efx_check.h efx_impl.h efx_mcdi.h +SRCS+= efx_regs.h efx_regs_ef10.h SRCS+= efx_regs_mcdi.h efx_regs_mcdi_aoe.h efx_regs_pci.h efx_types.h SRCS+= efx_phy_ids.h SRCS+= ef10_tlv_layout.h From owner-svn-src-head@freebsd.org Fri Nov 30 05:54:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0315A1158FC1; Fri, 30 Nov 2018 05:54:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3806DF16; Fri, 30 Nov 2018 05:54:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 733CF2468B; Fri, 30 Nov 2018 05:54:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU5s8Rh045883; Fri, 30 Nov 2018 05:54:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU5s8vW045880; Fri, 30 Nov 2018 05:54:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300554.wAU5s8vW045880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 05:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341284 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A3806DF16 X-Spamd-Result: default: False [0.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.418,0]; NEURAL_SPAM_MEDIUM(0.47)[0.467,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.03)[0.032,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 05:54:09 -0000 Author: arybchik Date: Fri Nov 30 05:54:07 2018 New Revision: 341284 URL: https://svnweb.freebsd.org/changeset/base/341284 Log: sfxge(4): refactor monitors support Remove obsolete monitor types since Falcon SFN4000 series adapters no longer supported by libefx. Rename MCDI monitors to be consistent with YML. The code may be simplified and generalized since only MCDI monitors remain. Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18249 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 05:50:01 2018 (r341283) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 05:54:07 2018 (r341284) @@ -690,77 +690,74 @@ efx_mon_init( #define EFX_MON_STATS_PAGE_SIZE 0x100 #define EFX_MON_MASK_ELEMENT_SIZE 32 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 400fdb0517af1fca */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 78b65c8d5af9747b */ typedef enum efx_mon_stat_e { - EFX_MON_STAT_2_5V, - EFX_MON_STAT_VCCP1, - EFX_MON_STAT_VCC, - EFX_MON_STAT_5V, - EFX_MON_STAT_12V, - EFX_MON_STAT_VCCP2, - EFX_MON_STAT_EXT_TEMP, - EFX_MON_STAT_INT_TEMP, - EFX_MON_STAT_AIN1, - EFX_MON_STAT_AIN2, - EFX_MON_STAT_INT_COOLING, - EFX_MON_STAT_EXT_COOLING, - EFX_MON_STAT_1V, - EFX_MON_STAT_1_2V, - EFX_MON_STAT_1_8V, - EFX_MON_STAT_3_3V, - EFX_MON_STAT_1_2VA, - EFX_MON_STAT_VREF, - EFX_MON_STAT_VAOE, + EFX_MON_STAT_CONTROLLER_TEMP, + EFX_MON_STAT_PHY_COMMON_TEMP, + EFX_MON_STAT_CONTROLLER_COOLING, + EFX_MON_STAT_PHY0_TEMP, + EFX_MON_STAT_PHY0_COOLING, + EFX_MON_STAT_PHY1_TEMP, + EFX_MON_STAT_PHY1_COOLING, + EFX_MON_STAT_IN_1V0, + EFX_MON_STAT_IN_1V2, + EFX_MON_STAT_IN_1V8, + EFX_MON_STAT_IN_2V5, + EFX_MON_STAT_IN_3V3, + EFX_MON_STAT_IN_12V0, + EFX_MON_STAT_IN_1V2A, + EFX_MON_STAT_IN_VREF, + EFX_MON_STAT_OUT_VAOE, EFX_MON_STAT_AOE_TEMP, EFX_MON_STAT_PSU_AOE_TEMP, EFX_MON_STAT_PSU_TEMP, - EFX_MON_STAT_FAN0, - EFX_MON_STAT_FAN1, - EFX_MON_STAT_FAN2, - EFX_MON_STAT_FAN3, - EFX_MON_STAT_FAN4, - EFX_MON_STAT_VAOE_IN, - EFX_MON_STAT_IAOE, - EFX_MON_STAT_IAOE_IN, + EFX_MON_STAT_FAN_0, + EFX_MON_STAT_FAN_1, + EFX_MON_STAT_FAN_2, + EFX_MON_STAT_FAN_3, + EFX_MON_STAT_FAN_4, + EFX_MON_STAT_IN_VAOE, + EFX_MON_STAT_OUT_IAOE, + EFX_MON_STAT_IN_IAOE, EFX_MON_STAT_NIC_POWER, - EFX_MON_STAT_0_9V, - EFX_MON_STAT_I0_9V, - EFX_MON_STAT_I1_2V, - EFX_MON_STAT_0_9V_ADC, - EFX_MON_STAT_INT_TEMP2, - EFX_MON_STAT_VREG_TEMP, - EFX_MON_STAT_VREG_0_9V_TEMP, - EFX_MON_STAT_VREG_1_2V_TEMP, - EFX_MON_STAT_INT_VPTAT, - EFX_MON_STAT_INT_ADC_TEMP, - EFX_MON_STAT_EXT_VPTAT, - EFX_MON_STAT_EXT_ADC_TEMP, + EFX_MON_STAT_IN_0V9, + EFX_MON_STAT_IN_I0V9, + EFX_MON_STAT_IN_I1V2, + EFX_MON_STAT_IN_0V9_ADC, + EFX_MON_STAT_CONTROLLER_2_TEMP, + EFX_MON_STAT_VREG_INTERNAL_TEMP, + EFX_MON_STAT_VREG_0V9_TEMP, + EFX_MON_STAT_VREG_1V2_TEMP, + EFX_MON_STAT_CONTROLLER_VPTAT, + EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP, + EFX_MON_STAT_CONTROLLER_VPTAT_EXTADC, + EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP_EXTADC, EFX_MON_STAT_AMBIENT_TEMP, EFX_MON_STAT_AIRFLOW, EFX_MON_STAT_VDD08D_VSS08D_CSR, EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC, EFX_MON_STAT_HOTPOINT_TEMP, - EFX_MON_STAT_PHY_POWER_SWITCH_PORT0, - EFX_MON_STAT_PHY_POWER_SWITCH_PORT1, + EFX_MON_STAT_PHY_POWER_PORT0, + EFX_MON_STAT_PHY_POWER_PORT1, EFX_MON_STAT_MUM_VCC, - EFX_MON_STAT_0V9_A, - EFX_MON_STAT_I0V9_A, - EFX_MON_STAT_0V9_A_TEMP, - EFX_MON_STAT_0V9_B, - EFX_MON_STAT_I0V9_B, - EFX_MON_STAT_0V9_B_TEMP, + EFX_MON_STAT_IN_0V9_A, + EFX_MON_STAT_IN_I0V9_A, + EFX_MON_STAT_VREG_0V9_A_TEMP, + EFX_MON_STAT_IN_0V9_B, + EFX_MON_STAT_IN_I0V9_B, + EFX_MON_STAT_VREG_0V9_B_TEMP, EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY, - EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXT_ADC, + EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXTADC, EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY, - EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXT_ADC, + EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXTADC, EFX_MON_STAT_CONTROLLER_MASTER_VPTAT, EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP, - EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXT_ADC, - EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXT_ADC, + EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXTADC, + EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC, EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT, EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP, - EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXT_ADC, - EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC, + EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXTADC, + EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC, EFX_MON_STAT_SODIMM_VOUT, EFX_MON_STAT_SODIMM_0_TEMP, EFX_MON_STAT_SODIMM_1_TEMP, @@ -769,12 +766,12 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_CONTROLLER_TDIODE_TEMP, EFX_MON_STAT_BOARD_FRONT_TEMP, EFX_MON_STAT_BOARD_BACK_TEMP, - EFX_MON_STAT_I1V8, - EFX_MON_STAT_I2V5, - EFX_MON_STAT_I3V3, - EFX_MON_STAT_I12V0, - EFX_MON_STAT_1_3V, - EFX_MON_STAT_I1V3, + EFX_MON_STAT_IN_I1V8, + EFX_MON_STAT_IN_I2V5, + EFX_MON_STAT_IN_I3V3, + EFX_MON_STAT_IN_I12V0, + EFX_MON_STAT_IN_1V3, + EFX_MON_STAT_IN_I1V3, EFX_MON_NSTATS } efx_mon_stat_t; @@ -788,11 +785,33 @@ typedef enum efx_mon_stat_state_e { EFX_MON_STAT_STATE_NO_READING = 4, } efx_mon_stat_state_t; +typedef enum efx_mon_stat_unit_e { + EFX_MON_STAT_UNIT_UNKNOWN = 0, + EFX_MON_STAT_UNIT_BOOL, + EFX_MON_STAT_UNIT_TEMP_C, + EFX_MON_STAT_UNIT_VOLTAGE_MV, + EFX_MON_STAT_UNIT_CURRENT_MA, + EFX_MON_STAT_UNIT_POWER_W, + EFX_MON_STAT_UNIT_RPM, + EFX_MON_NUNITS +} efx_mon_stat_unit_t; + typedef struct efx_mon_stat_value_s { - uint16_t emsv_value; - uint16_t emsv_state; + uint16_t emsv_value; + efx_mon_stat_state_t emsv_state; + efx_mon_stat_unit_t emsv_unit; } efx_mon_stat_value_t; +typedef enum efx_mon_stat_portmask_e { + EFX_MON_STAT_PORTMAP_NONE = 0, + EFX_MON_STAT_PORTMAP_PORT0 = 1, + EFX_MON_STAT_PORTMAP_PORT1 = 2, + EFX_MON_STAT_PORTMAP_PORT2 = 3, + EFX_MON_STAT_PORTMAP_PORT3 = 4, + EFX_MON_STAT_PORTMAP_ALL = (-1), + EFX_MON_STAT_PORTMAP_UNKNOWN = (-2) +} efx_mon_stat_portmask_t; + #if EFSYS_OPT_NAMES extern const char * @@ -801,6 +820,21 @@ efx_mon_stat_name( __in efx_mon_stat_t id); #endif /* EFSYS_OPT_NAMES */ + +extern __checkReturn boolean_t +efx_mon_mcdi_to_efx_stat( + __in int mcdi_index, + __out efx_mon_stat_t *statp); + +extern __checkReturn boolean_t +efx_mon_get_stat_unit( + __in efx_mon_stat_t stat, + __out efx_mon_stat_unit_t *unitp); + +extern __checkReturn boolean_t +efx_mon_get_stat_portmap( + __in efx_mon_stat_t stat, + __out efx_mon_stat_portmask_t *maskp); extern __checkReturn efx_rc_t efx_mon_stats_update( Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Fri Nov 30 05:50:01 2018 (r341283) +++ head/sys/dev/sfxge/common/efx_mon.c Fri Nov 30 05:54:07 2018 (r341284) @@ -128,77 +128,74 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 8150a068198c0f96 */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock 277c17eda1a6d1a4 */ static const char * const __mon_stat_name[] = { - "value_2_5v", - "value_vccp1", - "value_vcc", - "value_5v", - "value_12v", - "value_vccp2", - "value_ext_temp", - "value_int_temp", - "value_ain1", - "value_ain2", + "controller_temp", + "phy_common_temp", "controller_cooling", - "ext_cooling", - "1v", - "1_2v", - "1_8v", - "3_3v", - "1_2va", - "vref", - "vaoe", - "aoe_temperature", - "psu_aoe_temperature", - "psu_temperature", - "fan0", - "fan1", - "fan2", - "fan3", - "fan4", - "vaoe_in", - "iaoe", - "iaoe_in", + "phy0_temp", + "phy0_cooling", + "phy1_temp", + "phy1_cooling", + "in_1v0", + "in_1v2", + "in_1v8", + "in_2v5", + "in_3v3", + "in_12v0", + "in_1v2a", + "in_vref", + "out_vaoe", + "aoe_temp", + "psu_aoe_temp", + "psu_temp", + "fan_0", + "fan_1", + "fan_2", + "fan_3", + "fan_4", + "in_vaoe", + "out_iaoe", + "in_iaoe", "nic_power", - "0_9v", - "i0_9v", - "i1_2v", - "0_9v_adc", - "controller_temperature2", - "vreg_temperature", - "vreg_0_9v_temperature", - "vreg_1_2v_temperature", - "int_vptat", - "controller_internal_adc_temperature", - "ext_vptat", - "controller_external_adc_temperature", - "ambient_temperature", + "in_0v9", + "in_i0v9", + "in_i1v2", + "in_0v9_adc", + "controller_2_temp", + "vreg_internal_temp", + "vreg_0v9_temp", + "vreg_1v2_temp", + "controller_vptat", + "controller_internal_temp", + "controller_vptat_extadc", + "controller_internal_temp_extadc", + "ambient_temp", "airflow", "vdd08d_vss08d_csr", "vdd08d_vss08d_csr_extadc", - "hotpoint_temperature", - "phy_power_switch_port0", - "phy_power_switch_port1", + "hotpoint_temp", + "phy_power_port0", + "phy_power_port1", "mum_vcc", - "0v9_a", - "i0v9_a", - "0v9_a_temp", - "0v9_b", - "i0v9_b", - "0v9_b_temp", + "in_0v9_a", + "in_i0v9_a", + "vreg_0v9_a_temp", + "in_0v9_b", + "in_i0v9_b", + "vreg_0v9_b_temp", "ccom_avreg_1v2_supply", - "ccom_avreg_1v2_supply_ext_adc", + "ccom_avreg_1v2_supply_extadc", "ccom_avreg_1v8_supply", - "ccom_avreg_1v8_supply_ext_adc", + "ccom_avreg_1v8_supply_extadc", "controller_master_vptat", "controller_master_internal_temp", - "controller_master_vptat_ext_adc", - "controller_master_internal_temp_ext_adc", + "controller_master_vptat_extadc", + "controller_master_internal_temp_extadc", "controller_slave_vptat", "controller_slave_internal_temp", - "controller_slave_vptat_ext_adc", - "controller_slave_internal_temp_ext_adc", + "controller_slave_vptat_extadc", + "controller_slave_internal_temp_extadc", "sodimm_vout", "sodimm_0_temp", "sodimm_1_temp", @@ -207,15 +204,513 @@ static const char * const __mon_stat_name[] = { "controller_tdiode_temp", "board_front_temp", "board_back_temp", - "i1v8", - "i2v5", - "i3v3", - "i12v0", - "1v3", - "i1v3", + "in_i1v8", + "in_i2v5", + "in_i3v3", + "in_i12v0", + "in_1v3", + "in_i1v3", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ + +/* START MKCONFIG GENERATED MonitorMcdiMappingBlock 362875db87a4e7da */ + __checkReturn boolean_t +efx_mon_mcdi_to_efx_stat( + __in int mcdi_index, + __out efx_mon_stat_t *statp) +{ + + if ((mcdi_index % (MC_CMD_SENSOR_PAGE0_NEXT + 1)) == + MC_CMD_SENSOR_PAGE0_NEXT) { + *statp = EFX_MON_NSTATS; + return (B_FALSE); + } + + switch (mcdi_index) { + case MC_CMD_SENSOR_IN_I0V9: + *statp = EFX_MON_STAT_IN_I0V9; + break; + case MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC: + *statp = EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXTADC; + break; + case MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT: + *statp = EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT; + break; + case MC_CMD_SENSOR_PSU_TEMP: + *statp = EFX_MON_STAT_PSU_TEMP; + break; + case MC_CMD_SENSOR_FAN_2: + *statp = EFX_MON_STAT_FAN_2; + break; + case MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC: + *statp = EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP_EXTADC; + break; + case MC_CMD_SENSOR_BOARD_BACK_TEMP: + *statp = EFX_MON_STAT_BOARD_BACK_TEMP; + break; + case MC_CMD_SENSOR_IN_1V3: + *statp = EFX_MON_STAT_IN_1V3; + break; + case MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP: + *statp = EFX_MON_STAT_CONTROLLER_TDIODE_TEMP; + break; + case MC_CMD_SENSOR_IN_2V5: + *statp = EFX_MON_STAT_IN_2V5; + break; + case MC_CMD_SENSOR_PHY_COMMON_TEMP: + *statp = EFX_MON_STAT_PHY_COMMON_TEMP; + break; + case MC_CMD_SENSOR_PHY1_TEMP: + *statp = EFX_MON_STAT_PHY1_TEMP; + break; + case MC_CMD_SENSOR_VREG_INTERNAL_TEMP: + *statp = EFX_MON_STAT_VREG_INTERNAL_TEMP; + break; + case MC_CMD_SENSOR_IN_1V0: + *statp = EFX_MON_STAT_IN_1V0; + break; + case MC_CMD_SENSOR_FAN_1: + *statp = EFX_MON_STAT_FAN_1; + break; + case MC_CMD_SENSOR_IN_1V2: + *statp = EFX_MON_STAT_IN_1V2; + break; + case MC_CMD_SENSOR_FAN_3: + *statp = EFX_MON_STAT_FAN_3; + break; + case MC_CMD_SENSOR_IN_1V2A: + *statp = EFX_MON_STAT_IN_1V2A; + break; + case MC_CMD_SENSOR_SODIMM_0_TEMP: + *statp = EFX_MON_STAT_SODIMM_0_TEMP; + break; + case MC_CMD_SENSOR_IN_1V8: + *statp = EFX_MON_STAT_IN_1V8; + break; + case MC_CMD_SENSOR_IN_VREF: + *statp = EFX_MON_STAT_IN_VREF; + break; + case MC_CMD_SENSOR_SODIMM_VOUT: + *statp = EFX_MON_STAT_SODIMM_VOUT; + break; + case MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY: + *statp = EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY; + break; + case MC_CMD_SENSOR_IN_I1V2: + *statp = EFX_MON_STAT_IN_I1V2; + break; + case MC_CMD_SENSOR_IN_I1V3: + *statp = EFX_MON_STAT_IN_I1V3; + break; + case MC_CMD_SENSOR_AIRFLOW: + *statp = EFX_MON_STAT_AIRFLOW; + break; + case MC_CMD_SENSOR_HOTPOINT_TEMP: + *statp = EFX_MON_STAT_HOTPOINT_TEMP; + break; + case MC_CMD_SENSOR_VDD08D_VSS08D_CSR: + *statp = EFX_MON_STAT_VDD08D_VSS08D_CSR; + break; + case MC_CMD_SENSOR_AOE_TEMP: + *statp = EFX_MON_STAT_AOE_TEMP; + break; + case MC_CMD_SENSOR_IN_I1V8: + *statp = EFX_MON_STAT_IN_I1V8; + break; + case MC_CMD_SENSOR_IN_I2V5: + *statp = EFX_MON_STAT_IN_I2V5; + break; + case MC_CMD_SENSOR_PHY1_COOLING: + *statp = EFX_MON_STAT_PHY1_COOLING; + break; + case MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC: + *statp = EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXTADC; + break; + case MC_CMD_SENSOR_IN_0V9_ADC: + *statp = EFX_MON_STAT_IN_0V9_ADC; + break; + case MC_CMD_SENSOR_VREG_0V9_A_TEMP: + *statp = EFX_MON_STAT_VREG_0V9_A_TEMP; + break; + case MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT: + *statp = EFX_MON_STAT_CONTROLLER_MASTER_VPTAT; + break; + case MC_CMD_SENSOR_PHY0_VCC: + *statp = EFX_MON_STAT_PHY0_VCC; + break; + case MC_CMD_SENSOR_PHY0_COOLING: + *statp = EFX_MON_STAT_PHY0_COOLING; + break; + case MC_CMD_SENSOR_PSU_AOE_TEMP: + *statp = EFX_MON_STAT_PSU_AOE_TEMP; + break; + case MC_CMD_SENSOR_VREG_0V9_TEMP: + *statp = EFX_MON_STAT_VREG_0V9_TEMP; + break; + case MC_CMD_SENSOR_IN_I0V9_A: + *statp = EFX_MON_STAT_IN_I0V9_A; + break; + case MC_CMD_SENSOR_IN_I3V3: + *statp = EFX_MON_STAT_IN_I3V3; + break; + case MC_CMD_SENSOR_BOARD_FRONT_TEMP: + *statp = EFX_MON_STAT_BOARD_FRONT_TEMP; + break; + case MC_CMD_SENSOR_OUT_VAOE: + *statp = EFX_MON_STAT_OUT_VAOE; + break; + case MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC: + *statp = EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC; + break; + case MC_CMD_SENSOR_IN_I12V0: + *statp = EFX_MON_STAT_IN_I12V0; + break; + case MC_CMD_SENSOR_PHY_POWER_PORT1: + *statp = EFX_MON_STAT_PHY_POWER_PORT1; + break; + case MC_CMD_SENSOR_PHY_POWER_PORT0: + *statp = EFX_MON_STAT_PHY_POWER_PORT0; + break; + case MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC: + *statp = EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC; + break; + case MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP: + *statp = EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP; + break; + case MC_CMD_SENSOR_CONTROLLER_TEMP: + *statp = EFX_MON_STAT_CONTROLLER_TEMP; + break; + case MC_CMD_SENSOR_IN_IAOE: + *statp = EFX_MON_STAT_IN_IAOE; + break; + case MC_CMD_SENSOR_IN_VAOE: + *statp = EFX_MON_STAT_IN_VAOE; + break; + case MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC: + *statp = EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXTADC; + break; + case MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY: + *statp = EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY; + break; + case MC_CMD_SENSOR_PHY1_VCC: + *statp = EFX_MON_STAT_PHY1_VCC; + break; + case MC_CMD_SENSOR_CONTROLLER_COOLING: + *statp = EFX_MON_STAT_CONTROLLER_COOLING; + break; + case MC_CMD_SENSOR_AMBIENT_TEMP: + *statp = EFX_MON_STAT_AMBIENT_TEMP; + break; + case MC_CMD_SENSOR_IN_3V3: + *statp = EFX_MON_STAT_IN_3V3; + break; + case MC_CMD_SENSOR_PHY0_TEMP: + *statp = EFX_MON_STAT_PHY0_TEMP; + break; + case MC_CMD_SENSOR_SODIMM_1_TEMP: + *statp = EFX_MON_STAT_SODIMM_1_TEMP; + break; + case MC_CMD_SENSOR_MUM_VCC: + *statp = EFX_MON_STAT_MUM_VCC; + break; + case MC_CMD_SENSOR_VREG_0V9_B_TEMP: + *statp = EFX_MON_STAT_VREG_0V9_B_TEMP; + break; + case MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP: + *statp = EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP; + break; + case MC_CMD_SENSOR_FAN_4: + *statp = EFX_MON_STAT_FAN_4; + break; + case MC_CMD_SENSOR_CONTROLLER_2_TEMP: + *statp = EFX_MON_STAT_CONTROLLER_2_TEMP; + break; + case MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC: + *statp = EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXTADC; + break; + case MC_CMD_SENSOR_IN_0V9_A: + *statp = EFX_MON_STAT_IN_0V9_A; + break; + case MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC: + *statp = EFX_MON_STAT_CONTROLLER_VPTAT_EXTADC; + break; + case MC_CMD_SENSOR_IN_0V9: + *statp = EFX_MON_STAT_IN_0V9; + break; + case MC_CMD_SENSOR_IN_I0V9_B: + *statp = EFX_MON_STAT_IN_I0V9_B; + break; + case MC_CMD_SENSOR_NIC_POWER: + *statp = EFX_MON_STAT_NIC_POWER; + break; + case MC_CMD_SENSOR_IN_12V0: + *statp = EFX_MON_STAT_IN_12V0; + break; + case MC_CMD_SENSOR_OUT_IAOE: + *statp = EFX_MON_STAT_OUT_IAOE; + break; + case MC_CMD_SENSOR_CONTROLLER_VPTAT: + *statp = EFX_MON_STAT_CONTROLLER_VPTAT; + break; + case MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC: + *statp = EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC; + break; + case MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP: + *statp = EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP; + break; + case MC_CMD_SENSOR_FAN_0: + *statp = EFX_MON_STAT_FAN_0; + break; + case MC_CMD_SENSOR_VREG_1V2_TEMP: + *statp = EFX_MON_STAT_VREG_1V2_TEMP; + break; + case MC_CMD_SENSOR_IN_0V9_B: + *statp = EFX_MON_STAT_IN_0V9_B; + break; + default: + *statp = EFX_MON_NSTATS; + break; + }; + + if (*statp == EFX_MON_NSTATS) + goto fail1; + + return (B_TRUE); + +fail1: + EFSYS_PROBE1(fail1, boolean_t, B_TRUE); + return (B_FALSE); +}; + +/* END MKCONFIG GENERATED MonitorMcdiMappingBlock */ + +/* START MKCONFIG GENERATED MonitorStatisticUnitsBlock 2d447c656cc2d01d */ + __checkReturn boolean_t +efx_mon_get_stat_unit( + __in efx_mon_stat_t stat, + __out efx_mon_stat_unit_t *unitp) +{ + switch (stat) { + case EFX_MON_STAT_IN_1V0: + case EFX_MON_STAT_IN_1V2: + case EFX_MON_STAT_IN_1V8: + case EFX_MON_STAT_IN_2V5: + case EFX_MON_STAT_IN_3V3: + case EFX_MON_STAT_IN_12V0: + case EFX_MON_STAT_IN_1V2A: + case EFX_MON_STAT_IN_VREF: + case EFX_MON_STAT_OUT_VAOE: + case EFX_MON_STAT_IN_VAOE: + case EFX_MON_STAT_IN_0V9: + case EFX_MON_STAT_IN_0V9_ADC: + case EFX_MON_STAT_CONTROLLER_VPTAT_EXTADC: + case EFX_MON_STAT_VDD08D_VSS08D_CSR: + case EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC: + case EFX_MON_STAT_MUM_VCC: + case EFX_MON_STAT_IN_0V9_A: + case EFX_MON_STAT_IN_0V9_B: + case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY: + case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXTADC: + case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY: + case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXTADC: + case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT: + case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXTADC: + case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT: + case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXTADC: + case EFX_MON_STAT_SODIMM_VOUT: + case EFX_MON_STAT_PHY0_VCC: + case EFX_MON_STAT_PHY1_VCC: + case EFX_MON_STAT_IN_1V3: + *unitp = EFX_MON_STAT_UNIT_VOLTAGE_MV; + break; + case EFX_MON_STAT_CONTROLLER_TEMP: + case EFX_MON_STAT_PHY_COMMON_TEMP: + case EFX_MON_STAT_PHY0_TEMP: + case EFX_MON_STAT_PHY1_TEMP: + case EFX_MON_STAT_AOE_TEMP: + case EFX_MON_STAT_PSU_AOE_TEMP: + case EFX_MON_STAT_PSU_TEMP: + case EFX_MON_STAT_CONTROLLER_2_TEMP: + case EFX_MON_STAT_VREG_INTERNAL_TEMP: + case EFX_MON_STAT_VREG_0V9_TEMP: + case EFX_MON_STAT_VREG_1V2_TEMP: + case EFX_MON_STAT_CONTROLLER_VPTAT: + case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP: + case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP_EXTADC: + case EFX_MON_STAT_AMBIENT_TEMP: + case EFX_MON_STAT_HOTPOINT_TEMP: + case EFX_MON_STAT_VREG_0V9_A_TEMP: + case EFX_MON_STAT_VREG_0V9_B_TEMP: + case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP: + case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC: + case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP: + case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC: + case EFX_MON_STAT_SODIMM_0_TEMP: + case EFX_MON_STAT_SODIMM_1_TEMP: + case EFX_MON_STAT_CONTROLLER_TDIODE_TEMP: + case EFX_MON_STAT_BOARD_FRONT_TEMP: + case EFX_MON_STAT_BOARD_BACK_TEMP: + *unitp = EFX_MON_STAT_UNIT_TEMP_C; + break; + case EFX_MON_STAT_CONTROLLER_COOLING: + case EFX_MON_STAT_PHY0_COOLING: + case EFX_MON_STAT_PHY1_COOLING: + case EFX_MON_STAT_AIRFLOW: + case EFX_MON_STAT_PHY_POWER_PORT0: + case EFX_MON_STAT_PHY_POWER_PORT1: + *unitp = EFX_MON_STAT_UNIT_BOOL; + break; + case EFX_MON_STAT_NIC_POWER: + *unitp = EFX_MON_STAT_UNIT_POWER_W; + break; + case EFX_MON_STAT_OUT_IAOE: + case EFX_MON_STAT_IN_IAOE: + case EFX_MON_STAT_IN_I0V9: + case EFX_MON_STAT_IN_I1V2: + case EFX_MON_STAT_IN_I0V9_A: + case EFX_MON_STAT_IN_I0V9_B: + case EFX_MON_STAT_IN_I1V8: + case EFX_MON_STAT_IN_I2V5: + case EFX_MON_STAT_IN_I3V3: + case EFX_MON_STAT_IN_I12V0: + case EFX_MON_STAT_IN_I1V3: + *unitp = EFX_MON_STAT_UNIT_CURRENT_MA; + break; + case EFX_MON_STAT_FAN_0: + case EFX_MON_STAT_FAN_1: + case EFX_MON_STAT_FAN_2: + case EFX_MON_STAT_FAN_3: + case EFX_MON_STAT_FAN_4: + *unitp = EFX_MON_STAT_UNIT_RPM; + break; + default: + *unitp = EFX_MON_STAT_UNIT_UNKNOWN; + break; + }; + + if (*unitp == EFX_MON_STAT_UNIT_UNKNOWN) + goto fail1; + + return (B_TRUE); + +fail1: + EFSYS_PROBE1(fail1, boolean_t, B_TRUE); + return (B_FALSE); +}; + +/* END MKCONFIG GENERATED MonitorStatisticUnitsBlock */ + +/* START MKCONFIG GENERATED MonitorStatisticPortsBlock 1719b751d842534f */ + __checkReturn boolean_t +efx_mon_get_stat_portmap( + __in efx_mon_stat_t stat, + __out efx_mon_stat_portmask_t *maskp) +{ + + switch (stat) { + case EFX_MON_STAT_PHY1_TEMP: + case EFX_MON_STAT_PHY1_COOLING: + case EFX_MON_STAT_PHY_POWER_PORT1: + *maskp = EFX_MON_STAT_PORTMAP_PORT1; + break; + case EFX_MON_STAT_CONTROLLER_TEMP: + case EFX_MON_STAT_PHY_COMMON_TEMP: + case EFX_MON_STAT_CONTROLLER_COOLING: + case EFX_MON_STAT_IN_1V0: + case EFX_MON_STAT_IN_1V2: + case EFX_MON_STAT_IN_1V8: + case EFX_MON_STAT_IN_2V5: + case EFX_MON_STAT_IN_3V3: + case EFX_MON_STAT_IN_12V0: + case EFX_MON_STAT_IN_1V2A: + case EFX_MON_STAT_IN_VREF: + case EFX_MON_STAT_OUT_VAOE: + case EFX_MON_STAT_AOE_TEMP: + case EFX_MON_STAT_PSU_AOE_TEMP: + case EFX_MON_STAT_PSU_TEMP: + case EFX_MON_STAT_FAN_0: + case EFX_MON_STAT_FAN_1: + case EFX_MON_STAT_FAN_2: + case EFX_MON_STAT_FAN_3: + case EFX_MON_STAT_FAN_4: + case EFX_MON_STAT_IN_VAOE: + case EFX_MON_STAT_OUT_IAOE: + case EFX_MON_STAT_IN_IAOE: + case EFX_MON_STAT_NIC_POWER: + case EFX_MON_STAT_IN_0V9: + case EFX_MON_STAT_IN_I0V9: + case EFX_MON_STAT_IN_I1V2: + case EFX_MON_STAT_IN_0V9_ADC: + case EFX_MON_STAT_CONTROLLER_2_TEMP: + case EFX_MON_STAT_VREG_INTERNAL_TEMP: + case EFX_MON_STAT_VREG_0V9_TEMP: + case EFX_MON_STAT_VREG_1V2_TEMP: + case EFX_MON_STAT_CONTROLLER_VPTAT: + case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP: + case EFX_MON_STAT_CONTROLLER_VPTAT_EXTADC: + case EFX_MON_STAT_CONTROLLER_INTERNAL_TEMP_EXTADC: + case EFX_MON_STAT_AMBIENT_TEMP: + case EFX_MON_STAT_AIRFLOW: + case EFX_MON_STAT_VDD08D_VSS08D_CSR: + case EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC: + case EFX_MON_STAT_HOTPOINT_TEMP: + case EFX_MON_STAT_MUM_VCC: + case EFX_MON_STAT_IN_0V9_A: + case EFX_MON_STAT_IN_I0V9_A: + case EFX_MON_STAT_VREG_0V9_A_TEMP: + case EFX_MON_STAT_IN_0V9_B: + case EFX_MON_STAT_IN_I0V9_B: + case EFX_MON_STAT_VREG_0V9_B_TEMP: + case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY: + case EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXTADC: + case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY: + case EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXTADC: + case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT: + case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP: + case EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXTADC: + case EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC: + case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT: + case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP: + case EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXTADC: + case EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC: + case EFX_MON_STAT_SODIMM_VOUT: + case EFX_MON_STAT_SODIMM_0_TEMP: + case EFX_MON_STAT_SODIMM_1_TEMP: + case EFX_MON_STAT_PHY0_VCC: + case EFX_MON_STAT_PHY1_VCC: + case EFX_MON_STAT_CONTROLLER_TDIODE_TEMP: + case EFX_MON_STAT_BOARD_FRONT_TEMP: + case EFX_MON_STAT_BOARD_BACK_TEMP: + case EFX_MON_STAT_IN_I1V8: + case EFX_MON_STAT_IN_I2V5: + case EFX_MON_STAT_IN_I3V3: + case EFX_MON_STAT_IN_I12V0: + case EFX_MON_STAT_IN_1V3: + case EFX_MON_STAT_IN_I1V3: + *maskp = EFX_MON_STAT_PORTMAP_ALL; + break; + case EFX_MON_STAT_PHY0_TEMP: + case EFX_MON_STAT_PHY0_COOLING: + case EFX_MON_STAT_PHY_POWER_PORT0: + *maskp = EFX_MON_STAT_PORTMAP_PORT0; + break; + default: + *maskp = EFX_MON_STAT_PORTMAP_UNKNOWN; + break; + }; + + if (*maskp == EFX_MON_STAT_PORTMAP_UNKNOWN) + goto fail1; + + return (B_TRUE); + +fail1: + EFSYS_PROBE1(fail1, boolean_t, B_TRUE); + return (B_FALSE); +}; + +/* END MKCONFIG GENERATED MonitorStatisticPortsBlock */ extern const char * efx_mon_stat_name( Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Fri Nov 30 05:50:01 2018 (r341283) +++ head/sys/dev/sfxge/common/mcdi_mon.c Fri Nov 30 05:54:07 2018 (r341284) @@ -39,136 +39,9 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MON_STATS -#define MCDI_MON_NEXT_PAGE ((uint16_t)0xfffe) -#define MCDI_MON_INVALID_SENSOR ((uint16_t)0xfffd) -#define MCDI_MON_PAGE_SIZE 0x20 - -/* Bitmasks of valid port(s) for each sensor */ -#define MCDI_MON_PORT_NONE (0x00) -#define MCDI_MON_PORT_P1 (0x01) -#define MCDI_MON_PORT_P2 (0x02) -#define MCDI_MON_PORT_P3 (0x04) -#define MCDI_MON_PORT_P4 (0x08) -#define MCDI_MON_PORT_Px (0xFFFF) - /* Get port mask from one-based MCDI port number */ #define MCDI_MON_PORT_MASK(_emip) (1U << ((_emip)->emi_port - 1)) -/* Entry for MCDI sensor in sensor map */ -#define STAT(portmask, stat) \ - { (MCDI_MON_PORT_##portmask), (EFX_MON_STAT_##stat) } - -/* Entry for sensor next page flag in sensor map */ -#define STAT_NEXT_PAGE() \ - { MCDI_MON_PORT_NONE, MCDI_MON_NEXT_PAGE } - -/* Placeholder for gaps in the array */ -#define STAT_NO_SENSOR() \ - { MCDI_MON_PORT_NONE, MCDI_MON_INVALID_SENSOR } - -/* Map from MC sensors to monitor statistics */ -static const struct mcdi_sensor_map_s { - uint16_t msm_port_mask; - uint16_t msm_stat; -} mcdi_sensor_map[] = { - /* Sensor page 0 MC_CMD_SENSOR_xxx */ - STAT(Px, INT_TEMP), /* 0x00 CONTROLLER_TEMP */ - STAT(Px, EXT_TEMP), /* 0x01 PHY_COMMON_TEMP */ - STAT(Px, INT_COOLING), /* 0x02 CONTROLLER_COOLING */ - STAT(P1, EXT_TEMP), /* 0x03 PHY0_TEMP */ - STAT(P1, EXT_COOLING), /* 0x04 PHY0_COOLING */ - STAT(P2, EXT_TEMP), /* 0x05 PHY1_TEMP */ - STAT(P2, EXT_COOLING), /* 0x06 PHY1_COOLING */ - STAT(Px, 1V), /* 0x07 IN_1V0 */ - STAT(Px, 1_2V), /* 0x08 IN_1V2 */ - STAT(Px, 1_8V), /* 0x09 IN_1V8 */ - STAT(Px, 2_5V), /* 0x0a IN_2V5 */ - STAT(Px, 3_3V), /* 0x0b IN_3V3 */ - STAT(Px, 12V), /* 0x0c IN_12V0 */ - STAT(Px, 1_2VA), /* 0x0d IN_1V2A */ - STAT(Px, VREF), /* 0x0e IN_VREF */ - STAT(Px, VAOE), /* 0x0f OUT_VAOE */ - STAT(Px, AOE_TEMP), /* 0x10 AOE_TEMP */ - STAT(Px, PSU_AOE_TEMP), /* 0x11 PSU_AOE_TEMP */ - STAT(Px, PSU_TEMP), /* 0x12 PSU_TEMP */ - STAT(Px, FAN0), /* 0x13 FAN_0 */ - STAT(Px, FAN1), /* 0x14 FAN_1 */ - STAT(Px, FAN2), /* 0x15 FAN_2 */ - STAT(Px, FAN3), /* 0x16 FAN_3 */ - STAT(Px, FAN4), /* 0x17 FAN_4 */ - STAT(Px, VAOE_IN), /* 0x18 IN_VAOE */ - STAT(Px, IAOE), /* 0x19 OUT_IAOE */ - STAT(Px, IAOE_IN), /* 0x1a IN_IAOE */ - STAT(Px, NIC_POWER), /* 0x1b NIC_POWER */ - STAT(Px, 0_9V), /* 0x1c IN_0V9 */ - STAT(Px, I0_9V), /* 0x1d IN_I0V9 */ - STAT(Px, I1_2V), /* 0x1e IN_I1V2 */ - STAT_NEXT_PAGE(), /* 0x1f Next page flag (not a sensor) */ - - /* Sensor page 1 MC_CMD_SENSOR_xxx */ - STAT(Px, 0_9V_ADC), /* 0x20 IN_0V9_ADC */ - STAT(Px, INT_TEMP2), /* 0x21 CONTROLLER_2_TEMP */ - STAT(Px, VREG_TEMP), /* 0x22 VREG_INTERNAL_TEMP */ - STAT(Px, VREG_0_9V_TEMP), /* 0x23 VREG_0V9_TEMP */ - STAT(Px, VREG_1_2V_TEMP), /* 0x24 VREG_1V2_TEMP */ - STAT(Px, INT_VPTAT), /* 0x25 CTRLR. VPTAT */ - STAT(Px, INT_ADC_TEMP), /* 0x26 CTRLR. INTERNAL_TEMP */ - STAT(Px, EXT_VPTAT), /* 0x27 CTRLR. VPTAT_EXTADC */ - STAT(Px, EXT_ADC_TEMP), /* 0x28 CTRLR. INTERNAL_TEMP_EXTADC */ - STAT(Px, AMBIENT_TEMP), /* 0x29 AMBIENT_TEMP */ - STAT(Px, AIRFLOW), /* 0x2a AIRFLOW */ - STAT(Px, VDD08D_VSS08D_CSR), /* 0x2b VDD08D_VSS08D_CSR */ - STAT(Px, VDD08D_VSS08D_CSR_EXTADC), /* 0x2c VDD08D_VSS08D_CSR_EXTADC */ - STAT(Px, HOTPOINT_TEMP), /* 0x2d HOTPOINT_TEMP */ - STAT(P1, PHY_POWER_SWITCH_PORT0), /* 0x2e PHY_POWER_SWITCH_PORT0 */ - STAT(P2, PHY_POWER_SWITCH_PORT1), /* 0x2f PHY_POWER_SWITCH_PORT1 */ - STAT(Px, MUM_VCC), /* 0x30 MUM_VCC */ - STAT(Px, 0V9_A), /* 0x31 0V9_A */ - STAT(Px, I0V9_A), /* 0x32 I0V9_A */ - STAT(Px, 0V9_A_TEMP), /* 0x33 0V9_A_TEMP */ - STAT(Px, 0V9_B), /* 0x34 0V9_B */ - STAT(Px, I0V9_B), /* 0x35 I0V9_B */ - STAT(Px, 0V9_B_TEMP), /* 0x36 0V9_B_TEMP */ - STAT(Px, CCOM_AVREG_1V2_SUPPLY), /* 0x37 CCOM_AVREG_1V2_SUPPLY */ - STAT(Px, CCOM_AVREG_1V2_SUPPLY_EXT_ADC), - /* 0x38 CCOM_AVREG_1V2_SUPPLY_EXT_ADC */ - STAT(Px, CCOM_AVREG_1V8_SUPPLY), /* 0x39 CCOM_AVREG_1V8_SUPPLY */ - STAT(Px, CCOM_AVREG_1V8_SUPPLY_EXT_ADC), - /* 0x3a CCOM_AVREG_1V8_SUPPLY_EXT_ADC */ - STAT_NO_SENSOR(), /* 0x3b (no sensor) */ - STAT_NO_SENSOR(), /* 0x3c (no sensor) */ - STAT_NO_SENSOR(), /* 0x3d (no sensor) */ - STAT_NO_SENSOR(), /* 0x3e (no sensor) */ - STAT_NEXT_PAGE(), /* 0x3f Next page flag (not a sensor) */ - - /* Sensor page 2 MC_CMD_SENSOR_xxx */ - STAT(Px, CONTROLLER_MASTER_VPTAT), /* 0x40 MASTER_VPTAT */ - STAT(Px, CONTROLLER_MASTER_INTERNAL_TEMP), /* 0x41 MASTER_INT_TEMP */ - STAT(Px, CONTROLLER_MASTER_VPTAT_EXT_ADC), /* 0x42 MAST_VPTAT_EXT_ADC */ - STAT(Px, CONTROLLER_MASTER_INTERNAL_TEMP_EXT_ADC), - /* 0x43 MASTER_INTERNAL_TEMP_EXT_ADC */ - STAT(Px, CONTROLLER_SLAVE_VPTAT), /* 0x44 SLAVE_VPTAT */ - STAT(Px, CONTROLLER_SLAVE_INTERNAL_TEMP), /* 0x45 SLAVE_INTERNAL_TEMP */ - STAT(Px, CONTROLLER_SLAVE_VPTAT_EXT_ADC), /* 0x46 SLAVE_VPTAT_EXT_ADC */ - STAT(Px, CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC), - /* 0x47 SLAVE_INTERNAL_TEMP_EXT_ADC */ - STAT_NO_SENSOR(), /* 0x48 (no sensor) */ - STAT(Px, SODIMM_VOUT), /* 0x49 SODIMM_VOUT */ - STAT(Px, SODIMM_0_TEMP), /* 0x4a SODIMM_0_TEMP */ - STAT(Px, SODIMM_1_TEMP), /* 0x4b SODIMM_1_TEMP */ - STAT(Px, PHY0_VCC), /* 0x4c PHY0_VCC */ - STAT(Px, PHY1_VCC), /* 0x4d PHY1_VCC */ - STAT(Px, CONTROLLER_TDIODE_TEMP), /* 0x4e CONTROLLER_TDIODE_TEMP */ - STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ - STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ - STAT(Px, I1V8), /* 0x51 IN_I1V8 */ - STAT(Px, I2V5), /* 0x52 IN_I2V5 */ - STAT(Px, I3V3), /* 0x53 IN_I3V3 */ - STAT(Px, I12V0), /* 0x54 IN_I12V0 */ - STAT(Px, 1_3V), /* 0x55 IN_1V3 */ - STAT(Px, I1V3), /* 0x56 IN_I1V3 */ -}; - #define MCDI_STATIC_SENSOR_ASSERT(_field) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 30 05:54:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF8191158FFD; Fri, 30 Nov 2018 05:54:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 767656DFFE; Fri, 30 Nov 2018 05:54:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AF082468C; Fri, 30 Nov 2018 05:54:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU5sKe4045941; Fri, 30 Nov 2018 05:54:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU5sJY4045939; Fri, 30 Nov 2018 05:54:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300554.wAU5sJY4045939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 05:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341285 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 767656DFFE X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 05:54:22 -0000 Author: arybchik Date: Fri Nov 30 05:54:19 2018 New Revision: 341285 URL: https://svnweb.freebsd.org/changeset/base/341285 Log: sfxge(4): remove probes when a Tx queue is too full No need for probe messages when a TxQ is too full for a post to be done. Existing drivers check if there is room in the queue before posting descriptors, even though efx_tx_qdesc_post() does the check itself. The new SFN Windows driver doesn't perform the check before calling efx_tx_qdesc_post(), but that means these probes can get frequently printed out. It's normal driver behaviour so there's no need to print an error. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18250 Modified: head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 30 05:54:07 2018 (r341284) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 30 05:54:19 2018 (r341285) @@ -568,12 +568,9 @@ ef10_tx_qdesc_post( { unsigned int added = *addedp; unsigned int i; - efx_rc_t rc; - if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) { - rc = ENOSPC; - goto fail1; - } + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) + return (ENOSPC); for (i = 0; i < ndescs; i++) { efx_desc_t *edp = &ed[i]; @@ -593,11 +590,6 @@ ef10_tx_qdesc_post( *addedp = added; return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); } void Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Fri Nov 30 05:54:07 2018 (r341284) +++ head/sys/dev/sfxge/common/efx_tx.c Fri Nov 30 05:54:19 2018 (r341285) @@ -601,19 +601,10 @@ efx_tx_qdesc_post( { efx_nic_t *enp = etp->et_enp; const efx_tx_ops_t *etxop = enp->en_etxop; - efx_rc_t rc; EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); - if ((rc = etxop->etxo_qdesc_post(etp, ed, - ndescs, completed, addedp)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - return (rc); + return (etxop->etxo_qdesc_post(etp, ed, ndescs, completed, addedp)); } void @@ -792,10 +783,9 @@ siena_tx_qpost( { unsigned int added = *addedp; unsigned int i; - int rc = ENOSPC; if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) - goto fail1; + return (ENOSPC); for (i = 0; i < ndescs; i++) { efx_buffer_t *ebp = &eb[i]; @@ -817,11 +807,6 @@ siena_tx_qpost( *addedp = added; return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); } static void From owner-svn-src-head@freebsd.org Fri Nov 30 05:54:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96DB91159020; Fri, 30 Nov 2018 05:54:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40D646E11D; Fri, 30 Nov 2018 05:54:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D8592468D; Fri, 30 Nov 2018 05:54:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU5sWIi046002; Fri, 30 Nov 2018 05:54:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU5sVkB045998; Fri, 30 Nov 2018 05:54:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300554.wAU5sVkB045998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 05:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341286 - in head/sys: dev/sfxge/common modules/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys: dev/sfxge/common modules/sfxge X-SVN-Commit-Revision: 341286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40D646E11D X-Spamd-Result: default: False [0.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.014,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 05:54:36 -0000 Author: arybchik Date: Fri Nov 30 05:54:30 2018 New Revision: 341286 URL: https://svnweb.freebsd.org/changeset/base/341286 Log: sfxge(4): add generated description of sensors Description of sensors is generated from firmware sources. Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18251 Added: head/sys/dev/sfxge/common/efx_regs_mcdi_strs.h (contents, props changed) Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_mon.c head/sys/modules/sfxge/Makefile Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 05:54:19 2018 (r341285) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 05:54:30 2018 (r341286) @@ -819,6 +819,11 @@ efx_mon_stat_name( __in efx_nic_t *enp, __in efx_mon_stat_t id); +extern const char * +efx_mon_stat_description( + __in efx_nic_t *enp, + __in efx_mon_stat_t id); + #endif /* EFSYS_OPT_NAMES */ extern __checkReturn boolean_t Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 30 05:54:19 2018 (r341285) +++ head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 30 05:54:30 2018 (r341286) @@ -38,6 +38,10 @@ #include "efx.h" #include "efx_regs_mcdi.h" +#if EFSYS_OPT_NAMES +#include "efx_regs_mcdi_strs.h" +#endif /* EFSYS_OPT_NAMES */ + #ifdef __cplusplus extern "C" { #endif Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Fri Nov 30 05:54:19 2018 (r341285) +++ head/sys/dev/sfxge/common/efx_mon.c Fri Nov 30 05:54:30 2018 (r341286) @@ -214,7 +214,124 @@ static const char * const __mon_stat_name[] = { /* END MKCONFIG GENERATED MonitorStatNamesBlock */ -/* START MKCONFIG GENERATED MonitorMcdiMappingBlock 362875db87a4e7da */ + const char * +efx_mon_stat_name( + __in efx_nic_t *enp, + __in efx_mon_stat_t id) +{ + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + + EFSYS_ASSERT3U(id, <, EFX_MON_NSTATS); + return (__mon_stat_name[id]); +} + +typedef struct _stat_description_t { + efx_mon_stat_t stat; + const char *desc; +} stat_description_t; + +/* START MKCONFIG GENERATED MonitorStatDescriptionsBlock f072138f16d2e1f8 */ +static const char *__mon_stat_description[] = { + MC_CMD_SENSOR_CONTROLLER_TEMP_ENUM_STR, + MC_CMD_SENSOR_PHY_COMMON_TEMP_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_COOLING_ENUM_STR, + MC_CMD_SENSOR_PHY0_TEMP_ENUM_STR, + MC_CMD_SENSOR_PHY0_COOLING_ENUM_STR, + MC_CMD_SENSOR_PHY1_TEMP_ENUM_STR, + MC_CMD_SENSOR_PHY1_COOLING_ENUM_STR, + MC_CMD_SENSOR_IN_1V0_ENUM_STR, + MC_CMD_SENSOR_IN_1V2_ENUM_STR, + MC_CMD_SENSOR_IN_1V8_ENUM_STR, + MC_CMD_SENSOR_IN_2V5_ENUM_STR, + MC_CMD_SENSOR_IN_3V3_ENUM_STR, + MC_CMD_SENSOR_IN_12V0_ENUM_STR, + MC_CMD_SENSOR_IN_1V2A_ENUM_STR, + MC_CMD_SENSOR_IN_VREF_ENUM_STR, + MC_CMD_SENSOR_OUT_VAOE_ENUM_STR, + MC_CMD_SENSOR_AOE_TEMP_ENUM_STR, + MC_CMD_SENSOR_PSU_AOE_TEMP_ENUM_STR, + MC_CMD_SENSOR_PSU_TEMP_ENUM_STR, + MC_CMD_SENSOR_FAN_0_ENUM_STR, + MC_CMD_SENSOR_FAN_1_ENUM_STR, + MC_CMD_SENSOR_FAN_2_ENUM_STR, + MC_CMD_SENSOR_FAN_3_ENUM_STR, + MC_CMD_SENSOR_FAN_4_ENUM_STR, + MC_CMD_SENSOR_IN_VAOE_ENUM_STR, + MC_CMD_SENSOR_OUT_IAOE_ENUM_STR, + MC_CMD_SENSOR_IN_IAOE_ENUM_STR, + MC_CMD_SENSOR_NIC_POWER_ENUM_STR, + MC_CMD_SENSOR_IN_0V9_ENUM_STR, + MC_CMD_SENSOR_IN_I0V9_ENUM_STR, + MC_CMD_SENSOR_IN_I1V2_ENUM_STR, + MC_CMD_SENSOR_IN_0V9_ADC_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_2_TEMP_ENUM_STR, + MC_CMD_SENSOR_VREG_INTERNAL_TEMP_ENUM_STR, + MC_CMD_SENSOR_VREG_0V9_TEMP_ENUM_STR, + MC_CMD_SENSOR_VREG_1V2_TEMP_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_VPTAT_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC_ENUM_STR, + MC_CMD_SENSOR_AMBIENT_TEMP_ENUM_STR, + MC_CMD_SENSOR_AIRFLOW_ENUM_STR, + MC_CMD_SENSOR_VDD08D_VSS08D_CSR_ENUM_STR, + MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC_ENUM_STR, + MC_CMD_SENSOR_HOTPOINT_TEMP_ENUM_STR, + MC_CMD_SENSOR_PHY_POWER_PORT0_ENUM_STR, + MC_CMD_SENSOR_PHY_POWER_PORT1_ENUM_STR, + MC_CMD_SENSOR_MUM_VCC_ENUM_STR, + MC_CMD_SENSOR_IN_0V9_A_ENUM_STR, + MC_CMD_SENSOR_IN_I0V9_A_ENUM_STR, + MC_CMD_SENSOR_VREG_0V9_A_TEMP_ENUM_STR, + MC_CMD_SENSOR_IN_0V9_B_ENUM_STR, + MC_CMD_SENSOR_IN_I0V9_B_ENUM_STR, + MC_CMD_SENSOR_VREG_0V9_B_TEMP_ENUM_STR, + MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_ENUM_STR, + MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC_ENUM_STR, + MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_ENUM_STR, + MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC_ENUM_STR, + MC_CMD_SENSOR_SODIMM_VOUT_ENUM_STR, + MC_CMD_SENSOR_SODIMM_0_TEMP_ENUM_STR, + MC_CMD_SENSOR_SODIMM_1_TEMP_ENUM_STR, + MC_CMD_SENSOR_PHY0_VCC_ENUM_STR, + MC_CMD_SENSOR_PHY1_VCC_ENUM_STR, + MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP_ENUM_STR, + MC_CMD_SENSOR_BOARD_FRONT_TEMP_ENUM_STR, + MC_CMD_SENSOR_BOARD_BACK_TEMP_ENUM_STR, + MC_CMD_SENSOR_IN_I1V8_ENUM_STR, + MC_CMD_SENSOR_IN_I2V5_ENUM_STR, + MC_CMD_SENSOR_IN_I3V3_ENUM_STR, + MC_CMD_SENSOR_IN_I12V0_ENUM_STR, + MC_CMD_SENSOR_IN_1V3_ENUM_STR, + MC_CMD_SENSOR_IN_I1V3_ENUM_STR, +}; + +/* END MKCONFIG GENERATED MonitorStatDescriptionsBlock */ + + const char * +efx_mon_stat_description( + __in efx_nic_t *enp, + __in efx_mon_stat_t id) +{ + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + + EFSYS_ASSERT3U(id, <, EFX_MON_NSTATS); + return (__mon_stat_description[id]); +} + +#endif /* EFSYS_OPT_NAMES */ + +/* START MKCONFIG GENERATED MonitorMcdiMappingBlock 173eee0a5599996a */ __checkReturn boolean_t efx_mon_mcdi_to_efx_stat( __in int mcdi_index, @@ -711,20 +828,6 @@ fail1: }; /* END MKCONFIG GENERATED MonitorStatisticPortsBlock */ - -extern const char * -efx_mon_stat_name( - __in efx_nic_t *enp, - __in efx_mon_stat_t id) -{ - _NOTE(ARGUNUSED(enp)) - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - - EFSYS_ASSERT3U(id, <, EFX_MON_NSTATS); - return (__mon_stat_name[id]); -} - -#endif /* EFSYS_OPT_NAMES */ __checkReturn efx_rc_t efx_mon_stats_update( Added: head/sys/dev/sfxge/common/efx_regs_mcdi_strs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/efx_regs_mcdi_strs.h Fri Nov 30 05:54:30 2018 (r341286) @@ -0,0 +1,125 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2008-2018 Solarflare Communications Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This file is automatically generated. DO NOT EDIT IT. + * To make changes, edit the .yml files under firmwaresrc doc/mcdi/ and + * rebuild this file with "make -C doc mcdiheaders". + * + * The version of this file has MCDI strings really used in the libefx. + */ + +#ifndef _SYS_EFX_REGS_MCDI_STRS_H +#define _SYS_EFX_REGS_MCDI_STRS_H + +#define MC_CMD_SENSOR_CONTROLLER_TEMP_ENUM_STR "Controller temperature: degC" +#define MC_CMD_SENSOR_PHY_COMMON_TEMP_ENUM_STR "Phy common temperature: degC" +#define MC_CMD_SENSOR_CONTROLLER_COOLING_ENUM_STR "Controller cooling: bool" +#define MC_CMD_SENSOR_PHY0_TEMP_ENUM_STR "Phy 0 temperature: degC" +#define MC_CMD_SENSOR_PHY0_COOLING_ENUM_STR "Phy 0 cooling: bool" +#define MC_CMD_SENSOR_PHY1_TEMP_ENUM_STR "Phy 1 temperature: degC" +#define MC_CMD_SENSOR_PHY1_COOLING_ENUM_STR "Phy 1 cooling: bool" +#define MC_CMD_SENSOR_IN_1V0_ENUM_STR "1.0v power: mV" +#define MC_CMD_SENSOR_IN_1V2_ENUM_STR "1.2v power: mV" +#define MC_CMD_SENSOR_IN_1V8_ENUM_STR "1.8v power: mV" +#define MC_CMD_SENSOR_IN_2V5_ENUM_STR "2.5v power: mV" +#define MC_CMD_SENSOR_IN_3V3_ENUM_STR "3.3v power: mV" +#define MC_CMD_SENSOR_IN_12V0_ENUM_STR "12v power: mV" +#define MC_CMD_SENSOR_IN_1V2A_ENUM_STR "1.2v analogue power: mV" +#define MC_CMD_SENSOR_IN_VREF_ENUM_STR "reference voltage: mV" +#define MC_CMD_SENSOR_OUT_VAOE_ENUM_STR "AOE FPGA power: mV" +#define MC_CMD_SENSOR_AOE_TEMP_ENUM_STR "AOE FPGA temperature: degC" +#define MC_CMD_SENSOR_PSU_AOE_TEMP_ENUM_STR "AOE FPGA PSU temperature: degC" +#define MC_CMD_SENSOR_PSU_TEMP_ENUM_STR "AOE PSU temperature: degC" +#define MC_CMD_SENSOR_FAN_0_ENUM_STR "Fan 0 speed: RPM" +#define MC_CMD_SENSOR_FAN_1_ENUM_STR "Fan 1 speed: RPM" +#define MC_CMD_SENSOR_FAN_2_ENUM_STR "Fan 2 speed: RPM" +#define MC_CMD_SENSOR_FAN_3_ENUM_STR "Fan 3 speed: RPM" +#define MC_CMD_SENSOR_FAN_4_ENUM_STR "Fan 4 speed: RPM" +#define MC_CMD_SENSOR_IN_VAOE_ENUM_STR "AOE FPGA input power: mV" +#define MC_CMD_SENSOR_OUT_IAOE_ENUM_STR "AOE FPGA current: mA" +#define MC_CMD_SENSOR_IN_IAOE_ENUM_STR "AOE FPGA input current: mA" +#define MC_CMD_SENSOR_NIC_POWER_ENUM_STR "NIC power consumption: W" +#define MC_CMD_SENSOR_IN_0V9_ENUM_STR "0.9v power voltage: mV" +#define MC_CMD_SENSOR_IN_I0V9_ENUM_STR "0.9v power current: mA" +#define MC_CMD_SENSOR_IN_I1V2_ENUM_STR "1.2v power current: mA" +#define MC_CMD_SENSOR_PAGE0_NEXT_ENUM_STR "Not a sensor: reserved for the next page flag" +#define MC_CMD_SENSOR_IN_0V9_ADC_ENUM_STR "0.9v power voltage (at ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_2_TEMP_ENUM_STR "Controller temperature 2: degC" +#define MC_CMD_SENSOR_VREG_INTERNAL_TEMP_ENUM_STR "Voltage regulator internal temperature: degC" +#define MC_CMD_SENSOR_VREG_0V9_TEMP_ENUM_STR "0.9V voltage regulator temperature: degC" +#define MC_CMD_SENSOR_VREG_1V2_TEMP_ENUM_STR "1.2V voltage regulator temperature: degC" +#define MC_CMD_SENSOR_CONTROLLER_VPTAT_ENUM_STR "controller internal temperature sensor voltage (internal ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_ENUM_STR "controller internal temperature (internal ADC): degC" +#define MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC_ENUM_STR "controller internal temperature sensor voltage (external ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC_ENUM_STR "controller internal temperature (external ADC): degC" +#define MC_CMD_SENSOR_AMBIENT_TEMP_ENUM_STR "ambient temperature: degC" +#define MC_CMD_SENSOR_AIRFLOW_ENUM_STR "air flow: bool" +#define MC_CMD_SENSOR_VDD08D_VSS08D_CSR_ENUM_STR "voltage between VSS08D and VSS08D at CSR: mV" +#define MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC_ENUM_STR "voltage between VSS08D and VSS08D at CSR (external ADC): mV" +#define MC_CMD_SENSOR_HOTPOINT_TEMP_ENUM_STR "Hotpoint temperature: degC" +#define MC_CMD_SENSOR_PHY_POWER_PORT0_ENUM_STR "Port 0 PHY power switch over-current: bool" +#define MC_CMD_SENSOR_PHY_POWER_PORT1_ENUM_STR "Port 1 PHY power switch over-current: bool" +#define MC_CMD_SENSOR_MUM_VCC_ENUM_STR "Mop-up microcontroller reference voltage: mV" +#define MC_CMD_SENSOR_IN_0V9_A_ENUM_STR "0.9v power phase A voltage: mV" +#define MC_CMD_SENSOR_IN_I0V9_A_ENUM_STR "0.9v power phase A current: mA" +#define MC_CMD_SENSOR_VREG_0V9_A_TEMP_ENUM_STR "0.9V voltage regulator phase A temperature: degC" +#define MC_CMD_SENSOR_IN_0V9_B_ENUM_STR "0.9v power phase B voltage: mV" +#define MC_CMD_SENSOR_IN_I0V9_B_ENUM_STR "0.9v power phase B current: mA" +#define MC_CMD_SENSOR_VREG_0V9_B_TEMP_ENUM_STR "0.9V voltage regulator phase B temperature: degC" +#define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_ENUM_STR "CCOM AVREG 1v2 supply (interval ADC): mV" +#define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC_ENUM_STR "CCOM AVREG 1v2 supply (external ADC): mV" +#define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_ENUM_STR "CCOM AVREG 1v8 supply (interval ADC): mV" +#define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC_ENUM_STR "CCOM AVREG 1v8 supply (external ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_RTS_ENUM_STR "CCOM RTS temperature: degC" +#define MC_CMD_SENSOR_PAGE1_NEXT_ENUM_STR "Not a sensor: reserved for the next page flag" +#define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_ENUM_STR "controller internal temperature sensor voltage on master core (internal ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_ENUM_STR "controller internal temperature on master core (internal ADC): degC" +#define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC_ENUM_STR "controller internal temperature sensor voltage on master core (external ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC_ENUM_STR "controller internal temperature on master core (external ADC): degC" +#define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_ENUM_STR "controller internal temperature on slave core sensor voltage (internal ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_ENUM_STR "controller internal temperature on slave core (internal ADC): degC" +#define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC_ENUM_STR "controller internal temperature on slave core sensor voltage (external ADC): mV" +#define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC_ENUM_STR "controller internal temperature on slave core (external ADC): degC" +#define MC_CMD_SENSOR_SODIMM_VOUT_ENUM_STR "Voltage supplied to the SODIMMs from their power supply: mV" +#define MC_CMD_SENSOR_SODIMM_0_TEMP_ENUM_STR "Temperature of SODIMM 0 (if installed): degC" +#define MC_CMD_SENSOR_SODIMM_1_TEMP_ENUM_STR "Temperature of SODIMM 1 (if installed): degC" +#define MC_CMD_SENSOR_PHY0_VCC_ENUM_STR "Voltage supplied to the QSFP #0 from their power supply: mV" +#define MC_CMD_SENSOR_PHY1_VCC_ENUM_STR "Voltage supplied to the QSFP #1 from their power supply: mV" +#define MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP_ENUM_STR "Controller die temperature (TDIODE): degC" +#define MC_CMD_SENSOR_BOARD_FRONT_TEMP_ENUM_STR "Board temperature (front): degC" +#define MC_CMD_SENSOR_BOARD_BACK_TEMP_ENUM_STR "Board temperature (back): degC" +#define MC_CMD_SENSOR_IN_I1V8_ENUM_STR "1.8v power current: mA" +#define MC_CMD_SENSOR_IN_I2V5_ENUM_STR "2.5v power current: mA" +#define MC_CMD_SENSOR_IN_I3V3_ENUM_STR "3.3v power current: mA" +#define MC_CMD_SENSOR_IN_I12V0_ENUM_STR "12v power current: mA" +#define MC_CMD_SENSOR_IN_1V3_ENUM_STR "1.3v power: mV" +#define MC_CMD_SENSOR_IN_I1V3_ENUM_STR "1.3v power current: mA" + +#endif /* _SYS_EFX_REGS_MCDI_STRS_H */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri Nov 30 05:54:19 2018 (r341285) +++ head/sys/modules/sfxge/Makefile Fri Nov 30 05:54:30 2018 (r341286) @@ -21,7 +21,8 @@ SRCS+= efx_tx.c efx_vpd.c efx_filter.c efx_hash.c SRCS+= efsys.h SRCS+= efx.h efx_annote.h efx_check.h efx_impl.h efx_mcdi.h SRCS+= efx_regs.h efx_regs_ef10.h -SRCS+= efx_regs_mcdi.h efx_regs_mcdi_aoe.h efx_regs_pci.h efx_types.h +SRCS+= efx_regs_mcdi.h efx_regs_mcdi_aoe.h efx_regs_mcdi_strs.h +SRCS+= efx_regs_pci.h efx_types.h SRCS+= efx_phy_ids.h SRCS+= ef10_tlv_layout.h From owner-svn-src-head@freebsd.org Fri Nov 30 07:04:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9107115A2B6; Fri, 30 Nov 2018 07:04:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AFAD6FFB1; Fri, 30 Nov 2018 07:04:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A6A2251EC; Fri, 30 Nov 2018 07:04:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU74EB0081658; Fri, 30 Nov 2018 07:04:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU74Ec6081657; Fri, 30 Nov 2018 07:04:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300704.wAU74Ec6081657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341290 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8AFAD6FFB1 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:04:15 -0000 Author: arybchik Date: Fri Nov 30 07:04:13 2018 New Revision: 341290 URL: https://svnweb.freebsd.org/changeset/base/341290 Log: sfxge(4): check size of memory to read sensors data to Size of provided memory should be consistent with specified size. Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18252 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Fri Nov 30 06:47:01 2018 (r341289) +++ head/sys/dev/sfxge/common/mcdi_mon.c Fri Nov 30 07:04:13 2018 (r341290) @@ -221,7 +221,13 @@ efx_mcdi_read_sensors( uint8_t payload[MAX(MC_CMD_READ_SENSORS_EXT_IN_LEN, MC_CMD_READ_SENSORS_EXT_OUT_LEN)]; uint32_t addr_lo, addr_hi; + efx_rc_t rc; + if (EFSYS_MEM_SIZE(esmp) < size) { + rc = EINVAL; + goto fail1; + } + req.emr_cmd = MC_CMD_READ_SENSORS; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_READ_SENSORS_EXT_IN_LEN; @@ -238,6 +244,11 @@ efx_mcdi_read_sensors( efx_mcdi_execute(enp, &req); return (req.emr_rc); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } static __checkReturn efx_rc_t From owner-svn-src-head@freebsd.org Fri Nov 30 07:04:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F002115A2D7; Fri, 30 Nov 2018 07:04:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12104700A7; Fri, 30 Nov 2018 07:04:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2875251ED; Fri, 30 Nov 2018 07:04:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU74QiM081719; Fri, 30 Nov 2018 07:04:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU74Phs081715; Fri, 30 Nov 2018 07:04:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300704.wAU74Phs081715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341291 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 12104700A7 X-Spamd-Result: default: False [0.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.014,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:04:27 -0000 Author: arybchik Date: Fri Nov 30 07:04:25 2018 New Revision: 341291 URL: https://svnweb.freebsd.org/changeset/base/341291 Log: sfxge(4): add API to retrieve sensor limits Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18253 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/mcdi_mon.c head/sys/dev/sfxge/common/mcdi_mon.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:04:13 2018 (r341290) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:04:25 2018 (r341291) @@ -802,6 +802,13 @@ typedef struct efx_mon_stat_value_s { efx_mon_stat_unit_t emsv_unit; } efx_mon_stat_value_t; +typedef struct efx_mon_limit_value_s { + uint16_t emlv_warning_min; + uint16_t emlv_warning_max; + uint16_t emlv_fatal_min; + uint16_t emlv_fatal_max; +} efx_mon_stat_limits_t; + typedef enum efx_mon_stat_portmask_e { EFX_MON_STAT_PORTMAP_NONE = 0, EFX_MON_STAT_PORTMAP_PORT0 = 1, @@ -846,6 +853,11 @@ efx_mon_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values); + +extern __checkReturn efx_rc_t +efx_mon_limits_update( + __in efx_nic_t *enp, + __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_limits_t *values); #endif /* EFSYS_OPT_MON_STATS */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:04:13 2018 (r341290) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:04:25 2018 (r341291) @@ -345,6 +345,8 @@ typedef struct efx_mon_ops_s { #if EFSYS_OPT_MON_STATS efx_rc_t (*emo_stats_update)(efx_nic_t *, efsys_mem_t *, efx_mon_stat_value_t *); + efx_rc_t (*emo_limits_update)(efx_nic_t *, + efx_mon_stat_limits_t *); #endif /* EFSYS_OPT_MON_STATS */ } efx_mon_ops_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Fri Nov 30 07:04:13 2018 (r341290) +++ head/sys/dev/sfxge/common/efx_mon.c Fri Nov 30 07:04:25 2018 (r341291) @@ -67,7 +67,8 @@ efx_mon_name( #if EFSYS_OPT_MON_MCDI static const efx_mon_ops_t __efx_mon_mcdi_ops = { #if EFSYS_OPT_MON_STATS - mcdi_mon_stats_update /* emo_stats_update */ + mcdi_mon_stats_update, /* emo_stats_update */ + mcdi_mon_limits_update, /* emo_limits_update */ #endif /* EFSYS_OPT_MON_STATS */ }; #endif @@ -842,6 +843,20 @@ efx_mon_stats_update( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MON); return (emop->emo_stats_update(enp, esmp, values)); +} + + __checkReturn efx_rc_t +efx_mon_limits_update( + __in efx_nic_t *enp, + __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_limits_t *values) +{ + efx_mon_t *emp = &(enp->en_mon); + const efx_mon_ops_t *emop = emp->em_emop; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MON); + + return (emop->emo_limits_update(enp, values)); } #endif /* EFSYS_OPT_MON_STATS */ Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Fri Nov 30 07:04:13 2018 (r341290) +++ head/sys/dev/sfxge/common/mcdi_mon.c Fri Nov 30 07:04:25 2018 (r341291) @@ -361,6 +361,87 @@ fail1: return (rc); } +static __checkReturn efx_rc_t +efx_mcdi_sensor_info_page( + __in efx_nic_t *enp, + __in uint32_t page, + __out uint32_t *mask_part, + __out_ecount((sizeof (*mask_part) * 8) - 1) + efx_mon_stat_limits_t *limits) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_SENSOR_INFO_EXT_IN_LEN, + MC_CMD_SENSOR_INFO_OUT_LENMAX)]; + efx_rc_t rc; + uint32_t mask_copy; + efx_dword_t *maskp; + efx_qword_t *limit_info; + + EFSYS_ASSERT(mask_part != NULL); + EFSYS_ASSERT(limits != NULL); + + memset(limits, 0, + ((sizeof (*mask_part) * 8) - 1) * sizeof (efx_mon_stat_limits_t)); + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_SENSOR_INFO; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_SENSOR_INFO_EXT_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_SENSOR_INFO_OUT_LENMAX; + + MCDI_IN_SET_DWORD(req, SENSOR_INFO_EXT_IN_PAGE, page); + + efx_mcdi_execute(enp, &req); + + rc = req.emr_rc; + + if (rc != 0) + goto fail1; + + EFSYS_ASSERT(sizeof (*limit_info) == + MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_LEN); + maskp = MCDI_OUT2(req, efx_dword_t, SENSOR_INFO_OUT_MASK); + limit_info = (efx_qword_t *)(maskp + 1); + + *mask_part = maskp->ed_u32[0]; + mask_copy = *mask_part; + + /* Copy an entry for all but the highest bit set. */ + while (mask_copy) { + + if (mask_copy == (1U << MC_CMD_SENSOR_PAGE0_NEXT)) { + /* Only next page bit set. */ + mask_copy = 0; + } else { + /* Clear lowest bit */ + mask_copy = mask_copy & ~(mask_copy ^ (mask_copy - 1)); + /* And copy out limit entry into buffer */ + limits->emlv_warning_min = EFX_QWORD_FIELD(*limit_info, + MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1); + + limits->emlv_warning_max = EFX_QWORD_FIELD(*limit_info, + MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1); + + limits->emlv_fatal_min = EFX_QWORD_FIELD(*limit_info, + MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2); + + limits->emlv_fatal_max = EFX_QWORD_FIELD(*limit_info, + MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2); + + limits++; + limit_info++; + } + } + + return (rc); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t mcdi_mon_stats_update( __in efx_nic_t *enp, @@ -382,6 +463,96 @@ mcdi_mon_stats_update( esmp, NULL, values); return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static void +lowest_set_bit( + __in uint32_t input_mask, + __out uint32_t *lowest_bit_mask, + __out uint32_t *lowest_bit_num +) +{ + uint32_t x; + uint32_t set_bit, bit_index; + + x = (input_mask ^ (input_mask - 1)); + set_bit = (x + 1) >> 1; + if (!set_bit) + set_bit = (1U << 31U); + + bit_index = 0; + if (set_bit & 0xFFFF0000) + bit_index += 16; + if (set_bit & 0xFF00FF00) + bit_index += 8; + if (set_bit & 0xF0F0F0F0) + bit_index += 4; + if (set_bit & 0xCCCCCCCC) + bit_index += 2; + if (set_bit & 0xAAAAAAAA) + bit_index += 1; + + *lowest_bit_mask = set_bit; + *lowest_bit_num = bit_index; +} + + __checkReturn efx_rc_t +mcdi_mon_limits_update( + __in efx_nic_t *enp, + __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_limits_t *values) +{ + efx_rc_t rc; + uint32_t page; + uint32_t page_mask; + uint32_t limit_index; + efx_mon_stat_limits_t limits[sizeof (page_mask) * 8]; + efx_mon_stat_t stat; + + page = 0; + page--; + do { + page++; + + rc = efx_mcdi_sensor_info_page(enp, page, &page_mask, limits); + if (rc != 0) + goto fail1; + + limit_index = 0; + while (page_mask) { + uint32_t set_bit; + uint32_t page_index; + uint32_t mcdi_index; + + if (page_mask == (1U << MC_CMD_SENSOR_PAGE0_NEXT)) + break; + + lowest_set_bit(page_mask, &set_bit, &page_index); + page_mask = page_mask & ~set_bit; + + mcdi_index = + page_index + (sizeof (page_mask) * 8 * page); + + /* + * This can fail if MCDI reports newer stats than the + * drivers understand, or the bit is the next page bit. + * + * Driver needs to be tolerant of this. + */ + if (!efx_mon_mcdi_to_efx_stat(mcdi_index, &stat)) + continue; + + values[stat] = limits[limit_index]; + limit_index++; + } + + } while (page_mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)); + + return (rc); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/mcdi_mon.h ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.h Fri Nov 30 07:04:13 2018 (r341290) +++ head/sys/dev/sfxge/common/mcdi_mon.h Fri Nov 30 07:04:25 2018 (r341291) @@ -65,6 +65,11 @@ mcdi_mon_stats_update( __in efsys_mem_t *esmp, __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values); +extern __checkReturn efx_rc_t +mcdi_mon_limits_update( + __in efx_nic_t *enp, + __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_limits_t *values); + #endif /* EFSYS_OPT_MON_STATS */ #endif /* EFSYS_OPT_MON_MCDI */ From owner-svn-src-head@freebsd.org Fri Nov 30 07:04:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 515AE115A300; Fri, 30 Nov 2018 07:04:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3B73701CC; Fri, 30 Nov 2018 07:04:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 431FA251EE; Fri, 30 Nov 2018 07:04:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU74cGO081778; Fri, 30 Nov 2018 07:04:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU74bm4081775; Fri, 30 Nov 2018 07:04:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300704.wAU74bm4081775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341292 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3B73701CC X-Spamd-Result: default: False [0.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.391,0]; NEURAL_SPAM_SHORT(0.02)[0.024,0]; NEURAL_SPAM_MEDIUM(0.42)[0.417,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:04:41 -0000 Author: arybchik Date: Fri Nov 30 07:04:37 2018 New Revision: 341292 URL: https://svnweb.freebsd.org/changeset/base/341292 Log: sfxge(4): add buffer editing functions to boot config Functions to process the DHCP option list format used by the expansion ROM config buffers, to support extracting and updating of individual options. The initial use case is the driver presenting the global and per-PF options as separate items, with the driver implementing the synchronization of global options across the configuration buffers for all PFs. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18254 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_annote.h (contents, props changed) head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:04:25 2018 (r341291) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:04:37 2018 (r341292) @@ -1690,6 +1690,87 @@ efx_bootcfg_write( __in_bcount(size) uint8_t *data, __in size_t size); + +/* + * Processing routines for buffers arranged in the DHCP/BOOTP option format + * (see https://tools.ietf.org/html/rfc1533) + * + * Summarising the format: the buffer is a sequence of options. All options + * begin with a tag octet, which uniquely identifies the option. Fixed- + * length options without data consist of only a tag octet. Only options PAD + * (0) and END (255) are fixed length. All other options are variable-length + * with a length octet following the tag octet. The value of the length + * octet does not include the two octets specifying the tag and length. The + * length octet is followed by "length" octets of data. + * + * Option data may be a sequence of sub-options in the same format. The data + * content of the encapsulating option is one or more encapsulated sub-options, + * with no terminating END tag is required. + * + * To be valid, the top-level sequence of options should be terminated by an + * END tag. The buffer should be padded with the PAD byte. + * + * When stored to NVRAM, the DHCP option format buffer is preceded by a + * checksum octet. The full buffer (including after the END tag) contributes + * to the checksum, hence the need to fill the buffer to the end with PAD. + */ + +#define EFX_DHCP_END ((uint8_t)0xff) +#define EFX_DHCP_PAD ((uint8_t)0) + +#define EFX_DHCP_ENCAP_OPT(encapsulator, encapsulated) \ + (uint16_t)(((encapsulator) << 8) | (encapsulated)) + +extern __checkReturn uint8_t +efx_dhcp_csum( + __in_bcount(size) uint8_t const *data, + __in size_t size); + +extern __checkReturn efx_rc_t +efx_dhcp_verify( + __in_bcount(size) uint8_t const *data, + __in size_t size, + __out_opt size_t *usedp); + +extern __checkReturn efx_rc_t +efx_dhcp_find_tag( + __in_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt, + __deref_out uint8_t **valuepp, + __out size_t *value_lengthp); + +extern __checkReturn efx_rc_t +efx_dhcp_find_end( + __in_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __deref_out uint8_t **endpp); + + +extern __checkReturn efx_rc_t +efx_dhcp_delete_tag( + __inout_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt); + +extern __checkReturn efx_rc_t +efx_dhcp_add_tag( + __inout_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt, + __in_bcount_opt(value_length) uint8_t *valuep, + __in size_t value_length); + +extern __checkReturn efx_rc_t +efx_dhcp_update_tag( + __inout_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt, + __in uint8_t *value_locationp, + __in_bcount_opt(value_length) uint8_t *valuep, + __in size_t value_length); + + #endif /* EFSYS_OPT_BOOTCFG */ #if EFSYS_OPT_IMAGE_LAYOUT Modified: head/sys/dev/sfxge/common/efx_annote.h ============================================================================== --- head/sys/dev/sfxge/common/efx_annote.h Fri Nov 30 07:04:25 2018 (r341291) +++ head/sys/dev/sfxge/common/efx_annote.h Fri Nov 30 07:04:37 2018 (r341292) @@ -67,6 +67,7 @@ #define __out_bcount_part_opt(_n, _l) #define __deref_out +#define __deref_inout #define __inout #define __inout_opt Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Fri Nov 30 07:04:25 2018 (r341291) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Fri Nov 30 07:04:37 2018 (r341292) @@ -48,10 +48,35 @@ __FBSDID("$FreeBSD$"); #define BOOTCFG_PER_PF 0x800 #define BOOTCFG_PF_COUNT 16 -#define DHCP_END ((uint8_t)0xff) -#define DHCP_PAD ((uint8_t)0) +#define DHCP_OPT_HAS_VALUE(opt) \ + (((opt) > EFX_DHCP_PAD) && ((opt) < EFX_DHCP_END)) +#define DHCP_MAX_VALUE 255 +#define DHCP_ENCAPSULATOR(encap_opt) ((encap_opt) >> 8) +#define DHCP_ENCAPSULATED(encap_opt) ((encap_opt) & 0xff) +#define DHCP_IS_ENCAP_OPT(opt) DHCP_OPT_HAS_VALUE(DHCP_ENCAPSULATOR(opt)) + +typedef struct efx_dhcp_tag_hdr_s { + uint8_t tag; + uint8_t length; +} efx_dhcp_tag_hdr_t; + +/* + * Length calculations for tags with value field. PAD and END + * have a fixed length of 1, with no length or value field. + */ +#define DHCP_FULL_TAG_LENGTH(hdr) \ + (sizeof (efx_dhcp_tag_hdr_t) + (hdr)->length) + +#define DHCP_NEXT_TAG(hdr) \ + ((efx_dhcp_tag_hdr_t *)(((uint8_t *)(hdr)) + \ + DHCP_FULL_TAG_LENGTH((hdr)))) + +#define DHCP_CALC_TAG_LENGTH(payload_len) \ + ((payload_len) + sizeof (efx_dhcp_tag_hdr_t)) + + /* Report the layout of bootcfg sectors in NVRAM partition. */ __checkReturn efx_rc_t efx_bootcfg_sector_info( @@ -139,14 +164,11 @@ fail1: } -static __checkReturn uint8_t -efx_bootcfg_csum( - __in efx_nic_t *enp, + __checkReturn uint8_t +efx_dhcp_csum( __in_bcount(size) uint8_t const *data, __in size_t size) { - _NOTE(ARGUNUSED(enp)) - unsigned int pos; uint8_t checksum = 0; @@ -155,9 +177,8 @@ efx_bootcfg_csum( return (checksum); } -static __checkReturn efx_rc_t -efx_bootcfg_verify( - __in efx_nic_t *enp, + __checkReturn efx_rc_t +efx_dhcp_verify( __in_bcount(size) uint8_t const *data, __in size_t size, __out_opt size_t *usedp) @@ -173,12 +194,12 @@ efx_bootcfg_verify( /* Consume tag */ tag = data[offset]; - if (tag == DHCP_END) { + if (tag == EFX_DHCP_END) { offset++; used = offset; break; } - if (tag == DHCP_PAD) { + if (tag == EFX_DHCP_PAD) { offset++; continue; } @@ -200,8 +221,8 @@ efx_bootcfg_verify( used = offset; } - /* Checksum the entire sector, including bytes after any DHCP_END */ - if (efx_bootcfg_csum(enp, data, size) != 0) { + /* Checksum the entire sector, including bytes after any EFX_DHCP_END */ + if (efx_dhcp_csum(data, size) != 0) { rc = EINVAL; goto fail3; } @@ -222,6 +243,516 @@ fail1: } /* + * Walk the entire tag set looking for option. The sought option may be + * encapsulated. ENOENT indicates the walk completed without finding the + * option. If we run out of buffer during the walk the function will return + * ENOSPC. + */ +static efx_rc_t +efx_dhcp_walk_tags( + __deref_inout uint8_t **tagpp, + __inout size_t *buffer_sizep, + __in uint16_t opt) +{ + efx_rc_t rc = 0; + boolean_t is_encap = B_FALSE; + + if (DHCP_IS_ENCAP_OPT(opt)) { + /* + * Look for the encapsulator and, if found, limit ourselves + * to its payload. If it's not found then the entire tag + * cannot be found, so the encapsulated opt search is + * skipped. + */ + rc = efx_dhcp_walk_tags(tagpp, buffer_sizep, + DHCP_ENCAPSULATOR(opt)); + if (rc == 0) { + *buffer_sizep = ((efx_dhcp_tag_hdr_t *)*tagpp)->length; + (*tagpp) += sizeof (efx_dhcp_tag_hdr_t); + } + opt = DHCP_ENCAPSULATED(opt); + is_encap = B_TRUE; + } + + EFSYS_ASSERT(!DHCP_IS_ENCAP_OPT(opt)); + + while (rc == 0) { + size_t size; + + if (*buffer_sizep == 0) { + rc = ENOSPC; + goto fail1; + } + + if (DHCP_ENCAPSULATED(**tagpp) == opt) + break; + + if ((**tagpp) == EFX_DHCP_END) { + rc = ENOENT; + break; + } else if ((**tagpp) == EFX_DHCP_PAD) { + size = 1; + } else { + if (*buffer_sizep < sizeof (efx_dhcp_tag_hdr_t)) { + rc = ENOSPC; + goto fail2; + } + + size = + DHCP_FULL_TAG_LENGTH((efx_dhcp_tag_hdr_t *)*tagpp); + } + + if (size > *buffer_sizep) { + rc = ENOSPC; + goto fail3; + } + + (*tagpp) += size; + (*buffer_sizep) -= size; + + if ((*buffer_sizep == 0) && is_encap) { + /* Search within encapulator tag finished */ + rc = ENOENT; + break; + } + } + + /* + * Returns 0 if found otherwise ENOENT indicating search finished + * correctly + */ + return (rc); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Locate value buffer for option in the given buffer. + * Returns 0 if found, ENOENT indicating search finished + * correctly, otherwise search failed before completion. + */ + __checkReturn efx_rc_t +efx_dhcp_find_tag( + __in_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt, + __deref_out uint8_t **valuepp, + __out size_t *value_lengthp) +{ + efx_rc_t rc; + uint8_t *tagp = bufferp; + size_t len = buffer_length; + + rc = efx_dhcp_walk_tags(&tagp, &len, opt); + if (rc == 0) { + efx_dhcp_tag_hdr_t *hdrp; + + hdrp = (efx_dhcp_tag_hdr_t *)tagp; + *valuepp = (uint8_t *)(&hdrp[1]); + *value_lengthp = hdrp->length; + } else if (rc != ENOENT) { + goto fail1; + } + + return (rc); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Locate the end tag in the given buffer. + * Returns 0 if found, ENOENT indicating search finished + * correctly but end tag was not found; otherwise search + * failed before completion. + */ + __checkReturn efx_rc_t +efx_dhcp_find_end( + __in_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __deref_out uint8_t **endpp) +{ + efx_rc_t rc; + uint8_t *endp = bufferp; + size_t len = buffer_length; + + rc = efx_dhcp_walk_tags(&endp, &len, EFX_DHCP_END); + if (rc == 0) + *endpp = endp; + else if (rc != ENOENT) + goto fail1; + + return (rc); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + +/* + * Delete the given tag from anywhere in the buffer. Copes with + * encapsulated tags, and updates or deletes the encapsulating opt as + * necessary. + */ + __checkReturn efx_rc_t +efx_dhcp_delete_tag( + __inout_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt) +{ + efx_rc_t rc; + efx_dhcp_tag_hdr_t *hdrp; + size_t len; + uint8_t *startp; + uint8_t *endp; + + len = buffer_length; + startp = bufferp; + + if (!DHCP_OPT_HAS_VALUE(DHCP_ENCAPSULATED(opt))) { + rc = EINVAL; + goto fail1; + } + + rc = efx_dhcp_walk_tags(&startp, &len, opt); + if (rc != 0) + goto fail1; + + hdrp = (efx_dhcp_tag_hdr_t *)startp; + + if (DHCP_IS_ENCAP_OPT(opt)) { + uint8_t tag_length = DHCP_FULL_TAG_LENGTH(hdrp); + uint8_t *encapp = bufferp; + efx_dhcp_tag_hdr_t *encap_hdrp; + + len = buffer_length; + rc = efx_dhcp_walk_tags(&encapp, &len, + DHCP_ENCAPSULATOR(opt)); + if (rc != 0) + goto fail2; + + encap_hdrp = (efx_dhcp_tag_hdr_t *)encapp; + if (encap_hdrp->length > tag_length) { + encap_hdrp->length = (uint8_t)( + (size_t)encap_hdrp->length - tag_length); + } else { + /* delete the encapsulating tag */ + hdrp = encap_hdrp; + } + } + + startp = (uint8_t *)hdrp; + endp = (uint8_t *)DHCP_NEXT_TAG(hdrp); + + if (startp < bufferp) { + rc = EINVAL; + goto fail3; + } + + if (endp > &bufferp[buffer_length]) { + rc = EINVAL; + goto fail4; + } + + memmove(startp, endp, + buffer_length - (endp - bufferp)); + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Write the tag header into write_pointp and optionally copies the payload + * into the space following. + */ +static void +efx_dhcp_write_tag( + __in uint8_t *write_pointp, + __in uint16_t opt, + __in_bcount_opt(value_length) + uint8_t *valuep, + __in size_t value_length) +{ + efx_dhcp_tag_hdr_t *hdrp = (efx_dhcp_tag_hdr_t *)write_pointp; + hdrp->tag = DHCP_ENCAPSULATED(opt); + hdrp->length = (uint8_t)value_length; + if ((value_length > 0) && (valuep != NULL)) + memcpy(&hdrp[1], valuep, value_length); +} + +/* + * Add the given tag to the end of the buffer. Copes with creating an + * encapsulated tag, and updates or creates the encapsulating opt as + * necessary. + */ + __checkReturn efx_rc_t +efx_dhcp_add_tag( + __inout_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt, + __in_bcount_opt(value_length) uint8_t *valuep, + __in size_t value_length) +{ + efx_rc_t rc; + efx_dhcp_tag_hdr_t *encap_hdrp = NULL; + uint8_t *insert_pointp = NULL; + uint8_t *endp; + size_t available_space; + size_t added_length; + size_t search_size; + uint8_t *searchp; + + if (!DHCP_OPT_HAS_VALUE(DHCP_ENCAPSULATED(opt))) { + rc = EINVAL; + goto fail1; + } + + if (value_length > DHCP_MAX_VALUE) { + rc = EINVAL; + goto fail2; + } + + if ((value_length > 0) && (valuep == NULL)) { + rc = EINVAL; + goto fail3; + } + + endp = bufferp; + available_space = buffer_length; + rc = efx_dhcp_walk_tags(&endp, &available_space, EFX_DHCP_END); + if (rc != 0) + goto fail4; + + searchp = bufferp; + search_size = buffer_length; + if (DHCP_IS_ENCAP_OPT(opt)) { + rc = efx_dhcp_walk_tags(&searchp, &search_size, + DHCP_ENCAPSULATOR(opt)); + if (rc == 0) { + encap_hdrp = (efx_dhcp_tag_hdr_t *)searchp; + + /* Check encapsulated tag is not present */ + search_size = encap_hdrp->length; + rc = efx_dhcp_walk_tags(&searchp, &search_size, + opt); + if (rc != ENOENT) { + rc = EINVAL; + goto fail5; + } + + /* Check encapsulator will not overflow */ + if (((size_t)encap_hdrp->length + + DHCP_CALC_TAG_LENGTH(value_length)) > + DHCP_MAX_VALUE) { + rc = E2BIG; + goto fail6; + } + + /* Insert at start of existing encapsulator */ + insert_pointp = (uint8_t *)&encap_hdrp[1]; + opt = DHCP_ENCAPSULATED(opt); + } else if (rc == ENOENT) { + encap_hdrp = NULL; + } else { + goto fail7; + } + } else { + /* Check unencapsulated tag is not present */ + rc = efx_dhcp_walk_tags(&searchp, &search_size, + opt); + if (rc != ENOENT) { + rc = EINVAL; + goto fail8; + } + } + + if (insert_pointp == NULL) { + /* Insert at end of existing tags */ + insert_pointp = endp; + } + + /* Includes the new encapsulator tag hdr if required */ + added_length = DHCP_CALC_TAG_LENGTH(value_length) + + (DHCP_IS_ENCAP_OPT(opt) ? sizeof (efx_dhcp_tag_hdr_t) : 0); + + if (available_space <= added_length) { + rc = ENOMEM; + goto fail9; + } + + memmove(insert_pointp + added_length, insert_pointp, + available_space - added_length); + + if (DHCP_IS_ENCAP_OPT(opt)) { + /* Create new encapsulator header */ + added_length -= sizeof (efx_dhcp_tag_hdr_t); + efx_dhcp_write_tag(insert_pointp, + DHCP_ENCAPSULATOR(opt), NULL, added_length); + insert_pointp += sizeof (efx_dhcp_tag_hdr_t); + } else if (encap_hdrp) + /* Modify existing encapsulator header */ + encap_hdrp->length += + ((uint8_t)DHCP_CALC_TAG_LENGTH(value_length)); + + efx_dhcp_write_tag(insert_pointp, opt, valuep, value_length); + + return (0); + +fail9: + EFSYS_PROBE(fail9); +fail8: + EFSYS_PROBE(fail8); +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Update an existing tag to the new value. Copes with encapsulated + * tags, and updates the encapsulating opt as necessary. + */ + __checkReturn efx_rc_t +efx_dhcp_update_tag( + __inout_bcount(buffer_length) uint8_t *bufferp, + __in size_t buffer_length, + __in uint16_t opt, + __in uint8_t *value_locationp, + __in_bcount_opt(value_length) uint8_t *valuep, + __in size_t value_length) +{ + efx_rc_t rc; + uint8_t *write_pointp = value_locationp - sizeof (efx_dhcp_tag_hdr_t); + efx_dhcp_tag_hdr_t *hdrp = (efx_dhcp_tag_hdr_t *)write_pointp; + efx_dhcp_tag_hdr_t *encap_hdrp = NULL; + size_t old_length; + + if (!DHCP_OPT_HAS_VALUE(DHCP_ENCAPSULATED(opt))) { + rc = EINVAL; + goto fail1; + } + + if (value_length > DHCP_MAX_VALUE) { + rc = EINVAL; + goto fail2; + } + + if ((value_length > 0) && (valuep == NULL)) { + rc = EINVAL; + goto fail3; + } + + old_length = hdrp->length; + + if (old_length < value_length) { + uint8_t *endp = bufferp; + size_t available_space = buffer_length; + + rc = efx_dhcp_walk_tags(&endp, &available_space, + EFX_DHCP_END); + if (rc != 0) + goto fail4; + + if (available_space < (value_length - old_length)) { + rc = EINVAL; + goto fail5; + } + } + + if (DHCP_IS_ENCAP_OPT(opt)) { + uint8_t *encapp = bufferp; + size_t following_encap = buffer_length; + size_t new_length; + + rc = efx_dhcp_walk_tags(&encapp, &following_encap, + DHCP_ENCAPSULATOR(opt)); + if (rc != 0) + goto fail6; + + encap_hdrp = (efx_dhcp_tag_hdr_t *)encapp; + + new_length = ((size_t)encap_hdrp->length + + value_length - old_length); + /* Check encapsulator will not overflow */ + if (new_length > DHCP_MAX_VALUE) { + rc = E2BIG; + goto fail7; + } + + encap_hdrp->length = (uint8_t)new_length; + } + + /* + * Move the following data up/down to accommodate the new payload + * length. + */ + if (old_length != value_length) { + uint8_t *destp = (uint8_t *)DHCP_NEXT_TAG(hdrp) + + value_length - old_length; + size_t count = &bufferp[buffer_length] - + (uint8_t *)DHCP_NEXT_TAG(hdrp); + + memmove(destp, DHCP_NEXT_TAG(hdrp), count); + } + + EFSYS_ASSERT(hdrp->tag == DHCP_ENCAPSULATED(opt)); + efx_dhcp_write_tag(write_pointp, opt, valuep, value_length); + + return (0); + +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + +/* * Copy bootcfg sector data to a target buffer which may differ in size. * Optionally corrects format errors in source buffer. */ @@ -235,17 +766,19 @@ efx_bootcfg_copy_sector( __in size_t data_size, __in boolean_t handle_format_errors) { + _NOTE(ARGUNUSED(enp)) + size_t used_bytes; efx_rc_t rc; - /* Minimum buffer is checksum byte and DHCP_END terminator */ + /* Minimum buffer is checksum byte and EFX_DHCP_END terminator */ if (data_size < 2) { rc = ENOSPC; goto fail1; } /* Verify that the area is correctly formatted and checksummed */ - rc = efx_bootcfg_verify(enp, sector, sector_length, + rc = efx_dhcp_verify(sector, sector_length, &used_bytes); if (!handle_format_errors) { @@ -253,8 +786,8 @@ efx_bootcfg_copy_sector( goto fail2; if ((used_bytes < 2) || - (sector[used_bytes - 1] != DHCP_END)) { - /* Block too short, or DHCP_END missing */ + (sector[used_bytes - 1] != EFX_DHCP_END)) { + /* Block too short, or EFX_DHCP_END missing */ rc = ENOENT; goto fail3; } @@ -263,24 +796,24 @@ efx_bootcfg_copy_sector( /* Synthesize empty format on verification failure */ if (rc != 0 || used_bytes == 0) { sector[0] = 0; - sector[1] = DHCP_END; + sector[1] = EFX_DHCP_END; used_bytes = 2; } - EFSYS_ASSERT(used_bytes >= 2); /* checksum and DHCP_END */ + EFSYS_ASSERT(used_bytes >= 2); /* checksum and EFX_DHCP_END */ EFSYS_ASSERT(used_bytes <= sector_length); EFSYS_ASSERT(sector_length >= 2); /* - * Legacy bootcfg sectors don't terminate with a DHCP_END character. - * Modify the returned payload so it does. + * Legacy bootcfg sectors don't terminate with an EFX_DHCP_END + * character. Modify the returned payload so it does. * Reinitialise the sector if there isn't room for the character. */ - if (sector[used_bytes - 1] != DHCP_END) { + if (sector[used_bytes - 1] != EFX_DHCP_END) { if (used_bytes >= sector_length) { sector[0] = 0; used_bytes = 1; } - sector[used_bytes] = DHCP_END; + sector[used_bytes] = EFX_DHCP_END; ++used_bytes; } @@ -303,10 +836,11 @@ efx_bootcfg_copy_sector( (void) memset(data + used_bytes, 0, data_size - used_bytes); /* - * The checksum includes trailing data after any DHCP_END character, - * which we've just modified (by truncation or appending DHCP_END). + * The checksum includes trailing data after any EFX_DHCP_END + * character, which we've just modified (by truncation or appending + * EFX_DHCP_END). */ - data[0] -= efx_bootcfg_csum(enp, data, data_size); + data[0] -= efx_dhcp_csum(data, data_size); return (0); @@ -336,7 +870,7 @@ efx_bootcfg_read( efx_rc_t rc; uint32_t sector_number; - /* Minimum buffer is checksum byte and DHCP_END terminator */ + /* Minimum buffer is checksum byte and EFX_DHCP_END terminator */ if (size < 2) { rc = ENOSPC; goto fail1; @@ -372,10 +906,10 @@ efx_bootcfg_read( } /* - * We need to read the entire BOOTCFG sector to ensure we read all the - * tags, because legacy bootcfg sectors are not guaranteed to end with - * a DHCP_END character. If the user hasn't supplied a sufficiently - * large buffer then use our own buffer. + * We need to read the entire BOOTCFG sector to ensure we read all + * tags, because legacy bootcfg sectors are not guaranteed to end + * with an EFX_DHCP_END character. If the user hasn't supplied a + * sufficiently large buffer then use our own buffer. */ if (sector_length > size) { EFSYS_KMEM_ALLOC(enp->en_esip, sector_length, payload); @@ -399,28 +933,29 @@ efx_bootcfg_read( goto fail9; /* Verify that the area is correctly formatted and checksummed */ - rc = efx_bootcfg_verify(enp, payload, sector_length, + rc = efx_dhcp_verify(payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { payload[0] = 0; - payload[1] = DHCP_END; + payload[1] = EFX_DHCP_END; used_bytes = 2; } - EFSYS_ASSERT(used_bytes >= 2); /* checksum and DHCP_END */ + EFSYS_ASSERT(used_bytes >= 2); /* checksum and EFX_DHCP_END */ EFSYS_ASSERT(used_bytes <= sector_length); /* - * Legacy bootcfg sectors don't terminate with a DHCP_END character. - * Modify the returned payload so it does. BOOTCFG_MAX_SIZE is by - * definition large enough for any valid (per-port) bootcfg sector, - * so reinitialise the sector if there isn't room for the character. + * Legacy bootcfg sectors don't terminate with an EFX_DHCP_END + * character. Modify the returned payload so it does. + * BOOTCFG_MAX_SIZE is by definition large enough for any valid + * (per-port) bootcfg sector, so reinitialise the sector if there + * isn't room for the character. */ - if (payload[used_bytes - 1] != DHCP_END) { + if (payload[used_bytes - 1] != EFX_DHCP_END) { if (used_bytes >= sector_length) used_bytes = 1; - payload[used_bytes] = DHCP_END; + payload[used_bytes] = EFX_DHCP_END; ++used_bytes; } @@ -446,10 +981,10 @@ efx_bootcfg_read( (void) memset(data + used_bytes, 0, size - used_bytes); /* - * The checksum includes trailing data after any DHCP_END character, - * which we've just modified (by truncation or appending DHCP_END). + * The checksum includes trailing data after any EFX_DHCP_END character, + * which we've just modified (by truncation or appending EFX_DHCP_END). */ - data[0] -= efx_bootcfg_csum(enp, data, size); + data[0] -= efx_dhcp_csum(data, size); return (0); @@ -519,12 +1054,16 @@ efx_bootcfg_write( goto fail3; } - if ((rc = efx_bootcfg_verify(enp, data, size, &used_bytes)) != 0) + if ((rc = efx_dhcp_verify(data, size, &used_bytes)) != 0) goto fail4; - /* The caller *must* terminate their block with a DHCP_END character */ - if ((used_bytes < 2) || ((uint8_t)data[used_bytes - 1] != DHCP_END)) { - /* Block too short or DHCP_END missing */ + /* + * The caller *must* terminate their block with a EFX_DHCP_END + * character + */ + if ((used_bytes < 2) || ((uint8_t)data[used_bytes - 1] != + EFX_DHCP_END)) { + /* Block too short or EFX_DHCP_END missing */ rc = ENOENT; goto fail5; } @@ -557,13 +1096,13 @@ efx_bootcfg_write( goto fail9; /* - * Insert the BOOTCFG sector into the partition, Zero out all data after - * the DHCP_END tag, and adjust the checksum. + * Insert the BOOTCFG sector into the partition, Zero out all data + * after the EFX_DHCP_END tag, and adjust the checksum. */ (void) memset(partn_data + sector_offset, 0x0, sector_length); (void) memcpy(partn_data + sector_offset, data, used_bytes); - checksum = efx_bootcfg_csum(enp, data, used_bytes); + checksum = efx_dhcp_csum(data, used_bytes); partn_data[sector_offset] -= checksum; if ((rc = efx_nvram_erase(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) From owner-svn-src-head@freebsd.org Fri Nov 30 07:04:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6092115A340; Fri, 30 Nov 2018 07:04:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C375702CA; Fri, 30 Nov 2018 07:04:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10654251F0; Fri, 30 Nov 2018 07:04:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU74nMp081839; Fri, 30 Nov 2018 07:04:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU74nTO081834; Fri, 30 Nov 2018 07:04:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300704.wAU74nTO081834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341293 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C375702CA X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:04:54 -0000 Author: arybchik Date: Fri Nov 30 07:04:48 2018 New Revision: 341293 URL: https://svnweb.freebsd.org/changeset/base/341293 Log: sfxge(4): add accessor for default port mode Extend efx_mcdi_get_port_modes() to optionally pass on the default port mode field. This provides a more direct way of handling the case where the dynamic config does not specify the port mode than the alternative of a lookup table indexed by MCFW subtype. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18255 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:04:37 2018 (r341292) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:04:48 2018 (r341293) @@ -1154,7 +1154,8 @@ extern __checkReturn efx_rc_t efx_mcdi_get_port_modes( __in efx_nic_t *enp, __out uint32_t *modesp, - __out_opt uint32_t *current_modep); + __out_opt uint32_t *current_modep, + __out_opt uint32_t *default_modep); extern __checkReturn efx_rc_t ef10_nic_get_port_mode_bandwidth( Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:04:37 2018 (r341292) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:04:48 2018 (r341293) @@ -90,7 +90,8 @@ fail1: efx_mcdi_get_port_modes( __in efx_nic_t *enp, __out uint32_t *modesp, - __out_opt uint32_t *current_modep) + __out_opt uint32_t *current_modep, + __out_opt uint32_t *default_modep) { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_PORT_MODES_IN_LEN, @@ -137,6 +138,11 @@ efx_mcdi_get_port_modes( GET_PORT_MODES_OUT_CURRENT_MODE); } + if (default_modep != NULL) { + *default_modep = MCDI_OUT_DWORD(req, + GET_PORT_MODES_OUT_DEFAULT_MODE); + } + return (0); fail3: @@ -1662,13 +1668,14 @@ ef10_external_port_mapping( int32_t count = 1; /* Default 1-1 mapping */ int32_t offset = 1; /* Default starting external port number */ - if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, ¤t)) != 0) { + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, ¤t, + NULL)) != 0) { /* * No current port mode information (i.e. Huntington) * - infer mapping from available modes */ if ((rc = efx_mcdi_get_port_modes(enp, - &port_modes, NULL)) != 0) { + &port_modes, NULL, NULL)) != 0) { /* * No port mode information available * - use default mapping Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 30 07:04:37 2018 (r341292) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 30 07:04:48 2018 (r341293) @@ -57,7 +57,8 @@ hunt_nic_get_required_pcie_bandwidth( * capable mode is in use. */ - if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, NULL)) != 0) { + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, + NULL, NULL)) != 0) { /* No port mode info available */ bandwidth = 0; goto out; Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Fri Nov 30 07:04:37 2018 (r341292) +++ head/sys/dev/sfxge/common/medford2_nic.c Fri Nov 30 07:04:48 2018 (r341293) @@ -52,7 +52,7 @@ medford2_nic_get_required_pcie_bandwidth( /* FIXME: support new Medford2 dynamic port modes */ if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, - ¤t_mode)) != 0) { + ¤t_mode, NULL)) != 0) { /* No port mode info available. */ bandwidth = 0; goto out; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Nov 30 07:04:37 2018 (r341292) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Nov 30 07:04:48 2018 (r341293) @@ -48,7 +48,7 @@ medford_nic_get_required_pcie_bandwidth( efx_rc_t rc; if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, - ¤t_mode)) != 0) { + ¤t_mode, NULL)) != 0) { /* No port mode info available. */ bandwidth = 0; goto out; From owner-svn-src-head@freebsd.org Fri Nov 30 07:05:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44266115A374; Fri, 30 Nov 2018 07:05:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE6617039E; Fri, 30 Nov 2018 07:05:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C524251F1; Fri, 30 Nov 2018 07:05:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU751n0081912; Fri, 30 Nov 2018 07:05:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU751V1081908; Fri, 30 Nov 2018 07:05:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300705.wAU751V1081908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341294 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE6617039E X-Spamd-Result: default: False [0.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.014,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:05:05 -0000 Author: arybchik Date: Fri Nov 30 07:05:00 2018 New Revision: 341294 URL: https://svnweb.freebsd.org/changeset/base/341294 Log: sfxge(4): generalise EF10 NVRAM buffer interface The SFN driver's PartitionControl WMI object requires an API to parse and filter partition data in TLV format, particularly for the Dynamic Config partition. The ef10_nvram_buffer functions provide this functionality but are tied to use with license partition only. Modify functions so they are applicable to all TLV partitions and add functions to support in-place tag modification. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18256 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:04:48 2018 (r341293) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:05:00 2018 (r341294) @@ -503,17 +503,21 @@ ef10_nvram_partn_set_version( extern __checkReturn efx_rc_t ef10_nvram_buffer_validate( - __in efx_nic_t *enp, __in uint32_t partn, __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size); +extern void +ef10_nvram_buffer_init( + __out_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size); + extern __checkReturn efx_rc_t ef10_nvram_buffer_create( - __in efx_nic_t *enp, - __in uint16_t partn_type, - __in_bcount(buffer_size) + __in uint32_t partn_type, + __out_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size); @@ -542,15 +546,26 @@ ef10_nvram_buffer_find_item( __out uint32_t *lengthp); extern __checkReturn efx_rc_t +ef10_nvram_buffer_peek_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *tagp, + __out uint32_t *lengthp, + __out uint32_t *value_offsetp); + +extern __checkReturn efx_rc_t ef10_nvram_buffer_get_item( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, __in uint32_t length, - __out_bcount_part(item_max_size, *lengthp) - caddr_t itemp, - __in size_t item_max_size, + __out uint32_t *tagp, + __out_bcount_part(value_max_size, *lengthp) + caddr_t valuep, + __in size_t value_max_size, __out uint32_t *lengthp); extern __checkReturn efx_rc_t @@ -559,7 +574,19 @@ ef10_nvram_buffer_insert_item( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __in_bcount(length) caddr_t keyp, + __in uint32_t tag, + __in_bcount(length) caddr_t valuep, + __in uint32_t length, + __out uint32_t *lengthp); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_modify_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t tag, + __in_bcount(length) caddr_t valuep, __in uint32_t length, __out uint32_t *lengthp); Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 30 07:04:48 2018 (r341293) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 30 07:05:00 2018 (r341294) @@ -230,14 +230,14 @@ tlv_validate_state( if (tlv_tag(cursor) != TLV_TAG_END) { /* Check current item has space for tag and length */ - if (cursor->current > (cursor->limit - 2)) { + if (cursor->current > (cursor->limit - 1)) { cursor->current = NULL; rc = EFAULT; goto fail3; } - /* Check we have value data for current item and another tag */ - if (tlv_next_item_ptr(cursor) > (cursor->limit - 1)) { + /* Check we have value data for current item and an END tag */ + if (tlv_next_item_ptr(cursor) > cursor->limit) { cursor->current = NULL; rc = EFAULT; goto fail4; @@ -662,7 +662,6 @@ fail1: /* Validate buffer contents (before writing to flash) */ __checkReturn efx_rc_t ef10_nvram_buffer_validate( - __in efx_nic_t *enp, __in uint32_t partn, __in_bcount(partn_size) caddr_t partn_data, __in size_t partn_size) @@ -675,7 +674,6 @@ ef10_nvram_buffer_validate( int pos; efx_rc_t rc; - _NOTE(ARGUNUSED(enp, partn)) EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK); if ((partn_data == NULL) || (partn_size == 0)) { @@ -702,26 +700,32 @@ ef10_nvram_buffer_validate( goto fail4; } + /* Check partition header matches partn */ + if (__LE_TO_CPU_16(header->type_id) != partn) { + rc = EINVAL; + goto fail5; + } + /* Check partition ends with PARTITION_TRAILER and END tags */ if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) { rc = EINVAL; - goto fail5; + goto fail6; } trailer = (struct tlv_partition_trailer *)tlv_item(&cursor); if ((rc = tlv_advance(&cursor)) != 0) { rc = EINVAL; - goto fail6; + goto fail7; } if (tlv_tag(&cursor) != TLV_TAG_END) { rc = EINVAL; - goto fail7; + goto fail8; } /* Check generation counts are consistent */ if (trailer->generation != header->generation) { rc = EINVAL; - goto fail8; + goto fail9; } /* Verify partition checksum */ @@ -731,11 +735,13 @@ ef10_nvram_buffer_validate( } if (cksum != 0) { rc = EINVAL; - goto fail9; + goto fail10; } return (0); +fail10: + EFSYS_PROBE(fail10); fail9: EFSYS_PROBE(fail9); fail8: @@ -758,13 +764,24 @@ fail1: return (rc); } + void +ef10_nvram_buffer_init( + __out_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size) +{ + uint32_t *buf = (uint32_t *)bufferp; + memset(buf, 0xff, buffer_size); + tlv_init_block(buf); +} + __checkReturn efx_rc_t ef10_nvram_buffer_create( - __in efx_nic_t *enp, - __in uint16_t partn_type, - __in_bcount(partn_size) caddr_t partn_data, + __in uint32_t partn_type, + __out_bcount(partn_size) + caddr_t partn_data, __in size_t partn_size) { uint32_t *buf = (uint32_t *)partn_data; @@ -780,9 +797,8 @@ ef10_nvram_buffer_create( goto fail1; } - memset(buf, 0xff, partn_size); + ef10_nvram_buffer_init(partn_data, partn_size); - tlv_init_block(buf); if ((rc = tlv_init_cursor(&cursor, buf, (uint32_t *)((uint8_t *)buf + partn_size), buf)) != 0) { @@ -814,7 +830,7 @@ ef10_nvram_buffer_create( goto fail6; /* Check that the partition is valid. */ - if ((rc = ef10_nvram_buffer_validate(enp, partn_type, + if ((rc = ef10_nvram_buffer_validate(partn_type, partn_data, partn_size)) != 0) goto fail7; @@ -986,22 +1002,65 @@ ef10_nvram_buffer_find_item( } __checkReturn efx_rc_t +ef10_nvram_buffer_peek_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *tagp, + __out uint32_t *lengthp, + __out uint32_t *value_offsetp) +{ + efx_rc_t rc; + tlv_cursor_t cursor; + uint32_t tag; + + if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, + buffer_size, offset)) != 0) { + goto fail1; + } + + tag = tlv_tag(&cursor); + *tagp = tag; + if (tag == TLV_TAG_END) { + /* + * To allow stepping over the END tag, report the full tag + * length and a zero length value. + */ + *lengthp = sizeof (tag); + *value_offsetp = sizeof (tag); + } else { + *lengthp = byte_offset(tlv_next_item_ptr(&cursor), + cursor.current); + *value_offsetp = byte_offset((uint32_t *)tlv_value(&cursor), + cursor.current); + } + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t ef10_nvram_buffer_get_item( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, __in uint32_t length, - __out_bcount_part(item_max_size, *lengthp) - caddr_t itemp, - __in size_t item_max_size, + __out uint32_t *tagp, + __out_bcount_part(value_max_size, *lengthp) + caddr_t valuep, + __in size_t value_max_size, __out uint32_t *lengthp) { efx_rc_t rc; tlv_cursor_t cursor; - uint32_t item_length; + uint32_t value_length; - if (item_max_size < length) { + if (buffer_size < (offset + length)) { rc = ENOSPC; goto fail1; } @@ -1011,14 +1070,15 @@ ef10_nvram_buffer_get_item( goto fail2; } - item_length = tlv_length(&cursor); - if (length < item_length) { + value_length = tlv_length(&cursor); + if (value_max_size < value_length) { rc = ENOSPC; goto fail3; } - memcpy(itemp, tlv_value(&cursor), item_length); + memcpy(valuep, tlv_value(&cursor), value_length); - *lengthp = item_length; + *tagp = tlv_tag(&cursor); + *lengthp = value_length; return (0); @@ -1038,7 +1098,8 @@ ef10_nvram_buffer_insert_item( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __in_bcount(length) caddr_t keyp, + __in uint32_t tag, + __in_bcount(length) caddr_t valuep, __in uint32_t length, __out uint32_t *lengthp) { @@ -1050,8 +1111,45 @@ ef10_nvram_buffer_insert_item( goto fail1; } - rc = tlv_insert(&cursor, TLV_TAG_LICENSE, (uint8_t *)keyp, length); + rc = tlv_insert(&cursor, tag, (uint8_t *)valuep, length); + if (rc != 0) + goto fail2; + + *lengthp = byte_offset(tlv_next_item_ptr(&cursor), + cursor.current); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_nvram_buffer_modify_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t tag, + __in_bcount(length) caddr_t valuep, + __in uint32_t length, + __out uint32_t *lengthp) +{ + efx_rc_t rc; + tlv_cursor_t cursor; + + if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, + buffer_size, offset)) != 0) { + goto fail1; + } + + rc = tlv_modify(&cursor, tag, (uint8_t *)valuep, length); + if (rc != 0) { goto fail2; } @@ -1068,6 +1166,7 @@ fail1: return (rc); } + __checkReturn efx_rc_t ef10_nvram_buffer_delete_item( Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:04:48 2018 (r341293) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:05:00 2018 (r341294) @@ -537,7 +537,7 @@ typedef struct efx_nvram_ops_s { uint32_t *, uint16_t *); efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t, uint16_t *); - efx_rc_t (*envo_buffer_validate)(efx_nic_t *, uint32_t, + efx_rc_t (*envo_buffer_validate)(uint32_t, caddr_t, size_t); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Fri Nov 30 07:04:48 2018 (r341293) +++ head/sys/dev/sfxge/common/efx_lic.c Fri Nov 30 07:05:00 2018 (r341294) @@ -1185,10 +1185,12 @@ efx_lic_v3_read_key( __in size_t key_max_size, __out uint32_t *lengthp) { + uint32_t tag; + _NOTE(ARGUNUSED(enp)) return ef10_nvram_buffer_get_item(bufferp, buffer_size, - offset, length, keyp, key_max_size, lengthp); + offset, length, &tag, keyp, key_max_size, lengthp); } __checkReturn efx_rc_t @@ -1206,7 +1208,7 @@ efx_lic_v3_write_key( EFSYS_ASSERT(length <= EFX_LICENSE_V3_KEY_LENGTH_MAX); return ef10_nvram_buffer_insert_item(bufferp, buffer_size, - offset, keyp, length, lengthp); + offset, TLV_TAG_LICENSE, keyp, length, lengthp); } __checkReturn efx_rc_t @@ -1248,8 +1250,10 @@ efx_lic_v3_create_partition( { efx_rc_t rc; + _NOTE(ARGUNUSED(enp)) + /* Construct empty partition */ - if ((rc = ef10_nvram_buffer_create(enp, + if ((rc = ef10_nvram_buffer_create( NVRAM_PARTITION_TYPE_LICENSE, bufferp, buffer_size)) != 0) { rc = EFAULT; @@ -1273,13 +1277,16 @@ efx_lic_v3_finish_partition( { efx_rc_t rc; + _NOTE(ARGUNUSED(enp)) + if ((rc = ef10_nvram_buffer_finish(bufferp, buffer_size)) != 0) { goto fail1; } /* Validate completed partition */ - if ((rc = ef10_nvram_buffer_validate(enp, NVRAM_PARTITION_TYPE_LICENSE, + if ((rc = ef10_nvram_buffer_validate( + NVRAM_PARTITION_TYPE_LICENSE, bufferp, buffer_size)) != 0) { goto fail2; } Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 30 07:04:48 2018 (r341293) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 30 07:05:00 2018 (r341294) @@ -497,7 +497,7 @@ efx_nvram_validate( goto fail1; if (envop->envo_buffer_validate != NULL) { - if ((rc = envop->envo_buffer_validate(enp, partn, + if ((rc = envop->envo_buffer_validate(partn, partn_data, partn_size)) != 0) goto fail2; } From owner-svn-src-head@freebsd.org Fri Nov 30 07:05:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51055115A3C3; Fri, 30 Nov 2018 07:05:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5EE07049E; Fri, 30 Nov 2018 07:05:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CDAE251F2; Fri, 30 Nov 2018 07:05:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU75D1T081970; Fri, 30 Nov 2018 07:05:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU75CtS081968; Fri, 30 Nov 2018 07:05:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300705.wAU75CtS081968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341295 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5EE07049E X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:05:15 -0000 Author: arybchik Date: Fri Nov 30 07:05:12 2018 New Revision: 341295 URL: https://svnweb.freebsd.org/changeset/base/341295 Log: sfxge(4): avoid usage of too big arrays on stack Found by PreFAST static analysis. Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18257 Modified: head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:05:00 2018 (r341294) +++ head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:05:12 2018 (r341295) @@ -610,14 +610,26 @@ ef10_bist_poll( unsigned long *valuesp, __in size_t count) { + /* + * MCDI_CTL_SDU_LEN_MAX_V1 is large enough cover all BIST results, + * whilst not wasting stack. + */ + uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, MCDI_CTL_SDU_LEN_MAX_V1)]; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, - MCDI_CTL_SDU_LEN_MAX)]; uint32_t value_mask = 0; uint32_t result; efx_rc_t rc; + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_SFT9001_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MRSFP_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MEM_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + _NOTE(ARGUNUSED(type)) (void) memset(payload, 0, sizeof (payload)); @@ -625,7 +637,7 @@ ef10_bist_poll( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; + req.emr_out_length = MCDI_CTL_SDU_LEN_MAX_V1; efx_mcdi_execute(enp, &req); Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 30 07:05:00 2018 (r341294) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 30 07:05:12 2018 (r341295) @@ -898,23 +898,27 @@ efx_mcdi_nvram_write( __in size_t size) { efx_mcdi_req_t req; - uint8_t payload[MAX(MCDI_CTL_SDU_LEN_MAX_V1, - MCDI_CTL_SDU_LEN_MAX_V2)]; + uint8_t *payload; efx_rc_t rc; size_t max_data_size; + size_t payload_len = enp->en_nic_cfg.enc_mcdi_max_payload_length; - max_data_size = enp->en_nic_cfg.enc_mcdi_max_payload_length - - MC_CMD_NVRAM_WRITE_IN_LEN(0); - EFSYS_ASSERT3U(enp->en_nic_cfg.enc_mcdi_max_payload_length, >, 0); - EFSYS_ASSERT3U(max_data_size, <, - enp->en_nic_cfg.enc_mcdi_max_payload_length); + max_data_size = payload_len - MC_CMD_NVRAM_WRITE_IN_LEN(0); + EFSYS_ASSERT3U(payload_len, >, 0); + EFSYS_ASSERT3U(max_data_size, <, payload_len); if (size > max_data_size) { rc = EINVAL; goto fail1; } - (void) memset(payload, 0, sizeof (payload)); + EFSYS_KMEM_ALLOC(enp->en_esip, payload_len, payload); + if (payload == NULL) { + rc = ENOMEM; + goto fail2; + } + + (void) memset(payload, 0, payload_len); req.emr_cmd = MC_CMD_NVRAM_WRITE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_NVRAM_WRITE_IN_LEN(size); @@ -932,11 +936,16 @@ efx_mcdi_nvram_write( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } + EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload); + return (0); +fail3: + EFSYS_PROBE(fail3); + EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-head@freebsd.org Fri Nov 30 07:05:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC581115A3FC; Fri, 30 Nov 2018 07:05:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B1E705F5; Fri, 30 Nov 2018 07:05:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB33D251F3; Fri, 30 Nov 2018 07:05:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU75OAq082030; Fri, 30 Nov 2018 07:05:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU75OGh082026; Fri, 30 Nov 2018 07:05:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300705.wAU75OGh082026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341296 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73B1E705F5 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:05:29 -0000 Author: arybchik Date: Fri Nov 30 07:05:23 2018 New Revision: 341296 URL: https://svnweb.freebsd.org/changeset/base/341296 Log: sfxge(4): add information if TSO workaround is required In SF bug 61297 it's been confirmed that the hardware does not always calculate the TCP checksum correctly with TSO sends. The value of the Total Length field (IPv4) or Payload Length field (IPv6) is the critical factor. We're sufficiently confident that if these fields are zero then the checksum will be calculated correctly. The information may be used by the drivers to check if the workaround is required when FATSOv2 is implemented. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18258 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:05:12 2018 (r341295) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:05:23 2018 (r341296) @@ -1320,6 +1320,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_bug35388_workaround; boolean_t enc_bug41750_workaround; boolean_t enc_bug61265_workaround; + boolean_t enc_bug61297_workaround; boolean_t enc_rx_batching_enabled; /* Maximum number of descriptors completed in an rx event. */ uint32_t enc_rx_batch_max; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 30 07:05:12 2018 (r341295) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 30 07:05:23 2018 (r341296) @@ -217,6 +217,9 @@ hunt_board_cfg( encp->enc_bug61265_workaround = B_FALSE; /* Medford only */ + /* Checksums for TSO sends can be incorrect on Huntington. */ + encp->enc_bug61297_workaround = B_TRUE; + /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */ Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Fri Nov 30 07:05:12 2018 (r341295) +++ head/sys/dev/sfxge/common/medford2_nic.c Fri Nov 30 07:05:23 2018 (r341296) @@ -125,6 +125,9 @@ medford2_board_cfg( else goto fail1; + /* Checksums for TSO sends should always be correct on Medford2. */ + encp->enc_bug61297_workaround = B_FALSE; + /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) goto fail2; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Nov 30 07:05:12 2018 (r341295) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Nov 30 07:05:23 2018 (r341296) @@ -121,6 +121,9 @@ medford_board_cfg( else goto fail1; + /* Checksums for TSO sends can be incorrect on Medford. */ + encp->enc_bug61297_workaround = B_TRUE; + /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) goto fail2; From owner-svn-src-head@freebsd.org Fri Nov 30 07:05:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49BBE115A44A; Fri, 30 Nov 2018 07:05:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC7EC706B7; Fri, 30 Nov 2018 07:05:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98826251F4; Fri, 30 Nov 2018 07:05:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU75ckm082097; Fri, 30 Nov 2018 07:05:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU75abO082087; Fri, 30 Nov 2018 07:05:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300705.wAU75abO082087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341297 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC7EC706B7 X-Spamd-Result: default: False [0.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.418,0]; NEURAL_SPAM_MEDIUM(0.47)[0.467,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.03)[0.032,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:05:39 -0000 Author: arybchik Date: Fri Nov 30 07:05:36 2018 New Revision: 341297 URL: https://svnweb.freebsd.org/changeset/base/341297 Log: sfxge(4): fix out of bounds read when dereferencing sdup Introduce and use macro to make sure that MCDI buffers allocated on stack are rounded up properly. Submitted by: Gautam Dawar Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18259 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_intr.c head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/efx_tunnel.c head/sys/dev/sfxge/common/mcdi_mon.c head/sys/dev/sfxge/common/siena_mac.c head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_phy.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 30 07:05:36 2018 (r341297) @@ -100,11 +100,10 @@ efx_mcdi_set_evq_tmr( __in uint32_t timer_ns) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_EVQ_TMR_IN_LEN, - MC_CMD_SET_EVQ_TMR_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_EVQ_TMR_IN_LEN, + MC_CMD_SET_EVQ_TMR_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_EVQ_TMR; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_EVQ_TMR_IN_LEN; @@ -150,9 +149,9 @@ efx_mcdi_init_evq( __in boolean_t low_latency) { efx_mcdi_req_t req; - uint8_t payload[ - MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), - MC_CMD_INIT_EVQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, + MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), + MC_CMD_INIT_EVQ_OUT_LEN); efx_qword_t *dma_addr; uint64_t addr; int npages; @@ -167,7 +166,6 @@ efx_mcdi_init_evq( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_EVQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_EVQ_IN_LEN(npages); @@ -287,9 +285,9 @@ efx_mcdi_init_evq_v2( __in uint32_t flags) { efx_mcdi_req_t req; - uint8_t payload[ - MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), - MC_CMD_INIT_EVQ_V2_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, + MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), + MC_CMD_INIT_EVQ_V2_OUT_LEN); boolean_t interrupting; unsigned int evq_type; efx_qword_t *dma_addr; @@ -304,7 +302,6 @@ efx_mcdi_init_evq_v2( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_EVQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_EVQ_V2_IN_LEN(npages); @@ -411,11 +408,10 @@ efx_mcdi_fini_evq( __in uint32_t instance) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FINI_EVQ_IN_LEN, - MC_CMD_FINI_EVQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_EVQ_IN_LEN, + MC_CMD_FINI_EVQ_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FINI_EVQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FINI_EVQ_IN_LEN; @@ -630,8 +626,8 @@ efx_mcdi_driver_event( __in efx_qword_t data) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_DRIVER_EVENT_IN_LEN, - MC_CMD_DRIVER_EVENT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_DRIVER_EVENT_IN_LEN, + MC_CMD_DRIVER_EVENT_OUT_LEN); efx_rc_t rc; req.emr_cmd = MC_CMD_DRIVER_EVENT; Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 30 07:05:36 2018 (r341297) @@ -199,12 +199,11 @@ efx_mcdi_filter_op_add( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_V3_IN_LEN, - MC_CMD_FILTER_OP_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FILTER_OP_V3_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN); efx_filter_match_flags_t match_flags; efx_rc_t rc; - memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FILTER_OP_V3_IN_LEN; @@ -403,11 +402,10 @@ efx_mcdi_filter_op_delete( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, - MC_CMD_FILTER_OP_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN); efx_rc_t rc; - memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; @@ -977,13 +975,12 @@ efx_mcdi_get_parser_disp_info( __out size_t *list_lengthp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PARSER_DISP_INFO_IN_LEN, - MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PARSER_DISP_INFO_IN_LEN, + MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX); size_t matches_count; size_t list_size; efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PARSER_DISP_INFO; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PARSER_DISP_INFO_IN_LEN; Modified: head/sys/dev/sfxge/common/ef10_intr.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_intr.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_intr.c Fri Nov 30 07:05:36 2018 (r341297) @@ -78,8 +78,8 @@ efx_mcdi_trigger_interrupt( __in unsigned int level) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_TRIGGER_INTERRUPT_IN_LEN, - MC_CMD_TRIGGER_INTERRUPT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_TRIGGER_INTERRUPT_IN_LEN, + MC_CMD_TRIGGER_INTERRUPT_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || @@ -91,7 +91,6 @@ efx_mcdi_trigger_interrupt( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_TRIGGER_INTERRUPT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_TRIGGER_INTERRUPT_IN_LEN; Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_mac.c Fri Nov 30 07:05:36 2018 (r341297) @@ -102,11 +102,10 @@ efx_mcdi_vadapter_set_mac( { efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_SET_MAC_IN_LEN, - MC_CMD_VADAPTOR_SET_MAC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VADAPTOR_SET_MAC_IN_LEN, + MC_CMD_VADAPTOR_SET_MAC_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VADAPTOR_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VADAPTOR_SET_MAC_IN_LEN; @@ -168,11 +167,10 @@ efx_mcdi_mtu_set( __in uint32_t mtu) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_MAC_EXT_IN_LEN, - MC_CMD_SET_MAC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_MAC_EXT_IN_LEN, + MC_CMD_SET_MAC_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_MAC_EXT_IN_LEN; @@ -205,11 +203,10 @@ efx_mcdi_mtu_get( __out size_t *mtu) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_MAC_EXT_IN_LEN, - MC_CMD_SET_MAC_V2_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_MAC_EXT_IN_LEN, + MC_CMD_SET_MAC_V2_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_MAC_EXT_IN_LEN; @@ -301,11 +298,10 @@ ef10_mac_reconfigure( { efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_MAC_IN_LEN, - MC_CMD_SET_MAC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_MAC_IN_LEN, + MC_CMD_SET_MAC_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_MAC_IN_LEN; Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:05:36 2018 (r341297) @@ -47,15 +47,14 @@ efx_mcdi_get_port_assignment( __out uint32_t *portp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN, - MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN, + MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD || enp->en_family == EFX_FAMILY_MEDFORD2); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_ASSIGNMENT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN; @@ -94,15 +93,14 @@ efx_mcdi_get_port_modes( __out_opt uint32_t *default_modep) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PORT_MODES_IN_LEN, - MC_CMD_GET_PORT_MODES_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PORT_MODES_IN_LEN, + MC_CMD_GET_PORT_MODES_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD || enp->en_family == EFX_FAMILY_MEDFORD2); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_MODES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PORT_MODES_IN_LEN; @@ -207,13 +205,12 @@ efx_mcdi_vadaptor_alloc( __in uint32_t port_id) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_ALLOC_IN_LEN, - MC_CMD_VADAPTOR_ALLOC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VADAPTOR_ALLOC_IN_LEN, + MC_CMD_VADAPTOR_ALLOC_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT3U(enp->en_vport_id, ==, EVB_PORT_ID_NULL); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VADAPTOR_ALLOC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VADAPTOR_ALLOC_IN_LEN; @@ -246,11 +243,10 @@ efx_mcdi_vadaptor_free( __in uint32_t port_id) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_FREE_IN_LEN, - MC_CMD_VADAPTOR_FREE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VADAPTOR_FREE_IN_LEN, + MC_CMD_VADAPTOR_FREE_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VADAPTOR_FREE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VADAPTOR_FREE_IN_LEN; @@ -280,15 +276,14 @@ efx_mcdi_get_mac_address_pf( __out_ecount_opt(6) uint8_t mac_addrp[6]) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_MAC_ADDRESSES_IN_LEN, - MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_MAC_ADDRESSES_IN_LEN, + MC_CMD_GET_MAC_ADDRESSES_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD || enp->en_family == EFX_FAMILY_MEDFORD2); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_MAC_ADDRESSES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_MAC_ADDRESSES_IN_LEN; @@ -339,15 +334,14 @@ efx_mcdi_get_mac_address_vf( __out_ecount_opt(6) uint8_t mac_addrp[6]) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN, - MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN, + MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD || enp->en_family == EFX_FAMILY_MEDFORD2); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VPORT_GET_MAC_ADDRESSES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN; @@ -404,15 +398,14 @@ efx_mcdi_get_clock( __out uint32_t *dpcpu_freqp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CLOCK_IN_LEN, - MC_CMD_GET_CLOCK_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_CLOCK_IN_LEN, + MC_CMD_GET_CLOCK_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD || enp->en_family == EFX_FAMILY_MEDFORD2); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_CLOCK; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CLOCK_IN_LEN; @@ -462,12 +455,11 @@ efx_mcdi_get_rxdp_config( __out uint32_t *end_paddingp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN, - MC_CMD_GET_RXDP_CONFIG_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_RXDP_CONFIG_IN_LEN, + MC_CMD_GET_RXDP_CONFIG_OUT_LEN); uint32_t end_padding; efx_rc_t rc; - memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_RXDP_CONFIG; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN; @@ -522,11 +514,10 @@ efx_mcdi_get_vector_cfg( __out_opt uint32_t *vf_nvecp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_VECTOR_CFG_IN_LEN, - MC_CMD_GET_VECTOR_CFG_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_VECTOR_CFG_IN_LEN, + MC_CMD_GET_VECTOR_CFG_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_VECTOR_CFG; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_VECTOR_CFG_IN_LEN; @@ -572,8 +563,8 @@ efx_mcdi_alloc_vis( __out uint32_t *vi_shiftp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN, - MC_CMD_ALLOC_VIS_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_ALLOC_VIS_IN_LEN, + MC_CMD_ALLOC_VIS_EXT_OUT_LEN); efx_rc_t rc; if (vi_countp == NULL) { @@ -581,7 +572,6 @@ efx_mcdi_alloc_vis( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_ALLOC_VIS; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN; @@ -664,8 +654,8 @@ efx_mcdi_alloc_piobuf( __out efx_piobuf_handle_t *handlep) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ALLOC_PIOBUF_IN_LEN, - MC_CMD_ALLOC_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_ALLOC_PIOBUF_IN_LEN, + MC_CMD_ALLOC_PIOBUF_OUT_LEN); efx_rc_t rc; if (handlep == NULL) { @@ -673,7 +663,6 @@ efx_mcdi_alloc_piobuf( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_ALLOC_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ALLOC_PIOBUF_IN_LEN; @@ -712,11 +701,10 @@ efx_mcdi_free_piobuf( __in efx_piobuf_handle_t handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FREE_PIOBUF_IN_LEN, - MC_CMD_FREE_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FREE_PIOBUF_IN_LEN, + MC_CMD_FREE_PIOBUF_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FREE_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FREE_PIOBUF_IN_LEN; @@ -747,11 +735,10 @@ efx_mcdi_link_piobuf( __in efx_piobuf_handle_t handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LINK_PIOBUF_IN_LEN, - MC_CMD_LINK_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LINK_PIOBUF_IN_LEN, + MC_CMD_LINK_PIOBUF_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LINK_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LINK_PIOBUF_IN_LEN; @@ -782,11 +769,10 @@ efx_mcdi_unlink_piobuf( __in uint32_t vi_index) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_UNLINK_PIOBUF_IN_LEN, - MC_CMD_UNLINK_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_UNLINK_PIOBUF_IN_LEN, + MC_CMD_UNLINK_PIOBUF_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_UNLINK_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_UNLINK_PIOBUF_IN_LEN; @@ -984,11 +970,10 @@ ef10_mcdi_get_pf_count( __out uint32_t *pf_countp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PF_COUNT_IN_LEN, - MC_CMD_GET_PF_COUNT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PF_COUNT_IN_LEN, + MC_CMD_GET_PF_COUNT_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PF_COUNT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PF_COUNT_IN_LEN; @@ -1028,15 +1013,14 @@ ef10_get_datapath_caps( { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V5_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_CAPABILITIES_IN_LEN, + MC_CMD_GET_CAPABILITIES_V5_OUT_LEN); efx_rc_t rc; if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) goto fail1; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_CAPABILITIES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; @@ -2073,8 +2057,8 @@ ef10_nic_reset( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ENTITY_RESET_IN_LEN, - MC_CMD_ENTITY_RESET_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_ENTITY_RESET_IN_LEN, + MC_CMD_ENTITY_RESET_OUT_LEN); efx_rc_t rc; /* ef10_nic_reset() is called to recover from BADASSERT failures. */ @@ -2083,7 +2067,6 @@ ef10_nic_reset( if ((rc = efx_mcdi_exit_assertion_handler(enp)) != 0) goto fail2; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_ENTITY_RESET; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ENTITY_RESET_IN_LEN; @@ -2420,11 +2403,10 @@ efx_mcdi_get_nic_global( __out uint32_t *valuep) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_NIC_GLOBAL_IN_LEN, - MC_CMD_GET_NIC_GLOBAL_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_NIC_GLOBAL_IN_LEN, + MC_CMD_GET_NIC_GLOBAL_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_NIC_GLOBAL; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_NIC_GLOBAL_IN_LEN; @@ -2464,10 +2446,9 @@ efx_mcdi_set_nic_global( __in uint32_t value) { efx_mcdi_req_t req; - uint8_t payload[MC_CMD_SET_NIC_GLOBAL_IN_LEN]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_NIC_GLOBAL_IN_LEN, 0); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_NIC_GLOBAL; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_NIC_GLOBAL_IN_LEN; Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:05:36 2018 (r341297) @@ -269,11 +269,10 @@ ef10_phy_get_link( __out ef10_link_state_t *elsp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN, - MC_CMD_GET_LINK_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_LINK_IN_LEN, + MC_CMD_GET_LINK_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_LINK; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LINK_IN_LEN; @@ -328,8 +327,8 @@ ef10_phy_reconfigure( { efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, - MC_CMD_SET_LINK_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_LINK_IN_LEN, + MC_CMD_SET_LINK_OUT_LEN); uint32_t cap_mask; #if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; @@ -343,7 +342,6 @@ ef10_phy_reconfigure( if (supported == B_FALSE) goto out; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_LINK; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_LINK_IN_LEN; @@ -491,12 +489,11 @@ ef10_phy_verify( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN, - MC_CMD_GET_PHY_STATE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PHY_STATE_IN_LEN, + MC_CMD_GET_PHY_STATE_OUT_LEN); uint32_t state; efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PHY_STATE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PHY_STATE_IN_LEN; @@ -614,7 +611,8 @@ ef10_bist_poll( * MCDI_CTL_SDU_LEN_MAX_V1 is large enough cover all BIST results, * whilst not wasting stack. */ - uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, MCDI_CTL_SDU_LEN_MAX_V1)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_POLL_BIST_IN_LEN, + MCDI_CTL_SDU_LEN_MAX_V1); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint32_t value_mask = 0; @@ -632,7 +630,6 @@ ef10_bist_poll( _NOTE(ARGUNUSED(type)) - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_POLL_BIST; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:05:36 2018 (r341297) @@ -56,8 +56,8 @@ efx_mcdi_init_rxq( { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_INIT_RXQ_V3_IN_LEN, - MC_CMD_INIT_RXQ_V3_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_INIT_RXQ_V3_IN_LEN, + MC_CMD_INIT_RXQ_V3_OUT_LEN); int npages = EFX_RXQ_NBUFS(ndescs); int i; efx_qword_t *dma_addr; @@ -100,7 +100,6 @@ efx_mcdi_init_rxq( want_outer_classes = B_FALSE; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_RXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_RXQ_V3_IN_LEN; @@ -173,11 +172,10 @@ efx_mcdi_fini_rxq( __in uint32_t instance) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FINI_RXQ_IN_LEN, - MC_CMD_FINI_RXQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_RXQ_IN_LEN, + MC_CMD_FINI_RXQ_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FINI_RXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FINI_RXQ_IN_LEN; @@ -215,8 +213,8 @@ efx_mcdi_rss_context_alloc( __out uint32_t *rss_contextp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN, - MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN, + MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN); uint32_t rss_context; uint32_t context_type; efx_rc_t rc; @@ -238,7 +236,6 @@ efx_mcdi_rss_context_alloc( goto fail2; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_ALLOC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN; @@ -301,8 +298,8 @@ efx_mcdi_rss_context_free( __in uint32_t rss_context) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_FREE_IN_LEN, - MC_CMD_RSS_CONTEXT_FREE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_FREE_IN_LEN, + MC_CMD_RSS_CONTEXT_FREE_OUT_LEN); efx_rc_t rc; if (rss_context == EF10_RSS_CONTEXT_INVALID) { @@ -310,7 +307,6 @@ efx_mcdi_rss_context_free( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_FREE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_FREE_IN_LEN; @@ -351,8 +347,8 @@ efx_mcdi_rss_context_set_flags( efx_rx_hash_type_t type_ipv6_tcp; efx_rx_hash_type_t modes; efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN, - MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN, + MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN); efx_rc_t rc; EFX_STATIC_ASSERT(EFX_RX_CLASS_IPV4_TCP_LBN == @@ -377,7 +373,6 @@ efx_mcdi_rss_context_set_flags( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_FLAGS; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN; @@ -466,8 +461,8 @@ efx_mcdi_rss_context_set_key( __in size_t n) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN, - MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN, + MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN); efx_rc_t rc; if (rss_context == EF10_RSS_CONTEXT_INVALID) { @@ -475,7 +470,6 @@ efx_mcdi_rss_context_set_key( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_KEY; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN; @@ -523,8 +517,8 @@ efx_mcdi_rss_context_set_table( __in size_t n) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN, - MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN, + MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN); uint8_t *req_table; int i, rc; @@ -533,7 +527,6 @@ efx_mcdi_rss_context_set_table( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_TABLE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN; Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 30 07:05:36 2018 (r341297) @@ -58,8 +58,8 @@ efx_mcdi_init_txq( __in efsys_mem_t *esmp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_INIT_TXQ_IN_LEN(EFX_TXQ_MAX_BUFS), - MC_CMD_INIT_TXQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_INIT_TXQ_IN_LEN(EFX_TXQ_MAX_BUFS), + MC_CMD_INIT_TXQ_OUT_LEN); efx_qword_t *dma_addr; uint64_t addr; int npages; @@ -80,7 +80,6 @@ efx_mcdi_init_txq( goto fail2; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_TXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_TXQ_IN_LEN(npages); @@ -147,11 +146,10 @@ efx_mcdi_fini_txq( __in uint32_t instance) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FINI_TXQ_IN_LEN, - MC_CMD_FINI_TXQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_TXQ_IN_LEN, + MC_CMD_FINI_TXQ_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FINI_TXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FINI_TXQ_IN_LEN; Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/efx_lic.c Fri Nov 30 07:05:36 2018 (r341297) @@ -328,12 +328,11 @@ efx_mcdi_fc_license_update_license( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MC_CMD_FC_IN_LICENSE_LEN]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FC_IN_LICENSE_LEN, 0); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; @@ -374,13 +373,12 @@ efx_mcdi_fc_license_get_key_stats( __out efx_key_stats_t *eksp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FC_IN_LICENSE_LEN, - MC_CMD_FC_OUT_LICENSE_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FC_IN_LICENSE_LEN, + MC_CMD_FC_OUT_LICENSE_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; @@ -690,8 +688,8 @@ efx_mcdi_licensed_app_state( __out boolean_t *licensedp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_LICENSED_APP_STATE_IN_LEN, - MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_LICENSED_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN); uint32_t app_state; efx_rc_t rc; @@ -703,7 +701,6 @@ efx_mcdi_licensed_app_state( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_LICENSED_APP_STATE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LICENSED_APP_STATE_IN_LEN; @@ -749,12 +746,11 @@ efx_mcdi_licensing_update_licenses( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MC_CMD_LICENSING_IN_LEN]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_IN_LEN, 0); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_IN_LEN; @@ -792,13 +788,12 @@ efx_mcdi_licensing_get_key_stats( __out efx_key_stats_t *eksp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LICENSING_IN_LEN, - MC_CMD_LICENSING_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_IN_LEN, + MC_CMD_LICENSING_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_IN_LEN; @@ -856,13 +851,12 @@ efx_mcdi_licensing_v3_update_licenses( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MC_CMD_LICENSING_V3_IN_LEN]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_V3_IN_LEN, 0); efx_rc_t rc; EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) || (enp->en_family == EFX_FAMILY_MEDFORD2)); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING_V3; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; @@ -893,14 +887,13 @@ efx_mcdi_licensing_v3_report_license( __out efx_key_stats_t *eksp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LICENSING_V3_IN_LEN, - MC_CMD_LICENSING_V3_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_V3_IN_LEN, + MC_CMD_LICENSING_V3_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) || (enp->en_family == EFX_FAMILY_MEDFORD2)); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING_V3; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; @@ -957,15 +950,14 @@ efx_mcdi_licensing_v3_app_state( __out boolean_t *licensedp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN, - MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN); uint32_t app_state; efx_rc_t rc; EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) || (enp->en_family == EFX_FAMILY_MEDFORD2)); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_LICENSED_V3_APP_STATE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN; @@ -1017,8 +1009,8 @@ efx_mcdi_licensing_v3_get_id( uint8_t *bufferp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LICENSING_GET_ID_V3_IN_LEN, - MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_GET_ID_V3_IN_LEN, + MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN); efx_rc_t rc; req.emr_cmd = MC_CMD_LICENSING_GET_ID_V3; @@ -1029,7 +1021,6 @@ efx_mcdi_licensing_v3_get_id( req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; req.emr_out_buf = bufferp; req.emr_out_length = MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; - (void) memset(payload, 0, sizeof (payload)); } else { /* Request full buffer */ req.emr_in_buf = bufferp; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:05:23 2018 (r341296) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:05:36 2018 (r341297) @@ -929,10 +929,10 @@ efx_mcdi_version( __out_opt efx_mcdi_boot_t *statusp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MAX(MC_CMD_GET_VERSION_IN_LEN, - MC_CMD_GET_VERSION_OUT_LEN), - MAX(MC_CMD_GET_BOOT_STATUS_IN_LEN, - MC_CMD_GET_BOOT_STATUS_OUT_LEN))]; + EFX_MCDI_DECLARE_BUF(payload, + MAX(MC_CMD_GET_VERSION_IN_LEN, MC_CMD_GET_BOOT_STATUS_IN_LEN), + MAX(MC_CMD_GET_VERSION_OUT_LEN, + MC_CMD_GET_BOOT_STATUS_OUT_LEN)); efx_word_t *ver_words; uint16_t version[4]; uint32_t build; @@ -941,7 +941,6 @@ efx_mcdi_version( EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_VERSION; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_VERSION_IN_LEN; @@ -1047,12 +1046,11 @@ efx_mcdi_get_capabilities( __out_opt uint32_t *tso2ncp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_CAPABILITIES_IN_LEN, + MC_CMD_GET_CAPABILITIES_V2_OUT_LEN); boolean_t v2_capable; efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_CAPABILITIES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; @@ -1115,7 +1113,8 @@ efx_mcdi_do_reboot( __in efx_nic_t *enp, __in boolean_t after_assertion) { - uint8_t payload[MAX(MC_CMD_REBOOT_IN_LEN, MC_CMD_REBOOT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_REBOOT_IN_LEN, + MC_CMD_REBOOT_OUT_LEN); efx_mcdi_req_t req; efx_rc_t rc; @@ -1128,7 +1127,6 @@ efx_mcdi_do_reboot( */ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_REBOOT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_REBOOT_IN_LEN; @@ -1179,8 +1177,8 @@ efx_mcdi_read_assertion( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_ASSERTS_IN_LEN, - MC_CMD_GET_ASSERTS_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_ASSERTS_IN_LEN, + MC_CMD_GET_ASSERTS_OUT_LEN); const char *reason; unsigned int flags; unsigned int index; @@ -1281,11 +1279,10 @@ efx_mcdi_drv_attach( __in boolean_t attach) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_DRV_ATTACH_IN_LEN, - MC_CMD_DRV_ATTACH_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_DRV_ATTACH_IN_LEN, + MC_CMD_DRV_ATTACH_EXT_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_DRV_ATTACH; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_DRV_ATTACH_IN_LEN; @@ -1340,11 +1337,10 @@ efx_mcdi_get_board_cfg( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_BOARD_CFG_IN_LEN, - MC_CMD_GET_BOARD_CFG_OUT_LENMIN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_BOARD_CFG_IN_LEN, + MC_CMD_GET_BOARD_CFG_OUT_LENMIN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_BOARD_CFG; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_BOARD_CFG_IN_LEN; @@ -1420,11 +1416,10 @@ efx_mcdi_get_resource_limits( __out_opt uint32_t *ntxqp) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 30 07:05:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8EAF115A486; Fri, 30 Nov 2018 07:05:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 796D4707C0; Fri, 30 Nov 2018 07:05:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30D55251F5; Fri, 30 Nov 2018 07:05:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU75pam082160; Fri, 30 Nov 2018 07:05:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU75nD4082154; Fri, 30 Nov 2018 07:05:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300705.wAU75nD4082154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341298 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 796D4707C0 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:05:52 -0000 Author: arybchik Date: Fri Nov 30 07:05:49 2018 New Revision: 341298 URL: https://svnweb.freebsd.org/changeset/base/341298 Log: sfxge(4): add routine to check for hardware presence Add efx_nic_hw_unavailable() routine to check for hardware presence before continuing with NIC operations. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18260 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 30 07:05:36 2018 (r341297) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 30 07:05:49 2018 (r341298) @@ -890,8 +890,9 @@ ef10_ev_rx( EFX_EV_QSTAT_INCR(eep, EV_RX); - /* Discard events after RXQ/TXQ errors */ - if (enp->en_reset_flags & (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR)) + /* Discard events after RXQ/TXQ errors, or hardware not available */ + if (enp->en_reset_flags & + (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR | EFX_RESET_HW_UNAVAIL)) return (B_FALSE); /* Basic packet information */ @@ -1091,8 +1092,9 @@ ef10_ev_tx( EFX_EV_QSTAT_INCR(eep, EV_TX); - /* Discard events after RXQ/TXQ errors */ - if (enp->en_reset_flags & (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR)) + /* Discard events after RXQ/TXQ errors, or hardware not available */ + if (enp->en_reset_flags & + (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR | EFX_RESET_HW_UNAVAIL)) return (B_FALSE); if (EFX_QWORD_FIELD(*eqp, ESF_DZ_TX_DROP_EVENT) != 0) { Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:05:36 2018 (r341297) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:05:49 2018 (r341298) @@ -216,6 +216,10 @@ extern __checkReturn efx_rc_t ef10_nic_init( __in efx_nic_t *enp); +extern __checkReturn boolean_t +ef10_nic_hw_unavailable( + __in efx_nic_t *enp); + #if EFSYS_OPT_DIAG extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:05:36 2018 (r341297) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:05:49 2018 (r341298) @@ -2331,6 +2331,28 @@ fail1: return (rc); } + __checkReturn boolean_t +ef10_nic_hw_unavailable( + __in efx_nic_t *enp) +{ + efx_dword_t dword; + + if (enp->en_reset_flags & EFX_RESET_HW_UNAVAIL) + return (B_TRUE); + + EFX_BAR_READD(enp, ER_DZ_BIU_MC_SFT_STATUS_REG, &dword, B_FALSE); + if (EFX_DWORD_FIELD(dword, EFX_DWORD_0) == 0xffffffff) + goto unavail; + + return (B_FALSE); + +unavail: + EFSYS_PROBE(hw_unavail); + enp->en_reset_flags |= EFX_RESET_HW_UNAVAIL; + + return (B_TRUE); +} + void ef10_nic_fini( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:05:36 2018 (r341297) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:05:49 2018 (r341298) @@ -183,6 +183,10 @@ extern __checkReturn efx_rc_t efx_nic_reset( __in efx_nic_t *enp); +extern __checkReturn boolean_t +efx_nic_hw_unavailable( + __in efx_nic_t *enp); + #if EFSYS_OPT_DIAG extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:05:36 2018 (r341297) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:05:49 2018 (r341298) @@ -87,6 +87,7 @@ extern "C" { #define EFX_RESET_PHY 0x00000001 #define EFX_RESET_RXQ_ERR 0x00000002 #define EFX_RESET_TXQ_ERR 0x00000004 +#define EFX_RESET_HW_UNAVAIL 0x00000008 typedef enum efx_mac_type_e { EFX_MAC_INVALID = 0, @@ -384,6 +385,7 @@ typedef struct efx_nic_ops_s { efx_rc_t (*eno_get_vi_pool)(efx_nic_t *, uint32_t *); efx_rc_t (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t, uint32_t *, size_t *); + boolean_t (*eno_hw_unavailable)(efx_nic_t *); #if EFSYS_OPT_DIAG efx_rc_t (*eno_register_test)(efx_nic_t *); #endif /* EFSYS_OPT_DIAG */ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:05:36 2018 (r341297) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:05:49 2018 (r341298) @@ -525,6 +525,12 @@ efx_mcdi_request_poll( EFSYS_ASSERT(!emip->emi_ev_cpl); emrp = emip->emi_pending_req; + /* Check if hardware is unavailable */ + if (efx_nic_hw_unavailable(enp)) { + EFSYS_UNLOCK(enp->en_eslp, state); + return (B_FALSE); + } + /* Check for reboot atomically w.r.t efx_mcdi_request_start */ if (emip->emi_poll_cnt++ == 0) { if ((rc = efx_mcdi_poll_reboot(enp)) != 0) { Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Fri Nov 30 07:05:36 2018 (r341297) +++ head/sys/dev/sfxge/common/efx_nic.c Fri Nov 30 07:05:49 2018 (r341298) @@ -129,6 +129,7 @@ static const efx_nic_ops_t __efx_nic_siena_ops = { siena_nic_init, /* eno_init */ NULL, /* eno_get_vi_pool */ NULL, /* eno_get_bar_region */ + NULL, /* eno_hw_unavailable */ #if EFSYS_OPT_DIAG siena_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -148,6 +149,7 @@ static const efx_nic_ops_t __efx_nic_hunt_ops = { ef10_nic_init, /* eno_init */ ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ + ef10_nic_hw_unavailable, /* eno_hw_unavailable */ #if EFSYS_OPT_DIAG ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -167,6 +169,7 @@ static const efx_nic_ops_t __efx_nic_medford_ops = { ef10_nic_init, /* eno_init */ ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ + ef10_nic_hw_unavailable, /* eno_hw_unavailable */ #if EFSYS_OPT_DIAG ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -186,6 +189,7 @@ static const efx_nic_ops_t __efx_nic_medford2_ops = { ef10_nic_init, /* eno_init */ ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ + ef10_nic_hw_unavailable, /* eno_hw_unavailable */ #if EFSYS_OPT_DIAG ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -680,6 +684,29 @@ fail1: return (rc); } + + __checkReturn boolean_t +efx_nic_hw_unavailable( + __in efx_nic_t *enp) +{ + const efx_nic_ops_t *enop = enp->en_enop; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + /* NOTE: can be used by MCDI before NIC probe */ + + if (enop->eno_hw_unavailable != NULL) { + if ((enop->eno_hw_unavailable)(enp) != B_FALSE) + goto unavail; + } + + return (B_FALSE); + +unavail: + EFSYS_PROBE(hw_unavail); + + return (B_TRUE); +} + #if EFSYS_OPT_DIAG From owner-svn-src-head@freebsd.org Fri Nov 30 07:06:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9736115A4E3; Fri, 30 Nov 2018 07:06:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EC0670935; Fri, 30 Nov 2018 07:06:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CAD9251F6; Fri, 30 Nov 2018 07:06:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU763pU082225; Fri, 30 Nov 2018 07:06:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU762lN082220; Fri, 30 Nov 2018 07:06:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300706.wAU762lN082220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341299 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EC0670935 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_SHORT(0.01)[0.005,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:06:07 -0000 Author: arybchik Date: Fri Nov 30 07:06:01 2018 New Revision: 341299 URL: https://svnweb.freebsd.org/changeset/base/341299 Log: sfxge(4): add API to inform libefx of hardware removal The efx_nic_hw_unavailable() checks ensure that if the NIC hardware has failed or has been physically removed then libefx will stop further attempts to access the hardware. Add an interface for libefx clients to force unavailability, so the hardware is treated as dead or removed even if still physically present. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18261 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:05:49 2018 (r341298) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:06:01 2018 (r341299) @@ -220,6 +220,10 @@ extern __checkReturn boolean_t ef10_nic_hw_unavailable( __in efx_nic_t *enp); +extern void +ef10_nic_set_hw_unavailable( + __in efx_nic_t *enp); + #if EFSYS_OPT_DIAG extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:05:49 2018 (r341298) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:06:01 2018 (r341299) @@ -2347,11 +2347,19 @@ ef10_nic_hw_unavailable( return (B_FALSE); unavail: - EFSYS_PROBE(hw_unavail); - enp->en_reset_flags |= EFX_RESET_HW_UNAVAIL; + ef10_nic_set_hw_unavailable(enp); return (B_TRUE); } + + void +ef10_nic_set_hw_unavailable( + __in efx_nic_t *enp) +{ + EFSYS_PROBE(hw_unavail); + enp->en_reset_flags |= EFX_RESET_HW_UNAVAIL; +} + void ef10_nic_fini( Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:05:49 2018 (r341298) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:06:01 2018 (r341299) @@ -187,6 +187,10 @@ extern __checkReturn boolean_t efx_nic_hw_unavailable( __in efx_nic_t *enp); +extern void +efx_nic_set_hw_unavailable( + __in efx_nic_t *enp); + #if EFSYS_OPT_DIAG extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:05:49 2018 (r341298) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:06:01 2018 (r341299) @@ -386,6 +386,7 @@ typedef struct efx_nic_ops_s { efx_rc_t (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t, uint32_t *, size_t *); boolean_t (*eno_hw_unavailable)(efx_nic_t *); + void (*eno_set_hw_unavailable)(efx_nic_t *); #if EFSYS_OPT_DIAG efx_rc_t (*eno_register_test)(efx_nic_t *); #endif /* EFSYS_OPT_DIAG */ Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Fri Nov 30 07:05:49 2018 (r341298) +++ head/sys/dev/sfxge/common/efx_nic.c Fri Nov 30 07:06:01 2018 (r341299) @@ -130,6 +130,7 @@ static const efx_nic_ops_t __efx_nic_siena_ops = { NULL, /* eno_get_vi_pool */ NULL, /* eno_get_bar_region */ NULL, /* eno_hw_unavailable */ + NULL, /* eno_set_hw_unavailable */ #if EFSYS_OPT_DIAG siena_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -150,6 +151,7 @@ static const efx_nic_ops_t __efx_nic_hunt_ops = { ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ ef10_nic_hw_unavailable, /* eno_hw_unavailable */ + ef10_nic_set_hw_unavailable, /* eno_set_hw_unavailable */ #if EFSYS_OPT_DIAG ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -170,6 +172,7 @@ static const efx_nic_ops_t __efx_nic_medford_ops = { ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ ef10_nic_hw_unavailable, /* eno_hw_unavailable */ + ef10_nic_set_hw_unavailable, /* eno_set_hw_unavailable */ #if EFSYS_OPT_DIAG ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -190,6 +193,7 @@ static const efx_nic_ops_t __efx_nic_medford2_ops = { ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ ef10_nic_hw_unavailable, /* eno_hw_unavailable */ + ef10_nic_set_hw_unavailable, /* eno_set_hw_unavailable */ #if EFSYS_OPT_DIAG ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ @@ -702,9 +706,19 @@ efx_nic_hw_unavailable( return (B_FALSE); unavail: - EFSYS_PROBE(hw_unavail); - return (B_TRUE); +} + + void +efx_nic_set_hw_unavailable( + __in efx_nic_t *enp) +{ + const efx_nic_ops_t *enop = enp->en_enop; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + + if (enop->eno_set_hw_unavailable != NULL) + enop->eno_set_hw_unavailable(enp); } From owner-svn-src-head@freebsd.org Fri Nov 30 07:06:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C06F9115A534; Fri, 30 Nov 2018 07:06:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60F4970A50; Fri, 30 Nov 2018 07:06:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37DFC251F7; Fri, 30 Nov 2018 07:06:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU76EK7082282; Fri, 30 Nov 2018 07:06:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU76EvV082281; Fri, 30 Nov 2018 07:06:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300706.wAU76EvV082281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341300 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60F4970A50 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:06:18 -0000 Author: arybchik Date: Fri Nov 30 07:06:13 2018 New Revision: 341300 URL: https://svnweb.freebsd.org/changeset/base/341300 Log: sfxge(4): fix ID retrieval in v3 licensing Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18262 Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Fri Nov 30 07:06:01 2018 (r341299) +++ head/sys/dev/sfxge/common/efx_lic.c Fri Nov 30 07:06:13 2018 (r341300) @@ -1010,27 +1010,15 @@ efx_mcdi_licensing_v3_get_id( { efx_mcdi_req_t req; EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_GET_ID_V3_IN_LEN, - MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN); + MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX); efx_rc_t rc; req.emr_cmd = MC_CMD_LICENSING_GET_ID_V3; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX; - if (bufferp == NULL) { - /* Request id type and length only */ - req.emr_in_buf = bufferp; - req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; - req.emr_out_buf = bufferp; - req.emr_out_length = MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; - } else { - /* Request full buffer */ - req.emr_in_buf = bufferp; - req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; - req.emr_out_buf = bufferp; - req.emr_out_length = - MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX); - (void) memset(bufferp, 0, req.emr_out_length); - } - efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { @@ -1047,19 +1035,10 @@ efx_mcdi_licensing_v3_get_id( *lengthp = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH); - if (bufferp == NULL) { - /* - * Modify length requirements to indicate to caller the extra - * buffering needed to read the complete output. - */ - *lengthp += MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; - } else { - /* Shift ID down to start of buffer */ - memmove(bufferp, - bufferp + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, - *lengthp); - memset(bufferp + (*lengthp), 0, - MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST); + if (bufferp != NULL) { + memcpy(bufferp, + payload + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST, + MIN(buffer_size, *lengthp)); } return (0); From owner-svn-src-head@freebsd.org Fri Nov 30 07:06:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27628115A56A; Fri, 30 Nov 2018 07:06:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4B1F70B2E; Fri, 30 Nov 2018 07:06:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34BAD251F8; Fri, 30 Nov 2018 07:06:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU76ONM082339; Fri, 30 Nov 2018 07:06:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU76Ob1082338; Fri, 30 Nov 2018 07:06:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300706.wAU76Ob1082338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341301 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4B1F70B2E X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:06:26 -0000 Author: arybchik Date: Fri Nov 30 07:06:24 2018 New Revision: 341301 URL: https://svnweb.freebsd.org/changeset/base/341301 Log: sfxge(4): prevent access to the NIC config before probe NIC config is initialized during NIC probe. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18263 Modified: head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Fri Nov 30 07:06:13 2018 (r341300) +++ head/sys/dev/sfxge/common/efx_nic.c Fri Nov 30 07:06:24 2018 (r341301) @@ -624,6 +624,7 @@ efx_nic_cfg_get( __in efx_nic_t *enp) { EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); return (&(enp->en_nic_cfg)); } From owner-svn-src-head@freebsd.org Fri Nov 30 07:06:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 113C1115A5A9; Fri, 30 Nov 2018 07:06:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE20170C43; Fri, 30 Nov 2018 07:06:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2232251F9; Fri, 30 Nov 2018 07:06:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU76ZnI082405; Fri, 30 Nov 2018 07:06:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU76ZnZ082404; Fri, 30 Nov 2018 07:06:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300706.wAU76ZnZ082404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341302 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE20170C43 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:06:37 -0000 Author: arybchik Date: Fri Nov 30 07:06:35 2018 New Revision: 341302 URL: https://svnweb.freebsd.org/changeset/base/341302 Log: sfxge(4): fix a typo in unicast filter insertion comment Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18264 Modified: head/sys/dev/sfxge/common/ef10_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 30 07:06:24 2018 (r341301) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 30 07:06:35 2018 (r341302) @@ -1605,7 +1605,7 @@ ef10_filter_reconfigure( /* * Insert or renew unicast filters. * - * Frimware does not perform chaining on unicast filters. As traffic is + * Firmware does not perform chaining on unicast filters. As traffic is * therefore only delivered to the first matching filter, we should * always insert the specific filter for our MAC address, to try and * ensure we get that traffic. From owner-svn-src-head@freebsd.org Fri Nov 30 07:06:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75412115A5F0; Fri, 30 Nov 2018 07:06:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B6DD70D81; Fri, 30 Nov 2018 07:06:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF879251FA; Fri, 30 Nov 2018 07:06:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU76ldE082478; Fri, 30 Nov 2018 07:06:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU76ksK082473; Fri, 30 Nov 2018 07:06:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300706.wAU76ksK082473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341303 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B6DD70D81 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:06:49 -0000 Author: arybchik Date: Fri Nov 30 07:06:46 2018 New Revision: 341303 URL: https://svnweb.freebsd.org/changeset/base/341303 Log: sfxge(4): add support to get active FEC type Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18265 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:06:35 2018 (r341302) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:06:46 2018 (r341303) @@ -622,6 +622,7 @@ typedef struct ef10_link_state_s { uint32_t els_adv_cap_mask; uint32_t els_lp_cap_mask; unsigned int els_fcntl; + efx_phy_fec_type_t els_fec; efx_link_mode_t els_link_mode; #if EFSYS_OPT_LOOPBACK efx_loopback_type_t els_loopback; @@ -657,6 +658,11 @@ extern __checkReturn efx_rc_t ef10_phy_oui_get( __in efx_nic_t *enp, __out uint32_t *ouip); + +extern __checkReturn efx_rc_t +ef10_phy_fec_type_get( + __in efx_nic_t *enp, + __out efx_phy_fec_type_t *fecp); #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:06:35 2018 (r341302) +++ head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:06:46 2018 (r341303) @@ -125,8 +125,10 @@ mcdi_phy_decode_link_mode( __in uint32_t link_flags, __in unsigned int speed, __in unsigned int fcntl, + __in uint32_t fec, __out efx_link_mode_t *link_modep, - __out unsigned int *fcntlp) + __out unsigned int *fcntlp, + __out efx_phy_fec_type_t *fecp) { boolean_t fd = !!(link_flags & (1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN)); @@ -168,6 +170,22 @@ mcdi_phy_decode_link_mode( EFSYS_PROBE1(mc_pcol_error, int, fcntl); *fcntlp = 0; } + + switch (fec) { + case MC_CMD_FEC_NONE: + *fecp = EFX_PHY_FEC_NONE; + break; + case MC_CMD_FEC_BASER: + *fecp = EFX_PHY_FEC_BASER; + break; + case MC_CMD_FEC_RS: + *fecp = EFX_PHY_FEC_RS; + break; + default: + EFSYS_PROBE1(mc_pcol_error, int, fec); + *fecp = EFX_PHY_FEC_NONE; + break; + } } @@ -181,6 +199,7 @@ ef10_phy_link_ev( unsigned int link_flags; unsigned int speed; unsigned int fcntl; + efx_phy_fec_type_t fec = MC_CMD_FEC_NONE; efx_link_mode_t link_mode; uint32_t lp_cap_mask; @@ -218,7 +237,8 @@ ef10_phy_link_ev( link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS); mcdi_phy_decode_link_mode(enp, link_flags, speed, MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL), - &link_mode, &fcntl); + MC_CMD_FEC_NONE, &link_mode, + &fcntl, &fec); mcdi_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), &lp_cap_mask); @@ -269,15 +289,16 @@ ef10_phy_get_link( __out ef10_link_state_t *elsp) { efx_mcdi_req_t req; + uint32_t fec; EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_LINK_IN_LEN, - MC_CMD_GET_LINK_OUT_LEN); + MC_CMD_GET_LINK_OUT_V2_LEN); efx_rc_t rc; req.emr_cmd = MC_CMD_GET_LINK; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LINK_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_LINK_OUT_LEN; + req.emr_out_length = MC_CMD_GET_LINK_OUT_V2_LEN; efx_mcdi_execute(enp, &req); @@ -296,10 +317,16 @@ ef10_phy_get_link( mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), &elsp->els_lp_cap_mask); + if (req.emr_out_length_used < MC_CMD_GET_LINK_OUT_V2_LEN) + fec = MC_CMD_FEC_NONE; + else + fec = MCDI_OUT_DWORD(req, GET_LINK_OUT_V2_FEC_TYPE); + mcdi_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), - &elsp->els_link_mode, &elsp->els_fcntl); + fec, &elsp->els_link_mode, + &elsp->els_fcntl, &elsp->els_fec); #if EFSYS_OPT_LOOPBACK /* @@ -541,6 +568,29 @@ ef10_phy_oui_get( return (ENOTSUP); } + + __checkReturn efx_rc_t +ef10_phy_fec_type_get( + __in efx_nic_t *enp, + __out efx_phy_fec_type_t *fecp) +{ + efx_rc_t rc; + ef10_link_state_t els; + + /* Obtain the active FEC type */ + if ((rc = ef10_phy_get_link(enp, &els)) != 0) + goto fail1; + + *fecp = els.els_fec; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:06:35 2018 (r341302) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:06:46 2018 (r341303) @@ -3231,6 +3231,17 @@ efx_nic_set_fw_subvariant( #endif /* EFSYS_OPT_FW_SUBVARIANT_AWARE */ +typedef enum efx_phy_fec_type_e { + EFX_PHY_FEC_NONE = 0, + EFX_PHY_FEC_BASER, + EFX_PHY_FEC_RS +} efx_phy_fec_type_t; + +extern __checkReturn efx_rc_t +efx_phy_fec_type_get( + __in efx_nic_t *enp, + __out efx_phy_fec_type_t *typep); + #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:06:35 2018 (r341302) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:06:46 2018 (r341303) @@ -252,6 +252,7 @@ typedef struct efx_phy_ops_s { efx_rc_t (*epo_reconfigure)(efx_nic_t *); efx_rc_t (*epo_verify)(efx_nic_t *); efx_rc_t (*epo_oui_get)(efx_nic_t *, uint32_t *); + efx_rc_t (*epo_fec_type_get)(efx_nic_t *, efx_phy_fec_type_t *); #if EFSYS_OPT_PHY_STATS efx_rc_t (*epo_stats_update)(efx_nic_t *, efsys_mem_t *, uint32_t *); Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:06:35 2018 (r341302) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:06:46 2018 (r341303) @@ -44,6 +44,7 @@ static const efx_phy_ops_t __efx_phy_siena_ops = { siena_phy_reconfigure, /* epo_reconfigure */ siena_phy_verify, /* epo_verify */ siena_phy_oui_get, /* epo_oui_get */ + NULL, /* epo_fec_type_get */ #if EFSYS_OPT_PHY_STATS siena_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ @@ -63,6 +64,7 @@ static const efx_phy_ops_t __efx_phy_ef10_ops = { ef10_phy_reconfigure, /* epo_reconfigure */ ef10_phy_verify, /* epo_verify */ ef10_phy_oui_get, /* epo_oui_get */ + ef10_phy_fec_type_get, /* epo_fec_type_get */ #if EFSYS_OPT_PHY_STATS ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ @@ -219,6 +221,11 @@ efx_phy_adv_cap_get( } } +#define EFX_PHY_CAP_FEC_REQ_MASK \ + (1U << EFX_PHY_CAP_BASER_FEC_REQUESTED) | \ + (1U << EFX_PHY_CAP_RS_FEC_REQUESTED) | \ + (1U << EFX_PHY_CAP_25G_BASER_FEC_REQUESTED) + __checkReturn efx_rc_t efx_phy_adv_cap_set( __in efx_nic_t *enp, @@ -232,7 +239,8 @@ efx_phy_adv_cap_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); - if ((mask & ~epp->ep_phy_cap_mask) != 0) { + /* Ignore don't care bits of FEC (FEC EFX_PHY_CAP_*_REQUESTED) */ + if ((mask & ~(epp->ep_phy_cap_mask | EFX_PHY_CAP_FEC_REQ_MASK)) != 0) { rc = ENOTSUP; goto fail1; } @@ -331,6 +339,35 @@ efx_phy_module_get_info( if ((rc = efx_mcdi_phy_module_get_info(enp, dev_addr, offset, len, data)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_phy_fec_type_get( + __in efx_nic_t *enp, + __out efx_phy_fec_type_t *typep) +{ + efx_port_t *epp = &(enp->en_port); + const efx_phy_ops_t *epop = epp->ep_epop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + + if (epop->epo_fec_type_get == NULL) { + rc = ENOTSUP; + goto fail1; + } + + if ((rc = epop->epo_fec_type_get(enp, typep)) != 0) goto fail2; return (0); From owner-svn-src-head@freebsd.org Fri Nov 30 07:06:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C782115A63A; Fri, 30 Nov 2018 07:06:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D46AC70E7F; Fri, 30 Nov 2018 07:06:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5B7A251FB; Fri, 30 Nov 2018 07:06:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU76wjq082536; Fri, 30 Nov 2018 07:06:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU76wD2082535; Fri, 30 Nov 2018 07:06:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300706.wAU76wD2082535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341304 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D46AC70E7F X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:06:59 -0000 Author: arybchik Date: Fri Nov 30 07:06:58 2018 New Revision: 341304 URL: https://svnweb.freebsd.org/changeset/base/341304 Log: sfxge(4): use simpler code to check hash algorithm type The API which is used to list supported hash flags verifies hash algorithm choice before writing the output. This check is based on a switch() statement which has only two options and no distinctive actions to be conducted for each of them. Use simpler code instead of switch() to improve readability. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18266 Modified: head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:06:46 2018 (r341303) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:06:58 2018 (r341304) @@ -341,6 +341,11 @@ efx_rx_scale_hash_flags_get( goto fail1; } + if ((encp->enc_rx_scale_hash_alg_mask & (1U << hash_alg)) == 0) { + *nflagsp = 0; + return 0; + } + l4 = encp->enc_rx_scale_l4_hash_supported; additional_modes = encp->enc_rx_scale_additional_modes_supported; @@ -369,41 +374,23 @@ efx_rx_scale_hash_flags_get( _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) - switch (hash_alg) { - case EFX_RX_HASHALG_PACKED_STREAM: - if ((encp->enc_rx_scale_hash_alg_mask & (1U << hash_alg)) == 0) - break; - /* FALLTHRU */ - case EFX_RX_HASHALG_TOEPLITZ: - if ((encp->enc_rx_scale_hash_alg_mask & (1U << hash_alg)) == 0) - break; + LIST_FLAGS(entryp, IPV4_TCP, l4, additional_modes); + LIST_FLAGS(entryp, IPV6_TCP, l4, additional_modes); - LIST_FLAGS(entryp, IPV4_TCP, l4, additional_modes); - LIST_FLAGS(entryp, IPV6_TCP, l4, additional_modes); - - if (additional_modes) { - LIST_FLAGS(entryp, IPV4_UDP, l4, additional_modes); - LIST_FLAGS(entryp, IPV6_UDP, l4, additional_modes); - } - - LIST_FLAGS(entryp, IPV4, B_FALSE, additional_modes); - LIST_FLAGS(entryp, IPV6, B_FALSE, additional_modes); - break; - - default: - rc = EINVAL; - goto fail2; + if (additional_modes) { + LIST_FLAGS(entryp, IPV4_UDP, l4, additional_modes); + LIST_FLAGS(entryp, IPV6_UDP, l4, additional_modes); } + LIST_FLAGS(entryp, IPV4, B_FALSE, additional_modes); + LIST_FLAGS(entryp, IPV6, B_FALSE, additional_modes); + #undef LIST_FLAGS *nflagsp = (unsigned int)(entryp - flagsp); EFSYS_ASSERT3U(*nflagsp, <=, EFX_RX_HASH_NFLAGS); return (0); - -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Fri Nov 30 07:07:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DBAE115A68B; Fri, 30 Nov 2018 07:07:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE78570FCA; Fri, 30 Nov 2018 07:07:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2489F251FC; Fri, 30 Nov 2018 07:07:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU77A60082617; Fri, 30 Nov 2018 07:07:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU779Um082614; Fri, 30 Nov 2018 07:07:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300707.wAU779Um082614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341305 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE78570FCA X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:07:12 -0000 Author: arybchik Date: Fri Nov 30 07:07:09 2018 New Revision: 341305 URL: https://svnweb.freebsd.org/changeset/base/341305 Log: sfxge(4): check buffer size for hash flags The efx_rx_scale_hash_flags_get interface is unsafe, as it does not have an argument for the size of the output buffer used to return the flags. While the only caller currently supplies a sufficiently large buffer, this should be checked at runtime to avoid writing past the end of the buffer. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18267 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_annote.h (contents, props changed) head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:06:58 2018 (r341304) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:07:09 2018 (r341305) @@ -2396,7 +2396,8 @@ extern __checkReturn efx_rc_t efx_rx_scale_hash_flags_get( __in efx_nic_t *enp, __in efx_rx_hash_alg_t hash_alg, - __inout_ecount(EFX_RX_HASH_NFLAGS) unsigned int *flagsp, + __out_ecount_part(max_nflags, *nflagsp) unsigned int *flagsp, + __in unsigned int max_nflags, __out unsigned int *nflagsp); extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_annote.h ============================================================================== --- head/sys/dev/sfxge/common/efx_annote.h Fri Nov 30 07:06:58 2018 (r341304) +++ head/sys/dev/sfxge/common/efx_annote.h Fri Nov 30 07:07:09 2018 (r341305) @@ -61,6 +61,7 @@ #define __out_opt #define __out_ecount(_n) #define __out_ecount_opt(_n) +#define __out_ecount_part(_n, _l) #define __out_bcount(_n) #define __out_bcount_opt(_n) #define __out_bcount_part(_n, _l) Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:06:58 2018 (r341304) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:07:09 2018 (r341305) @@ -327,13 +327,12 @@ fail1: efx_rx_scale_hash_flags_get( __in efx_nic_t *enp, __in efx_rx_hash_alg_t hash_alg, - __inout_ecount(EFX_RX_HASH_NFLAGS) unsigned int *flagsp, + __out_ecount_part(max_nflags, *nflagsp) unsigned int *flagsp, + __in unsigned int max_nflags, __out unsigned int *nflagsp) { efx_nic_cfg_t *encp = &enp->en_nic_cfg; - boolean_t l4; - boolean_t additional_modes; - unsigned int *entryp = flagsp; + unsigned int nflags = 0; efx_rc_t rc; if (flagsp == NULL || nflagsp == NULL) { @@ -342,56 +341,90 @@ efx_rx_scale_hash_flags_get( } if ((encp->enc_rx_scale_hash_alg_mask & (1U << hash_alg)) == 0) { - *nflagsp = 0; - return 0; + nflags = 0; + goto done; } - l4 = encp->enc_rx_scale_l4_hash_supported; - additional_modes = encp->enc_rx_scale_additional_modes_supported; - -#define LIST_FLAGS(_entryp, _class, _l4_hashing, _additional_modes) \ - do { \ - if (_l4_hashing) { \ - *(_entryp++) = EFX_RX_HASH(_class, 4TUPLE); \ - \ - if (_additional_modes) { \ - *(_entryp++) = \ - EFX_RX_HASH(_class, 2TUPLE_DST); \ - *(_entryp++) = \ - EFX_RX_HASH(_class, 2TUPLE_SRC); \ - } \ - } \ - \ - *(_entryp++) = EFX_RX_HASH(_class, 2TUPLE); \ - \ - if (_additional_modes) { \ - *(_entryp++) = EFX_RX_HASH(_class, 1TUPLE_DST); \ - *(_entryp++) = EFX_RX_HASH(_class, 1TUPLE_SRC); \ - } \ - \ - *(_entryp++) = EFX_RX_HASH(_class, DISABLE); \ - \ - _NOTE(CONSTANTCONDITION) \ + /* Helper to add flags word to flags array without buffer overflow */ +#define INSERT_FLAGS(_flags) \ + do { \ + if (nflags >= max_nflags) { \ + rc = E2BIG; \ + goto fail2; \ + } \ + *(flagsp + nflags) = (_flags); \ + nflags++; \ + \ + _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) - LIST_FLAGS(entryp, IPV4_TCP, l4, additional_modes); - LIST_FLAGS(entryp, IPV6_TCP, l4, additional_modes); + if (encp->enc_rx_scale_l4_hash_supported != B_FALSE) { + INSERT_FLAGS(EFX_RX_HASH(IPV4_TCP, 4TUPLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_TCP, 4TUPLE)); + } - if (additional_modes) { - LIST_FLAGS(entryp, IPV4_UDP, l4, additional_modes); - LIST_FLAGS(entryp, IPV6_UDP, l4, additional_modes); + if ((encp->enc_rx_scale_l4_hash_supported != B_FALSE) && + (encp->enc_rx_scale_additional_modes_supported != B_FALSE)) { + INSERT_FLAGS(EFX_RX_HASH(IPV4_TCP, 2TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV4_TCP, 2TUPLE_SRC)); + + INSERT_FLAGS(EFX_RX_HASH(IPV6_TCP, 2TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_TCP, 2TUPLE_SRC)); + + INSERT_FLAGS(EFX_RX_HASH(IPV4_UDP, 4TUPLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV4_UDP, 2TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV4_UDP, 2TUPLE_SRC)); + + INSERT_FLAGS(EFX_RX_HASH(IPV6_UDP, 4TUPLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_UDP, 2TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_UDP, 2TUPLE_SRC)); } - LIST_FLAGS(entryp, IPV4, B_FALSE, additional_modes); - LIST_FLAGS(entryp, IPV6, B_FALSE, additional_modes); + INSERT_FLAGS(EFX_RX_HASH(IPV4_TCP, 2TUPLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_TCP, 2TUPLE)); -#undef LIST_FLAGS + INSERT_FLAGS(EFX_RX_HASH(IPV4, 2TUPLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6, 2TUPLE)); - *nflagsp = (unsigned int)(entryp - flagsp); - EFSYS_ASSERT3U(*nflagsp, <=, EFX_RX_HASH_NFLAGS); + if (encp->enc_rx_scale_additional_modes_supported != B_FALSE) { + INSERT_FLAGS(EFX_RX_HASH(IPV4_TCP, 1TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV4_TCP, 1TUPLE_SRC)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_TCP, 1TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_TCP, 1TUPLE_SRC)); + + INSERT_FLAGS(EFX_RX_HASH(IPV4_UDP, 2TUPLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV4_UDP, 1TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV4_UDP, 1TUPLE_SRC)); + + INSERT_FLAGS(EFX_RX_HASH(IPV6_UDP, 2TUPLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_UDP, 1TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_UDP, 1TUPLE_SRC)); + + INSERT_FLAGS(EFX_RX_HASH(IPV4, 1TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV4, 1TUPLE_SRC)); + + INSERT_FLAGS(EFX_RX_HASH(IPV6, 1TUPLE_DST)); + INSERT_FLAGS(EFX_RX_HASH(IPV6, 1TUPLE_SRC)); + } + + INSERT_FLAGS(EFX_RX_HASH(IPV4_TCP, DISABLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_TCP, DISABLE)); + + INSERT_FLAGS(EFX_RX_HASH(IPV4_UDP, DISABLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6_UDP, DISABLE)); + + INSERT_FLAGS(EFX_RX_HASH(IPV4, DISABLE)); + INSERT_FLAGS(EFX_RX_HASH(IPV6, DISABLE)); + +#undef INSERT_FLAGS + +done: + *nflagsp = nflags; return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -577,7 +610,8 @@ efx_rx_scale_mode_set( /* * Get the list of supported hash flags and sanitise the input. */ - rc = efx_rx_scale_hash_flags_get(enp, alg, type_flags, &type_nflags); + rc = efx_rx_scale_hash_flags_get(enp, alg, type_flags, + EFX_ARRAY_SIZE(type_flags), &type_nflags); if (rc != 0) goto fail2; From owner-svn-src-head@freebsd.org Fri Nov 30 07:07:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E41B5115A6DB; Fri, 30 Nov 2018 07:07:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89371710CD; Fri, 30 Nov 2018 07:07:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C1C42521A; Fri, 30 Nov 2018 07:07:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU77L6v082679; Fri, 30 Nov 2018 07:07:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU77Lcn082677; Fri, 30 Nov 2018 07:07:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300707.wAU77Lcn082677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341306 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89371710CD X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_SHORT(0.01)[0.005,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:07:22 -0000 Author: arybchik Date: Fri Nov 30 07:07:20 2018 New Revision: 341306 URL: https://svnweb.freebsd.org/changeset/base/341306 Log: sfxge(4): simplify the code to parse RSS hash type RSS mode bits can be accessed a lot easier in the hash type value provided that the variable type is uint32_t. The macro helper can be removed to enhance readability. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18268 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:07:09 2018 (r341305) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:07:20 2018 (r341306) @@ -404,12 +404,6 @@ efx_mcdi_rss_context_set_flags( if (encp->enc_rx_scale_additional_modes_supported == B_FALSE) modes = 0; -#define EXTRACT_RSS_MODE(_type, _class) \ - (EFX_EXTRACT_NATIVE(_type, 0, 31, \ - EFX_LOW_BIT(EFX_RX_CLASS_##_class), \ - EFX_HIGH_BIT(EFX_RX_CLASS_##_class)) & \ - EFX_MASK32(EFX_RX_CLASS_##_class)) - MCDI_IN_POPULATE_DWORD_10(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN, ((type & type_ipv4) == type_ipv4) ? 1 : 0, @@ -420,19 +414,21 @@ efx_mcdi_rss_context_set_flags( RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN, ((type & type_ipv6_tcp) == type_ipv6_tcp) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE, - EXTRACT_RSS_MODE(modes, IPV4_TCP), + (modes >> EFX_RX_CLASS_IPV4_TCP_LBN) & + EFX_MASK32(EFX_RX_CLASS_IPV4_TCP), RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE, - EXTRACT_RSS_MODE(modes, IPV4_UDP), + (modes >> EFX_RX_CLASS_IPV4_UDP_LBN) & + EFX_MASK32(EFX_RX_CLASS_IPV4_UDP), RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE, - EXTRACT_RSS_MODE(modes, IPV4), + (modes >> EFX_RX_CLASS_IPV4_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV4), RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE, - EXTRACT_RSS_MODE(modes, IPV6_TCP), + (modes >> EFX_RX_CLASS_IPV6_TCP_LBN) & + EFX_MASK32(EFX_RX_CLASS_IPV6_TCP), RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE, - EXTRACT_RSS_MODE(modes, IPV6_UDP), + (modes >> EFX_RX_CLASS_IPV6_UDP_LBN) & + EFX_MASK32(EFX_RX_CLASS_IPV6_UDP), RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE, - EXTRACT_RSS_MODE(modes, IPV6)); - -#undef EXTRACT_RSS_MODE + (modes >> EFX_RX_CLASS_IPV6_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV6)); efx_mcdi_execute(enp, &req); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:07:09 2018 (r341305) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:07:20 2018 (r341306) @@ -2295,7 +2295,7 @@ typedef enum efx_rx_hash_alg_e { * - a combination of legacy flags * - a combination of EFX_RX_HASH() flags */ -typedef unsigned int efx_rx_hash_type_t; +typedef uint32_t efx_rx_hash_type_t; typedef enum efx_rx_hash_support_e { EFX_RX_HASH_UNAVAILABLE = 0, /* Hardware hash not inserted */ From owner-svn-src-head@freebsd.org Fri Nov 30 07:07:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43016115A72E; Fri, 30 Nov 2018 07:07:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCF8C71217; Fri, 30 Nov 2018 07:07:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC7102523B; Fri, 30 Nov 2018 07:07:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU77WPu082737; Fri, 30 Nov 2018 07:07:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU77W1t082735; Fri, 30 Nov 2018 07:07:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300707.wAU77W1t082735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341307 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCF8C71217 X-Spamd-Result: default: False [0.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_SHORT(0.01)[0.014,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:07:35 -0000 Author: arybchik Date: Fri Nov 30 07:07:31 2018 New Revision: 341307 URL: https://svnweb.freebsd.org/changeset/base/341307 Log: sfxge(4): improve handling of legacy RSS hash flags Client drivers may use either legacy flags, for example, EFX_RX_HASH_TCPIPV4, or generalised flags, for example, EFX_RX_HASH(IPV4_TCP, 4TUPLE), to configure RSS hash. The libefx is able to recognise what scheme is used. Legacy flags may be consumed directly by a chip-specific handler to configure the NIC, that is, on EF10, these flags can be used to fill in legacy RSS mode field in MCDI request. Generalised flags can also be directly used in EF10-specific handler as they are fully compatible with additional fields of the same MCDI request. Legacy flags undergo conversion to generalised flags before they are consumed by a chip-specific handler. This conversion is used to make sure that chip-specific handlers expect only generalised flags in the input for the sake of clarity of the code. Depending on firmware capabilities, a chip-specififc handler either supplies the input to the NIC directly, for example, EFX_RX_HASH(IPV4_TCP, 4TUPLE) flag will enable 4 bits in RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE field on EF10, or takes the opportunity to translate the input to enable bits which don't map to the generic flag, like setting RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN on EF10 when the firmware claims no support for additional modes. However, this approach has introduced a severe problem which can be reproduced with ultra-low-latency firmware variant. In order to enable IP hash, EF10-specific handler requires the user to request 2-tuple hash for IP-other, TCP and UDP traffic classes, unconditionally. In example, IPv4 hash can be enabled using the following input: EFX_RX_HASH(IPV4_TCP, 2TUPLE) | EFX_RX_HASH(IPV4_UDP, 2TUPLE) | EFX_RX_HASH(IPV4, 2TUPLE). At the same time, on ultra-low-latency firmware, the common code will never report support for any UDP tuple to the client driver. That is, in the same example, the driver will use EFX_RX_HASH(IPV4_TCP, 2TUPLE) | EFX_RX_HASH(IPV4, 2TUPLE). This input will not be recognised by EF10-specific handler, and RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN bit will not be set in the MCDI request. In order to solve the problem, the patch removes conversion code from chip-specific handlers and adds appropriate code to convert EFX_RX_HASH() flags to their legacy counterparts to the common scale mode set function. If the firmware does not support additional modes, the function will convert generalised flags to legacy flags correctly without any demand for UDP flags and pass the result to a chip-specific handler. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18269 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:07:20 2018 (r341306) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:07:31 2018 (r341307) @@ -341,11 +341,6 @@ efx_mcdi_rss_context_set_flags( __in efx_rx_hash_type_t type) { efx_nic_cfg_t *encp = &enp->en_nic_cfg; - efx_rx_hash_type_t type_ipv4; - efx_rx_hash_type_t type_ipv4_tcp; - efx_rx_hash_type_t type_ipv6; - efx_rx_hash_type_t type_ipv6_tcp; - efx_rx_hash_type_t modes; efx_mcdi_req_t req; EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN, MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN); @@ -382,53 +377,38 @@ efx_mcdi_rss_context_set_flags( MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID, rss_context); - type_ipv4 = EFX_RX_HASH(IPV4, 2TUPLE) | EFX_RX_HASH(IPV4_TCP, 2TUPLE) | - EFX_RX_HASH(IPV4_UDP, 2TUPLE); - type_ipv4_tcp = EFX_RX_HASH(IPV4_TCP, 4TUPLE); - type_ipv6 = EFX_RX_HASH(IPV6, 2TUPLE) | EFX_RX_HASH(IPV6_TCP, 2TUPLE) | - EFX_RX_HASH(IPV6_UDP, 2TUPLE); - type_ipv6_tcp = EFX_RX_HASH(IPV6_TCP, 4TUPLE); - /* - * Create a copy of the original hash type. - * The copy will be used to fill in RSS_MODE bits and - * may be cleared beforehand. The original variable - * and, thus, EN bits will remain unaffected. - */ - modes = type; - - /* * If the firmware lacks support for additional modes, RSS_MODE * fields must contain zeros, otherwise the operation will fail. */ if (encp->enc_rx_scale_additional_modes_supported == B_FALSE) - modes = 0; + type &= EFX_RX_HASH_LEGACY_MASK; MCDI_IN_POPULATE_DWORD_10(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN, - ((type & type_ipv4) == type_ipv4) ? 1 : 0, + (type & EFX_RX_HASH_IPV4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN, - ((type & type_ipv4_tcp) == type_ipv4_tcp) ? 1 : 0, + (type & EFX_RX_HASH_TCPIPV4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN, - ((type & type_ipv6) == type_ipv6) ? 1 : 0, + (type & EFX_RX_HASH_IPV6) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN, - ((type & type_ipv6_tcp) == type_ipv6_tcp) ? 1 : 0, + (type & EFX_RX_HASH_TCPIPV6) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE, - (modes >> EFX_RX_CLASS_IPV4_TCP_LBN) & + (type >> EFX_RX_CLASS_IPV4_TCP_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV4_TCP), RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE, - (modes >> EFX_RX_CLASS_IPV4_UDP_LBN) & + (type >> EFX_RX_CLASS_IPV4_UDP_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV4_UDP), RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE, - (modes >> EFX_RX_CLASS_IPV4_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV4), + (type >> EFX_RX_CLASS_IPV4_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV4), RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE, - (modes >> EFX_RX_CLASS_IPV6_TCP_LBN) & + (type >> EFX_RX_CLASS_IPV6_TCP_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV6_TCP), RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE, - (modes >> EFX_RX_CLASS_IPV6_UDP_LBN) & + (type >> EFX_RX_CLASS_IPV6_UDP_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV6_UDP), RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE, - (modes >> EFX_RX_CLASS_IPV6_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV6)); + (type >> EFX_RX_CLASS_IPV6_LBN) & EFX_MASK32(EFX_RX_CLASS_IPV6)); efx_mcdi_execute(enp, &req); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:07:20 2018 (r341306) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:07:31 2018 (r341307) @@ -561,9 +561,8 @@ efx_rx_scale_mode_set( __in efx_rx_hash_type_t type, __in boolean_t insert) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; const efx_rx_ops_t *erxop = enp->en_erxop; - unsigned int type_flags[EFX_RX_HASH_NFLAGS]; - unsigned int type_nflags; efx_rx_hash_type_t type_check; unsigned int i; efx_rc_t rc; @@ -582,47 +581,60 @@ efx_rx_scale_mode_set( } /* - * Translate legacy flags to the new representation - * so that chip-specific handlers will consider the - * new flags only. + * If RSS hash type is represented by additional bits + * in the value, the latter need to be verified since + * not all bit combinations are valid RSS modes. Also, + * depending on the firmware, some valid combinations + * may be unsupported. Discern additional bits in the + * type value and try to recognise valid combinations. + * If some bits remain unrecognised, report the error. */ - if (type & EFX_RX_HASH_IPV4) { - type |= EFX_RX_HASH(IPV4, 2TUPLE); - type |= EFX_RX_HASH(IPV4_TCP, 2TUPLE); - type |= EFX_RX_HASH(IPV4_UDP, 2TUPLE); - } + type_check = type & ~EFX_RX_HASH_LEGACY_MASK; + if (type_check != 0) { + unsigned int type_flags[EFX_RX_HASH_NFLAGS]; + unsigned int type_nflags; - if (type & EFX_RX_HASH_TCPIPV4) - type |= EFX_RX_HASH(IPV4_TCP, 4TUPLE); + rc = efx_rx_scale_hash_flags_get(enp, alg, type_flags, + EFX_ARRAY_SIZE(type_flags), &type_nflags); + if (rc != 0) + goto fail2; - if (type & EFX_RX_HASH_IPV6) { - type |= EFX_RX_HASH(IPV6, 2TUPLE); - type |= EFX_RX_HASH(IPV6_TCP, 2TUPLE); - type |= EFX_RX_HASH(IPV6_UDP, 2TUPLE); + for (i = 0; i < type_nflags; ++i) { + if ((type_check & type_flags[i]) == type_flags[i]) + type_check &= ~(type_flags[i]); + } + + if (type_check != 0) { + rc = EINVAL; + goto fail3; + } } - if (type & EFX_RX_HASH_TCPIPV6) - type |= EFX_RX_HASH(IPV6_TCP, 4TUPLE); - - type &= ~EFX_RX_HASH_LEGACY_MASK; - type_check = type; - /* - * Get the list of supported hash flags and sanitise the input. + * Translate EFX_RX_HASH() flags to their legacy counterparts + * provided that the FW claims no support for additional modes. */ - rc = efx_rx_scale_hash_flags_get(enp, alg, type_flags, - EFX_ARRAY_SIZE(type_flags), &type_nflags); - if (rc != 0) - goto fail2; + if (encp->enc_rx_scale_additional_modes_supported == B_FALSE) { + efx_rx_hash_type_t t_ipv4 = EFX_RX_HASH(IPV4, 2TUPLE) | + EFX_RX_HASH(IPV4_TCP, 2TUPLE); + efx_rx_hash_type_t t_ipv6 = EFX_RX_HASH(IPV6, 2TUPLE) | + EFX_RX_HASH(IPV6_TCP, 2TUPLE); + efx_rx_hash_type_t t_ipv4_tcp = EFX_RX_HASH(IPV4_TCP, 4TUPLE); + efx_rx_hash_type_t t_ipv6_tcp = EFX_RX_HASH(IPV6_TCP, 4TUPLE); - for (i = 0; i < type_nflags; ++i) { - if ((type_check & type_flags[i]) == type_flags[i]) - type_check &= ~(type_flags[i]); - } + if ((type & t_ipv4) == t_ipv4) + type |= EFX_RX_HASH_IPV4; + if ((type & t_ipv6) == t_ipv6) + type |= EFX_RX_HASH_IPV6; - if (type_check != 0) { - rc = EINVAL; - goto fail3; + if (encp->enc_rx_scale_l4_hash_supported == B_TRUE) { + if ((type & t_ipv4_tcp) == t_ipv4_tcp) + type |= EFX_RX_HASH_TCPIPV4; + if ((type & t_ipv6_tcp) == t_ipv6_tcp) + type |= EFX_RX_HASH_TCPIPV6; + } + + type &= EFX_RX_HASH_LEGACY_MASK; } if (erxop->erxo_scale_mode_set != NULL) { @@ -1140,10 +1152,6 @@ siena_rx_scale_mode_set( __in efx_rx_hash_type_t type, __in boolean_t insert) { - efx_rx_hash_type_t type_ipv4 = EFX_RX_HASH(IPV4, 2TUPLE); - efx_rx_hash_type_t type_ipv4_tcp = EFX_RX_HASH(IPV4_TCP, 4TUPLE); - efx_rx_hash_type_t type_ipv6 = EFX_RX_HASH(IPV6, 2TUPLE); - efx_rx_hash_type_t type_ipv6_tcp = EFX_RX_HASH(IPV6_TCP, 4TUPLE); efx_rc_t rc; if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { @@ -1158,12 +1166,12 @@ siena_rx_scale_mode_set( case EFX_RX_HASHALG_TOEPLITZ: EFX_RX_TOEPLITZ_IPV4_HASH(enp, insert, - (type & type_ipv4) == type_ipv4, - (type & type_ipv4_tcp) == type_ipv4_tcp); + (type & EFX_RX_HASH_IPV4) ? B_TRUE : B_FALSE, + (type & EFX_RX_HASH_TCPIPV4) ? B_TRUE : B_FALSE); EFX_RX_TOEPLITZ_IPV6_HASH(enp, - (type & type_ipv6) == type_ipv6, - (type & type_ipv6_tcp) == type_ipv6_tcp, + (type & EFX_RX_HASH_IPV6) ? B_TRUE : B_FALSE, + (type & EFX_RX_HASH_TCPIPV6) ? B_TRUE : B_FALSE, rc); if (rc != 0) goto fail2; From owner-svn-src-head@freebsd.org Fri Nov 30 07:07:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE73115A786; Fri, 30 Nov 2018 07:07:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0527133E; Fri, 30 Nov 2018 07:07:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE9FA2524E; Fri, 30 Nov 2018 07:07:43 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU77hAa082795; Fri, 30 Nov 2018 07:07:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU77hxg082794; Fri, 30 Nov 2018 07:07:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300707.wAU77hxg082794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341308 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B0527133E X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:07:45 -0000 Author: arybchik Date: Fri Nov 30 07:07:43 2018 New Revision: 341308 URL: https://svnweb.freebsd.org/changeset/base/341308 Log: sfxge(4): modify phy caps to indicate FEC request The capability bits to request FEC modes are implicitly valid when the corresponding FEC mode is a supported capability. Drivers expect that it is only valid to advertise those capabilities explicitly marked as supported. The capabilities reported by firmware is modified with the implicit capabilities to present the explicit model to drivers. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18270 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:07:31 2018 (r341307) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:07:43 2018 (r341308) @@ -1799,6 +1799,21 @@ ef10_nic_board_cfg( if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) goto fail6; + /* + * Firmware with support for *_FEC capability bits does not + * report that the corresponding *_FEC_REQUESTED bits are supported. + * Add them here so that drivers understand that they are supported. + */ + if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_BASER_FEC)) + epp->ep_phy_cap_mask |= + (1u << EFX_PHY_CAP_BASER_FEC_REQUESTED); + if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_RS_FEC)) + epp->ep_phy_cap_mask |= + (1u << EFX_PHY_CAP_RS_FEC_REQUESTED); + if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_25G_BASER_FEC)) + epp->ep_phy_cap_mask |= + (1u << EFX_PHY_CAP_25G_BASER_FEC_REQUESTED); + /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:07:31 2018 (r341307) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:07:43 2018 (r341308) @@ -221,11 +221,6 @@ efx_phy_adv_cap_get( } } -#define EFX_PHY_CAP_FEC_REQ_MASK \ - (1U << EFX_PHY_CAP_BASER_FEC_REQUESTED) | \ - (1U << EFX_PHY_CAP_RS_FEC_REQUESTED) | \ - (1U << EFX_PHY_CAP_25G_BASER_FEC_REQUESTED) - __checkReturn efx_rc_t efx_phy_adv_cap_set( __in efx_nic_t *enp, @@ -239,8 +234,7 @@ efx_phy_adv_cap_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); - /* Ignore don't care bits of FEC (FEC EFX_PHY_CAP_*_REQUESTED) */ - if ((mask & ~(epp->ep_phy_cap_mask | EFX_PHY_CAP_FEC_REQ_MASK)) != 0) { + if ((mask & ~epp->ep_phy_cap_mask) != 0) { rc = ENOTSUP; goto fail1; } From owner-svn-src-head@freebsd.org Fri Nov 30 07:07:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0EA115A7D6; Fri, 30 Nov 2018 07:07:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDEC37143B; Fri, 30 Nov 2018 07:07:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7890825250; Fri, 30 Nov 2018 07:07:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU77sxj082977; Fri, 30 Nov 2018 07:07:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU77sIA082976; Fri, 30 Nov 2018 07:07:54 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300707.wAU77sIA082976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341309 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDEC37143B X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:07:55 -0000 Author: arybchik Date: Fri Nov 30 07:07:54 2018 New Revision: 341309 URL: https://svnweb.freebsd.org/changeset/base/341309 Log: sfxge(4): fix MAC Tx stats for less or equal to 64 bytes This statistic should include 64byte and smaller frames. Fix EF10 calculation to match Siena code. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18271 Modified: head/sys/dev/sfxge/common/ef10_mac.c Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Fri Nov 30 07:07:43 2018 (r341308) +++ head/sys/dev/sfxge/common/ef10_mac.c Fri Nov 30 07:07:54 2018 (r341309) @@ -677,7 +677,7 @@ ef10_mac_stats_update( EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value); - EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); + EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value); From owner-svn-src-head@freebsd.org Fri Nov 30 07:08:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C83E115A842; Fri, 30 Nov 2018 07:08:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9EA9716A0; Fri, 30 Nov 2018 07:08:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90F6C25262; Fri, 30 Nov 2018 07:08:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU78GCI083128; Fri, 30 Nov 2018 07:08:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU78GaU083127; Fri, 30 Nov 2018 07:08:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300708.wAU78GaU083127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341311 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9EA9716A0 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:08:18 -0000 Author: arybchik Date: Fri Nov 30 07:08:16 2018 New Revision: 341311 URL: https://svnweb.freebsd.org/changeset/base/341311 Log: sfxge(4): make last byte of module information available Adjust bounds so the interface supports reading the last available byte of data. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18273 Modified: head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:08:05 2018 (r341310) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:08:16 2018 (r341311) @@ -326,7 +326,7 @@ efx_phy_module_get_info( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(data != NULL); - if ((uint32_t)offset + len > 0xff) { + if ((uint32_t)offset + len > 0x100) { rc = EINVAL; goto fail1; } From owner-svn-src-head@freebsd.org Fri Nov 30 07:08:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C297115A805; Fri, 30 Nov 2018 07:08:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EF5971580; Fri, 30 Nov 2018 07:08:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6BB025259; Fri, 30 Nov 2018 07:08:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU785ug083051; Fri, 30 Nov 2018 07:08:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU785Wu083049; Fri, 30 Nov 2018 07:08:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300708.wAU785Wu083049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341310 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EF5971580 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:08:07 -0000 Author: arybchik Date: Fri Nov 30 07:08:05 2018 New Revision: 341310 URL: https://svnweb.freebsd.org/changeset/base/341310 Log: sfxge(4): add helper API to make Geneve filter spec Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18272 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:07:54 2018 (r341309) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:08:05 2018 (r341310) @@ -2988,9 +2988,23 @@ efx_filter_spec_set_encap_type( __in efx_filter_inner_frame_match_t inner_frame_match); extern __checkReturn efx_rc_t -efx_filter_spec_set_vxlan_full( +efx_filter_spec_set_vxlan( __inout efx_filter_spec_t *spec, - __in const uint8_t *vxlan_id, + __in const uint8_t *vni, + __in const uint8_t *inner_addr, + __in const uint8_t *outer_addr); + +extern __checkReturn efx_rc_t +efx_filter_spec_set_geneve( + __inout efx_filter_spec_t *spec, + __in const uint8_t *vni, + __in const uint8_t *inner_addr, + __in const uint8_t *outer_addr); + +extern __checkReturn efx_rc_t +efx_filter_spec_set_nvgre( + __inout efx_filter_spec_t *spec, + __in const uint8_t *vsid, __in const uint8_t *inner_addr, __in const uint8_t *outer_addr); Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 30 07:07:54 2018 (r341309) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 30 07:08:05 2018 (r341310) @@ -519,27 +519,42 @@ fail1: } /* - * Specify inner and outer Ethernet address and VXLAN ID in filter + * Specify inner and outer Ethernet address and VNI or VSID in tunnel filter * specification. */ - __checkReturn efx_rc_t -efx_filter_spec_set_vxlan_full( - __inout efx_filter_spec_t *spec, - __in const uint8_t *vxlan_id, +static __checkReturn efx_rc_t +efx_filter_spec_set_tunnel( + __inout efx_filter_spec_t *spec, + __in efx_tunnel_protocol_t encap_type, + __in const uint8_t *vni_or_vsid, __in const uint8_t *inner_addr, __in const uint8_t *outer_addr) { + efx_rc_t rc; + EFSYS_ASSERT3P(spec, !=, NULL); - EFSYS_ASSERT3P(vxlan_id, !=, NULL); + EFSYS_ASSERT3P(vni_or_vsid, !=, NULL); EFSYS_ASSERT3P(inner_addr, !=, NULL); EFSYS_ASSERT3P(outer_addr, !=, NULL); - if ((inner_addr == NULL) && (outer_addr == NULL)) - return (EINVAL); + switch (encap_type) { + case EFX_TUNNEL_PROTOCOL_VXLAN: + case EFX_TUNNEL_PROTOCOL_GENEVE: + case EFX_TUNNEL_PROTOCOL_NVGRE: + break; + default: + rc = EINVAL; + goto fail1; + } - if (vxlan_id != NULL) { + if ((inner_addr == NULL) && (outer_addr == NULL)) { + rc = EINVAL; + goto fail2; + } + + if (vni_or_vsid != NULL) { spec->efs_match_flags |= EFX_FILTER_MATCH_VNI_OR_VSID; - memcpy(spec->efs_vni_or_vsid, vxlan_id, EFX_VNI_OR_VSID_LEN); + memcpy(spec->efs_vni_or_vsid, vni_or_vsid, EFX_VNI_OR_VSID_LEN); } if (outer_addr != NULL) { spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC; @@ -549,10 +564,63 @@ efx_filter_spec_set_vxlan_full( spec->efs_match_flags |= EFX_FILTER_MATCH_IFRM_LOC_MAC; memcpy(spec->efs_ifrm_loc_mac, inner_addr, EFX_MAC_ADDR_LEN); } + spec->efs_match_flags |= EFX_FILTER_MATCH_ENCAP_TYPE; - spec->efs_encap_type = EFX_TUNNEL_PROTOCOL_VXLAN; + spec->efs_encap_type = encap_type; return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Specify inner and outer Ethernet address and VNI in VXLAN filter + * specification. + */ +__checkReturn efx_rc_t +efx_filter_spec_set_vxlan( + __inout efx_filter_spec_t *spec, + __in const uint8_t *vni, + __in const uint8_t *inner_addr, + __in const uint8_t *outer_addr) +{ + return efx_filter_spec_set_tunnel(spec, EFX_TUNNEL_PROTOCOL_VXLAN, + vni, inner_addr, outer_addr); +} + +/* + * Specify inner and outer Ethernet address and VNI in Geneve filter + * specification. + */ +__checkReturn efx_rc_t +efx_filter_spec_set_geneve( + __inout efx_filter_spec_t *spec, + __in const uint8_t *vni, + __in const uint8_t *inner_addr, + __in const uint8_t *outer_addr) +{ + return efx_filter_spec_set_tunnel(spec, EFX_TUNNEL_PROTOCOL_GENEVE, + vni, inner_addr, outer_addr); +} + +/* + * Specify inner and outer Ethernet address and vsid in NVGRE filter + * specification. + */ +__checkReturn efx_rc_t +efx_filter_spec_set_nvgre( + __inout efx_filter_spec_t *spec, + __in const uint8_t *vsid, + __in const uint8_t *inner_addr, + __in const uint8_t *outer_addr) +{ + return efx_filter_spec_set_tunnel(spec, EFX_TUNNEL_PROTOCOL_NVGRE, + vsid, inner_addr, outer_addr); } #if EFSYS_OPT_RX_SCALE From owner-svn-src-head@freebsd.org Fri Nov 30 07:08:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0708C115A8E8; Fri, 30 Nov 2018 07:08:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FB2C717C7; Fri, 30 Nov 2018 07:08:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA8A52526B; Fri, 30 Nov 2018 07:08:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU78RkK083195; Fri, 30 Nov 2018 07:08:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU78RUH083194; Fri, 30 Nov 2018 07:08:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300708.wAU78RUH083194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341312 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FB2C717C7 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:08:29 -0000 Author: arybchik Date: Fri Nov 30 07:08:27 2018 New Revision: 341312 URL: https://svnweb.freebsd.org/changeset/base/341312 Log: sfxge(4): expose PHY module device address constants Rearrange so the valid addresses are visible to the caller. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18274 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:08:16 2018 (r341311) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:08:27 2018 (r341312) @@ -1058,6 +1058,27 @@ efx_phy_media_type_get( __in efx_nic_t *enp, __out efx_phy_media_type_t *typep); +/* + * 2-wire device address of the base information in accordance with SFF-8472 + * Diagnostic Monitoring Interface for Optical Transceivers section + * 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE 0xA0 + +/* + * 2-wire device address of the digital diagnostics monitoring interface + * in accordance with SFF-8472 Diagnostic Monitoring Interface for Optical + * Transceivers section 4 Memory Organization. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM 0xA2 + +/* + * Hard wired 2-wire device address for QSFP+ in accordance with SFF-8436 + * QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER section 7.4 Device Addressing and + * Operation. + */ +#define EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP 0xA0 + extern __checkReturn efx_rc_t efx_phy_module_get_info( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:08:16 2018 (r341311) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:08:27 2018 (r341312) @@ -2239,27 +2239,6 @@ fail1: return (rc); } -/* - * 2-wire device address of the base information in accordance with SFF-8472 - * Diagnostic Monitoring Interface for Optical Transceivers section - * 4 Memory Organization. - */ -#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_BASE 0xA0 - -/* - * 2-wire device address of the digital diagnostics monitoring interface - * in accordance with SFF-8472 Diagnostic Monitoring Interface for Optical - * Transceivers section 4 Memory Organization. - */ -#define EFX_PHY_MEDIA_INFO_DEV_ADDR_SFP_DDM 0xA2 - -/* - * Hard wired 2-wire device address for QSFP+ in accordance with SFF-8436 - * QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER section 7.4 Device Addressing and - * Operation. - */ -#define EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP 0xA0 - __checkReturn efx_rc_t efx_mcdi_phy_module_get_info( __in efx_nic_t *enp, From owner-svn-src-head@freebsd.org Fri Nov 30 07:08:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B1DB115A942; Fri, 30 Nov 2018 07:08:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A695771901; Fri, 30 Nov 2018 07:08:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80C8F2526C; Fri, 30 Nov 2018 07:08:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU78dVF083255; Fri, 30 Nov 2018 07:08:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU78cHV083251; Fri, 30 Nov 2018 07:08:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300708.wAU78cHV083251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341313 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A695771901 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:08:41 -0000 Author: arybchik Date: Fri Nov 30 07:08:38 2018 New Revision: 341313 URL: https://svnweb.freebsd.org/changeset/base/341313 Log: sfxge(4): adjust PHY module info interface Adjust data types in interface to permit the complete module information buffer to be obtained in a single call. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18275 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:08:27 2018 (r341312) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:08:38 2018 (r341313) @@ -1079,12 +1079,18 @@ efx_phy_media_type_get( */ #define EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP 0xA0 +/* + * Maximum accessible data offset for PHY module information. + */ +#define EFX_PHY_MEDIA_INFO_MAX_OFFSET 0x100 + + extern __checkReturn efx_rc_t efx_phy_module_get_info( __in efx_nic_t *enp, __in uint8_t dev_addr, - __in uint8_t offset, - __in uint8_t len, + __in size_t offset, + __in size_t len, __out_bcount(len) uint8_t *data); #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:08:27 2018 (r341312) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:08:38 2018 (r341313) @@ -2243,8 +2243,8 @@ fail1: efx_mcdi_phy_module_get_info( __in efx_nic_t *enp, __in uint8_t dev_addr, - __in uint8_t offset, - __in uint8_t len, + __in size_t offset, + __in size_t len, __out_bcount(len) uint8_t *data) { efx_port_t *epp = &(enp->en_port); @@ -2325,12 +2325,14 @@ efx_mcdi_phy_module_get_info( goto fail1; } + EFX_STATIC_ASSERT(EFX_PHY_MEDIA_INFO_PAGE_SIZE <= 0xFF); + if (offset < EFX_PHY_MEDIA_INFO_PAGE_SIZE) { - uint8_t read_len = + size_t read_len = MIN(len, EFX_PHY_MEDIA_INFO_PAGE_SIZE - offset); rc = efx_mcdi_get_phy_media_info(enp, - mcdi_lower_page, offset, read_len, data); + mcdi_lower_page, (uint8_t)offset, (uint8_t)read_len, data); if (rc != 0) goto fail2; @@ -2347,7 +2349,7 @@ efx_mcdi_phy_module_get_info( EFSYS_ASSERT3U(offset, <, EFX_PHY_MEDIA_INFO_PAGE_SIZE); rc = efx_mcdi_get_phy_media_info(enp, - mcdi_upper_page, offset, len, data); + mcdi_upper_page, (uint8_t)offset, (uint8_t)len, data); if (rc != 0) goto fail3; } Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 30 07:08:27 2018 (r341312) +++ head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 30 07:08:38 2018 (r341313) @@ -247,8 +247,8 @@ extern __checkReturn efx_rc_t efx_mcdi_phy_module_get_info( __in efx_nic_t *enp, __in uint8_t dev_addr, - __in uint8_t offset, - __in uint8_t len, + __in size_t offset, + __in size_t len, __out_bcount(len) uint8_t *data); #define MCDI_IN(_emr, _type, _ofst) \ Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:08:27 2018 (r341312) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:08:38 2018 (r341313) @@ -317,8 +317,8 @@ efx_phy_media_type_get( efx_phy_module_get_info( __in efx_nic_t *enp, __in uint8_t dev_addr, - __in uint8_t offset, - __in uint8_t len, + __in size_t offset, + __in size_t len, __out_bcount(len) uint8_t *data) { efx_rc_t rc; @@ -326,7 +326,8 @@ efx_phy_module_get_info( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(data != NULL); - if ((uint32_t)offset + len > 0x100) { + if ((offset > EFX_PHY_MEDIA_INFO_MAX_OFFSET) || + ((offset + len) > EFX_PHY_MEDIA_INFO_MAX_OFFSET)) { rc = EINVAL; goto fail1; } From owner-svn-src-head@freebsd.org Fri Nov 30 07:08:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9807115A99A; Fri, 30 Nov 2018 07:08:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A22C71A3E; Fri, 30 Nov 2018 07:08:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ED122526D; Fri, 30 Nov 2018 07:08:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU78oYC083312; Fri, 30 Nov 2018 07:08:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU78onI083311; Fri, 30 Nov 2018 07:08:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300708.wAU78onI083311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341314 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A22C71A3E X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:08:53 -0000 Author: arybchik Date: Fri Nov 30 07:08:50 2018 New Revision: 341314 URL: https://svnweb.freebsd.org/changeset/base/341314 Log: sfxge(4): update to current port mode terminology >From Medford onwards, the newer constants enumerating port modes should be used. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18276 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:08:38 2018 (r341313) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:08:50 2018 (r341314) @@ -162,26 +162,29 @@ ef10_nic_get_port_mode_bandwidth( efx_rc_t rc; switch (port_mode) { - case TLV_PORT_MODE_10G: + case TLV_PORT_MODE_1x1_NA: /* mode 0 */ bandwidth = 10000; break; - case TLV_PORT_MODE_10G_10G: + case TLV_PORT_MODE_1x1_1x1: /* mode 2 */ bandwidth = 10000 * 2; break; - case TLV_PORT_MODE_10G_10G_10G_10G: - case TLV_PORT_MODE_10G_10G_10G_10G_Q: - case TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2: - case TLV_PORT_MODE_10G_10G_10G_10G_Q2: + case TLV_PORT_MODE_4x1_NA: /* mode 4 */ + case TLV_PORT_MODE_2x1_2x1: /* mode 5 */ + case TLV_PORT_MODE_NA_4x1: /* mode 8 */ bandwidth = 10000 * 4; break; - case TLV_PORT_MODE_40G: + /* Legacy Medford-only mode. Do not use (see bug63270) */ + case TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2: /* mode 9 */ + bandwidth = 10000 * 4; + break; + case TLV_PORT_MODE_1x4_NA: /* mode 1 */ bandwidth = 40000; break; - case TLV_PORT_MODE_40G_40G: + case TLV_PORT_MODE_1x4_1x4: /* mode 3 */ bandwidth = 40000 * 2; break; - case TLV_PORT_MODE_40G_10G_10G: - case TLV_PORT_MODE_10G_10G_40G: + case TLV_PORT_MODE_1x4_2x1: /* mode 6 */ + case TLV_PORT_MODE_2x1_1x4: /* mode 7 */ bandwidth = 40000 + (10000 * 2); break; default: @@ -1495,8 +1498,8 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1U << TLV_PORT_MODE_10G) | /* mode 0 */ - (1U << TLV_PORT_MODE_10G_10G), /* mode 2 */ + (1U << TLV_PORT_MODE_1x1_NA) | /* mode 0 */ + (1U << TLV_PORT_MODE_1x1_1x1), /* mode 2 */ 1, /* ports per cage */ 1 /* first cage */ }, @@ -1510,10 +1513,10 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1U << TLV_PORT_MODE_40G) | /* mode 1 */ - (1U << TLV_PORT_MODE_40G_40G) | /* mode 3 */ - (1U << TLV_PORT_MODE_40G_10G_10G) | /* mode 6 */ - (1U << TLV_PORT_MODE_10G_10G_40G) | /* mode 7 */ + (1U << TLV_PORT_MODE_1x4_NA) | /* mode 1 */ + (1U << TLV_PORT_MODE_1x4_1x4) | /* mode 3 */ + (1U << TLV_PORT_MODE_1x4_2x1) | /* mode 6 */ + (1U << TLV_PORT_MODE_2x1_1x4) | /* mode 7 */ /* Do not use 10G_10G_10G_10G_Q1_Q2 (see bug63270) */ (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2), /* mode 9 */ 2, /* ports per cage */ @@ -1529,9 +1532,9 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q) | /* mode 5 */ + (1U << TLV_PORT_MODE_2x1_2x1) | /* mode 5 */ /* Do not use 10G_10G_10G_10G_Q1 (see bug63270) */ - (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q1), /* mode 4 */ + (1U << TLV_PORT_MODE_4x1_NA), /* mode 4 */ 4, /* ports per cage */ 1 /* first cage */ }, @@ -1545,7 +1548,7 @@ static struct ef10_external_port_map_s { */ { EFX_FAMILY_MEDFORD, - (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q2), /* mode 8 */ + (1U << TLV_PORT_MODE_NA_4x1), /* mode 8 */ 4, /* ports per cage */ 2 /* first cage */ }, From owner-svn-src-head@freebsd.org Fri Nov 30 07:09:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 484C7115AA12; Fri, 30 Nov 2018 07:09:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E10A371B5B; Fri, 30 Nov 2018 07:09:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E47925273; Fri, 30 Nov 2018 07:09:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU791iQ083501; Fri, 30 Nov 2018 07:09:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU791Wq083500; Fri, 30 Nov 2018 07:09:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300709.wAU791Wq083500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341315 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E10A371B5B X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:09:03 -0000 Author: arybchik Date: Fri Nov 30 07:09:00 2018 New Revision: 341315 URL: https://svnweb.freebsd.org/changeset/base/341315 Log: sfxge(4): add X2 port modes to bandwidth calculator Add cases for the new port modes supported by X2 NICs. Lane bandwidth is calculated for pre-X2 cards so is an underestimate for X2 in 25G/100G modes. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18277 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:08:50 2018 (r341314) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:00 2018 (r341315) @@ -158,34 +158,59 @@ ef10_nic_get_port_mode_bandwidth( __in uint32_t port_mode, __out uint32_t *bandwidth_mbpsp) { + uint32_t single_lane = 10000; + uint32_t dual_lane = 50000; + uint32_t quad_lane = 40000; uint32_t bandwidth; efx_rc_t rc; switch (port_mode) { case TLV_PORT_MODE_1x1_NA: /* mode 0 */ - bandwidth = 10000; + bandwidth = single_lane; break; + case TLV_PORT_MODE_1x2_NA: /* mode 10 */ + case TLV_PORT_MODE_NA_1x2: /* mode 11 */ + bandwidth = dual_lane; + break; case TLV_PORT_MODE_1x1_1x1: /* mode 2 */ - bandwidth = 10000 * 2; + bandwidth = single_lane + single_lane; break; case TLV_PORT_MODE_4x1_NA: /* mode 4 */ - case TLV_PORT_MODE_2x1_2x1: /* mode 5 */ case TLV_PORT_MODE_NA_4x1: /* mode 8 */ - bandwidth = 10000 * 4; + bandwidth = 4 * single_lane; break; + case TLV_PORT_MODE_2x1_2x1: /* mode 5 */ + bandwidth = (2 * single_lane) + (2 * single_lane); + break; + case TLV_PORT_MODE_1x2_1x2: /* mode 12 */ + bandwidth = dual_lane + dual_lane; + break; + case TLV_PORT_MODE_1x2_2x1: /* mode 17 */ + case TLV_PORT_MODE_2x1_1x2: /* mode 18 */ + bandwidth = dual_lane + (2 * single_lane); + break; /* Legacy Medford-only mode. Do not use (see bug63270) */ case TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2: /* mode 9 */ - bandwidth = 10000 * 4; + bandwidth = 4 * single_lane; break; case TLV_PORT_MODE_1x4_NA: /* mode 1 */ - bandwidth = 40000; + case TLV_PORT_MODE_NA_1x4: /* mode 22 */ + bandwidth = quad_lane; break; - case TLV_PORT_MODE_1x4_1x4: /* mode 3 */ - bandwidth = 40000 * 2; + case TLV_PORT_MODE_2x2_NA: /* mode 13 */ + case TLV_PORT_MODE_NA_2x2: /* mode 14 */ + bandwidth = 2 * dual_lane; break; case TLV_PORT_MODE_1x4_2x1: /* mode 6 */ case TLV_PORT_MODE_2x1_1x4: /* mode 7 */ - bandwidth = 40000 + (10000 * 2); + bandwidth = quad_lane + (2 * single_lane); + break; + case TLV_PORT_MODE_1x4_1x2: /* mode 15 */ + case TLV_PORT_MODE_1x2_1x4: /* mode 16 */ + bandwidth = quad_lane + dual_lane; + break; + case TLV_PORT_MODE_1x4_1x4: /* mode 3 */ + bandwidth = quad_lane + quad_lane; break; default: rc = EINVAL; From owner-svn-src-head@freebsd.org Fri Nov 30 07:09:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E139115AA5D; Fri, 30 Nov 2018 07:09:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 206FC71CC4; Fri, 30 Nov 2018 07:09:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DF9725278; Fri, 30 Nov 2018 07:09:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU79DRH083578; Fri, 30 Nov 2018 07:09:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU79CWC083572; Fri, 30 Nov 2018 07:09:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300709.wAU79CWC083572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341316 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 206FC71CC4 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:09:16 -0000 Author: arybchik Date: Fri Nov 30 07:09:11 2018 New Revision: 341316 URL: https://svnweb.freebsd.org/changeset/base/341316 Log: sfxge(4): support improvements to bandwidth calculations Change the interface to ef10_nic_get_port_mode_bandwidth() so more NIC information can be used to infer bandwidth requirements. Huntington calculations separated out completely. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18278 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford2_nic.c head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:09:00 2018 (r341315) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:09:11 2018 (r341316) @@ -1200,7 +1200,7 @@ efx_mcdi_get_port_modes( extern __checkReturn efx_rc_t ef10_nic_get_port_mode_bandwidth( - __in uint32_t port_mode, + __in efx_nic_t *enp, __out uint32_t *bandwidth_mbpsp); extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:00 2018 (r341315) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:11 2018 (r341316) @@ -155,16 +155,24 @@ fail1: __checkReturn efx_rc_t ef10_nic_get_port_mode_bandwidth( - __in uint32_t port_mode, + __in efx_nic_t *enp, __out uint32_t *bandwidth_mbpsp) { + uint32_t port_modes; + uint32_t current_mode; uint32_t single_lane = 10000; uint32_t dual_lane = 50000; uint32_t quad_lane = 40000; uint32_t bandwidth; efx_rc_t rc; - switch (port_mode) { + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, + ¤t_mode, NULL)) != 0) { + /* No port mode info available. */ + goto fail1; + } + + switch (current_mode) { case TLV_PORT_MODE_1x1_NA: /* mode 0 */ bandwidth = single_lane; break; @@ -214,13 +222,15 @@ ef10_nic_get_port_mode_bandwidth( break; default: rc = EINVAL; - goto fail1; + goto fail2; } *bandwidth_mbpsp = bandwidth; return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 30 07:09:00 2018 (r341315) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 30 07:09:11 2018 (r341316) @@ -47,7 +47,6 @@ hunt_nic_get_required_pcie_bandwidth( __out uint32_t *bandwidth_mbpsp) { uint32_t port_modes; - uint32_t max_port_mode; uint32_t bandwidth; efx_rc_t rc; @@ -74,17 +73,13 @@ hunt_nic_get_required_pcie_bandwidth( goto fail1; } else { if (port_modes & (1U << TLV_PORT_MODE_40G)) { - max_port_mode = TLV_PORT_MODE_40G; + bandwidth = 40000; } else if (port_modes & (1U << TLV_PORT_MODE_10G_10G_10G_10G)) { - max_port_mode = TLV_PORT_MODE_10G_10G_10G_10G; + bandwidth = 4 * 10000; } else { /* Assume two 10G ports */ - max_port_mode = TLV_PORT_MODE_10G_10G; + bandwidth = 2 * 10000; } - - if ((rc = ef10_nic_get_port_mode_bandwidth(max_port_mode, - &bandwidth)) != 0) - goto fail2; } out: @@ -92,8 +87,6 @@ out: return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/medford2_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford2_nic.c Fri Nov 30 07:09:00 2018 (r341315) +++ head/sys/dev/sfxge/common/medford2_nic.c Fri Nov 30 07:09:11 2018 (r341316) @@ -44,25 +44,15 @@ medford2_nic_get_required_pcie_bandwidth( __in efx_nic_t *enp, __out uint32_t *bandwidth_mbpsp) { - uint32_t port_modes; - uint32_t current_mode; uint32_t bandwidth; efx_rc_t rc; /* FIXME: support new Medford2 dynamic port modes */ - if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, - ¤t_mode, NULL)) != 0) { - /* No port mode info available. */ - bandwidth = 0; - goto out; - } - - if ((rc = ef10_nic_get_port_mode_bandwidth(current_mode, + if ((rc = ef10_nic_get_port_mode_bandwidth(enp, &bandwidth)) != 0) goto fail1; -out: *bandwidth_mbpsp = bandwidth; return (0); Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Nov 30 07:09:00 2018 (r341315) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Nov 30 07:09:11 2018 (r341316) @@ -42,23 +42,13 @@ medford_nic_get_required_pcie_bandwidth( __in efx_nic_t *enp, __out uint32_t *bandwidth_mbpsp) { - uint32_t port_modes; - uint32_t current_mode; uint32_t bandwidth; efx_rc_t rc; - if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, - ¤t_mode, NULL)) != 0) { - /* No port mode info available. */ - bandwidth = 0; - goto out; - } - - if ((rc = ef10_nic_get_port_mode_bandwidth(current_mode, + if ((rc = ef10_nic_get_port_mode_bandwidth(enp, &bandwidth)) != 0) goto fail1; -out: *bandwidth_mbpsp = bandwidth; return (0); From owner-svn-src-head@freebsd.org Fri Nov 30 07:09:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A54115AB19; Fri, 30 Nov 2018 07:09:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20D4D71F4E; Fri, 30 Nov 2018 07:09:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92DCC25285; Fri, 30 Nov 2018 07:09:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU79ZcH083769; Fri, 30 Nov 2018 07:09:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU79ZP3083766; Fri, 30 Nov 2018 07:09:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300709.wAU79ZP3083766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341319 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20D4D71F4E X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:09:45 -0000 Author: arybchik Date: Fri Nov 30 07:09:34 2018 New Revision: 341319 URL: https://svnweb.freebsd.org/changeset/base/341319 Log: sfxge(4): guard Rx scale code with corresponding option Previously only some of the code was guarded by this which caused a build error when EFSYS_OPT_RX_SCALE is 0 (e.g. in manftest). Submitted by: Tom Millington Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18280 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:29 2018 (r341318) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:34 2018 (r341319) @@ -1113,11 +1113,13 @@ ef10_get_datapath_caps( } encp->enc_rx_prefix_size = 14; +#if EFSYS_OPT_RX_SCALE /* Check if the firmware supports additional RSS modes */ if (CAP_FLAGS1(req, ADDITIONAL_RSS_MODES)) encp->enc_rx_scale_additional_modes_supported = B_TRUE; else encp->enc_rx_scale_additional_modes_supported = B_FALSE; +#endif /* EFSYS_OPT_RX_SCALE */ /* Check if the firmware supports TSO */ if (CAP_FLAGS1(req, TX_TSO)) @@ -1323,6 +1325,7 @@ ef10_get_datapath_caps( else encp->enc_hlb_counters = B_FALSE; +#if EFSYS_OPT_RX_SCALE if (CAP_FLAGS1(req, RX_RSS_LIMITED)) { /* Only one exclusive RSS context is available per port. */ encp->enc_rx_scale_max_exclusive_contexts = 1; @@ -1372,6 +1375,8 @@ ef10_get_datapath_caps( */ encp->enc_rx_scale_l4_hash_supported = B_TRUE; } +#endif /* EFSYS_OPT_RX_SCALE */ + /* Check if the firmware supports "FLAG" and "MARK" filter actions */ if (CAP_FLAGS2(req, FILTER_ACTION_FLAG)) encp->enc_filter_action_flag_supported = B_TRUE; @@ -1395,8 +1400,10 @@ ef10_get_datapath_caps( return (0); +#if EFSYS_OPT_RX_SCALE fail5: EFSYS_PROBE(fail5); +#endif /* EFSYS_OPT_RX_SCALE */ fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:09:29 2018 (r341318) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:09:34 2018 (r341319) @@ -1309,6 +1309,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_prefix_size; uint32_t enc_rx_buf_align_start; uint32_t enc_rx_buf_align_end; +#if EFSYS_OPT_RX_SCALE uint32_t enc_rx_scale_max_exclusive_contexts; /* * Mask of supported hash algorithms. @@ -1321,6 +1322,7 @@ typedef struct efx_nic_cfg_s { */ boolean_t enc_rx_scale_l4_hash_supported; boolean_t enc_rx_scale_additional_modes_supported; +#endif /* EFSYS_OPT_RX_SCALE */ #if EFSYS_OPT_LOOPBACK efx_qword_t enc_loopback_types[EFX_LINK_NMODES]; #endif /* EFSYS_OPT_LOOPBACK */ Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Fri Nov 30 07:09:29 2018 (r341318) +++ head/sys/dev/sfxge/common/siena_nic.c Fri Nov 30 07:09:34 2018 (r341319) @@ -143,6 +143,7 @@ siena_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = 1; +#if EFSYS_OPT_RX_SCALE /* There is one RSS context per function */ encp->enc_rx_scale_max_exclusive_contexts = 1; @@ -157,6 +158,7 @@ siena_board_cfg( /* There is no support for additional RSS modes */ encp->enc_rx_scale_additional_modes_supported = B_FALSE; +#endif /* EFSYS_OPT_RX_SCALE */ encp->enc_tx_dma_desc_size_max = EFX_MASK32(FSF_AZ_TX_KER_BYTE_COUNT); /* Fragments must not span 4k boundaries. */ From owner-svn-src-head@freebsd.org Fri Nov 30 07:09:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA4CB115AAB4; Fri, 30 Nov 2018 07:09:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E9FF71DE3; Fri, 30 Nov 2018 07:09:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 504AF2527B; Fri, 30 Nov 2018 07:09:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU79OMM083655; Fri, 30 Nov 2018 07:09:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU79OFh083654; Fri, 30 Nov 2018 07:09:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300709.wAU79OFh083654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341317 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E9FF71DE3 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:09:28 -0000 Author: arybchik Date: Fri Nov 30 07:09:23 2018 New Revision: 341317 URL: https://svnweb.freebsd.org/changeset/base/341317 Log: sfxge(4): infer port mode bandwidth from max link speed Limit the port mode bandwidth calculations by the maximum reported link speed. This system detects 25G vs 10G cards, and 100G port modes vs 40G. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18279 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:11 2018 (r341316) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:23 2018 (r341317) @@ -160,9 +160,11 @@ ef10_nic_get_port_mode_bandwidth( { uint32_t port_modes; uint32_t current_mode; - uint32_t single_lane = 10000; - uint32_t dual_lane = 50000; - uint32_t quad_lane = 40000; + efx_port_t *epp = &(enp->en_port); + + uint32_t single_lane; + uint32_t dual_lane; + uint32_t quad_lane; uint32_t bandwidth; efx_rc_t rc; @@ -171,6 +173,21 @@ ef10_nic_get_port_mode_bandwidth( /* No port mode info available. */ goto fail1; } + + if (epp->ep_phy_cap_mask & (1 << EFX_PHY_CAP_25000FDX)) + single_lane = 25000; + else + single_lane = 10000; + + if (epp->ep_phy_cap_mask & (1 << EFX_PHY_CAP_50000FDX)) + dual_lane = 50000; + else + dual_lane = 20000; + + if (epp->ep_phy_cap_mask & (1 << EFX_PHY_CAP_100000FDX)) + quad_lane = 100000; + else + quad_lane = 40000; switch (current_mode) { case TLV_PORT_MODE_1x1_NA: /* mode 0 */ From owner-svn-src-head@freebsd.org Fri Nov 30 07:10:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50F99115ABA8; Fri, 30 Nov 2018 07:10:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58881720B1; Fri, 30 Nov 2018 07:09:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31D6B2528A; Fri, 30 Nov 2018 07:09:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU79m6i083834; Fri, 30 Nov 2018 07:09:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU79k8N083825; Fri, 30 Nov 2018 07:09:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300709.wAU79k8N083825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341320 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58881720B1 X-Spamd-Result: default: False [0.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_MEDIUM(0.37)[0.366,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.014,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:10:11 -0000 Author: arybchik Date: Fri Nov 30 07:09:46 2018 New Revision: 341320 URL: https://svnweb.freebsd.org/changeset/base/341320 Log: sfxge(4): add accessor to whole link status Add a function which makes an MCDI GET_LINK request and packages up the results. Currently, the get-link function is triggered from several entry points which then pass on or store selected parts of the data. When the driver needs to obtain the current link state, it is more efficient to do this in a single call. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18281 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:09:34 2018 (r341319) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:09:46 2018 (r341320) @@ -619,11 +619,7 @@ ef10_nvram_buffer_finish( /* PHY */ typedef struct ef10_link_state_s { - uint32_t els_adv_cap_mask; - uint32_t els_lp_cap_mask; - unsigned int els_fcntl; - efx_phy_fec_type_t els_fec; - efx_link_mode_t els_link_mode; + efx_phy_link_state_t epls; #if EFSYS_OPT_LOOPBACK efx_loopback_type_t els_loopback; #endif @@ -660,9 +656,9 @@ ef10_phy_oui_get( __out uint32_t *ouip); extern __checkReturn efx_rc_t -ef10_phy_fec_type_get( +ef10_phy_link_state_get( __in efx_nic_t *enp, - __out efx_phy_fec_type_t *fecp); + __out efx_phy_link_state_t *eplsp); #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Fri Nov 30 07:09:34 2018 (r341319) +++ head/sys/dev/sfxge/common/ef10_mac.c Fri Nov 30 07:09:46 2018 (r341320) @@ -49,10 +49,10 @@ ef10_mac_poll( if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; - epp->ep_adv_cap_mask = els.els_adv_cap_mask; - epp->ep_fcntl = els.els_fcntl; + epp->ep_adv_cap_mask = els.epls.epls_adv_cap_mask; + epp->ep_fcntl = els.epls.epls_fcntl; - *link_modep = els.els_link_mode; + *link_modep = els.epls.epls_link_mode; return (0); Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:34 2018 (r341319) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:09:46 2018 (r341320) @@ -1879,8 +1879,8 @@ ef10_nic_board_cfg( /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; - epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; - epp->ep_adv_cap_mask = els.els_adv_cap_mask; + epp->ep_default_adv_cap_mask = els.epls.epls_adv_cap_mask; + epp->ep_adv_cap_mask = els.epls.epls_adv_cap_mask; /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:09:34 2018 (r341319) +++ head/sys/dev/sfxge/common/ef10_phy.c Fri Nov 30 07:09:46 2018 (r341320) @@ -313,9 +313,9 @@ ef10_phy_get_link( } mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), - &elsp->els_adv_cap_mask); + &elsp->epls.epls_adv_cap_mask); mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), - &elsp->els_lp_cap_mask); + &elsp->epls.epls_lp_cap_mask); if (req.emr_out_length_used < MC_CMD_GET_LINK_OUT_V2_LEN) fec = MC_CMD_FEC_NONE; @@ -325,9 +325,17 @@ ef10_phy_get_link( mcdi_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), - fec, &elsp->els_link_mode, - &elsp->els_fcntl, &elsp->els_fec); + fec, &elsp->epls.epls_link_mode, + &elsp->epls.epls_fcntl, &elsp->epls.epls_fec); + if (req.emr_out_length_used < MC_CMD_GET_LINK_OUT_V2_LEN) { + elsp->epls.epls_ld_cap_mask = 0; + } else { + mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_V2_LD_CAP), + &elsp->epls.epls_ld_cap_mask); + } + + #if EFSYS_OPT_LOOPBACK /* * MC_CMD_LOOPBACK and EFX_LOOPBACK names are equivalent, so use the @@ -570,18 +578,18 @@ ef10_phy_oui_get( } __checkReturn efx_rc_t -ef10_phy_fec_type_get( +ef10_phy_link_state_get( __in efx_nic_t *enp, - __out efx_phy_fec_type_t *fecp) + __out efx_phy_link_state_t *eplsp) { efx_rc_t rc; ef10_link_state_t els; - /* Obtain the active FEC type */ + /* Obtain the active link state */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; - *fecp = els.els_fec; + *eplsp = els.epls; return (0); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:09:34 2018 (r341319) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:09:46 2018 (r341320) @@ -3286,6 +3286,21 @@ efx_phy_fec_type_get( __in efx_nic_t *enp, __out efx_phy_fec_type_t *typep); +typedef struct efx_phy_link_state_s { + uint32_t epls_adv_cap_mask; + uint32_t epls_lp_cap_mask; + uint32_t epls_ld_cap_mask; + unsigned int epls_fcntl; + efx_phy_fec_type_t epls_fec; + efx_link_mode_t epls_link_mode; +} efx_phy_link_state_t; + +extern __checkReturn efx_rc_t +efx_phy_link_state_get( + __in efx_nic_t *enp, + __out efx_phy_link_state_t *eplsp); + + #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:09:34 2018 (r341319) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 30 07:09:46 2018 (r341320) @@ -252,7 +252,7 @@ typedef struct efx_phy_ops_s { efx_rc_t (*epo_reconfigure)(efx_nic_t *); efx_rc_t (*epo_verify)(efx_nic_t *); efx_rc_t (*epo_oui_get)(efx_nic_t *, uint32_t *); - efx_rc_t (*epo_fec_type_get)(efx_nic_t *, efx_phy_fec_type_t *); + efx_rc_t (*epo_link_state_get)(efx_nic_t *, efx_phy_link_state_t *); #if EFSYS_OPT_PHY_STATS efx_rc_t (*epo_stats_update)(efx_nic_t *, efsys_mem_t *, uint32_t *); Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:09:34 2018 (r341319) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Nov 30 07:09:46 2018 (r341320) @@ -44,7 +44,7 @@ static const efx_phy_ops_t __efx_phy_siena_ops = { siena_phy_reconfigure, /* epo_reconfigure */ siena_phy_verify, /* epo_verify */ siena_phy_oui_get, /* epo_oui_get */ - NULL, /* epo_fec_type_get */ + NULL, /* epo_link_state_get */ #if EFSYS_OPT_PHY_STATS siena_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ @@ -64,7 +64,7 @@ static const efx_phy_ops_t __efx_phy_ef10_ops = { ef10_phy_reconfigure, /* epo_reconfigure */ ef10_phy_verify, /* epo_verify */ ef10_phy_oui_get, /* epo_oui_get */ - ef10_phy_fec_type_get, /* epo_fec_type_get */ + ef10_phy_link_state_get, /* epo_link_state_get */ #if EFSYS_OPT_PHY_STATS ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ @@ -351,18 +351,40 @@ efx_phy_fec_type_get( __in efx_nic_t *enp, __out efx_phy_fec_type_t *typep) { + efx_rc_t rc; + efx_phy_link_state_t epls; + + if ((rc = efx_phy_link_state_get(enp, &epls)) != 0) + goto fail1; + + *typep = epls.epls_fec; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_phy_link_state_get( + __in efx_nic_t *enp, + __out efx_phy_link_state_t *eplsp) +{ efx_port_t *epp = &(enp->en_port); const efx_phy_ops_t *epop = epp->ep_epop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); - if (epop->epo_fec_type_get == NULL) { + if (epop->epo_link_state_get == NULL) { rc = ENOTSUP; goto fail1; } - if ((rc = epop->epo_fec_type_get(enp, typep)) != 0) + if ((rc = epop->epo_link_state_get(enp, eplsp)) != 0) goto fail2; return (0); From owner-svn-src-head@freebsd.org Fri Nov 30 07:10:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B1A1115AC0A; Fri, 30 Nov 2018 07:10:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62C1472228; Fri, 30 Nov 2018 07:10:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A70325294; Fri, 30 Nov 2018 07:09:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU79w19084133; Fri, 30 Nov 2018 07:09:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU79wQB084131; Fri, 30 Nov 2018 07:09:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300709.wAU79wQB084131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341321 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62C1472228 X-Spamd-Result: default: False [0.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.01)[0.005,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:10:32 -0000 Author: arybchik Date: Fri Nov 30 07:09:58 2018 New Revision: 341321 URL: https://svnweb.freebsd.org/changeset/base/341321 Log: sfxge(4): use transceiver ID when reading info In efx_mcdi_phy_module_get_info() probe the transceiver identification byte rather than assume the module matches the fixed port type. This supports scenarios such as a SFP mounted in a QSFP port via a QSA module. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18282 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:09:46 2018 (r341320) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 30 07:09:58 2018 (r341321) @@ -2179,6 +2179,14 @@ fail1: */ #define EFX_PHY_MEDIA_INFO_PAGE_SIZE 0x80 +/* + * Transceiver identifiers from SFF-8024 Table 4-1. + */ +#define EFX_SFF_TRANSCEIVER_ID_SFP 0x03 /* SFP/SFP+/SFP28 */ +#define EFX_SFF_TRANSCEIVER_ID_QSFP 0x0c /* QSFP */ +#define EFX_SFF_TRANSCEIVER_ID_QSFP_PLUS 0x0d /* QSFP+ or later */ +#define EFX_SFF_TRANSCEIVER_ID_QSFP28 0x11 /* QSFP28 or later */ + static __checkReturn efx_rc_t efx_mcdi_get_phy_media_info( __in efx_nic_t *enp, @@ -2251,6 +2259,7 @@ efx_mcdi_phy_module_get_info( efx_rc_t rc; uint32_t mcdi_lower_page; uint32_t mcdi_upper_page; + uint8_t id; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); @@ -2264,6 +2273,25 @@ efx_mcdi_phy_module_get_info( */ switch (epp->ep_fixed_port_type) { case EFX_PHY_MEDIA_SFP_PLUS: + case EFX_PHY_MEDIA_QSFP_PLUS: + /* Port type supports modules */ + break; + default: + rc = ENOTSUP; + goto fail1; + } + + /* + * For all supported port types, MCDI page 0 offset 0 holds the + * transceiver identifier. Probe to determine the data layout. + * Definitions from SFF-8024 Table 4-1. + */ + rc = efx_mcdi_get_phy_media_info(enp, 0, 0, sizeof (id), &id); + if (rc != 0) + goto fail2; + + switch (id) { + case EFX_SFF_TRANSCEIVER_ID_SFP: /* * In accordance with SFF-8472 Diagnostic Monitoring * Interface for Optical Transceivers section 4 Memory @@ -2298,10 +2326,12 @@ efx_mcdi_phy_module_get_info( break; default: rc = ENOTSUP; - goto fail1; + goto fail3; } break; - case EFX_PHY_MEDIA_QSFP_PLUS: + case EFX_SFF_TRANSCEIVER_ID_QSFP: + case EFX_SFF_TRANSCEIVER_ID_QSFP_PLUS: + case EFX_SFF_TRANSCEIVER_ID_QSFP28: switch (dev_addr) { case EFX_PHY_MEDIA_INFO_DEV_ADDR_QSFP: /* @@ -2317,12 +2347,12 @@ efx_mcdi_phy_module_get_info( break; default: rc = ENOTSUP; - goto fail1; + goto fail3; } break; default: rc = ENOTSUP; - goto fail1; + goto fail3; } EFX_STATIC_ASSERT(EFX_PHY_MEDIA_INFO_PAGE_SIZE <= 0xFF); @@ -2334,7 +2364,7 @@ efx_mcdi_phy_module_get_info( rc = efx_mcdi_get_phy_media_info(enp, mcdi_lower_page, (uint8_t)offset, (uint8_t)read_len, data); if (rc != 0) - goto fail2; + goto fail4; data += read_len; len -= read_len; @@ -2351,11 +2381,15 @@ efx_mcdi_phy_module_get_info( rc = efx_mcdi_get_phy_media_info(enp, mcdi_upper_page, (uint8_t)offset, (uint8_t)len, data); if (rc != 0) - goto fail3; + goto fail5; } return (0); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-head@freebsd.org Fri Nov 30 07:10:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 594C8115AC3B; Fri, 30 Nov 2018 07:10:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FEEA72311; Fri, 30 Nov 2018 07:10:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCA3E25298; Fri, 30 Nov 2018 07:10:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU7A9fa084246; Fri, 30 Nov 2018 07:10:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU7A9WM084245; Fri, 30 Nov 2018 07:10:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300710.wAU7A9WM084245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341322 - head/sys/dev/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge X-SVN-Commit-Revision: 341322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FEEA72311 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.00)[-0.004,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:10:35 -0000 Author: arybchik Date: Fri Nov 30 07:10:09 2018 New Revision: 341322 URL: https://svnweb.freebsd.org/changeset/base/341322 Log: sfxge(4): support new link modes in the driver Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18283 Modified: head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Fri Nov 30 07:09:58 2018 (r341321) +++ head/sys/dev/sfxge/sfxge_port.c Fri Nov 30 07:10:09 2018 (r341322) @@ -308,7 +308,10 @@ static const uint64_t sfxge_link_baudrate[EFX_LINK_NMO [EFX_LINK_1000HDX] = IF_Gbps(1), [EFX_LINK_1000FDX] = IF_Gbps(1), [EFX_LINK_10000FDX] = IF_Gbps(10), + [EFX_LINK_25000FDX] = IF_Gbps(25), [EFX_LINK_40000FDX] = IF_Gbps(40), + [EFX_LINK_50000FDX] = IF_Gbps(50), + [EFX_LINK_100000FDX] = IF_Gbps(100), }; void @@ -836,12 +839,16 @@ static const int sfxge_link_mode[EFX_PHY_MEDIA_NTYPES] [EFX_PHY_MEDIA_QSFP_PLUS] = { /* Don't know the module type, but assume SR for now. */ [EFX_LINK_10000FDX] = IFM_ETHER | IFM_FDX | IFM_10G_SR, + [EFX_LINK_25000FDX] = IFM_ETHER | IFM_FDX | IFM_25G_SR, [EFX_LINK_40000FDX] = IFM_ETHER | IFM_FDX | IFM_40G_CR4, + [EFX_LINK_50000FDX] = IFM_ETHER | IFM_FDX | IFM_50G_SR, + [EFX_LINK_100000FDX] = IFM_ETHER | IFM_FDX | IFM_100G_SR2, }, [EFX_PHY_MEDIA_SFP_PLUS] = { /* Don't know the module type, but assume SX/SR for now. */ [EFX_LINK_1000FDX] = IFM_ETHER | IFM_FDX | IFM_1000_SX, [EFX_LINK_10000FDX] = IFM_ETHER | IFM_FDX | IFM_10G_SR, + [EFX_LINK_25000FDX] = IFM_ETHER | IFM_FDX | IFM_25G_SR, }, [EFX_PHY_MEDIA_BASE_T] = { [EFX_LINK_10HDX] = IFM_ETHER | IFM_HDX | IFM_10_T, @@ -897,8 +904,14 @@ sfxge_link_mode_to_phy_cap(efx_link_mode_t mode) return (EFX_PHY_CAP_1000FDX); case EFX_LINK_10000FDX: return (EFX_PHY_CAP_10000FDX); + case EFX_LINK_25000FDX: + return (EFX_PHY_CAP_25000FDX); case EFX_LINK_40000FDX: return (EFX_PHY_CAP_40000FDX); + case EFX_LINK_50000FDX: + return (EFX_PHY_CAP_50000FDX); + case EFX_LINK_100000FDX: + return (EFX_PHY_CAP_100000FDX); default: return (EFX_PHY_CAP_INVALID); } From owner-svn-src-head@freebsd.org Fri Nov 30 07:10:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1235115AD76; Fri, 30 Nov 2018 07:10:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1937240A; Fri, 30 Nov 2018 07:10:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2E0D2529D; Fri, 30 Nov 2018 07:10:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU7ALQK084322; Fri, 30 Nov 2018 07:10:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU7AKMT084317; Fri, 30 Nov 2018 07:10:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300710.wAU7AKMT084317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341323 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A1937240A X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.026,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:10:38 -0000 Author: arybchik Date: Fri Nov 30 07:10:20 2018 New Revision: 341323 URL: https://svnweb.freebsd.org/changeset/base/341323 Log: sfxge(4): correct annotations where NULL input is OK Correct annotations where NULL input can be permitted Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18284 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:10:09 2018 (r341322) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 30 07:10:20 2018 (r341323) @@ -1038,7 +1038,7 @@ ef10_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in const union efx_rxq_type_data_u *type_data, + __in_opt const union efx_rxq_type_data_u *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:10:09 2018 (r341322) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 30 07:10:20 2018 (r341323) @@ -1015,7 +1015,7 @@ ef10_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in const efx_rxq_type_data_t *type_data, + __in_opt const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -1058,6 +1058,10 @@ ef10_rx_qcreate( break; #if EFSYS_OPT_RX_PACKED_STREAM case EFX_RXQ_TYPE_PACKED_STREAM: + if (type_data == NULL) { + rc = EINVAL; + goto fail3; + } switch (type_data->ertd_packed_stream.eps_buf_size) { case EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M: ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; @@ -1076,12 +1080,16 @@ ef10_rx_qcreate( break; default: rc = ENOTSUP; - goto fail3; + goto fail4; } break; #endif /* EFSYS_OPT_RX_PACKED_STREAM */ #if EFSYS_OPT_RX_ES_SUPER_BUFFER case EFX_RXQ_TYPE_ES_SUPER_BUFFER: + if (type_data == NULL) { + rc = EINVAL; + goto fail5; + } ps_buf_size = 0; es_bufs_per_desc = type_data->ertd_es_super_buffer.eessb_bufs_per_desc; @@ -1095,7 +1103,7 @@ ef10_rx_qcreate( #endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ default: rc = ENOTSUP; - goto fail4; + goto fail6; } #if EFSYS_OPT_RX_PACKED_STREAM @@ -1103,13 +1111,13 @@ ef10_rx_qcreate( /* Check if datapath firmware supports packed stream mode */ if (encp->enc_rx_packed_stream_supported == B_FALSE) { rc = ENOTSUP; - goto fail5; + goto fail7; } /* Check if packed stream allows configurable buffer sizes */ if ((ps_buf_size != MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M) && (encp->enc_rx_var_packed_stream_supported == B_FALSE)) { rc = ENOTSUP; - goto fail6; + goto fail8; } } #else /* EFSYS_OPT_RX_PACKED_STREAM */ @@ -1120,17 +1128,17 @@ ef10_rx_qcreate( if (es_bufs_per_desc > 0) { if (encp->enc_rx_es_super_buffer_supported == B_FALSE) { rc = ENOTSUP; - goto fail7; + goto fail9; } if (!IS_P2ALIGNED(es_max_dma_len, EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { rc = EINVAL; - goto fail8; + goto fail10; } if (!IS_P2ALIGNED(es_buf_stride, EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { rc = EINVAL; - goto fail9; + goto fail11; } } #else /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ @@ -1152,7 +1160,7 @@ ef10_rx_qcreate( esmp, disable_scatter, want_inner_classes, ps_buf_size, es_bufs_per_desc, es_max_dma_len, es_buf_stride, hol_block_timeout)) != 0) - goto fail10; + goto fail12; erp->er_eep = eep; erp->er_label = label; @@ -1163,25 +1171,31 @@ ef10_rx_qcreate( return (0); +fail12: + EFSYS_PROBE(fail12); +#if EFSYS_OPT_RX_ES_SUPER_BUFFER +fail11: + EFSYS_PROBE(fail11); fail10: EFSYS_PROBE(fail10); -#if EFSYS_OPT_RX_ES_SUPER_BUFFER fail9: EFSYS_PROBE(fail9); +#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ +#if EFSYS_OPT_RX_PACKED_STREAM fail8: EFSYS_PROBE(fail8); fail7: EFSYS_PROBE(fail7); -#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ -#if EFSYS_OPT_RX_PACKED_STREAM +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail6: EFSYS_PROBE(fail6); +#if EFSYS_OPT_RX_ES_SUPER_BUFFER fail5: EFSYS_PROBE(fail5); -#endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ +#if EFSYS_OPT_RX_PACKED_STREAM fail4: EFSYS_PROBE(fail4); -#if EFSYS_OPT_RX_PACKED_STREAM fail3: EFSYS_PROBE(fail3); #endif /* EFSYS_OPT_RX_PACKED_STREAM */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:10:09 2018 (r341322) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 30 07:10:20 2018 (r341323) @@ -328,7 +328,7 @@ extern __checkReturn efx_rc_t efx_intr_init( __in efx_nic_t *enp, __in efx_intr_type_t type, - __in efsys_mem_t *esmp); + __in_opt efsys_mem_t *esmp); extern void efx_intr_enable( Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Fri Nov 30 07:10:09 2018 (r341322) +++ head/sys/dev/sfxge/common/efx_intr.c Fri Nov 30 07:10:20 2018 (r341323) @@ -122,7 +122,7 @@ static const efx_intr_ops_t __efx_intr_ef10_ops = { efx_intr_init( __in efx_nic_t *enp, __in efx_intr_type_t type, - __in efsys_mem_t *esmp) + __in_opt efsys_mem_t *esmp) { efx_intr_t *eip = &(enp->en_intr); const efx_intr_ops_t *eiop; Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:10:09 2018 (r341322) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 30 07:10:20 2018 (r341323) @@ -136,7 +136,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in const efx_rxq_type_data_t *type_data, + __in_opt const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -813,7 +813,7 @@ efx_rx_qcreate_internal( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in const efx_rxq_type_data_t *type_data, + __in_opt const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -1597,7 +1597,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, - __in const efx_rxq_type_data_t *type_data, + __in_opt const efx_rxq_type_data_t *type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, From owner-svn-src-head@freebsd.org Fri Nov 30 07:10:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A4F3115ADB6; Fri, 30 Nov 2018 07:10:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69C60724E5; Fri, 30 Nov 2018 07:10:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFD57252A2; Fri, 30 Nov 2018 07:10:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU7AWvr084389; Fri, 30 Nov 2018 07:10:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU7AWnt084388; Fri, 30 Nov 2018 07:10:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300710.wAU7AWnt084388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341324 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69C60724E5 X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.026,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:10:41 -0000 Author: arybchik Date: Fri Nov 30 07:10:32 2018 New Revision: 341324 URL: https://svnweb.freebsd.org/changeset/base/341324 Log: sfxge(4): update external port number calculation Revise the external port calculation to support all X2 port modes. The previous algorithm could not handle different port numbering schemes on each cage. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18285 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:10:20 2018 (r341323) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 30 07:10:32 2018 (r341324) @@ -1468,6 +1468,9 @@ fail1: } +#define EFX_EXT_PORT_MAX 4 +#define EFX_EXT_PORT_NA 0xFF + /* * Table of mapping schemes from port number to external number. * @@ -1481,7 +1484,7 @@ fail1: * port mapping (n:1) * | * v - * External port number (normally 1-based) + * External port number (1-based) * | * fixed (1:1) or cable assembly (1:m) * | @@ -1493,9 +1496,8 @@ fail1: * how to determine which external cage/magjack corresponds to the port * numbers used by the driver. * - * The count of adjacent port numbers that map to each external number, - * and the offset in the numbering, is determined by the chip family and - * current port mode. + * The count of consecutive port numbers that map to each external number, + * is determined by the chip family and the current port mode. * * For the Huntington family, the current port mode cannot be discovered, * but a single mapping is used by all modes for a given chip variant, @@ -1506,8 +1508,7 @@ fail1: static struct ef10_external_port_map_s { efx_family_t family; uint32_t modes_mask; - int32_t count; - int32_t offset; + uint8_t base_port[EFX_EXT_PORT_MAX]; } __ef10_external_port_mappings[] = { /* * Modes used by Huntington family controllers where each port @@ -1526,8 +1527,7 @@ static struct ef10_external_port_map_s { (1U << TLV_PORT_MODE_10G) | /* mode 0 */ (1U << TLV_PORT_MODE_10G_10G) | /* mode 2 */ (1U << TLV_PORT_MODE_10G_10G_10G_10G), /* mode 4 */ - 1, /* ports per cage */ - 1 /* first cage */ + { 0, 1, 2, 3 } }, /* * Modes which for Huntington identify a chip variant where 2 @@ -1544,8 +1544,7 @@ static struct ef10_external_port_map_s { (1U << TLV_PORT_MODE_40G_40G) | /* mode 3 */ (1U << TLV_PORT_MODE_40G_10G_10G) | /* mode 6 */ (1U << TLV_PORT_MODE_10G_10G_40G), /* mode 7 */ - 2, /* ports per cage */ - 1 /* first cage */ + { 0, 2, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, /* * Modes that on Medford allocate each port number to a separate @@ -1559,8 +1558,7 @@ static struct ef10_external_port_map_s { EFX_FAMILY_MEDFORD, (1U << TLV_PORT_MODE_1x1_NA) | /* mode 0 */ (1U << TLV_PORT_MODE_1x1_1x1), /* mode 2 */ - 1, /* ports per cage */ - 1 /* first cage */ + { 0, 1, 2, 3 } }, /* * Modes that on Medford allocate 2 adjacent port numbers to each @@ -1578,8 +1576,7 @@ static struct ef10_external_port_map_s { (1U << TLV_PORT_MODE_2x1_1x4) | /* mode 7 */ /* Do not use 10G_10G_10G_10G_Q1_Q2 (see bug63270) */ (1U << TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2), /* mode 9 */ - 2, /* ports per cage */ - 1 /* first cage */ + { 0, 2, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, /* * Modes that on Medford allocate 4 adjacent port numbers to each @@ -1594,8 +1591,7 @@ static struct ef10_external_port_map_s { (1U << TLV_PORT_MODE_2x1_2x1) | /* mode 5 */ /* Do not use 10G_10G_10G_10G_Q1 (see bug63270) */ (1U << TLV_PORT_MODE_4x1_NA), /* mode 4 */ - 4, /* ports per cage */ - 1 /* first cage */ + { 0, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, /* * Modes that on Medford allocate 4 adjacent port numbers to each @@ -1608,8 +1604,7 @@ static struct ef10_external_port_map_s { { EFX_FAMILY_MEDFORD, (1U << TLV_PORT_MODE_NA_4x1), /* mode 8 */ - 4, /* ports per cage */ - 2 /* first cage */ + { EFX_EXT_PORT_NA, 0, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, /* * Modes that on Medford2 allocate each port number to a separate @@ -1628,16 +1623,21 @@ static struct ef10_external_port_map_s { (1U << TLV_PORT_MODE_1x2_1x2) | /* mode 12 */ (1U << TLV_PORT_MODE_1x4_1x2) | /* mode 15 */ (1U << TLV_PORT_MODE_1x2_1x4), /* mode 16 */ - 1, /* ports per cage */ - 1 /* first cage */ + { 0, 1, 2, 3 } }, /* - * FIXME: Some port modes are not representable in this mapping: - * - TLV_PORT_MODE_1x2_2x1 (mode 17): + * Modes that on Medford2 allocate 1 port to cage 1 and the rest + * to cage 2. * port 0 -> cage 1 * port 1 -> cage 2 * port 2 -> cage 2 */ + { + EFX_FAMILY_MEDFORD2, + (1U << TLV_PORT_MODE_1x2_2x1) | /* mode 17 */ + (1U << TLV_PORT_MODE_1x4_2x1), /* mode 6 */ + { 0, 1, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } + }, /* * Modes that on Medford2 allocate 2 adjacent port numbers to each * cage, starting on cage 1. @@ -1654,8 +1654,7 @@ static struct ef10_external_port_map_s { (1U << TLV_PORT_MODE_2x1_1x4) | /* mode 7 */ (1U << TLV_PORT_MODE_2x2_NA) | /* mode 13 */ (1U << TLV_PORT_MODE_2x1_1x2), /* mode 18 */ - 2, /* ports per cage */ - 1 /* first cage */ + { 0, 2, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, /* * Modes that on Medford2 allocate 2 adjacent port numbers to each @@ -1666,8 +1665,7 @@ static struct ef10_external_port_map_s { { EFX_FAMILY_MEDFORD2, (1U << TLV_PORT_MODE_NA_2x2), /* mode 14 */ - 2, /* ports per cage */ - 2 /* first cage */ + { EFX_EXT_PORT_NA, 0, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, /* * Modes that on Medford2 allocate 4 adjacent port numbers to each @@ -1680,8 +1678,7 @@ static struct ef10_external_port_map_s { { EFX_FAMILY_MEDFORD2, (1U << TLV_PORT_MODE_4x1_NA), /* mode 5 */ - 4, /* ports per cage */ - 1 /* first cage */ + { 0, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, /* * Modes that on Medford2 allocate 4 adjacent port numbers to each @@ -1695,8 +1692,7 @@ static struct ef10_external_port_map_s { EFX_FAMILY_MEDFORD2, (1U << TLV_PORT_MODE_NA_4x1) | /* mode 8 */ (1U << TLV_PORT_MODE_NA_1x2), /* mode 11 */ - 4, /* ports per cage */ - 2 /* first cage */ + { EFX_EXT_PORT_NA, 0, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA } }, }; @@ -1711,8 +1707,8 @@ ef10_external_port_mapping( uint32_t port_modes; uint32_t matches; uint32_t current; - int32_t count = 1; /* Default 1-1 mapping */ - int32_t offset = 1; /* Default starting external port number */ + struct ef10_external_port_map_s *mapp = NULL; + int ext_index = port; /* Default 1-1 mapping */ if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, ¤t, NULL)) != 0) { @@ -1749,8 +1745,7 @@ ef10_external_port_mapping( * there will be multiple matches. The mapping on the * last match is used. */ - count = eepmp->count; - offset = eepmp->offset; + mapp = eepmp; port_modes &= ~matches; } } @@ -1762,11 +1757,25 @@ ef10_external_port_mapping( } out: - /* - * Scale as required by last matched mode and then convert to - * correctly offset numbering - */ - *external_portp = (uint8_t)((port / count) + offset); + if (mapp != NULL) { + /* + * External ports are assigned a sequence of consecutive + * port numbers, so find the one with the closest base_port. + */ + uint32_t delta = EFX_EXT_PORT_NA; + + for (i = 0; i < EFX_EXT_PORT_MAX; i++) { + uint32_t base = mapp->base_port[i]; + if ((base != EFX_EXT_PORT_NA) && (base <= port)) { + if ((port - base) < delta) { + delta = (port - base); + ext_index = i; + } + } + } + } + *external_portp = (uint8_t)(ext_index + 1); + return (0); fail1: From owner-svn-src-head@freebsd.org Fri Nov 30 07:10:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DDA0115AE69; Fri, 30 Nov 2018 07:10:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3093727C7; Fri, 30 Nov 2018 07:10:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5818E252B5; Fri, 30 Nov 2018 07:10:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU7Ain0084576; Fri, 30 Nov 2018 07:10:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU7AhR9084573; Fri, 30 Nov 2018 07:10:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300710.wAU7AhR9084573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341325 - in head: share/man/man4 sys/dev/sfxge sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/sfxge sys/dev/sfxge/common X-SVN-Commit-Revision: 341325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3093727C7 X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.026,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:10:52 -0000 Author: arybchik Date: Fri Nov 30 07:10:43 2018 New Revision: 341325 URL: https://svnweb.freebsd.org/changeset/base/341325 Log: sfxge(4): support Medford2 Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18286 Modified: head/share/man/man4/sfxge.4 head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/sfxge.c Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Fri Nov 30 07:10:32 2018 (r341324) +++ head/share/man/man4/sfxge.4 Fri Nov 30 07:10:43 2018 (r341325) @@ -52,7 +52,7 @@ sfxge_load="YES" The .Nm driver provides support for 10Gb Ethernet adapters based on -Solarflare SFC9000 family controllers. +Solarflare SFC9000 and XtremeScale X2 family controllers. The driver supports jumbo frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, @@ -163,8 +163,8 @@ Period in milliseconds to refresh interface statistics The accepted range is 0 to 65535, the default is 1000 (1 second). Use zero value to disable periodic statistics update. Supported on SFN8xxx series adapters with firmware v6.2.1.1033 and later and -SFN5xxx and SFN6xxx series adapters. -SFN7xxx series adapters and SFN8xxx series with earlier firmware use a +SFN5xxx, SFN6xxx and XtremeScale X2xxx series adapters. +SFN7xxx series adapters and sfN8xxx series with earlier firmware use a fixed 1000 milliseconds statistics update period. The period may also be changed after the driver is loaded using the sysctl .Va dev.sfxge.%d.stats_update_period_ms . Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Fri Nov 30 07:10:32 2018 (r341324) +++ head/sys/dev/sfxge/common/efsys.h Fri Nov 30 07:10:43 2018 (r341325) @@ -202,7 +202,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_SIENA 1 #define EFSYS_OPT_HUNTINGTON 1 #define EFSYS_OPT_MEDFORD 1 -#define EFSYS_OPT_MEDFORD2 0 +#define EFSYS_OPT_MEDFORD2 1 #ifdef DEBUG #define EFSYS_OPT_CHECK_REG 1 #else Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Fri Nov 30 07:10:32 2018 (r341324) +++ head/sys/dev/sfxge/sfxge.c Fri Nov 30 07:10:43 2018 (r341325) @@ -1182,6 +1182,11 @@ sfxge_probe(device_t dev) return (0); } + if (family == EFX_FAMILY_MEDFORD2) { + device_set_desc(dev, "Solarflare SFC9250 family"); + return (0); + } + DBGPRINT(dev, "impossible controller family %d", family); return (ENXIO); } From owner-svn-src-head@freebsd.org Fri Nov 30 07:11:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC244115AEC9; Fri, 30 Nov 2018 07:11:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23C69728CA; Fri, 30 Nov 2018 07:11:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53215252C6; Fri, 30 Nov 2018 07:10:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU7AtnO084648; Fri, 30 Nov 2018 07:10:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU7At8p084647; Fri, 30 Nov 2018 07:10:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300710.wAU7At8p084647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341326 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23C69728CA X-Spamd-Result: default: False [0.50 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_HAM_SHORT(-0.06)[-0.063,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:11:02 -0000 Author: arybchik Date: Fri Nov 30 07:10:54 2018 New Revision: 341326 URL: https://svnweb.freebsd.org/changeset/base/341326 Log: sfxge(4): ensure EvQ poll stops when abort is requested If an event handler requested an abort, only the inner loop was guarenteed to be broken out of - the outer loop could continue if total == batch. Fix this by poisoning batch to ensure it is different to total. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18287 Modified: head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Fri Nov 30 07:10:43 2018 (r341325) +++ head/sys/dev/sfxge/common/efx_ev.c Fri Nov 30 07:10:54 2018 (r341326) @@ -509,6 +509,14 @@ efx_ev_qpoll( if (should_abort) { /* Ignore subsequent events */ total = index + 1; + + /* + * Poison batch to ensure the outer + * loop is broken out of. + */ + EFSYS_ASSERT(batch <= EFX_EV_BATCH); + batch += (EFX_EV_BATCH << 1); + EFSYS_ASSERT(total != batch); break; } } From owner-svn-src-head@freebsd.org Fri Nov 30 07:11:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A56E115AF32; Fri, 30 Nov 2018 07:11:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01AF472A60; Fri, 30 Nov 2018 07:11:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03F72252EF; Fri, 30 Nov 2018 07:11:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU7B5YN084753; Fri, 30 Nov 2018 07:11:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU7B5R6084752; Fri, 30 Nov 2018 07:11:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811300711.wAU7B5R6084752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Nov 2018 07:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341327 - head/sys/dev/sfxge X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge X-SVN-Commit-Revision: 341327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01AF472A60 X-Spamd-Result: default: False [0.50 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.06)[-0.063,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 07:11:15 -0000 Author: arybchik Date: Fri Nov 30 07:11:05 2018 New Revision: 341327 URL: https://svnweb.freebsd.org/changeset/base/341327 Log: sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped Early processing of a packet on transmit may change last seen VLAN TCI in the queue context. If such a packet is eventually dropped, last seen VLAN TCI must be set to its previous value. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18288 Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Fri Nov 30 07:10:54 2018 (r341326) +++ head/sys/dev/sfxge/sfxge_tx.c Fri Nov 30 07:11:05 2018 (r341327) @@ -361,6 +361,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, int rc; int i; int eop; + uint16_t hw_vlan_tci_prev; int vlan_tagged; KASSERT(!txq->blocked, ("txq->blocked")); @@ -412,6 +413,8 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, used_map = &stmp->map; + hw_vlan_tci_prev = txq->hw_vlan_tci; + vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf); if (vlan_tagged) { sfxge_next_stmp(txq, &stmp); @@ -463,6 +466,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, return (0); reject_mapped: + txq->hw_vlan_tci = hw_vlan_tci_prev; bus_dmamap_unload(txq->packet_dma_tag, *used_map); reject: /* Drop the packet on the floor. */ From owner-svn-src-head@freebsd.org Fri Nov 30 08:01:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2495115C5B5; Fri, 30 Nov 2018 08:01:12 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61B547547B; Fri, 30 Nov 2018 08:01:12 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42BF925AFD; Fri, 30 Nov 2018 08:01:12 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU81CbO013998; Fri, 30 Nov 2018 08:01:12 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU81CqC013995; Fri, 30 Nov 2018 08:01:12 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811300801.wAU81CqC013995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 30 Nov 2018 08:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341328 - in head/stand/i386: libi386 loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/i386: libi386 loader X-SVN-Commit-Revision: 341328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61B547547B X-Spamd-Result: default: False [1.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.391,0]; NEURAL_SPAM_MEDIUM(0.42)[0.417,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.223,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 08:01:13 -0000 Author: tsoome Date: Fri Nov 30 08:01:11 2018 New Revision: 341328 URL: https://svnweb.freebsd.org/changeset/base/341328 Log: loader: create separate lists for fd, cd and hd, merge bioscd with biosdisk Create unified block IO implementation in BIOS version, like it is done in UEFI side. Implement fd, disk and cd device lists, this will split floppy devices from disks and will allow us to have consistent, predictable device naming (modulo BIOS issues). Differential Revision: https://reviews.freebsd.org/D17888 Deleted: head/stand/i386/libi386/bioscd.c Modified: head/stand/i386/libi386/Makefile head/stand/i386/libi386/biosdisk.c head/stand/i386/libi386/bootinfo32.c head/stand/i386/libi386/libi386.h head/stand/i386/loader/chain.c head/stand/i386/loader/conf.c head/stand/i386/loader/main.c Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Fri Nov 30 07:11:05 2018 (r341327) +++ head/stand/i386/libi386/Makefile Fri Nov 30 08:01:11 2018 (r341328) @@ -4,7 +4,7 @@ LIB= i386 -SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ +SRCS= biosacpi.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Fri Nov 30 07:11:05 2018 (r341327) +++ head/stand/i386/libi386/biosdisk.c Fri Nov 30 08:01:11 2018 (r341328) @@ -40,9 +40,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include @@ -59,6 +61,8 @@ __FBSDID("$FreeBSD$"); #define WFDMAJOR 1 #define FDMAJOR 2 #define DAMAJOR 4 +#define ACDMAJOR 117 +#define CDMAJOR 15 #ifdef DISK_DEBUG #define DEBUG(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) @@ -66,12 +70,27 @@ __FBSDID("$FreeBSD$"); #define DEBUG(fmt, args...) #endif +struct specification_packet { + uint8_t sp_size; + uint8_t sp_bootmedia; + uint8_t sp_drive; + uint8_t sp_controller; + uint32_t sp_lba; + uint16_t sp_devicespec; + uint16_t sp_buffersegment; + uint16_t sp_loadsegment; + uint16_t sp_sectorcount; + uint16_t sp_cylsec; + uint8_t sp_head; +}; + /* * List of BIOS devices, translation from disk unit number to * BIOS unit number. */ -static struct bdinfo +typedef struct bdinfo { + STAILQ_ENTRY(bdinfo) bd_link; /* link in device list */ int bd_unit; /* BIOS unit number */ int bd_cyl; /* BIOS geometry */ int bd_hds; @@ -83,25 +102,30 @@ static struct bdinfo #define BD_MODEEDD (BD_MODEEDD1 | BD_MODEEDD3) #define BD_MODEMASK 0x0003 #define BD_FLOPPY 0x0004 -#define BD_NO_MEDIA 0x0008 +#define BD_CDROM 0x0008 +#define BD_NO_MEDIA 0x0010 int bd_type; /* BIOS 'drive type' (floppy only) */ uint16_t bd_sectorsize; /* Sector size */ uint64_t bd_sectors; /* Disk size */ int bd_open; /* reference counter */ void *bd_bcache; /* buffer cache data */ -} bdinfo [MAXBDDEV]; -static int nbdinfo = 0; +} bdinfo_t; -#define BD(dev) (bdinfo[(dev)->dd.d_unit]) #define BD_RD 0 #define BD_WR 1 -static void bd_io_workaround(struct disk_devdesc *dev); +typedef STAILQ_HEAD(bdinfo_list, bdinfo) bdinfo_list_t; +static bdinfo_list_t fdinfo = STAILQ_HEAD_INITIALIZER(fdinfo); +static bdinfo_list_t cdinfo = STAILQ_HEAD_INITIALIZER(cdinfo); +static bdinfo_list_t hdinfo = STAILQ_HEAD_INITIALIZER(hdinfo); -static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); -static int bd_int13probe(struct bdinfo *bd); +static void bd_io_workaround(bdinfo_t *); +static int bd_io(struct disk_devdesc *, bdinfo_t *, daddr_t, int, caddr_t, int); +static bool bd_int13probe(bdinfo_t *); static int bd_init(void); +static int cd_init(void); +static int fd_init(void); static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize); static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, @@ -110,42 +134,120 @@ static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); static int bd_ioctl(struct open_file *f, u_long cmd, void *data); static int bd_print(int verbose); +static int cd_print(int verbose); +static int fd_print(int verbose); -struct devsw biosdisk = { - "disk", - DEVT_DISK, - bd_init, - bd_strategy, - bd_open, - bd_close, - bd_ioctl, - bd_print, - NULL +struct devsw biosfd = { + .dv_name = "fd", + .dv_type = DEVT_FD, + .dv_init = fd_init, + .dv_strategy = bd_strategy, + .dv_open = bd_open, + .dv_close = bd_close, + .dv_ioctl = bd_ioctl, + .dv_print = fd_print, + .dv_cleanup = NULL }; +struct devsw bioscd = { + .dv_name = "cd", + .dv_type = DEVT_CD, + .dv_init = cd_init, + .dv_strategy = bd_strategy, + .dv_open = bd_open, + .dv_close = bd_close, + .dv_ioctl = bd_ioctl, + .dv_print = cd_print, + .dv_cleanup = NULL +}; + +struct devsw bioshd = { + .dv_name = "disk", + .dv_type = DEVT_DISK, + .dv_init = bd_init, + .dv_strategy = bd_strategy, + .dv_open = bd_open, + .dv_close = bd_close, + .dv_ioctl = bd_ioctl, + .dv_print = bd_print, + .dv_cleanup = NULL +}; + +static bdinfo_list_t * +bd_get_bdinfo_list(struct devsw *dev) +{ + if (dev->dv_type == DEVT_DISK) + return (&hdinfo); + if (dev->dv_type == DEVT_CD) + return (&cdinfo); + if (dev->dv_type == DEVT_FD) + return (&fdinfo); + return (NULL); +} + +/* XXX this gets called way way too often, investigate */ +static bdinfo_t * +bd_get_bdinfo(struct devdesc *dev) +{ + bdinfo_list_t *bdi; + bdinfo_t *bd = NULL; + int unit; + + bdi = bd_get_bdinfo_list(dev->d_dev); + if (bdi == NULL) + return (bd); + + unit = 0; + STAILQ_FOREACH(bd, bdi, bd_link) { + if (unit == dev->d_unit) + return (bd); + unit++; + } + return (bd); +} + /* * Translate between BIOS device numbers and our private unit numbers. */ int bd_bios2unit(int biosdev) { - int i; + bdinfo_list_t *bdi[] = { &fdinfo, &cdinfo, &hdinfo, NULL }; + bdinfo_t *bd; + int i, unit; DEBUG("looking for bios device 0x%x", biosdev); - for (i = 0; i < nbdinfo; i++) { - DEBUG("bd unit %d is BIOS device 0x%x", i, bdinfo[i].bd_unit); - if (bdinfo[i].bd_unit == biosdev) - return (i); + for (i = 0; bdi[i] != NULL; i++) { + unit = 0; + STAILQ_FOREACH(bd, bdi[i], bd_link) { + if (bd->bd_unit == biosdev) { + DEBUG("bd unit %d is BIOS device 0x%x", unit, + bd->bd_unit); + return (unit); + } + unit++; + } } return (-1); } int -bd_unit2bios(int unit) +bd_unit2bios(struct i386_devdesc *dev) { + bdinfo_list_t *bdi; + bdinfo_t *bd; + int unit; - if ((unit >= 0) && (unit < nbdinfo)) - return (bdinfo[unit].bd_unit); + bdi = bd_get_bdinfo_list(dev->dd.d_dev); + if (bdi == NULL) + return (-1); + + unit = 0; + STAILQ_FOREACH(bd, bdi, bd_link) { + if (unit == dev->dd.d_unit) + return (bd->bd_unit); + unit++; + } return (-1); } @@ -153,42 +255,128 @@ bd_unit2bios(int unit) * Quiz the BIOS for disk devices, save a little info about them. */ static int -bd_init(void) +fd_init(void) { - int base, unit, nfd = 0; + int unit; + bdinfo_t *bd; - /* sequence 0, 0x80 */ - for (base = 0; base <= 0x80; base += 0x80) { - for (unit = base; (nbdinfo < MAXBDDEV); unit++) { -#ifndef VIRTUALBOX - /* - * Check the BIOS equipment list for number - * of fixed disks. - */ - if (base == 0x80 && - (nfd >= *(unsigned char *)PTOV(BIOS_NUMDRIVES))) - break; -#endif - bdinfo[nbdinfo].bd_open = 0; - bdinfo[nbdinfo].bd_bcache = NULL; - bdinfo[nbdinfo].bd_unit = unit; - bdinfo[nbdinfo].bd_flags = unit < 0x80 ? BD_FLOPPY: 0; - if (!bd_int13probe(&bdinfo[nbdinfo])) - break; + for (unit = 0; unit < MAXBDDEV; unit++) { + if ((bd = calloc(1, sizeof(*bd))) == NULL) + break; + bd->bd_flags = BD_FLOPPY; + bd->bd_unit = unit; + if (!bd_int13probe(bd)) { + free(bd); + break; + } + if (bd->bd_sectors == 0) + bd->bd_flags |= BD_NO_MEDIA; - /* XXX we need "disk aliases" to make this simpler */ - printf("BIOS drive %c: is disk%d\n", (unit < 0x80) ? - ('A' + unit): ('C' + unit - 0x80), nbdinfo); - nbdinfo++; - if (base == 0x80) - nfd++; + printf("BIOS drive %c: is %s%d\n", ('A' + unit), + biosfd.dv_name, unit); + + STAILQ_INSERT_TAIL(&fdinfo, bd, bd_link); + } + + bcache_add_dev(unit); + return (0); +} + +static int +bd_init(void) +{ + int base, unit; + bdinfo_t *bd; + + base = 0x80; + for (unit = 0; unit < *(unsigned char *)PTOV(BIOS_NUMDRIVES); unit++) { + /* + * Check the BIOS equipment list for number of fixed disks. + */ + if ((bd = calloc(1, sizeof(*bd))) == NULL) + break; + bd->bd_unit = base + unit; + if (!bd_int13probe(bd)) { + free(bd); + break; } + + printf("BIOS drive %c: is %s%d\n", ('C' + unit), + bioshd.dv_name, unit); + + STAILQ_INSERT_TAIL(&hdinfo, bd, bd_link); } - bcache_add_dev(nbdinfo); + bcache_add_dev(unit); return (0); } /* + * We can't quiz, we have to be told what device to use, so this function + * doesn't do anything. Instead, the loader calls bc_add() with the BIOS + * device number to add. + */ +static int +cd_init(void) +{ + + return (0); +} + +int +bc_add(int biosdev) +{ + bdinfo_t *bd; + struct specification_packet bc_sp; + int nbcinfo = 0; + + if (!STAILQ_EMPTY(&cdinfo)) + return (-1); + + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4b01; + v86.edx = biosdev; + v86.ds = VTOPSEG(&bc_sp); + v86.esi = VTOPOFF(&bc_sp); + v86int(); + if ((v86.eax & 0xff00) != 0) + return (-1); + + if ((bd = calloc(1, sizeof(*bd))) == NULL) + return (-1); + + bd->bd_flags = BD_CDROM; + bd->bd_unit = biosdev; + + /* + * Ignore result from bd_int13probe(), we will use local + * workaround below. + */ + (void)bd_int13probe(bd); + + if (bd->bd_cyl == 0) { + bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + + ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + } + if (bd->bd_hds == 0) + bd->bd_hds = bc_sp.sp_head + 1; + if (bd->bd_sec == 0) + bd->bd_sec = bc_sp.sp_cylsec & 0x3f; + if (bd->bd_sectors == 0) + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; + + /* Still no size? use 7.961GB */ + if (bd->bd_sectors == 0) + bd->bd_sectors = 4173824; + + STAILQ_INSERT_TAIL(&cdinfo, bd, bd_link); + printf("BIOS CD is cd%d\n", nbcinfo); + nbcinfo++; + bcache_add_dev(nbcinfo); /* register cd device in bcache */ + return(0); +} + +/* * Return EDD version or 0 if EDD is not supported on this drive. */ static int @@ -306,11 +494,10 @@ bd_get_diskinfo_ext(struct bdinfo *bd) /* * Try to detect a device supported by the legacy int13 BIOS */ -static int -bd_int13probe(struct bdinfo *bd) +static bool +bd_int13probe(bdinfo_t *bd) { - int edd; - int ret; + int edd, ret; bd->bd_flags &= ~BD_NO_MEDIA; @@ -340,7 +527,7 @@ bd_int13probe(struct bdinfo *bd) v86.edx = bd->bd_unit; v86int(); if (V86_CY(v86.efl) || (v86.eax & 0x300) == 0) - return (0); + return (false); } ret = 1; @@ -354,7 +541,6 @@ bd_int13probe(struct bdinfo *bd) bd->bd_cyl = 80; bd->bd_hds = 2; bd->bd_sec = 18; - bd->bd_type = 4; bd->bd_sectors = 2880; /* Since we are there, there most likely is no media */ bd->bd_flags |= BD_NO_MEDIA; @@ -362,6 +548,10 @@ bd_int13probe(struct bdinfo *bd) } if (ret != 0) { + /* CD is special case, bc_add() has its own fallback. */ + if ((bd->bd_flags & BD_CDROM) != 0) + return (true); + if (bd->bd_sectors != 0 && edd != 0) { bd->bd_sec = 63; bd->bd_hds = 255; @@ -369,9 +559,18 @@ bd_int13probe(struct bdinfo *bd) (bd->bd_sectors + bd->bd_sec * bd->bd_hds - 1) / bd->bd_sec * bd->bd_hds; } else { + const char *dv_name; + + if ((bd->bd_flags & BD_FLOPPY) != 0) + dv_name = biosfd.dv_name; + else if ((bd->bd_flags & BD_CDROM) != 0) + dv_name = bioscd.dv_name; + else + dv_name = bioshd.dv_name; + printf("Can not get information about %s unit %#x\n", - biosdisk.dv_name, bd->bd_unit); - return (0); + dv_name, bd->bd_unit); + return (false); } } @@ -383,54 +582,86 @@ bd_int13probe(struct bdinfo *bd) if (bd->bd_sectors == 0) bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, + DEBUG("unit 0x%x geometry %d/%d/%d\n", bd->bd_unit, bd->bd_cyl, bd->bd_hds, bd->bd_sec); - return (1); + return (true); } +static int +bd_count(bdinfo_list_t *bdi) +{ + bdinfo_t *bd; + int i; + + i = 0; + STAILQ_FOREACH(bd, bdi, bd_link) + i++; + return (i); +} + /* * Print information about disks */ static int -bd_print(int verbose) +bd_print_common(struct devsw *dev, bdinfo_list_t *bdi, int verbose) { - static char line[80]; - struct disk_devdesc dev; + char line[80]; + struct disk_devdesc devd; + bdinfo_t *bd; int i, ret = 0; + char drive; - if (nbdinfo == 0) + if (STAILQ_EMPTY(bdi)) return (0); - printf("%s devices:", biosdisk.dv_name); + printf("%s devices:", dev->dv_name); if ((ret = pager_output("\n")) != 0) return (ret); - for (i = 0; i < nbdinfo; i++) { + i = -1; + STAILQ_FOREACH(bd, bdi, bd_link) { + i++; + + switch (dev->dv_type) { + case DEVT_FD: + drive = 'A'; + break; + case DEVT_CD: + drive = 'C' + bd_count(&hdinfo); + break; + default: + drive = 'C'; + break; + } + snprintf(line, sizeof(line), - " disk%d: BIOS drive %c (%s%ju X %u):\n", i, - (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): - ('C' + bdinfo[i].bd_unit - 0x80), - (bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA ? + " %s%d: BIOS drive %c (%s%ju X %u):\n", + dev->dv_name, i, drive + i, + (bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA ? "no media, " : "", - (uintmax_t)bdinfo[i].bd_sectors, - bdinfo[i].bd_sectorsize); + (uintmax_t)bd->bd_sectors, + bd->bd_sectorsize); if ((ret = pager_output(line)) != 0) break; - if ((bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + if ((bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) continue; - dev.dd.d_dev = &biosdisk; - dev.dd.d_unit = i; - dev.d_slice = -1; - dev.d_partition = -1; - if (disk_open(&dev, - bdinfo[i].bd_sectorsize * bdinfo[i].bd_sectors, - bdinfo[i].bd_sectorsize) == 0) { - snprintf(line, sizeof(line), " disk%d", i); - ret = disk_print(&dev, line, verbose); - disk_close(&dev); + if (dev->dv_type != DEVT_DISK) + continue; + + devd.dd.d_dev = dev; + devd.dd.d_unit = i; + devd.d_slice = -1; + devd.d_partition = -1; + if (disk_open(&devd, + bd->bd_sectorsize * bd->bd_sectors, + bd->bd_sectorsize) == 0) { + snprintf(line, sizeof(line), " %s%d", + dev->dv_name, i); + ret = disk_print(&devd, line, verbose); + disk_close(&devd); if (ret != 0) break; } @@ -438,6 +669,24 @@ bd_print(int verbose) return (ret); } +static int +fd_print(int verbose) +{ + return (bd_print_common(&biosfd, &fdinfo, verbose)); +} + +static int +bd_print(int verbose) +{ + return (bd_print_common(&bioshd, &hdinfo, verbose)); +} + +static int +cd_print(int verbose) +{ + return (bd_print_common(&bioscd, &cdinfo, verbose)); +} + /* * Read disk size from partition. * This is needed to work around buggy BIOS systems returning @@ -448,21 +697,26 @@ bd_print(int verbose) static uint64_t bd_disk_get_sectors(struct disk_devdesc *dev) { + bdinfo_t *bd; struct disk_devdesc disk; uint64_t size; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (0); + disk.dd.d_dev = dev->dd.d_dev; disk.dd.d_unit = dev->dd.d_unit; disk.d_slice = -1; disk.d_partition = -1; disk.d_offset = 0; - size = BD(dev).bd_sectors * BD(dev).bd_sectorsize; - if (disk_open(&disk, size, BD(dev).bd_sectorsize) == 0) { + size = bd->bd_sectors * bd->bd_sectorsize; + if (disk_open(&disk, size, bd->bd_sectorsize) == 0) { (void) disk_ioctl(&disk, DIOCGMEDIASIZE, &size); disk_close(&disk); } - return (size / BD(dev).bd_sectorsize); + return (size / bd->bd_sectorsize); } /* @@ -478,6 +732,7 @@ bd_disk_get_sectors(struct disk_devdesc *dev) static int bd_open(struct open_file *f, ...) { + bdinfo_t *bd; struct disk_devdesc *dev; va_list ap; int rc; @@ -486,29 +741,33 @@ bd_open(struct open_file *f, ...) dev = va_arg(ap, struct disk_devdesc *); va_end(ap); - if (dev->dd.d_unit < 0 || dev->dd.d_unit >= nbdinfo) + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) return (EIO); - if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { - if (!bd_int13probe(&BD(dev))) + if ((bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { + if (!bd_int13probe(bd)) return (EIO); - if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + if ((bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) return (EIO); } - if (BD(dev).bd_bcache == NULL) - BD(dev).bd_bcache = bcache_allocate(); + if (bd->bd_bcache == NULL) + bd->bd_bcache = bcache_allocate(); - if (BD(dev).bd_open == 0) - BD(dev).bd_sectors = bd_disk_get_sectors(dev); - BD(dev).bd_open++; + if (bd->bd_open == 0) + bd->bd_sectors = bd_disk_get_sectors(dev); + bd->bd_open++; - rc = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, - BD(dev).bd_sectorsize); - if (rc != 0) { - BD(dev).bd_open--; - if (BD(dev).bd_open == 0) { - bcache_free(BD(dev).bd_bcache); - BD(dev).bd_bcache = NULL; + rc = 0; + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_open(dev, bd->bd_sectors * bd->bd_sectorsize, + bd->bd_sectorsize); + if (rc != 0) { + bd->bd_open--; + if (bd->bd_open == 0) { + bcache_free(bd->bd_bcache); + bd->bd_bcache = NULL; + } } } return (rc); @@ -518,34 +777,48 @@ static int bd_close(struct open_file *f) { struct disk_devdesc *dev; + bdinfo_t *bd; + int rc = 0; dev = (struct disk_devdesc *)f->f_devdata; - BD(dev).bd_open--; - if (BD(dev).bd_open == 0) { - bcache_free(BD(dev).bd_bcache); - BD(dev).bd_bcache = NULL; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (EIO); + + bd->bd_open--; + if (bd->bd_open == 0) { + bcache_free(bd->bd_bcache); + bd->bd_bcache = NULL; } - return (disk_close(dev)); + if (dev->dd.d_dev->dv_type == DEVT_DISK) + rc = disk_close(dev); + return (rc); } static int bd_ioctl(struct open_file *f, u_long cmd, void *data) { + bdinfo_t *bd; struct disk_devdesc *dev; int rc; dev = (struct disk_devdesc *)f->f_devdata; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (EIO); - rc = disk_ioctl(dev, cmd, data); - if (rc != ENOTTY) - return (rc); + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_ioctl(dev, cmd, data); + if (rc != ENOTTY) + return (rc); + } switch (cmd) { case DIOCGSECTORSIZE: - *(uint32_t *)data = BD(dev).bd_sectorsize; + *(uint32_t *)data = bd->bd_sectorsize; break; case DIOCGMEDIASIZE: - *(uint64_t *)data = BD(dev).bd_sectors * BD(dev).bd_sectorsize; + *(uint64_t *)data = bd->bd_sectors * bd->bd_sectorsize; break; default: return (ENOTTY); @@ -557,14 +830,27 @@ static int bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { + bdinfo_t *bd; struct bcache_devdata bcd; struct disk_devdesc *dev; + daddr_t offset; dev = (struct disk_devdesc *)devdata; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (EINVAL); + bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; - bcd.dv_cache = BD(dev).bd_bcache; - return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, size, + bcd.dv_cache = bd->bd_bcache; + + offset = 0; + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + + offset = dev->d_offset * bd->bd_sectorsize; + offset /= BIOSDISK_SECSIZE; + } + return (bcache_strategy(&bcd, rw, dblk + offset, size, buf, rsize)); } @@ -573,12 +859,14 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - uint64_t disk_blocks, offset; + bdinfo_t *bd; + uint64_t disk_blocks, offset, d_offset; size_t blks, blkoff, bsize, rest; caddr_t bbuf; int rc; - if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL || (bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) return (EIO); /* @@ -596,8 +884,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s DEBUG("open_disk %p", dev); offset = dblk * BIOSDISK_SECSIZE; - dblk = offset / BD(dev).bd_sectorsize; - blkoff = offset % BD(dev).bd_sectorsize; + dblk = offset / bd->bd_sectorsize; + blkoff = offset % bd->bd_sectorsize; /* * Check the value of the size argument. We do have quite small @@ -610,8 +898,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s return (EIO); } - blks = size / BD(dev).bd_sectorsize; - if (blks == 0 || (size % BD(dev).bd_sectorsize) != 0) + blks = size / bd->bd_sectorsize; + if (blks == 0 || (size % bd->bd_sectorsize) != 0) blks++; if (dblk > dblk + blks) @@ -624,44 +912,48 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * Get disk blocks, this value is either for whole disk or for * partition. */ - if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { - /* DIOCGMEDIASIZE does return bytes. */ - disk_blocks /= BD(dev).bd_sectorsize; - } else { - /* We should not get here. Just try to survive. */ - disk_blocks = BD(dev).bd_sectors - dev->d_offset; + d_offset = 0; + disk_blocks = 0; + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { + /* DIOCGMEDIASIZE does return bytes. */ + disk_blocks /= bd->bd_sectorsize; + } + d_offset = dev->d_offset; } + if (disk_blocks == 0) + disk_blocks = bd->bd_sectors - d_offset; /* Validate source block address. */ - if (dblk < dev->d_offset || dblk >= dev->d_offset + disk_blocks) + if (dblk < d_offset || dblk >= d_offset + disk_blocks) return (EIO); /* * Truncate if we are crossing disk or partition end. */ - if (dblk + blks >= dev->d_offset + disk_blocks) { - blks = dev->d_offset + disk_blocks - dblk; - size = blks * BD(dev).bd_sectorsize; + if (dblk + blks >= d_offset + disk_blocks) { + blks = d_offset + disk_blocks - dblk; + size = blks * bd->bd_sectorsize; DEBUG("short I/O %d", blks); } - if (V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize == 0) + if (V86_IO_BUFFER_SIZE / bd->bd_sectorsize == 0) panic("BUG: Real mode buffer is too small"); bbuf = PTOV(V86_IO_BUFFER); rest = size; while (blks > 0) { - int x = min(blks, V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize); + int x = min(blks, V86_IO_BUFFER_SIZE / bd->bd_sectorsize); switch (rw & F_MASK) { case F_READ: DEBUG("read %d from %lld to %p", x, dblk, buf); - bsize = BD(dev).bd_sectorsize * x - blkoff; + bsize = bd->bd_sectorsize * x - blkoff; if (rest < bsize) bsize = rest; - if ((rc = bd_io(dev, dblk, x, bbuf, BD_RD)) != 0) + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD)) != 0) return (EIO); bcopy(bbuf + blkoff, buf, bsize); @@ -674,27 +966,27 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * bbuf. */ x = 1; - bsize = BD(dev).bd_sectorsize - blkoff; + bsize = bd->bd_sectorsize - blkoff; bsize = min(bsize, rest); - rc = bd_io(dev, dblk, x, bbuf, BD_RD); - } else if (rest < BD(dev).bd_sectorsize) { + rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD); + } else if (rest < bd->bd_sectorsize) { /* * The remaining block is not full * sector. Read 1 sector to bbuf. */ x = 1; bsize = rest; - rc = bd_io(dev, dblk, x, bbuf, BD_RD); + rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD); } else { /* We can write full sector(s). */ - bsize = BD(dev).bd_sectorsize * x; + bsize = bd->bd_sectorsize * x; } /* * Put your Data In, Put your Data out, * Put your Data In, and shake it all about */ bcopy(buf, bbuf + blkoff, bsize); - if ((rc = bd_io(dev, dblk, x, bbuf, BD_WR)) != 0) + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_WR)) != 0) return (EIO); break; @@ -716,7 +1008,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s } static int -bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, +bd_edd_io(bdinfo_t *bd, daddr_t dblk, int blks, caddr_t dest, int dowrite) { static struct edd_packet packet; @@ -733,7 +1025,7 @@ bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int v86.eax = 0x4300; else v86.eax = 0x4200; - v86.edx = BD(dev).bd_unit; + v86.edx = bd->bd_unit; v86.ds = VTOPSEG(&packet); v86.esi = VTOPOFF(&packet); v86int(); @@ -743,17 +1035,17 @@ bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int } static int -bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, +bd_chs_io(bdinfo_t *bd, daddr_t dblk, int blks, caddr_t dest, int dowrite) { uint32_t x, bpc, cyl, hd, sec; - bpc = BD(dev).bd_sec * BD(dev).bd_hds; /* blocks per cylinder */ + bpc = bd->bd_sec * bd->bd_hds; /* blocks per cylinder */ x = dblk; cyl = x / bpc; /* block # / blocks per cylinder */ x %= bpc; /* block offset into cylinder */ - hd = x / BD(dev).bd_sec; /* offset / blocks per track */ - sec = x % BD(dev).bd_sec; /* offset into track */ + hd = x / bd->bd_sec; /* offset / blocks per track */ + sec = x % bd->bd_sec; /* offset into track */ /* correct sector number for 1-based BIOS numbering */ sec++; @@ -770,7 +1062,7 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int else v86.eax = 0x200 | blks; v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; - v86.edx = (hd << 8) | BD(dev).bd_unit; + v86.edx = (hd << 8) | bd->bd_unit; v86.es = VTOPSEG(dest); v86.ebx = VTOPOFF(dest); v86int(); @@ -780,16 +1072,16 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int } static void -bd_io_workaround(struct disk_devdesc *dev) +bd_io_workaround(bdinfo_t *bd) { uint8_t buf[8 * 1024]; - bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, BD_RD); + bd_edd_io(bd, 0xffffffff, 1, (caddr_t)buf, BD_RD); } static int -bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, - int dowrite) +bd_io(struct disk_devdesc *dev, bdinfo_t *bd, daddr_t dblk, int blks, + caddr_t dest, int dowrite) { int result, retry; @@ -809,20 +1101,20 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks * may also retry. */ if (dowrite == BD_RD && dblk >= 0x100000000) - bd_io_workaround(dev); + bd_io_workaround(bd); for (retry = 0; retry < 3; retry++) { - if (BD(dev).bd_flags & BD_MODEEDD) - result = bd_edd_io(dev, dblk, blks, dest, dowrite); + if (bd->bd_flags & BD_MODEEDD) + result = bd_edd_io(bd, dblk, blks, dest, dowrite); else - result = bd_chs_io(dev, dblk, blks, dest, dowrite); + result = bd_chs_io(bd, dblk, blks, dest, dowrite); if (result == 0) { - if (BD(dev).bd_flags & BD_NO_MEDIA) - BD(dev).bd_flags &= ~BD_NO_MEDIA; + if (bd->bd_flags & BD_NO_MEDIA) + bd->bd_flags &= ~BD_NO_MEDIA; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 30 08:31:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A985F115CD84 for ; Fri, 30 Nov 2018 08:31:20 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B0F576131 for ; Fri, 30 Nov 2018 08:31:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-ed1-x532.google.com with SMTP id h50so4152972ede.5 for ; Fri, 30 Nov 2018 00:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=XoVkJKLHrjkt7BUJ3nocUf+Ox2+OCUatAiGViS84Evk=; b=0pXrpte2Po05ji/Cy+6YS32nS3wUryCill3RXvkasfE7+wbNIhM+W7CjUz5ZvODuxI ZEVwW8H2KhzzHdd8t6oOBNXmweQzHxBzr3Kbz0mERElGGhPxrJGtK4yPdHkCrJ59xnRr EEVLukrHF0EGaFFwQN5If/y/JT18420g0kwsjU5zv0yWZLfjqC0NQQg+3w0hLHWvn9ZJ kXSsO4H5dMn54ifnMrc9yYPOkonP+cTkR0IdHOgfkvCC2BOlrTzeOYI1eRi05VQL5vR2 MccfWs+CUynCag6qYkiUi2JMVwnUWkgZo70De0jyL+goHUN4Qof+MnqjE7Fz2OW9BnX5 l2TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=XoVkJKLHrjkt7BUJ3nocUf+Ox2+OCUatAiGViS84Evk=; b=po4Y18lphp1mK0RKPUW9x/f6KZYw78rWU6WL7LnIJdZIrOWiD6xvHHRjd3/snAiiT/ i/2ss6M7IHdlixWACq1myRVGQPf2aSzsA+Pd2iAvvnKTGig/TTJaIjwirnS5smlDsq4J e4ub0wHvpNJYXFwLu4YE+MWoa0nUcyM7bgJ3fhplh0sBy5YwPXVc/u+xY1qXTUdF0JKQ 4oo4B1ju/g2Zh6y9fgUzGFvK5C1IX5eOkHhcgksGXHZBe+GQNFGPjizz77Bo6524yJJL WW6YVlgfFA/TPSMHz/jxXPa9pRbj+4D11h0wjMBGd8omRrxMZtkVimVBEh2l+avd9bOA Ls3g== X-Gm-Message-State: AA+aEWb0hfPcQuCTbFLMwUASzc8zHfna+LLc7EENk1jedi5Cx0n8rVzw 0U85bhecDxs99L4lqezwptu7ZQ== X-Google-Smtp-Source: AFSGD/VjIb5xwbOfnjrTQ+W4NfnS1wMBsiNi/1qw2ezLFMt7fnibw177Zc7FsDxBz4gNm62Bsh62EA== X-Received: by 2002:a17:906:6dcb:: with SMTP id j11-v6mr4034554ejt.162.1543566677489; Fri, 30 Nov 2018 00:31:17 -0800 (PST) Received: from [10.44.128.75] ([161.12.40.153]) by smtp.gmail.com with ESMTPSA id t21-v6sm709368ejk.33.2018.11.30.00.31.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 00:31:16 -0800 (PST) Subject: Re: svn: head/usr.bin: . trim To: Cy Schubert , Alexey Dokuchaev , Maxim Sobolev Cc: "eugen@freebsd.org" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers References: <20181130011713.42B641D27@spqr.komquats.com> From: Steven Hartland Message-ID: <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> Date: Fri, 30 Nov 2018 08:31:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181130011713.42B641D27@spqr.komquats.com> Content-Language: en-US X-Rspamd-Queue-Id: 5B0F576131 X-Spamd-Result: default: False [-5.68 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[multiplay.co.uk]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ASPMX.L.GOOGLE.COM,ALT2.ASPMX.L.GOOGLE.COM,ALT1.ASPMX.L.GOOGLE.COM,ASPMX2.GOOGLEMAIL.COM,ASPMX3.GOOGLEMAIL.COM]; RCVD_IN_DNSWL_NONE(0.00)[2.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.19)[ip: (-8.04), ipnet: 2a00:1450::/32(-1.46), asn: 15169(-1.34), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 08:31:20 -0000 Personally I disagree, chances of people finding that option in dd is slim, a dedicated trim utility makes much more sense to me. Sure have both that's cool but keep the trim would be my vote. On 30/11/2018 01:17, Cy Schubert wrote: > Agreed. > > --- > Sent using a tiny phone keyboard. > Apologies for any typos and autocorrect. > Also, this old phone only supports top post. Apologies. > > Cy Schubert > or > The need of the many outweighs the greed of the few. > --- > ------------------------------------------------------------------------ > From: Alexey Dokuchaev > Sent: 29/11/2018 17:01 > To: Maxim Sobolev > Cc: eugen@freebsd.org; svn-src-head@freebsd.org; > svn-src-all@freebsd.org; src-committers > Subject: Re: svn: head/usr.bin: . trim > > On Thu, Nov 29, 2018 at 10:36:02AM -0800, Maxim Sobolev wrote: > > Interesting. I have a similar functionality implemented as an option for > > the dd utility in my pipeline (conv=erase). > > Which probably makes a better place rather than adding 4-letter program, > commonly named ("trim" is a simple word), into global namespace. :-/ > > ./danfe > From owner-svn-src-head@freebsd.org Fri Nov 30 08:42:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47663113853B; Fri, 30 Nov 2018 08:42:15 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3239767EC; Fri, 30 Nov 2018 08:42:14 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C41EC26201; Fri, 30 Nov 2018 08:42:14 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU8gEXj036936; Fri, 30 Nov 2018 08:42:14 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU8gEph036935; Fri, 30 Nov 2018 08:42:14 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811300842.wAU8gEph036935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 30 Nov 2018 08:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341329 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 341329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3239767EC X-Spamd-Result: default: False [0.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.15)[0.145,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 08:42:15 -0000 Author: tsoome Date: Fri Nov 30 08:42:14 2018 New Revision: 341329 URL: https://svnweb.freebsd.org/changeset/base/341329 Log: loader.efi: fix EFI getchar() for multiple consoles This fix is ported from illumos (issue #9970), the analysis and initial implementation was done by John Levon. See also: https://www.illumos.org/issues/9970 Currently, efi_cons_getchar() will wait for a key. While this seems to make sense, the implementation of getchar() in common/console.c will loop across getchar() for all consoles without doing ischar() first. This means that if we've configured multiple consoles, we can't input into the serial, as getchar() will be sat waiting for input only from efi_console.c This patch does implement a bit more generic key buffer to support translation of input keys, and we use generic efi_readkey() to reduce duplication from calls from getchar() and poll(). Modified: head/stand/efi/libefi/efi_console.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Fri Nov 30 08:01:11 2018 (r341328) +++ head/stand/efi/libefi/efi_console.c Fri Nov 30 08:42:14 2018 (r341329) @@ -51,7 +51,8 @@ void HO(void); void end_term(void); #endif -static EFI_INPUT_KEY key_cur; +#define KEYBUFSZ 10 +static unsigned keybuf[KEYBUFSZ]; /* keybuf for extended codes */ static int key_pending; static void efi_cons_probe(struct console *); @@ -438,55 +439,120 @@ efi_cons_putchar(int c) #endif } -int -efi_cons_getchar() +static int +keybuf_getchar(void) { - EFI_INPUT_KEY key; - EFI_STATUS status; - UINTN junk; + int i, c = 0; - if (key_pending) { - key = key_cur; - key_pending = 0; - } else { - /* Try to read a key stroke. We wait for one if none is pending. */ - status = conin->ReadKeyStroke(conin, &key); - while (status == EFI_NOT_READY) { - /* Some EFI implementation (u-boot for example) do not support WaitForKey */ - if (conin->WaitForKey != NULL) - BS->WaitForEvent(1, &conin->WaitForKey, &junk); - status = conin->ReadKeyStroke(conin, &key); + for (i = 0; i < KEYBUFSZ; i++) { + if (keybuf[i] != 0) { + c = keybuf[i]; + keybuf[i] = 0; + break; } } - switch (key.ScanCode) { - case 0x17: /* ESC */ - return (0x1b); /* esc */ + return (c); +} + +static bool +keybuf_ischar(void) +{ + int i; + + for (i = 0; i < KEYBUFSZ; i++) { + if (keybuf[i] != 0) + return (true); } + return (false); +} - /* this can return */ - return (key.UnicodeChar); +/* + * We are not reading input before keybuf is empty, so we are safe + * just to fill keybuf from the beginning. + */ +static void +keybuf_inschar(EFI_INPUT_KEY *key) +{ + + switch (key->ScanCode) { + case 0x1: /* UP */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'A'; + break; + case 0x2: /* DOWN */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'B'; + break; + case 0x3: /* RIGHT */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'C'; + break; + case 0x4: /* LEFT */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'D'; + break; + case 0x17: + keybuf[0] = 0x1b; /* esc */ + break; + default: + keybuf[0] = key->UnicodeChar; + break; + } } -int -efi_cons_poll() +static bool +efi_readkey(void) { - EFI_INPUT_KEY key; EFI_STATUS status; + EFI_INPUT_KEY key; - if (conin->WaitForKey == NULL) { - if (key_pending) - return (1); - status = conin->ReadKeyStroke(conin, &key); - if (status == EFI_SUCCESS) { - key_cur = key; - key_pending = 1; - } - return (key_pending); + status = conin->ReadKeyStroke(conin, &key); + if (status == EFI_SUCCESS) { + keybuf_inschar(&key); + return (true); } + return (false); +} - /* This can clear the signaled state. */ - return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); +int +efi_cons_getchar(void) +{ + int c; + + if ((c = keybuf_getchar()) != 0) + return (c); + + key_pending = 0; + + if (efi_readkey()) + return (keybuf_getchar()); + + return (-1); +} + +int +efi_cons_poll(void) +{ + + if (keybuf_ischar() || key_pending) + return (1); + + /* + * Some EFI implementation (u-boot for example) do not support + * WaitForKey(). + * CheckEvent() can clear the signaled state. + */ + if (conin->WaitForKey == NULL) + key_pending = efi_readkey(); + else + key_pending = BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS; + + return (key_pending); } /* Plain direct access to EFI OutputString(). */ From owner-svn-src-head@freebsd.org Fri Nov 30 08:49:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EB11138B24; Fri, 30 Nov 2018 08:49:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9C376CE0; Fri, 30 Nov 2018 08:49:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 798F613343; Fri, 30 Nov 2018 08:49:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id DDEE3875E1; Fri, 30 Nov 2018 09:49:55 +0100 (CET) Date: Fri, 30 Nov 2018 09:49:55 +0100 From: Baptiste Daroussin To: Steven Hartland Cc: Cy Schubert , Alexey Dokuchaev , Maxim Sobolev , "eugen@freebsd.org" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Subject: Re: svn: head/usr.bin: . trim Message-ID: <20181130084955.o4loxtuswdsvzksy@ivaldir.net> References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hqgensnpc7l2ehgw" Content-Disposition: inline In-Reply-To: <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: AF9C376CE0 X-Spamd-Result: default: False [0.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.055,0]; NEURAL_SPAM_MEDIUM(0.16)[0.164,0]; NEURAL_SPAM_LONG(0.14)[0.141,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 08:49:58 -0000 --hqgensnpc7l2ehgw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 30, 2018 at 08:31:17AM +0000, Steven Hartland wrote: > Personally I disagree, chances of people finding that option in dd is slim, > a dedicated trim utility makes much more sense to me. Sure have both that's > cool but keep the trim would be my vote. I also like the idea of a simple dedicated tool with an obvious name Bapt --hqgensnpc7l2ehgw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlwA+a4ACgkQY4mL3PG3 Plq7cg/+LUfv63CVjB6tNwvpzZkDmKOGJAr3knDWVpL4dVKoqs9falEo9m9psGG/ KLUAcycRPzF/7/cT5cufmPf+VyJCWO5j68AKMlXQv8zEleVV5107aIWag6negAky 4Xq2PWFBtJWnat1kysPI7DgAo1xu42tHaaLkICA0lYlMluHymYaDT9U54c6uQQJS XBRKkjn0odkKUCDxmmkHBZucXPW+vdKas6o8zwAbCSkmybdI4EfcMqYjIg5M2gno JT2jD8nlY3aWhdY6pjN2JMFxxdPQzK3+eQyFvkveWjS/eZaweyCN4wEwx8ftlmtM kIsh20zaLL8kVW8tGdCXeiG17tDAda0XuebyJwojCz1yEctEIPDb+1PrG6KwBmhe smEtwDalGBkVi+HZtCzKu8qgyAVMHSMxXaUnXRNn5nr80AsVbZpTWlTgRx3zfI5t +pMjwrZ34dgIHLiu+x6TXItrax++xEjOfozm6byrpDNnjTqFekZ28QBMnR/fvMLi lW5/Q89tDotbnyyaspmYd5Q/+9yI467C7U+hl7l/+Ww1irnXjawd/kMYtxDc4xon LB0uIXeJPfdB/pNX2z3GQ1mX4b6zCEndELToLEmb1JKJRP+P17/IGK50xaVi8WgF 5An4mgXLSsXIT5R14DG+TGxko2FHSCA+b0g8AlmS/q0kXbjWMpU= =pyl7 -----END PGP SIGNATURE----- --hqgensnpc7l2ehgw-- From owner-svn-src-head@freebsd.org Fri Nov 30 10:31:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDDD2113F0C7; Fri, 30 Nov 2018 10:31:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7561C7B2F9; Fri, 30 Nov 2018 10:31:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 566B5275F4; Fri, 30 Nov 2018 10:31:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUAVVnY093804; Fri, 30 Nov 2018 10:31:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUAVVoG093803; Fri, 30 Nov 2018 10:31:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811301031.wAUAVVoG093803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 30 Nov 2018 10:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341333 - head/sys/dts/arm64/overlays X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dts/arm64/overlays X-SVN-Commit-Revision: 341333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7561C7B2F9 X-Spamd-Result: default: False [0.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.24)[0.244,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 10:31:32 -0000 Author: manu Date: Fri Nov 30 10:31:30 2018 New Revision: 341333 URL: https://svnweb.freebsd.org/changeset/base/341333 Log: arm64: allwinner: Add 792Mhz frequency to sun50i-a64-opp This is the frequency of the cpu on the Pinebook so add it to make cpufreq find the current setting. Note that this dtbo on the Pinebook doesn't work right now as u-boot dtb doesn't have symbols and so it fails to apply. Linux 4.20 have the dts and will be imported once taggued. MFC after: 1 month X-MFC with: r341268 Modified: head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Modified: head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso ============================================================================== --- head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Fri Nov 30 10:00:09 2018 (r341332) +++ head/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Fri Nov 30 10:31:30 2018 (r341333) @@ -15,6 +15,11 @@ opp-microvolt = <1040000>; clock-latency-ns = <244144>; /* 8 32k periods */ }; + opp-792000000 { + opp-hz = /bits/ 64 <792000000>; + opp-microvolt = <1100000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; opp-816000000 { opp-hz = /bits/ 64 <816000000>; opp-microvolt = <1100000>; From owner-svn-src-head@freebsd.org Fri Nov 30 10:36:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6680A113F34B; Fri, 30 Nov 2018 10:36:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB087B5BC; Fri, 30 Nov 2018 10:36:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E177B27660; Fri, 30 Nov 2018 10:36:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUAaErL094060; Fri, 30 Nov 2018 10:36:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUAaE9c094059; Fri, 30 Nov 2018 10:36:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811301036.wAUAaE9c094059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 30 Nov 2018 10:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341334 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 341334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CB087B5BC X-Spamd-Result: default: False [0.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.244,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 10:36:15 -0000 Author: ae Date: Fri Nov 30 10:36:14 2018 New Revision: 341334 URL: https://svnweb.freebsd.org/changeset/base/341334 Log: Adapt the fix in r341008 to correctly work with EBR. IFNET_RLOCK_NOSLEEP() is epoch_enter_preempt() in FreeBSD 12+. Holding it in sysctl_rtsock() doesn't protect us from ifnet unlinking, because unlinking occurs with IFNET_WLOCK(), that is rw_wlock+sx_xlock, and it doesn check that concurrent code is running in epoch section. But while we are in epoch section, we should be able to do access to ifnet's fields, even it was unlinked. Thus do not change if_addr and if_hw_addr fields in ifnet_detach_internal() to NULL, since rtsock code can do access to these fields and this is allowed while it is running in epoch section. This should fix the race, when ifnet_detach_internal() unlinks ifnet after we checked it for IFF_DYING in sysctl_dumpentry. Move free(ifp->if_hw_addr) into ifnet_free_internal(). Also remove the NULL check for ifp->if_description, since free(9) can correctly handle NULL pointer. MFC after: 1 week Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Nov 30 10:31:30 2018 (r341333) +++ head/sys/net/if.c Fri Nov 30 10:36:14 2018 (r341334) @@ -597,8 +597,6 @@ if_free_internal(struct ifnet *ifp) #ifdef MAC mac_ifnet_destroy(ifp); #endif /* MAC */ - if (ifp->if_description != NULL) - free(ifp->if_description, M_IFDESCR); IF_AFDATA_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp); ifq_delete(&ifp->if_snd); @@ -606,6 +604,8 @@ if_free_internal(struct ifnet *ifp) for (int i = 0; i < IFCOUNTERS; i++) counter_u64_free(ifp->if_counters[i]); + free(ifp->if_description, M_IFDESCR); + free(ifp->if_hw_addr, M_IFADDR); free(ifp, M_IFNET); } @@ -1184,14 +1184,8 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc if_dead(ifp); /* - * Remove link ifaddr pointer and maybe decrement if_index. * Clean up all addresses. */ - free(ifp->if_hw_addr, M_IFADDR); - ifp->if_hw_addr = NULL; - ifp->if_addr = NULL; - - /* We can now free link ifaddr. */ IF_ADDR_WLOCK(ifp); if (!CK_STAILQ_EMPTY(&ifp->if_addrhead)) { ifa = CK_STAILQ_FIRST(&ifp->if_addrhead); From owner-svn-src-head@freebsd.org Fri Nov 30 10:50:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14A63113F8DB; Fri, 30 Nov 2018 10:50:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEBEF7BCA6; Fri, 30 Nov 2018 10:50:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9040C27805; Fri, 30 Nov 2018 10:50:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUAo8Ap099466; Fri, 30 Nov 2018 10:50:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUAo8Y4099465; Fri, 30 Nov 2018 10:50:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811301050.wAUAo8Y4099465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 30 Nov 2018 10:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341335 - in head/sys/netinet: . cc X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . cc X-SVN-Commit-Revision: 341335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AEBEF7BCA6 X-Spamd-Result: default: False [0.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.24)[0.244,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 10:50:09 -0000 Author: tuexen Date: Fri Nov 30 10:50:07 2018 New Revision: 341335 URL: https://svnweb.freebsd.org/changeset/base/341335 Log: Limit option_len for the TCP_CCALGOOPT. Limiting the length to 2048 bytes seems to be acceptable, since the values used right now are using 8 bytes. Reviewed by: glebius, bz, rrs MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18366 Modified: head/sys/netinet/cc/cc.h head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/cc/cc.h ============================================================================== --- head/sys/netinet/cc/cc.h Fri Nov 30 10:36:14 2018 (r341334) +++ head/sys/netinet/cc/cc.h Fri Nov 30 10:50:07 2018 (r341335) @@ -184,4 +184,6 @@ extern struct rwlock cc_list_lock; #define CC_LIST_WUNLOCK() rw_wunlock(&cc_list_lock) #define CC_LIST_LOCK_ASSERT() rw_assert(&cc_list_lock, RA_LOCKED) +#define CC_ALGOOPT_LIMIT 2048 + #endif /* _NETINET_CC_CC_H_ */ Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Fri Nov 30 10:36:14 2018 (r341334) +++ head/sys/netinet/tcp_usrreq.c Fri Nov 30 10:50:07 2018 (r341335) @@ -1769,6 +1769,8 @@ tcp_default_ctloutput(struct socket *so, struct sockop switch (sopt->sopt_name) { case TCP_CCALGOOPT: INP_WUNLOCK(inp); + if (sopt->sopt_valsize > CC_ALGOOPT_LIMIT) + return (EINVAL); pbuf = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK | M_ZERO); error = sooptcopyin(sopt, pbuf, sopt->sopt_valsize, sopt->sopt_valsize); From owner-svn-src-head@freebsd.org Fri Nov 30 10:57:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F4D113FC79; Fri, 30 Nov 2018 10:57:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8834A7C2B7; Fri, 30 Nov 2018 10:57:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 7650A1C0CE; Fri, 30 Nov 2018 10:57:14 +0000 (UTC) Date: Fri, 30 Nov 2018 10:57:14 +0000 From: Alexey Dokuchaev To: Baptiste Daroussin Cc: Steven Hartland , Maxim Sobolev , src-committers , "eugen@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Cy Schubert Subject: Re: svn: head/usr.bin: . trim Message-ID: <20181130105714.GA84052@FreeBSD.org> References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181130084955.o4loxtuswdsvzksy@ivaldir.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 8834A7C2B7 X-Spamd-Result: default: False [1.02 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.16)[-0.162,0]; NEURAL_SPAM_LONG(0.66)[0.663,0]; NEURAL_SPAM_MEDIUM(0.52)[0.518,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 10:57:15 -0000 On Fri, Nov 30, 2018 at 09:49:55AM +0100, Baptiste Daroussin wrote: > On Fri, Nov 30, 2018 at 08:31:17AM +0000, Steven Hartland wrote: > > Personally I disagree, chances of people finding that option in dd > > is slim, a dedicated trim utility makes much more sense to me. Sure > > have both that's cool but keep the trim would be my vote. Having both is OK when there's no code duplication involved (e.g. like hd(1) being a handy hardlink to hexdump(1)), yet again... > I also like the idea of a simple dedicated tool with an obvious name. ... "Obvious" names can cut both ways. They can be too generic and thus create a clash in the future. They can be ambiguous ("trim" can just as easily be a tool that excessive whitespace from text files). ./danfe From owner-svn-src-head@freebsd.org Fri Nov 30 11:12:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8931114050E; Fri, 30 Nov 2018 11:12:33 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC5C7CD7B; Fri, 30 Nov 2018 11:12:33 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAUBCOZi025808 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Nov 2018 12:12:25 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: Cy.Schubert@cschubert.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAUBCN4u099996 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 30 Nov 2018 18:12:24 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn: head/usr.bin: . trim To: Alexey Dokuchaev , Baptiste Daroussin References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> Cc: Steven Hartland , Maxim Sobolev , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Cy Schubert From: Eugene Grosbein Message-ID: <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> Date: Fri, 30 Nov 2018 18:12:12 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20181130105714.GA84052@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 1EC5C7CD7B X-Spamd-Result: default: False [-0.14 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.22)[-0.217,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; NEURAL_SPAM_SHORT(0.45)[0.446,0]; NEURAL_HAM_LONG(-0.37)[-0.365,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:12:33 -0000 30.11.2018 17:57, Alexey Dokuchaev wrote: > On Fri, Nov 30, 2018 at 09:49:55AM +0100, Baptiste Daroussin wrote: >> On Fri, Nov 30, 2018 at 08:31:17AM +0000, Steven Hartland wrote: >>> Personally I disagree, chances of people finding that option in dd >>> is slim, a dedicated trim utility makes much more sense to me. Sure >>> have both that's cool but keep the trim would be my vote. > > Having both is OK when there's no code duplication involved (e.g. like > hd(1) being a handy hardlink to hexdump(1)), yet again... > >> I also like the idea of a simple dedicated tool with an obvious name. > > ... "Obvious" names can cut both ways. They can be too generic and thus > create a clash in the future. They can be ambiguous ("trim" can just as > easily be a tool that excessive whitespace from text files). In theory, it can. In practice, it did not for 25 years of FreeBSD existence despite of whitespace processing being much more generic task. Maybe that's because we already have "fmt -s" since 3BSD to do that? :-) From owner-svn-src-head@freebsd.org Fri Nov 30 11:34:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C29E71140C52; Fri, 30 Nov 2018 11:34:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6504D7D943; Fri, 30 Nov 2018 11:34:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 369801CAE8; Fri, 30 Nov 2018 11:34:22 +0000 (UTC) Date: Fri, 30 Nov 2018 11:34:22 +0000 From: Alexey Dokuchaev To: Eugene Grosbein Cc: Baptiste Daroussin , Maxim Sobolev , src-committers , "svn-src-all@freebsd.org" , Steven Hartland , "svn-src-head@freebsd.org" , Cy Schubert Subject: Re: svn: head/usr.bin: . trim Message-ID: <20181130113422.GA14353@FreeBSD.org> References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 6504D7D943 X-Spamd-Result: default: False [1.83 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.68)[0.680,0]; NEURAL_SPAM_MEDIUM(0.56)[0.559,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.586,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:34:22 -0000 On Fri, Nov 30, 2018 at 06:12:12PM +0700, Eugene Grosbein wrote: > 30.11.2018 17:57, Alexey Dokuchaev wrote: > > On Fri, Nov 30, 2018 at 09:49:55AM +0100, Baptiste Daroussin wrote: > >> On Fri, Nov 30, 2018 at 08:31:17AM +0000, Steven Hartland wrote: > >>> Personally I disagree, chances of people finding that option in dd > >>> is slim, a dedicated trim utility makes much more sense to me. Sure > >>> have both that's cool but keep the trim would be my vote. > > > > Having both is OK when there's no code duplication involved (e.g. like > > hd(1) being a handy hardlink to hexdump(1)), yet again... > > > >> I also like the idea of a simple dedicated tool with an obvious name. > > > > ... "Obvious" names can cut both ways. They can be too generic and thus > > create a clash in the future. They can be ambiguous ("trim" can just as > > easily be a tool that excessive whitespace from text files). > > In theory, it can. In practice, it did not for 25 years of FreeBSD > existence despite of whitespace processing being much more generic task. > > Maybe that's because we already have "fmt -s" since 3BSD to do that? :-) Actually, while perhaps whitespace trimming was not the best example (no surprise given it was my first idea of "trimming" other than trimming a beard), your reply is quite helpful: text formatter tasks of different kinds are grouped under one fmt(1) tool. Likewise, dd(1) is what people normally use when talking to storage media. How often does average Joe user need to explicitly trim their flash disks to warrant a dedicated "trim" utility in the base? Shouldn't it just happen automagically most of the times, and require some manual intervention under some specific circumstances? Another point: the manpage says, "It is only relevant for flash based storage devices that use wear-leveling algorithms", which is an argument against generic "trim". I would mind less of it would be called ftrim(8) or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. ./danfe From owner-svn-src-head@freebsd.org Fri Nov 30 11:42:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 903221140F40; Fri, 30 Nov 2018 11:42:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36AF47DDFF; Fri, 30 Nov 2018 11:42:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 188CB217; Fri, 30 Nov 2018 11:42:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUBgJdc030346; Fri, 30 Nov 2018 11:42:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUBgJJP030319; Fri, 30 Nov 2018 11:42:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301142.wAUBgJJP030319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 11:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341337 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 341337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 36AF47DDFF X-Spamd-Result: default: False [1.09 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.528,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:42:20 -0000 Author: trasz Date: Fri Nov 30 11:42:19 2018 New Revision: 341337 URL: https://svnweb.freebsd.org/changeset/base/341337 Log: Remove the hint for ISA buses; we don't support them anymore. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Fri Nov 30 11:19:04 2018 (r341336) +++ head/share/man/man4/ddb.4 Fri Nov 30 11:42:19 2018 (r341337) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2018 +.Dd November 30, 2018 .Dt DDB 4 .Os .Sh NAME @@ -1491,17 +1491,8 @@ might be defined to have special handling, and might be defined to simply panic and reboot. .El .Sh HINTS -On machines with an ISA expansion bus, a simple NMI generation card can be -constructed by connecting a push button between the A01 and B01 (CHCHK# and -GND) card fingers. -Momentarily shorting these two fingers together may cause the bridge chipset to -generate an NMI, which causes the kernel to pass control to -.Nm . -Some bridge chipsets do not generate a NMI on CHCHK#, so your mileage may vary. The NMI allows one to break into the debugger on a wedged machine to diagnose problems. -Other bus' bridge chipsets may be able to generate NMI using bus specific -methods. There are many PCI and PCIe add-in cards which can generate NMI for debugging. Modern server systems typically use IPMI to generate signals to enter the From owner-svn-src-head@freebsd.org Fri Nov 30 11:44:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B3F91140FEE; Fri, 30 Nov 2018 11:44:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C196C7DFA2; Fri, 30 Nov 2018 11:44:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1173227; Fri, 30 Nov 2018 11:44:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUBiGWK030553; Fri, 30 Nov 2018 11:44:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUBiGj6030552; Fri, 30 Nov 2018 11:44:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301144.wAUBiGj6030552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 11:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341338 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 341338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C196C7DFA2 X-Spamd-Result: default: False [1.09 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.528,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:44:17 -0000 Author: trasz Date: Fri Nov 30 11:44:16 2018 New Revision: 341338 URL: https://svnweb.freebsd.org/changeset/base/341338 Log: Say in plain text what the 'debug' keymap action usually is. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Fri Nov 30 11:42:19 2018 (r341337) +++ head/share/man/man4/ddb.4 Fri Nov 30 11:44:16 2018 (r341338) @@ -108,7 +108,7 @@ If linked into the running kernel, it can be invoked locally with the .Ql debug .Xr keymap 5 -action, or by setting setting the +action, usually mapped to Ctrl+Alt+Esc, or by setting setting the .Dv debug.kdb.enter sysctl to 1. The debugger is also invoked on kernel From owner-svn-src-head@freebsd.org Fri Nov 30 11:44:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75AAC114103E; Fri, 30 Nov 2018 11:44:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC0E7E0DF; Fri, 30 Nov 2018 11:44:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2B39228; Fri, 30 Nov 2018 11:44:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUBihB7030615; Fri, 30 Nov 2018 11:44:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUBihkK030614; Fri, 30 Nov 2018 11:44:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301144.wAUBihkK030614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 11:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341339 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 341339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CC0E7E0DF X-Spamd-Result: default: False [1.09 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.528,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:44:44 -0000 Author: trasz Date: Fri Nov 30 11:44:43 2018 New Revision: 341339 URL: https://svnweb.freebsd.org/changeset/base/341339 Log: Remove duplicated word. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Fri Nov 30 11:44:16 2018 (r341338) +++ head/share/man/man4/ddb.4 Fri Nov 30 11:44:43 2018 (r341339) @@ -108,7 +108,7 @@ If linked into the running kernel, it can be invoked locally with the .Ql debug .Xr keymap 5 -action, usually mapped to Ctrl+Alt+Esc, or by setting setting the +action, usually mapped to Ctrl+Alt+Esc, or by setting the .Dv debug.kdb.enter sysctl to 1. The debugger is also invoked on kernel From owner-svn-src-head@freebsd.org Fri Nov 30 11:45:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06721114108B; Fri, 30 Nov 2018 11:45:09 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE197E235; Fri, 30 Nov 2018 11:45:08 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAUBj01P026033 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Nov 2018 12:45:01 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: Cy.Schubert@cschubert.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAUBixIs000483 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 30 Nov 2018 18:44:59 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn: head/usr.bin: . trim To: Alexey Dokuchaev References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> Cc: Baptiste Daroussin , Maxim Sobolev , src-committers , "svn-src-all@freebsd.org" , Steven Hartland , "svn-src-head@freebsd.org" , Cy Schubert From: Eugene Grosbein Message-ID: Date: Fri, 30 Nov 2018 18:44:48 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20181130113422.GA14353@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 7AE197E235 X-Spamd-Result: default: False [-0.04 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.30)[-0.303,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; NEURAL_SPAM_SHORT(0.56)[0.555,0]; NEURAL_HAM_LONG(-0.29)[-0.288,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:45:09 -0000 30.11.2018 18:34, Alexey Dokuchaev wrote: > Another point: the manpage says, "It is only relevant for flash based > storage devices that use wear-leveling algorithms", which is an argument > against generic "trim". I would mind less of it would be called ftrim(8) > or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. Speaking of naming issues: NAME dd - convert and copy a file I still prefer unix-way: "each utility does one simple task". And that's not about dd :-( From owner-svn-src-head@freebsd.org Fri Nov 30 11:50:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE54111412A2; Fri, 30 Nov 2018 11:50:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62FC57E4F9; Fri, 30 Nov 2018 11:50:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43FB323A; Fri, 30 Nov 2018 11:50:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUBogFI033136; Fri, 30 Nov 2018 11:50:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUBogg0033135; Fri, 30 Nov 2018 11:50:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301150.wAUBogg0033135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 11:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341340 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 341340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62FC57E4F9 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.54)[0.535,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:50:43 -0000 Author: trasz Date: Fri Nov 30 11:50:41 2018 New Revision: 341340 URL: https://svnweb.freebsd.org/changeset/base/341340 Log: Use .Va for sysctls, not .Dv. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Fri Nov 30 11:44:43 2018 (r341339) +++ head/share/man/man4/ddb.4 Fri Nov 30 11:50:41 2018 (r341340) @@ -109,7 +109,7 @@ it can be invoked locally with the .Ql debug .Xr keymap 5 action, usually mapped to Ctrl+Alt+Esc, or by setting the -.Dv debug.kdb.enter +.Va debug.kdb.enter sysctl to 1. The debugger is also invoked on kernel .Xr panic 9 @@ -1207,17 +1207,17 @@ Userspace processes may inspect and manage capture state using .Xr sysctl 8 : .Pp -.Dv debug.ddb.capture.bufsize +.Va debug.ddb.capture.bufsize may be used to query or set the current capture buffer size. .Pp -.Dv debug.ddb.capture.maxbufsize +.Va debug.ddb.capture.maxbufsize may be used to query the compile-time limit on the capture buffer size. .Pp -.Dv debug.ddb.capture.bytes +.Va debug.ddb.capture.bytes may be used to query the number of bytes of output currently in the capture buffer. .Pp -.Dv debug.ddb.capture.data +.Va debug.ddb.capture.data returns the contents of the buffer as a string to an appropriately privileged process. .Pp @@ -1419,58 +1419,58 @@ Certain scripts are run automatically, if defined, for events. The follow scripts are run when various events occur: .Bl -tag -width kdb.enter.powerfail -.It Dv kdb.enter.acpi +.It Va kdb.enter.acpi The kernel debugger was entered as a result of an .Xr acpi 4 event. -.It Dv kdb.enter.bootflags +.It Va kdb.enter.bootflags The kernel debugger was entered at boot as a result of the debugger boot flag being set. -.It Dv kdb.enter.break +.It Va kdb.enter.break The kernel debugger was entered as a result of a serial or console break. -.It Dv kdb.enter.cam +.It Va kdb.enter.cam The kernel debugger was entered as a result of a .Xr CAM 4 event. -.It Dv kdb.enter.mac +.It Va kdb.enter.mac The kernel debugger was entered as a result of an assertion failure in the .Xr mac_test 4 module of the TrustedBSD MAC Framework. -.It Dv kdb.enter.ndis +.It Va kdb.enter.ndis The kernel debugger was entered as a result of an .Xr ndis 4 breakpoint event. -.It Dv kdb.enter.netgraph +.It Va kdb.enter.netgraph The kernel debugger was entered as a result of a .Xr netgraph 4 event. -.It Dv kdb.enter.panic +.It Va kdb.enter.panic .Xr panic 9 was called. -.It Dv kdb.enter.powerfail +.It Va kdb.enter.powerfail The kernel debugger was entered as a result of a powerfail NMI on the sparc64 platform. -.It Dv kdb.enter.powerpc +.It Va kdb.enter.powerpc The kernel debugger was entered as a result of an unimplemented interrupt type on the powerpc platform. -.It Dv kdb.enter.sysctl +.It Va kdb.enter.sysctl The kernel debugger was entered as a result of the -.Dv debug.kdb.enter +.Va debug.kdb.enter sysctl being set. -.It Dv kdb.enter.trapsig +.It Va kdb.enter.trapsig The kernel debugger was entered as a result of a trapsig event on the sparc64 platform. -.It Dv kdb.enter.unionfs +.It Va kdb.enter.unionfs The kernel debugger was entered as a result of an assertion failure in the union file system. -.It Dv kdb.enter.unknown +.It Va kdb.enter.unknown The kernel debugger was entered, but no reason has been set. -.It Dv kdb.enter.vfslock +.It Va kdb.enter.vfslock The kernel debugger was entered as a result of a VFS lock violation. -.It Dv kdb.enter.watchdog +.It Va kdb.enter.watchdog The kernel debugger was entered as a result of a watchdog firing. -.It Dv kdb.enter.witness +.It Va kdb.enter.witness The kernel debugger was entered as a result of a .Xr witness 4 violation. @@ -1480,14 +1480,14 @@ In the event that none of these scripts is found, .Nm will attempt to execute a default script: .Bl -tag -width kdb.enter.powerfail -.It Dv kdb.enter.default +.It Va kdb.enter.default The kernel debugger was entered, but a script exactly matching the reason for entering was not defined. This can be used as a catch-all to handle cases not specifically of interest; for example, -.Dv kdb.enter.witness +.Va kdb.enter.witness might be defined to have special handling, and -.Dv kdb.enter.default +.Va kdb.enter.default might be defined to simply panic and reboot. .El .Sh HINTS @@ -1498,7 +1498,7 @@ debugging. Modern server systems typically use IPMI to generate signals to enter the debugger. The -.Dv devel/ipmitool +.Va devel/ipmitool port can be used to send the .Cd chassis power diag command which delivers an NMI to the processor. @@ -1528,16 +1528,16 @@ and then releasing both. The break to enter the debugger behavior may be enabled at run-time by setting the .Xr sysctl 8 -.Dv debug.kdb.break_to_debugger +.Va debug.kdb.break_to_debugger to 1. The alternate sequence to enter the debugger behavior may be enabled at run-time by setting the .Xr sysctl 8 -.Dv debug.kdb.alt_break_to_debugger +.Va debug.kdb.alt_break_to_debugger to 1. The debugger may be entered by setting the .Xr sysctl 8 -.Dv debug.kdb.enter +.Va debug.kdb.enter to 1. .Sh FILES Header files mentioned in this manual page can be found below From owner-svn-src-head@freebsd.org Fri Nov 30 11:55:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E572E114151E; Fri, 30 Nov 2018 11:55:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9FE7E90F; Fri, 30 Nov 2018 11:55:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3DD6C1D3DE; Fri, 30 Nov 2018 11:55:15 +0000 (UTC) Date: Fri, 30 Nov 2018 11:55:15 +0000 From: Alexey Dokuchaev To: Eugene Grosbein Cc: Baptiste Daroussin , Maxim Sobolev , src-committers , "svn-src-all@freebsd.org" , Steven Hartland , "svn-src-head@freebsd.org" , Cy Schubert Subject: Re: svn: head/usr.bin: . trim Message-ID: <20181130115515.GA28531@FreeBSD.org> References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 8C9FE7E90F X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.13)[-0.126,0]; NEURAL_SPAM_LONG(0.68)[0.680,0]; NEURAL_SPAM_MEDIUM(0.56)[0.559,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 11:55:16 -0000 On Fri, Nov 30, 2018 at 06:44:48PM +0700, Eugene Grosbein wrote: > 30.11.2018 18:34, Alexey Dokuchaev wrote: > > > Another point: the manpage says, "It is only relevant for flash based > > storage devices that use wear-leveling algorithms", which is an argument > > against generic "trim". I would mind less of it would be called ftrim(8) > > or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. > > Speaking of naming issues: > > NAME > dd - convert and copy a file IMHO this description should be fixed (but that's the whole another bug). > I still prefer unix-way: "each utility does one simple task". > And that's not about dd :-( Yes, I understand you. Like I've said, a little more flash-media-related name would perhaps be more appropriate for such an utility. ./danfe From owner-svn-src-head@freebsd.org Fri Nov 30 12:17:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63A7E114276B; Fri, 30 Nov 2018 12:17:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 095317FB52; Fri, 30 Nov 2018 12:17:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE4B0702; Fri, 30 Nov 2018 12:17:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUCHZWE046124; Fri, 30 Nov 2018 12:17:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUCHZCB046123; Fri, 30 Nov 2018 12:17:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301217.wAUCHZCB046123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 12:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341341 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 341341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 095317FB52 X-Spamd-Result: default: False [0.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.240,0]; NEURAL_SPAM_MEDIUM(0.31)[0.312,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 12:17:36 -0000 Author: trasz Date: Fri Nov 30 12:17:35 2018 New Revision: 341341 URL: https://svnweb.freebsd.org/changeset/base/341341 Log: Use .Va for sysctls, not .Dv. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man4/textdump.4 Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Fri Nov 30 11:50:41 2018 (r341340) +++ head/share/man/man4/textdump.4 Fri Nov 30 12:17:35 2018 (r341341) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2008 +.Dd November 30, 2018 .Dt TEXTDUMP 4 .Os .Sh NAME @@ -73,30 +73,30 @@ Captured .Xr ddb 4 output, if the capture facility has been used. May be disabled by clearing the -.Dv debug.ddb.textdump.do_ddb +.Va debug.ddb.textdump.do_ddb sysctl. .It Pa config.txt Kernel configuration, if .Cd options INCLUDE_CONFIG_FILE has been compiled into the kernel. May be disabled by clearing the -.Dv debug.ddb.textdump.do_config +.Va debug.ddb.textdump.do_config sysctl. .It Pa msgbuf.txt Kernel message buffer, including recent console output if the capture facility has been used. May be disabled by clearing the -.Dv debug.ddb.textdump.do_msgbuf +.Va debug.ddb.textdump.do_msgbuf sysctl. .It Pa panic.txt Kernel panic string, if the kernel panicked before the dump was generated. May be disabled by clearing the -.Dv debug.ddb.textdump.do_panic +.Va debug.ddb.textdump.do_panic sysctl. .It Pa version.txt Kernel version string. My be disabled by clearing the -.Dv debug.ddb.textdump.do_version +.Va debug.ddb.textdump.do_version sysctl. .El .Pp @@ -115,7 +115,7 @@ dump will be regular memory dumps; however, by using t command in .Xr ddb 4 , or by setting the -.Dv debug.ddb.textdump.pending +.Va debug.ddb.textdump.pending sysctl to 1 using .Xr sysctl 8 , it is possible to request that the next dump be a textdump. @@ -155,7 +155,7 @@ as well as other diagnostics useful to debug the textd .El .Sh EXAMPLES In the following example, the script -.Dv kdb.enter.panic +.Va kdb.enter.panic will run when the kernel debugger is entered as a result of a panic, enable output capture, dump several useful pieces of debugging information, and then invoke panic in order to force a kernel dump to be written out followed by a @@ -166,7 +166,7 @@ script kdb.enter.panic=textdump set; capture on; show .Ed .Pp In the following example, the script -.Dv kdb.enter.witness +.Va kdb.enter.witness will run when the kernel debugger is entered as a result of a witness violation, printing lock-related information for the user: .Bd -literal -offset indent From owner-svn-src-head@freebsd.org Fri Nov 30 12:28:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6446B1143133; Fri, 30 Nov 2018 12:28:21 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 633B080387; Fri, 30 Nov 2018 12:28:10 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAUCRwde026303 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Nov 2018 13:27:59 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: danfe@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAUCRv52000781 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 30 Nov 2018 19:27:57 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn: head/usr.bin: . trim To: Alexey Dokuchaev References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> Cc: src-committers , "svn-src-all@freebsd.org" , Steven Hartland , "svn-src-head@freebsd.org" , Cy Schubert From: Eugene Grosbein Message-ID: Date: Fri, 30 Nov 2018 19:27:46 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20181130115515.GA28531@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 633B080387 X-Spamd-Result: default: False [-4.66 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.909,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-2.15)[ip: (-4.16), ipnet: 2a01:4f8::/29(-3.92), asn: 24940(-2.66), country: DE(-0.02)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 12:28:21 -0000 30.11.2018 18:55, Alexey Dokuchaev wrote: >>> Another point: the manpage says, "It is only relevant for flash based >>> storage devices that use wear-leveling algorithms", which is an argument >>> against generic "trim". I would mind less of it would be called ftrim(8) >>> or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. [skip] > Yes, I understand you. Like I've said, a little more flash-media-related > name would perhaps be more appropriate for such an utility. This excludes virtio_blk and ZFS. Perhaps, manpage should be corrected as quoted phrase has been taken from news -E description as is. From owner-svn-src-head@freebsd.org Fri Nov 30 12:56:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0546511439B1; Fri, 30 Nov 2018 12:56:46 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C98D80F61; Fri, 30 Nov 2018 12:56:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8C8151DE38; Fri, 30 Nov 2018 12:56:45 +0000 (UTC) Date: Fri, 30 Nov 2018 12:56:45 +0000 From: Alexey Dokuchaev To: Eugene Grosbein Cc: src-committers , "svn-src-all@freebsd.org" , Steven Hartland , "svn-src-head@freebsd.org" , Cy Schubert Subject: Re: svn: head/usr.bin: . trim Message-ID: <20181130125645.GA97463@FreeBSD.org> References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 9C98D80F61 X-Spamd-Result: default: False [1.39 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_SPAM_SHORT(0.11)[0.113,0]; NEURAL_SPAM_MEDIUM(0.59)[0.585,0]; NEURAL_SPAM_LONG(0.69)[0.695,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 12:56:46 -0000 On Fri, Nov 30, 2018 at 07:27:46PM +0700, Eugene Grosbein wrote: > 30.11.2018 18:55, Alexey Dokuchaev wrote: > > >>> Another point: the manpage says, "It is only relevant for flash based > >>> storage devices that use wear-leveling algorithms", which is an argument > >>> against generic "trim". I would mind less of it would be called ftrim(8) > >>> or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. > > [skip] > > > Yes, I understand you. Like I've said, a little more flash-media-related > > name would perhaps be more appropriate for such an utility. > > This excludes virtio_blk and ZFS. Perhaps, manpage should be corrected > as quoted phrase has been taken from news -E description as is. How about mtrim(8) or media_trim(8)? I vaguely when back in times misc/mc was installed as bin/midc because some commercial Unix implementation had "mc" as a "media copy" command or something like that. ./danfe From owner-svn-src-head@freebsd.org Fri Nov 30 14:23:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB91111458C6 for ; Fri, 30 Nov 2018 14:23:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5BCC845AF for ; Fri, 30 Nov 2018 14:23:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id n12so3214533qkh.11 for ; Fri, 30 Nov 2018 06:23:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=heRaYwgEP5kiB9wX9aY17kjqVWYhTEctdb7ysAMCoI8=; b=cNJsGAWx7EOh3wSIiBJi16kv6VjbuZQ1yDHLcm3TWiYMXcl2pBX9aXszFOskenJWoN ElMeCSo0Qtk31Bn1x6OczjKPiKitSEp/RxMEGAo26AnalZ+IsOpnUBD6Tcy6yz/d8fa2 kDzjsmrN4aoBXQTt2PlhqbCYSG7/ocP8e15ryP85c8qQZ44druJLB0HsacPNuEqjXfYU E01aIHCGzL18FjQiyCbFZJ+ONemiZJJQuZ3XsLwVvu5EMEi3Gjun/n1hpevC+AQQoN/I ZxlYKegW5joRlpLVjq6NqEcKYObHVgjqKOfaRymSuzolWKDV71tKCDRj4bgU+nVhyf4i JVzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=heRaYwgEP5kiB9wX9aY17kjqVWYhTEctdb7ysAMCoI8=; b=mSfd1r8DXY7jjeUzvKUYy5yZXVaO9dYj8DsT1J578mTmhLSbO+lxBsOqtF67zYw0FH g0wslhNKfLfpEIBxAt1t0ftxprvBCJ/+KDpnKHS8UH+LRx6i2jVJtZcTTnirfpOnHbUG 28m73719pn4MHkEDbHZ4EKBzzxWEFFH7pBfOM7LwFhQMSUP3CuBrTemBnVvgHzwhFUHD 74Kt/PzfVDYQNGbwfmOked+tVRKmpIUQCczUZA8dPU9SB6x916t3hyrCwsdQZLescNhX WGs7q1Ds/DxQL/hgoeXaL1HOAXAQopLMIoKnA6hpr+tn8ZrtzeMGH7cuet3Ya0oTHrIA lHJg== X-Gm-Message-State: AA+aEWZdmDEhlo9yBtq9KL9Gd3zLB6hH68Yf+o1IeFUK4Zy9fOfMhY8z WQnSK4+CQiiqqKpXdCj6XqOvtlZeW7S7DfnUVTxa8A== X-Google-Smtp-Source: AFSGD/VVGZfMGqL2f2fr7AdmjiwL7QEDJTGebO550rIyM9Ufv+99e+FqedfQWhZ2m3WI2XChV37PB/CAJSyH/yVf+5g= X-Received: by 2002:a37:6e86:: with SMTP id j128mr5616222qkc.46.1543587793256; Fri, 30 Nov 2018 06:23:13 -0800 (PST) MIME-Version: 1.0 References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> <20181130125645.GA97463@FreeBSD.org> In-Reply-To: <20181130125645.GA97463@FreeBSD.org> From: Warner Losh Date: Fri, 30 Nov 2018 07:23:01 -0700 Message-ID: Subject: Re: svn: head/usr.bin: . trim To: Alexey Dokuchaev Cc: Eugene Grosbein , src-committers , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, Cy Schubert X-Rspamd-Queue-Id: E5BCC845AF X-Spamd-Result: default: False [-5.46 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[0.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.46)[ip: (-9.14), ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.33), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 14:23:15 -0000 On Fri, Nov 30, 2018 at 5:57 AM Alexey Dokuchaev wrote: > On Fri, Nov 30, 2018 at 07:27:46PM +0700, Eugene Grosbein wrote: > > 30.11.2018 18:55, Alexey Dokuchaev wrote: > > > > >>> Another point: the manpage says, "It is only relevant for flash based > > >>> storage devices that use wear-leveling algorithms", which is an > argument > > >>> against generic "trim". I would mind less of it would be called > ftrim(8) > > >>> or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. > > > > [skip] > > > > > Yes, I understand you. Like I've said, a little more > flash-media-related > > > name would perhaps be more appropriate for such an utility. > > > > This excludes virtio_blk and ZFS. Perhaps, manpage should be corrected > > as quoted phrase has been taken from news -E description as is. > > How about mtrim(8) or media_trim(8)? I vaguely when back in times misc/mc > was installed as bin/midc because some commercial Unix implementation had > "mc" as a "media copy" command or something like that. > We should just put it in dd and remove this experiment. Both of these suggested names are horrible. They are too specific. And the notion that trim is too generic may have some merit, but the cure is worse than the disease. So I'm back to my point: we should just put it into dd and move on with our lives. It's really the right place for it. Why? Because then we can have 'dd if=image of=/dev/foo conf=sparse,erase' and it will erase the bits of the drive that are all 0's. We won't have to resort to weird hacks to make most of them trimmed. While this works only on media where trim is persistently 0's, that describes all modern flash media and most (all?) of the virtualization / thin storage scenarios I'm aware of. You can't do that with the current utility, at least not w/o a lot of effort. Warner From owner-svn-src-head@freebsd.org Fri Nov 30 14:24:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 004C111459CF for ; Fri, 30 Nov 2018 14:24:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC3B484899 for ; Fri, 30 Nov 2018 14:24:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id d18so6046797qto.8 for ; Fri, 30 Nov 2018 06:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4hLiAGMArx/Pqobdvg4reEO48pF5CB8KaURlLweAwLc=; b=1X2Ga4Txs52PKODsc7gUjU6/dryJTb3F5MfxDe+4jZuI0xxPUS0ZS9I6R8YZ1YdSZ5 KwiLaPXjg+DN/fJftfOcMi4JVXaWbyWXCA5qgh3+VL0RJ0KYoKCYpfUeUT6A4h9FzS5K gjI6ZZbE+85dbkuCblD6iIe6yeJrtqNdiV3LK0e1sT/w84D7ALzdJ6XPgK6xG55ia3z4 rxwyQ1qEZViQkJY7tZGomehEZ0d+MWCSrhER4rugwcutmS4MulZSaeLItO88+ZC4ie2Y /Qde0gK297TYNSL2OGPHmh6/l+mHBlWiOYzGXrUSUap02YZUYcc7hYfpn0cF7003s9H1 R5IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4hLiAGMArx/Pqobdvg4reEO48pF5CB8KaURlLweAwLc=; b=RZ1g2KgevlbabGUDZsdj0ER0mYHnz7DmakQo+MyXDBS4SF+g83qxMwq1oXUmaNzUex 7MYBbdnNpRd9pvcX4aoLQg3mTJPpM9lK31Fqmo+Xqyn9NfpJGNeg7R6hspiz6j7lElvj b/7oWaLuaStjN8n6kPiUgOk7MHVdXGv3tQkob+9IpGf4K1poa/2/mZaKkH18TbTBsU4D TrC4SwOiPzku3RgzWnSU6gYYMlcoGBuLBZjZdjzjsfgT8pACeEHWoPWen2UvElv/s8ab esyPTVeOkqQzj8R6+ZvJ07hSV++JGiw2JVRCXF3IrQiT9hc7gWvIi4dZRQpbYZVnA43k yHDw== X-Gm-Message-State: AA+aEWZUbaTgV9vctHfQ7VAUOz2tUkBf7tYCoKO4AETdS3hbXRMR4G29 XQuKshALJv/cZLwa9GeB7ncJ8LNckKYRPb9gfTbFHQ== X-Google-Smtp-Source: AFSGD/VAhF5QvCdNhacRO57nrjcLkTZyEaxEkjQW5hys8ndfSv8P+1pIO+thqVrTeAit+buvIMc0JRXxk59Qq+oLK00= X-Received: by 2002:ac8:548a:: with SMTP id h10mr5768814qtq.15.1543587875375; Fri, 30 Nov 2018 06:24:35 -0800 (PST) MIME-Version: 1.0 References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Fri, 30 Nov 2018 07:24:24 -0700 Message-ID: Subject: Re: svn: head/usr.bin: . trim To: Eugene Grosbein Cc: Alexey Dokuchaev , Baptiste Daroussin , Maxim Sobolev , src-committers , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, Cy Schubert X-Rspamd-Queue-Id: EC3B484899 X-Spamd-Result: default: False [-3.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.89)[-0.893,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_IN_DNSWL_NONE(0.00)[d.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.33), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 14:24:37 -0000 On Fri, Nov 30, 2018 at 4:45 AM Eugene Grosbein wrote: > 30.11.2018 18:34, Alexey Dokuchaev wrote: > > > Another point: the manpage says, "It is only relevant for flash based > > storage devices that use wear-leveling algorithms", which is an argument > > against generic "trim". I would mind less of it would be called ftrim(8) > > or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. > > Speaking of naming issues: > > NAME > dd - convert and copy a file > > I still prefer unix-way: "each utility does one simple task". > And that's not about dd :-( > That ship has sailed on dd. Even v7 dd wasn't good at doing one simple task... Warner From owner-svn-src-head@freebsd.org Fri Nov 30 15:52:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7431114772B; Fri, 30 Nov 2018 15:52:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 518528725E; Fri, 30 Nov 2018 15:52:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 322142A77; Fri, 30 Nov 2018 15:52:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUFq4lq058962; Fri, 30 Nov 2018 15:52:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUFq40O058961; Fri, 30 Nov 2018 15:52:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301552.wAUFq40O058961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 15:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341342 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 341342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 518528725E X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.241,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 15:52:04 -0000 Author: trasz Date: Fri Nov 30 15:52:03 2018 New Revision: 341342 URL: https://svnweb.freebsd.org/changeset/base/341342 Log: Revert r341337; according to imp@ we still support these. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Fri Nov 30 12:17:35 2018 (r341341) +++ head/share/man/man4/ddb.4 Fri Nov 30 15:52:03 2018 (r341342) @@ -1491,8 +1491,17 @@ might be defined to have special handling, and might be defined to simply panic and reboot. .El .Sh HINTS +On machines with an ISA expansion bus, a simple NMI generation card can be +constructed by connecting a push button between the A01 and B01 (CHCHK# and +GND) card fingers. +Momentarily shorting these two fingers together may cause the bridge chipset to +generate an NMI, which causes the kernel to pass control to +.Nm . +Some bridge chipsets do not generate a NMI on CHCHK#, so your mileage may vary. The NMI allows one to break into the debugger on a wedged machine to diagnose problems. +Other bus' bridge chipsets may be able to generate NMI using bus specific +methods. There are many PCI and PCIe add-in cards which can generate NMI for debugging. Modern server systems typically use IPMI to generate signals to enter the From owner-svn-src-head@freebsd.org Fri Nov 30 15:56:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3CF2114785D; Fri, 30 Nov 2018 15:56:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 867C18755A; Fri, 30 Nov 2018 15:56:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6379D2AB2; Fri, 30 Nov 2018 15:56:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUFuFQh060206; Fri, 30 Nov 2018 15:56:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUFuFlQ060205; Fri, 30 Nov 2018 15:56:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301556.wAUFuFlQ060205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 15:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341343 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 341343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 867C18755A X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.21)[0.209,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 15:56:16 -0000 Author: trasz Date: Fri Nov 30 15:56:14 2018 New Revision: 341343 URL: https://svnweb.freebsd.org/changeset/base/341343 Log: Add an example of rebuilding a single piece of userspace. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 2018 (r341342) +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 2018 (r341343) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2018 +.Dd November 30, 2018 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -118,6 +118,14 @@ After reboot: cd src make -j8 installworld reboot +.Ed +.Pp +Rebuild and reinstall a single piece of userspace, in this +case +.Xr ls 1 : +.Bd -literal -offset indent +cd src/bin/ls +make clean all install .Ed .Sh SEE ALSO .Xr svnlite 1 , From owner-svn-src-head@freebsd.org Fri Nov 30 16:01:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 966D11147B42; Fri, 30 Nov 2018 16:01:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A77769CFA; Fri, 30 Nov 2018 16:01:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C7662B1B; Fri, 30 Nov 2018 16:01:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUG1h9q065287; Fri, 30 Nov 2018 16:01:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUG1h3F065286; Fri, 30 Nov 2018 16:01:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301601.wAUG1h3F065286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 16:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341344 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 341344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A77769CFA X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.209,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:01:44 -0000 Author: trasz Date: Fri Nov 30 16:01:43 2018 New Revision: 341344 URL: https://svnweb.freebsd.org/changeset/base/341344 Log: Add an example of quick kernel rebuild. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Fri Nov 30 15:56:14 2018 (r341343) +++ head/share/man/man7/development.7 Fri Nov 30 16:01:43 2018 (r341344) @@ -127,6 +127,14 @@ case cd src/bin/ls make clean all install .Ed +.Pp +Quickly rebuild and reinstall the kernel, only recompiling the files +changed since last build; note that this will only work if the full kernel +build has been completed in the past, not on a fresh source tree: +.Bd -literal -offset indent +cd src +make -j8 kernel KERNFAST=1 +.Ed .Sh SEE ALSO .Xr svnlite 1 , .Xr witness 4 , From owner-svn-src-head@freebsd.org Fri Nov 30 16:02:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 719391147BB8; Fri, 30 Nov 2018 16:02:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18AAE69EF0; Fri, 30 Nov 2018 16:02:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDCD22C4A; Fri, 30 Nov 2018 16:02:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUG2RQx065381; Fri, 30 Nov 2018 16:02:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUG2RQg065380; Fri, 30 Nov 2018 16:02:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811301602.wAUG2RQg065380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Nov 2018 16:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341345 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 341345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18AAE69EF0 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.209,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:02:28 -0000 Author: trasz Date: Fri Nov 30 16:02:27 2018 New Revision: 341345 URL: https://svnweb.freebsd.org/changeset/base/341345 Log: Silence down the example builds a bit. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Fri Nov 30 16:01:43 2018 (r341344) +++ head/share/man/man7/development.7 Fri Nov 30 16:02:27 2018 (r341345) @@ -109,7 +109,7 @@ system: .Bd -literal -offset indent svnlite co https://svn.FreeBSD.org/base/head src cd src -make -j8 buildworld buildkernel installkernel +make -sj8 buildworld buildkernel installkernel shutdown -r now .Ed .Pp @@ -133,7 +133,7 @@ changed since last build; note that this will only wor build has been completed in the past, not on a fresh source tree: .Bd -literal -offset indent cd src -make -j8 kernel KERNFAST=1 +make -sj8 kernel KERNFAST=1 .Ed .Sh SEE ALSO .Xr svnlite 1 , From owner-svn-src-head@freebsd.org Fri Nov 30 16:24:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81727114870A; Fri, 30 Nov 2018 16:24:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 94A326ABA8; Fri, 30 Nov 2018 16:24:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 151738D4A14C; Fri, 30 Nov 2018 16:24:04 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BFF38D1F885; Fri, 30 Nov 2018 16:24:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id TpF7piiw6OGK; Fri, 30 Nov 2018 16:24:00 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 87FB8D1F878; Fri, 30 Nov 2018 16:21:19 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Edward Tomasz Napierala" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341343 - head/share/man/man7 Date: Fri, 30 Nov 2018 16:21:49 +0000 X-Mailer: MailMate (2.0BETAr6132) Message-ID: <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> In-Reply-To: <201811301556.wAUFuFlQ060205@repo.freebsd.org> References: <201811301556.wAUFuFlQ060205@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94A326ABA8 X-Spamd-Result: default: False [-4.61 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[zabbadoz.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-1.32)[ipnet: 2a01:4f8::/29(-3.92), asn: 24940(-2.67), country: DE(-0.02)]; MX_GOOD(-0.01)[cross.sbone.de]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:24:07 -0000 On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote: > Author: trasz > Date: Fri Nov 30 15:56:14 2018 > New Revision: 341343 > URL: https://svnweb.freebsd.org/changeset/base/341343 > > Log: > Add an example of rebuilding a single piece of userspace. > > Modified: > head/share/man/man7/development.7 > > Modified: head/share/man/man7/development.7 > ============================================================================== > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 > 2018 (r341342) > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 > 2018 (r341343) > @@ -118,6 +118,14 @@ After reboot: > cd src > make -j8 installworld > reboot > +.Ed > +.Pp > +Rebuild and reinstall a single piece of userspace, in this > +case > +.Xr ls 1 : > +.Bd -literal -offset indent > +cd src/bin/ls > +make clean all install I always thought the proper sequence was: make clean cleandepend obj depend all install However I have recently figured that it’s not actually true as building inside an individual user space source directory seems to pick up headers etc from the installed machine and not from the source tree. I keep arguing with myself if that had always been the case or not.. I am sure some people here do know better than me (so please see this as asking for help/advise). /bz From owner-svn-src-head@freebsd.org Fri Nov 30 16:35:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC6081148C50 for ; Fri, 30 Nov 2018 16:35:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4362F6B1DD for ; Fri, 30 Nov 2018 16:35:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x832.google.com with SMTP id k12so6533927qtf.7 for ; Fri, 30 Nov 2018 08:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z7/er1ewGrK4SUfev+Dw8svnKg6cMkoCYf58tNIQV4U=; b=BBxyP2xSZY+P1i/25xDzXDFN8jVK2/IUgT9h5ovj27qqTXdJYlj24ChZybvvfMLnbi VBpYgjCyzHOc1Tk1P1Y12ZNPeNyzpfm2shcGujYtLSd0E+vrrZtzTGO90YysV6ca2bYC gVBHJQDdaQxQg+jCkfTEa1+jO+4ykRrZrKq97wWrw3SOzg8goOJ471vHVXAfzT0L3HSo 05lEoYKGWN2XQpicc7lpay8QkCUgL/OyJW/4mZvWx8R0dGHkh1me6PdIlocFsCnhtDDR oYp89F09nfulwq3arjq5fGfeUUWI1k3f7VLYLJBJKvVT+sVek8f/x+f/XMK67QuhYtaj +Dzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z7/er1ewGrK4SUfev+Dw8svnKg6cMkoCYf58tNIQV4U=; b=UBanSanT13lOEDMTqqPz+TpuTBXx0/uuvpjjFGucWmBXKSazn2lws1OncWLbgh5zAM pYtT9u81vKx3INjqur2Ch7mKNIESqfPD1zv8rzg8K/SLH0oWHdkmdXTv2VIG8rWy50rJ AwIiscI2dYoPJ5zIxVt/QgMMFAwwYQVryW9xEzaiza7Xfu7KVba2weTxT7bsTf1c/uCl NEePxUkyAIU0zdtNzRDk3YIBuzrP9rpMsaLdyvXcMNJYLm2imPxTe//BMg/zzbVsWTvG Vg41MPqTZDVeFpybn8dU2/YiVL7G4tE+v26xKoqAKyocV0W984D4iohZNg0D3BHVvVSM 1Mzg== X-Gm-Message-State: AA+aEWapFVwH8TaEJd/1YsReKEqiMejSKfvH2rUeEdV41Glo0XF0nX/q 9mW3DJhQwqVL27N/aFalAs4LVlNffXYR0D9bxyhAlQ== X-Google-Smtp-Source: AFSGD/WUNx3+CrWzSaIGpLg6isV1vrJLcvgx89GTtJJKs0vKSlFde2kEkqbyQZaFUACVhCQxYKhwOzSOJa+mks0/a1g= X-Received: by 2002:ac8:668c:: with SMTP id d12mr5943785qtp.242.1543595713441; Fri, 30 Nov 2018 08:35:13 -0800 (PST) MIME-Version: 1.0 References: <201811301556.wAUFuFlQ060205@repo.freebsd.org> <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> In-Reply-To: <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> From: Warner Losh Date: Fri, 30 Nov 2018 09:35:02 -0700 Message-ID: Subject: Re: svn commit: r341343 - head/share/man/man7 To: "Bjoern A. Zeeb" Cc: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4362F6B1DD X-Spamd-Result: default: False [-3.45 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.985,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.82)[-0.822,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.34), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:35:15 -0000 On Fri, Nov 30, 2018 at 9:24 AM Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote: > > > Author: trasz > > Date: Fri Nov 30 15:56:14 2018 > > New Revision: 341343 > > URL: https://svnweb.freebsd.org/changeset/base/341343 > > > > Log: > > Add an example of rebuilding a single piece of userspace. > > > > Modified: > > head/share/man/man7/development.7 > > > > Modified: head/share/man/man7/development.7 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 > > 2018 (r341342) > > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 > > 2018 (r341343) > > @@ -118,6 +118,14 @@ After reboot: > > cd src > > make -j8 installworld > > reboot > > +.Ed > > +.Pp > > +Rebuild and reinstall a single piece of userspace, in this > > +case > > +.Xr ls 1 : > > +.Bd -literal -offset indent > > +cd src/bin/ls > > +make clean all install > > I always thought the proper sequence was: make clean cleandepend obj > depend all install > > However I have recently figured that it=E2=80=99s not actually true as > building inside an individual user space source directory seems to pick > up headers etc from the installed machine and not from the source tree. > I keep arguing with myself if that had always been the case or not.. I > am sure some people here do know better than me (so please see this as > asking for help/advise). > obj and depend are now optional (they are now reconstructed the first time something builds), but used to be required though sometime in the 9.x/10.x series. Except for on super-weird case involving FS level corruption, I've never needed these targets since the cut-over. cleandepend may be required in some weird edge cases, but it's rarely needed that you can omit it most of the time. It used to be required whenever the dependencies changed as part of the build. That's mostly, but not entirely, fixed today. Warner From owner-svn-src-head@freebsd.org Fri Nov 30 16:35:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBED51148C5A; Fri, 30 Nov 2018 16:35:17 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07FF26B1DF; Fri, 30 Nov 2018 16:35:17 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-x22c.google.com with SMTP id 83-v6so5521186ljf.10; Fri, 30 Nov 2018 08:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v8+WCtneMQ0+MQYFFb9iWntOAqr6e3w2mI2IIZFCORw=; b=SxnnLRZahpAMpJj3qPtbiDTqkHkh4WB8xNxSTGdvHOKYn04Hbz4lt1Uc6Rg+kH9afP HLu4AbSsWt6GZKpkzv9vVmVsySCiyAYtTFOQ9moaVHRRgPa2I1zZKlQNpHXw9wKaDVYE wPukgqTZaSKMDVNxnlF1zrW/M71LuujT4FcDn6r8EFVQqM23RmZ0Oe75tOmZZdxAVlNF EPOK47U2D1G03CssG4FnJIrHDZJCqcIJi7j956o+Nh7TNHIuC/mwJJEMunXoU3wu29nL o4W0GFHK+tObrY25tvuX9W9oiHtY4CTQh43AH1WiHa2KloYHJl9jHkDMN4J/21X9RJPe uloQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v8+WCtneMQ0+MQYFFb9iWntOAqr6e3w2mI2IIZFCORw=; b=m7B0Fts2ZT3OyQAN4zKykCmqA6WHUH+TSvPIj78kPWbHF1T21o7wDE08JWSl8AY5JR 1zsR4D77SJzLqOCeJsrfIx9C/u6SxWb9pAec6+nJGcmhA5pQUGKTmbaOWYoAcmHEOnBu Sff60B2D6IXcS/c+nEmWxv1yGt2dvfd+44oL4md76s5kNxFtgR4aPTBGYcQwEl5lt62N jtrIIe1v9ltNGGqvS+vWZtltt+q5uLVnykcJzGyON5ycXfjBJff6T2kYpdwxGd2RXywV fmn7/no2ach3jqfUOf4yP2+IC+lNChhvK/oCqdE1TnYlkwI5PbRngNCkA0Ljim4DYCEX C4yA== X-Gm-Message-State: AA+aEWbloVc2s64HL3fHZia3aO5t/VlSAKTKtEwbrfIlifqo9A2+jIUn l5JthV7zAch3TgecGlwpuiQPGJ7pj7JTzEGz8wJrsg== X-Google-Smtp-Source: AFSGD/VXIrcwE+HJgONggxO0MtC1quMw9jBXPr6E9nBHcoV+1RtslZb9Fu2ONcE2X0be+5HMljaVSwnIglZh/q5FYjU= X-Received: by 2002:a2e:8007:: with SMTP id j7-v6mr4457800ljg.22.1543595715349; Fri, 30 Nov 2018 08:35:15 -0800 (PST) MIME-Version: 1.0 References: <201811301556.wAUFuFlQ060205@repo.freebsd.org> <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> In-Reply-To: <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> From: Justin Hibbits Date: Fri, 30 Nov 2018 08:35:02 -0800 Message-ID: Subject: Re: svn commit: r341343 - head/share/man/man7 To: "Bjoern A. Zeeb" Cc: Edward Tomasz Napierala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 07FF26B1DF X-Spamd-Result: default: False [-6.49 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(-2.49)[ip: (-9.56), ipnet: 2a00:1450::/32(-1.48), asn: 15169(-1.34), country: US(-0.09)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[c.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:35:18 -0000 On Fri, Nov 30, 2018, 08:24 Bjoern A. Zeeb On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote: > > > Author: trasz > > Date: Fri Nov 30 15:56:14 2018 > > New Revision: 341343 > > URL: https://svnweb.freebsd.org/changeset/base/341343 > > > > Log: > > Add an example of rebuilding a single piece of userspace. > > > > Modified: > > head/share/man/man7/development.7 > > > > Modified: head/share/man/man7/development.7 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 > > 2018 (r341342) > > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 > > 2018 (r341343) > > @@ -118,6 +118,14 @@ After reboot: > > cd src > > make -j8 installworld > > reboot > > +.Ed > > +.Pp > > +Rebuild and reinstall a single piece of userspace, in this > > +case > > +.Xr ls 1 : > > +.Bd -literal -offset indent > > +cd src/bin/ls > > +make clean all install > > I always thought the proper sequence was: make clean cleandepend obj > depend all install > > However I have recently figured that it=E2=80=99s not actually true as > building inside an individual user space source directory seems to pick > up headers etc from the installed machine and not from the source tree. > I keep arguing with myself if that had always been the case or not.. I > am sure some people here do know better than me (so please see this as > asking for help/advise). > > /bz > > > When I need the build headers I use make buildenv ... cd bin/ls ... make - Justin From owner-svn-src-head@freebsd.org Fri Nov 30 16:36:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3E631148D86 for ; Fri, 30 Nov 2018 16:36:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 023C06B4B7 for ; Fri, 30 Nov 2018 16:36:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x831.google.com with SMTP id v11so6572913qtc.2 for ; Fri, 30 Nov 2018 08:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=C/y7Yj2vgbXsVzIsUu/b/pkaC85alIo5XmnqdXvZz/4=; b=uR0GTASBhSi3Q0bI5rN1p9iVTFwsiIUmsiBKaeVJeeL51JCjLLCqKLmBpigb+Z5EJ+ KTZei17fimBaRFaUUMtbq/vOf4AZg1mPrngL6sGSWAXfiEFe38fbfriPuUAvRhuTclve oi2TVyDvRAdFfiAMZtAug7sE4t4ZukYClJLmF2zcljkKrvpjr1pQgUTfrb+f/7pkG03E pvSZr32M9F8vLfithTftbIOozG6JOJgf8ookSoSWI28iMQKPsGTVyGDcSgbbyzJZ+Ko+ MSYqk1ecFPBA6IlJAEkHWPFgKdQpzWBqHwgKHyG99LdeKRMLNfrV3kFgfuoXWoe8jDGm gyXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C/y7Yj2vgbXsVzIsUu/b/pkaC85alIo5XmnqdXvZz/4=; b=oQFW1yM8LQ+jkZi9sDUjdm1NCX7qU+fyp+sO8rGEo8f8G/Q+96Y8w5aKxb0Eh9y+yA qFn3/InRcOCzB6szs9fXma0ghaDyUw/x7rup3ydzxLI16hH7KDF+smtF2xbJiLfCBHiL IUsdyk4xEaFgPUkV5Ow5Tygqpgqba0tcLfXotDKQcUJ9EnPWlJNcN8AyWtTYh9fTy+dN IUWffkEnK1SWNyASp2D88mB3DdiSrrvSjPkz+4Vo7HG03kgB6ieJ0MFiYzMiS6+AbSTs +DDJMlxbvGAr+hjDwHrDUBVIOPTgT9eXhJblpgTYpMNF0qfDcrHkCEKsM1NGZLOzJQXo 0auw== X-Gm-Message-State: AA+aEWZCX3v+UBo5GhOuOg9O8Qg3hofLQpNANq8eGRfqs6cUtpxQyitP Q4gcengvEEK+jI4609KMUa0Y54lbyHAl2g0d7h457y0U X-Google-Smtp-Source: AFSGD/UavKrRjP2sVg7Ju6ujf6lagssValdaQFiXcTycLPrMJuTHAQeRyCnf8HAbZXPGg2L/g46Qg8C4EO8/qBY47L0= X-Received: by 2002:a05:6214:1087:: with SMTP id o7mr6299687qvr.115.1543595814477; Fri, 30 Nov 2018 08:36:54 -0800 (PST) MIME-Version: 1.0 References: <201811301556.wAUFuFlQ060205@repo.freebsd.org> <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> In-Reply-To: From: Warner Losh Date: Fri, 30 Nov 2018 09:36:43 -0700 Message-ID: Subject: Re: svn commit: r341343 - head/share/man/man7 To: Justin Hibbits Cc: "Bjoern A. Zeeb" , =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 023C06B4B7 X-Spamd-Result: default: False [-3.44 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.985,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[1.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.81)[-0.814,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.34), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:36:56 -0000 On Fri, Nov 30, 2018 at 9:35 AM Justin Hibbits wrote= : > > > On Fri, Nov 30, 2018, 08:24 Bjoern A. Zeeb wrote: > >> On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote: >> >> > Author: trasz >> > Date: Fri Nov 30 15:56:14 2018 >> > New Revision: 341343 >> > URL: https://svnweb.freebsd.org/changeset/base/341343 >> > >> > Log: >> > Add an example of rebuilding a single piece of userspace. >> > >> > Modified: >> > head/share/man/man7/development.7 >> > >> > Modified: head/share/man/man7/development.7 >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 >> > 2018 (r341342) >> > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 >> > 2018 (r341343) >> > @@ -118,6 +118,14 @@ After reboot: >> > cd src >> > make -j8 installworld >> > reboot >> > +.Ed >> > +.Pp >> > +Rebuild and reinstall a single piece of userspace, in this >> > +case >> > +.Xr ls 1 : >> > +.Bd -literal -offset indent >> > +cd src/bin/ls >> > +make clean all install >> >> I always thought the proper sequence was: make clean cleandepend obj >> depend all install >> >> However I have recently figured that it=E2=80=99s not actually true as >> building inside an individual user space source directory seems to pick >> up headers etc from the installed machine and not from the source tree. >> I keep arguing with myself if that had always been the case or not.. I >> am sure some people here do know better than me (so please see this as >> asking for help/advise). >> >> /bz >> >> >> When I need the build headers I use > > > make buildenv > ... cd bin/ls > ... make > You can also do cd bin/ls ; make buildenv now too :) Warner From owner-svn-src-head@freebsd.org Fri Nov 30 16:38:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979AF1148E89; Fri, 30 Nov 2018 16:38:26 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C79A06B661; Fri, 30 Nov 2018 16:38:25 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-x235.google.com with SMTP id z80-v6so5526444ljb.8; Fri, 30 Nov 2018 08:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jQpNKCVZULTxDExZrJiw/u/7LLDgJWAehBDsyaMwJ0k=; b=GJ61jCNXApE0ZcB7UtOkQFkwYIhTMb7rWkaSP7sKtD9n3OuOzMfiFqoISPCimRZ7PV RlaEzpCZuVk10UqVdJVQ3yFNX6ayICS9rjn3aWcNJC0MXUSQ80no5/+7pdKJxi4qBTaU XILRHeYZHghjoWdxM1aRaGrGOoBm2IcbBh8+clx7o0UeHAbYthXfbUZXJIZyagiOMWjI jF+srXu+XbcN7AGtOgHD6p8r4MYGz2e6FARFlysS7Rk7TtTxStL4r4w+TtvRhfHGoMCq RpRHT04tcPwR9bVaFqwe3QgZ0vbwKPds1IOIK72AQKdEc7snwmynifVExMrWRDyCt8cQ 0jPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jQpNKCVZULTxDExZrJiw/u/7LLDgJWAehBDsyaMwJ0k=; b=WGNr+PYd3yv6qDpf+V+YD15wny2DHKHg6qTqj6oj04NzdpFnlZRM7vtGTkO65IdKUy iEOv81sJdnn/kZnDk3DqoWfAV6JGK4aKL7x6uAHTrbGW7xoN3XSNhgYibhtESJ9bKOps RPrlwnR2UUBWocUM3+Siv+tQwD+Jsm68DJfGTkUfD8ZwBgcQy31NqkL7UD27FE4Evhbj lY26Eq270g8d7bieeA0lxA/X4Mu3ipEo0oq8nb6Y5OkMWNwyb9sWz84wTYcQQFIosqBw LtFEQa2rLcktsgBPoQtVGFapzphz6m2xKLKf0baQHDtn9YalD4sqa+sufAcvhR3Ct2Yn 0z2g== X-Gm-Message-State: AA+aEWZyDimcrr6BkaPYMetPfjuFW/Tp0WxjN2OCYfIgWklEn/d9GQrL iMwrw2KlU28Pz15FlRC10CfNGizD/ScWaWEuehg= X-Google-Smtp-Source: AFSGD/WcFnJgYlESL6G0fVH1iSug/S6f/0oRlktJdxmUAt0Au2oCBmBvknqvzw2+zdj5SZwjb4B0zFZmi5eJ5ldL+sE= X-Received: by 2002:a2e:9e03:: with SMTP id e3-v6mr4426798ljk.4.1543595904215; Fri, 30 Nov 2018 08:38:24 -0800 (PST) MIME-Version: 1.0 References: <201811301556.wAUFuFlQ060205@repo.freebsd.org> <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> In-Reply-To: From: Justin Hibbits Date: Fri, 30 Nov 2018 08:38:11 -0800 Message-ID: Subject: Re: svn commit: r341343 - head/share/man/man7 To: Warner Losh Cc: "Bjoern A. Zeeb" , =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: C79A06B661 X-Spamd-Result: default: False [-4.52 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(-0.58)[ipnet: 2a00:1450::/32(-1.48), asn: 15169(-1.34), country: US(-0.09)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[5.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:38:26 -0000 On Fri, Nov 30, 2018, 08:36 Warner Losh > > On Fri, Nov 30, 2018 at 9:35 AM Justin Hibbits > wrote: > >> >> >> On Fri, Nov 30, 2018, 08:24 Bjoern A. Zeeb < >> bzeeb-lists@lists.zabbadoz.net wrote: >> >>> On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote: >>> >>> > Author: trasz >>> > Date: Fri Nov 30 15:56:14 2018 >>> > New Revision: 341343 >>> > URL: https://svnweb.freebsd.org/changeset/base/341343 >>> > >>> > Log: >>> > Add an example of rebuilding a single piece of userspace. >>> > >>> > Modified: >>> > head/share/man/man7/development.7 >>> > >>> > Modified: head/share/man/man7/development.7 >>> > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 >>> > 2018 (r341342) >>> > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 >>> > 2018 (r341343) >>> > @@ -118,6 +118,14 @@ After reboot: >>> > cd src >>> > make -j8 installworld >>> > reboot >>> > +.Ed >>> > +.Pp >>> > +Rebuild and reinstall a single piece of userspace, in this >>> > +case >>> > +.Xr ls 1 : >>> > +.Bd -literal -offset indent >>> > +cd src/bin/ls >>> > +make clean all install >>> >>> I always thought the proper sequence was: make clean cleandepend obj >>> depend all install >>> >>> However I have recently figured that it=E2=80=99s not actually true as >>> building inside an individual user space source directory seems to pick >>> up headers etc from the installed machine and not from the source tree. >>> I keep arguing with myself if that had always been the case or not.. I >>> am sure some people here do know better than me (so please see this as >>> asking for help/advise). >>> >>> /bz >>> >>> >>> When I need the build headers I use >> >> >> make buildenv >> ... cd bin/ls >> ... make >> > > You can also do cd bin/ls ; make buildenv now too :) > > Warner > I learn something new everyday! Thanks! - Justin > From owner-svn-src-head@freebsd.org Fri Nov 30 16:43:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D25114944D; Fri, 30 Nov 2018 16:43:31 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BA9C6BD0D; Fri, 30 Nov 2018 16:43:31 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D3B918D4A217; Fri, 30 Nov 2018 16:43:29 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BDF62D1F874; Fri, 30 Nov 2018 16:43:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id WU7SGd9bD5HZ; Fri, 30 Nov 2018 16:43:27 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id BCBC7D1F857; Fri, 30 Nov 2018 16:43:26 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Justin Hibbits" Cc: "Warner Losh" , "Edward Tomasz =?utf-8?q?Napiera=C5=82a?=" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341343 - head/share/man/man7 Date: Fri, 30 Nov 2018 16:44:00 +0000 X-Mailer: MailMate (2.0BETAr6132) Message-ID: <06F736F1-E101-4720-A70C-A58D143CFE49@lists.zabbadoz.net> In-Reply-To: References: <201811301556.wAUFuFlQ060205@repo.freebsd.org> <5F231C0E-AD6A-4F85-9D65-3EB414B59E6E@lists.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 1BA9C6BD0D X-Spamd-Result: default: False [-4.60 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[zabbadoz.net]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: cross.sbone.de]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; IP_SCORE(-1.32)[ipnet: 2a01:4f8::/29(-3.93), asn: 24940(-2.68), country: DE(-0.02)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:43:31 -0000 On 30 Nov 2018, at 16:38, Justin Hibbits wrote: > On Fri, Nov 30, 2018, 08:36 Warner Losh >> >> >> On Fri, Nov 30, 2018 at 9:35 AM Justin Hibbits >> wrote: >> >>> >>> >>> On Fri, Nov 30, 2018, 08:24 Bjoern A. Zeeb < >>> bzeeb-lists@lists.zabbadoz.net wrote: >>> >>>> On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote: >>>> >>>>> Author: trasz >>>>> Date: Fri Nov 30 15:56:14 2018 >>>>> New Revision: 341343 >>>>> URL: https://svnweb.freebsd.org/changeset/base/341343 >>>>> >>>>> Log: >>>>> Add an example of rebuilding a single piece of userspace. >>>>> >>>>> Modified: >>>>> head/share/man/man7/development.7 >>>>> >>>>> Modified: head/share/man/man7/development.7 >>>>> >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 >>>>> 2018 (r341342) >>>>> +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 >>>>> 2018 (r341343) >>>>> @@ -118,6 +118,14 @@ After reboot: >>>>> cd src >>>>> make -j8 installworld >>>>> reboot >>>>> +.Ed >>>>> +.Pp >>>>> +Rebuild and reinstall a single piece of userspace, in this >>>>> +case >>>>> +.Xr ls 1 : >>>>> +.Bd -literal -offset indent >>>>> +cd src/bin/ls >>>>> +make clean all install >>>> >>>> I always thought the proper sequence was: make clean cleandepend = >>>> obj >>>> depend all install >>>> >>>> However I have recently figured that it=E2=80=99s not actually true = as >>>> building inside an individual user space source directory seems to = >>>> pick >>>> up headers etc from the installed machine and not from the source = >>>> tree. >>>> I keep arguing with myself if that had always been the case or = >>>> not.. I >>>> am sure some people here do know better than me (so please see this = >>>> as >>>> asking for help/advise). >>>> >>>> /bz >>>> >>>> >>>> When I need the build headers I use >>> >>> >>> make buildenv >>> ... cd bin/ls >>> ... make >>> >> >> You can also do cd bin/ls ; make buildenv now too :) >> >> Warner >> > > I learn something new everyday! Thanks! I guess that should be documented as part of the needed steps then? /bz From owner-svn-src-head@freebsd.org Fri Nov 30 17:02:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A23A1149DFE; Fri, 30 Nov 2018 17:02:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E57106C8D7; Fri, 30 Nov 2018 17:02:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAUGkJmc019025; Fri, 30 Nov 2018 08:46:19 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAUGkICh019024; Fri, 30 Nov 2018 08:46:18 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811301646.wAUGkICh019024@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn: head/usr.bin: . trim In-Reply-To: To: Warner Losh Date: Fri, 30 Nov 2018 08:46:18 -0800 (PST) CC: Alexey Dokuchaev , Eugene Grosbein , src-committers , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, Cy Schubert Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: E57106C8D7 X-Spamd-Result: default: False [-1.21 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.78)[-0.778,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.76)[-0.758,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.55)[-0.549,0]; RCPT_COUNT_SEVEN(0.00)[8]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 17:02:54 -0000 > On Fri, Nov 30, 2018 at 5:57 AM Alexey Dokuchaev wrote: > > > On Fri, Nov 30, 2018 at 07:27:46PM +0700, Eugene Grosbein wrote: > > > 30.11.2018 18:55, Alexey Dokuchaev wrote: > > > > > > >>> Another point: the manpage says, "It is only relevant for flash based > > > >>> storage devices that use wear-leveling algorithms", which is an > > argument > > > >>> against generic "trim". I would mind less of it would be called > > ftrim(8) > > > >>> or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. > > > > > > [skip] > > > > > > > Yes, I understand you. Like I've said, a little more > > flash-media-related > > > > name would perhaps be more appropriate for such an utility. > > > > > > This excludes virtio_blk and ZFS. Perhaps, manpage should be corrected > > > as quoted phrase has been taken from news -E description as is. > > > > How about mtrim(8) or media_trim(8)? I vaguely when back in times misc/mc > > was installed as bin/midc because some commercial Unix implementation had > > "mc" as a "media copy" command or something like that. > > > > We should just put it in dd and remove this experiment. Both of these > suggested names are horrible. They are too specific. And the notion that > trim is too generic may have some merit, but the cure is worse than the > disease. > > So I'm back to my point: we should just put it into dd and move on with our > lives. It's really the right place for it. > > Why? > > Because then we can have 'dd if=image of=/dev/foo conf=sparse,erase' and it conf -> conv, and why erase? We are not actually erasing anything during this "copy" operation. I am having some confusion as to how the above would actually do the same thing that trim(8) implements. I do not really care if this is implemented as trim(8) or part of dd, either way is reasonable, though I am upset at repeating the discussion that already occured pre commit. Seems not enough committers follow hackers any more, so that has become a poor forum for vettting ideas, and now we post commit vet them on -commit. > will erase the bits of the drive that are all 0's. We won't have to resort > to weird hacks to make most of them trimmed. While this works only on media > where trim is persistently 0's, that describes all modern flash media and > most (all?) of the virtualization / thin storage scenarios I'm aware of. > You can't do that with the current utility, at least not w/o a lot of > effort. If your reading from file image and writting to dev foo I do not see that description matching the above command invocation. I think it would be: dd if=/dev/foo of=/dev/foo conv=noerror,sync,trim sparse is not involved, it is for files, not devices. erase imho is the wrong keyword, nothing in the trim/delete world calls this operation erase do they? trim could imply noerror,sync. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Nov 30 17:07:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5915F1149F63; Fri, 30 Nov 2018 17:07:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B68EC6CCA5; Fri, 30 Nov 2018 17:07:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAUH7CIO019143; Fri, 30 Nov 2018 09:07:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAUH7Ce2019142; Fri, 30 Nov 2018 09:07:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811301707.wAUH7Ce2019142@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r341343 - head/share/man/man7 In-Reply-To: To: Warner Losh Date: Fri, 30 Nov 2018 09:07:12 -0800 (PST) CC: "Bjoern A. Zeeb" , =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B68EC6CCA5 X-Spamd-Result: default: False [-0.97 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.62)[-0.619,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.33)[-0.325,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.90)[-0.899,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 17:07:15 -0000 > On Fri, Nov 30, 2018 at 9:24 AM Bjoern A. Zeeb < > bzeeb-lists@lists.zabbadoz.net> wrote: > > > On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote: > > > > > Author: trasz > > > Date: Fri Nov 30 15:56:14 2018 > > > New Revision: 341343 > > > URL: https://svnweb.freebsd.org/changeset/base/341343 > > > > > > Log: > > > Add an example of rebuilding a single piece of userspace. > > > > > > Modified: > > > head/share/man/man7/development.7 > > > > > > Modified: head/share/man/man7/development.7 > > > > > ============================================================================== > > > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03 > > > 2018 (r341342) > > > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14 > > > 2018 (r341343) > > > @@ -118,6 +118,14 @@ After reboot: > > > cd src > > > make -j8 installworld > > > reboot > > > +.Ed > > > +.Pp > > > +Rebuild and reinstall a single piece of userspace, in this > > > +case > > > +.Xr ls 1 : > > > +.Bd -literal -offset indent > > > +cd src/bin/ls > > > +make clean all install > > > > I always thought the proper sequence was: make clean cleandepend obj > > depend all install make clean && make cleandepend && make obj && \ make depend && make all && make install If you do not use the && jointers you may actually end up installing a binary that was from the last build.... or other not so nice side effects from not stopping your command sequence on failure. > > > > However I have recently figured that it?s not actually true as > > building inside an individual user space source directory seems to pick > > up headers etc from the installed machine and not from the source tree. > > I keep arguing with myself if that had always been the case or not.. I > > am sure some people here do know better than me (so please see this as > > asking for help/advise). The original BSD 4.4 lite case, and hence early FreeBSD up to some point, was that all builds, other than the kernel which is self isolated by design, picked up the installed include files from /usr/include. This is what lead to the original top level Makefile target make includes which populates DESTDIR/usr/include from the files in the src tree you are rooted at. There was also an associated knob whos name is escaping me right now that says to make the DESTDIR/usr/include hierarchy symlinks into the source tree, thus in effect making your userland builds always use the header files from the current src tree. > > > > obj and depend are now optional (they are now reconstructed the first time > something builds), but used to be required though sometime in the 9.x/10.x > series. Except for on super-weird case involving FS level corruption, I've > never needed these targets since the cut-over. obj was orignally optional, and hopefully has always been and still is optional. Also true of depend, but you might not get what you wanted/ expected if you do not make the .depends files if your editing the src's and recompiling. If your just building from a "clean" src/obj pair there should be no need for depend until you edit something, then you need to run a depend build so that make knows what to rebuild. > cleandepend may be required in some weird edge cases, but it's rarely > needed that you can omit it most of the time. It used to be required > whenever the dependencies changed as part of the build. That's mostly, but > not entirely, fixed today. cleandepend was traditionally required when depencies changed in a way that caused the contents of the .depend file to be incorrect. If .depend is dependent on every file listed in the .depend file and Makefile and .mk files make depend should be able to do the right thing all the time. I never got to this idea back in the day, .depend files had no depencies and the user had to know when they effected the dependency graph and to run a make cleandepend && make depend pass. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Nov 30 17:30:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF702114A948; Fri, 30 Nov 2018 17:30:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFE66D9B1; Fri, 30 Nov 2018 17:30:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E0E7A10B429; Fri, 30 Nov 2018 12:30:43 -0500 (EST) Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: Andrew Rybchenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811300711.wAU7B5R6084752@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 30 Nov 2018 09:30:42 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201811300711.wAU7B5R6084752@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 30 Nov 2018 12:30:44 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 5AFE66D9B1 X-Spamd-Result: default: False [0.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.15)[-0.153,0]; NEURAL_SPAM_LONG(0.17)[0.173,0]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; NEURAL_SPAM_SHORT(0.57)[0.575,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 17:30:46 -0000 On 11/29/18 11:11 PM, Andrew Rybchenko wrote: > Author: arybchik > Date: Fri Nov 30 07:11:05 2018 > New Revision: 341327 > URL: https://svnweb.freebsd.org/changeset/base/341327 > > Log: > sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped > > Early processing of a packet on transmit may change last seen > VLAN TCI in the queue context. If such a packet is eventually > dropped, last seen VLAN TCI must be set to its previous value. > > Submitted by: Ivan Malov > Sponsored by: Solarflare Communications, Inc. > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D18288 Just as a general comment. There's no point in creating a review in phabricator if you aren't going to get any actual review feedback via the tool. That just adds noise. (I've spotchecked a few of the recent sfxge commits and they all seem to create a review that then gets committed a few hours later without any feedback, etc.) -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Fri Nov 30 17:37:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8AA2114AB9E for ; Fri, 30 Nov 2018 17:37:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E8096DE59 for ; Fri, 30 Nov 2018 17:37:19 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1543599435; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=mEBYyc+HsN7P+K3ToV07GonIgYhqtz+UKMLEUCOkTtsANx/8qjSpUppU+4YwGaQdR4cLzklSnJhcd 8OPpReINX7GEqN07kpdRhsZH/ZsRhJHQnMCWr0QsvJgpgaypIegTaGCBBY2munTEAUI4wJv0sw7kM7 WfcUK1QabfZcPWpuQ7I9gMguQuiRMx7EcTHivUK4UDoN0MwukftXK+KR8Du+X2tWSbq1/N9qBNncM2 bfL7LiLZhPPxEu/ZZX/Q1rTrNLm2otysgNuVss0zpClhXlBCQxi9U4z8CV1qCURlR1ZWfx+moT00X5 JzR6UT4BwCkk5S5jIQ1RC5YZ5SQyuUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=f0wqFptRV+BG5Mc2Mq+ieRnVGZec1dqT4xyi1BiYWaw=; b=N4wtiH30LGOyYcaW+VMV6ldzJigkOp7L3jikLiz/XwgeJOs4aeHlMWVcFJMwlyvWf/BuMzNCIMKlL 9iH50uRm7HYqRWlxd9RsdSYsvTxnvVeT/TDLAqbNf5WsPv+jCNwAfOKicD4ZEaFGYNZDCBJI1fuLVX +zJT+K1EZetvXHQPzR/waOVoOMKQ26BpIUgcDLzmy+dDl+yAwtEBbwf9bxXrRnYrK3/vBzA3NtHLcV dEeElq1wW+P47YpEE7qexS5ysz0TUlh2vc8tevTHyPCZH5uHc0Y8Emu4Sclzpw9SX2xyJEwAQHtYcv S1xw3tpENyUQ8wCWqpoqEt9dh+p7bbQ== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=f0wqFptRV+BG5Mc2Mq+ieRnVGZec1dqT4xyi1BiYWaw=; b=DplYW6HfAveR8x3ZVwka+iw7bbO+xSbFe3QFJAx6lJBXVjoD1oFlIWs4FTC3Hwjn3rVKfCJiBZ55W qbzM0bn5EUOPzqpEP2w8+NO6dhMpU6wM4EHLNrATkB0vgUd3tyQzraGe08TC3apwwBw4A3dMKQUocV X8lYI0zF2UEYSjCkM82+IAU1lS/I9qw/fYnJTro4vMfG0yT0SAXVQKkYuuURKg2/Nn2dlKMuMAXPgi XLCtjFmjtjqwGXQp5w+KpsG2F4nSO/n3pG5V5oVdPlbLHo45gI5gQk51XS09Ogk1e0OX4wmIJPmjaI L0dE8v0D9u2WlSLMnjYlGEa7/rqFU9w== X-MHO-RoutePath: aGlwcGll X-MHO-User: 91de3937-f4c6-11e8-8a28-a1efd8da9a94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id 91de3937-f4c6-11e8-8a28-a1efd8da9a94; Fri, 30 Nov 2018 17:37:13 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wAUHbBWX044255; Fri, 30 Nov 2018 10:37:11 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1543599431.1860.161.camel@freebsd.org> Subject: Re: svn commit: r341344 - head/share/man/man7 From: Ian Lepore To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 30 Nov 2018 10:37:11 -0700 In-Reply-To: <201811301601.wAUG1h3F065286@repo.freebsd.org> References: <201811301601.wAUG1h3F065286@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E8096DE59 X-Spamd-Result: default: False [1.39 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; NEURAL_SPAM_SHORT(0.71)[0.713,0]; NEURAL_SPAM_MEDIUM(0.60)[0.598,0]; NEURAL_SPAM_LONG(0.08)[0.082,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 17:37:20 -0000 On Fri, 2018-11-30 at 16:01 +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Fri Nov 30 16:01:43 2018 > New Revision: 341344 > URL: https://svnweb.freebsd.org/changeset/base/341344 > > Log: >   Add an example of quick kernel rebuild. >    >   MFC after: 2 weeks >   Sponsored by: DARPA, AFRL > > Modified: >   head/share/man/man7/development.7 > > Modified: head/share/man/man7/development.7 > ===================================================================== > ========= > --- head/share/man/man7/development.7 Fri Nov 30 15:56:14 2018 > (r341343) > +++ head/share/man/man7/development.7 Fri Nov 30 16:01:43 2018 > (r341344) > @@ -127,6 +127,14 @@ case >  cd src/bin/ls >  make clean all install >  .Ed > +.Pp > +Quickly rebuild and reinstall the kernel, only recompiling the files > +changed since last build; note that this will only work if the full > kernel > +build has been completed in the past, not on a fresh source tree: > +.Bd -literal -offset indent > +cd src > +make -j8 kernel KERNFAST=1 It might also be worth mentioning that if you're building a kernel other than GENERIC, you can use KERNFAST=configname instead of KERNFAST=1 KERNCONF=configname -- Ian From owner-svn-src-head@freebsd.org Fri Nov 30 17:47:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3BA7114AE94; Fri, 30 Nov 2018 17:47:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32E9A6E38D; Fri, 30 Nov 2018 17:47:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id BEB9910B429; Fri, 30 Nov 2018 12:47:36 -0500 (EST) Subject: Re: svn commit: r341344 - head/share/man/man7 To: Ian Lepore , Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811301601.wAUG1h3F065286@repo.freebsd.org> <1543599431.1860.161.camel@freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <9ac1300e-3e8a-1151-dd8d-3a980bd6cae8@FreeBSD.org> Date: Fri, 30 Nov 2018 09:47:35 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1543599431.1860.161.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 30 Nov 2018 12:47:37 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 32E9A6E38D X-Spamd-Result: default: False [0.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.14)[-0.135,0]; NEURAL_SPAM_SHORT(0.70)[0.704,0]; NEURAL_SPAM_LONG(0.17)[0.173,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 17:47:38 -0000 On 11/30/18 9:37 AM, Ian Lepore wrote: > On Fri, 2018-11-30 at 16:01 +0000, Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Fri Nov 30 16:01:43 2018 >> New Revision: 341344 >> URL: https://svnweb.freebsd.org/changeset/base/341344 >> >> Log: >>   Add an example of quick kernel rebuild. >>    >>   MFC after: 2 weeks >>   Sponsored by: DARPA, AFRL >> >> Modified: >>   head/share/man/man7/development.7 >> >> Modified: head/share/man/man7/development.7 >> ===================================================================== >> ========= >> --- head/share/man/man7/development.7 Fri Nov 30 15:56:14 2018 >> (r341343) >> +++ head/share/man/man7/development.7 Fri Nov 30 16:01:43 2018 >> (r341344) >> @@ -127,6 +127,14 @@ case >>  cd src/bin/ls >>  make clean all install >>  .Ed >> +.Pp >> +Quickly rebuild and reinstall the kernel, only recompiling the files >> +changed since last build; note that this will only work if the full >> kernel >> +build has been completed in the past, not on a fresh source tree: >> +.Bd -literal -offset indent >> +cd src >> +make -j8 kernel KERNFAST=1 > > It might also be worth mentioning that if you're building a kernel > other than GENERIC, you can use KERNFAST=configname instead of > KERNFAST=1 KERNCONF=configname You could perhaps just use 'KERNFAST=GENERIC' in this example and it would effectively communicate that I think. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Fri Nov 30 18:03:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A3A114B475; Fri, 30 Nov 2018 18:03:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15BAE6ED25; Fri, 30 Nov 2018 18:03:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4DDE4449; Fri, 30 Nov 2018 18:02:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUI2xA5029758; Fri, 30 Nov 2018 18:02:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUI2xZK029757; Fri, 30 Nov 2018 18:02:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811301802.wAUI2xZK029757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 30 Nov 2018 18:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341346 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 341346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15BAE6ED25 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.37)[0.366,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 18:03:00 -0000 Author: markj Date: Fri Nov 30 18:02:59 2018 New Revision: 341346 URL: https://svnweb.freebsd.org/changeset/base/341346 Log: Add missing display messages when toggling modes. PR: 233667 Submitted by: James Wright MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18331 Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Nov 30 16:02:27 2018 (r341345) +++ head/usr.bin/top/top.c Fri Nov 30 18:02:59 2018 (r341346) @@ -985,6 +985,9 @@ restart: break; case CMD_viewtog: displaymode = displaymode == DISP_IO ? DISP_CPU : DISP_IO; + new_message(MT_standout | MT_delayed, + " Displaying %s statistics.", + displaymode == DISP_IO ? "IO" : "CPU"); header_text = format_header(uname_field); display_header(true); d_header = i_header; @@ -992,9 +995,15 @@ restart: break; case CMD_viewsys: ps.system = !ps.system; + new_message(MT_standout | MT_delayed, + " %sisplaying system processes.", + ps.system ? "D" : "Not d"); break; case CMD_showargs: fmt_flags ^= FMT_SHOWARGS; + new_message(MT_standout | MT_delayed, + " %sisplaying process arguments.", + fmt_flags & FMT_SHOWARGS ? "D" : "Not d"); break; case CMD_order: new_message(MT_standout, From owner-svn-src-head@freebsd.org Fri Nov 30 18:04:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D4E3114B531 for ; Fri, 30 Nov 2018 18:04:41 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D0446EEF5 for ; Fri, 30 Nov 2018 18:04:40 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ot1-f52.google.com with SMTP id u16so5892257otk.8 for ; Fri, 30 Nov 2018 10:04:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FxRRlnQRnSj2yy8XuM0kkbuiWRXYhZBw0yobjU4R+z0=; b=U/dseGQe801jDo85wvMD9lE0DeeGXf6XyDTODx3UsG45f+SIDyOLDjjjcb4XfmopS7 DvTmwObBlEIITfNa9g2CYTRaHevi4oriApYIuMQ7rknEPNiG17NI1I49ia2IJFOfqvr4 weXuvFlZopWyFc6jkGxIeB9xeKE+nUHd27fMnNjdh9Zeb/J5ss1h10N+Q0P0aInlo/MP gJu8if5RhG47PGPrO54KhwoH1X/Yzeo/fivySQfpU2/D/FUDOPFeRtXEsUH5VpB6JiXA DaOIqkTMDiz+S7iRYZ1t5bLcZW5RXGDWcftENrep7SVsYQ5x6LeV5SW+QZK32uO59AH9 y7aA== X-Gm-Message-State: AA+aEWZnM3vP49y5yFTomLibH5vasgvdAuQ4VDj3Sq/1/XV5ZWvsaDVw fuvc+k5bcdTx75qeYCkuIVpWoLzm69ksG+EapirDzg== X-Google-Smtp-Source: AFSGD/XbqDUH+21TEJ3fyDGrJwhfWoscyHmIg/tJVQ7jBbk1/Cdg6JipF4ItdCIuqP61AQ3d3F6c0Cx5ukKNvpLmBdo= X-Received: by 2002:a9d:6c5:: with SMTP id 63mr1602560otx.81.1543601073449; Fri, 30 Nov 2018 10:04:33 -0800 (PST) MIME-Version: 1.0 References: <201811301646.wAUGkICh019024@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811301646.wAUGkICh019024@pdx.rh.CN85.dnsmgr.net> From: Maxim Sobolev Date: Fri, 30 Nov 2018 10:04:21 -0800 Message-ID: Subject: Re: svn: head/usr.bin: . trim To: rgrimes@freebsd.org Cc: Warner Losh , Alexey Dokuchaev , Eugene Grosbein , src-committers , svn-src-all@freebsd.org, steven.hartland@multiplay.co.uk, svn-src-head@freebsd.org, Cy Schubert X-Rspamd-Queue-Id: 7D0446EEF5 X-Spamd-Result: default: False [-3.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[52.210.85.209.rep.mailspike.net : 127.0.0.18]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_IN_DNSWL_NONE(0.00)[52.210.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.97)[ipnet: 209.85.128.0/17(-3.42), asn: 15169(-1.34), country: US(-0.09)]; FORGED_SENDER(0.30)[sobomax@freebsd.org,sobomax@sippysoft.com]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[sobomax@freebsd.org,sobomax@sippysoft.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 18:04:41 -0000 Well, I personally think "erase" better describes the option in question. "delete" is ambiguous, since nothing is really "deleted" here and "trim" refers to a name of a particular command in a particular protocol, which may or may not be around in 10 years from now. However, it looks like the industry has settled on that term for now and we've adopted utility with that very name, so I've updated my review request with that. https://reviews.freebsd.org/D18382 Other than that, it would work just as Warner has described. That all being said, I think it might need some other option to actually zero-out block before we trim them out. What I discovered is that unlike say our md(4), actual SATA hard drives may still return some, possibly random, data after BIO_DELETE'ing the corresponding block. So if you have say a big file filled with zeroes for whatever reason, then making a copy of your fs with conv=trim would likely result in some old garbage in that file after such an operation, unless you zero-out the content in advance. As an option, I could possibly make a modifications so that: "conv=sparse,trim" performs just a TRIM "conv=trim" performs write(NIL)+TRIM Then we can have a cake and eat it too. :) -Max On Fri, Nov 30, 2018 at 9:03 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Fri, Nov 30, 2018 at 5:57 AM Alexey Dokuchaev > wrote: > > > > > On Fri, Nov 30, 2018 at 07:27:46PM +0700, Eugene Grosbein wrote: > > > > 30.11.2018 18:55, Alexey Dokuchaev wrote: > > > > > > > > >>> Another point: the manpage says, "It is only relevant for flash > based > > > > >>> storage devices that use wear-leveling algorithms", which is an > > > argument > > > > >>> against generic "trim". I would mind less of it would be called > > > ftrim(8) > > > > >>> or ssd_trim(8) or flash_trim(8), but still prefer Maxim's > approach. > > > > > > > > [skip] > > > > > > > > > Yes, I understand you. Like I've said, a little more > > > flash-media-related > > > > > name would perhaps be more appropriate for such an utility. > > > > > > > > This excludes virtio_blk and ZFS. Perhaps, manpage should be > corrected > > > > as quoted phrase has been taken from news -E description as is. > > > > > > How about mtrim(8) or media_trim(8)? I vaguely when back in times > misc/mc > > > was installed as bin/midc because some commercial Unix implementation > had > > > "mc" as a "media copy" command or something like that. > > > > > > > We should just put it in dd and remove this experiment. Both of these > > suggested names are horrible. They are too specific. And the notion that > > trim is too generic may have some merit, but the cure is worse than the > > disease. > > > > So I'm back to my point: we should just put it into dd and move on with > our > > lives. It's really the right place for it. > > > > Why? > > > > Because then we can have 'dd if=image of=/dev/foo conf=sparse,erase' and > it > > conf -> conv, and why erase? We are not actually erasing anything > during this "copy" operation. I am having some confusion as to > how the above would actually do the same thing that trim(8) implements. > > I do not really care if this is implemented as trim(8) or part of > dd, either way is reasonable, though I am upset at repeating the > discussion that already occured pre commit. Seems not enough > committers follow hackers any more, so that has become a poor > forum for vettting ideas, and now we post commit vet them on > -commit. > > > will erase the bits of the drive that are all 0's. We won't have to > resort > > to weird hacks to make most of them trimmed. While this works only on > media > > where trim is persistently 0's, that describes all modern flash media and > > most (all?) of the virtualization / thin storage scenarios I'm aware of. > > You can't do that with the current utility, at least not w/o a lot of > > effort. > > If your reading from file image and writting to dev foo I do > not see that description matching the above command invocation. > > I think it would be: > dd if=/dev/foo of=/dev/foo conv=noerror,sync,trim > sparse is not involved, it is for files, not devices. > erase imho is the wrong keyword, nothing in the trim/delete > world calls this operation erase do they? > trim could imply noerror,sync. > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Fri Nov 30 18:15:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39D4D114BC19; Fri, 30 Nov 2018 18:15:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [84.52.114.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFC346F589; Fri, 30 Nov 2018 18:15:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from [192.168.1.192] (unknown [188.242.181.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 2C8587F5F4; Fri, 30 Nov 2018 21:15:42 +0300 (MSK) Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: John Baldwin References: <201811300711.wAU7B5R6084752@repo.freebsd.org> From: Andrew Rybchenko Organization: OKTET Labs Cc: gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, philip@FreeBSD.org Message-ID: <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> Date: Fri, 30 Nov 2018 21:15:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: AFC346F589 X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.21)[-0.206,0]; NEURAL_SPAM_SHORT(0.70)[0.698,0]; NEURAL_SPAM_LONG(0.13)[0.126,0]; ASN(0.00)[asn:25408, ipnet:84.52.64.0/18, country:RU] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 18:15:51 -0000 On 30.11.2018 20:30, John Baldwin wrote: > On 11/29/18 11:11 PM, Andrew Rybchenko wrote: >> Author: arybchik >> Date: Fri Nov 30 07:11:05 2018 >> New Revision: 341327 >> URL: https://svnweb.freebsd.org/changeset/base/341327 >> >> Log: >> sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped >> >> Early processing of a packet on transmit may change last seen >> VLAN TCI in the queue context. If such a packet is eventually >> dropped, last seen VLAN TCI must be set to its previous value. >> >> Submitted by: Ivan Malov >> Sponsored by: Solarflare Communications, Inc. >> MFC after: 1 week >> Differential Revision: https://reviews.freebsd.org/D18288 > Just as a general comment. There's no point in creating a review in > phabricator if you aren't going to get any actual review feedback via > the tool. That just adds noise. (I've spotchecked a few of the recent > sfxge commits and they all seem to create a review that then gets committed > a few hours later without any feedback, etc.) All these changesets is the result of development in Solarflare. All these changesets were reviewed internally and in fact many have later fixes which are simply squashed in. We have discussed it with George (gnn@) some time ago and he asked to submit reviews anyway and wait at least a day or two before commit. Yes in this particular case these 2 hundreds of patches is the result of 2 years of development. So, I'd waited some time and started to commit in blocks. This time I've not included np@ and bz@ in reviewers since I've not got reviewed before and it would be too much spam. We have discussed it with Philip (philip@) shortly. As I understand he has no time now to review it. Basically I'm ready to follow any sensible policy. I don't think it makes to wait forever. If there are any volunteers I'll be happy to include more people in reviewers. Andrew. From owner-svn-src-head@freebsd.org Fri Nov 30 18:35:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AA89114C43B; Fri, 30 Nov 2018 18:35:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AA4F70080; Fri, 30 Nov 2018 18:35:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f175.google.com with SMTP id h193so10734182ita.5; Fri, 30 Nov 2018 10:35:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=SOby22t/g8gsXow9WxIngFiLMUfUri8FqhYoSBGxCAM=; b=WWXBc6W04b4sN9ghDkfKzPBTyQTF33vlG/CnRtyCJ/Kz4k0KYgAiGPIleBAvyX2iSt JBBHgty3n+tbn21uF6kzEjAL4zEuKl5H6MkH/CfkPBAzn+i7W7j+UCqi6B0JpDH1bgYl p2HnjJZ2MNRFvXJZqbyquafCvKwTlMP7lb633dJVYLK0xVdaa3IH3igsaNZkDX5jH73W 2yl0cCPHvKRQzF9vY9L4MKm2r8AEeZnqMry6xpw4W0kmGjJHYkbO/SG5oAjfk73gLW5/ jcJYg5+kCcA0zTNa0jxVLUXvma4jB8D42eaQvyPYQB/7qPg0lJYZJdWUHzyGxu4M8oc7 KZwA== X-Gm-Message-State: AA+aEWa33odo4kWse/hAJls49yu9+PY1WR7MvNROh699sdaMZrVzAUQc cQRzSpS/j6CmR/Y603xbm+ngae/u X-Google-Smtp-Source: AFSGD/W68jGJZYq78TXHH+H0BdbgsfXTzUYcaBT27B/mqAyPPG/ersW7x1nNptu1X4ipx2ff6hJlRA== X-Received: by 2002:a24:2c50:: with SMTP id i77mr5490213iti.131.1543602956352; Fri, 30 Nov 2018 10:35:56 -0800 (PST) Received: from mail-it1-f170.google.com (mail-it1-f170.google.com. [209.85.166.170]) by smtp.gmail.com with ESMTPSA id n16sm2247047iom.58.2018.11.30.10.35.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 10:35:56 -0800 (PST) Received: by mail-it1-f170.google.com with SMTP id o19so10528899itg.5; Fri, 30 Nov 2018 10:35:56 -0800 (PST) X-Received: by 2002:a02:a791:: with SMTP id e17mr802316jaj.104.1543602955699; Fri, 30 Nov 2018 10:35:55 -0800 (PST) MIME-Version: 1.0 References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> In-Reply-To: <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 30 Nov 2018 10:35:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: arybchik@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 8AA4F70080 X-Spamd-Result: default: False [-5.61 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-2.62)[ip: (-8.28), ipnet: 209.85.128.0/17(-3.42), asn: 15169(-1.34), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; RCVD_IN_DNSWL_NONE(0.00)[175.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 18:35:58 -0000 On Fri, Nov 30, 2018 at 10:16 AM Andrew Rybchenko wr= ote: > Basically I'm ready to follow any sensible policy. Hi Andrew, I think general policy is to not include a "Differential Revision:" line in a commit message unless there was actual review there. (That's separate from the issue of creating a bunch of reviews that no one will ever look at =E2=80=94 which is a different kind of spam.) > Yes in this particular case these 2 hundreds of patches is the result of = 2 years of development. Why are they being committed now, hundreds at a time, instead of as they were developed over the last two years? Thanks, Conrad From owner-svn-src-head@freebsd.org Fri Nov 30 18:36:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63AD0114C482; Fri, 30 Nov 2018 18:36:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8DF9701BF; Fri, 30 Nov 2018 18:36:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 667CA10AFCD; Fri, 30 Nov 2018 13:36:29 -0500 (EST) Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: Andrew Rybchenko References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> Cc: gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, philip@FreeBSD.org From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 30 Nov 2018 10:36:27 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 30 Nov 2018 13:36:30 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: E8DF9701BF X-Spamd-Result: default: False [0.70 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.16)[-0.157,0]; NEURAL_SPAM_LONG(0.15)[0.155,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_SPAM_SHORT(0.70)[0.701,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 18:36:31 -0000 On 11/30/18 10:15 AM, Andrew Rybchenko wrote: > On 30.11.2018 20:30, John Baldwin wrote: >> On 11/29/18 11:11 PM, Andrew Rybchenko wrote: >>> Author: arybchik >>> Date: Fri Nov 30 07:11:05 2018 >>> New Revision: 341327 >>> URL: https://svnweb.freebsd.org/changeset/base/341327 >>> >>> Log: >>> sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped >>> >>> Early processing of a packet on transmit may change last seen >>> VLAN TCI in the queue context. If such a packet is eventually >>> dropped, last seen VLAN TCI must be set to its previous value. >>> >>> Submitted by: Ivan Malov >>> Sponsored by: Solarflare Communications, Inc. >>> MFC after: 1 week >>> Differential Revision: https://reviews.freebsd.org/D18288 >> Just as a general comment. There's no point in creating a review in >> phabricator if you aren't going to get any actual review feedback via >> the tool. That just adds noise. (I've spotchecked a few of the recent >> sfxge commits and they all seem to create a review that then gets committed >> a few hours later without any feedback, etc.) > > All these changesets is the result of development in Solarflare. > All these changesets were reviewed internally and in fact many > have later fixes which are simply squashed in. > > We have discussed it with George (gnn@) some time ago and > he asked to submit reviews anyway and wait at least a day or > two before commit. Yes in this particular case these 2 hundreds > of patches is the result of 2 years of development. So, I'd > waited some time and started to commit in blocks. > > This time I've not included np@ and bz@ in reviewers since I've > not got reviewed before and it would be too much spam. > > We have discussed it with Philip (philip@) shortly. As I understand > he has no time now to review it. > > Basically I'm ready to follow any sensible policy. I don't think it > makes to wait forever. If there are any volunteers I'll be happy > to include more people in reviewers. I don't think you have to wait forever, and if the changes were reviewed internally that counts for review, I just don't want to add noise and clutter to phabricator and commit logs. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Fri Nov 30 18:54:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CD95114CE34; Fri, 30 Nov 2018 18:54:26 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D88157107A; Fri, 30 Nov 2018 18:54:25 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id CD9A33C475F; Fri, 30 Nov 2018 18:54:18 +0000 (UTC) Date: Fri, 30 Nov 2018 18:54:18 +0000 From: Brooks Davis To: Andrew Rybchenko Cc: John Baldwin , gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, philip@FreeBSD.org Subject: Re: svn commit: r341327 - head/sys/dev/sfxge Message-ID: <20181130185418.GA4183@spindle.one-eyed-alien.net> References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: D88157107A X-Spamd-Result: default: False [-4.04 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; IP_SCORE(-3.64)[ip: (-9.48), ipnet: 199.48.128.0/22(-4.74), asn: 36236(-3.92), country: US(-0.09)]; MX_GOOD(-0.01)[spindle.one-eyed-alien.net]; MX_MISSING(3.50)[requested record is not found]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 18:54:27 -0000 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 30, 2018 at 09:15:39PM +0300, Andrew Rybchenko wrote: > On 30.11.2018 20:30, John Baldwin wrote: > > On 11/29/18 11:11 PM, Andrew Rybchenko wrote: > >> Author: arybchik > >> Date: Fri Nov 30 07:11:05 2018 > >> New Revision: 341327 > >> URL: https://svnweb.freebsd.org/changeset/base/341327 > >> > >> Log: > >> sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped > >> =20 > >> Early processing of a packet on transmit may change last seen > >> VLAN TCI in the queue context. If such a packet is eventually > >> dropped, last seen VLAN TCI must be set to its previous value. > >> =20 > >> Submitted by: Ivan Malov > >> Sponsored by: Solarflare Communications, Inc. > >> MFC after: 1 week > >> Differential Revision: https://reviews.freebsd.org/D18288 > > Just as a general comment. There's no point in creating a review in > > phabricator if you aren't going to get any actual review feedback via > > the tool. That just adds noise. (I've spotchecked a few of the recent > > sfxge commits and they all seem to create a review that then gets commi= tted > > a few hours later without any feedback, etc.) >=20 > All these changesets is the result of development in Solarflare. > All these changesets were reviewed internally and in fact many > have later fixes which are simply squashed in. >=20 > We have discussed it with George (gnn@) some time ago and > he asked to submit reviews anyway and wait at least a day or > two before commit. Yes in this particular case these 2 hundreds > of patches is the result of 2 years of development. So, I'd > waited some time and started to commit in blocks. >=20 > This time I've not included np@ and bz@ in reviewers since I've > not got reviewed before and it would be too much spam. >=20 > We have discussed it with Philip (philip@) shortly. As I understand > he has no time now to review it. >=20 > Basically I'm ready to follow any sensible policy. I don't think it > makes to wait forever. If there are any volunteers I'll be happy > to include more people in reviewers. You can't just throw things in phab and hope someone reviews them. If you want then to be reviewed you need to work to have the reviewed. That's true regardless of technology. In this case, it seems pretty clear they have been reviewed within Solarflare so I don't think they really need to be reviewed within FreeBSD processes before they land so long as they are well tested and don't break the build. -- Brooks --ReaqsoxgOBHFXBhH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcAYdaAAoJEKzQXbSebgfAo/oIAJTg2TXyWH3pCJnvNtm2jAbS t5YRRPbhhU+Z/1XGbYcQBQ2isTGIiuj4NW00iQRP3JrmOyCX4P+1k8g5CyW3C22G IxoeenQflHwimuuOsp+0Yi35kSCjzEv73i6+pq/e5bZhPulzTssSYxEdClWaNIOC 95pDW/ORiMsElQ0p1cI4oM+nN5mx8ndRk2M001+QEO5Nawm+6PRXRX1Yvww+hiRC uQNCywWu21/Y1gzZxOELsMGNTiwu5Yn4W3gJP74JK2Upc3SFAkFiTXG/JuDS8HUo jjIed8j6aYcRoI8iA/E8MVznsXoLyauSaKTBKq145Ivz+Nn3byNHJ8Ma3QQut3c= =wsDy -----END PGP SIGNATURE----- --ReaqsoxgOBHFXBhH-- From owner-svn-src-head@freebsd.org Fri Nov 30 19:01:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 982BA114CF73; Fri, 30 Nov 2018 19:01:11 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4061971434; Fri, 30 Nov 2018 19:01:11 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [IPv6:2a00:dd80:3c::62e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id EBEF31721D; Fri, 30 Nov 2018 19:01:10 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [IPv6:2a01:4f9:2a:1715::1:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 4363dK1kYGz4fYY; Fri, 30 Nov 2018 19:01:09 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, authenticated sender philip) id 4363dG13dzz1mnL; Fri, 30 Nov 2018 19:01:06 +0000 (UTC) From: "Philip Paeps" To: "John Baldwin" Cc: "Andrew Rybchenko" , gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341327 - head/sys/dev/sfxge Date: Fri, 30 Nov 2018 20:01:01 +0100 X-Clacks-Overhead: GNU Terry Pratchett X-Mailer: MailMate (1.12.2r5571) Message-ID: <0A8EBFBB-37DA-439F-A8D3-099A13128AD9@freebsd.org> In-Reply-To: References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; markup=markdown X-Rspamd-Queue-Id: 4061971434 X-Spamd-Result: default: False [0.16 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.25)[-0.251,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.460,0]; NEURAL_HAM_LONG(-0.05)[-0.049,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:01:11 -0000 On 2018-11-30 19:36:27 (+0100), John Baldwin wrote: > On 11/30/18 10:15 AM, Andrew Rybchenko wrote: >> On 30.11.2018 20:30, John Baldwin wrote: >>> On 11/29/18 11:11 PM, Andrew Rybchenko wrote: >>>> Author: arybchik >>>> Date: Fri Nov 30 07:11:05 2018 >>>> New Revision: 341327 >>>> URL: https://svnweb.freebsd.org/changeset/base/341327 >>>> >>>> Log: >>>> sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped >>>> >>>> Early processing of a packet on transmit may change last seen >>>> VLAN TCI in the queue context. If such a packet is eventually >>>> dropped, last seen VLAN TCI must be set to its previous value. >>>> >>>> Submitted by: Ivan Malov >>>> Sponsored by: Solarflare Communications, Inc. >>>> MFC after: 1 week >>>> Differential Revision: https://reviews.freebsd.org/D18288 >>> >>> Just as a general comment. There's no point in creating a review in >>> phabricator if you aren't going to get any actual review feedback >>> via the tool. That just adds noise. (I've spotchecked a few of the >>> recent sfxge commits and they all seem to create a review that then >>> gets committed a few hours later without any feedback, etc.) >> >> All these changesets is the result of development in Solarflare. All >> these changesets were reviewed internally and in fact many have later >> fixes which are simply squashed in. >> >> We have discussed it with George (gnn@) some time ago and he asked to >> submit reviews anyway and wait at least a day or two before commit. >> Yes in this particular case these 2 hundreds of patches is the result >> of 2 years of development. So, I'd waited some time and started to >> commit in blocks. >> >> This time I've not included np@ and bz@ in reviewers since I've not >> got reviewed before and it would be too much spam. >> >> We have discussed it with Philip (philip@) shortly. As I understand >> he has no time now to review it. >> >> Basically I'm ready to follow any sensible policy. I don't think it >> makes to wait forever. If there are any volunteers I'll be happy to >> include more people in reviewers. > > I don't think you have to wait forever, and if the changes were > reviewed internally that counts for review, I just don't want to add > noise and clutter to phabricator and commit logs. I think it makes sense to have Phabricator reviews for the FreeBSD-specific parts of sfxge(4). The internal review at Solarflare is definitely good enough to commit without waiting for review -- certainly on the parts of the driver that are generated from the common source -- but there is some value to having the FreeBSD-specific bits sit in Phabricator for a few days. The storm of commits in the last week is exceptional because it represents two years of changes. With hindsight, just bulk-committing those to Subversion would have been a better idea. In the future though, and when in the steady state of commits trickling in rather than flooding in, I still appreciate the reviews in Phabricator. Particularly for the FreeBSD-specific parts of the driver. Philip -- Philip Paeps Senior Reality Engineer Ministry of Information From owner-svn-src-head@freebsd.org Fri Nov 30 19:12:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 349C7114D3AD; Fri, 30 Nov 2018 19:12:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B17AF7189A; Fri, 30 Nov 2018 19:12:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id F1F7010AFD2; Fri, 30 Nov 2018 14:12:20 -0500 (EST) Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: Philip Paeps References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> <0A8EBFBB-37DA-439F-A8D3-099A13128AD9@freebsd.org> Cc: Andrew Rybchenko , gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg80eSm9obiBCYWxk d2luIDxqb2huQGJhbGR3aW4uY3g+wmMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTbOwU0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 30 Nov 2018 11:12:20 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <0A8EBFBB-37DA-439F-A8D3-099A13128AD9@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 30 Nov 2018 14:12:21 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: B17AF7189A X-Spamd-Result: default: False [0.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.16)[-0.157,0]; NEURAL_SPAM_LONG(0.15)[0.155,0]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; NEURAL_SPAM_SHORT(0.54)[0.543,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:12:23 -0000 On 11/30/18 11:01 AM, Philip Paeps wrote: > On 2018-11-30 19:36:27 (+0100), John Baldwin wrote: >> On 11/30/18 10:15 AM, Andrew Rybchenko wrote: >>> On 30.11.2018 20:30, John Baldwin wrote: >>>> On 11/29/18 11:11 PM, Andrew Rybchenko wrote: >>>>> Author: arybchik >>>>> Date: Fri Nov 30 07:11:05 2018 >>>>> New Revision: 341327 >>>>> URL: https://svnweb.freebsd.org/changeset/base/341327 >>>>> >>>>> Log: >>>>> sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped >>>>> >>>>> Early processing of a packet on transmit may change last seen >>>>> VLAN TCI in the queue context. If such a packet is eventually >>>>> dropped, last seen VLAN TCI must be set to its previous value. >>>>> >>>>> Submitted by: Ivan Malov >>>>> Sponsored by: Solarflare Communications, Inc. >>>>> MFC after: 1 week >>>>> Differential Revision: https://reviews.freebsd.org/D18288 >>>> >>>> Just as a general comment. There's no point in creating a review in >>>> phabricator if you aren't going to get any actual review feedback >>>> via the tool. That just adds noise. (I've spotchecked a few of the >>>> recent sfxge commits and they all seem to create a review that then >>>> gets committed a few hours later without any feedback, etc.) >>> >>> All these changesets is the result of development in Solarflare. All >>> these changesets were reviewed internally and in fact many have later >>> fixes which are simply squashed in. >>> >>> We have discussed it with George (gnn@) some time ago and he asked to >>> submit reviews anyway and wait at least a day or two before commit. >>> Yes in this particular case these 2 hundreds of patches is the result >>> of 2 years of development. So, I'd waited some time and started to >>> commit in blocks. >>> >>> This time I've not included np@ and bz@ in reviewers since I've not >>> got reviewed before and it would be too much spam. >>> >>> We have discussed it with Philip (philip@) shortly. As I understand >>> he has no time now to review it. >>> >>> Basically I'm ready to follow any sensible policy. I don't think it >>> makes to wait forever. If there are any volunteers I'll be happy to >>> include more people in reviewers. >> >> I don't think you have to wait forever, and if the changes were >> reviewed internally that counts for review, I just don't want to add >> noise and clutter to phabricator and commit logs. > > I think it makes sense to have Phabricator reviews for the > FreeBSD-specific parts of sfxge(4). > > The internal review at Solarflare is definitely good enough to commit > without waiting for review -- certainly on the parts of the driver that > are generated from the common source -- but there is some value to > having the FreeBSD-specific bits sit in Phabricator for a few days. > > The storm of commits in the last week is exceptional because it > represents two years of changes. With hindsight, just bulk-committing > those to Subversion would have been a better idea. > > In the future though, and when in the steady state of commits trickling > in rather than flooding in, I still appreciate the reviews in > Phabricator. Particularly for the FreeBSD-specific parts of the driver. That's fine as long as you are going to do actual reviews. The only point I raised was about putting things in phab but not really using phab. Let's use it when it makes sense, but let's avoid things that look like dummy reviews to satisfy a checkbox. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Fri Nov 30 19:27:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56C04114DB13; Fri, 30 Nov 2018 19:27:15 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB279720BE; Fri, 30 Nov 2018 19:27:14 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5D5E50FB; Fri, 30 Nov 2018 19:27:14 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUJREuY073552; Fri, 30 Nov 2018 19:27:14 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUJREoJ073551; Fri, 30 Nov 2018 19:27:14 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811301927.wAUJREoJ073551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 30 Nov 2018 19:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341347 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 341347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB279720BE X-Spamd-Result: default: False [0.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.45)[0.452,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:27:15 -0000 Author: oshogbo Date: Fri Nov 30 19:27:14 2018 New Revision: 341347 URL: https://svnweb.freebsd.org/changeset/base/341347 Log: libcasper: do not fail if Capsicum is not avilable Casper service can be also used on the kernels without Capsicum support. Reported by: sbruno Tested by: sbruno Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Fri Nov 30 18:02:59 2018 (r341346) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Fri Nov 30 19:27:14 2018 (r341347) @@ -363,7 +363,7 @@ open_file(const char *name) return (-1); if (caprightsp != NULL) { - if (cap_rights_limit(fd, caprightsp) < 0) { + if (cap_rights_limit(fd, caprightsp) < 0 && errno != ENOSYS) { serrno = errno; close(fd); errno = serrno; From owner-svn-src-head@freebsd.org Fri Nov 30 19:40:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56396114DF0D; Fri, 30 Nov 2018 19:40:17 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F15AC7288C; Fri, 30 Nov 2018 19:40:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B840352B0; Fri, 30 Nov 2018 19:40:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUJeGuX079046; Fri, 30 Nov 2018 19:40:16 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUJeGJl079044; Fri, 30 Nov 2018 19:40:16 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811301940.wAUJeGJl079044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 30 Nov 2018 19:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341348 - in head/usr.sbin: ctld iscsid X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/usr.sbin: ctld iscsid X-SVN-Commit-Revision: 341348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F15AC7288C X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_SHORT(0.45)[0.455,0]; NEURAL_SPAM_MEDIUM(0.15)[0.151,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:40:17 -0000 Author: oshogbo Date: Fri Nov 30 19:40:16 2018 New Revision: 341348 URL: https://svnweb.freebsd.org/changeset/base/341348 Log: iscsi: simplify the capsicumization Approved by: trasz Differential Revision: https://reviews.freebsd.org/D17962 Modified: head/usr.sbin/ctld/kernel.c head/usr.sbin/iscsid/iscsid.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Fri Nov 30 19:27:14 2018 (r341347) +++ head/usr.sbin/ctld/kernel.c Fri Nov 30 19:40:16 2018 (r341348) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1313,22 +1314,17 @@ kernel_receive(struct pdu *pdu) void kernel_capsicate(void) { - int error; cap_rights_t rights; const unsigned long cmds[] = { CTL_ISCSI }; cap_rights_init(&rights, CAP_IOCTL); - error = cap_rights_limit(ctl_fd, &rights); - if (error != 0 && errno != ENOSYS) + if (caph_rights_limit(ctl_fd, &rights) < 0) log_err(1, "cap_rights_limit"); - error = cap_ioctls_limit(ctl_fd, cmds, nitems(cmds)); - - if (error != 0 && errno != ENOSYS) + if (caph_ioctls_limit(ctl_fd, cmds, nitems(cmds)) < 0) log_err(1, "cap_ioctls_limit"); - error = cap_enter(); - if (error != 0 && errno != ENOSYS) + if (caph_enter() < 0) log_err(1, "cap_enter"); if (cap_sandboxed()) Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Fri Nov 30 19:27:14 2018 (r341347) +++ head/usr.sbin/iscsid/iscsid.c Fri Nov 30 19:40:16 2018 (r341348) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -349,7 +350,6 @@ fail(const struct connection *conn, const char *reason static void capsicate(struct connection *conn) { - int error; cap_rights_t rights; #ifdef ICL_KERNEL_PROXY const unsigned long cmds[] = { ISCSIDCONNECT, ISCSIDSEND, ISCSIDRECEIVE, @@ -360,17 +360,13 @@ capsicate(struct connection *conn) #endif cap_rights_init(&rights, CAP_IOCTL); - error = cap_rights_limit(conn->conn_iscsi_fd, &rights); - if (error != 0 && errno != ENOSYS) + if (caph_rights_limit(conn->conn_iscsi_fd, &rights) < 0) log_err(1, "cap_rights_limit"); - error = cap_ioctls_limit(conn->conn_iscsi_fd, cmds, nitems(cmds)); - - if (error != 0 && errno != ENOSYS) + if (caph_ioctls_limit(conn->conn_iscsi_fd, cmds, nitems(cmds)) < 0) log_err(1, "cap_ioctls_limit"); - error = cap_enter(); - if (error != 0 && errno != ENOSYS) + if (caph_enter() != 0) log_err(1, "cap_enter"); if (cap_sandboxed()) From owner-svn-src-head@freebsd.org Fri Nov 30 19:53:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2047E114E414; Fri, 30 Nov 2018 19:53:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [84.52.114.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C3D77311A; Fri, 30 Nov 2018 19:53:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from [192.168.1.192] (unknown [188.242.181.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 6C61E7F5DF; Fri, 30 Nov 2018 22:53:20 +0300 (MSK) Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Fri, 30 Nov 2018 22:53:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 8C3D77311A X-Spamd-Result: default: False [0.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.15)[-0.153,0]; NEURAL_SPAM_SHORT(0.56)[0.565,0]; NEURAL_SPAM_LONG(0.17)[0.173,0]; ASN(0.00)[asn:25408, ipnet:84.52.64.0/18, country:RU] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:53:23 -0000 Hi Conrad, On 30.11.2018 21:35, Conrad Meyer wrote: > On Fri, Nov 30, 2018 at 10:16 AM Andrew Rybchenko wrote: >> Basically I'm ready to follow any sensible policy. > Hi Andrew, > > I think general policy is to not include a "Differential Revision:" > line in a commit message unless there was actual review there. I've not heard about it and have not found it anywhere written. At least it is convenient to specify, since it closes the review request automatically and keeps the track. So, I think it is better to specify, but I have no strong opinion. > (That's separate from the issue of creating a bunch of reviews that no > one will ever look at — which is a different kind of spam.) > >> Yes in this particular case these 2 hundreds of patches is the result of 2 years of development. > Why are they being committed now, hundreds at a time, instead of as > they were developed over the last two years? It is simple - had no time and had different priorities from SF. Also there are some benefits in delay - patches are more clear now since many fixes are squashed in. In any case I'll try to avoid so huge delays in the future. Andrew. From owner-svn-src-head@freebsd.org Fri Nov 30 19:58:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C34C114E4E1; Fri, 30 Nov 2018 19:58:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [84.52.114.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B9CA732EF; Fri, 30 Nov 2018 19:58:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from [192.168.1.192] (unknown [188.242.181.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id E0F0E7F4F3; Fri, 30 Nov 2018 22:58:00 +0300 (MSK) Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: Brooks Davis Cc: John Baldwin , gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, philip@FreeBSD.org References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> <20181130185418.GA4183@spindle.one-eyed-alien.net> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Fri, 30 Nov 2018 22:57:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181130185418.GA4183@spindle.one-eyed-alien.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 1B9CA732EF X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.22)[-0.219,0]; NEURAL_SPAM_SHORT(0.53)[0.533,0]; NEURAL_SPAM_LONG(0.11)[0.113,0]; ASN(0.00)[asn:25408, ipnet:84.52.64.0/18, country:RU] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 19:58:02 -0000 On 30.11.2018 21:54, Brooks Davis wrote: > On Fri, Nov 30, 2018 at 09:15:39PM +0300, Andrew Rybchenko wrote: >> On 30.11.2018 20:30, John Baldwin wrote: >>> On 11/29/18 11:11 PM, Andrew Rybchenko wrote: >>>> Author: arybchik >>>> Date: Fri Nov 30 07:11:05 2018 >>>> New Revision: 341327 >>>> URL: https://svnweb.freebsd.org/changeset/base/341327 >>>> >>>> Log: >>>> sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped >>>> >>>> Early processing of a packet on transmit may change last seen >>>> VLAN TCI in the queue context. If such a packet is eventually >>>> dropped, last seen VLAN TCI must be set to its previous value. >>>> >>>> Submitted by: Ivan Malov >>>> Sponsored by: Solarflare Communications, Inc. >>>> MFC after: 1 week >>>> Differential Revision: https://reviews.freebsd.org/D18288 >>> Just as a general comment. There's no point in creating a review in >>> phabricator if you aren't going to get any actual review feedback via >>> the tool. That just adds noise. (I've spotchecked a few of the recent >>> sfxge commits and they all seem to create a review that then gets committed >>> a few hours later without any feedback, etc.) >> All these changesets is the result of development in Solarflare. >> All these changesets were reviewed internally and in fact many >> have later fixes which are simply squashed in. >> >> We have discussed it with George (gnn@) some time ago and >> he asked to submit reviews anyway and wait at least a day or >> two before commit. Yes in this particular case these 2 hundreds >> of patches is the result of 2 years of development. So, I'd >> waited some time and started to commit in blocks. >> >> This time I've not included np@ and bz@ in reviewers since I've >> not got reviewed before and it would be too much spam. >> >> We have discussed it with Philip (philip@) shortly. As I understand >> he has no time now to review it. >> >> Basically I'm ready to follow any sensible policy. I don't think it >> makes to wait forever. If there are any volunteers I'll be happy >> to include more people in reviewers. > You can't just throw things in phab and hope someone reviews them. If > you want then to be reviewed you need to work to have the reviewed. > That's true regardless of technology. > > In this case, it seems pretty clear they have been reviewed within > Solarflare so I don't think they really need to be reviewed within > FreeBSD processes before they land so long as they are well tested and > don't break the build. It makes sense. As I understand the argument from George was just give it a chance to be reviewed within FreeBSD process. Andrew. From owner-svn-src-head@freebsd.org Fri Nov 30 20:10:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6125F114F230; Fri, 30 Nov 2018 20:10:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [84.52.114.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D445B75A39; Fri, 30 Nov 2018 20:10:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from [192.168.1.192] (unknown [188.242.181.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 4AE347FFCF; Fri, 30 Nov 2018 23:10:40 +0300 (MSK) Subject: Re: svn commit: r341327 - head/sys/dev/sfxge To: Philip Paeps , John Baldwin Cc: gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811300711.wAU7B5R6084752@repo.freebsd.org> <7545b110-4930-d49f-f99f-7ec17db7e7a7@oktetlabs.ru> <0A8EBFBB-37DA-439F-A8D3-099A13128AD9@freebsd.org> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Fri, 30 Nov 2018 23:10:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <0A8EBFBB-37DA-439F-A8D3-099A13128AD9@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: D445B75A39 X-Spamd-Result: default: False [0.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.16)[-0.157,0]; NEURAL_SPAM_LONG(0.15)[0.155,0]; ASN(0.00)[asn:25408, ipnet:84.52.64.0/18, country:RU]; NEURAL_SPAM_SHORT(0.82)[0.818,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 20:10:42 -0000 On 30.11.2018 22:01, Philip Paeps wrote: > On 2018-11-30 19:36:27 (+0100), John Baldwin wrote: >> On 11/30/18 10:15 AM, Andrew Rybchenko wrote: >>> On 30.11.2018 20:30, John Baldwin wrote: >>>> On 11/29/18 11:11 PM, Andrew Rybchenko wrote: >>>>> Author: arybchik >>>>> Date: Fri Nov 30 07:11:05 2018 >>>>> New Revision: 341327 >>>>> URL: https://svnweb.freebsd.org/changeset/base/341327 >>>>> >>>>> Log: >>>>>    sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped >>>>> >>>>>    Early processing of a packet on transmit may change last seen >>>>>    VLAN TCI in the queue context. If such a packet is eventually >>>>>    dropped, last seen VLAN TCI must be set to its previous value. >>>>> >>>>>    Submitted by:   Ivan Malov >>>>>    Sponsored by:   Solarflare Communications, Inc. >>>>>    MFC after:      1 week >>>>>    Differential Revision: https://reviews.freebsd.org/D18288 >>>> >>>> Just as a general comment.  There's no point in creating a review >>>> in phabricator if you aren't going to get any actual review >>>> feedback via the tool.  That just adds noise.  (I've spotchecked a >>>> few of the recent sfxge commits and they all seem to create a >>>> review that then gets committed a few hours later without any >>>> feedback, etc.) >>> >>> All these changesets is the result of development in Solarflare.  >>> All these changesets were reviewed internally and in fact many have >>> later fixes which are simply squashed in. >>> >>> We have discussed it with George (gnn@) some time ago and he asked >>> to submit reviews anyway and wait at least a day or two before >>> commit. Yes in this particular case these 2 hundreds of patches is >>> the result of 2 years of development. So, I'd waited some time and >>> started to commit in blocks. >>> >>> This time I've not included np@ and bz@ in reviewers since I've not >>> got reviewed before and it would be too much spam. >>> >>> We have discussed it with Philip (philip@) shortly. As I understand >>> he has no time now to review it. >>> >>> Basically I'm ready to follow any sensible policy. I don't think it >>> makes to wait forever. If there are any volunteers I'll be happy to >>> include more people in reviewers. >> >> I don't think you have to wait forever, and if the changes were >> reviewed internally that counts for review, I just don't want to add >> noise and clutter to phabricator and commit logs. > > I think it makes sense to have Phabricator reviews for the > FreeBSD-specific parts of sfxge(4). Yes, I think it would be very-very useful. > The internal review at Solarflare is definitely good enough to commit > without waiting for review -- certainly on the parts of the driver > that are generated from the common source -- but there is some value > to having the FreeBSD-specific bits sit in Phabricator for a few days. Makes sense. Two FreeBSD-specific are waiting right now :) > The storm of commits in the last week is exceptional because it > represents two years of changes.  With hindsight, just bulk-committing > those to Subversion would have been a better idea. I think it is still useful for the project to have more granular changes. At least it easier to understand in the future motivation of these changes etc. Not a strong opinion as well, but I'd prefer to keep these changes as is (except squashing fixes as I do to avoid known breakages in the middle). > In the future though, and when in the steady state of commits > trickling in rather than flooding in, I still appreciate the reviews > in Phabricator.  Particularly for the FreeBSD-specific parts of the > driver. I can't promise, but I'll try to avoid so huge delays in the future. I'm trying to submit when I'm more confident that changes are stable and probability of problems is less. Andrew. From owner-svn-src-head@freebsd.org Fri Nov 30 20:58:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F5A411503CD; Fri, 30 Nov 2018 20:58:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A48DF775C2; Fri, 30 Nov 2018 20:58:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80E695F8A; Fri, 30 Nov 2018 20:58:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUKw9d7025565; Fri, 30 Nov 2018 20:58:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUKw9UE025564; Fri, 30 Nov 2018 20:58:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811302058.wAUKw9UE025564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Nov 2018 20:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341351 - in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 341351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A48DF775C2 X-Spamd-Result: default: False [1.02 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.534,0]; NEURAL_SPAM_MEDIUM(0.15)[0.151,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 20:58:10 -0000 Author: mjg Date: Fri Nov 30 20:58:08 2018 New Revision: 341351 URL: https://svnweb.freebsd.org/changeset/base/341351 Log: amd64: handle small memmove buffers with overlapping stores Handling sizes of > 32 backwards will be updated later. Reviewed by: kib (kernel part) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18387 Modified: head/lib/libc/amd64/string/memmove.S head/sys/amd64/amd64/support.S Modified: head/lib/libc/amd64/string/memmove.S ============================================================================== --- head/lib/libc/amd64/string/memmove.S Fri Nov 30 19:59:28 2018 (r341350) +++ head/lib/libc/amd64/string/memmove.S Fri Nov 30 20:58:08 2018 (r341351) @@ -42,11 +42,19 @@ __FBSDID("$FreeBSD$"); * rsi - source * rdx - count * - * The macro possibly clobbers the above and: rcx, r8. - * It does not clobber rax, r10 nor r11. + * The macro possibly clobbers the above and: rcx, r8, r9, 10 + * It does not clobber rax nor r11. */ .macro MEMMOVE erms overlap begin end \begin + + /* + * For sizes 0..32 all data is read before it is written, so there + * is no correctness issue with direction of copying. + */ + cmpq $32,%rcx + jbe 101632f + .if \overlap == 1 movq %rdi,%r8 subq %rsi,%r8 @@ -54,13 +62,10 @@ __FBSDID("$FreeBSD$"); jb 2f .endif - cmpq $32,%rcx - jb 1016f - cmpq $256,%rcx ja 1256f -1032: +103200: movq (%rsi),%rdx movq %rdx,(%rdi) movq 8(%rsi),%rdx @@ -73,56 +78,62 @@ __FBSDID("$FreeBSD$"); leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b + jae 103200b cmpb $0,%cl - jne 1016f + jne 101632f \end ret ALIGN_TEXT -1016: +101632: cmpb $16,%cl - jl 1008f + jl 100816f movq (%rsi),%rdx + movq 8(%rsi),%r8 + movq -16(%rsi,%rcx),%r9 + movq -8(%rsi,%rcx),%r10 movq %rdx,(%rdi) - movq 8(%rsi),%rdx - movq %rdx,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rsi),%rsi - leaq 16(%rdi),%rdi -1008: + movq %r8,8(%rdi) + movq %r9,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f + jl 100408f movq (%rsi),%rdx + movq -8(%rsi,%rcx),%r8 movq %rdx,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rsi),%rsi - leaq 8(%rdi),%rdi -1004: + movq %r8,-8(%rdi,%rcx,) + \end + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f + jl 100204f movl (%rsi),%edx + movl -4(%rsi,%rcx),%r8d movl %edx,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rsi),%rsi - leaq 4(%rdi),%rdi -1002: + movl %r8d,-4(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw (%rsi),%dx + jl 100001f + movzwl (%rsi),%edx + movzwl -2(%rsi,%rcx),%r8d movw %dx,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rsi),%rsi - leaq 2(%rdi),%rdi -1001: + movw %r8w,-2(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100001: cmpb $1,%cl - jl 1000f + jl 100000f movb (%rsi),%dl movb %dl,(%rdi) -1000: +100000: \end ret @@ -136,8 +147,8 @@ __FBSDID("$FreeBSD$"); rep movsq movq %rdx,%rcx - andb $7,%cl /* any bytes left? */ - jne 1004b + andl $7,%ecx /* any bytes left? */ + jne 100408b .endif \end ret @@ -246,6 +257,7 @@ __FBSDID("$FreeBSD$"); ret .endif .endm + .macro MEMMOVE_BEGIN movq %rdi,%rax Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Fri Nov 30 19:59:28 2018 (r341350) +++ head/sys/amd64/amd64/support.S Fri Nov 30 20:58:08 2018 (r341351) @@ -205,11 +205,19 @@ END(memcmp) * rsi - source * rdx - count * - * The macro possibly clobbers the above and: rcx, r8. - * It does not clobber rax, r10 nor r11. + * The macro possibly clobbers the above and: rcx, r8, r9, 10 + * It does not clobber rax nor r11. */ .macro MEMMOVE erms overlap begin end \begin + + /* + * For sizes 0..32 all data is read before it is written, so there + * is no correctness issue with direction of copying. + */ + cmpq $32,%rcx + jbe 101632f + .if \overlap == 1 movq %rdi,%r8 subq %rsi,%r8 @@ -217,13 +225,10 @@ END(memcmp) jb 2f .endif - cmpq $32,%rcx - jb 1016f - cmpq $256,%rcx ja 1256f -1032: +103200: movq (%rsi),%rdx movq %rdx,(%rdi) movq 8(%rsi),%rdx @@ -236,56 +241,62 @@ END(memcmp) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b + jae 103200b cmpb $0,%cl - jne 1016f + jne 101632f \end ret ALIGN_TEXT -1016: +101632: cmpb $16,%cl - jl 1008f + jl 100816f movq (%rsi),%rdx + movq 8(%rsi),%r8 + movq -16(%rsi,%rcx),%r9 + movq -8(%rsi,%rcx),%r10 movq %rdx,(%rdi) - movq 8(%rsi),%rdx - movq %rdx,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rsi),%rsi - leaq 16(%rdi),%rdi -1008: + movq %r8,8(%rdi) + movq %r9,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f + jl 100408f movq (%rsi),%rdx + movq -8(%rsi,%rcx),%r8 movq %rdx,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rsi),%rsi - leaq 8(%rdi),%rdi -1004: + movq %r8,-8(%rdi,%rcx,) + \end + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f + jl 100204f movl (%rsi),%edx + movl -4(%rsi,%rcx),%r8d movl %edx,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rsi),%rsi - leaq 4(%rdi),%rdi -1002: + movl %r8d,-4(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw (%rsi),%dx + jl 100001f + movzwl (%rsi),%edx + movzwl -2(%rsi,%rcx),%r8d movw %dx,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rsi),%rsi - leaq 2(%rdi),%rdi -1001: + movw %r8w,-2(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100001: cmpb $1,%cl - jl 1000f + jl 100000f movb (%rsi),%dl movb %dl,(%rdi) -1000: +100000: \end ret @@ -299,8 +310,8 @@ END(memcmp) rep movsq movq %rdx,%rcx - andb $7,%cl /* any bytes left? */ - jne 1004b + andl $7,%ecx /* any bytes left? */ + jne 100408b .endif \end ret From owner-svn-src-head@freebsd.org Fri Nov 30 21:17:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A291115078E; Fri, 30 Nov 2018 21:17:20 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6D377E12; Fri, 30 Nov 2018 21:17:19 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAULH53m030175 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Nov 2018 22:17:06 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAULH4rO007112 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 1 Dec 2018 04:17:04 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn: head/usr.bin: . trim To: Warner Losh , Alexey Dokuchaev References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> <20181130125645.GA97463@FreeBSD.org> Cc: src-committers , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, Cy Schubert From: Eugene Grosbein Message-ID: <2ef3034e-6c4c-4fb7-3c7d-7cb41e4faac5@grosbein.net> Date: Sat, 1 Dec 2018 04:16:52 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 7C6D377E12 X-Spamd-Result: default: False [-4.56 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MX_INVALID(0.50)[cached]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-2.02)[ip: (-3.84), ipnet: 2a01:4f8::/29(-3.65), asn: 24940(-2.61), country: DE(-0.02)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 21:17:20 -0000 30.11.2018 21:23, Warner Losh wrote: > So I'm back to my point: we should just put it into dd and move on with our lives. It's really the right place for it. Why can't we have two implementations? Diversity is good thing. I can imagine erasing a partition with ZFS Cache or ZIL inside and "trim /dev/da0p2 /dev/da0p3" looks much better :-) From owner-svn-src-head@freebsd.org Fri Nov 30 21:29:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B0151150BE1 for ; Fri, 30 Nov 2018 21:29:23 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C5D97852A for ; Fri, 30 Nov 2018 21:29:22 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-ed1-x531.google.com with SMTP id f23so5997542edb.3 for ; Fri, 30 Nov 2018 13:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=UFI7iPehjKQEK7wmXoKsm8nxKbxRWfYtsieRVlU7gNs=; b=E/zgRw7R/iX/4qztVEQD/MQmjsPEGjPAaGxttvp0RQmCsRfeW2YS9yTH5vioFPzkyE SutJLPOKsepvelGuIqCT7xsM1gt4EqgxlIq3gLIAl2P4VJZTLxvOTJPj+mQxgpijg/9O bi9w2NhC4qFwyRwE0t1r9LgQ06iX42xJen1yiGx1U6KeZrqTsF78zUybvrbRUTT9D79D i/OI95soeZAT8Mhjj0tEuHJ5cjXbBOkH5F1Nsh5nin6/VcibBFPVxc3neXlwl085Pwo8 51mUJWkkUkKrUglYGo9ESpjVYgCvXAd6klwm5dTSQmv/O+p1iLQHg6WlAamD5gHBYTDU Ke3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=UFI7iPehjKQEK7wmXoKsm8nxKbxRWfYtsieRVlU7gNs=; b=H2eio6ECILgTqzB5AS+QnomomydkNbGdSg4nGG8nYhaEZLUuUzVd9S5RwKIUI+Swns ISunwm+KbWo4o2IRW4RCJz/UUD6vwGu+Dkb1Oj5pjDAKrOhJoGKP/aUTqo4q9yzL7Vqm LILhiimujiMqp8bjRVmri0ilnPYGjp65Bz+S+nD6MPV+0n5xtupbyqJDpjtn3w1oHrRn sP3vB5Pc59Zrh1o9XLLksr1W1Iq3HIorLmLLOPyE2U/WwnmnPctLHc1x7/SmOsn/ScgQ /PgD8Gm6lA3RhralyoSQlCYM5mq9Lu2EHZ1k8A5F9efGJTknmL/LUtg+Sp5t+CnllhEu keqA== X-Gm-Message-State: AA+aEWag0MCwgZ7Ph1QifevpHDeHv9OWPiH5BrIbOhCmRDXKAkUpwTlZ DEYbJQcCtRHaxTALwQea2/YDcg== X-Google-Smtp-Source: AFSGD/W6MJdb8iIcyp5X7ReS0Qj9oiwI4MeVpfu6YGqMTOUJI8BVsGBzjEaK99C74p7OffsHdVi/cw== X-Received: by 2002:a17:906:4e14:: with SMTP id z20-v6mr5582339eju.187.1543613361098; Fri, 30 Nov 2018 13:29:21 -0800 (PST) Received: from [10.44.128.75] ([161.12.40.153]) by smtp.gmail.com with ESMTPSA id x58sm1693633edm.10.2018.11.30.13.29.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 13:29:20 -0800 (PST) Subject: Re: svn: head/usr.bin: . trim To: Eugene Grosbein , Warner Losh , Alexey Dokuchaev Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Cy Schubert References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> <20181130125645.GA97463@FreeBSD.org> <2ef3034e-6c4c-4fb7-3c7d-7cb41e4faac5@grosbein.net> From: Steven Hartland Message-ID: <864fc11c-6554-f8de-5a58-dfee09a23803@multiplay.co.uk> Date: Fri, 30 Nov 2018 21:29:19 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <2ef3034e-6c4c-4fb7-3c7d-7cb41e4faac5@grosbein.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 7C5D97852A X-Spamd-Result: default: False [-5.60 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[multiplay.co.uk]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ASPMX.L.GOOGLE.COM]; RCVD_IN_DNSWL_NONE(0.00)[1.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.11)[ip: (-7.67), ipnet: 2a00:1450::/32(-1.48), asn: 15169(-1.34), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 21:29:23 -0000 ZFS already does that no need for a separate tool On 30/11/2018 21:16, Eugene Grosbein wrote: > 30.11.2018 21:23, Warner Losh wrote: > >> So I'm back to my point: we should just put it into dd and move on with our lives. It's really the right place for it. > Why can't we have two implementations? Diversity is good thing. > > I can imagine erasing a partition with ZFS Cache or ZIL inside and > "trim /dev/da0p2 /dev/da0p3" looks much better :-) > > From owner-svn-src-head@freebsd.org Fri Nov 30 21:57:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E2D6115183A; Fri, 30 Nov 2018 21:57:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34BDA79B4D; Fri, 30 Nov 2018 21:57:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 159B96942; Fri, 30 Nov 2018 21:57:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAULv2VF057186; Fri, 30 Nov 2018 21:57:02 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAULv2iH057184; Fri, 30 Nov 2018 21:57:02 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811302157.wAULv2iH057184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Fri, 30 Nov 2018 21:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341352 - head/usr.sbin/trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/trim X-SVN-Commit-Revision: 341352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 34BDA79B4D X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.02)[-0.021,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; NEURAL_SPAM_MEDIUM(0.15)[0.151,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 21:57:03 -0000 Author: eugen Date: Fri Nov 30 21:57:02 2018 New Revision: 341352 URL: https://svnweb.freebsd.org/changeset/base/341352 Log: trim(8): serveral style fixes Submitted by: imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18380 Modified: head/usr.sbin/trim/trim.8 head/usr.sbin/trim/trim.c Modified: head/usr.sbin/trim/trim.8 ============================================================================== --- head/usr.sbin/trim/trim.8 Fri Nov 30 20:58:08 2018 (r341351) +++ head/usr.sbin/trim/trim.8 Fri Nov 30 21:57:02 2018 (r341352) @@ -50,8 +50,8 @@ The .Nm utility erases specified region of the device. -It is only relevant for flash based storage devices that use wear-leveling -algorithms. +It is mostly relevant for storage that implement trim (like flash based, +or thinly provisioned storage). .Sy All erased data is lost. .Pp The following options are available: @@ -153,12 +153,13 @@ is special device file not supporting DIOCGMEDIASIZE .Xr ada 4 , .Xr da 4 , .Xr ioctl 2 , +.Xr nda 4 , .Xr sysexits 3 .Sh HISTORY The .Nm utility first appeared in -.Fx 12.0 . +.Fx 12.1 . .Sh AUTHORS The .Nm Modified: head/usr.sbin/trim/trim.c ============================================================================== --- head/usr.sbin/trim/trim.c Fri Nov 30 20:58:08 2018 (r341351) +++ head/usr.sbin/trim/trim.c Fri Nov 30 21:57:02 2018 (r341352) @@ -37,49 +37,49 @@ #include #include #include +#include #include #include #include #include -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); -static int trim(char *path, off_t offset, off_t length, int dryrun, int verbose); -static off_t getsize(char *path); -static void usage(char *name) __dead2; +static off_t getsize(const char *path); +static int opendev(const char *path, int flags); +static int trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose); +static void usage(const char *name); int main(int argc, char **argv) { off_t offset, length; uint64_t usz; - int ch, dryrun, error, verbose; + int ch, error; + bool dryrun, verbose; char *fname, *name; error = 0; length = offset = 0; name = argv[0]; - dryrun = verbose = 1; + dryrun = verbose = true; while ((ch = getopt(argc, argv, "Nfl:o:qr:v")) != -1) switch (ch) { case 'N': - dryrun = 1; - verbose = 1; + dryrun = true; + verbose = true; break; case 'f': - dryrun = 0; + dryrun = false; break; case 'l': case 'o': if (expand_number(optarg, &usz) == -1 || - (off_t)usz < 0 || - (usz == 0 && ch == 'l')) + (off_t)usz < 0 || (usz == 0 && ch == 'l')) errx(EX_USAGE, - "invalid %s of the region: `%s'", + "invalid %s of the region: %s", ch == 'o' ? "offset" : "length", optarg); if (ch == 'o') @@ -88,16 +88,16 @@ main(int argc, char **argv) length = (off_t)usz; break; case 'q': - verbose = 0; + verbose = false; break; case 'r': if ((length = getsize(optarg)) == 0) errx(EX_USAGE, "invalid zero length reference file" - " for the region: `%s'", optarg); + " for the region: %s", optarg); break; case 'v': - verbose = 1; + verbose = true; break; default: usage(name); @@ -117,28 +117,38 @@ main(int argc, char **argv) return (error ? EXIT_FAILURE : EXIT_SUCCESS); } -static off_t -getsize(char *path) +static int +opendev(const char *path, int flags) { - struct stat sb; - char *tstr; - off_t mediasize; int fd; + char *tstr; - if ((fd = open(path, O_RDONLY | O_DIRECT)) < 0) { + if ((fd = open(path, flags)) < 0) { if (errno == ENOENT && path[0] != '/') { if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) errx(EX_OSERR, "no memory"); - fd = open(tstr, O_RDONLY | O_DIRECT); + fd = open(tstr, flags); free(tstr); } } if (fd < 0) - err(EX_NOINPUT, "`%s'", path); + err(EX_NOINPUT, "fstat failed: %s", path); + return (fd); +} + +static off_t +getsize(const char *path) +{ + struct stat sb; + off_t mediasize; + int fd; + + fd = opendev(path, O_RDONLY | O_DIRECT); + if (fstat(fd, &sb) < 0) - err(EX_IOERR, "`%s'", path); + err(EX_IOERR, "fstat failed: %s", path); if (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode)) { close(fd); @@ -148,62 +158,50 @@ getsize(char *path) if (!S_ISCHR(sb.st_mode) && !S_ISBLK(sb.st_mode)) errx(EX_DATAERR, "invalid type of the file " - "(not regular, directory nor special device): `%s'", + "(not regular, directory nor special device): %s", path); if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) - errx(EX_UNAVAILABLE, + err(EX_UNAVAILABLE, "ioctl(DIOCGMEDIASIZE) failed, probably not a disk: " - "`%s'", path); - close(fd); + "%s", path); + close(fd); return (mediasize); } static int -trim(char *path, off_t offset, off_t length, int dryrun, int verbose) +trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose) { off_t arg[2]; - char *tstr; int error, fd; if (length == 0) length = getsize(path); if (verbose) - printf("trim `%s' offset %ju length %ju\n", - path, (uintmax_t)offset, (uintmax_t)length); + printf("trim %s offset %ju length %ju\n", + path, (uintmax_t)offset, (uintmax_t)length); if (dryrun) { printf("dry run: add -f to actually perform the operation\n"); return (0); } - if ((fd = open(path, O_WRONLY | O_DIRECT)) < 0) { - if (errno == ENOENT && path[0] != '/') { - if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) - errx(EX_OSERR, "no memory"); - fd = open(tstr, O_WRONLY | O_DIRECT); - free(tstr); - } - } - - if (fd < 0) - err(EX_NOINPUT, "`%s'", path); - + fd = opendev(path, O_WRONLY | O_DIRECT); arg[0] = offset; arg[1] = length; error = ioctl(fd, DIOCGDELETE, arg); if (error < 0) - warn("ioctl(DIOCGDELETE) failed for `%s'", path); + warn("ioctl(DIOCGDELETE) failed: %s", path); close(fd); return (error); } static void -usage(char *name) +usage(const char *name) { (void)fprintf(stderr, "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t]] [-r rfile] [-Nfqv] device ...\n", From owner-svn-src-head@freebsd.org Fri Nov 30 22:01:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAC6911518F8; Fri, 30 Nov 2018 22:01:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 251C079EA4; Fri, 30 Nov 2018 22:01:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id D66BD104FCA1; Sat, 1 Dec 2018 09:00:56 +1100 (AEDT) Date: Sat, 1 Dec 2018 09:00:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz Napierala cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341338 - head/share/man/man4 In-Reply-To: <201811301144.wAUBiGj6030552@repo.freebsd.org> Message-ID: <20181201071457.N4011@besplex.bde.org> References: <201811301144.wAUBiGj6030552@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DZtnkrlW c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=MnhWq3ogupY_1e35NF4A:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 251C079EA4 X-Spamd-Result: default: False [-4.95 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_FROM(0.00)[optusnet.com.au]; DMARC_NA(0.00)[optusnet.com.au]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.70)[ipnet: 211.28.0.0/14(-4.69), asn: 4804(-3.75), country: AU(-0.04)]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 22:01:08 -0000 On Fri, 30 Nov 2018, Edward Tomasz Napierala wrote: > Log: > Say in plain text what the 'debug' keymap action usually is. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/share/man/man4/ddb.4 > > Modified: head/share/man/man4/ddb.4 > ============================================================================== > --- head/share/man/man4/ddb.4 Fri Nov 30 11:42:19 2018 (r341337) > +++ head/share/man/man4/ddb.4 Fri Nov 30 11:44:16 2018 (r341338) > @@ -108,7 +108,7 @@ If linked into the running kernel, > it can be invoked locally with the > .Ql debug > .Xr keymap 5 > -action, or by setting setting the > +action, usually mapped to Ctrl+Alt+Esc, or by setting setting the > .Dv debug.kdb.enter > sysctl to 1. > The debugger is also invoked on kernel Actually, it is usually mapped to Ctl-PrintScreen. Ctl-Alt-Esc is a harder to type alternative for this. There is 1 more alias in syscons us.iso.kbd and 4 more aliases in syscons us.iso.acc.kbd. vt complicates things. It removes ".iso" from the file names and changes 1 unrelated entry in us.iso.kbd. It changes many unrelated entries in us.iso.acc.kbd, but all changes seem to be to replace decimal constants by hex constants and mangle the formatting. There are many undocumented complications for enabling these keys. Some are: - the config option BREAK_TO_DEBUGGER for enabling entry to kdb on serial line breaks is conflated with entering kdb with a breakpoint instruction and used to initialize the similarly conflated sysctl variable kdb_break_to_debugger. Entering kdb on a serial line break is usually unwanted since it gives kdb entries when you unplug the cable or turn the other end off. So if you have a serial console, this option should rarely be used the sysctl variabled should rarely be enabled. ddb.4 documents BREAK_TO_DEBUGGER and clearly says that it is (only) for serial lines and gives slightly different reasons for not using it, and documents kdb.break_to_debugger, but doesn't know about about the conflation or the kdb sysctls or the following complications. - the sysctl variable controls entry to kdb using kdb_break() from all console drivers, so it should have to be enabled for the keys documented above to work, but it should be disabled for serial consoles. This is complicated by the conflation. The "break" in kdb_break() means more like "break in to" than either "serial line break" or "breakpoint instruction". sio and uart use this function for serial line breaks. syscons uses this for the keys documented above. But vt doesn't use this. - the sysctl variable gives a layer of security for the keys documented above. syscons gives 4 more layers of security. That's 4 too many layers. sio and uart don't add any layers. vt doesn't use this layer, and adds its own layers. Details of the layers for syscons: - kdb entry keys can be disabled by omitting them from the keymap - IIRC, loading of keymaps is not privileged, so you will need some restrictions on accesses to syscons devices to secure the previous layer - config option SC_DISABLE_KDBKEY - sysctl variable enable_kdbkey which defaults to the inverse of the config option, or enabled if the config option is not set. Details of the layers for vt: - 2 layers for the keymap as for syscons - sysctl variable vt_kbd_debug. The sysctl name has the vt_ prefix separate. kbd_debug corresponds to the sysctl name enable_kdbkey. Both names are bad: - they are different (after removing the prefix) - no sc_ prefix in variable name for syscons - "kdb" for syscons looks like "kbd" which is a bad abbreviation for "keyboard" (should be "kb") - "kbd" for vt. This might actually mean "keyboard". Then "debug" is a verbose spelling of the "d" in "kdb", and "kdb" is not mentioned. The vt method is better, and I plan to change sysctl to use the same method as a first step in fixing the conflation. The security restrictions should be per-device since you might have some secure consoles and some insecure consoles. The separate security layers already give this for syscons and vt, but it is more needed for multiple serial consoles. Everything except the kdb sysctl defaults to enabled, so it is easy to enable entry to kdb via the keys documented above. Disabling all entries to kdb via keys involves understanding smaller mazes of security-related options and sysctls: - ALT_BREAK_TO_DEBUGGER option and kdb_alt_break_to_debugger sysctl. This was originally only an alternative to serial line BREAK_TO_DEBUGGER. Its conflation with serial line breaks was smaller, but it now allows panics and reboots so it is even more misnamed than BREAK_TO_DEBUGGER. Separate security flags are needed for the different features in it. ddb.5 documents all this. - in syscons, the enable_kdbkey sysctl is used for allowing the ALT_BREAK_TO_DEBUGGER sequences too. - in vt, there are no extra controls on ALT_BREAK_TO_DEBUGGER sequences. This is the same as for sio and uart. Bruce From owner-svn-src-head@freebsd.org Fri Nov 30 22:09:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2BEA1151B9E; Fri, 30 Nov 2018 22:09:34 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B87FC7A2C8; Fri, 30 Nov 2018 22:09:33 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAUM9OVM030503 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Nov 2018 23:09:25 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: steven.hartland@multiplay.co.uk Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAUM9NNE008090 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 1 Dec 2018 05:09:23 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn: head/usr.bin: . trim To: Steven Hartland References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> <20181130125645.GA97463@FreeBSD.org> <2ef3034e-6c4c-4fb7-3c7d-7cb41e4faac5@grosbein.net> <864fc11c-6554-f8de-5a58-dfee09a23803@multiplay.co.uk> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Cy Schubert From: Eugene Grosbein Message-ID: <51e0273e-2259-28c9-1872-c3c971e4ece0@grosbein.net> Date: Sat, 1 Dec 2018 05:09:11 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <864fc11c-6554-f8de-5a58-dfee09a23803@multiplay.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: B87FC7A2C8 X-Spamd-Result: default: False [-4.55 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MX_INVALID(0.50)[cached]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-2.01)[ip: (-3.77), ipnet: 2a01:4f8::/29(-3.64), asn: 24940(-2.61), country: DE(-0.02)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 22:09:34 -0000 01.12.2018 4:29, Steven Hartland wrote: > On 30/11/2018 21:16, Eugene Grosbein wrote: >> 30.11.2018 21:23, Warner Losh wrote: >> >>> So I'm back to my point: we should just put it into dd and move on with our lives. It's really the right place for it. >> Why can't we have two implementations? Diversity is good thing. >> >> I can imagine erasing a partition with ZFS Cache or ZIL inside and >> "trim /dev/da0p2 /dev/da0p3" looks much better :-) > > ZFS already does that no need for a separate tool Think of media taken out of (possibly already dead) ZFS-based to UFS-only system. By the way, how exactly do you trim previously ZIL partition withing working ZFS-based system? From owner-svn-src-head@freebsd.org Fri Nov 30 22:44:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D0611524C3; Fri, 30 Nov 2018 22:44:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6EA57B337; Fri, 30 Nov 2018 22:44:34 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A96B17136; Fri, 30 Nov 2018 22:44:34 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUMiYMQ083113; Fri, 30 Nov 2018 22:44:34 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUMiXxl083108; Fri, 30 Nov 2018 22:44:33 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811302244.wAUMiXxl083108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 30 Nov 2018 22:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341353 - in head: sys/arm/arm sys/arm64/arm64 sys/riscv/riscv tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head: sys/arm/arm sys/arm64/arm64 sys/riscv/riscv tests/sys/kern X-SVN-Commit-Revision: 341353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6EA57B337 X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.151,0]; NEURAL_HAM_SHORT(-0.02)[-0.021,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 22:44:35 -0000 Author: vangyzen Date: Fri Nov 30 22:44:33 2018 New Revision: 341353 URL: https://svnweb.freebsd.org/changeset/base/341353 Log: Fix reporting of SS_ONSTACK Fix reporting of SS_ONSTACK in nested signal delivery when sigaltstack() is used on some architectures. Add a unit test for this. I tested the test by introducing the bug on amd64. I did not test it on other architectures. Reviewed by: kib MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18347 Added: head/tests/sys/kern/sigaltstack.c (contents, props changed) Modified: head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/riscv/riscv/machdep.c head/tests/sys/kern/Makefile Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Nov 30 21:57:02 2018 (r341352) +++ head/sys/arm/arm/machdep.c Fri Nov 30 22:44:33 2018 (r341353) @@ -653,9 +653,9 @@ sendsig(catcher, ksi, mask) #endif frame.sf_si = ksi->ksi_info; frame.sf_uc.uc_sigmask = *mask; - frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK ) - ? ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE; frame.sf_uc.uc_stack = td->td_sigstk; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? + (onstack ? SS_ONSTACK : 0) : SS_DISABLE; mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(td->td_proc); Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Fri Nov 30 21:57:02 2018 (r341352) +++ head/sys/arm64/arm64/machdep.c Fri Nov 30 22:44:33 2018 (r341353) @@ -661,9 +661,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; frame.sf_uc.uc_sigmask = *mask; - frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ? - ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE; frame.sf_uc.uc_stack = td->td_sigstk; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? + (onstack ? SS_ONSTACK : 0) : SS_DISABLE; mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(td->td_proc); Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Fri Nov 30 21:57:02 2018 (r341352) +++ head/sys/riscv/riscv/machdep.c Fri Nov 30 22:44:33 2018 (r341353) @@ -587,9 +587,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; frame.sf_uc.uc_sigmask = *mask; - frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ? - ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE; frame.sf_uc.uc_stack = td->td_sigstk; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? + (onstack ? SS_ONSTACK : 0) : SS_DISABLE; mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(td->td_proc); Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Fri Nov 30 21:57:02 2018 (r341352) +++ head/tests/sys/kern/Makefile Fri Nov 30 22:44:33 2018 (r341353) @@ -10,6 +10,7 @@ ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" ATF_TESTS_C+= reaper +ATF_TESTS_C+= sigaltstack PLAIN_TESTS_C+= subr_unit_test ATF_TESTS_C+= sys_getrandom ATF_TESTS_C+= unix_passfd_test Added: head/tests/sys/kern/sigaltstack.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/sigaltstack.c Fri Nov 30 22:44:33 2018 (r341353) @@ -0,0 +1,115 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Eric van Gyzen + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +/* + * TODO add tests for: + * + * - all error cases + * - SS_DISABLE + * - no effect without SA_ONSTACK + */ + +static sig_atomic_t disabled_correct = 1; +static sig_atomic_t level1_correct = -1; +static sig_atomic_t level2_correct = -1; + +static void +sig_handler(int signo, siginfo_t *info __unused, void *ucp) +{ + ucontext_t *uc = ucp; + + // The alternate signal stack is enabled. + disabled_correct = disabled_correct && + (uc->uc_stack.ss_flags & SS_DISABLE) == 0; + if (signo == SIGUSR1) { + // The thread was NOT running on the alternate signal + // stack when this signal arrived. + level1_correct = (uc->uc_stack.ss_flags & SS_ONSTACK) == 0; + raise(SIGUSR2); + } else { + // The thread WAS running on the alternate signal + // stack when this signal arrived. + level2_correct = (uc->uc_stack.ss_flags & SS_ONSTACK) != 0; + } +} + +ATF_TC(ss_onstack); + +ATF_TC_HEAD(ss_onstack, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Test reporting of SS_ONSTACK"); +} + +ATF_TC_BODY(ss_onstack, tc) +{ + stack_t ss = { + .ss_size = SIGSTKSZ, + }; + stack_t oss = {0}; + + ss.ss_sp = malloc(ss.ss_size); + ATF_REQUIRE(ss.ss_sp != NULL); + ATF_REQUIRE(sigaltstack(&ss, &oss) == 0); + + // There should be no signal stack currently configured. + ATF_CHECK(oss.ss_sp == NULL); + ATF_CHECK(oss.ss_size == 0); + ATF_CHECK((oss.ss_flags & SS_DISABLE) != 0); + ATF_CHECK((oss.ss_flags & SS_ONSTACK) == 0); + + struct sigaction sa = { + .sa_sigaction = sig_handler, + .sa_flags = SA_ONSTACK | SA_SIGINFO, + }; + ATF_REQUIRE(sigemptyset(&sa.sa_mask) == 0); + ATF_REQUIRE(sigaction(SIGUSR1, &sa, NULL) == 0); + ATF_REQUIRE(sigaction(SIGUSR2, &sa, NULL) == 0); + ATF_REQUIRE(raise(SIGUSR1) == 0); + + ATF_CHECK(level1_correct != -1); + ATF_CHECK(level1_correct == 1); + ATF_CHECK(level2_correct != -1); + ATF_CHECK(level2_correct == 1); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, ss_onstack); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Fri Nov 30 23:47:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B96A911533F9; Fri, 30 Nov 2018 23:47:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C6CC7CA25; Fri, 30 Nov 2018 23:47:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D8C77B13; Fri, 30 Nov 2018 23:47:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAUNlw2g014391; Fri, 30 Nov 2018 23:47:58 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAUNlwqD014390; Fri, 30 Nov 2018 23:47:58 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811302347.wAUNlwqD014390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 30 Nov 2018 23:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341354 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 341354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C6CC7CA25 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.05)[0.047,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 23:47:58 -0000 Author: vangyzen Date: Fri Nov 30 23:47:57 2018 New Revision: 341354 URL: https://svnweb.freebsd.org/changeset/base/341354 Log: Maybe make gcc happy According to Jenkins, the GCC architectures were unhappy because: sigaltstack.c:82: warning: missing initializer sigaltstack.c:82: warning: (near initialization for 'oss.ss_size') MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kern/sigaltstack.c Modified: head/tests/sys/kern/sigaltstack.c ============================================================================== --- head/tests/sys/kern/sigaltstack.c Fri Nov 30 22:44:33 2018 (r341353) +++ head/tests/sys/kern/sigaltstack.c Fri Nov 30 23:47:57 2018 (r341354) @@ -79,7 +79,9 @@ ATF_TC_BODY(ss_onstack, tc) stack_t ss = { .ss_size = SIGSTKSZ, }; - stack_t oss = {0}; + stack_t oss = { + .ss_size = 0, + }; ss.ss_sp = malloc(ss.ss_size); ATF_REQUIRE(ss.ss_sp != NULL); From owner-svn-src-head@freebsd.org Sat Dec 1 01:54:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5475811576F9 for ; Sat, 1 Dec 2018 01:54:11 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F0E981B8F for ; Sat, 1 Dec 2018 01:54:10 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-ed1-x52c.google.com with SMTP id x30so6342927edx.2 for ; Fri, 30 Nov 2018 17:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=1rKcat5mF3zk/GLM4zJJ2Xv+0Vn9PUsYs/b1UAzKoZQ=; b=K7D8MWvTcQDOwc8w/pbo8CmF/DkMrHhhEgSfQN63bT0OseknkR5koqbVuGebZhI/0X zIlhS91eseOF73UA4vNcG+duyPDFwscm0JJvOXAwGoDwO4Jjo3+b3G09zMDD8U14cKIy sIUCoCkeuElQ0oaCNiuWKFyy7iMmx6ZjMLYXd1CGsiajtXV0U8IrPnP4BQ84kOS0dWlW Miwes9XHRaIwtCpzcMsNoYv3jLaL/7owHa0VmZOpJcKJxDYr3IBErm0dYE4NITF6agIn smW8XcV+9bDOUkOcT9r928oJpIh6fLxIKK1RtPIb3UatDb+hhTCJLZHKFzj5krXO9iC2 0asw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=1rKcat5mF3zk/GLM4zJJ2Xv+0Vn9PUsYs/b1UAzKoZQ=; b=O/tskTZLM3leiHZAIeZuUSdRyl7YXhjbq8PO6T0NMe6yNabpT9tH0xEr7sJVrhnUme shVVOphUW9rCvnPnnC7rwuroJ3TDseXgOHGeEpEBZZElPtPEJK4ljWm7upOtafl4e1jd P5C8gYXuTU1tKuxJLJF8NH6cZZg7uKVj1v7Yl5Zhm2qyf13T3RTnnZYLIY1KDfUwbDXQ y1pN6esGLao+YNnIlesLfrR6jJqVUYCYrQTyvt33aWdjd18YzjcElwF8J58wFvudgAcp UtB5zFKGETM6cMsyfni49SwPbm9shtr/uTovY2dyILRi2/yqfOMsnTirF3LAH8SePHmm IqMA== X-Gm-Message-State: AA+aEWZo8WJNclReFL9FEI3+V7izefJ2I4MlFu8OInYQgX5aPLpiJ/+e 3p7Cp4QcNiRbrRBeUk6xwGkkaQ== X-Google-Smtp-Source: AFSGD/VkaPRnHQteTEeRhh2BZ/r143Tb59HQvvp2AOvrZmDy8QzoKDtUN8YI9NVBTZwC1Rzx6FixVg== X-Received: by 2002:a50:c2d9:: with SMTP id u25mr7178815edf.280.1543629249102; Fri, 30 Nov 2018 17:54:09 -0800 (PST) Received: from [10.44.128.75] ([161.12.40.153]) by smtp.gmail.com with ESMTPSA id b11-v6sm1030017eje.38.2018.11.30.17.54.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 17:54:07 -0800 (PST) Subject: Re: svn: head/usr.bin: . trim To: Eugene Grosbein Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Cy Schubert References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> <20181130125645.GA97463@FreeBSD.org> <2ef3034e-6c4c-4fb7-3c7d-7cb41e4faac5@grosbein.net> <864fc11c-6554-f8de-5a58-dfee09a23803@multiplay.co.uk> <51e0273e-2259-28c9-1872-c3c971e4ece0@grosbein.net> From: Steven Hartland Message-ID: <3c0dae49-84ac-a3ef-32c7-f796e3eec16c@multiplay.co.uk> Date: Sat, 1 Dec 2018 01:54:07 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <51e0273e-2259-28c9-1872-c3c971e4ece0@grosbein.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 5F0E981B8F X-Spamd-Result: default: False [-5.71 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[multiplay.co.uk]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: ASPMX.L.GOOGLE.COM]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[c.2.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.21)[ip: (-8.13), ipnet: 2a00:1450::/32(-1.50), asn: 15169(-1.34), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 01:54:11 -0000 On 30/11/2018 22:09, Eugene Grosbein wrote: > 01.12.2018 4:29, Steven Hartland wrote: > >> On 30/11/2018 21:16, Eugene Grosbein wrote: >>> 30.11.2018 21:23, Warner Losh wrote: >>> >>>> So I'm back to my point: we should just put it into dd and move on with our lives. It's really the right place for it. >>> Why can't we have two implementations? Diversity is good thing. >>> >>> I can imagine erasing a partition with ZFS Cache or ZIL inside and >>> "trim /dev/da0p2 /dev/da0p3" looks much better :-) >> ZFS already does that no need for a separate tool > Think of media taken out of (possibly already dead) ZFS-based to UFS-only system. > > By the way, how exactly do you trim previously ZIL partition withing working ZFS-based system? > You could use camcontrol which can perform a secure erase on the device, but that's obviously device wide not a specific partition. What I was referring to is ZFS performs a delete of blocks when it initializes a volume, so there's usually no need to perform a manual step there. For reference this behavior can be disabled by setting vfs.zfs.vdev.trim_on_init=0     Regards     Steve From owner-svn-src-head@freebsd.org Sat Dec 1 03:20:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B673D115A4C4; Sat, 1 Dec 2018 03:20:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E251850EA; Sat, 1 Dec 2018 03:20:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F188121FC; Sat, 1 Dec 2018 03:20:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB13KBbR025257; Sat, 1 Dec 2018 03:20:11 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB13KBYV025256; Sat, 1 Dec 2018 03:20:11 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812010320.wB13KBYV025256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 1 Dec 2018 03:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341356 - in head/usr.sbin: . trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head/usr.sbin: . trim X-SVN-Commit-Revision: 341356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E251850EA X-Spamd-Result: default: False [0.50 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.28)[0.278,0]; NEURAL_SPAM_SHORT(0.18)[0.182,0]; NEURAL_SPAM_MEDIUM(0.04)[0.040,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 03:20:11 -0000 Author: eugen Date: Sat Dec 1 03:20:10 2018 New Revision: 341356 URL: https://svnweb.freebsd.org/changeset/base/341356 Log: Remove trim(8) by multiple demands. Deleted: head/usr.sbin/trim/ Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Nov 30 23:51:53 2018 (r341355) +++ head/usr.sbin/Makefile Sat Dec 1 03:20:10 2018 (r341356) @@ -91,7 +91,6 @@ SUBDIR= adduser \ tcpdrop \ tcpdump \ traceroute \ - trim \ trpt \ tzsetup \ ugidfw \ From owner-svn-src-head@freebsd.org Sat Dec 1 02:34:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F961158F01; Sat, 1 Dec 2018 02:34:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCCC98386B; Sat, 1 Dec 2018 02:34:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f42.google.com with SMTP id s22so6122118ioc.8; Fri, 30 Nov 2018 18:34:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=54+mfksFnulO+FonJ4eh/8+t+qQtE79DF69XWtc4Fmc=; b=cMDBSl1QJnb0vL/IA81dsGD7x5sUp9W3y6JaAA8E4Uo8ExwNZ62cD6un0/zLHeOPMB /tXAX3yOQwErglX1p62iqgZ14cyeHD3XTU301PZhwebGv4nD2WUrwDBjCtln7ejfsza0 745WwA/95upCIJ+QNx8JWJt5f29IuS28OJZyEPJqrDhHRBSlOmYu86+ZWE45nOsk7T0G OoDnxQfdPqtPZ6MDXsXnsdjQl5OwNMO9rqE3D8k34PJhlJxtV0l9KY/RMjedV1QgBdch z4NKwJiBbNDYhwIHBjc5wHjv9qY7bsnHI7X8Xj8BSV8JCY7nEFbBXjUmX+MQAcHBJO1S DGsg== X-Gm-Message-State: AA+aEWYCOf47ND6YgSJ2iHw9UAVUo6AtCYbGZpm2vBILzepOSVCTZ6DG BkyQnfn3v6ElmpXt8S1zmKbjLXsm X-Google-Smtp-Source: AFSGD/WK64wkmUF+P02qfuN3i3Hm6oeK6yccjK0yNl/0FlCvYvM3zfHpne1IDbCO5GrvXVKrwjOmqA== X-Received: by 2002:a5d:8788:: with SMTP id f8mr2136417ion.239.1543631654849; Fri, 30 Nov 2018 18:34:14 -0800 (PST) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id 14sm1553685itm.3.2018.11.30.18.34.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 18:34:14 -0800 (PST) Received: by mail-io1-f42.google.com with SMTP id k7so6125575iob.6; Fri, 30 Nov 2018 18:34:14 -0800 (PST) X-Received: by 2002:a6b:6111:: with SMTP id v17mr77696iob.107.1543631654186; Fri, 30 Nov 2018 18:34:14 -0800 (PST) MIME-Version: 1.0 References: <201811302157.wAULv2iH057184@repo.freebsd.org> In-Reply-To: <201811302157.wAULv2iH057184@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 30 Nov 2018 18:34:03 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r341352 - head/usr.sbin/trim To: eugen@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: BCCC98386B X-Spamd-Result: default: False [-3.95 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; IP_SCORE(-0.97)[ipnet: 209.85.128.0/17(-3.39), asn: 15169(-1.34), country: US(-0.09)]; RCVD_IN_DNSWL_NONE(0.00)[42.166.85.209.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[42.166.85.209.rep.mailspike.net : 127.0.0.17] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 02:34:22 -0000 Hi Eugene, Generally when a committer puts a patch on phabricator, they'll commit it when they're ready. In particular this patch hadn't actually been approved by any reviewers yet and review discussion was still active. As far as I can tell, imp@ hadn't indicated he wasn't going to commit his patch himself. I'd love to be imagining things, but it seems like the general trend is you consistently fail to follow basic etiquette and consistently ignore review and concerns. This time around you definitely don't have the excuse of phabricator being silent for months =E2=80=94 the review hadn't seen any 24h period of inactivity since its creation. I was tentatively ok with trim staying in based on imp@ taking charge of cleaning up the deficiencies, but you've gone around imp@ and ignored me completely. Please back out trim and consider taking a few days off. The way trim has entered the tree is just not how we do things as a project. I think there's universal consensus that we want a tool that does what trim does in base; there's some bikeshedding about whether it should live in dd or not (it shouldn't); but rest assured, it will go in in some form. My ask is that it to go in the right way, instead of the total mess it has so been so far. Thanks, Conrad On Fri, Nov 30, 2018 at 1:57 PM Eugene Grosbein wrote: > > Author: eugen > Date: Fri Nov 30 21:57:02 2018 > New Revision: 341352 > URL: https://svnweb.freebsd.org/changeset/base/341352 > > Log: > trim(8): serveral style fixes > > Submitted by: imp > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D18380 > > Modified: > head/usr.sbin/trim/trim.8 > head/usr.sbin/trim/trim.c > > Modified: head/usr.sbin/trim/trim.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/trim/trim.8 Fri Nov 30 20:58:08 2018 (r341351) > +++ head/usr.sbin/trim/trim.8 Fri Nov 30 21:57:02 2018 (r341352) > @@ -50,8 +50,8 @@ > The > .Nm > utility erases specified region of the device. > -It is only relevant for flash based storage devices that use wear-leveli= ng > -algorithms. > +It is mostly relevant for storage that implement trim (like flash based, > +or thinly provisioned storage). > .Sy All erased data is lost. > .Pp > The following options are available: > @@ -153,12 +153,13 @@ is special device file not supporting DIOCGMEDIASIZ= E > .Xr ada 4 , > .Xr da 4 , > .Xr ioctl 2 , > +.Xr nda 4 , > .Xr sysexits 3 > .Sh HISTORY > The > .Nm > utility first appeared in > -.Fx 12.0 . > +.Fx 12.1 . > .Sh AUTHORS > The > .Nm > > Modified: head/usr.sbin/trim/trim.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/trim/trim.c Fri Nov 30 20:58:08 2018 (r341351) > +++ head/usr.sbin/trim/trim.c Fri Nov 30 21:57:02 2018 (r341352) > @@ -37,49 +37,49 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > > -#ifndef lint > -static const char rcsid[] =3D > - "$FreeBSD$"; > -#endif /* not lint */ > +#include > +__FBSDID("$FreeBSD$"); > > -static int trim(char *path, off_t offset, off_t length, int dryrun, = int verbose); > -static off_t getsize(char *path); > -static void usage(char *name) __dead2; > +static off_t getsize(const char *path); > +static int opendev(const char *path, int flags); > +static int trim(const char *path, off_t offset, off_t length, bool d= ryrun, bool verbose); > +static void usage(const char *name); > > int > main(int argc, char **argv) > { > off_t offset, length; > uint64_t usz; > - int ch, dryrun, error, verbose; > + int ch, error; > + bool dryrun, verbose; > char *fname, *name; > > error =3D 0; > length =3D offset =3D 0; > name =3D argv[0]; > - dryrun =3D verbose =3D 1; > + dryrun =3D verbose =3D true; > > while ((ch =3D getopt(argc, argv, "Nfl:o:qr:v")) !=3D -1) > switch (ch) { > case 'N': > - dryrun =3D 1; > - verbose =3D 1; > + dryrun =3D true; > + verbose =3D true; > break; > case 'f': > - dryrun =3D 0; > + dryrun =3D false; > break; > case 'l': > case 'o': > if (expand_number(optarg, &usz) =3D=3D -1 || > - (off_t)usz < 0 || > - (usz =3D=3D 0 && ch =3D=3D 'l')) > + (off_t)usz < 0 || (usz =3D=3D 0 &= & ch =3D=3D 'l')) > errx(EX_USAGE, > - "invalid %s of the region: `%s'", > + "invalid %s of the region: %s", > ch =3D=3D 'o' ? "offset" : "lengt= h", > optarg); > if (ch =3D=3D 'o') > @@ -88,16 +88,16 @@ main(int argc, char **argv) > length =3D (off_t)usz; > break; > case 'q': > - verbose =3D 0; > + verbose =3D false; > break; > case 'r': > if ((length =3D getsize(optarg)) =3D=3D 0) > errx(EX_USAGE, > "invalid zero length reference fi= le" > - " for the region: `%s'", optarg); > + " for the region: %s", optarg); > break; > case 'v': > - verbose =3D 1; > + verbose =3D true; > break; > default: > usage(name); > @@ -117,28 +117,38 @@ main(int argc, char **argv) > return (error ? EXIT_FAILURE : EXIT_SUCCESS); > } > > -static off_t > -getsize(char *path) > +static int > +opendev(const char *path, int flags) > { > - struct stat sb; > - char *tstr; > - off_t mediasize; > int fd; > + char *tstr; > > - if ((fd =3D open(path, O_RDONLY | O_DIRECT)) < 0) { > + if ((fd =3D open(path, flags)) < 0) { > if (errno =3D=3D ENOENT && path[0] !=3D '/') { > if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) > errx(EX_OSERR, "no memory"); > - fd =3D open(tstr, O_RDONLY | O_DIRECT); > + fd =3D open(tstr, flags); > free(tstr); > } > } > > if (fd < 0) > - err(EX_NOINPUT, "`%s'", path); > + err(EX_NOINPUT, "fstat failed: %s", path); > > + return (fd); > +} > + > +static off_t > +getsize(const char *path) > +{ > + struct stat sb; > + off_t mediasize; > + int fd; > + > + fd =3D opendev(path, O_RDONLY | O_DIRECT); > + > if (fstat(fd, &sb) < 0) > - err(EX_IOERR, "`%s'", path); > + err(EX_IOERR, "fstat failed: %s", path); > > if (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode)) { > close(fd); > @@ -148,62 +158,50 @@ getsize(char *path) > if (!S_ISCHR(sb.st_mode) && !S_ISBLK(sb.st_mode)) > errx(EX_DATAERR, > "invalid type of the file " > - "(not regular, directory nor special device): `%s= '", > + "(not regular, directory nor special device): %s"= , > path); > > if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) > - errx(EX_UNAVAILABLE, > + err(EX_UNAVAILABLE, > "ioctl(DIOCGMEDIASIZE) failed, probably not a dis= k: " > - "`%s'", path); > - close(fd); > + "%s", path); > > + close(fd); > return (mediasize); > } > > static int > -trim(char *path, off_t offset, off_t length, int dryrun, int verbose) > +trim(const char *path, off_t offset, off_t length, bool dryrun, bool ver= bose) > { > off_t arg[2]; > - char *tstr; > int error, fd; > > if (length =3D=3D 0) > length =3D getsize(path); > > if (verbose) > - printf("trim `%s' offset %ju length %ju\n", > - path, (uintmax_t)offset, (uintmax_t)length); > + printf("trim %s offset %ju length %ju\n", > + path, (uintmax_t)offset, (uintmax_t)length); > > if (dryrun) { > printf("dry run: add -f to actually perform the operation= \n"); > return (0); > } > > - if ((fd =3D open(path, O_WRONLY | O_DIRECT)) < 0) { > - if (errno =3D=3D ENOENT && path[0] !=3D '/') { > - if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) > - errx(EX_OSERR, "no memory"); > - fd =3D open(tstr, O_WRONLY | O_DIRECT); > - free(tstr); > - } > - } > - > - if (fd < 0) > - err(EX_NOINPUT, "`%s'", path); > - > + fd =3D opendev(path, O_WRONLY | O_DIRECT); > arg[0] =3D offset; > arg[1] =3D length; > > error =3D ioctl(fd, DIOCGDELETE, arg); > if (error < 0) > - warn("ioctl(DIOCGDELETE) failed for `%s'", path); > + warn("ioctl(DIOCGDELETE) failed: %s", path); > > close(fd); > return (error); > } > > static void > -usage(char *name) > +usage(const char *name) > { > (void)fprintf(stderr, > "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t]] [-r rfile] [-Nfqv]= device ...\n", > From owner-svn-src-head@freebsd.org Sat Dec 1 02:41:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB471159291; Sat, 1 Dec 2018 02:41:02 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 88F6983B47; Sat, 1 Dec 2018 02:40:51 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wB12edoA032686 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 1 Dec 2018 03:40:40 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: steven.hartland@multiplay.co.uk Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wB12ecXf011713 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 1 Dec 2018 09:40:38 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn: head/usr.bin: . trim To: Steven Hartland References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> <20181130113422.GA14353@FreeBSD.org> <20181130115515.GA28531@FreeBSD.org> <20181130125645.GA97463@FreeBSD.org> <2ef3034e-6c4c-4fb7-3c7d-7cb41e4faac5@grosbein.net> <864fc11c-6554-f8de-5a58-dfee09a23803@multiplay.co.uk> <51e0273e-2259-28c9-1872-c3c971e4ece0@grosbein.net> <3c0dae49-84ac-a3ef-32c7-f796e3eec16c@multiplay.co.uk> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Cy Schubert From: Eugene Grosbein Message-ID: <1a6cb76c-50b4-cc77-dbcd-cc79d073088e@grosbein.net> Date: Sat, 1 Dec 2018 09:40:27 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <3c0dae49-84ac-a3ef-32c7-f796e3eec16c@multiplay.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 88F6983B47 X-Spamd-Result: default: False [-4.55 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-1.97)[ip: (-3.63), ipnet: 2a01:4f8::/29(-3.62), asn: 24940(-2.60), country: DE(-0.01)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 02:41:02 -0000 01.12.2018 8:54, Steven Hartland wrote: > What I was referring to is ZFS performs a delete of blocks when it initializes a volume, so there's usually no need to perform a manual step there. It may be needed after ZIL or ZFS Cache partition became unneeded. From owner-svn-src-head@freebsd.org Sat Dec 1 03:15:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32787115A369; Sat, 1 Dec 2018 03:15:05 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BA31C84F09; Sat, 1 Dec 2018 03:15:04 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wB13Ev8e032907 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 1 Dec 2018 04:14:58 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: cem@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wB13EuY0011932 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 1 Dec 2018 10:14:56 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r341352 - head/usr.sbin/trim To: cem@freebsd.org References: <201811302157.wAULv2iH057184@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <13bec879-3cf5-3f9b-58a3-47f7405e5f77@freebsd.org> Date: Sat, 1 Dec 2018 10:14:44 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: BA31C84F09 X-Spamd-Result: default: False [-0.33 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.40)[-0.401,0]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; NEURAL_SPAM_SHORT(0.29)[0.292,0]; NEURAL_HAM_LONG(-0.22)[-0.217,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 03:15:05 -0000 01.12.2018 9:34, Conrad Meyer wrote: > Generally when a committer puts a patch on phabricator, they'll commit > it when they're ready. I think this is wrong behaviour of the Phabricator to auto-close a differential just because some singe commit referred to it. It was not meant to be closed for now and I've just re-opened the differential. > In particular this patch hadn't actually been > approved by any reviewers yet and review discussion was still active. Is it possible to add hackers@ audience to reviewers list? I do not see people discussing the topic adding themselves and it would be wrong to force them. > As far as I can tell, imp@ hadn't indicated he wasn't going to commit > his patch himself. Parts of changes that have consensus were committed. Why is it bad? > I'd love to be imagining things, but it seems like > the general trend is you consistently fail to follow basic etiquette > and consistently ignore review and concerns. > > This time around you definitely don't have the excuse of phabricator > being silent for months — the review hadn't seen any 24h period of > inactivity since its creation. > > I was tentatively ok with trim staying in based on imp@ taking charge > of cleaning up the deficiencies, but you've gone around imp@ and > ignored me completely. This is untrue: I committed some changes requested by you and imp. > Please back out trim and consider taking a few days off. The way trim > has entered the tree is just not how we do things as a project. I > think there's universal consensus that we want a tool that does what > trim does in base; there's some bikeshedding about whether it should > live in dd or not (it shouldn't); but rest assured, it will go in in > some form. My ask is that it to go in the right way, instead of the > total mess it has so been so far. I have not seen universal consensus about backing it out and I disagree that it is "total mess". The code is small, clean and works. But if you insist, feel free to remove it. From owner-svn-src-head@freebsd.org Sat Dec 1 05:58:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F0B41331CF0; Sat, 1 Dec 2018 05:58:34 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAA356A64B; Sat, 1 Dec 2018 05:58:33 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC88613D89; Sat, 1 Dec 2018 05:58:33 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB15wX7j007990; Sat, 1 Dec 2018 05:58:33 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB15wXDd007989; Sat, 1 Dec 2018 05:58:33 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201812010558.wB15wXDd007989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Sat, 1 Dec 2018 05:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341357 - head/bin/pkill X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/bin/pkill X-SVN-Commit-Revision: 341357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAA356A64B X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.01)[-0.013,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 05:58:34 -0000 Author: ygy (doc committer) Date: Sat Dec 1 05:58:33 2018 New Revision: 341357 URL: https://svnweb.freebsd.org/changeset/base/341357 Log: Clarify that patterns are extended regular expressions in pkill(1) manual page. PR: 231060 Submitted by: naddy MFC after: 3 days Modified: head/bin/pkill/pkill.1 Modified: head/bin/pkill/pkill.1 ============================================================================== --- head/bin/pkill/pkill.1 Sat Dec 1 03:20:10 2018 (r341356) +++ head/bin/pkill/pkill.1 Sat Dec 1 05:58:33 2018 (r341357) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 5, 2017 +.Dd December 1, 2018 .Dt PKILL 1 .Os .Sh NAME @@ -221,7 +221,7 @@ This option is valid only when given as the first argu .Pp If any .Ar pattern -operands are specified, they are used as regular expressions to match +operands are specified, they are used as extended regular expressions to match the command name or full argument list of each process. If the .Fl f From owner-svn-src-head@freebsd.org Sat Dec 1 09:59:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50DD3132A7F6; Sat, 1 Dec 2018 09:59:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E70E57A1B9; Sat, 1 Dec 2018 09:59:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C26CB16451; Sat, 1 Dec 2018 09:59:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB19xWon032368; Sat, 1 Dec 2018 09:59:32 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB19xWZF032367; Sat, 1 Dec 2018 09:59:32 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201812010959.wB19xWZF032367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 1 Dec 2018 09:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341360 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 341360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E70E57A1B9 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.35)[-0.348,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 09:59:33 -0000 Author: kp Date: Sat Dec 1 09:59:32 2018 New Revision: 341360 URL: https://svnweb.freebsd.org/changeset/base/341360 Log: pf tests: Test name handling Provoke a situation where two interfaces have the same name, and verify pf's reaction to this. Added: head/tests/sys/netpfil/pf/names.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Sat Dec 1 09:58:21 2018 (r341359) +++ head/tests/sys/netpfil/pf/Makefile Sat Dec 1 09:59:32 2018 (r341360) @@ -9,6 +9,7 @@ ATF_TESTS_SH+= anchor \ pass_block \ forward \ fragmentation \ + names \ set_tos \ route_to \ synproxy \ Added: head/tests/sys/netpfil/pf/names.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/names.sh Sat Dec 1 09:59:32 2018 (r341360) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "names" "cleanup" +names_head() +{ + atf_set descr 'Test overlapping names' + atf_set require.user root +} + +names_body() +{ + pft_init + + epair=$(pft_mkepair) + + pft_mkjail alcatraz ${epair}b + ifconfig ${epair}a name foo + jexec alcatraz ifconfig ${epair}b name foo + + jail -r alcatraz + ifconfig foo destroy +} + +names_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "names" +} From owner-svn-src-head@freebsd.org Sat Dec 1 09:57:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8B62132A4F4; Sat, 1 Dec 2018 09:57:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B03C79FC5; Sat, 1 Dec 2018 09:57:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65A781644E; Sat, 1 Dec 2018 09:57:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB19vUU9032190; Sat, 1 Dec 2018 09:57:30 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB19vUMv032189; Sat, 1 Dec 2018 09:57:30 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201812010957.wB19vUMv032189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 1 Dec 2018 09:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341358 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 341358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B03C79FC5 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.35)[-0.348,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 09:57:31 -0000 Author: kp Date: Sat Dec 1 09:57:29 2018 New Revision: 341358 URL: https://svnweb.freebsd.org/changeset/base/341358 Log: pf tests: Make pass_block:noalias more robust Send several ICMPv6 echo requests. We've seen occasional failures with a single request. Modified: head/tests/sys/netpfil/pf/pass_block.sh Modified: head/tests/sys/netpfil/pf/pass_block.sh ============================================================================== --- head/tests/sys/netpfil/pf/pass_block.sh Sat Dec 1 05:58:33 2018 (r341357) +++ head/tests/sys/netpfil/pf/pass_block.sh Sat Dec 1 09:57:29 2018 (r341358) @@ -107,21 +107,21 @@ noalias_body() | cut -d % -f 1) # Sanity check - atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 - atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a + atf_check -s exit:0 -o ignore ping6 -c 3 -x 1 2001:db8:42::2 + atf_check -s exit:0 -o ignore ping6 -c 3 -x 1 ${linklocaladdr}%${epair}a jexec alcatraz pfctl -e pft_set_rules alcatraz "block out inet6 from (${epair}b:0) to any" - atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 + atf_check -s exit:2 -o ignore ping6 -c 3 -x 1 2001:db8:42::2 # We should still be able to ping the link-local address - atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a + atf_check -s exit:0 -o ignore ping6 -c 3 -x 1 ${linklocaladdr}%${epair}a pft_set_rules alcatraz "block out inet6 from (${epair}b) to any" # We cannot ping to the link-local address - atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a + atf_check -s exit:2 -o ignore ping6 -c 3 -x 1 ${linklocaladdr}%${epair}a } noalias_cleanup() From owner-svn-src-head@freebsd.org Sat Dec 1 09:58:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F255C132A662; Sat, 1 Dec 2018 09:58:21 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 985BC7A0CA; Sat, 1 Dec 2018 09:58:21 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 796CB1644F; Sat, 1 Dec 2018 09:58:21 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB19wLID032271; Sat, 1 Dec 2018 09:58:21 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB19wLeK032270; Sat, 1 Dec 2018 09:58:21 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201812010958.wB19wLeK032270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 1 Dec 2018 09:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341359 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 341359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 985BC7A0CA X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.35)[-0.348,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 09:58:22 -0000 Author: kp Date: Sat Dec 1 09:58:21 2018 New Revision: 341359 URL: https://svnweb.freebsd.org/changeset/base/341359 Log: pf: Fix panic on overlapping interface names In rare situations[*] it's possible for two different interfaces to have the same name. This confuses pf, because kifs are indexed by name (which is assumed to be unique). As a result we can end up trying to if_rele(NULL), which panics. Explicitly checking the ifp pointer before if_rele() prevents the panic. Note pf will likely behave in unexpected ways on the the overlapping interfaces. [*] Insert an interface in a vnet jail. Rename it to an interface which exists on the host. Remove the jail. There are now two interfaces with the same name in the host. Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Sat Dec 1 09:57:29 2018 (r341358) +++ head/sys/netpfil/pf/pf_if.c Sat Dec 1 09:58:21 2018 (r341359) @@ -853,7 +853,8 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne V_pfi_update++; pfi_kif_update(kif); - if_rele(kif->pfik_ifp); + if (kif->pfik_ifp) + if_rele(kif->pfik_ifp); kif->pfik_ifp = NULL; ifp->if_pf_kif = NULL; From owner-svn-src-head@freebsd.org Sat Dec 1 14:20:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6FDA1318C9D; Sat, 1 Dec 2018 14:20:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A37A847B8; Sat, 1 Dec 2018 14:20:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E04018FA7; Sat, 1 Dec 2018 14:20:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1EKWa9068806; Sat, 1 Dec 2018 14:20:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1EKWgs068804; Sat, 1 Dec 2018 14:20:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812011420.wB1EKWgs068804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Dec 2018 14:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341364 - in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 341364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A37A847B8 X-Spamd-Result: default: False [0.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.151,0]; NEURAL_HAM_SHORT(-0.28)[-0.281,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 14:20:33 -0000 Author: mjg Date: Sat Dec 1 14:20:32 2018 New Revision: 341364 URL: https://svnweb.freebsd.org/changeset/base/341364 Log: amd64: align target memmove buffer to 16 bytes before using rep movs See the review for sample test results. Reviewed by: kib (kernel part) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18401 Modified: head/lib/libc/amd64/string/memmove.S head/sys/amd64/amd64/support.S Modified: head/lib/libc/amd64/string/memmove.S ============================================================================== --- head/lib/libc/amd64/string/memmove.S Sat Dec 1 12:08:16 2018 (r341363) +++ head/lib/libc/amd64/string/memmove.S Sat Dec 1 14:20:32 2018 (r341364) @@ -139,6 +139,8 @@ __FBSDID("$FreeBSD$"); ALIGN_TEXT 1256: + testb $15,%dil + jnz 100f .if \erms == 1 rep movsb @@ -146,6 +148,34 @@ __FBSDID("$FreeBSD$"); shrq $3,%rcx /* copy by 64-bit words */ rep movsq + movq %rdx,%rcx + andl $7,%ecx /* any bytes left? */ + jne 100408b +.endif + \end + ret +100: + movq (%rsi),%r8 + movq 8(%rsi),%r9 + movq %rdi,%r10 + movq %rdi,%rcx + andq $15,%rcx + leaq -16(%rdx,%rcx),%rdx + neg %rcx + leaq 16(%rdi,%rcx),%rdi + leaq 16(%rsi,%rcx),%rsi + movq %rdx,%rcx +.if \erms == 1 + rep + movsb + movq %r8,(%r10) + movq %r9,8(%r10) +.else + shrq $3,%rcx /* copy by 64-bit words */ + rep + movsq + movq %r8,(%r10) + movq %r9,8(%r10) movq %rdx,%rcx andl $7,%ecx /* any bytes left? */ jne 100408b Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sat Dec 1 12:08:16 2018 (r341363) +++ head/sys/amd64/amd64/support.S Sat Dec 1 14:20:32 2018 (r341364) @@ -302,6 +302,8 @@ END(memcmp) ALIGN_TEXT 1256: + testb $15,%dil + jnz 100f .if \erms == 1 rep movsb @@ -309,6 +311,34 @@ END(memcmp) shrq $3,%rcx /* copy by 64-bit words */ rep movsq + movq %rdx,%rcx + andl $7,%ecx /* any bytes left? */ + jne 100408b +.endif + \end + ret +100: + movq (%rsi),%r8 + movq 8(%rsi),%r9 + movq %rdi,%r10 + movq %rdi,%rcx + andq $15,%rcx + leaq -16(%rdx,%rcx),%rdx + neg %rcx + leaq 16(%rdi,%rcx),%rdi + leaq 16(%rsi,%rcx),%rsi + movq %rdx,%rcx +.if \erms == 1 + rep + movsb + movq %r8,(%r10) + movq %r9,8(%r10) +.else + shrq $3,%rcx /* copy by 64-bit words */ + rep + movsq + movq %r8,(%r10) + movq %r9,8(%r10) movq %rdx,%rcx andl $7,%ecx /* any bytes left? */ jne 100408b From owner-svn-src-head@freebsd.org Sat Dec 1 16:43:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D44AD13215FC; Sat, 1 Dec 2018 16:43:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9886BB72; Sat, 1 Dec 2018 16:43:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CC471A705; Sat, 1 Dec 2018 16:43:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1GhJWF046596; Sat, 1 Dec 2018 16:43:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1GhI1Q046594; Sat, 1 Dec 2018 16:43:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812011643.wB1GhI1Q046594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Dec 2018 16:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341374 - in head/sys: arm/arm i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: arm/arm i386/i386 X-SVN-Commit-Revision: 341374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B9886BB72 X-Spamd-Result: default: False [-0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; NEURAL_HAM_SHORT(-0.45)[-0.445,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 16:43:20 -0000 Author: kib Date: Sat Dec 1 16:43:18 2018 New Revision: 341374 URL: https://svnweb.freebsd.org/changeset/base/341374 Log: Correct the tunable name in the message. Submitted by: Andre Albsmeier PR: 231577 MFC after: 1 week Modified: head/sys/arm/arm/pmap-v6.c head/sys/i386/i386/pmap.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Dec 1 15:42:02 2018 (r341373) +++ head/sys/arm/arm/pmap-v6.c Sat Dec 1 16:43:18 2018 (r341374) @@ -3037,7 +3037,7 @@ get_pv_entry(pmap_t pmap, boolean_t try) if (ratecheck(&lastprint, &printinterval)) printf("Approaching the limit on PV entries, consider " "increasing either the vm.pmap.shpgperproc or the " - "vm.pmap.pv_entry_max tunable.\n"); + "vm.pmap.pv_entries tunable.\n"); retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Dec 1 15:42:02 2018 (r341373) +++ head/sys/i386/i386/pmap.c Sat Dec 1 16:43:18 2018 (r341374) @@ -2568,7 +2568,7 @@ get_pv_entry(pmap_t pmap, boolean_t try) if (ratecheck(&lastprint, &printinterval)) printf("Approaching the limit on PV entries, consider " "increasing either the vm.pmap.shpgperproc or the " - "vm.pmap.pv_entry_max tunable.\n"); + "vm.pmap.pv_entries tunable.\n"); retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { From owner-svn-src-head@freebsd.org Sat Dec 1 16:50:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDD8A132198C; Sat, 1 Dec 2018 16:50:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 863416C071; Sat, 1 Dec 2018 16:50:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6739B1A711; Sat, 1 Dec 2018 16:50:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1GoDVe047127; Sat, 1 Dec 2018 16:50:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1GoD4x047126; Sat, 1 Dec 2018 16:50:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812011650.wB1GoD4x047126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Dec 2018 16:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341375 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 341375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 863416C071 X-Spamd-Result: default: False [-0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; NEURAL_HAM_SHORT(-0.45)[-0.445,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 16:50:14 -0000 Author: kib Date: Sat Dec 1 16:50:12 2018 New Revision: 341375 URL: https://svnweb.freebsd.org/changeset/base/341375 Log: Allow to create swap zone larger than v_page_count / 2. If user configured the maxswapzone tunable, just take the literal value for the initial zone sizing attempt. Before, it was only possible to reduce the zone by the tunable. While there, correct the message which was not correct when zone creation rounded the size up. Reported by: jmg Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18381 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat Dec 1 16:43:18 2018 (r341374) +++ head/sys/vm/swap_pager.c Sat Dec 1 16:50:12 2018 (r341375) @@ -547,12 +547,12 @@ swap_pager_swap_init(void) mtx_unlock(&pbuf_mtx); /* - * Initialize our zone, guessing on the number we need based - * on the number of pages in the system. + * Initialize our zone, taking the user's requested size or + * estimating the number we need based on the number of pages + * in the system. */ - n = vm_cnt.v_page_count / 2; - if (maxswzone && n > maxswzone / sizeof(struct swblk)) - n = maxswzone / sizeof(struct swblk); + n = maxswzone != 0 ? maxswzone / sizeof(struct swblk) : + vm_cnt.v_page_count / 2; swpctrie_zone = uma_zcreate("swpctrie", pctrie_node_size(), NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); if (swpctrie_zone == NULL) @@ -580,7 +580,7 @@ swap_pager_swap_init(void) n = uma_zone_get_max(swblk_zone); if (n < n2) - printf("Swap blk zone entries reduced from %lu to %lu.\n", + printf("Swap blk zone entries changed from %lu to %lu.\n", n2, n); swap_maxpages = n * SWAP_META_PAGES; swzone = n * sizeof(struct swblk); From owner-svn-src-head@freebsd.org Sat Dec 1 17:59:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7C95132332D; Sat, 1 Dec 2018 17:59:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 681D46DF3E; Sat, 1 Dec 2018 17:59:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 436951B273; Sat, 1 Dec 2018 17:59:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1Hxg9w083144; Sat, 1 Dec 2018 17:59:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1HxgTL083143; Sat, 1 Dec 2018 17:59:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812011759.wB1HxgTL083143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 17:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341377 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 681D46DF3E X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.455,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; NEURAL_SPAM_LONG(0.31)[0.307,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 17:59:43 -0000 Author: cy Date: Sat Dec 1 17:59:41 2018 New Revision: 341377 URL: https://svnweb.freebsd.org/changeset/base/341377 Log: Restore handling of PMTU discovery, removed through an unifdef(1) following the MFV of r254219 into r255332. In addition the 'FreeBSD' macro was never defined in ipfilter 5.1.2 thus it never would have been enabled in the first place. This work is prompted by a general cleanup of the IP Filter code prompted by working to resolve a PR. More to follow. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 17:48:28 2018 (r341376) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 17:59:41 2018 (r341377) @@ -85,6 +85,8 @@ static const char rcsid[] = "@(#)$Id$"; #endif extern int ip_optcopy __P((struct ip *, struct ip *)); +VNET_DECLARE(int, path_mtu_discovery); +#define V_path_mtu_discovery VNET(path_mtu_discovery) # ifdef IPFILTER_M_IPFILTER MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures"); @@ -477,11 +479,7 @@ ipf_send_ip(fin, m) IP_HL_A(ip, sizeof(*oip) >> 2); ip->ip_tos = oip->ip_tos; ip->ip_id = fin->fin_ip->ip_id; -#if defined(FreeBSD) && (__FreeBSD_version > 460000) - ip->ip_off = htons(path_mtu_discovery ? IP_DF : 0); -#else - ip->ip_off = 0; -#endif + ip->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0); ip->ip_ttl = V_ip_defttl; ip->ip_sum = 0; break; From owner-svn-src-head@freebsd.org Sat Dec 1 20:27:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C571132688E; Sat, 1 Dec 2018 20:27:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3E76727C2; Sat, 1 Dec 2018 20:27:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4C961CADD; Sat, 1 Dec 2018 20:27:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1KR0KD059880; Sat, 1 Dec 2018 20:27:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1KQxsF059870; Sat, 1 Dec 2018 20:26:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201812012026.wB1KQxsF059870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 1 Dec 2018 20:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341381 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 341381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3E76727C2 X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_MEDIUM(0.21)[0.206,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.226,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:27:01 -0000 Author: manu Date: Sat Dec 1 20:26:59 2018 New Revision: 341381 URL: https://svnweb.freebsd.org/changeset/base/341381 Log: arm64: rockchip: Add RK3399_CLK_PLL PLLs on the RK3399 are different than the ones on the RK3328. Add a new type and some dedicated recalc and set_freq functions. Rename the RK3328 dedicated rk_clk_pll function with rk3328_ prefix. MFC after: 1 month Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c head/sys/arm64/rockchip/clk/rk_clk_pll.c head/sys/arm64/rockchip/clk/rk_clk_pll.h head/sys/arm64/rockchip/clk/rk_cru.c head/sys/arm64/rockchip/clk/rk_cru.h Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Sat Dec 1 18:23:41 2018 (r341380) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Sat Dec 1 20:26:59 2018 (r341381) @@ -973,23 +973,23 @@ static struct rk_clk_composite_def i2c3 = { static struct rk_clk rk3328_clks[] = { { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &apll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &dpll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &cpll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &gpll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &npll }, Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Sat Dec 1 18:23:41 2018 (r341380) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Sat Dec 1 20:26:59 2018 (r341381) @@ -65,47 +65,7 @@ struct rk_clk_pll_sc { #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) -#define RK_CLK_PLL_FBDIV_OFFSET 0 -#define RK_CLK_PLL_FBDIV_SHIFT 0 -#define RK_CLK_PLL_FBDIV_MASK 0xFFF - -#define RK_CLK_PLL_POSTDIV1_OFFSET 0 -#define RK_CLK_PLL_POSTDIV1_SHIFT 12 -#define RK_CLK_PLL_POSTDIV1_MASK 0x7000 - -#define RK_CLK_PLL_DSMPD_OFFSET 4 -#define RK_CLK_PLL_DSMPD_SHIFT 12 -#define RK_CLK_PLL_DSMPD_MASK 0x1000 - -#define RK_CLK_PLL_REFDIV_OFFSET 4 -#define RK_CLK_PLL_REFDIV_SHIFT 0 -#define RK_CLK_PLL_REFDIV_MASK 0x3F - -#define RK_CLK_PLL_POSTDIV2_OFFSET 4 -#define RK_CLK_PLL_POSTDIV2_SHIFT 6 -#define RK_CLK_PLL_POSTDIV2_MASK 0x1C0 - -#define RK_CLK_PLL_FRAC_OFFSET 8 -#define RK_CLK_PLL_FRAC_SHIFT 0 -#define RK_CLK_PLL_FRAC_MASK 0xFFFFFF - -#define RK_CLK_PLL_LOCK_MASK 0x400 - -#define RK_CLK_PLL_WRITE_MASK 0xFFFF0000 - static int -rk_clk_pll_init(struct clknode *clk, device_t dev) -{ - struct rk_clk_pll_sc *sc; - - sc = clknode_get_softc(clk); - - clknode_init_parent_idx(clk, 0); - - return (0); -} - -static int rk_clk_pll_set_gate(struct clknode *clk, bool enable) { struct rk_clk_pll_sc *sc; @@ -128,10 +88,50 @@ rk_clk_pll_set_gate(struct clknode *clk, bool enable) return (0); } +#define RK3328_CLK_PLL_FBDIV_OFFSET 0 +#define RK3328_CLK_PLL_FBDIV_SHIFT 0 +#define RK3328_CLK_PLL_FBDIV_MASK 0xFFF + +#define RK3328_CLK_PLL_POSTDIV1_OFFSET 0 +#define RK3328_CLK_PLL_POSTDIV1_SHIFT 12 +#define RK3328_CLK_PLL_POSTDIV1_MASK 0x7000 + +#define RK3328_CLK_PLL_DSMPD_OFFSET 4 +#define RK3328_CLK_PLL_DSMPD_SHIFT 12 +#define RK3328_CLK_PLL_DSMPD_MASK 0x1000 + +#define RK3328_CLK_PLL_REFDIV_OFFSET 4 +#define RK3328_CLK_PLL_REFDIV_SHIFT 0 +#define RK3328_CLK_PLL_REFDIV_MASK 0x3F + +#define RK3328_CLK_PLL_POSTDIV2_OFFSET 4 +#define RK3328_CLK_PLL_POSTDIV2_SHIFT 6 +#define RK3328_CLK_PLL_POSTDIV2_MASK 0x1C0 + +#define RK3328_CLK_PLL_FRAC_OFFSET 8 +#define RK3328_CLK_PLL_FRAC_SHIFT 0 +#define RK3328_CLK_PLL_FRAC_MASK 0xFFFFFF + +#define RK3328_CLK_PLL_LOCK_MASK 0x400 + +#define RK3328_CLK_PLL_WRITE_MASK 0xFFFF0000 + static int -rk_clk_pll_recalc(struct clknode *clk, uint64_t *freq) +rk3328_clk_pll_init(struct clknode *clk, device_t dev) { struct rk_clk_pll_sc *sc; + + sc = clknode_get_softc(clk); + + clknode_init_parent_idx(clk, 0); + + return (0); +} + +static int +rk3328_clk_pll_recalc(struct clknode *clk, uint64_t *freq) +{ + struct rk_clk_pll_sc *sc; uint64_t rate; uint32_t dsmpd, refdiv, fbdiv; uint32_t postdiv1, postdiv2, frac; @@ -145,14 +145,14 @@ rk_clk_pll_recalc(struct clknode *clk, uint64_t *freq) READ4(clk, sc->base_offset + 4, &raw2); READ4(clk, sc->base_offset + 8, &raw3); - fbdiv = (raw1 & RK_CLK_PLL_FBDIV_MASK) >> RK_CLK_PLL_FBDIV_SHIFT; - postdiv1 = (raw1 & RK_CLK_PLL_POSTDIV1_MASK) >> RK_CLK_PLL_POSTDIV1_SHIFT; + fbdiv = (raw1 & RK3328_CLK_PLL_FBDIV_MASK) >> RK3328_CLK_PLL_FBDIV_SHIFT; + postdiv1 = (raw1 & RK3328_CLK_PLL_POSTDIV1_MASK) >> RK3328_CLK_PLL_POSTDIV1_SHIFT; - dsmpd = (raw2 & RK_CLK_PLL_DSMPD_MASK) >> RK_CLK_PLL_DSMPD_SHIFT; - refdiv = (raw2 & RK_CLK_PLL_REFDIV_MASK) >> RK_CLK_PLL_REFDIV_SHIFT; - postdiv2 = (raw2 & RK_CLK_PLL_POSTDIV2_MASK) >> RK_CLK_PLL_POSTDIV2_SHIFT; + dsmpd = (raw2 & RK3328_CLK_PLL_DSMPD_MASK) >> RK3328_CLK_PLL_DSMPD_SHIFT; + refdiv = (raw2 & RK3328_CLK_PLL_REFDIV_MASK) >> RK3328_CLK_PLL_REFDIV_SHIFT; + postdiv2 = (raw2 & RK3328_CLK_PLL_POSTDIV2_MASK) >> RK3328_CLK_PLL_POSTDIV2_SHIFT; - frac = (raw3 & RK_CLK_PLL_FRAC_MASK) >> RK_CLK_PLL_FRAC_SHIFT; + frac = (raw3 & RK3328_CLK_PLL_FRAC_MASK) >> RK3328_CLK_PLL_FRAC_SHIFT; DEVICE_UNLOCK(clk); @@ -174,7 +174,7 @@ rk_clk_pll_recalc(struct clknode *clk, uint64_t *freq) } static int -rk_clk_pll_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, +rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, int flags, int *stop) { struct rk_clk_pll_rate *rates; @@ -204,24 +204,24 @@ rk_clk_pll_set_freq(struct clknode *clk, uint64_t fpar /* Setting postdiv1 and fbdiv */ READ4(clk, sc->base_offset, ®); - reg &= ~(RK_CLK_PLL_POSTDIV1_MASK | RK_CLK_PLL_FBDIV_MASK); - reg |= rates->postdiv1 << RK_CLK_PLL_POSTDIV1_SHIFT; - reg |= rates->fbdiv << RK_CLK_PLL_FBDIV_SHIFT; - WRITE4(clk, sc->base_offset, reg | RK_CLK_PLL_WRITE_MASK); + reg &= ~(RK3328_CLK_PLL_POSTDIV1_MASK | RK3328_CLK_PLL_FBDIV_MASK); + reg |= rates->postdiv1 << RK3328_CLK_PLL_POSTDIV1_SHIFT; + reg |= rates->fbdiv << RK3328_CLK_PLL_FBDIV_SHIFT; + WRITE4(clk, sc->base_offset, reg | RK3328_CLK_PLL_WRITE_MASK); /* Setting dsmpd, postdiv2 and refdiv */ READ4(clk, sc->base_offset + 0x4, ®); - reg &= ~(RK_CLK_PLL_DSMPD_MASK | RK_CLK_PLL_POSTDIV2_MASK | - RK_CLK_PLL_REFDIV_MASK); - reg |= rates->dsmpd << RK_CLK_PLL_DSMPD_SHIFT; - reg |= rates->postdiv2 << RK_CLK_PLL_POSTDIV2_SHIFT; - reg |= rates->refdiv << RK_CLK_PLL_REFDIV_SHIFT; - WRITE4(clk, sc->base_offset + 0x4, reg | RK_CLK_PLL_WRITE_MASK); + reg &= ~(RK3328_CLK_PLL_DSMPD_MASK | RK3328_CLK_PLL_POSTDIV2_MASK | + RK3328_CLK_PLL_REFDIV_MASK); + reg |= rates->dsmpd << RK3328_CLK_PLL_DSMPD_SHIFT; + reg |= rates->postdiv2 << RK3328_CLK_PLL_POSTDIV2_SHIFT; + reg |= rates->refdiv << RK3328_CLK_PLL_REFDIV_SHIFT; + WRITE4(clk, sc->base_offset + 0x4, reg | RK3328_CLK_PLL_WRITE_MASK); /* Setting frac */ READ4(clk, sc->base_offset + 0x8, ®); - reg &= ~RK_CLK_PLL_FRAC_MASK; - reg |= rates->frac << RK_CLK_PLL_FRAC_SHIFT; + reg &= ~RK3328_CLK_PLL_FRAC_MASK; + reg |= rates->frac << RK3328_CLK_PLL_FRAC_SHIFT; WRITE4(clk, sc->base_offset + 0x8, reg); /* Setting to normal mode */ @@ -232,7 +232,7 @@ rk_clk_pll_set_freq(struct clknode *clk, uint64_t fpar /* Reading lock */ for (timeout = 1000; timeout; timeout--) { READ4(clk, sc->base_offset + 0x4, ®); - if ((reg & RK_CLK_PLL_LOCK_MASK) == 0) + if ((reg & RK3328_CLK_PLL_LOCK_MASK) == 0) break; DELAY(1); } @@ -243,25 +243,236 @@ rk_clk_pll_set_freq(struct clknode *clk, uint64_t fpar return (0); } -static clknode_method_t rk_clk_pll_clknode_methods[] = { +static clknode_method_t rk3328_clk_pll_clknode_methods[] = { /* Device interface */ - CLKNODEMETHOD(clknode_init, rk_clk_pll_init), + CLKNODEMETHOD(clknode_init, rk3328_clk_pll_init), CLKNODEMETHOD(clknode_set_gate, rk_clk_pll_set_gate), - CLKNODEMETHOD(clknode_recalc_freq, rk_clk_pll_recalc), - CLKNODEMETHOD(clknode_set_freq, rk_clk_pll_set_freq), + CLKNODEMETHOD(clknode_recalc_freq, rk3328_clk_pll_recalc), + CLKNODEMETHOD(clknode_set_freq, rk3328_clk_pll_set_freq), CLKNODEMETHOD_END }; -DEFINE_CLASS_1(rk_clk_pll_clknode, rk_clk_pll_clknode_class, - rk_clk_pll_clknode_methods, sizeof(struct rk_clk_pll_sc), clknode_class); +DEFINE_CLASS_1(rk3328_clk_pll_clknode, rk3328_clk_pll_clknode_class, + rk3328_clk_pll_clknode_methods, sizeof(struct rk_clk_pll_sc), clknode_class); int -rk_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef) +rk3328_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef) { struct clknode *clk; struct rk_clk_pll_sc *sc; - clk = clknode_create(clkdom, &rk_clk_pll_clknode_class, + clk = clknode_create(clkdom, &rk3328_clk_pll_clknode_class, + &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + + sc->base_offset = clkdef->base_offset; + sc->gate_offset = clkdef->gate_offset; + sc->gate_shift = clkdef->gate_shift; + sc->mode_reg = clkdef->mode_reg; + sc->mode_val = clkdef->mode_val; + sc->flags = clkdef->flags; + sc->rates = clkdef->rates; + sc->frac_rates = clkdef->frac_rates; + + clknode_register(clkdom, clk); + + return (0); +} + +#define RK3399_CLK_PLL_FBDIV_OFFSET 0 +#define RK3399_CLK_PLL_FBDIV_SHIFT 0 +#define RK3399_CLK_PLL_FBDIV_MASK 0xFFF + +#define RK3399_CLK_PLL_POSTDIV2_OFFSET 4 +#define RK3399_CLK_PLL_POSTDIV2_SHIFT 12 +#define RK3399_CLK_PLL_POSTDIV2_MASK 0x7000 + +#define RK3399_CLK_PLL_POSTDIV1_OFFSET 4 +#define RK3399_CLK_PLL_POSTDIV1_SHIFT 8 +#define RK3399_CLK_PLL_POSTDIV1_MASK 0x700 + +#define RK3399_CLK_PLL_REFDIV_OFFSET 4 +#define RK3399_CLK_PLL_REFDIV_SHIFT 0 +#define RK3399_CLK_PLL_REFDIV_MASK 0x3F + +#define RK3399_CLK_PLL_FRAC_OFFSET 8 +#define RK3399_CLK_PLL_FRAC_SHIFT 0 +#define RK3399_CLK_PLL_FRAC_MASK 0xFFFFFF + +#define RK3399_CLK_PLL_DSMPD_OFFSET 0xC +#define RK3399_CLK_PLL_DSMPD_SHIFT 3 +#define RK3399_CLK_PLL_DSMPD_MASK 0x8 + +#define RK3399_CLK_PLL_LOCK_OFFSET 8 +#define RK3399_CLK_PLL_LOCK_MASK 0x400 + +#define RK3399_CLK_PLL_MODE_OFFSET 0xC +#define RK3399_CLK_PLL_MODE_MASK 0x300 +#define RK3399_CLK_PLL_MODE_SLOW 0 +#define RK3399_CLK_PLL_MODE_NORMAL 1 +#define RK3399_CLK_PLL_MODE_DEEPSLOW 2 +#define RK3399_CLK_PLL_MODE_SHIFT 8 + +#define RK3399_CLK_PLL_WRITE_MASK 0xFFFF0000 + +static int +rk3399_clk_pll_init(struct clknode *clk, device_t dev) +{ + struct rk_clk_pll_sc *sc; + uint32_t reg; + + sc = clknode_get_softc(clk); + + /* Setting to normal mode */ + READ4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, ®); + reg &= ~RK3399_CLK_PLL_MODE_MASK; + reg |= RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; + WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, + reg | RK3399_CLK_PLL_WRITE_MASK); + + clknode_init_parent_idx(clk, 0); + + return (0); +} + +static int +rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *freq) +{ + struct rk_clk_pll_sc *sc; + uint64_t rate; + uint32_t dsmpd, refdiv, fbdiv; + uint32_t postdiv1, postdiv2, frac; + uint32_t raw1, raw2, raw3, raw4; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->base_offset, &raw1); + READ4(clk, sc->base_offset + 4, &raw2); + READ4(clk, sc->base_offset + 8, &raw3); + READ4(clk, sc->base_offset + 0xC, &raw4); + DEVICE_UNLOCK(clk); + + fbdiv = (raw1 & RK3399_CLK_PLL_FBDIV_MASK) >> RK3399_CLK_PLL_FBDIV_SHIFT; + + postdiv1 = (raw2 & RK3399_CLK_PLL_POSTDIV1_MASK) >> RK3399_CLK_PLL_POSTDIV1_SHIFT; + postdiv2 = (raw2 & RK3399_CLK_PLL_POSTDIV2_MASK) >> RK3399_CLK_PLL_POSTDIV2_SHIFT; + refdiv = (raw2 & RK3399_CLK_PLL_REFDIV_MASK) >> RK3399_CLK_PLL_REFDIV_SHIFT; + + frac = (raw3 & RK3399_CLK_PLL_FRAC_MASK) >> RK3399_CLK_PLL_FRAC_SHIFT; + + dsmpd = (raw4 & RK3399_CLK_PLL_DSMPD_MASK) >> RK3399_CLK_PLL_DSMPD_SHIFT; + + rate = *freq * fbdiv / refdiv; + if (dsmpd == 0) { + /* Fractional mode */ + uint64_t frac_rate; + + frac_rate = *freq * frac / refdiv; + rate += frac_rate >> 24; + } + + *freq = rate / postdiv1 / postdiv2; + + if (*freq % 2) + *freq = *freq + 1; + + return (0); +} + +static int +rk3399_clk_pll_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, + int flags, int *stop) +{ + struct rk_clk_pll_rate *rates; + struct rk_clk_pll_sc *sc; + uint32_t reg; + int timeout; + + sc = clknode_get_softc(clk); + + if (sc->rates) + rates = sc->rates; + else if (sc->frac_rates) + rates = sc->frac_rates; + else + return (EINVAL); + + for (; rates->freq; rates++) { + if (rates->freq == *fout) + break; + } + if (rates->freq == 0) { + *stop = 1; + return (EINVAL); + } + + DEVICE_LOCK(clk); + + /* Setting fbdiv */ + READ4(clk, sc->base_offset, ®); + reg &= ~RK3399_CLK_PLL_FBDIV_MASK; + reg |= rates->fbdiv << RK3399_CLK_PLL_FBDIV_SHIFT; + WRITE4(clk, sc->base_offset, reg | RK3399_CLK_PLL_WRITE_MASK); + + /* Setting postdiv1, postdiv2 and refdiv */ + READ4(clk, sc->base_offset + 0x4, ®); + reg &= ~(RK3399_CLK_PLL_POSTDIV1_MASK | RK3399_CLK_PLL_POSTDIV2_MASK | + RK3399_CLK_PLL_REFDIV_MASK); + reg |= rates->postdiv1 << RK3399_CLK_PLL_POSTDIV1_SHIFT; + reg |= rates->postdiv2 << RK3399_CLK_PLL_POSTDIV2_SHIFT; + reg |= rates->refdiv << RK3399_CLK_PLL_REFDIV_SHIFT; + WRITE4(clk, sc->base_offset + 0x4, reg | RK3399_CLK_PLL_WRITE_MASK); + + /* Setting frac */ + READ4(clk, sc->base_offset + 0x8, ®); + reg &= ~RK3399_CLK_PLL_FRAC_MASK; + reg |= rates->frac << RK3399_CLK_PLL_FRAC_SHIFT; + WRITE4(clk, sc->base_offset + 0x8, reg | RK3399_CLK_PLL_WRITE_MASK); + + /* Setting to normal mode and dsmpd */ + READ4(clk, sc->base_offset + 0xC, ®); + reg &= ~RK3399_CLK_PLL_MODE_MASK; + reg |= RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; + reg |= rates->dsmpd << RK3399_CLK_PLL_DSMPD_SHIFT; + WRITE4(clk, sc->base_offset + 0xC, reg | RK3399_CLK_PLL_WRITE_MASK); + + /* Reading lock */ + for (timeout = 1000; timeout; timeout--) { + READ4(clk, sc->base_offset + RK3399_CLK_PLL_LOCK_OFFSET, ®); + if ((reg & RK3399_CLK_PLL_LOCK_MASK) == 0) + break; + DELAY(1); + } + + DEVICE_UNLOCK(clk); + + *stop = 1; + return (0); +} + +static clknode_method_t rk3399_clk_pll_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, rk3399_clk_pll_init), + CLKNODEMETHOD(clknode_set_gate, rk_clk_pll_set_gate), + CLKNODEMETHOD(clknode_recalc_freq, rk3399_clk_pll_recalc), + CLKNODEMETHOD(clknode_set_freq, rk3399_clk_pll_set_freq), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk3399_clk_pll_clknode, rk3399_clk_pll_clknode_class, + rk3399_clk_pll_clknode_methods, sizeof(struct rk_clk_pll_sc), clknode_class); + +int +rk3399_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef) +{ + struct clknode *clk; + struct rk_clk_pll_sc *sc; + + clk = clknode_create(clkdom, &rk3399_clk_pll_clknode_class, &clkdef->clkdef); if (clk == NULL) return (1); Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.h Sat Dec 1 18:23:41 2018 (r341380) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.h Sat Dec 1 20:26:59 2018 (r341381) @@ -63,6 +63,7 @@ struct rk_clk_pll_def { #define RK_CLK_PLL_MASK 0xFFFF0000 -int rk_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef); +int rk3328_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef); +int rk3399_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef); #endif /* _RK_CLK_PLL_H_ */ Modified: head/sys/arm64/rockchip/clk/rk_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.c Sat Dec 1 18:23:41 2018 (r341380) +++ head/sys/arm64/rockchip/clk/rk_cru.c Sat Dec 1 20:26:59 2018 (r341381) @@ -220,8 +220,11 @@ rk_cru_attach(device_t dev) switch (sc->clks[i].type) { case RK_CLK_UNDEFINED: break; - case RK_CLK_PLL: - rk_clk_pll_register(sc->clkdom, sc->clks[i].clk.pll); + case RK3328_CLK_PLL: + rk3328_clk_pll_register(sc->clkdom, sc->clks[i].clk.pll); + break; + case RK3399_CLK_PLL: + rk3399_clk_pll_register(sc->clkdom, sc->clks[i].clk.pll); break; case RK_CLK_COMPOSITE: rk_clk_composite_register(sc->clkdom, Modified: head/sys/arm64/rockchip/clk/rk_cru.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.h Sat Dec 1 18:23:41 2018 (r341380) +++ head/sys/arm64/rockchip/clk/rk_cru.h Sat Dec 1 20:26:59 2018 (r341381) @@ -61,7 +61,8 @@ struct rk_cru_gate { enum rk_clk_type { RK_CLK_UNDEFINED = 0, - RK_CLK_PLL, + RK3328_CLK_PLL, + RK3399_CLK_PLL, RK_CLK_COMPOSITE, RK_CLK_MUX, RK_CLK_ARMCLK, From owner-svn-src-head@freebsd.org Sat Dec 1 20:28:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AEE313268FD; Sat, 1 Dec 2018 20:28:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D050B72929; Sat, 1 Dec 2018 20:28:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13A91CADE; Sat, 1 Dec 2018 20:28:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1KSGmM059973; Sat, 1 Dec 2018 20:28:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1KSGh6059970; Sat, 1 Dec 2018 20:28:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201812012028.wB1KSGh6059970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 1 Dec 2018 20:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341382 - in head/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf X-SVN-Commit-Revision: 341382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D050B72929 X-Spamd-Result: default: False [0.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.23)[0.230,0]; NEURAL_SPAM_MEDIUM(0.26)[0.259,0]; NEURAL_SPAM_LONG(0.39)[0.391,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:28:17 -0000 Author: manu Date: Sat Dec 1 20:28:16 2018 New Revision: 341382 URL: https://svnweb.freebsd.org/changeset/base/341382 Log: arm64/rockchip: add RK3399 support Add CRU (Clock and Reset Unit) driver for RK3399. Add support in rk_pinctrl driver. Submitted by: Greg V (Original version) Differential Revision: https://reviews.freebsd.org/D16732 MFC after: 1 month Added: head/sys/arm64/rockchip/clk/rk3399_cru.c (contents, props changed) head/sys/arm64/rockchip/clk/rk3399_pmucru.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/arm64/rockchip/if_dwc_rk.c head/sys/arm64/rockchip/rk_grf.c head/sys/arm64/rockchip/rk_pinctrl.c head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Dec 1 20:26:59 2018 (r341381) +++ head/sys/arm64/conf/GENERIC Sat Dec 1 20:28:16 2018 (r341382) @@ -108,6 +108,7 @@ options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 options SOC_BRCM_BCM2837 options SOC_ROCKCHIP_RK3328 +options SOC_ROCKCHIP_RK3399 options SOC_XILINX_ZYNQ # Timer drivers Added: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Sat Dec 1 20:28:16 2018 (r341382) @@ -0,0 +1,1535 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * Copyright (c) 2018 Greg V + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +/* GATES */ + +#define PCLK_GPIO2 336 +#define PCLK_GPIO3 337 +#define PCLK_GPIO4 338 +#define PCLK_I2C1 341 +#define PCLK_I2C2 342 +#define PCLK_I2C3 343 +#define PCLK_I2C5 344 +#define PCLK_I2C6 345 +#define PCLK_I2C7 346 + +static struct rk_cru_gate rk3399_gates[] = { + /* CRU_CLKGATE_CON0 */ + CRU_GATE(0, "clk_core_l_lpll_src", "lpll", 0x300, 0) + CRU_GATE(0, "clk_core_l_bpll_src", "bpll", 0x300, 1) + CRU_GATE(0, "clk_core_l_dpll_src", "dpll", 0x300, 2) + CRU_GATE(0, "clk_core_l_gpll_src", "gpll", 0x300, 3) + + /* CRU_CLKGATE_CON1 */ + CRU_GATE(0, "clk_core_b_lpll_src", "lpll", 0x304, 0) + CRU_GATE(0, "clk_core_b_bpll_src", "bpll", 0x304, 1) + CRU_GATE(0, "clk_core_b_dpll_src", "dpll", 0x304, 2) + CRU_GATE(0, "clk_core_b_gpll_src", "gpll", 0x304, 3) + + /* CRU_CLKGATE_CON5 */ + CRU_GATE(0, "cpll_aclk_perihp_src", "cpll", 0x314, 0) + CRU_GATE(0, "gpll_aclk_perihp_src", "gpll", 0x314, 1) + + /* CRU_CLKGATE_CON7 */ + CRU_GATE(0, "gpll_aclk_perilp0_src", "gpll", 0x31C, 0) + CRU_GATE(0, "cpll_aclk_perilp0_src", "cpll", 0x31C, 1) + + /* CRU_CLKGATE_CON8 */ + CRU_GATE(0, "hclk_perilp1_cpll_src", "cpll", 0x320, 1) + CRU_GATE(0, "hclk_perilp1_gpll_src", "gpll", 0x320, 0) + + /* CRU_CLKGATE_CON22 */ + CRU_GATE(PCLK_I2C7, "pclk_rki2c7", "pclk_perilp1", 0x358, 5) + CRU_GATE(PCLK_I2C1, "pclk_rki2c1", "pclk_perilp1", 0x358, 6) + CRU_GATE(PCLK_I2C5, "pclk_rki2c5", "pclk_perilp1", 0x358, 7) + CRU_GATE(PCLK_I2C6, "pclk_rki2c6", "pclk_perilp1", 0x358, 8) + CRU_GATE(PCLK_I2C2, "pclk_rki2c2", "pclk_perilp1", 0x358, 9) + CRU_GATE(PCLK_I2C3, "pclk_rki2c3", "pclk_perilp1", 0x358, 10) + + /* CRU_CLKGATE_CON31 */ + CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_alive", 0x37c, 3) + CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4) + CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5) +}; + + +/* + * PLLs + */ + +#define PLL_APLLL 1 +#define PLL_APLLB 2 +#define PLL_DPLL 3 +#define PLL_CPLL 4 +#define PLL_GPLL 5 +#define PLL_NPLL 6 +#define PLL_VPLL 7 + +static struct rk_clk_pll_rate rk3399_pll_rates[] = { + { + .freq = 2208000000, + .refdiv = 1, + .fbdiv = 92, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2184000000, + .refdiv = 1, + .fbdiv = 91, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2160000000, + .refdiv = 1, + .fbdiv = 90, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2136000000, + .refdiv = 1, + .fbdiv = 89, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2112000000, + .refdiv = 1, + .fbdiv = 88, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2088000000, + .refdiv = 1, + .fbdiv = 87, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2064000000, + .refdiv = 1, + .fbdiv = 86, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2040000000, + .refdiv = 1, + .fbdiv = 85, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2016000000, + .refdiv = 1, + .fbdiv = 84, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1992000000, + .refdiv = 1, + .fbdiv = 83, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1968000000, + .refdiv = 1, + .fbdiv = 82, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1944000000, + .refdiv = 1, + .fbdiv = 81, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1920000000, + .refdiv = 1, + .fbdiv = 80, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1896000000, + .refdiv = 1, + .fbdiv = 79, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1872000000, + .refdiv = 1, + .fbdiv = 78, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1848000000, + .refdiv = 1, + .fbdiv = 77, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1824000000, + .refdiv = 1, + .fbdiv = 76, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1800000000, + .refdiv = 1, + .fbdiv = 75, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1776000000, + .refdiv = 1, + .fbdiv = 74, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1752000000, + .refdiv = 1, + .fbdiv = 73, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1728000000, + .refdiv = 1, + .fbdiv = 72, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1704000000, + .refdiv = 1, + .fbdiv = 71, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1680000000, + .refdiv = 1, + .fbdiv = 70, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1656000000, + .refdiv = 1, + .fbdiv = 69, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1632000000, + .refdiv = 1, + .fbdiv = 68, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1608000000, + .refdiv = 1, + .fbdiv = 67, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1600000000, + .refdiv = 3, + .fbdiv = 200, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1584000000, + .refdiv = 1, + .fbdiv = 66, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1560000000, + .refdiv = 1, + .fbdiv = 65, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1536000000, + .refdiv = 1, + .fbdiv = 64, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1512000000, + .refdiv = 1, + .fbdiv = 63, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1488000000, + .refdiv = 1, + .fbdiv = 62, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1464000000, + .refdiv = 1, + .fbdiv = 61, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1440000000, + .refdiv = 1, + .fbdiv = 60, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1416000000, + .refdiv = 1, + .fbdiv = 59, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1392000000, + .refdiv = 1, + .fbdiv = 58, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1368000000, + .refdiv = 1, + .fbdiv = 57, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1344000000, + .refdiv = 1, + .fbdiv = 56, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1320000000, + .refdiv = 1, + .fbdiv = 55, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1296000000, + .refdiv = 1, + .fbdiv = 54, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1272000000, + .refdiv = 1, + .fbdiv = 53, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1248000000, + .refdiv = 1, + .fbdiv = 52, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1200000000, + .refdiv = 1, + .fbdiv = 50, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1188000000, + .refdiv = 2, + .fbdiv = 99, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1104000000, + .refdiv = 1, + .fbdiv = 46, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1100000000, + .refdiv = 12, + .fbdiv = 550, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1008000000, + .refdiv = 1, + .fbdiv = 84, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1000000000, + .refdiv = 1, + .fbdiv = 125, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 984000000, + .refdiv = 1, + .fbdiv = 82, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 960000000, + .refdiv = 1, + .fbdiv = 80, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 936000000, + .refdiv = 1, + .fbdiv = 78, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 912000000, + .refdiv = 1, + .fbdiv = 76, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 900000000, + .refdiv = 4, + .fbdiv = 300, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 888000000, + .refdiv = 1, + .fbdiv = 74, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 864000000, + .refdiv = 1, + .fbdiv = 72, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 840000000, + .refdiv = 1, + .fbdiv = 70, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 816000000, + .refdiv = 1, + .fbdiv = 68, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 800000000, + .refdiv = 1, + .fbdiv = 100, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 700000000, + .refdiv = 6, + .fbdiv = 350, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 696000000, + .refdiv = 1, + .fbdiv = 58, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 676000000, + .refdiv = 3, + .fbdiv = 169, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 600000000, + .refdiv = 1, + .fbdiv = 75, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 594000000, + .refdiv = 1, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 533250000, + .refdiv = 8, + .fbdiv = 711, + .postdiv1 = 4, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 504000000, + .refdiv = 1, + .fbdiv = 63, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 500000000, + .refdiv = 6, + .fbdiv = 250, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 408000000, + .refdiv = 1, + .fbdiv = 68, + .postdiv1 = 2, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 312000000, + .refdiv = 1, + .fbdiv = 52, + .postdiv1 = 2, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 297000000, + .refdiv = 1, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 216000000, + .refdiv = 1, + .fbdiv = 72, + .postdiv1 = 4, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 148500000, + .refdiv = 1, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 106500000, + .refdiv = 1, + .fbdiv = 71, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 96000000, + .refdiv = 1, + .fbdiv = 64, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 74250000, + .refdiv = 2, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 65000000, + .refdiv = 1, + .fbdiv = 65, + .postdiv1 = 6, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 54000000, + .refdiv = 1, + .fbdiv = 54, + .postdiv1 = 6, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 27000000, + .refdiv = 1, + .fbdiv = 27, + .postdiv1 = 6, + .postdiv2 = 4, + .dsmpd = 1, + }, + {}, +}; + +static const char *pll_parents[] = {"xin24m"}; + +static struct rk_clk_pll_def lpll = { + .clkdef = { + .id = PLL_APLLL, + .name = "lpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x00, + .gate_offset = 0x300, + .gate_shift = 0, + .flags = RK_CLK_PLL_HAVE_GATE, + .rates = rk3399_pll_rates, +}; + +static struct rk_clk_pll_def bpll = { + .clkdef = { + .id = PLL_APLLB, + .name = "bpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x20, + .gate_offset = 0x300, + .gate_shift = 1, + .flags = RK_CLK_PLL_HAVE_GATE, + .rates = rk3399_pll_rates, +}; + +static struct rk_clk_pll_def dpll = { + .clkdef = { + .id = PLL_DPLL, + .name = "dpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x40, + .gate_offset = 0x300, + .gate_shift = 2, + .flags = RK_CLK_PLL_HAVE_GATE, + .rates = rk3399_pll_rates, +}; + + +static struct rk_clk_pll_def cpll = { + .clkdef = { + .id = PLL_CPLL, + .name = "cpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x60, + .rates = rk3399_pll_rates, +}; + +static struct rk_clk_pll_def gpll = { + .clkdef = { + .id = PLL_GPLL, + .name = "gpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x80, + .gate_offset = 0x300, + .gate_shift = 3, + .flags = RK_CLK_PLL_HAVE_GATE, + .rates = rk3399_pll_rates, +}; + +static struct rk_clk_pll_def npll = { + .clkdef = { + .id = PLL_NPLL, + .name = "npll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0xa0, + .rates = rk3399_pll_rates, +}; + +static struct rk_clk_pll_def vpll = { + .clkdef = { + .id = PLL_VPLL, + .name = "vpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0xc0, + .rates = rk3399_pll_rates, +}; + +#define ACLK_PERIHP 192 +#define HCLK_PERIHP 448 +#define PCLK_PERIHP 320 + +static const char *aclk_perihp_parents[] = {"cpll_aclk_perihp_src", "gpll_aclk_perihp_src"}; + +static struct rk_clk_composite_def aclk_perihp = { + .clkdef = { + .id = ACLK_PERIHP, + .name = "aclk_perihp", + .parent_names = aclk_perihp_parents, + .parent_cnt = nitems(aclk_perihp_parents), + }, + /* CRU_CLKSEL_CON14 */ + .muxdiv_offset = 0x138, + + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 5, + + /* CRU_CLKGATE_CON5 */ + .gate_offset = 0x314, + .gate_shift = 2, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static const char *hclk_pclk_perihp_parents[] = {"aclk_perihp"}; + +static struct rk_clk_composite_def hclk_perihp = { + .clkdef = { + .id = HCLK_PERIHP, + .name = "hclk_perihp", + .parent_names = hclk_pclk_perihp_parents, + .parent_cnt = nitems(hclk_pclk_perihp_parents), + }, + /* CRU_CLKSEL_CON14 */ + .muxdiv_offset = 0x138, + + .div_shift = 8, + .div_width = 2, + + /* CRU_CLKGATE_CON5 */ + .gate_offset = 0x314, + .gate_shift = 3, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk_composite_def pclk_perihp = { + .clkdef = { + .id = PCLK_PERIHP, + .name = "pclk_perihp", + .parent_names = hclk_pclk_perihp_parents, + .parent_cnt = nitems(hclk_pclk_perihp_parents), + }, + /* CRU_CLKSEL_CON14 */ + .muxdiv_offset = 0x138, + + .div_shift = 12, + .div_width = 3, + + /* CRU_CLKGATE_CON5 */ + .gate_offset = 0x314, + .gate_shift = 4, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +#define ACLK_PERILP0 194 +#define HCLK_PERILP0 449 +#define PCLK_PERILP0 322 + +static const char *aclk_perilp0_parents[] = {"cpll_aclk_perilp0_src", "gpll_aclk_perilp0_src"}; + +static struct rk_clk_composite_def aclk_perilp0 = { + .clkdef = { + .id = ACLK_PERILP0, + .name = "aclk_perilp0", + .parent_names = aclk_perilp0_parents, + .parent_cnt = nitems(aclk_perilp0_parents), + }, + /* CRU_CLKSEL_CON14 */ + .muxdiv_offset = 0x15C, + + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 5, + + /* CRU_CLKGATE_CON7 */ + .gate_offset = 0x31C, + .gate_shift = 2, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static const char *hclk_pclk_perilp0_parents[] = {"aclk_perilp0"}; + +static struct rk_clk_composite_def hclk_perilp0 = { + .clkdef = { + .id = HCLK_PERILP0, + .name = "hclk_perilp0", + .parent_names = hclk_pclk_perilp0_parents, + .parent_cnt = nitems(hclk_pclk_perilp0_parents), + }, + /* CRU_CLKSEL_CON23 */ + .muxdiv_offset = 0x15C, + + .div_shift = 8, + .div_width = 2, + + /* CRU_CLKGATE_CON7 */ + .gate_offset = 0x31C, + .gate_shift = 3, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk_composite_def pclk_perilp0 = { + .clkdef = { + .id = PCLK_PERILP0, + .name = "pclk_perilp0", + .parent_names = hclk_pclk_perilp0_parents, + .parent_cnt = nitems(hclk_pclk_perilp0_parents), + }, + /* CRU_CLKSEL_CON23 */ + .muxdiv_offset = 0x15C, + + .div_shift = 12, + .div_width = 3, + + /* CRU_CLKGATE_CON7 */ + .gate_offset = 0x31C, + .gate_shift = 4, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +/* + * misc + */ +#define PCLK_ALIVE 390 + +static const char *alive_parents[] = {"gpll"}; + +static struct rk_clk_composite_def pclk_alive = { + .clkdef = { + .id = PCLK_ALIVE, + .name = "pclk_alive", + .parent_names = alive_parents, + .parent_cnt = nitems(alive_parents), + }, + /* CRU_CLKSEL_CON57 */ + .muxdiv_offset = 0x01e4, + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Dec 1 20:29:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 353F613269AD; Sat, 1 Dec 2018 20:29:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFE1972ABE; Sat, 1 Dec 2018 20:29:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADAF21CAE8; Sat, 1 Dec 2018 20:29:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1KTgfY060078; Sat, 1 Dec 2018 20:29:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1KTgxb060077; Sat, 1 Dec 2018 20:29:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201812012029.wB1KTgxb060077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 1 Dec 2018 20:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341383 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 341383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFE1972ABE X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.218,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:29:43 -0000 Author: manu Date: Sat Dec 1 20:29:42 2018 New Revision: 341383 URL: https://svnweb.freebsd.org/changeset/base/341383 Log: arm64: rockchip: rk_i2c: Use correct clock While here add RK3399 support and call clk_set_assigned to set the correct clock set in the DTS. MFC after: 1 month Modified: head/sys/arm64/rockchip/rk_i2c.c Modified: head/sys/arm64/rockchip/rk_i2c.c ============================================================================== --- head/sys/arm64/rockchip/rk_i2c.c Sat Dec 1 20:28:16 2018 (r341382) +++ head/sys/arm64/rockchip/rk_i2c.c Sat Dec 1 20:29:42 2018 (r341383) @@ -146,6 +146,9 @@ static struct ofw_compat_data compat_data[] = { #ifdef SOC_ROCKCHIP_RK3328 {"rockchip,rk3328-i2c", 1}, #endif +#ifdef SOC_ROCKCHIP_RK3399 + {"rockchip,rk3399-i2c", 1}, +#endif {NULL, 0} }; @@ -168,15 +171,15 @@ static int rk_i2c_detach(device_t dev); static uint32_t rk_i2c_get_clkdiv(struct rk_i2c_softc *sc, uint64_t speed) { - uint64_t pclk_freq; + uint64_t sclk_freq; uint32_t clkdiv; int err; - err = clk_get_freq(sc->pclk, &pclk_freq); + err = clk_get_freq(sc->sclk, &sclk_freq); if (err != 0) return (err); - clkdiv = (pclk_freq / speed / RK_I2C_CLKDIV_MUL / 2) - 1; + clkdiv = (sclk_freq / speed / RK_I2C_CLKDIV_MUL / 2) - 1; clkdiv &= RK_I2C_CLKDIVL_MASK; clkdiv = clkdiv << RK_I2C_CLKDIVH_SHIFT | clkdiv; @@ -417,7 +420,6 @@ rk_i2c_transfer(device_t dev, struct iic_msg *msgs, ui /* Write slave address */ reg = msgs[i].slave | RK_I2C_MRXADDR_VALID(0); RK_I2C_WRITE(sc, RK_I2C_MRXADDR, reg); - /* Write slave register address */ for (j = 0, reg = 0; j < msgs[i].len; j++) { reg |= (msgs[i].buf[j] & 0xff) << (j * 8); @@ -508,6 +510,8 @@ rk_i2c_attach(device_t dev) device_printf(dev, "cannot setup interrupt handler\n"); return (ENXIO); } + + clk_set_assigned(dev, ofw_bus_get_node(dev)); /* Activate the module clocks. */ error = clk_get_by_ofw_name(dev, 0, "i2c", &sc->sclk); From owner-svn-src-head@freebsd.org Sat Dec 1 20:30:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB0C71326A03; Sat, 1 Dec 2018 20:30:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 519AE72C0B; Sat, 1 Dec 2018 20:30:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32B7D1CAEC; Sat, 1 Dec 2018 20:30:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1KUJWt060174; Sat, 1 Dec 2018 20:30:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1KUJC3060173; Sat, 1 Dec 2018 20:30:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812012030.wB1KUJC3060173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 1 Dec 2018 20:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341384 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 519AE72C0B X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.22)[0.218,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; NEURAL_SPAM_LONG(0.31)[0.307,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:30:19 -0000 Author: cy Date: Sat Dec 1 20:30:18 2018 New Revision: 341384 URL: https://svnweb.freebsd.org/changeset/base/341384 Log: Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX is dead). This includes collaterally removing code shared by HP/UX, SGI, and Linux, where IP Filter will in all likelihood for various reasons never run again. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_log.c Modified: head/sys/contrib/ipfilter/netinet/ip_log.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec 1 20:29:42 2018 (r341383) +++ head/sys/contrib/ipfilter/netinet/ip_log.c Sat Dec 1 20:30:18 2018 (r341384) @@ -97,14 +97,8 @@ struct file; #include #ifdef __sgi # include -# ifdef IFF_DRVRLOCK /* IRIX6 */ -# include -# endif #endif -#if !defined(__hpux) && !defined(linux) && \ - !(defined(__sgi) && !defined(IFF_DRVRLOCK)) /*IRIX<6*/ # include -#endif #include #include #include From owner-svn-src-head@freebsd.org Sat Dec 1 20:31:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F40981326B09; Sat, 1 Dec 2018 20:31:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6505E72F0A; Sat, 1 Dec 2018 20:31:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 453BE1CC04; Sat, 1 Dec 2018 20:31:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1KV6wL060254; Sat, 1 Dec 2018 20:31:06 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1KV5OC060252; Sat, 1 Dec 2018 20:31:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201812012031.wB1KV5OC060252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 1 Dec 2018 20:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341385 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 341385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6505E72F0A X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.22)[0.222,0]; NEURAL_SPAM_MEDIUM(0.15)[0.151,0]; NEURAL_SPAM_LONG(0.34)[0.335,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:31:07 -0000 Author: manu Date: Sat Dec 1 20:31:05 2018 New Revision: 341385 URL: https://svnweb.freebsd.org/changeset/base/341385 Log: arm64: rockchip: rk805: Add basic support for RK808 PMIC RK808 PMIC is the companion chip for RK3399 SoC. Add basic regulator support in RK805 since they are similar. MFC after: 1 month Modified: head/sys/arm64/rockchip/rk805.c head/sys/arm64/rockchip/rk805reg.h Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Sat Dec 1 20:30:18 2018 (r341384) +++ head/sys/arm64/rockchip/rk805.c Sat Dec 1 20:31:05 2018 (r341385) @@ -51,8 +51,14 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); +enum rk_pmic_type { + RK805 = 1, + RK808, +}; + static struct ofw_compat_data compat_data[] = { - {"rockchip,rk805", 1}, + {"rockchip,rk805", RK805}, + {"rockchip,rk808", RK808}, {NULL, 0} }; @@ -83,6 +89,7 @@ struct rk805_softc { struct resource * res[1]; void * intrcookie; struct intr_config_hook intr_hook; + enum rk_pmic_type type; struct rk805_reg_sc **regs; int nregs; @@ -133,6 +140,51 @@ static struct rk805_regdef rk805_regdefs[] = { }, }; +static struct rk805_regdef rk808_regdefs[] = { + { + .id = RK805_DCDC1, + .name = "DCDC_REG1", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x1, + .voltage_reg = RK805_DCDC1_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1500000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + .id = RK805_DCDC2, + .name = "DCDC_REG2", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x2, + .voltage_reg = RK805_DCDC2_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1500000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + .id = RK805_DCDC3, + .name = "DCDC_REG3", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x4, + }, + { + .id = RK805_DCDC4, + .name = "DCDC_REG4", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x8, + .voltage_reg = RK805_DCDC4_ON_VSEL, + .voltage_mask = 0xF, + .voltage_min = 1800000, + .voltage_max = 3300000, + .voltage_step = 100000, + .voltage_nstep = 16, + }, +}; + static int rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { @@ -226,11 +278,17 @@ rk805_regnode_set_voltage(struct regnode *regnode, int if (!sc->def->voltage_step) return (ENXIO); + rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + printf("rk805_set_voltage: Current value for %x: %x\n", sc->def->voltage_reg, val); if (rk805_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) return (ERANGE); + printf("rk805_set_voltage: Setting %x to %x\n", sc->def->voltage_reg, val); rk805_write(sc->base_dev, sc->def->voltage_reg, val); + rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + printf("rk805_set_voltage: Set value for %x: %x\n", sc->def->voltage_reg, val); + *udelay = 0; return (0); @@ -326,13 +384,14 @@ rk805_start(void *pdev) sc = device_get_softc(dev); sc->dev = dev; - if (bootverbose) { - err = rk805_read(dev, 0x17, data, 1); + /* No version register in RK808 */ + if (bootverbose && sc->type == RK805) { + err = rk805_read(dev, RK805_CHIP_NAME, data, 1); if (err != 0) { device_printf(dev, "Cannot read chip name reg\n"); return; } - err = rk805_read(dev, 0x18, data + 1, 1); + err = rk805_read(dev, RK805_CHIP_VER, data + 1, 1); if (err != 0) { device_printf(dev, "Cannot read chip version reg\n"); return; @@ -365,8 +424,17 @@ rk805_attach(device_t dev) sc->regs = malloc(sizeof(struct rk805_reg_sc *) * sc->nregs, M_RK805_REG, M_WAITOK | M_ZERO); - regdefs = rk805_regdefs; - sc->nregs = nitems(rk805_regdefs); + sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + switch (sc->type) { + case RK805: + regdefs = rk805_regdefs; + sc->nregs = nitems(rk805_regdefs); + break; + case RK808: + regdefs = rk808_regdefs; + sc->nregs = nitems(rk808_regdefs); + break; + } rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); if (rnode > 0) { Modified: head/sys/arm64/rockchip/rk805reg.h ============================================================================== --- head/sys/arm64/rockchip/rk805reg.h Sat Dec 1 20:30:18 2018 (r341384) +++ head/sys/arm64/rockchip/rk805reg.h Sat Dec 1 20:31:05 2018 (r341385) @@ -37,6 +37,7 @@ #define RK805_OTP_VER 0x19 #define RK805_DCDC_EN 0x23 +#define RK808_LDO_EN 0x24 #define RK805_SLEEP_DCDC_EN 0x25 #define RK805_SLEEP_LDO_EN 0x26 #define RK805_LDO_EN 0x27 @@ -67,6 +68,23 @@ enum rk805_regulator { RK805_LDO1, RK805_LDO2, RK805_LDO3, +}; + +enum rk808_regulator { + RK808_DCDC1, + RK808_DCDC2, + RK808_DCDC3, + RK808_DCDC4, + RK808_LDO1, + RK808_LDO2, + RK808_LDO3, + RK808_LDO4, + RK808_LDO5, + RK808_LDO6, + RK808_LDO7, + RK808_LDO8, + RK808_SWITCH1, + RK808_SWITCH2, }; #endif /* _RK805REG_H_ */ From owner-svn-src-head@freebsd.org Sat Dec 1 20:31:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D9901326CC6; Sat, 1 Dec 2018 20:31:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFD6C731CF; Sat, 1 Dec 2018 20:31:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A29E61CC42; Sat, 1 Dec 2018 20:31:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1KVo8B063673; Sat, 1 Dec 2018 20:31:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1KVoAr063670; Sat, 1 Dec 2018 20:31:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201812012031.wB1KVoAr063670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 1 Dec 2018 20:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341386 - in head/sys: arm64/conf conf dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/iicbus X-SVN-Commit-Revision: 341386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFD6C731CF X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.36)[0.363,0]; NEURAL_SPAM_SHORT(0.23)[0.226,0]; NEURAL_SPAM_MEDIUM(0.21)[0.206,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:31:51 -0000 Author: manu Date: Sat Dec 1 20:31:49 2018 New Revision: 341386 URL: https://svnweb.freebsd.org/changeset/base/341386 Log: Add Silergy SYR827 PMIC driver SYR827 is a PMIC that can output a voltage from 0.7125V to 1.5V in 12.5mV steps It's controlled via I2C. MFC after: 1 month Added: head/sys/dev/iicbus/syr827.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Dec 1 20:31:05 2018 (r341385) +++ head/sys/arm64/conf/GENERIC Sat Dec 1 20:31:49 2018 (r341386) @@ -211,6 +211,7 @@ device iicbus device iic device twsi # Allwinner I2C controller device rk_i2c # RockChip I2C controller +device syr827 # Silergy SYR827 PMIC # Clock and reset controllers device aw_ccu # Allwinner clock controller Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 1 20:31:05 2018 (r341385) +++ head/sys/conf/files Sat Dec 1 20:31:49 2018 (r341386) @@ -1826,6 +1826,7 @@ dev/iicbus/ds13rtc.c optional ds13rtc | ds133x | ds13 dev/iicbus/ds1672.c optional ds1672 dev/iicbus/ds3231.c optional ds3231 dev/iicbus/rtc8583.c optional rtc8583 +dev/iicbus/syr827.c optional ext_resources syr827 dev/iicbus/icee.c optional icee dev/iicbus/if_ic.c optional ic dev/iicbus/iic.c optional iic Added: head/sys/dev/iicbus/syr827.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/syr827.c Sat Dec 1 20:31:49 2018 (r341386) @@ -0,0 +1,354 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016 Jared McNeill + * Copyright (c) 2018 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "iicbus_if.h" +#include "regdev_if.h" + +#define VSEL0 0x00 +#define VSEL1 0x01 + +#define VSEL_BUCK_EN (1 << 7) +#define VSEL_NSEL_MASK 0x3F +#define VSEL_VOLTAGE_BASE 712500 /* uV */ +#define VSEL_VOLTAGE_STEP 12500 /* uV */ + +#define ID1 0x03 +#define ID1_VENDOR_MASK 0xE0 +#define ID1_VENDOR_SHIFT 5 +#define ID1_DIE_MASK 0xF + +#define ID2 0x4 +#define ID2_DIE_REV_MASK 0xF + +static struct ofw_compat_data compat_data[] = { + { "silergy,syr827", 1 }, + { NULL, 0 } +}; + +struct syr827_reg_sc { + struct regnode *regnode; + device_t base_dev; + phandle_t xref; + struct regnode_std_param *param; + + int volt_reg; + int suspend_reg; +}; + +struct syr827_softc { + uint16_t addr; + struct intr_config_hook intr_hook; + + /* Regulator */ + struct syr827_reg_sc *reg; +}; + +static int +syr827_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + struct syr827_softc *sc; + struct iic_msg msg[2]; + + sc = device_get_softc(dev); + + msg[0].slave = sc->addr; + msg[0].flags = IIC_M_WR; + msg[0].len = 1; + msg[0].buf = ® + + msg[1].slave = sc->addr; + msg[1].flags = IIC_M_RD; + msg[1].len = size; + msg[1].buf = data; + + return (iicbus_transfer(dev, msg, 2)); +} + +static int +syr827_write(device_t dev, uint8_t reg, uint8_t val) +{ + struct syr827_softc *sc; + struct iic_msg msg; + uint8_t buffer[2]; + + sc = device_get_softc(dev); + + buffer[0] = reg; + buffer[1] = val; + + msg.slave = sc->addr; + msg.flags = IIC_M_WR; + msg.len = 2; + msg.buf = buffer; + + return (iicbus_transfer(dev, &msg, 1)); +} + +static int +syr827_regnode_init(struct regnode *regnode) +{ + return (0); +} + +static int +syr827_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct syr827_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + syr827_read(sc->base_dev, sc->volt_reg, &val, 1); + if (enable) + val &= ~VSEL_BUCK_EN; + else + val |= VSEL_BUCK_EN; + syr827_write(sc->base_dev, sc->volt_reg, val); + + *udelay = sc->param->ramp_delay; + + return (0); +} + +static int +syr827_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct syr827_reg_sc *sc; + int cur_uvolt; + uint8_t val; + + sc = regnode_get_softc(regnode); + + /* Get current voltage */ + syr827_read(sc->base_dev, sc->volt_reg, &val, 1); + cur_uvolt = (val & VSEL_NSEL_MASK) * VSEL_VOLTAGE_STEP + + VSEL_VOLTAGE_BASE; + + /* Set new voltage */ + val &= ~VSEL_NSEL_MASK; + val |= ((min_uvolt - VSEL_VOLTAGE_BASE) / VSEL_VOLTAGE_STEP); + syr827_write(sc->base_dev, sc->volt_reg, val); + + /* Time to delay is based on the number of voltage steps */ + *udelay = sc->param->ramp_delay * + (abs(cur_uvolt - min_uvolt) / VSEL_VOLTAGE_STEP); + + return (0); +} + +static int +syr827_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct syr827_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + syr827_read(sc->base_dev, sc->volt_reg, &val, 1); + *uvolt = (val & VSEL_NSEL_MASK) * VSEL_VOLTAGE_STEP + + VSEL_VOLTAGE_BASE; + + return (0); +} + +static regnode_method_t syr827_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, syr827_regnode_init), + REGNODEMETHOD(regnode_enable, syr827_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, syr827_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, syr827_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(syr827_regnode, syr827_regnode_class, syr827_regnode_methods, + sizeof(struct syr827_reg_sc), regnode_class); + +static struct syr827_reg_sc * +syr827_reg_attach(device_t dev, phandle_t node) +{ + struct syr827_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + int suspend_reg; + + memset(&initdef, 0, sizeof(initdef)); + regulator_parse_ofw_stdparam(dev, node, &initdef); + initdef.id = 0; + initdef.ofw_node = node; + regnode = regnode_create(dev, &syr827_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + if (OF_getencprop(node, "fcs,suspend-voltage-selector", &suspend_reg, + sizeof(uint32_t)) <= 0) + suspend_reg = 0; + + switch (suspend_reg) { + case 0: + reg_sc->suspend_reg = VSEL0; + reg_sc->volt_reg = VSEL1; + break; + case 1: + reg_sc->suspend_reg = VSEL1; + reg_sc->volt_reg = VSEL0; + break; + } + + regnode_register(regnode); + + return (reg_sc); +} + +static int +syr827_regdev_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, + intptr_t *num) +{ + struct syr827_softc *sc; + + sc = device_get_softc(dev); + + if (sc->reg->xref != xref) + return (ENXIO); + + *num = 0; + + return (0); +} + +static int +syr827_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Silergy SYR827 regulator"); + + return (BUS_PROBE_DEFAULT); +} + +static void +syr827_start(void *pdev) +{ + struct syr827_softc *sc; + device_t dev; + uint8_t val; + + dev = pdev; + sc = device_get_softc(dev); + + if (bootverbose) { + syr827_read(dev, ID1, &val, 1); + device_printf(dev, "Vendor ID: %x, DIE ID: %x\n", + (val & ID1_VENDOR_MASK) >> ID1_VENDOR_SHIFT, + val & ID1_DIE_MASK); + syr827_read(dev, ID2, &val, 1); + device_printf(dev, "DIE Rev: %x\n", val & ID2_DIE_REV_MASK); + } + + config_intrhook_disestablish(&sc->intr_hook); +} + +static int +syr827_attach(device_t dev) +{ + struct syr827_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + sc->addr = iicbus_get_addr(dev); + + sc->intr_hook.ich_func = syr827_start; + sc->intr_hook.ich_arg = dev; + + if (config_intrhook_establish(&sc->intr_hook) != 0) + return (ENOMEM); + + sc->reg = syr827_reg_attach(dev, node); + if (sc->reg == NULL) { + device_printf(dev, "cannot attach regulator\n"); + return (ENXIO); + } + + return (0); +} + +static device_method_t syr827_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, syr827_probe), + DEVMETHOD(device_attach, syr827_attach), + + /* Regdev interface */ + DEVMETHOD(regdev_map, syr827_regdev_map), + + DEVMETHOD_END +}; + +static driver_t syr827_driver = { + "syr827", + syr827_methods, + sizeof(struct syr827_softc), +}; + +static devclass_t syr827_devclass; + +EARLY_DRIVER_MODULE(syr827, iicbus, syr827_driver, syr827_devclass, 0, 0, + BUS_PASS_RESOURCE); +MODULE_VERSION(syr827, 1); +MODULE_DEPEND(syr827, iicbus, 1, 1, 1); From owner-svn-src-head@freebsd.org Sat Dec 1 20:39:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBC65132706C; Sat, 1 Dec 2018 20:39:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92CF973533; Sat, 1 Dec 2018 20:39:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 601571CC85; Sat, 1 Dec 2018 20:39:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1KdLhq065641; Sat, 1 Dec 2018 20:39:21 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1KdLE4065640; Sat, 1 Dec 2018 20:39:21 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201812012039.wB1KdLE4065640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 1 Dec 2018 20:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341387 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 341387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92CF973533 X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.218,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:39:22 -0000 Author: jhibbits Date: Sat Dec 1 20:39:20 2018 New Revision: 341387 URL: https://svnweb.freebsd.org/changeset/base/341387 Log: Fix PowerPC64 ELFv1-specific problem in __elf_phdr_match_addr() leading to crash in threaded programs that unload libraries. Summary: The GNOME update to 3.28 exposed a bug in __elf_phdr_match_addr(), which leads to a crash when building devel/libsoup on powerpc64. Due to __elf_phdr_match_addr() limiting its search to PF_X sections, on the PPC64 ELFv1 ABI, it was never matching function pointers properly. This meant that libthr was never cleaning up its atfork list in __pthread_cxa_finalize(), so if a library with an atfork handler was unloaded, libthr would crash on the next fork. Normally, the null pointer check it does before calling the handler would avoid this crash, but, due to PPC64 ELFv1 using function descriptors instead of raw function pointers, a null check against the pointer itself is insufficient, as the pointer itself was not null, it was just pointing at a function descriptor that had been zeroed. (Which is an ABI violation.) Calling a zeroed function descriptor on PPC64 ELFv1 causes a jump to address 0 with a zeroed r2 and r11. Submitted by: git_bdragon.rtk0.net Reviewed By: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18364 Modified: head/lib/libc/gen/elf_utils.c Modified: head/lib/libc/gen/elf_utils.c ============================================================================== --- head/lib/libc/gen/elf_utils.c Sat Dec 1 20:31:49 2018 (r341386) +++ head/lib/libc/gen/elf_utils.c Sat Dec 1 20:39:20 2018 (r341387) @@ -47,8 +47,21 @@ __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, for (i = 0; i < phdr_info->dlpi_phnum; i++) { ph = &phdr_info->dlpi_phdr[i]; - if (ph->p_type != PT_LOAD || (ph->p_flags & PF_X) == 0) + if (ph->p_type != PT_LOAD) continue; + + /* ELFv1 ABI for powerpc64 passes function descriptor + * pointers around, not function pointers. The function + * descriptors live in .opd, which is a non-executable segment. + * The PF_X check would therefore make all address checks fail, + * causing a crash in some instances. Don't skip over + * non-executable segments in the ELFv1 powerpc64 case. + */ +#if !defined(__powerpc64__) || (defined(_CALL_ELF) && _CALL_ELF == 2) + if ((ph->p_flags & PF_X) == 0) + continue; +#endif + if (phdr_info->dlpi_addr + ph->p_vaddr <= (uintptr_t)addr && (uintptr_t)addr + sizeof(addr) < phdr_info->dlpi_addr + ph->p_vaddr + ph->p_memsz) From owner-svn-src-head@freebsd.org Sat Dec 1 20:47:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 851FD13273F4; Sat, 1 Dec 2018 20:47:16 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E17F873B54; Sat, 1 Dec 2018 20:47:14 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id bf681257; Sat, 1 Dec 2018 21:47:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=s1101VqOPtu89FW2Kpli/ApNBJU=; b=J6uRC/OeHBMpxIlWbJxp7uL1fXbj uy1Xw3BRKeJRf+KHNmP8ckB+DaO0YM737WgRKbbAswjRoG7ReSmwLFVuDl8+tuNB SBwItyejb/J8TMG1kTq9pCy+0K9xUb+AIK9J+BCQ6Qx1yhscGnNt3Ec/fOOKgwAv csD4yPfFSXqcD5w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=b3MqwRcsXrHszuGGdVqA1Gm25xkaxyeRXOLEHCgtNcDXRfQpP8S3PwMJ 5ckkbGiXelN78ujqyDeRTL3vS2qflm+Lu210jau3aSvgFO+hS+iGJQbNVQk99RCi dB0wKrhiu4mTMqrA/u2Y5PlRvcv1Gg0xtyk3HtDkuhSA2193rmA= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 5abcd457 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 1 Dec 2018 21:47:06 +0100 (CET) Date: Sat, 1 Dec 2018 21:47:05 +0100 From: Emmanuel Vadot To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341377 - head/sys/contrib/ipfilter/netinet Message-Id: <20181201214705.7d2dca977d720467db57ee85@bidouilliste.com> In-Reply-To: <201812011759.wB1HxgTL083143@repo.freebsd.org> References: <201812011759.wB1HxgTL083143@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E17F873B54 X-Spamd-Result: default: False [-1.28 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com]; NEURAL_HAM_MEDIUM(-0.98)[-0.980,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[bidouilliste.com]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.41)[0.409,0]; NEURAL_HAM_LONG(-0.95)[-0.950,0]; DKIM_TRACE(0.00)[bidouilliste.com:+]; MX_GOOD(-0.01)[mx-backup.blih.net,mail.blih.net]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.15)[ipnet: 212.83.160.0/19(0.77), asn: 12876(0.00), country: FR(-0.02)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:47:16 -0000 Hi Cy, On Sat, 1 Dec 2018 17:59:42 +0000 (UTC) Cy Schubert wrote: > Author: cy > Date: Sat Dec 1 17:59:41 2018 > New Revision: 341377 > URL: https://svnweb.freebsd.org/changeset/base/341377 > > Log: > Restore handling of PMTU discovery, removed through an unifdef(1) > following the MFV of r254219 into r255332. In addition the 'FreeBSD' > macro was never defined in ipfilter 5.1.2 thus it never would have > been enabled in the first place. > > This work is prompted by a general cleanup of the IP Filter code > prompted by working to resolve a PR. More to follow. > > MFC after: 1 week > > Modified: > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > > Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c This breaks a lot of things : https://ci.freebsd.org/tinderbox/ -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Sat Dec 1 21:28:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F74813284B9; Sat, 1 Dec 2018 21:28:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7F0A750B9; Sat, 1 Dec 2018 21:28:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A7161D4B5; Sat, 1 Dec 2018 21:28:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1LS548095324; Sat, 1 Dec 2018 21:28:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1LS537095323; Sat, 1 Dec 2018 21:28:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812012128.wB1LS537095323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Dec 2018 21:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341388 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 341388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7F0A750B9 X-Spamd-Result: default: False [0.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_SHORT(0.22)[0.218,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 21:28:06 -0000 Author: cem Date: Sat Dec 1 21:28:05 2018 New Revision: 341388 URL: https://svnweb.freebsd.org/changeset/base/341388 Log: Restore build of the kernel, removed through r341377 Turns out we already had a path_mtu_discovery variable. X-MFC-with: r341377 Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 20:39:20 2018 (r341387) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 1 21:28:05 2018 (r341388) @@ -85,9 +85,6 @@ static const char rcsid[] = "@(#)$Id$"; #endif extern int ip_optcopy __P((struct ip *, struct ip *)); -VNET_DECLARE(int, path_mtu_discovery); -#define V_path_mtu_discovery VNET(path_mtu_discovery) - # ifdef IPFILTER_M_IPFILTER MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures"); # endif From owner-svn-src-head@freebsd.org Sat Dec 1 21:33:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16001328797; Sat, 1 Dec 2018 21:33:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DFE3A75508; Sat, 1 Dec 2018 21:33:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id TCsdg93P4ctraTCsfggbeY; Sat, 01 Dec 2018 14:32:55 -0700 X-Authority-Analysis: v=2.3 cv=Io3Pj43g c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=2ur7OfE09M0A:10 a=7ASnObcnAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=spqWC-di1eaPeLnmFLsA:9 a=CjuIK1q_8ugA:10 a=pj5rz7AvTRnaHDIeLm0D:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D9167440; Sat, 1 Dec 2018 13:32:51 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id wB1LWp0N054109; Sat, 1 Dec 2018 13:32:51 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id wB1LWoUG054106; Sat, 1 Dec 2018 13:32:50 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201812012132.wB1LWoUG054106@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Emmanuel Vadot cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r341377 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Emmanuel Vadot of "Sat, 01 Dec 2018 21:47:05 +0100." <20181201214705.7d2dca977d720467db57ee85@bidouilliste.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 01 Dec 2018 13:32:50 -0800 X-CMAE-Envelope: MS4wfCtv1vqDvgqSXplgn2SJoWkjgP6CCMf0n9p/OVRhdLZ8gTCmUcwOCq9UX9fwfj1vCxmD0Zoh8C4j0s1NTDM7vfjr6NjNXKDVAnEYVfwp/tKUl8d+Y932 bX15g9ASEAtyLyInqwLocb/Gr4BY+Dsp2UCvgutgHcCHITzeFhJaMJcAIZinhexpIQuxzYuz41QT3y5o940nIvxzJY/G/S5+m0n7+ciCfPM9pnDx36mxcaLU aThmKC97JU+yWBn5DaIFUkvljTgIjNVIoCoHMtGQGAcil7ZM76F5XsE+J3mxk9NCa0bGIp7qoksyHV3mQCTyhw== X-Rspamd-Queue-Id: DFE3A75508 X-Spamd-Result: default: False [-4.56 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-1.86)[ip: (-4.36), ipnet: 64.59.128.0/20(-2.70), asn: 6327(-2.16), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 21:33:03 -0000 In message <20181201214705.7d2dca977d720467db57ee85@bidouilliste.com>, Emmanuel Vadot writes: > > > Hi Cy, > > On Sat, 1 Dec 2018 17:59:42 +0000 (UTC) > Cy Schubert wrote: > > > Author: cy > > Date: Sat Dec 1 17:59:41 2018 > > New Revision: 341377 > > URL: https://svnweb.freebsd.org/changeset/base/341377 > > > > Log: > > Restore handling of PMTU discovery, removed through an unifdef(1) > > following the MFV of r254219 into r255332. In addition the 'FreeBSD' > > macro was never defined in ipfilter 5.1.2 thus it never would have > > been enabled in the first place. > > > > This work is prompted by a general cleanup of the IP Filter code > > prompted by working to resolve a PR. More to follow. > > > > MFC after: 1 week > > > > Modified: > > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > > > > Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > > This breaks a lot of things : https://ci.freebsd.org/tinderbox/ I see, gcc platforms. Thanks cem@ for the quick fix. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Dec 1 21:37:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499D61328940; Sat, 1 Dec 2018 21:37:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5973757AE; Sat, 1 Dec 2018 21:37:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A872C1D656; Sat, 1 Dec 2018 21:37:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB1LblQr001623; Sat, 1 Dec 2018 21:37:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB1Lbljo001622; Sat, 1 Dec 2018 21:37:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812012137.wB1Lbljo001622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Dec 2018 21:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341389 - head/sys/powerpc/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/powerpc/cpufreq X-SVN-Commit-Revision: 341389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5973757AE X-Spamd-Result: default: False [0.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.10)[0.096,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.419,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 21:37:48 -0000 Author: cem Date: Sat Dec 1 21:37:47 2018 New Revision: 341389 URL: https://svnweb.freebsd.org/changeset/base/341389 Log: pmcr: Fix pstate setting on Power8 Fix p-state setting on Power8 by removing the accidental double-indirection of the pstate_ids table. The pstate_ids table comes from the OF property "ibm,pstate-ids." On Power9, the values happen to be identical to the indices, so the extra indirection was harmless. On Power8, the values were out of the range [0, npstates], so pmcr_set() would fail the spec[0] range check with EINVAL. While here, include both the value and index in the driver-specific register array as spec[0] and spec[1] respectively. They're redundant, but relatively harmless, and it may aid debugging. While here, fix the range check to exclude the index npstates, which is one past the last valid index. PR: 233693 Reported and tested by: sbruno Reviewed by: jhibbits Modified: head/sys/powerpc/cpufreq/pmcr.c Modified: head/sys/powerpc/cpufreq/pmcr.c ============================================================================== --- head/sys/powerpc/cpufreq/pmcr.c Sat Dec 1 21:28:05 2018 (r341388) +++ head/sys/powerpc/cpufreq/pmcr.c Sat Dec 1 21:37:47 2018 (r341389) @@ -174,6 +174,7 @@ pmcr_settings(device_t dev, struct cf_setting *sets, i for (i = 0; i < npstates; i++) { sets[i].freq = pstate_freqs[i]; sets[i].spec[0] = pstate_ids[i]; + sets[i].spec[1] = i; sets[i].dev = dev; } *count = npstates; @@ -189,13 +190,11 @@ pmcr_set(device_t dev, const struct cf_setting *set) if (set == NULL) return (EINVAL); - if (set->spec[0] < 0 || set->spec[0] > npstates) + if (set->spec[1] < 0 || set->spec[1] >= npstates) return (EINVAL); - pmcr = ((long)pstate_ids[set->spec[0]] << PMCR_LOWERPS_SHIFT) & - PMCR_LOWERPS_MASK; - pmcr |= ((long)pstate_ids[set->spec[0]] << PMCR_UPPERPS_SHIFT) & - PMCR_UPPERPS_MASK; + pmcr = ((long)set->spec[0] << PMCR_LOWERPS_SHIFT) & PMCR_LOWERPS_MASK; + pmcr |= ((long)set->spec[0] << PMCR_UPPERPS_SHIFT) & PMCR_UPPERPS_MASK; pmcr |= PMCR_VERSION_1; mtspr(SPR_PMCR, pmcr); @@ -228,6 +227,7 @@ pmcr_get(device_t dev, struct cf_setting *set) return (EINVAL); set->spec[0] = pstate; + set->spec[1] = i; set->freq = pstate_freqs[i]; set->dev = dev;