svn commit: r342548 - in head/sys: fs/ext2fs kern ufs/ffs ufs/ufs

2018-12-26 Thread Kirk McKusick
Author: mckusick
Date: Thu Dec 27 07:18:53 2018
New Revision: 342548
URL: https://svnweb.freebsd.org/changeset/base/342548

Log:
  When loading an inode from disk, verify that its mode is valid.
  If invalid, return EINVAL. Note that inode check-hashes greatly
  reduce the chance that these errors will go undetected.
  
  Reported by:  Christopher Krah 
  Reported as:  FS-5-UFS-2: Denial Of Service in nmount-3 (ffs_read)
  Reviewed by:  kib
  MFC after:1 week
  Sponsored by: Netflix
  
  Msys/fs/ext2fs/ext2_vnops.c
  Msys/kern/vfs_subr.c
  Msys/ufs/ffs/ffs_snapshot.c
  Msys/ufs/ufs/ufs_vnops.c

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/kern/vfs_subr.c
  head/sys/ufs/ffs/ffs_snapshot.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==
--- head/sys/fs/ext2fs/ext2_vnops.c Thu Dec 27 04:53:53 2018
(r342547)
+++ head/sys/fs/ext2fs/ext2_vnops.c Thu Dec 27 07:18:53 2018
(r342548)
@@ -1920,6 +1920,11 @@ ext2_vinit(struct mount *mntp, struct vop_vector *fifo
vp = *vpp;
ip = VTOI(vp);
vp->v_type = IFTOVT(ip->i_mode);
+   /*
+* Only unallocated inodes should be of type VNON.
+*/
+   if (ip->i_mode != 0 && vp->v_type == VNON)
+   return (EINVAL);
if (vp->v_type == VFIFO)
vp->v_op = fifoops;
 

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cThu Dec 27 04:53:53 2018(r342547)
+++ head/sys/kern/vfs_subr.cThu Dec 27 07:18:53 2018(r342548)
@@ -156,7 +156,7 @@ SYSCTL_ULONG(_vfs, OID_AUTO, mnt_free_list_batch, CTLF
  */
 enum vtype iftovt_tab[16] = {
VNON, VFIFO, VCHR, VNON, VDIR, VNON, VBLK, VNON,
-   VREG, VNON, VLNK, VNON, VSOCK, VNON, VNON, VBAD,
+   VREG, VNON, VLNK, VNON, VSOCK, VNON, VNON, VNON
 };
 int vttoif_tab[10] = {
0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK,

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==
--- head/sys/ufs/ffs/ffs_snapshot.c Thu Dec 27 04:53:53 2018
(r342547)
+++ head/sys/ufs/ffs/ffs_snapshot.c Thu Dec 27 07:18:53 2018
(r342548)
@@ -2001,15 +2001,19 @@ ffs_snapshot_mount(mp)
continue;
}
ip = VTOI(vp);
-   if (!IS_SNAPSHOT(ip) || ip->i_size ==
+   if (vp->v_type != VREG) {
+   reason = "non-file snapshot";
+   } else if (!IS_SNAPSHOT(ip)) {
+   reason = "non-snapshot";
+   } else if (ip->i_size ==
lblktosize(fs, howmany(fs->fs_size, fs->fs_frag))) {
-   if (!IS_SNAPSHOT(ip)) {
-   reason = "non-snapshot";
-   } else {
-   reason = "old format snapshot";
-   (void)ffs_truncate(vp, (off_t)0, 0, NOCRED);
-   (void)ffs_syncvnode(vp, MNT_WAIT, 0);
-   }
+   reason = "old format snapshot";
+   (void)ffs_truncate(vp, (off_t)0, 0, NOCRED);
+   (void)ffs_syncvnode(vp, MNT_WAIT, 0);
+   } else {
+   reason = NULL;
+   }
+   if (reason != NULL) {
printf("ffs_snapshot_mount: %s inode %d\n",
reason, fs->fs_snapinum[snaploc]);
vput(vp);

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cThu Dec 27 04:53:53 2018
(r342547)
+++ head/sys/ufs/ufs/ufs_vnops.cThu Dec 27 07:18:53 2018
(r342548)
@@ -2517,6 +2517,11 @@ ufs_vinit(mntp, fifoops, vpp)
vp = *vpp;
ip = VTOI(vp);
vp->v_type = IFTOVT(ip->i_mode);
+   /*
+* Only unallocated inodes should be of type VNON.
+*/
+   if (ip->i_mode != 0 && vp->v_type == VNON)
+   return (EINVAL);
if (vp->v_type == VFIFO)
vp->v_op = fifoops;
ASSERT_VOP_LOCKED(vp, "ufs_vinit");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342547 - head/sys/contrib/ipfilter/netinet

2018-12-26 Thread Cy Schubert
Author: cy
Date: Thu Dec 27 04:53:53 2018
New Revision: 342547
URL: https://svnweb.freebsd.org/changeset/base/342547

Log:
  Remove another empty #ifdef block. This empty block also exists in
  the upstream HEAD.
  
  MFC after:3 days

Modified:
  head/sys/contrib/ipfilter/netinet/fil.c

Modified: head/sys/contrib/ipfilter/netinet/fil.c
==
--- head/sys/contrib/ipfilter/netinet/fil.c Wed Dec 26 23:41:52 2018
(r342546)
+++ head/sys/contrib/ipfilter/netinet/fil.c Thu Dec 27 04:53:53 2018
(r342547)
@@ -4266,8 +4266,6 @@ copyoutptr(softc, src, dst, size)
}
return error;
 }
-#ifdef _KERNEL
-#endif
 
 
 /*  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342546 - head/sys/dev/nvme

2018-12-26 Thread Alexander Motin
Author: mav
Date: Wed Dec 26 23:41:52 2018
New Revision: 342546
URL: https://svnweb.freebsd.org/changeset/base/342546

Log:
  Add descriptions to NVMe interrupts.
  
  MFC after:1 month

Modified:
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sys/dev/nvme/nvme_qpair.c
==
--- head/sys/dev/nvme/nvme_qpair.c  Wed Dec 26 12:56:36 2018
(r342545)
+++ head/sys/dev/nvme/nvme_qpair.c  Wed Dec 26 23:41:52 2018
(r342546)
@@ -561,6 +561,13 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_
bus_setup_intr(ctrlr->dev, qpair->res,
INTR_TYPE_MISC | INTR_MPSAFE, NULL,
nvme_qpair_msix_handler, qpair, &qpair->tag);
+   if (id == 0) {
+   bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag,
+   "admin");
+   } else {
+   bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag,
+   "io%d", id - 1);
+   }
}
 
mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342545 - stable/12/tests/sys/netpfil/pf

2018-12-26 Thread Kristof Provost
Author: kp
Date: Wed Dec 26 12:56:36 2018
New Revision: 342545
URL: https://svnweb.freebsd.org/changeset/base/342545

Log:
  MFC r342000:
  
  pf tests: Basic rdr test

Added:
  stable/12/tests/sys/netpfil/pf/rdr.sh
 - copied unchanged from r342000, head/tests/sys/netpfil/pf/rdr.sh
Modified:
  stable/12/tests/sys/netpfil/pf/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/netpfil/pf/Makefile
==
--- stable/12/tests/sys/netpfil/pf/Makefile Wed Dec 26 12:55:35 2018
(r342544)
+++ stable/12/tests/sys/netpfil/pf/Makefile Wed Dec 26 12:56:36 2018
(r342545)
@@ -11,6 +11,7 @@ ATF_TESTS_SH+=anchor \
fragmentation \
nat \
set_tos \
+   rdr \
route_to \
synproxy \
set_skip \

Copied: stable/12/tests/sys/netpfil/pf/rdr.sh (from r342000, 
head/tests/sys/netpfil/pf/rdr.sh)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/tests/sys/netpfil/pf/rdr.sh   Wed Dec 26 12:56:36 2018
(r342545, copy of r342000, head/tests/sys/netpfil/pf/rdr.sh)
@@ -0,0 +1,48 @@
+# $FreeBSD$
+
+. $(atf_get_srcdir)/utils.subr
+
+atf_test_case "basic" "cleanup"
+basic_head()
+{
+   atf_set descr 'Basic rdr test'
+   atf_set require.user root
+}
+
+basic_body()
+{
+   pft_init
+
+   epair=$(pft_mkepair)
+
+   pft_mkjail alcatraz ${epair}b
+
+   ifconfig ${epair}a 192.0.2.2/24 up
+   route add -net 198.51.100.0/24 192.0.2.1
+
+   jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up
+   jexec alcatraz sysctl net.inet.ip.forwarding=1
+
+   # Enable pf!
+   jexec alcatraz pfctl -e
+   pft_set_rules alcatraz \
+   "rdr pass on ${epair}b proto tcp from any to 198.51.100.0/24 
port 1234 -> 192.0.2.1 port 4321"
+
+   echo "foo" | jexec alcatraz nc -N -l 4321 &
+   sleep 1
+
+   result=$(nc -N -w 3 198.51.100.2 1234)
+   if [ "$result" != "foo" ]; then
+   atf_fail "Redirect failed"
+   fi
+}
+
+basic_cleanup()
+{
+   pft_cleanup
+}
+
+atf_init_test_cases()
+{
+   atf_add_test_case "basic"
+}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342544 - stable/12/tests/sys/netpfil/pf

2018-12-26 Thread Kristof Provost
Author: kp
Date: Wed Dec 26 12:55:35 2018
New Revision: 342544
URL: https://svnweb.freebsd.org/changeset/base/342544

Log:
  MFC r341999:
  
  pf tests: NAT exhaustion test
  
  It's been reported that pf doesn't handle running out of available ports
  for NAT correctly. It freezes until a state expires and it can find a
  free port.
  Test for this, by setting up a situation where only two ports are
  available for NAT and then attempting to create three connections.
  
  If successful the third connection will fail immediately. In an
  incorrect case the connection attempt will freeze, also freezing all
  interaction with pf through pfctl and trigger timeout.
  
  PR:   233867

Added:
  stable/12/tests/sys/netpfil/pf/nat.sh
 - copied unchanged from r341999, head/tests/sys/netpfil/pf/nat.sh
Modified:
  stable/12/tests/sys/netpfil/pf/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/netpfil/pf/Makefile
==
--- stable/12/tests/sys/netpfil/pf/Makefile Wed Dec 26 12:54:27 2018
(r342543)
+++ stable/12/tests/sys/netpfil/pf/Makefile Wed Dec 26 12:55:35 2018
(r342544)
@@ -9,6 +9,7 @@ ATF_TESTS_SH+=  anchor \
pass_block \
forward \
fragmentation \
+   nat \
set_tos \
route_to \
synproxy \

Copied: stable/12/tests/sys/netpfil/pf/nat.sh (from r341999, 
head/tests/sys/netpfil/pf/nat.sh)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/tests/sys/netpfil/pf/nat.sh   Wed Dec 26 12:55:35 2018
(r342544, copy of r341999, head/tests/sys/netpfil/pf/nat.sh)
@@ -0,0 +1,64 @@
+# $FreeBSD$
+
+. $(atf_get_srcdir)/utils.subr
+
+atf_test_case "exhaust" "cleanup"
+exhaust_head()
+{
+   atf_set descr 'Test exhausting the NAT pool'
+   atf_set require.user root
+}
+
+exhaust_body()
+{
+   pft_init
+
+   epair_nat=$(pft_mkepair)
+   epair_echo=$(pft_mkepair)
+
+   pft_mkjail nat ${epair_nat}b ${epair_echo}a
+   pft_mkjail echo ${epair_echo}b
+
+   ifconfig ${epair_nat}a 192.0.2.2/24 up
+   route add -net 198.51.100.0/24 192.0.2.1
+
+   jexec nat ifconfig ${epair_nat}b 192.0.2.1/24 up
+   jexec nat ifconfig ${epair_echo}a 198.51.100.1/24 up
+   jexec nat sysctl net.inet.ip.forwarding=1
+
+   jexec echo ifconfig ${epair_echo}b 198.51.100.2/24 up
+   jexec echo /usr/sbin/inetd $(atf_get_srcdir)/echo_inetd.conf
+
+   # Enable pf!
+   jexec nat pfctl -e
+   pft_set_rules nat \
+   "nat pass on ${epair_echo}a inet from 192.0.2.0/24 to any -> 
(${epair_echo}a) port 3:30001 sticky-address"
+
+   # Sanity check
+   atf_check -s exit:0 -o ignore ping -c 3 198.51.100.2
+
+   echo "foo" | nc -N 198.51.100.2 7
+   echo "foo" | nc -N 198.51.100.2 7
+
+   # This one will fail, but that's expected
+   echo "foo" | nc -N 198.51.100.2 7 &
+
+   sleep 1
+
+   # If the kernel is stuck in pf_get_sport() this will not succeed either.
+   timeout 2 jexec nat pfctl -sa
+   if [ $? -eq 124 ]; then
+   # Timed out
+   atf_fail "pfctl timeout"
+   fi
+}
+
+exhaust_cleanup()
+{
+   pft_cleanup
+}
+
+atf_init_test_cases()
+{
+   atf_add_test_case "exhaust"
+}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342543 - stable/11/sys/netpfil/pf

2018-12-26 Thread Kristof Provost
Author: kp
Date: Wed Dec 26 12:54:27 2018
New Revision: 342543
URL: https://svnweb.freebsd.org/changeset/base/342543

Log:
  MFC r341998:
  
  pf: Fix endless loop on NAT exhaustion with sticky-address
  
  When we try to find a source port in pf_get_sport() it's possible that
  all available source ports will be in use. In that case we call
  pf_map_addr() to try to find a new source IP to try from. If there are
  no more available source IPs pf_map_addr() will return 1 and we stop
  trying.
  
  However, if sticky-address is set we'll always return the same IP
  address, even if we've already tried that one.
  We need to check the supplied address, because if that's the one we'd
  set it means pf_get_sport() has already tried it, and we should error
  out rather than keep trying.
  
  PR:   233867

Modified:
  stable/11/sys/netpfil/pf/pf.c
  stable/11/sys/netpfil/pf/pf_lb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/pf/pf.c
==
--- stable/11/sys/netpfil/pf/pf.c   Wed Dec 26 12:54:24 2018
(r342542)
+++ stable/11/sys/netpfil/pf/pf.c   Wed Dec 26 12:54:27 2018
(r342543)
@@ -5517,6 +5517,8 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, 
ifp = nh4.nh_ifp;
dst.sin_addr = nh4.nh_addr;
} else {
+   bzero(&naddr, sizeof(naddr));
+
if (TAILQ_EMPTY(&r->rpool.list)) {
DPFPRINTF(PF_DEBUG_URGENT,
("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__));
@@ -5686,6 +5688,8 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir,
*m = NULL;
return;
}
+
+   bzero(&naddr, sizeof(naddr));
 
if (TAILQ_EMPTY(&r->rpool.list)) {
DPFPRINTF(PF_DEBUG_URGENT,

Modified: stable/11/sys/netpfil/pf/pf_lb.c
==
--- stable/11/sys/netpfil/pf/pf_lb.cWed Dec 26 12:54:24 2018
(r342542)
+++ stable/11/sys/netpfil/pf/pf_lb.cWed Dec 26 12:54:27 2018
(r342543)
@@ -322,6 +322,12 @@ pf_map_addr(sa_family_t af, struct pf_rule *r, struct 
   src node was created just a moment ago in pf_create_state and it
   needs to be filled in with routing decision calculated here. */
if (*sn != NULL && !PF_AZERO(&(*sn)->raddr, af)) {
+   /* If the supplied address is the same as the current one we've
+* been asked before, so tell the caller that there's no other
+* address to be had. */
+   if (PF_AEQ(naddr, &(*sn)->raddr, af))
+   return (1);
+
PF_ACPY(naddr, &(*sn)->raddr, af);
if (V_pf_status.debug >= PF_DEBUG_MISC) {
printf("pf_map_addr: src tracking maps ");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342542 - stable/12/sys/netpfil/pf

2018-12-26 Thread Kristof Provost
Author: kp
Date: Wed Dec 26 12:54:24 2018
New Revision: 342542
URL: https://svnweb.freebsd.org/changeset/base/342542

Log:
  MFC r341998:
  
  pf: Fix endless loop on NAT exhaustion with sticky-address
  
  When we try to find a source port in pf_get_sport() it's possible that
  all available source ports will be in use. In that case we call
  pf_map_addr() to try to find a new source IP to try from. If there are
  no more available source IPs pf_map_addr() will return 1 and we stop
  trying.
  
  However, if sticky-address is set we'll always return the same IP
  address, even if we've already tried that one.
  We need to check the supplied address, because if that's the one we'd
  set it means pf_get_sport() has already tried it, and we should error
  out rather than keep trying.
  
  PR:   233867

Modified:
  stable/12/sys/netpfil/pf/pf.c
  stable/12/sys/netpfil/pf/pf_lb.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netpfil/pf/pf.c
==
--- stable/12/sys/netpfil/pf/pf.c   Wed Dec 26 11:03:14 2018
(r342541)
+++ stable/12/sys/netpfil/pf/pf.c   Wed Dec 26 12:54:24 2018
(r342542)
@@ -5513,6 +5513,8 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, 
dst.sin_len = sizeof(dst);
dst.sin_addr = ip->ip_dst;
 
+   bzero(&naddr, sizeof(naddr));
+
if (TAILQ_EMPTY(&r->rpool.list)) {
DPFPRINTF(PF_DEBUG_URGENT,
("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__));
@@ -5671,6 +5673,8 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir,
dst.sin6_family = AF_INET6;
dst.sin6_len = sizeof(dst);
dst.sin6_addr = ip6->ip6_dst;
+
+   bzero(&naddr, sizeof(naddr));
 
if (TAILQ_EMPTY(&r->rpool.list)) {
DPFPRINTF(PF_DEBUG_URGENT,

Modified: stable/12/sys/netpfil/pf/pf_lb.c
==
--- stable/12/sys/netpfil/pf/pf_lb.cWed Dec 26 11:03:14 2018
(r342541)
+++ stable/12/sys/netpfil/pf/pf_lb.cWed Dec 26 12:54:24 2018
(r342542)
@@ -324,6 +324,12 @@ pf_map_addr(sa_family_t af, struct pf_rule *r, struct 
   src node was created just a moment ago in pf_create_state and it
   needs to be filled in with routing decision calculated here. */
if (*sn != NULL && !PF_AZERO(&(*sn)->raddr, af)) {
+   /* If the supplied address is the same as the current one we've
+* been asked before, so tell the caller that there's no other
+* address to be had. */
+   if (PF_AEQ(naddr, &(*sn)->raddr, af))
+   return (1);
+
PF_ACPY(naddr, &(*sn)->raddr, af);
if (V_pf_status.debug >= PF_DEBUG_MISC) {
printf("pf_map_addr: src tracking maps ");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342541 - in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/sys/fs

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 11:03:14 2018
New Revision: 342541
URL: https://svnweb.freebsd.org/changeset/base/342541

Log:
  MFV r342532: 5882 Temporary pool names
  
  Note that this commit brings only formatting changes that were done
  during the final review of the illumos change, because FreeBSD got the
  main changes before illumos.
  
  illumos/illumos-gate@04e56356520b98d5a93c496b10f02530bb6647e0
  
https://github.com/illumos/illumos-gate/commit/04e56356520b98d5a93c496b10f02530bb6647e0
  
  https://www.illumos.org/issues/5882
This is an import of the temporary pool names functionality from ZoL:

https://github.com/zfsonlinux/zfs/commit/e2282ef57edc79cdce2a4b9b7ec56494a807

https://github.com/zfsonlinux/zfs/commit/26b42f3f9d03f85cc7966dc2fe4dfe9216601b0e

https://github.com/zfsonlinux/zfs/commit/2f3ec9006146844af6763d1fa4e823fd9047fd54

https://github.com/zfsonlinux/zfs/commit/00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1

https://github.com/zfsonlinux/zfs/commit/83e9986f6eefdf0afc387f06407087bba3ead4e9

https://github.com/zfsonlinux/zfs/commit/023bbe6f017380f4a04c5060feb24dd8cdda9fce
It is intended to assist the creation and management of virtual machines
that have their rootfs on ZFS on hosts that also have their rootfs on
ZFS. These situations cause SPA namespace collisions when the standard
name rpool is used in both cases. The solution is either to give each
guest pool a name unique to the host, which is not always desireable, or
boot a VM environment containing an ISO image to install it, which is
cumbersome.
  
  MFC after:1 week
  Sponsored by: Panzura

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cWed Dec 26 
10:48:39 2018(r342540)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cWed Dec 26 
11:03:14 2018(r342541)
@@ -1273,7 +1273,7 @@ badusage:
 /*
  * zpool destroy 
  *
- * -f  Forcefully unmount any datasets
+ * -f  Forcefully unmount any datasets
  *
  * Destroy the given pool.  Automatically unmounts any datasets in the pool.
  */
@@ -2165,8 +2165,8 @@ do_import(nvlist_t *config, const char *newname, const
  * zpool checkpoint 
  *   checkpoint --discard 
  *
- *   -d Discard the checkpoint from a checkpointed
- *   --discard  pool.
+ * -d  Discard the checkpoint from a checkpointed
+ * --discard  pool.
  *
  * Checkpoints the specified pool, by taking a "snapshot" of its
  * current state. A pool can only have one checkpoint at a time.
@@ -2242,45 +2242,45 @@ zpool_do_checkpoint(int argc, char **argv)
  *  [-d dir | -c cachefile] [-f] [-n] [-F] [-t]
  *   [newpool]
  *
- *  -c Read pool information from a cachefile instead of searching
+ * -c  Read pool information from a cachefile instead of searching
  * devices.
  *
- *   -dScan in a specific directory, other than /dev/dsk.  More than
+ * -d  Scan in a specific directory, other than /dev/dsk.  More than
  * one directory can be specified using multiple '-d' options.
  *
- *   -D Scan for previously destroyed pools or import all or only
- *  specified destroyed pools.
+ * -D  Scan for previously destroyed pools or import all or only
+ * specified destroyed pools.
  *
- *   -RTemporarily import the pool, with all mountpoints relative to
+ * -R  Temporarily import the pool, with all mountpoints relative to
  * the given root.  The pool will remain exported when the machine
  * is rebooted.
  *
- *   -VImport even in the presence of faulted vdevs.  This is an
- * intentionally undocumented option for testing purposes, and
- * treats the pool configuration as complete, leaving any bad
+ * -V  Import even in the presence of faulted vdevs.  This is an
+ * intentionally undocumented option for testing purposes, and
+ * treats the pool configuration as complete, leaving any bad
  * vdevs in the FAULTED state. In other words, it does verbatim
  * import.
  *
- *   -fForce import, even if it appears that the pool is active.
+ * -f  Force import, even if it appears that the pool is active.
  *
- *   -F Attempt rewind if necessary.
+ * -F  Attempt rewind if necessary.
  *
- *   -n See if rewind would work, but don't actually rewind.
+ * -n  See i

svn commit: r342540 - head/sys/dev/mrsas

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:48:39 2018
New Revision: 342540
URL: https://svnweb.freebsd.org/changeset/base/342540

Log:
  Driver version upgrade.
  
  Submitted by: Sumit Saxena 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mrsas/mrsas.h

Modified: head/sys/dev/mrsas/mrsas.h
==
--- head/sys/dev/mrsas/mrsas.h  Wed Dec 26 10:47:52 2018(r342539)
+++ head/sys/dev/mrsas/mrsas.h  Wed Dec 26 10:48:39 2018(r342540)
@@ -119,7 +119,7 @@ __FBSDID("$FreeBSD$");
  */
 #defineBYTE_ALIGNMENT  1
 #defineMRSAS_MAX_NAME_LENGTH   32
-#defineMRSAS_VERSION   
"07.708.02.00-fbsd"
+#defineMRSAS_VERSION   
"07.709.01.00-fbsd"
 #defineMRSAS_ULONG_MAX 
0x
 #defineMRSAS_DEFAULT_TIMEOUT   0x14/* Temporarily 
set */
 #defineDONE0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342539 - head/sys/dev/mrsas

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:47:52 2018
New Revision: 342539
URL: https://svnweb.freebsd.org/changeset/base/342539

Log:
  Problem statement:
  Due to hardware errata in Aero controllers, reads to certain
  fusion registers could intermittently return all zeroes.
  This behavior is transient in nature and subsequent reads will return
  valid value.
  
  Fix:
  For Aero controllers, any read will retry the read operations
  from certain registers for maximum three times, if read returns zero.
  
  Submitted by: Sumit Saxena 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mrsas/mrsas.c

Modified: head/sys/dev/mrsas/mrsas.c
==
--- head/sys/dev/mrsas/mrsas.c  Wed Dec 26 10:47:08 2018(r342538)
+++ head/sys/dev/mrsas/mrsas.c  Wed Dec 26 10:47:52 2018(r342539)
@@ -95,6 +95,8 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t de
 static struct mrsas_softc *
 mrsas_get_softc_instance(struct cdev *dev,
 u_long cmd, caddr_t arg);
+u_int32_t
+mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset);
 u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset);
 u_int8_t
 mrsas_build_mptmfi_passthru(struct mrsas_softc *sc,
@@ -272,6 +274,22 @@ mrsas_write(struct cdev *dev, struct uio *uio, int iof
return (0);
 }
 
+u_int32_t
+mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset)
+{
+   u_int32_t i = 0, ret_val;
+
+   if (sc->is_aero) {
+   do {
+   ret_val = mrsas_read_reg(sc, offset);
+   i++;
+   } while(ret_val == 0 && i < 3);
+   } else
+   ret_val = mrsas_read_reg(sc, offset);
+
+   return ret_val;
+}
+
 /*
  * Register Read/Write Functions
  *
@@ -332,7 +350,7 @@ mrsas_clear_intr(struct mrsas_softc *sc)
u_int32_t status;
 
/* Read received interrupt */
-   status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, 
outbound_intr_status));
+   status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, 
outbound_intr_status));
 
/* Not our interrupt, so just return */
if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK))
@@ -2314,7 +2332,7 @@ mrsas_init_fw(struct mrsas_softc *sc)
return (ret);
}
if (sc->is_ventura || sc->is_aero) {
-   scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, 
outbound_scratch_pad_3));
+   scratch_pad_3 = mrsas_read_reg_with_retries(sc, 
offsetof(mrsas_reg_set, outbound_scratch_pad_3));
 #if VD_EXT_DEBUG
device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", 
scratch_pad_3);
 #endif
@@ -2325,10 +2343,10 @@ mrsas_init_fw(struct mrsas_softc *sc)
/* MSI-x index 0- reply post host index register */
sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET;
/* Check if MSI-X is supported while in ready state */
-   msix_enable = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, 
outbound_scratch_pad)) & 0x400) >> 0x1a;
+   msix_enable = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, 
outbound_scratch_pad)) & 0x400) >> 0x1a;
 
if (msix_enable) {
-   scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set,
+   scratch_pad_2 = mrsas_read_reg_with_retries(sc, 
offsetof(mrsas_reg_set,
outbound_scratch_pad_2));
 
/* Check max MSI-X vectors */
@@ -2388,7 +2406,7 @@ mrsas_init_fw(struct mrsas_softc *sc)
}
 
if (sc->is_ventura || sc->is_aero) {
-   scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set,
+   scratch_pad_4 = mrsas_read_reg_with_retries(sc, 
offsetof(mrsas_reg_set,
outbound_scratch_pad_4));
if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= 
MR_DEFAULT_NVME_PAGE_SHIFT)
sc->nvme_page_size = 1 << (scratch_pad_4 & 
MR_NVME_PAGE_SIZE_MASK);
@@ -2529,7 +2547,7 @@ mrsas_init_adapter(struct mrsas_softc *sc)
int i = 0;
 
/* Read FW status register */
-   status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, 
outbound_scratch_pad));
+   status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, 
outbound_scratch_pad));
 
sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK;
 
@@ -2544,7 +2562,7 @@ mrsas_init_adapter(struct mrsas_softc *sc)
sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * 
(sc->reply_q_depth);
sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE +
(MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1));
-   scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set,
+   scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set,
outbound_scratch_pad_2));
/*
 * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set,
@

svn commit: r342538 - head/sys/dev/mrsas

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:47:08 2018
New Revision: 342538
URL: https://svnweb.freebsd.org/changeset/base/342538

Log:
  This patch will add support for 32 bit atomic request descriptor for Aero 
adapters.
  
  For Aero adapters-
  1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs.
  2. Driver will use 64 bit request descriptor to fire IOC INIT.
  3. If Aero firmware supports 32 bit atomic descriptor, then only driver will 
use it
  otherwise driver will use 64 bit request descriptor.
  
  For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 
bit request
  descriptors only.
  
  Submitted by: Sumit Saxena 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mrsas/mrsas.c
  head/sys/dev/mrsas/mrsas.h

Modified: head/sys/dev/mrsas/mrsas.c
==
--- head/sys/dev/mrsas/mrsas.c  Wed Dec 26 10:46:23 2018(r342537)
+++ head/sys/dev/mrsas/mrsas.c  Wed Dec 26 10:47:08 2018(r342538)
@@ -171,6 +171,9 @@ voidmrsas_release_mpt_cmd(struct mrsas_mpt_cmd 
*cmd);
 void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd,
union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus,
u_int32_t data_length, u_int8_t *sense);
+void
+mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo,
+u_int32_t req_desc_hi);
 
 
 SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters");
@@ -2728,7 +2731,7 @@ mrsas_ioc_init(struct mrsas_softc *sc)
 
mrsas_disable_intr(sc);
mrsas_dprint(sc, MRSAS_OCR, "Issuing IOC INIT command to FW.\n");
-   mrsas_fire_cmd(sc, req_desc.addr.u.low, req_desc.addr.u.high);
+   mrsas_write_64bit_req_desc(sc, req_desc.addr.u.low, 
req_desc.addr.u.high);
 
/*
 * Poll response timer to wait for Firmware response.  While this
@@ -2754,6 +2757,15 @@ mrsas_ioc_init(struct mrsas_softc *sc)
retcode = 1;
}
 
+   if (sc->is_aero) {
+   scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set,
+   outbound_scratch_pad_2));
+   sc->atomic_desc_support = (scratch_pad_2 &
+   MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET) ? 1 : 0;
+   device_printf(sc->mrsas_dev, "FW supports atomic descriptor: 
%s\n",
+   sc->atomic_desc_support ? "Yes" : "No");
+   }
+
mrsas_free_ioc_cmd(sc);
return (retcode);
 }
@@ -2853,16 +2865,13 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc)
 }
 
 /*
- * mrsas_fire_cmd: Sends command to FW
+ * mrsas_write_64bit_req_dsc:  Writes 64 bit request descriptor to FW
  * input:  Adapter softstate
- * request descriptor address low
- * request descriptor address high
- *
- * This functions fires the command to Firmware by writing to the
- * inbound_low_queue_port and inbound_high_queue_port.
+ * request descriptor address low
+ * request descriptor address high
  */
 void
-mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo,
+mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo,
 u_int32_t req_desc_hi)
 {
mtx_lock(&sc->pci_lock);
@@ -2871,6 +2880,26 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_d
mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_high_queue_port),
req_desc_hi);
mtx_unlock(&sc->pci_lock);
+}
+
+/*
+ * mrsas_fire_cmd: Sends command to FW
+ * input:  Adapter softstate
+ * request descriptor address low
+ * request descriptor address high
+ *
+ * This functions fires the command to Firmware by writing to the
+ * inbound_low_queue_port and inbound_high_queue_port.
+ */
+void
+mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo,
+u_int32_t req_desc_hi)
+{
+   if (sc->atomic_desc_support)
+   mrsas_write_reg(sc, offsetof(mrsas_reg_set, 
inbound_single_queue_port),
+   req_desc_lo);
+   else
+   mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi);
 }
 
 /*

Modified: head/sys/dev/mrsas/mrsas.h
==
--- head/sys/dev/mrsas/mrsas.h  Wed Dec 26 10:46:23 2018(r342537)
+++ head/sys/dev/mrsas/mrsas.h  Wed Dec 26 10:47:08 2018(r342538)
@@ -1259,7 +1259,7 @@ typedef struct _mrsas_register_set {
 
u_int32_t inbound_high_queue_port;  /* 00C4h */
 
-   u_int32_t reserved_5;   /* 00C8h */
+   u_int32_t inbound_single_queue_port;/* 00C8h */
u_int32_t res_6[11];/* CCh */
u_int32_t host_diag;
u_int32_t seq_offset;
@@ -2316,6 +2316,8 @@ struct mrsas_ctrl_info {
  */
 #define MR_CAN

svn commit: r342537 - head/sys/dev/mrsas

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:46:23 2018
New Revision: 342537
URL: https://svnweb.freebsd.org/changeset/base/342537

Log:
  This patch will add support for latest generation MegaRAID adapters- 
Aero(39xx).
  Driver will throw a warning message when a Configurable secure type 
controller is
  encountered.
  
  Submitted by: Sumit Saxena 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mrsas/mrsas.c
  head/sys/dev/mrsas/mrsas.h
  head/sys/dev/mrsas/mrsas_cam.c
  head/sys/dev/mrsas/mrsas_fp.c

Modified: head/sys/dev/mrsas/mrsas.c
==
--- head/sys/dev/mrsas/mrsas.c  Wed Dec 26 10:44:30 2018(r342536)
+++ head/sys/dev/mrsas/mrsas.c  Wed Dec 26 10:46:23 2018(r342537)
@@ -201,6 +201,14 @@ MRSAS_CTLR_ID device_table[] = {
{0x1000, MRSAS_TOMCAT, 0x, 0x, "AVAGO Tomcat SAS Controller"},
{0x1000, MRSAS_VENTURA_4PORT, 0x, 0x, "AVAGO Ventura_4Port SAS 
Controller"},
{0x1000, MRSAS_CRUSADER_4PORT, 0x, 0x, "AVAGO Crusader_4Port 
SAS Controller"},
+   {0x1000, MRSAS_AERO_10E0, 0x, 0x, "BROADCOM AERO-10E0 SAS 
Controller"},
+   {0x1000, MRSAS_AERO_10E1, 0x, 0x, "BROADCOM AERO-10E1 SAS 
Controller"},
+   {0x1000, MRSAS_AERO_10E2, 0x, 0x, "BROADCOM AERO-10E2 SAS 
Controller"},
+   {0x1000, MRSAS_AERO_10E3, 0x, 0x, "BROADCOM AERO-10E3 SAS 
Controller"},
+   {0x1000, MRSAS_AERO_10E4, 0x, 0x, "BROADCOM AERO-10E4 SAS 
Controller"},
+   {0x1000, MRSAS_AERO_10E5, 0x, 0x, "BROADCOM AERO-10E5 SAS 
Controller"},
+   {0x1000, MRSAS_AERO_10E6, 0x, 0x, "BROADCOM AERO-10E6 SAS 
Controller"},
+   {0x1000, MRSAS_AERO_10E7, 0x, 0x, "BROADCOM AERO-10E7 SAS 
Controller"},
{0, 0, 0, 0, NULL}
 };
 
@@ -845,20 +853,37 @@ mrsas_attach(device_t dev)
sc->mrsas_dev = dev;
sc->device_id = pci_get_device(dev);
 
-   if ((sc->device_id == MRSAS_INVADER) ||
-   (sc->device_id == MRSAS_FURY) ||
-   (sc->device_id == MRSAS_INTRUDER) ||
-   (sc->device_id == MRSAS_INTRUDER_24) ||
-   (sc->device_id == MRSAS_CUTLASS_52) ||
-   (sc->device_id == MRSAS_CUTLASS_53)) {
+   switch (sc->device_id) {
+   case MRSAS_INVADER:
+   case MRSAS_FURY:
+   case MRSAS_INTRUDER:
+   case MRSAS_INTRUDER_24:
+   case MRSAS_CUTLASS_52:
+   case MRSAS_CUTLASS_53:
sc->mrsas_gen3_ctrl = 1;
-   } else if ((sc->device_id == MRSAS_VENTURA) ||
-   (sc->device_id == MRSAS_CRUSADER) ||
-   (sc->device_id == MRSAS_HARPOON) ||
-   (sc->device_id == MRSAS_TOMCAT) ||
-   (sc->device_id == MRSAS_VENTURA_4PORT) ||
-   (sc->device_id == MRSAS_CRUSADER_4PORT)) {
+   break;
+   case MRSAS_VENTURA:
+   case MRSAS_CRUSADER:
+   case MRSAS_HARPOON:
+   case MRSAS_TOMCAT:
+   case MRSAS_VENTURA_4PORT:
+   case MRSAS_CRUSADER_4PORT:
sc->is_ventura = true;
+   break;
+   case MRSAS_AERO_10E1:
+   case MRSAS_AERO_10E5:
+   device_printf(dev, "Adapter is in configurable secure mode\n");
+   case MRSAS_AERO_10E2:
+   case MRSAS_AERO_10E6:
+   sc->is_aero = true;
+   break;
+   case MRSAS_AERO_10E0:
+   case MRSAS_AERO_10E3:
+   case MRSAS_AERO_10E4:
+   case MRSAS_AERO_10E7:
+   device_printf(dev, "Adapter is in non-secure mode\n");
+   return SUCCESS;
+
}
 
mrsas_get_tunables(sc);
@@ -874,8 +899,8 @@ mrsas_attach(device_t dev)
cmd |= PCIM_CMD_BUSMASTEREN;
pci_write_config(dev, PCIR_COMMAND, cmd, 2);
 
-   /* For Ventura system registers are mapped to BAR0 */
-   if (sc->is_ventura)
+   /* For Ventura/Aero system registers are mapped to BAR0 */
+   if (sc->is_ventura || sc->is_aero)
sc->reg_res_id = PCIR_BAR(0);   /* BAR0 offset */
else
sc->reg_res_id = PCIR_BAR(1);   /* BAR1 offset */
@@ -1099,7 +1124,7 @@ mrsas_detach(device_t dev)
mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN);
mrsas_disable_intr(sc);
 
-   if (sc->is_ventura && sc->streamDetectByLD) {
+   if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) {
for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i)
free(sc->streamDetectByLD[i], M_MRSAS);
free(sc->streamDetectByLD, M_MRSAS);
@@ -2285,7 +2310,7 @@ mrsas_init_fw(struct mrsas_softc *sc)
if (ret != SUCCESS) {
return (ret);
}
-   if (sc->is_ventura) {
+   if (sc->is_ventura || sc->is_aero) {
scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, 
outbound_scratch_pad_3));
 #if VD_EXT_DEBUG
device_printf(sc->mrsas_dev, "scratch_pad_3 

svn commit: r342536 - head/sys/dev/mpr

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:44:30 2018
New Revision: 342536
URL: https://svnweb.freebsd.org/changeset/base/342536

Log:
  Update mpr driver version to v23.00.00.00-fbsd
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mprvar.h
==
--- head/sys/dev/mpr/mprvar.h   Wed Dec 26 10:43:31 2018(r342535)
+++ head/sys/dev/mpr/mprvar.h   Wed Dec 26 10:44:30 2018(r342536)
@@ -34,7 +34,7 @@
 #ifndef _MPRVAR_H
 #define _MPRVAR_H
 
-#define MPR_DRIVER_VERSION "18.03.00.00-fbsd"
+#define MPR_DRIVER_VERSION "23.00.00.00-fbsd"
 
 #define MPR_DB_MAX_WAIT2500
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342535 - head/sys/dev/mpr

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:43:31 2018
New Revision: 342535
URL: https://svnweb.freebsd.org/changeset/base/342535

Log:
  Update copyright information
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_ioctl.h
  head/sys/dev/mpr/mpr_mapping.c
  head/sys/dev/mpr/mpr_mapping.h
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas.h
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Wed Dec 26 10:42:45 2018(r342534)
+++ head/sys/dev/mpr/mpr.c  Wed Dec 26 10:43:31 2018(r342535)
@@ -2,6 +2,7 @@
  * Copyright (c) 2009 Yahoo! Inc.
  * Copyright (c) 2011-2015 LSI Corp.
  * Copyright (c) 2013-2016 Avago Technologies
+ * Copyright 2000-2020 Broadcom Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  */
 

Modified: head/sys/dev/mpr/mpr_config.c
==
--- head/sys/dev/mpr/mpr_config.c   Wed Dec 26 10:42:45 2018
(r342534)
+++ head/sys/dev/mpr/mpr_config.c   Wed Dec 26 10:43:31 2018
(r342535)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2011-2015 LSI Corp.
  * Copyright (c) 2013-2016 Avago Technologies
+ * Copyright 2000-2020 Broadcom Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD
  */
 
 #include 

Modified: head/sys/dev/mpr/mpr_ioctl.h
==
--- head/sys/dev/mpr/mpr_ioctl.hWed Dec 26 10:42:45 2018
(r342534)
+++ head/sys/dev/mpr/mpr_ioctl.hWed Dec 26 10:43:31 2018
(r342535)
@@ -27,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD userland interface
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD userland interface
  *
  * $FreeBSD$
  */
 /*-
  * Copyright (c) 2011-2015 LSI Corp.
  * Copyright (c) 2013-2016 Avago Technologies
+ * Copyright 2000-2020 Broadcom Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -57,7 +58,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/mpr/mpr_mapping.c
==
--- head/sys/dev/mpr/mpr_mapping.c  Wed Dec 26 10:42:45 2018
(r342534)
+++ head/sys/dev/mpr/mpr_mapping.c  Wed Dec 26 10:43:31 2018
(r342535)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2011-2015 LSI Corp.
  * Copyright (c) 2013-2016 Avago Technologies
+ * Copyright 2000-2020 Broadcom Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD
  */
 
 #include 

Modified: head/sys/dev/mpr/mpr_mapping.h
==
--- head/sys/dev/mpr/mpr_mapping.h  Wed Dec 26 10:42:45 2018
(r342534)
+++ head/sys/dev/mpr/mpr_mapping.h  Wed Dec 26 10:43:31 2018
(r342535)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2011-2015 LSI Corp.
  * Copyright (c) 2013-2016 Avago Technologies
+ * Copyright 2000-2020 Broadcom Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Wed Dec 26 10:42:45 2018(r342534)
+++ head/sys/d

svn commit: r342534 - head/sys/dev/mpr

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:42:45 2018
New Revision: 342534
URL: https://svnweb.freebsd.org/changeset/base/342534

Log:
  On Aero/Sea A0 cards retry MPT Fusion registers reads for max three times
  
  Due to HW Errta on Aero/Sea A0 chipset on secure boot mode & on heavy IO load,
  sometimes read operation on MPT Fusion registers will give zero value,
  So, as a workaround driver will retry the MPT Fusion register
  read operation for max three times upon reading zero value form these
  registers.
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mprvar.h
==
--- head/sys/dev/mpr/mprvar.h   Wed Dec 26 10:41:53 2018(r342533)
+++ head/sys/dev/mpr/mprvar.h   Wed Dec 26 10:42:45 2018(r342534)
@@ -530,7 +530,14 @@ struct scsi_read_capacity_eedp
 static __inline uint32_t
 mpr_regread(struct mpr_softc *sc, uint32_t offset)
 {
-   return (bus_space_read_4(sc->mpr_btag, sc->mpr_bhandle, offset));
+   uint32_t ret_val, i = 0;
+   do {
+   ret_val =
+   bus_space_read_4(sc->mpr_btag, sc->mpr_bhandle, offset);
+   } while((sc->mpr_flags & MPR_FLAGS_SEA_IOC) &&
+   (ret_val == 0) && (++i < 3));
+
+   return ret_val;
 }
 
 static __inline void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342532 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/cmd/zpool vendor/illumos/dist/lib/li...

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 10:41:17 2018
New Revision: 342532
URL: https://svnweb.freebsd.org/changeset/base/342532

Log:
  5882 Temporary pool names
  
  illumos/illumos-gate@04e56356520b98d5a93c496b10f02530bb6647e0
  
https://github.com/illumos/illumos-gate/commit/04e56356520b98d5a93c496b10f02530bb6647e0
  
  https://www.illumos.org/issues/5882
This is an import of the temporary pool names functionality from ZoL:
https://github.com/zfsonlinux/zfs/commit/
e2282ef57edc79cdce2a4b9b7ec56494a807
https://github.com/zfsonlinux/zfs/commit/
26b42f3f9d03f85cc7966dc2fe4dfe9216601b0e
https://github.com/zfsonlinux/zfs/commit/
2f3ec9006146844af6763d1fa4e823fd9047fd54
https://github.com/zfsonlinux/zfs/commit/
00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1
https://github.com/zfsonlinux/zfs/commit/
83e9986f6eefdf0afc387f06407087bba3ead4e9
https://github.com/zfsonlinux/zfs/commit/
023bbe6f017380f4a04c5060feb24dd8cdda9fce
It is intended to assist the creation and management of virtual machines
that have their rootfs on ZFS on hosts that also have their rootfs on
ZFS. These situations cause SPA namespace collisions when the standard
name rpool is used in both cases. The solution is either to give each
guest pool a name unique to the host, which is not always desireable, or
boot a VM environment containing an ISO image to install it, which is
cumbersome.
As a side note, this commit includes the removal of `zpool import -r`,
which previously did nothing.
patch [Magnifier] (14.3 KB) Richard Yao, 2015-04-30 04:33 PM
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Igor Kozhukhov 
  Reviewed by: John Kennedy 
  Approved by: Dan McDonald 
  Author: Andriy Gapon 

Modified:
  vendor-sys/illumos/dist/common/zfs/zpool_prop.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/spa_config.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
  vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h

Changes in other areas also in this revision:
Modified:
  vendor/illumos/dist/cmd/zpool/zpool_main.c
  vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c
  vendor/illumos/dist/man/man1m/zpool.1m

Modified: vendor-sys/illumos/dist/common/zfs/zpool_prop.c
==
--- vendor-sys/illumos/dist/common/zfs/zpool_prop.c Wed Dec 26 10:41:14 
2018(r342531)
+++ vendor-sys/illumos/dist/common/zfs/zpool_prop.c Wed Dec 26 10:41:17 
2018(r342532)
@@ -136,6 +136,8 @@ zpool_prop_init(void)
PROP_READONLY, ZFS_TYPE_POOL, "NAME");
zprop_register_hidden(ZPOOL_PROP_MAXBLOCKSIZE, "maxblocksize",
PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXBLOCKSIZE");
+   zprop_register_hidden(ZPOOL_PROP_TNAME, "tname", PROP_TYPE_STRING,
+   PROP_ONETIME, ZFS_TYPE_POOL, "TNAME");
 }
 
 /*

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Dec 26 10:41:14 
2018(r342531)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Dec 26 10:41:17 
2018(r342532)
@@ -4578,12 +4578,18 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_
uint_t nspares, nl2cache;
uint64_t version, obj;
boolean_t has_features;
+   char *poolname;
+   nvlist_t *nvl;
 
+   if (nvlist_lookup_string(props,
+   zpool_prop_to_name(ZPOOL_PROP_TNAME), &poolname) != 0)
+   poolname = (char *)pool;
+
/*
 * If this pool already exists, return failure.
 */
mutex_enter(&spa_namespace_lock);
-   if (spa_lookup(pool) != NULL) {
+   if (spa_lookup(poolname) != NULL) {
mutex_exit(&spa_namespace_lock);
return (SET_ERROR(EEXIST));
}
@@ -4591,9 +4597,12 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_
/*
 * Allocate a new spa_t structure.
 */
+   nvl = fnvlist_alloc();
+   fnvlist_add_string(nvl, ZPOOL_CONFIG_POOL_NAME, pool);
(void) nvlist_lookup_string(props,
zpool_prop_to_name(ZPOOL_PROP_ALTROOT), &altroot);
-   spa = spa_add(pool, NULL, altroot);
+   spa = spa_add(poolname, nvl, altroot);
+   fnvlist_free(nvl);
spa_activate(spa, spa_mode_global);
 
if (props && (error = spa_prop_validate(spa, props))) {
@@ -4602,6 +4611,12 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_
mutex_exit(&spa_namespace_lock);
return (error);
}
+
+   /*
+* Temporary pool names should never be written to disk.
+*/
+   if (poolname != pool)
+   spa->spa_import_flags |= ZFS_IMPORT_TEMP_NAME;
 
has_features = B_FALSE;
for (nvpair_t *elem = nvlist_next_nvpair(props, NULL);

Modified: vendor-sy

svn commit: r342533 - head/sys/dev/mpr

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:41:53 2018
New Revision: 342533
URL: https://svnweb.freebsd.org/changeset/base/342533

Log:
  Enable atomic type descriptor support only for Sea & Aero cards
  
  Enable atomic type descriptor support only for Sea & Aero cards,
  due to HW errata this atomic descriptor support has to be disabled
  on Ventura cards.
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mpr.c

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Wed Dec 26 10:41:17 2018(r342532)
+++ head/sys/dev/mpr/mpr.c  Wed Dec 26 10:41:53 2018(r342533)
@@ -624,8 +624,9 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at
sc->eedp_enabled = TRUE;
if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR)
sc->control_TLR = TRUE;
-   if (sc->facts->IOCCapabilities &
-   MPI26_IOCFACTS_CAPABILITY_ATOMIC_REQ)
+   if ((sc->facts->IOCCapabilities &
+   MPI26_IOCFACTS_CAPABILITY_ATOMIC_REQ) &&
+   (sc->mpr_flags & MPR_FLAGS_SEA_IOC))
sc->atomic_desc_capable = TRUE;
 
mpr_resize_queues(sc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342531 - head/sys/dev/mpr

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:41:14 2018
New Revision: 342531
URL: https://svnweb.freebsd.org/changeset/base/342531

Log:
  Add Sea,Aero adapter support
  
  Added deviceID's for Sea,Aero to mpr Driver
  Aero:
  0x00E0 Invalid
  0x00E1 Configurable Secure
  0x00E2 Hard Secure
  0x00E3 Tampered
  Sea:
  0x00E4 Invalid
  0x00E5 Configurable Secure
  0x00E6 Hard Secure
  0x00E7 Tampered
  
  For Tampered & Invalid type cards, driver will claim the device & quit the 
probe function with below error message,
  "HBA is in Non Secure mode"
  
  for Configurable Secure type cards, driver will display below message in 
.probe() callback function,
  "HBA is in Configurable Secure mode"
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mpr_pci.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpr_pci.c
==
--- head/sys/dev/mpr/mpr_pci.c  Wed Dec 26 10:40:27 2018(r342530)
+++ head/sys/dev/mpr/mpr_pci.c  Wed Dec 26 10:41:14 2018(r342531)
@@ -148,6 +148,30 @@ struct mpr_ident {
{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3716,
0x, 0x, MPR_FLAGS_GEN35_IOC,
"Avago Technologies (LSI) SAS3716" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID0_SAS3816,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) INVALID0 SAS3816" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3816,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) CFG SEC SAS3816" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_HARD_SEC_SAS3816,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) HARD SEC SAS3816" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID1_SAS3816,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) INVALID1 SAS3816" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID0_SAS3916,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) INVALID0 SAS3916" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3916,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) CFG SEC SAS3916" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_HARD_SEC_SAS3916,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) HARD SEC SAS3916" },
+   { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID1_SAS3916,
+   0x, 0x, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC),
+   "Broadcom Inc. (LSI) INVALID1 SAS3916" },
{ 0, 0, 0, 0, 0, NULL }
 };
 
@@ -205,6 +229,21 @@ mpr_pci_attach(device_t dev)
sc->mpr_dev = dev;
m = mpr_find_ident(dev);
sc->mpr_flags = m->flags;
+
+   switch (m->device) {
+   case MPI26_MFGPAGE_DEVID_INVALID0_SAS3816:
+   case MPI26_MFGPAGE_DEVID_INVALID1_SAS3816:
+   case MPI26_MFGPAGE_DEVID_INVALID0_SAS3916:
+   case MPI26_MFGPAGE_DEVID_INVALID1_SAS3916:
+   mpr_printf(sc, "HBA is in Non Secure mode\n");
+   return (ENXIO);
+   case MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3816:
+   case MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3916:
+   mpr_printf(sc, "HBA is in Configurable Secure mode\n");
+   break;
+   default:
+   break;
+   }
 
mpr_get_tunables(sc);
 

Modified: head/sys/dev/mpr/mprvar.h
==
--- head/sys/dev/mpr/mprvar.h   Wed Dec 26 10:40:27 2018(r342530)
+++ head/sys/dev/mpr/mprvar.h   Wed Dec 26 10:41:14 2018(r342531)
@@ -341,6 +341,7 @@ struct mpr_softc {
 #defineMPR_FLAGS_ATTACH_DONE   (1 << 5)
 #defineMPR_FLAGS_GEN35_IOC (1 << 6)
 #defineMPR_FLAGS_REALLOCATED   (1 << 7)
+#defineMPR_FLAGS_SEA_IOC   (1 << 8)
u_int   mpr_debug;
int msi_msgs;
u_int   reqframesz;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342532 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/cmd/zpool vendor/illumos/dist/lib/li...

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 10:41:17 2018
New Revision: 342532
URL: https://svnweb.freebsd.org/changeset/base/342532

Log:
  5882 Temporary pool names
  
  illumos/illumos-gate@04e56356520b98d5a93c496b10f02530bb6647e0
  
https://github.com/illumos/illumos-gate/commit/04e56356520b98d5a93c496b10f02530bb6647e0
  
  https://www.illumos.org/issues/5882
This is an import of the temporary pool names functionality from ZoL:
https://github.com/zfsonlinux/zfs/commit/
e2282ef57edc79cdce2a4b9b7ec56494a807
https://github.com/zfsonlinux/zfs/commit/
26b42f3f9d03f85cc7966dc2fe4dfe9216601b0e
https://github.com/zfsonlinux/zfs/commit/
2f3ec9006146844af6763d1fa4e823fd9047fd54
https://github.com/zfsonlinux/zfs/commit/
00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1
https://github.com/zfsonlinux/zfs/commit/
83e9986f6eefdf0afc387f06407087bba3ead4e9
https://github.com/zfsonlinux/zfs/commit/
023bbe6f017380f4a04c5060feb24dd8cdda9fce
It is intended to assist the creation and management of virtual machines
that have their rootfs on ZFS on hosts that also have their rootfs on
ZFS. These situations cause SPA namespace collisions when the standard
name rpool is used in both cases. The solution is either to give each
guest pool a name unique to the host, which is not always desireable, or
boot a VM environment containing an ISO image to install it, which is
cumbersome.
As a side note, this commit includes the removal of `zpool import -r`,
which previously did nothing.
patch [Magnifier] (14.3 KB) Richard Yao, 2015-04-30 04:33 PM
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Igor Kozhukhov 
  Reviewed by: John Kennedy 
  Approved by: Dan McDonald 
  Author: Andriy Gapon 

Modified:
  vendor/illumos/dist/cmd/zpool/zpool_main.c
  vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c
  vendor/illumos/dist/man/man1m/zpool.1m

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/common/zfs/zpool_prop.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/spa_config.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
  vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h

Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c
==
--- vendor/illumos/dist/cmd/zpool/zpool_main.c  Wed Dec 26 10:41:14 2018
(r342531)
+++ vendor/illumos/dist/cmd/zpool/zpool_main.c  Wed Dec 26 10:41:17 2018
(r342532)
@@ -220,8 +220,9 @@ get_usage(zpool_help_t idx)
case HELP_CREATE:
return (gettext("\tcreate [-fnd] [-B] "
"[-o property=value] ... \n"
-   "\t[-O file-system-property=value] ... \n"
-   "\t[-m mountpoint] [-R root]   ...\n"));
+   "\t[-O file-system-property=value] ...\n"
+   "\t[-m mountpoint] [-R root] [-t tempname] "
+   "  ...\n"));
case HELP_CHECKPOINT:
return (gettext("\tcheckpoint [--discard]  ...\n"));
case HELP_DESTROY:
@@ -239,7 +240,7 @@ get_usage(zpool_help_t idx)
"[-R root] [-F [-n]] -a\n"
"\timport [-o mntopts] [-o property=value] ... \n"
"\t[-d dir | -c cachefile] [-D] [-f] [-m] [-N] "
-   "[-R root] [-F [-n]]\n"
+   "[-R root] [-F [-n]] [-t]\n"
"\t[--rewind-to-checkpoint]  [newpool]\n"));
case HELP_IOSTAT:
return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval "
@@ -492,6 +493,21 @@ add_prop_list(const char *propname, char *propval, nvl
 }
 
 /*
+ * Set a default property pair (name, string-value) in a property nvlist
+ */
+static int
+add_prop_list_default(const char *propname, char *propval, nvlist_t **props,
+boolean_t poolprop)
+{
+   char *pval;
+
+   if (nvlist_lookup_string(*props, propname, &pval) == 0)
+   return (0);
+
+   return (add_prop_list(propname, propval, props, poolprop));
+}
+
+/*
  * zpool add [-fn]   ...
  *
  * -f  Force addition of devices, even if they appear in use
@@ -849,15 +865,16 @@ errout:
 /*
  * zpool create [-fnd] [-B] [-o property=value] ...
  * [-O file-system-property=value] ...
- * [-R root] [-m mountpoint]   ...
+ * [-R root] [-m mountpoint] [-t tempname]   ...
  *
  * -B  Create boot partition.
  * -f  Force creation, even if devices appear in use
  * -n  Do not create the pool, but display the resulting layout if it
  * were to be created.
- *  -R Create a pool under an alternate root
- *  -m Set default mountpoint for the root dataset.  By default it's
+ * -R  Create a pool under an alternate root
+ * -m  Set default mountpoint for the root dataset.  By default it's
  * '/'
+ * -t  Us

svn commit: r342530 - head/sys/dev/mpr

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:40:27 2018
New Revision: 342530
URL: https://svnweb.freebsd.org/changeset/base/342530

Log:
  Added support for NVMe Task Management
  
  Following list of changes done in the driver as a part of TM handling on the 
NVMe drives.
  Below changes are only applicable on NVMe drives and only when custom NVMe TM 
handling bit is set to zero by IOC.
  
  1. Issue LUN reset & Target reset TMs with Target reset method field set to 
Protocol Level reset (0x3),
  2. For LUN & target reset TMs use the timeout value as ControllerResetTO 
value provided by firmware using PCie Device Page 0,
  3. If LUN reset fails to terminates the IO then directly escalate to host 
reset instead of going for target reset TM,
  4. For Abort TM use the timeout value as NVMeAbortTO value given by the IOC 
using Manufacturing Page 11,
  5. Log message "PCie Host Reset failed" message up on receiving P
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas.h
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpr_config.c
==
--- head/sys/dev/mpr/mpr_config.c   Wed Dec 26 10:39:34 2018
(r342529)
+++ head/sys/dev/mpr/mpr_config.c   Wed Dec 26 10:40:27 2018
(r342530)
@@ -324,6 +324,137 @@ out:
 }
 
 /**
+ * mpr_config_get_man_pg11 - obtain manufacturing page 11
+ * @sc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpr_config_get_man_pg11(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply,
+Mpi2ManufacturingPage11_t *config_page)
+{
+   MPI2_CONFIG_REQUEST *request;
+   MPI2_CONFIG_REPLY *reply;
+   struct mpr_command *cm;
+   MPI2_CONFIG_PAGE_MAN_11 *page = NULL;
+   int error = 0;
+   u16 ioc_status;
+
+   mpr_dprint(sc, MPR_TRACE, "%s\n", __func__);
+
+   if ((cm = mpr_alloc_command(sc)) == NULL) {
+   printf("%s: command alloc failed @ line %d\n", __func__,
+   __LINE__);
+   error = EBUSY;
+   goto out;
+   }
+   request = (MPI2_CONFIG_REQUEST *)cm->cm_req;
+   bzero(request, sizeof(MPI2_CONFIG_REQUEST));
+   request->Function = MPI2_FUNCTION_CONFIG;
+   request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+   request->Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING;
+   request->Header.PageNumber = 11;
+   request->Header.PageLength = request->Header.PageVersion = 0;
+   cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
+   cm->cm_data = NULL;
+   error = mpr_wait_command(sc, &cm, 60, CAN_SLEEP);
+   reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
+   if (error || (reply == NULL)) {
+   /* FIXME */
+   /*
+* If the request returns an error then we need to do a diag
+* reset
+*/ 
+   printf("%s: request for header completed with error %d",
+   __func__, error);
+   error = ENXIO;
+   goto out;
+   }
+   ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK;
+   bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY));
+   if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+   /* FIXME */
+   /*
+* If the request returns an error then we need to do a diag
+* reset
+*/ 
+   printf("%s: header read with error; iocstatus = 0x%x\n",
+   __func__, ioc_status);
+   error = ENXIO;
+   goto out;
+   }
+   /* We have to do free and alloc for the reply-free and reply-post
+* counters to match - Need to review the reply FIFO handling.
+*/
+   mpr_free_command(sc, cm);
+   
+   if ((cm = mpr_alloc_command(sc)) == NULL) {
+   printf("%s: command alloc failed @ line %d\n", __func__,
+   __LINE__);
+   error = EBUSY;
+   goto out;
+   }
+   request = (MPI2_CONFIG_REQUEST *)cm->cm_req;
+   bzero(request, sizeof(MPI2_CONFIG_REQUEST));
+   request->Function = MPI2_FUNCTION_CONFIG;
+   request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
+   request->Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING;
+   request->Header.PageNumber = 11;
+   request->Header.PageVersion = mpi_reply->Header.PageVersion;
+   request->Header.PageLength = mpi_reply->Header.PageLength;
+   cm->cm_length =  le16toh(mpi_reply->Header.PageLength) * 4;
+   cm->cm_sge = &request->PageBufferSGE;
+   cm->cm_sglsize = sizeof(MPI2_SGE_

svn commit: r342529 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:39:34 2018
New Revision: 342529
URL: https://svnweb.freebsd.org/changeset/base/342529

Log:
  MFC r341785
  
  sfxge(4): use n Tx queues instead of n + 2 on EF10 HW
  
  On EF10 HW we can avoid sending packets without checksum offload
  or with IP-only checksum offload to dedicated queues. Instead, we
  can use option descriptors to change offload policy on any queue
  during runtime. Thus, we don't need to create two dedicated queues.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18390

Modified:
  stable/10/sys/dev/sfxge/sfxge.c
  stable/10/sys/dev/sfxge/sfxge.h
  stable/10/sys/dev/sfxge/sfxge_ev.c
  stable/10/sys/dev/sfxge/sfxge_tx.c
  stable/10/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.c
==
--- stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:39:34 2018
(r342529)
@@ -754,6 +754,11 @@ sfxge_create(struct sfxge_softc *sc)
}
sc->rxq_entries = sfxge_rx_ring_entries;
 
+   if (efx_nic_cfg_get(enp)->enc_features & EFX_FEATURE_TXQ_CKSUM_OP_DESC)
+   sc->txq_dynamic_cksum_toggle_supported = B_TRUE;
+   else
+   sc->txq_dynamic_cksum_toggle_supported = B_FALSE;
+
if (!ISP2(sfxge_tx_ring_entries) ||
(sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) ||
(sfxge_tx_ring_entries > efx_nic_cfg_get(enp)->enc_txq_max_ndescs)) 
{

Modified: stable/10/sys/dev/sfxge/sfxge.h
==
--- stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:39:34 2018
(r342529)
@@ -289,6 +289,8 @@ struct sfxge_softc {
efx_nic_t   *enp;
efsys_lock_tenp_lock;
 
+   boolean_t   txq_dynamic_cksum_toggle_supported;
+
unsigned intrxq_entries;
unsigned inttxq_entries;
 

Modified: stable/10/sys/dev/sfxge/sfxge_ev.c
==
--- stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:39:34 2018
(r342529)
@@ -262,8 +262,11 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx
 {
unsigned int index;
 
-   KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) ||
-   (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
+   KASSERT((evq->sc->txq_dynamic_cksum_toggle_supported) ? (label == 0) :
+   ((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
+(label == SFXGE_TXQ_IP_TCP_UDP_CKSUM)),
+   ("unexpected txq label"));
+
index = (evq->index == 0) ?
label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc));
return (evq->sc->txq[index]);

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:39:34 2018
(r342529)
@@ -33,7 +33,7 @@
 
 /* Theory of operation:
  *
- * Tx queues allocation and mapping
+ * Tx queues allocation and mapping on Siena
  *
  * One Tx queue with enabled checksum offload is allocated per Rx channel
  * (event queue).  Also 2 Tx queues (one without checksum offload and one
@@ -44,6 +44,17 @@
  * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES)
  * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1
  * See sfxge_get_txq_by_label() sfxge_ev.c
+ *
+ * Tx queue allocation and mapping on EF10
+ *
+ * One Tx queue with enabled checksum offload is allocated per Rx
+ * channel (event queue). Checksum offload on all Tx queues is enabled or
+ * disabled dynamically by inserting option descriptors, so the additional
+ * queues used on Siena are not required.
+ *
+ * TxQ label is always set to zero on EF10 hardware.
+ * So, event queue to Tx queue mapping is simple:
+ * TxQ-index = EvQ-index
  */
 
 #include 
@@ -130,38 +141,75 @@ static void sfxge_tx_qlist_post(struct sfxge_txq *txq)
 static void sfxge_tx_qunblock(struct sfxge_txq *txq);
 static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
  const bus_dma_segment_t *dma_seg, int n_dma_seg,
- int vlan_tagged);
+ int n_extra_descs);
 
+static inline void
+sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp)
+{
+   KASSERT((*pstmp)->flags == 

svn commit: r342528 - head/sys/dev/mpr

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:39:22 2018
New Revision: 342528
URL: https://svnweb.freebsd.org/changeset/base/342528

Log:
  Copy back the Sense data at proper location expected by the application
  
  typedef struct mps_pass_thru
  {
 uint64_t   PtrRequest;
 uint64_t   PtrReply;
 uint64_t   PtrData;
 uint32_t   RequestSize;
 uint32_t   ReplySize;
 uint32_t   DataSize;
 uint32_t   DataDirection;
 uint64_t   PtrDataOut;
 uint32_t   DataOutSize;
 uint32_t   Timeout;
  } mps_pass_thru_t, * ptrmpssas_pass_thru_t;
  
  In the above mps_pass_thru structure; Application expects PrtReply buffer
  should contain both MPI reply followed by sense data. So, updated driver
  to copy sense data at PtrReply + sizeof(MPI2 reply) location where
  application wants the driver to copy back the sense data info.
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mpr_user.c

Modified: head/sys/dev/mpr/mpr_user.c
==
--- head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:38:51 2018(r342527)
+++ head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:39:22 2018(r342528)
@@ -1106,7 +1106,8 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru
SenseCount)), sizeof(struct
scsi_sense_data));
mpr_unlock(sc);
-   copyout(cm->cm_sense, cm->cm_req + 64,
+   copyout(cm->cm_sense,
+   (PTRIN(data->PtrReply + 
sizeof(MPI2_SCSI_IO_REPLY))),
sense_len);
mpr_lock(sc);
}
@@ -1140,7 +1141,9 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru
sz = MIN(le32toh(nvme_error_reply->ErrorResponseCount),
NVME_ERROR_RESPONSE_SIZE);
mpr_unlock(sc);
-   copyout(cm->cm_sense, cm->nvme_error_response, sz);
+   copyout(cm->cm_sense,
+   (PTRIN(data->PtrReply +
+   sizeof(MPI2_SCSI_IO_REPLY))), sz);
mpr_lock(sc);
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342527 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:38:51 2018
New Revision: 342527
URL: https://svnweb.freebsd.org/changeset/base/342527

Log:
  MFC r341784
  
  sfxge(4): prepare the number of Tx queues on event queue 0 to become
  variable
  
  The number of Tx queues on event queue 0 can depend on the NIC family
  type, and this property will be leveraged by future patches.
  This patch prepares the code for this change.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18389

Modified:
  stable/10/sys/dev/sfxge/sfxge.c
  stable/10/sys/dev/sfxge/sfxge_ev.c
  stable/10/sys/dev/sfxge/sfxge_tx.c
  stable/10/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.c
==
--- stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:38:51 2018
(r342527)
@@ -134,8 +134,8 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
 
limits.edl_min_evq_count = 1;
limits.edl_max_evq_count = evq_max;
-   limits.edl_min_txq_count = SFXGE_TXQ_NTYPES;
-   limits.edl_max_txq_count = evq_max + SFXGE_TXQ_NTYPES - 1;
+   limits.edl_min_txq_count = SFXGE_EVQ0_N_TXQ(sc);
+   limits.edl_max_txq_count = evq_max + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = 1;
limits.edl_max_rxq_count = evq_max;
 
@@ -151,12 +151,12 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
return (rc);
}
 
-   KASSERT(txq_allocated >= SFXGE_TXQ_NTYPES,
-   ("txq_allocated < SFXGE_TXQ_NTYPES"));
+   KASSERT(txq_allocated >= SFXGE_EVQ0_N_TXQ(sc),
+   ("txq_allocated < %u", SFXGE_EVQ0_N_TXQ(sc)));
 
sc->evq_max = MIN(evq_allocated, evq_max);
sc->evq_max = MIN(rxq_allocated, sc->evq_max);
-   sc->evq_max = MIN(txq_allocated - (SFXGE_TXQ_NTYPES - 1),
+   sc->evq_max = MIN(txq_allocated - (SFXGE_EVQ0_N_TXQ(sc) - 1),
  sc->evq_max);
 
KASSERT(sc->evq_max <= evq_max,
@@ -180,7 +180,7 @@ sfxge_set_drv_limits(struct sfxge_softc *sc)
limits.edl_min_evq_count = limits.edl_max_evq_count =
sc->intr.n_alloc;
limits.edl_min_txq_count = limits.edl_max_txq_count =
-   sc->intr.n_alloc + SFXGE_TXQ_NTYPES - 1;
+   sc->intr.n_alloc + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = limits.edl_max_rxq_count =
sc->intr.n_alloc;
 

Modified: stable/10/sys/dev/sfxge/sfxge_ev.c
==
--- stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:38:51 2018
(r342527)
@@ -262,9 +262,10 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx
 {
unsigned int index;
 
-   KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
+   KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) ||
(label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
-   index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES);
+   index = (evq->index == 0) ?
+   label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc));
return (evq->sc->txq[index]);
 }
 

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:38:51 2018
(r342527)
@@ -1957,7 +1957,7 @@ sfxge_tx_init(struct sfxge_softc *sc)
goto fail_tx_dpl_put_max;
}
 
-   sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc;
+   sc->txq_count = SFXGE_EVQ0_N_TXQ(sc) - 1 + sc->intr.n_alloc;
 
sc->tso_fw_assisted = sfxge_tso_fw_assisted;
if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) ||
@@ -1986,9 +1986,9 @@ sfxge_tx_init(struct sfxge_softc *sc)
goto fail2;
 
for (index = 0;
-index < sc->txq_count - SFXGE_TXQ_NTYPES + 1;
+index < sc->txq_count - SFXGE_EVQ0_N_TXQ(sc) + 1;
 index++) {
-   if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NTYPES - 1 + index,
+   if ((rc = sfxge_tx_qinit(sc, SFXGE_EVQ0_N_TXQ(sc) - 1 + index,
SFXGE_TXQ_IP_TCP_UDP_CKSUM, index)) != 0)
goto fail3;
}

Modified: stable/10/sys/dev/sfxge/sfxge_tx.h
==
--- stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 10:38:51 2018
(r342527)
@@ -137,6 +137,8 @@ enum sfxge_txq_type {
   

svn commit: r342525 - in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 10:37:41 2018
New Revision: 342525
URL: https://svnweb.freebsd.org/changeset/base/342525

Log:
  MFV r342469: 9630 add lzc_rename and lzc_destroy to libzfs_core
  
  illumos/illumos-gate@049ba636fa37a2892809192fc671bff9158a01cd
  
https://github.com/illumos/illumos-gate/commit/049ba636fa37a2892809192fc671bff9158a01cd
  
  https://www.illumos.org/issues/9630
Rename and destroy are very useful operations that deserve to be in
libzfs_core.  And they are not hard to implement too.
  
  MFC after:2 weeks
  Relnotes: maybe

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
  head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
  head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.cWed Dec 
26 10:37:06 2018(r342524)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.cWed Dec 
26 10:37:41 2018(r342525)
@@ -3647,32 +3647,34 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs
 int
 zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
 {
-   zfs_cmd_t zc = { 0 };
+   int error;
 
+   if (zhp->zfs_type != ZFS_TYPE_SNAPSHOT && defer)
+   return (EINVAL);
+
if (zhp->zfs_type == ZFS_TYPE_BOOKMARK) {
nvlist_t *nv = fnvlist_alloc();
fnvlist_add_boolean(nv, zhp->zfs_name);
-   int error = lzc_destroy_bookmarks(nv, NULL);
+   error = lzc_destroy_bookmarks(nv, NULL);
fnvlist_free(nv);
if (error != 0) {
-   return (zfs_standard_error_fmt(zhp->zfs_hdl, errno,
+   return (zfs_standard_error_fmt(zhp->zfs_hdl, error,
dgettext(TEXT_DOMAIN, "cannot destroy '%s'"),
zhp->zfs_name));
}
return (0);
}
 
-   (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-   if (ZFS_IS_VOLUME(zhp)) {
-   zc.zc_objset_type = DMU_OST_ZVOL;
+   if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
+   nvlist_t *nv = fnvlist_alloc();
+   fnvlist_add_boolean(nv, zhp->zfs_name);
+   error = lzc_destroy_snaps(nv, defer, NULL);
+   fnvlist_free(nv);
} else {
-   zc.zc_objset_type = DMU_OST_ZFS;
+   error = lzc_destroy(zhp->zfs_name);
}
 
-   zc.zc_defer_destroy = defer;
-   if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY, &zc) != 0 &&
-   errno != ENOENT) {
+   if (error != 0 && error != ENOENT) {
return (zfs_standard_error_fmt(zhp->zfs_hdl, errno,
dgettext(TEXT_DOMAIN, "cannot destroy '%s'"),
zhp->zfs_name));

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c   Wed Dec 
26 10:37:06 2018(r342524)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c   Wed Dec 
26 10:37:41 2018(r342525)
@@ -2140,7 +2140,6 @@ recv_rename(libzfs_handle_t *hdl, const char *name, co
 int baselen, char *newname, recvflags_t *flags)
 {
static int seq;
-   zfs_cmd_t zc = { 0 };
int err;
prop_changelist_t *clp;
zfs_handle_t *zhp;
@@ -2157,19 +2156,13 @@ recv_rename(libzfs_handle_t *hdl, const char *name, co
if (err)
return (err);
 
-   zc.zc_objset_type = DMU_OST_ZFS;
-   (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name));
-
if (tryname) {
(void) strcpy(newname, tryname);
-
-   (void) strlcpy(zc.zc_value, tryname, sizeof (zc.zc_value));
-
if (flags->verbose) {
(void) printf("attempting rename %s to %s\n",
-   zc.zc_name, zc.zc_value);
+   name, newname);
}
-   err = ioctl(hdl->libzfs_fd, ZFS_IOC_RENAME, &zc);
+   err = lzc_rename(name, newname);
if (err == 0)
changelist_rename(clp, name, tryname);
} else {
@@ -2181,13 +2174,11 @@ recv_rename(libzfs_handle_t *hdl, const char *name, co
 
(void) snprintf(newname, ZFS_MAX_DATASET_NAME_LEN,
"%.*srecv-%u-%u", ba

svn commit: r342526 - head/sys/dev/mpr/mpi

2018-12-26 Thread Kashyap D Desai
Author: kadesai
Date: Wed Dec 26 10:38:12 2018
New Revision: 342526
URL: https://svnweb.freebsd.org/changeset/base/342526

Log:
  Update MPI header files version to 2.00.52 from 2.00.48
  
  Submitted by: Sreekanth Reddy 
  Reviewed by:  Kashyap Desai 
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mpi/mpi2.h
  head/sys/dev/mpr/mpi/mpi2_cnfg.h
  head/sys/dev/mpr/mpi/mpi2_hbd.h
  head/sys/dev/mpr/mpi/mpi2_history.txt
  head/sys/dev/mpr/mpi/mpi2_init.h
  head/sys/dev/mpr/mpi/mpi2_ioc.h
  head/sys/dev/mpr/mpi/mpi2_pci.h
  head/sys/dev/mpr/mpi/mpi2_ra.h
  head/sys/dev/mpr/mpi/mpi2_raid.h
  head/sys/dev/mpr/mpi/mpi2_sas.h
  head/sys/dev/mpr/mpi/mpi2_targ.h
  head/sys/dev/mpr/mpi/mpi2_tool.h
  head/sys/dev/mpr/mpi/mpi2_type.h

Modified: head/sys/dev/mpr/mpi/mpi2.h
==
--- head/sys/dev/mpr/mpi/mpi2.h Wed Dec 26 10:37:41 2018(r342525)
+++ head/sys/dev/mpr/mpi/mpi2.h Wed Dec 26 10:38:12 2018(r342526)
@@ -1,7 +1,5 @@
 /*-
- * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2016 Avago Technologies
- * All rights reserved.
+ *  Copyright 2000-2020 Broadcom Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,15 +25,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2015 LSI Corporation.
- *  Copyright (c) 2013-2016 Avago Technologies
- *  All rights reserved.
+ *  Copyright 2000-2020 Broadcom Inc. All rights reserved.
  *
  *
  *   Name:  mpi2.h
@@ -44,7 +40,7 @@
  *  scatter/gather formats.
  *  Creation Date:  June 21, 2006
  *
- *  mpi2.h Version:  02.00.48
+ *  mpi2.h Version:  02.00.52
  *
  *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *prefix are for use only on MPI v2.5 products, and must not be used
@@ -153,6 +149,11 @@
  *  09-02-16  02.00.46  Bumped MPI2_HEADER_VERSION_UNIT.
  *  11-23-16  02.00.47  Bumped MPI2_HEADER_VERSION_UNIT.
  *  02-03-17  02.00.48  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  06-13-17  02.00.49  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  09-29-17  02.00.50  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  07-22-18  02.00.51  Added SECURE_BOOT define.
+ *  Bumped MPI2_HEADER_VERSION_UNIT
+ *  08-15-18  02.00.52  Bumped MPI2_HEADER_VERSION_UNIT.
  *  --
  */
 
@@ -196,7 +197,7 @@
 
 
 /* Unit and Dev versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x30)
+#define MPI2_HEADER_VERSION_UNIT(0x34)
 #define MPI2_HEADER_VERSION_DEV (0x00)
 #define MPI2_HEADER_VERSION_UNIT_MASK   (0xFF00)
 #define MPI2_HEADER_VERSION_UNIT_SHIFT  (8)
@@ -297,6 +298,8 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS
  * Defines for the HostDiagnostic register
  */
 #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x0008)
+
+#define MPI26_DIAG_SECURE_BOOT  (0x8000)
 
 #define MPI2_DIAG_SBR_RELOAD(0x2000)
 

Modified: head/sys/dev/mpr/mpi/mpi2_cnfg.h
==
--- head/sys/dev/mpr/mpi/mpi2_cnfg.hWed Dec 26 10:37:41 2018
(r342525)
+++ head/sys/dev/mpr/mpi/mpi2_cnfg.hWed Dec 26 10:38:12 2018
(r342526)
@@ -1,7 +1,5 @@
 /*-
- * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2016 Avago Technologies
- * All rights reserved.
+ *  Copyright 2000-2020 Broadcom Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,22 +25,20 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2015 LSI Corporation.
- *  Copyright (c) 2013-2016 Avago Technologies
- *  All rights reserved.
+ *  Copyright 2000-2020 Broadcom Inc. All rights reserved.
  *
  *
  *   Name:  mpi2_cnfg.h
  *  Title:  MPI Configuration messages and pages
  *  Creation Date:  November 10, 2006
  *
- *mpi2_cnfg.h Version:  02.00.40
+ *mpi2_cnfg.h Version:  02.00.45
  *
  *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *prefix are for use only on MPI v2.5 products, and must not be used
@@ -259,6 +255,27 @@
  *  Added ChassisSlot field to SAS Enclosure Page 0.
  *  Added ChassisSlot Valid bit (bit

svn commit: r342524 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:37:06 2018
New Revision: 342524
URL: https://svnweb.freebsd.org/changeset/base/342524

Log:
  MFC r341783
  
  sfxge(4): report support for Tx checksum op descriptors
  
  FreeBSD driver needs a patch to provide a means for packets
  which do not need checksum offload but have flow ID set
  to avoid hitting only the first Tx queue (which has been used
  for packets not needing checksum offload).
  
  This should be possible on Huntington, Medford or Medford2 chips
  since these support toggling checksum offload on any given queue
  dynamically by means of pushing option descriptors.
  
  The patch for FreeBSD driver will then need a means to figure out
  whether the feature can be used, and testing adapter family might
  not be a good solution.
  
  This patch adds a feature bit specifically to indicate support
  for checksum option descriptors. The new feature bits may have
  more users in future, apart from the mentioned FreeBSD patch.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18388

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:35:41 2018
(r342523)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:37:06 2018
(r342524)
@@ -1084,6 +1084,7 @@ efx_bist_stop(
 #defineEFX_FEATURE_PIO_BUFFERS 0x0800
 #defineEFX_FEATURE_FW_ASSISTED_TSO 0x1000
 #defineEFX_FEATURE_FW_ASSISTED_TSO_V2  0x2000
+#defineEFX_FEATURE_TXQ_CKSUM_OP_DESC   0x8000
 
 typedef enum efx_tunnel_protocol_e {
EFX_TUNNEL_PROTOCOL_NONE = 0,

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:35:41 2018
(r342523)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:37:06 2018
(r342524)
@@ -215,7 +215,8 @@ efx_nic_create(
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
EFX_FEATURE_FW_ASSISTED_TSO |
-   EFX_FEATURE_FW_ASSISTED_TSO_V2;
+   EFX_FEATURE_FW_ASSISTED_TSO_V2 |
+   EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
@@ -234,7 +235,8 @@ efx_nic_create(
EFX_FEATURE_MAC_HEADER_FILTERS |
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
-   EFX_FEATURE_FW_ASSISTED_TSO_V2;
+   EFX_FEATURE_FW_ASSISTED_TSO_V2 |
+   EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
 #endif /* EFSYS_OPT_MEDFORD */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342523 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:35:41 2018
New Revision: 342523
URL: https://svnweb.freebsd.org/changeset/base/342523

Log:
  MFC r341782
  
  sfxge(4): populate per-event queue stats in sysctl
  
  In order to find out why the first event queue and corresponding
  interrupt is triggered more frequent, it is useful to know which
  events go to each event queue.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18418

Modified:
  stable/10/sys/dev/sfxge/sfxge.h
  stable/10/sys/dev/sfxge/sfxge_ev.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.h
==
--- stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:28:43 2018
(r342522)
+++ stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:35:41 2018
(r342523)
@@ -181,6 +181,10 @@ struct sfxge_evq {
unsigned intbuf_base_id;
unsigned intentries;
charlock_name[SFXGE_LOCK_NAME_MAX];
+#if EFSYS_OPT_QSTATS
+   clock_t stats_update_time;
+   uint64_tstats[EV_NQSTATS];
+#endif
 } __aligned(CACHE_LINE_SIZE);
 
 #defineSFXGE_NDESCS1024
@@ -272,6 +276,9 @@ struct sfxge_softc {
struct ifnet*ifnet;
unsigned intif_flags;
struct sysctl_oid   *stats_node;
+#if EFSYS_OPT_QSTATS
+   struct sysctl_oid   *evqs_stats_node;
+#endif
struct sysctl_oid   *txqs_node;
 
struct task task_reset;

Modified: stable/10/sys/dev/sfxge/sfxge_ev.c
==
--- stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:28:43 2018
(r342522)
+++ stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:35:41 2018
(r342523)
@@ -436,29 +436,94 @@ sfxge_ev_wake_up(void *arg, uint32_t index)
 #if EFSYS_OPT_QSTATS
 
 static void
+sfxge_evq_stat_update(struct sfxge_evq *evq)
+{
+   clock_t now;
+
+   SFXGE_EVQ_LOCK(evq);
+
+   if (__predict_false(evq->init_state != SFXGE_EVQ_STARTED))
+   goto out;
+
+   now = ticks;
+   if ((unsigned int)(now - evq->stats_update_time) < (unsigned int)hz)
+   goto out;
+
+   evq->stats_update_time = now;
+   efx_ev_qstats_update(evq->common, evq->stats);
+
+out:
+   SFXGE_EVQ_UNLOCK(evq);
+}
+
+static int
+sfxge_evq_stat_handler(SYSCTL_HANDLER_ARGS)
+{
+   struct sfxge_evq *evq = arg1;
+   struct sfxge_softc *sc = evq->sc;
+   unsigned int id = arg2;
+
+   SFXGE_ADAPTER_LOCK(sc);
+
+   sfxge_evq_stat_update(evq);
+
+   SFXGE_ADAPTER_UNLOCK(sc);
+
+   return (SYSCTL_OUT(req, &evq->stats[id], sizeof(evq->stats[id])));
+}
+
+static int
+sfxge_evq_stat_init(struct sfxge_evq *evq)
+{
+   struct sfxge_softc *sc = evq->sc;
+   struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev);
+   char name[16];
+   struct sysctl_oid *evq_stats_node;
+   unsigned int id;
+
+   snprintf(name, sizeof(name), "%u", evq->index);
+   evq_stats_node = SYSCTL_ADD_NODE(ctx,
+SYSCTL_CHILDREN(sc->evqs_stats_node),
+OID_AUTO, name, CTLFLAG_RD, NULL, "");
+   if (evq_stats_node == NULL)
+   return (ENOMEM);
+
+   for (id = 0; id < EV_NQSTATS; id++) {
+   SYSCTL_ADD_PROC(
+   ctx, SYSCTL_CHILDREN(evq_stats_node),
+   OID_AUTO, efx_ev_qstat_name(sc->enp, id),
+   CTLTYPE_U64|CTLFLAG_RD,
+   evq, id, sfxge_evq_stat_handler, "Q",
+   "");
+   }
+
+   return (0);
+}
+
+static void
 sfxge_ev_stat_update(struct sfxge_softc *sc)
 {
struct sfxge_evq *evq;
unsigned int index;
clock_t now;
+   unsigned int id;
 
SFXGE_ADAPTER_LOCK(sc);
 
-   if (__predict_false(sc->evq[0]->init_state != SFXGE_EVQ_STARTED))
-   goto out;
-
now = ticks;
if ((unsigned int)(now - sc->ev_stats_update_time) < (unsigned int)hz)
goto out;
 
sc->ev_stats_update_time = now;
 
-   /* Add event counts from each event queue in turn */
+   memset(sc->ev_stats, 0, sizeof(sc->ev_stats));
+
+   /* Update and add event counts from each event queue in turn */
for (index = 0; index < sc->evq_count; index++) {
evq = sc->evq[index];
-   SFXGE_EVQ_LOCK(evq);
-   efx_ev_qstats_update(evq->common, sc->ev_stats);
-   SFXGE_EVQ_UNLOCK(evq);
+   sfxge_evq_stat_update(evq);
+   for (id = 0; id < EV_NQSTATS; id++)
+   sc->ev_stats[id] += evq->stats[id];
}
 out:
SFXGE_ADAPTER_UNLOCK(sc);
@@ -665,7 +

svn commit: r342521 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:28:03 2018
New Revision: 342521
URL: https://svnweb.freebsd.org/changeset/base/342521

Log:
  MFC r341326
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18287

Modified:
  stable/10/sys/dev/sfxge/common/efx_ev.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==
--- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:27:24 2018
(r342520)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:28:03 2018
(r342521)
@@ -501,6 +501,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;
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342522 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:28:43 2018
New Revision: 342522
URL: https://svnweb.freebsd.org/changeset/base/342522

Log:
  MFC r341327
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18288

Modified:
  stable/10/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:28:03 2018
(r342521)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:28:43 2018
(r342522)
@@ -352,6 +352,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"));
@@ -403,6 +404,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);
@@ -454,6 +457,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. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342519 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:26:58 2018
New Revision: 342519
URL: https://svnweb.freebsd.org/changeset/base/342519

Log:
  MFC r341309
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18271

Modified:
  stable/10/sys/dev/sfxge/common/ef10_mac.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_mac.c
==
--- stable/10/sys/dev/sfxge/common/ef10_mac.c   Wed Dec 26 10:26:24 2018
(r342518)
+++ stable/10/sys/dev/sfxge/common/ef10_mac.c   Wed Dec 26 10:26:58 2018
(r342519)
@@ -611,7 +611,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);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342520 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:27:24 2018
New Revision: 342520
URL: https://svnweb.freebsd.org/changeset/base/342520

Log:
  MFC r341311
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18273

Modified:
  stable/10/sys/dev/sfxge/common/efx_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_phy.c
==
--- stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:26:58 2018
(r342519)
+++ stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:27:24 2018
(r342520)
@@ -312,7 +312,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;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342518 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:26:24 2018
New Revision: 342518
URL: https://svnweb.freebsd.org/changeset/base/342518

Log:
  MFC r341302
  
  sfxge(4): fix a typo in unicast filter insertion comment
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18264

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:25:55 
2018(r342517)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:26:24 
2018(r342518)
@@ -1488,7 +1488,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.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342517 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:25:55 2018
New Revision: 342517
URL: https://svnweb.freebsd.org/changeset/base/342517

Log:
  MFC r341301
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18263

Modified:
  stable/10/sys/dev/sfxge/common/efx_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:25:01 2018
(r342516)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:25:55 2018
(r342517)
@@ -541,6 +541,7 @@ efx_nic_cfg_get(
__inefx_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));
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342515 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:23:16 2018
New Revision: 342515
URL: https://svnweb.freebsd.org/changeset/base/342515

Log:
  MFC r341295
  
  sfxge(4): avoid usage of too big arrays on stack
  
  Found by PreFAST static analysis.
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18257

Modified:
  stable/10/sys/dev/sfxge/common/ef10_phy.c
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:22:49 2018
(r342514)
+++ stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:23:16 2018
(r342515)
@@ -528,14 +528,26 @@ ef10_bist_poll(
unsigned long *valuesp,
__insize_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));
@@ -543,7 +555,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: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:22:49 2018
(r342514)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:23:16 2018
(r342515)
@@ -862,23 +862,27 @@ efx_mcdi_nvram_write(
__insize_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);
@@ -896,11 +900,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:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342513 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:22:18 2018
New Revision: 342513
URL: https://svnweb.freebsd.org/changeset/base/342513

Log:
  MFC r341215
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18246

Modified:
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:21:40 2018
(r342512)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:22:18 2018
(r342513)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #include "efx.h"
 #include "efx_impl.h"
+#include "mcdi_mon.h"
 
 #if EFSYS_OPT_MON_MCDI
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342516 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:25:01 2018
New Revision: 342516
URL: https://svnweb.freebsd.org/changeset/base/342516

Log:
  MFC r341297
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18259

Modified:
  stable/10/sys/dev/sfxge/common/ef10_ev.c
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/ef10_intr.c
  stable/10/sys/dev/sfxge/common/ef10_mac.c
  stable/10/sys/dev/sfxge/common/ef10_nic.c
  stable/10/sys/dev/sfxge/common/ef10_phy.c
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx_lic.c
  stable/10/sys/dev/sfxge/common/efx_mcdi.c
  stable/10/sys/dev/sfxge/common/efx_mcdi.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/efx_nvram.c
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
  stable/10/sys/dev/sfxge/common/medford_nic.c
  stable/10/sys/dev/sfxge/common/siena_mac.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
  stable/10/sys/dev/sfxge/common/siena_nvram.c
  stable/10/sys/dev/sfxge/common/siena_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:23:16 2018
(r342515)
+++ stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:25:01 2018
(r342516)
@@ -100,11 +100,10 @@ efx_mcdi_set_evq_tmr(
__inuint32_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(
__inboolean_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(
__inuint32_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(
__inuint32_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;
@@ -627,8 +623,8 @@ efx_mcdi_driver_event(
__inefx_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: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:23:16 
2018(r342515)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 

svn commit: r342514 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:22:49 2018
New Revision: 342514
URL: https://svnweb.freebsd.org/changeset/base/342514

Log:
  MFC r341290
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18252

Modified:
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:22:18 2018
(r342513)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:22:49 2018
(r342514)
@@ -322,7 +322,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;
@@ -339,6 +345,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
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342511 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:20:54 2018
New Revision: 342511
URL: https://svnweb.freebsd.org/changeset/base/342511

Log:
  MFC r341213
  
  sfxge(4): fix PreFAST warnings because of unused return
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18244

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/ef10_mac.c
  stable/10/sys/dev/sfxge/common/ef10_nic.c
  stable/10/sys/dev/sfxge/common/ef10_nvram.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:20:02 
2018(r342510)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:20:54 
2018(r342511)
@@ -1054,12 +1054,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 <=
@@ -1067,6 +1070,8 @@ ef10_filter_insert_unicast(
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
@@ -1085,11 +1090,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 <=
@@ -1097,6 +1104,8 @@ ef10_filter_insert_all_unicast(
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
@@ -1138,9 +1147,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);
@@ -1163,8 +1184,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);
@@ -1212,12 +1237,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_mulc

svn commit: r342512 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:21:40 2018
New Revision: 342512
URL: https://svnweb.freebsd.org/changeset/base/342512

Log:
  MFC r341214
  
  sfxge(4): fix SAL annotation for input buffers
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18245

Modified:
  stable/10/sys/dev/sfxge/common/ef10_impl.h
  stable/10/sys/dev/sfxge/common/ef10_nvram.c
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:21:40 2018
(r342512)
@@ -440,7 +440,7 @@ ef10_nvram_partn_read(
__inefx_nic_t *enp,
__inuint32_t partn,
__inunsigned int offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size);
 
 extern __checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:21:40 2018
(r342512)
@@ -2000,7 +2000,7 @@ ef10_nvram_partn_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inunsigned int offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size)
 {
size_t chunk;

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:21:40 2018
(r342512)
@@ -538,7 +538,7 @@ efx_mcdi_nvram_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inuint32_t offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size);
 
__checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:21:40 2018
(r342512)
@@ -858,7 +858,7 @@ efx_mcdi_nvram_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inuint32_t offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size)
 {
efx_mcdi_req_t req;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342510 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:20:02 2018
New Revision: 342510
URL: https://svnweb.freebsd.org/changeset/base/342510

Log:
  MFC r341197
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18228

Modified:
  stable/10/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_port.c
==
--- stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:19:12 2018
(r342509)
+++ stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:20:02 2018
(r342510)
@@ -147,7 +147,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;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342509 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:19:12 2018
New Revision: 342509
URL: https://svnweb.freebsd.org/changeset/base/342509

Log:
  MFC r341038
  
  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:
  stable/10/sys/dev/sfxge/common/ef10_impl.h
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:19:12 2018
(r342509)
@@ -759,6 +759,11 @@ ef10_tx_qdesc_vlantci_create(
__inuint16_t vlan_tci,
__out   efx_desc_t *edp);
 
+extern void
+ef10_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp);
 
 #if EFSYS_OPT_QSTATS
 

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:19:12 2018
(r342509)
@@ -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(
+   __inefx_txq_t *etp,
+   __inuint16_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: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:19:12 2018
(r342509)
@@ -2110,6 +2110,12 @@ efx_tx_qdesc_vlantci_create(
__inuint16_t tci,
__out   efx_desc_t *edp);
 
+extern void
+efx_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp);
+
 #if EFSYS_OPT_QSTATS
 
 #if EFSYS_OPT_NAMES

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:19:12 2018
(r342509)
@@ -141,6 +141,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,
+  

svn commit: r342508 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:17:44 2018
New Revision: 342508
URL: https://svnweb.freebsd.org/changeset/base/342508

Log:
  MFC r340896
  
  sfxge(4): remove Falcon-specific concurrency check
  
  Falcon support has been withdrawn from libefx, however, there is still
  an obsolete Falcon-specific assertion that efx_mac_stats_upload()
  and efx_port_poll() aren't concurrent. To be consistent with an overall
  Falcon support revocation it's desirable to remove it.
  
  Fix debug build invalid assertion failure.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D1813

Modified:
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_mac.c
  stable/10/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:16:48 2018
(r342507)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:17:44 2018
(r342508)
@@ -285,7 +285,6 @@ typedef struct efx_port_s {
uint32_tep_default_adv_cap_mask;
uint32_tep_phy_cap_mask;
boolean_t   ep_mac_drain;
-   boolean_t   ep_mac_stats_pending;
 #if EFSYS_OPT_BIST
efx_bist_type_t ep_current_bist;
 #endif

Modified: stable/10/sys/dev/sfxge/common/efx_mac.c
==
--- stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:16:48 2018
(r342507)
+++ stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:17:44 2018
(r342508)
@@ -729,16 +729,9 @@ efx_mac_stats_upload(
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
EFSYS_ASSERT(emop != NULL);
 
-   /*
-* Don't assert !ep_mac_stats_pending, because the client might
-* have failed to finalise statistics when previously stopping
-* the port.
-*/
if ((rc = emop->emo_stats_upload(enp, esmp)) != 0)
goto fail1;
 
-   epp->ep_mac_stats_pending = B_TRUE;
-
return (0);
 
 fail1:
@@ -798,8 +791,6 @@ efx_mac_stats_update(
EFSYS_ASSERT(emop != NULL);
 
rc = emop->emo_stats_update(enp, esmp, essp, generationp);
-   if (rc == 0)
-   epp->ep_mac_stats_pending = B_FALSE;
 
return (rc);
 }

Modified: stable/10/sys/dev/sfxge/common/efx_port.c
==
--- stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:16:48 2018
(r342507)
+++ stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:17:44 2018
(r342508)
@@ -112,7 +112,6 @@ efx_port_poll(
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
 
EFSYS_ASSERT(emop != NULL);
-   EFSYS_ASSERT(!epp->ep_mac_stats_pending);
 
if (link_modep == NULL)
link_modep = &ignore_link_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342507 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:16:48 2018
New Revision: 342507
URL: https://svnweb.freebsd.org/changeset/base/342507

Log:
  MFC r340895
  
  sfxge(4): move BIU test code into Siena-specific file
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18129

Modified:
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:16:11 2018
(r342506)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:16:48 2018
(r342507)
@@ -1048,10 +1048,6 @@ struct efx_txq_s {
} while (B_FALSE)
 
 extern __checkReturn   efx_rc_t
-efx_nic_biu_test(
-   __inefx_nic_t *enp);
-
-extern __checkReturn   efx_rc_t
 efx_mac_select(
__inefx_nic_t *enp);
 

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:16:11 2018
(r342506)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:16:48 2018
(r342507)
@@ -105,78 +105,6 @@ efx_family(
return (ENOTSUP);
 }
 
-
-#defineEFX_BIU_MAGIC0  0x01234567
-#defineEFX_BIU_MAGIC1  0xfedcba98
-
-   __checkReturn   efx_rc_t
-efx_nic_biu_test(
-   __inefx_nic_t *enp)
-{
-   efx_oword_t oword;
-   efx_rc_t rc;
-
-   /*
-* Write magic values to scratch registers 0 and 1, then
-* verify that the values were written correctly.  Interleave
-* the accesses to ensure that the BIU is not just reading
-* back the cached value that was last written.
-*/
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
-   rc = EIO;
-   goto fail1;
-   }
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
-   rc = EIO;
-   goto fail2;
-   }
-
-   /*
-* Perform the same test, with the values swapped.  This
-* ensures that subsequent tests don't start with the correct
-* values already written into the scratch registers.
-*/
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
-   rc = EIO;
-   goto fail3;
-   }
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
-   rc = EIO;
-   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);
-}
-
 #if EFSYS_OPT_SIENA
 
 static const efx_nic_ops_t __efx_nic_siena_ops = {

Modified: stable/10/sys/dev/sfxge/common/siena_nic.c
==
--- stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:16:11 2018
(r342506)
+++ stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:16:48 2018
(r342507)
@@ -211,6 +211,77 @@ fail1:
return (rc);
 }
 
+#defineSIENA_BIU_MAGIC00x01234567
+#defineSIENA_BIU_MAGIC10xfedcba98
+
+static __checkReturn   efx_rc_t
+siena_nic_biu_test(
+   __inefx_nic_t *enp)
+{
+   efx_oword_t oword;
+   efx_rc_t rc;
+
+   /*
+* Write magic values to scratch registers 0 and 1, then
+* verify that the values were written correctly.  Interleave
+* the accesses to ensure that the BIU is not just reading
+* back the cached value that was last written.
+*/
+   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0);
+   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
+
+   EFX_POPULAT

svn commit: r342506 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:16:11 2018
New Revision: 342506
URL: https://svnweb.freebsd.org/changeset/base/342506

Log:
  MFC r340894
  
  sfxge(4): fix PreFAST static analysis warning (C6001)
  
  Fix warning
  "C6001: Using uninitialized memory '*sensor_maskp'"
  which could occur when the npages argument to efx_mcdi_sensor_info()
  is less than or equal to zero.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18128

Modified:
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:15:31 2018
(r342505)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:16:11 2018
(r342506)
@@ -397,6 +397,11 @@ efx_mcdi_sensor_info(
 
EFSYS_ASSERT(sensor_maskp != NULL);
 
+   if (npages < 1) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
for (page = 0; page < npages; page++) {
uint32_t mask;
 
@@ -413,7 +418,7 @@ efx_mcdi_sensor_info(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail1;
+   goto fail2;
}
 
mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK);
@@ -421,18 +426,20 @@ efx_mcdi_sensor_info(
if ((page != (npages - 1)) &&
((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) {
rc = EINVAL;
-   goto fail2;
+   goto fail3;
}
sensor_maskp[page] = mask;
}
 
if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) {
rc = EINVAL;
-   goto fail3;
+   goto fail4;
}
 
return (0);
 
+fail4:
+   EFSYS_PROBE(fail4);
 fail3:
EFSYS_PROBE(fail3);
 fail2:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342505 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:15:31 2018
New Revision: 342505
URL: https://svnweb.freebsd.org/changeset/base/342505

Log:
  MFC r340892
  
  sfxge(4): remove obsolete check for pre-Siena hardware
  
  The fail4 label was used twice, so it doesn't need removing.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18126

Modified:
  stable/10/sys/dev/sfxge/common/efx_rx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_rx.c
==
--- stable/10/sys/dev/sfxge/common/efx_rx.c Wed Dec 26 10:14:29 2018
(r342504)
+++ stable/10/sys/dev/sfxge/common/efx_rx.c Wed Dec 26 10:15:31 2018
(r342505)
@@ -1164,10 +1164,6 @@ siena_rx_qcreate(
 
 #if EFSYS_OPT_RX_SCATTER
case EFX_RXQ_TYPE_SCATTER:
-   if (enp->en_family < EFX_FAMILY_SIENA) {
-   rc = EINVAL;
-   goto fail4;
-   }
jumbo = B_TRUE;
break;
 #endif /* EFSYS_OPT_RX_SCATTER */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342504 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:14:29 2018
New Revision: 342504
URL: https://svnweb.freebsd.org/changeset/base/342504

Log:
  MFC r340891
  
  sfxge(4): fix warnings from VS2015 C compiler (C4214)
  
  Fix multiple level 4 warnings
  "C4214: nonstandard extension used: bit field types other than int";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18125

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:13:42 2018
(r342503)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:14:29 2018
(r342504)
@@ -2159,7 +2159,7 @@ efx_tx_qdestroy(
 /* Filter is for TX */
 #defineEFX_FILTER_FLAG_TX  0x10
 
-typedef unsigned int efx_filter_flags_t;
+typedef uint8_t efx_filter_flags_t;
 
 /*
  * Flags which specify the fields to match on. The values are the same as in 
the
@@ -2216,22 +2216,22 @@ typedef enum efx_filter_priority_s {
  */
 
 typedef struct efx_filter_spec_s {
-   uint32_tefs_match_flags;
-   uint32_tefs_priority:2;
-   uint32_tefs_flags:6;
-   uint32_tefs_dmaq_id:12;
-   uint32_tefs_rss_context;
-   uint16_tefs_outer_vid;
-   uint16_tefs_inner_vid;
-   uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN];
-   uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN];
-   uint16_tefs_ether_type;
-   uint8_t efs_ip_proto;
-   efx_tunnel_protocol_t   efs_encap_type;
-   uint16_tefs_loc_port;
-   uint16_tefs_rem_port;
-   efx_oword_t efs_rem_host;
-   efx_oword_t efs_loc_host;
+   efx_filter_match_flags_tefs_match_flags;
+   uint8_t efs_priority;
+   efx_filter_flags_t  efs_flags;
+   uint16_tefs_dmaq_id;
+   uint32_tefs_rss_context;
+   uint16_tefs_outer_vid;
+   uint16_tefs_inner_vid;
+   uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN];
+   uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN];
+   uint16_tefs_ether_type;
+   uint8_t efs_ip_proto;
+   efx_tunnel_protocol_t   efs_encap_type;
+   uint16_tefs_loc_port;
+   uint16_tefs_rem_port;
+   efx_oword_t efs_rem_host;
+   efx_oword_t efs_loc_host;
 } efx_filter_spec_t;
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342503 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:13:42 2018
New Revision: 342503
URL: https://svnweb.freebsd.org/changeset/base/342503

Log:
  MFC r340890
  
  sfxge(4): fix warnings from VS2015 C compiler (C4057)
  
  Fix two level 4 warnings
  "C4057: 'function': 'const uint8_t *' differs in indirection to
  slightly different base types from 'caddr_t'"; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18124

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_bootcfg.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:12:15 2018
(r342502)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:13:42 2018
(r342503)
@@ -1464,13 +1464,13 @@ efx_bootcfg_copy_sector(
 extern efx_rc_t
 efx_bootcfg_read(
__inefx_nic_t *enp,
-   __out_bcount(size)  caddr_t data,
+   __out_bcount(size)  uint8_t *data,
__insize_t size);
 
 extern efx_rc_t
 efx_bootcfg_write(
__inefx_nic_t *enp,
-   __in_bcount(size)   caddr_t data,
+   __in_bcount(size)   uint8_t *data,
__insize_t size);
 
 #endif /* EFSYS_OPT_BOOTCFG */

Modified: stable/10/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:12:15 
2018(r342502)
+++ stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:13:42 
2018(r342503)
@@ -293,7 +293,7 @@ fail1:
efx_rc_t
 efx_bootcfg_read(
__inefx_nic_t *enp,
-   __out_bcount(size)  caddr_t data,
+   __out_bcount(size)  uint8_t *data,
__insize_t size)
 {
uint8_t *payload = NULL;
@@ -356,7 +356,7 @@ efx_bootcfg_read(
goto fail7;
 
/* Verify that the area is correctly formatted and checksummed */
-   rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
+   rc = efx_bootcfg_verify(enp, payload, sector_length,
&used_bytes);
if (rc != 0 || used_bytes == 0) {
payload[0] = (uint8_t)(~DHCP_END & 0xff);
@@ -433,7 +433,7 @@ fail1:
efx_rc_t
 efx_bootcfg_write(
__inefx_nic_t *enp,
-   __in_bcount(size)   caddr_t data,
+   __in_bcount(size)   uint8_t *data,
__insize_t size)
 {
uint8_t *partn_data;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342502 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:12:15 2018
New Revision: 342502
URL: https://svnweb.freebsd.org/changeset/base/342502

Log:
  MFC r340889
  
  sfxge(4): fix warnings from VS2015 C compiler (C4189)
  
  Fix multiple level 4 warnings
  "C4189: 'xxx': local variable is initialized but not referenced";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18123

Modified:
  stable/10/sys/dev/sfxge/common/ef10_ev.c
  stable/10/sys/dev/sfxge/common/efx_ev.c
  stable/10/sys/dev/sfxge/common/efx_tx.c
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:12:15 2018
(r342502)
@@ -576,7 +576,7 @@ ef10_ev_qdestroy(
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
 
-   (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index);
+   (void) efx_mcdi_fini_evq(enp, eep->ee_index);
 }
 
__checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==
--- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:12:15 2018
(r342502)
@@ -226,14 +226,14 @@ efx_ev_qcreate(
__deref_out efx_evq_t **eepp)
 {
const efx_ev_ops_t *eevop = enp->en_eevop;
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_evq_t *eep;
efx_rc_t rc;
 
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
 
-   EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit);
+   EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <,
+   enp->en_nic_cfg.enc_evq_limit);
 
switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) {
case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT:

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==
--- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:12:15 2018
(r342502)
@@ -301,14 +301,14 @@ efx_tx_qcreate(
__out   unsigned int *addedp)
 {
const efx_tx_ops_t *etxop = enp->en_etxop;
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_txq_t *etp;
efx_rc_t rc;
 
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
 
-   EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit);
+   EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <,
+   enp->en_nic_cfg.enc_txq_limit);
 
/* Allocate an TXQ object */
EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp);

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:12:15 2018
(r342502)
@@ -265,7 +265,6 @@ mcdi_mon_ev(
__out   efx_mon_stat_value_t *valuep)
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint16_t port_mask;
uint16_t sensor;
uint16_t state;
@@ -281,11 +280,13 @@ mcdi_mon_ev(
value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE);
 
/* Hardware must support this MCDI sensor */
-   EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size));
+   EFSYS_ASSERT3U(sensor, <,
+   (8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size));
EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT);
-   EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL);
-   EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] &
-   (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
+   EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL);
+   EFSYS_ASSERT(
+   (enp->en_nic_cfg.enc_mcdi_sensor_maskp[sensor/MCDI_MON_PAGE_SIZE] &
+   (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
 
/* But we don't have to understand it */
if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342501 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:09:53 2018
New Revision: 342501
URL: https://svnweb.freebsd.org/changeset/base/342501

Log:
  MFC r340888
  
  sfxge(4): fix warnings from VS2015 C compiler (C4100)
  
  Fix multiple level 4 warnings
  "C4100: 'xxx': unreferenced formal parameter"
  no functional changes.
  
  The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
  Studio 2015 C compiler with the following:
  
#define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
#define _NOTE(_annotation)   _NOTE_ ## _annotation
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18122

Modified:
  stable/10/sys/dev/sfxge/common/ef10_nvram.c
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx_ev.c
  stable/10/sys/dev/sfxge/common/efx_lic.c
  stable/10/sys/dev/sfxge/common/efx_mcdi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:09:53 2018
(r342501)
@@ -675,6 +675,7 @@ 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)) {
@@ -1284,6 +1285,8 @@ ef10_nvram_buf_read_tlv(
size_t length;
caddr_t value;
efx_rc_t rc;
+
+   _NOTE(ARGUNUSED(enp))
 
if ((seg_data == NULL) || (max_seg_size == 0)) {
rc = EINVAL;

Modified: stable/10/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 10:09:53 2018
(r342501)
@@ -657,6 +657,8 @@ ef10_rx_qpost(
unsigned int offset;
unsigned int id;
 
+   _NOTE(ARGUNUSED(completed))
+
/* The client driver must not overfill the queue */
EFSYS_ASSERT3U(added - completed + n, <=,
EFX_RXQ_LIMIT(erp->er_mask + 1));

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:09:53 2018
(r342501)
@@ -609,6 +609,8 @@ ef10_tx_qdesc_dma_create(
__inboolean_t eop,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
/* No limitations on boundary crossing */
EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
@@ -632,6 +634,8 @@ ef10_tx_qdesc_tso_create(
__inuint8_t  tcp_flags,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index,
uint16_t, ipv4_id, uint32_t, tcp_seq,
uint8_t, tcp_flags);
@@ -654,6 +658,8 @@ ef10_tx_qdesc_tso2_create(
__out_ecount(count) efx_desc_t *edp,
__inint count)
 {
+   _NOTE(ARGUNUSED(etp, count))
+
EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index,
uint16_t, ipv4_id, uint32_t, tcp_seq,
uint16_t, tcp_mss);
@@ -683,6 +689,8 @@ ef10_tx_qdesc_vlantci_create(
__inuint16_t  tci,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index,
uint16_t, tci);
 

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==
--- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:09:53 2018
(r342501)
@@ -1419,6 +1419,8 @@ efx_ev_qstat_name(
__inefx_nic_t *enp,
__inunsigned int id)
 {
+   _NOTE(ARGUNUSED(enp))
+
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(id, <, EV_NQSTATS);
 

Modified: stable/10/sys/dev/sfxge/common/efx_lic.c
==
--- stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:09:53 2018
(r342501)
@@ -587,7 +587,7 @@ efx_lic_v1v2_read_key(
 {
efx_rc_t rc;
 
-   _NOTE(ARGUNUSED(enp))
+   _NOTE(ARGUNUSED(enp, buffer_size))
EFSYS_ASSERT(length <= (EFX_LICENS

svn commit: r342500 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:08:28 2018
New Revision: 342500
URL: https://svnweb.freebsd.org/changeset/base/342500

Log:
  MFC r340887
  
  sfxge(4): fix warnings from VS2015 C compiler (C4245)
  
  Fix level 4 warning
  "C4245: 'initializing': conversion from 'int' to 'uint32_t',
  signed/unsigned mismatch" warning; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18121

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:07:30 
2018(r342499)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:08:28 
2018(r342500)
@@ -992,7 +992,7 @@ ef10_filter_supported_filters(
size_t list_length;
uint32_t i;
efx_rc_t rc;
-   uint32_t all_filter_flags =
+   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 |

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:07:30 2018
(r342499)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:08:28 2018
(r342500)
@@ -2165,29 +2165,37 @@ typedef unsigned int efx_filter_flags_t;
  * Flags which specify the fields to match on. The values are the same as in 
the
  * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands.
  */
-typedef enum efx_filter_match_flags_e {
-   EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host
-* address */
-   EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host
-* address */
-   EFX_FILTER_MATCH_REM_MAC = 0x0004,  /* Match by remote MAC address 
*/
-   EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port 
*/
-   EFX_FILTER_MATCH_LOC_MAC = 0x0010,  /* Match by remote TCP/UDP port 
*/
-   EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port 
*/
-   EFX_FILTER_MATCH_ETHER_TYPE = 0x0040,   /* Match by Ether-type */
-   EFX_FILTER_MATCH_INNER_VID = 0x0080,/* Match by inner VLAN ID */
-   EFX_FILTER_MATCH_OUTER_VID = 0x0100,/* Match by outer VLAN ID */
-   EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport
-* protocol */
-   /* For encapsulated packets, match all multicast inner frames */
-   EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x0100,
-   /* For encapsulated packets, match all unicast inner frames */
-   EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x0200,
-   /* Match otherwise-unmatched multicast and broadcast packets */
-   EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x4000,
-   /* Match otherwise-unmatched unicast packets */
-   EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x8000,
-} efx_filter_match_flags_t;
+
+/* Match by remote IP host address */
+#defineEFX_FILTER_MATCH_REM_HOST   0x0001
+/* Match by local IP host address */
+#defineEFX_FILTER_MATCH_LOC_HOST   0x0002
+/* Match by remote MAC address */
+#defineEFX_FILTER_MATCH_REM_MAC0x0004
+/* Match by remote TCP/UDP port */
+#defineEFX_FILTER_MATCH_REM_PORT   0x0008
+/* Match by remote TCP/UDP port */
+#defineEFX_FILTER_MATCH_LOC_MAC0x0010
+/* Match by local TCP/UDP port */
+#defineEFX_FILTER_MATCH_LOC_PORT   0x0020
+/* Match by Ether-type */
+#defineEFX_FILTER_MATCH_ETHER_TYPE 0x0040
+/* Match by inner VLAN ID */
+#defineEFX_FILTER_MATCH_INNER_VID  0x0080
+/* Match by outer VLAN ID */
+#defineEFX_FILTER_MATCH_OUTER_VID  0x0100
+/* Match by IP transport protocol */
+#defineEFX_FILTER_MATCH_IP_PROTO   0x0200
+/* For encapsulated packets, match all multicast inner frames */
+#defineEFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x0100
+/* For encapsulated packets, match all unicast inner frames */
+#defineEFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST 0x0200
+/* Match otherwise-unmatched multicast and broadcast packets */
+#defineEFX_FILTER_MATCH_UNKNOWN_MCAST_DST  0x4000
+/* Match otherwise-unmatched unicast packets */
+#defineEFX_FILTER_MATCH_UNKNOWN_UCAST_DST  0x8000
+
+typedef uint32_

svn commit: r342499 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:07:30 2018
New Revision: 342499
URL: https://svnweb.freebsd.org/changeset/base/342499

Log:
  MFC r340886
  
  sfxge(4): fix warnings from VS2015 C compiler (C4244)
  
  Fix level 4 warning
  "C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible
  loss
  of data"; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18120

Modified:
  stable/10/sys/dev/sfxge/common/efx_vpd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_vpd.c
==
--- stable/10/sys/dev/sfxge/common/efx_vpd.cWed Dec 26 10:06:14 2018
(r342498)
+++ stable/10/sys/dev/sfxge/common/efx_vpd.cWed Dec 26 10:07:30 2018
(r342499)
@@ -931,7 +931,7 @@ efx_vpd_hunk_set(
}
 
/* Modify tag length (large resource type) */
-   taglen += (dest - source);
+   taglen += (uint16_t)(dest - source);
EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen);
data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0);
data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342498 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:06:14 2018
New Revision: 342498
URL: https://svnweb.freebsd.org/changeset/base/342498

Log:
  MFC r340885
  
  sfxge(4): fix warnings from VS2015 C compiler (C4310)
  
  Fix level 4 warning
  "C4310: cast truncates constant value";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18119

Modified:
  stable/10/sys/dev/sfxge/common/efx_bootcfg.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:05:36 
2018(r342497)
+++ stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:06:14 
2018(r342498)
@@ -359,7 +359,7 @@ efx_bootcfg_read(
rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
&used_bytes);
if (rc != 0 || used_bytes == 0) {
-   payload[0] = (uint8_t)~DHCP_END;
+   payload[0] = (uint8_t)(~DHCP_END & 0xff);
payload[1] = DHCP_END;
used_bytes = 2;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342496 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:05:03 2018
New Revision: 342496
URL: https://svnweb.freebsd.org/changeset/base/342496

Log:
  MFC r340883
  
  sfxge(4): fix diagnostics support build without Siena
  
  The compilation failed because __efx_sram_pattern_fns was used in
  efx_nic.c, but defined in efx_sram.c which is only needed when
  supporting Siena.
  
  To fix it move all the code using __efx_sram_pattern_fns into
  Siena-specific files (except for the definition in efx_sram.c itself,
  as that file only needs to be included in Siena-supporting builds
  anyway).
  
  The functions to test registers and tables are unlikely to apply to any
  new hardware and so can be moved into Siena files. Since Huntington
  such tests have been implemented in firmware.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18117

Modified:
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/siena_impl.h
  stable/10/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:03:59 2018
(r342495)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:05:03 2018
(r342496)
@@ -1119,32 +1119,6 @@ efx_vpd_hunk_set(
 
 #endif /* EFSYS_OPT_VPD */
 
-#if EFSYS_OPT_DIAG
-
-extern efx_sram_pattern_fn_t   __efx_sram_pattern_fns[];
-
-typedef struct efx_register_set_s {
-   unsigned intaddress;
-   unsigned intstep;
-   unsigned introws;
-   efx_oword_t mask;
-} efx_register_set_t;
-
-extern __checkReturn   efx_rc_t
-efx_nic_test_registers(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __insize_t count);
-
-extern __checkReturn   efx_rc_t
-efx_nic_test_tables(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __inefx_pattern_type_t pattern,
-   __insize_t count);
-
-#endif /* EFSYS_OPT_DIAG */
-
 #if EFSYS_OPT_MCDI
 
 extern __checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:03:59 2018
(r342495)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:05:03 2018
(r342496)
@@ -641,139 +641,6 @@ fail1:
return (rc);
 }
 
-   __checkReturn   efx_rc_t
-efx_nic_test_registers(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __insize_t count)
-{
-   unsigned int bit;
-   efx_oword_t original;
-   efx_oword_t reg;
-   efx_oword_t buf;
-   efx_rc_t rc;
-
-   while (count > 0) {
-   /* This function is only suitable for registers */
-   EFSYS_ASSERT(rsp->rows == 1);
-
-   /* bit sweep on and off */
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original,
-   B_TRUE);
-   for (bit = 0; bit < 128; bit++) {
-   /* Is this bit in the mask? */
-   if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit))
-   continue;
-
-   /* Test this bit can be set in isolation */
-   reg = original;
-   EFX_AND_OWORD(reg, rsp->mask);
-   EFX_SET_OWORD_BIT(reg, bit);
-
-   EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®,
-   B_TRUE);
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(®, &buf, sizeof (reg))) {
-   rc = EIO;
-   goto fail1;
-   }
-
-   /* Test this bit can be cleared in isolation */
-   EFX_OR_OWORD(reg, rsp->mask);
-   EFX_CLEAR_OWORD_BIT(reg, bit);
-
-   EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®,
-   B_TRUE);
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(®, &buf, sizeof (reg))) {
-   rc = EIO;
-   goto fail2;
-   }
-   }
-
-   /* Restore the old value */
-   EFSYS_BAR_WRITEO(enp

svn commit: r342495 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:03:59 2018
New Revision: 342495
URL: https://svnweb.freebsd.org/changeset/base/342495

Log:
  MFC r340875
  
  sfxge(4): fix build issue with PHY LED control enabled
  
  Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
  Medford.
  
  Submitted by:   Vijay Srivastava 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18110

Modified:
  stable/10/sys/dev/sfxge/common/ef10_phy.c
  stable/10/sys/dev/sfxge/common/efx_check.h
  stable/10/sys/dev/sfxge/common/siena_nic.c
  stable/10/sys/dev/sfxge/common/siena_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:03:59 2018
(r342495)
@@ -283,7 +283,9 @@ ef10_phy_reconfigure(
uint8_t payload[MAX(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;
+#endif
unsigned int speed;
boolean_t supported;
efx_rc_t rc;

Modified: stable/10/sys/dev/sfxge/common/efx_check.h
==
--- stable/10/sys/dev/sfxge/common/efx_check.h  Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/efx_check.h  Wed Dec 26 10:03:59 2018
(r342495)
@@ -226,8 +226,8 @@
 
 /* Support for PHY LED control */
 #if EFSYS_OPT_PHY_LED_CONTROL
-# if !EFSYS_OPT_SIENA
-#  error "PHY_LED_CONTROL requires SIENA"
+# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
+#  error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD"
 # endif
 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
 

Modified: stable/10/sys/dev/sfxge/common/siena_nic.c
==
--- stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:03:59 2018
(r342495)
@@ -188,7 +188,9 @@ static  __checkReturn   efx_rc_t
 siena_phy_cfg(
__inefx_nic_t *enp)
 {
+#if EFSYS_OPT_PHY_STATS
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+#endif /* EFSYS_OPT_PHY_STATS */
efx_rc_t rc;
 
/* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */

Modified: stable/10/sys/dev/sfxge/common/siena_phy.c
==
--- stable/10/sys/dev/sfxge/common/siena_phy.c  Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/siena_phy.c  Wed Dec 26 10:03:59 2018
(r342495)
@@ -276,7 +276,9 @@ siena_phy_reconfigure(
MAX(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;
+#endif
unsigned int speed;
efx_rc_t rc;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342497 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:05:36 2018
New Revision: 342497
URL: https://svnweb.freebsd.org/changeset/base/342497

Log:
  MFC r340884
  
  sfxge(4): fix probes in licensing support
  
  EFSYS_PROBE1 takes one typed value (in addition to the probe name),
  whereas EFSYS_PROBE has just the probe name.
  
  Which to use is determined by the probe name - "fail1" probes are
  expected to include the function result.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18118

Modified:
  stable/10/sys/dev/sfxge/common/efx_lic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_lic.c
==
--- stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:05:03 2018
(r342496)
+++ stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:05:36 2018
(r342497)
@@ -522,7 +522,7 @@ efx_lic_v1v2_find_key(
return (found);
 
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
@@ -565,7 +565,7 @@ fail3:
 fail2:
EFSYS_PROBE(fail2);
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
@@ -1187,7 +1187,7 @@ fail3:
 fail2:
EFSYS_PROBE(fail2);
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342494 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:03:11 2018
New Revision: 342494
URL: https://svnweb.freebsd.org/changeset/base/342494

Log:
  MFC r340833
  
  sfxge(4): support inner checksum offload on transmit
  
  Inner checksum offloads may be used only if firmware supports
  these tunnels.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18102

Modified:
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:02:05 2018
(r342493)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:03:11 2018
(r342494)
@@ -87,12 +87,16 @@ efx_mcdi_init_txq(
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label);
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance);
 
-   MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS,
+   MCDI_IN_POPULATE_DWORD_9(req, INIT_TXQ_IN_FLAGS,
INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
INIT_TXQ_IN_FLAG_IP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1,
INIT_TXQ_IN_FLAG_TCP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1,
+   INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN,
+   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0,
+   INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN,
+   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0,
INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
INIT_TXQ_IN_CRC_MODE, 0,
@@ -197,14 +201,23 @@ ef10_tx_qcreate(
__inefx_txq_t *etp,
__out   unsigned int *addedp)
 {
+   efx_nic_cfg_t *encp = &enp->en_nic_cfg;
+   uint16_t inner_csum;
efx_qword_t desc;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(id))
 
+   inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP;
+   if (((flags & inner_csum) != 0) &&
+   (encp->enc_tunnel_encapsulations_supported == 0)) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags,
esmp)) != 0)
-   goto fail1;
+   goto fail2;
 
/*
 * A previous user of this TX queue may have written a descriptor to the
@@ -215,19 +228,25 @@ ef10_tx_qcreate(
 * a no-op TX option descriptor. See bug29981 for details.
 */
*addedp = 1;
-   EFX_POPULATE_QWORD_4(desc,
+   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);
+   (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);
 
EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
ef10_tx_qpush(etp, *addedp, 0);
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
 

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:02:05 2018
(r342493)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:03:11 2018
(r342494)
@@ -1997,9 +1997,11 @@ efx_tx_fini(
 
 #defineEFX_TXQ_MAX_BUFS 8 /* Maximum independent of 
EFX_BUG35388_WORKAROUND. */
 
-#defineEFX_TXQ_CKSUM_IPV4  0x0001
-#defineEFX_TXQ_CKSUM_TCPUDP0x0002
-#defineEFX_TXQ_FATSOV2 0x0004
+#defineEFX_TXQ_CKSUM_IPV4  0x0001
+#defineEFX_TXQ_CKSUM_TCPUDP0x0002
+#defineEFX_TXQ_FATSOV2 0x0004
+#defineEFX_TXQ_CKSUM_INNER_IPV40x0008
+#defineEFX_TXQ_CKSUM_INNER_TCPUDP  0x0010
 
 extern __checkReturn   efx_rc_t
 efx_tx_qcreate(

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==
--- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:02:05 2018
(r342493)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:03:11 2018
(r342494)
@@ -903,6 +903,7 @@ siena_tx_qcreate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_oword_t oword;
uint32_t size;
+   uint16_t inner_csum;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(esmp))
@@ -932,6 +933,12 @@ 

svn commit: r342493 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:02:05 2018
New Revision: 342493
URL: https://svnweb.freebsd.org/changeset/base/342493

Log:
  MFC r340831
  
  sfxge(4): make MAC naming consistent with other modules
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18101

Modified:
  stable/10/sys/dev/sfxge/common/efx_mac.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_mac.c
==
--- stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:01:25 2018
(r342492)
+++ stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:02:05 2018
(r342493)
@@ -43,7 +43,7 @@ siena_mac_multicast_list_set(
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_SIENA
-static const efx_mac_ops_t __efx_siena_mac_ops = {
+static const efx_mac_ops_t __efx_mac_siena_ops = {
siena_mac_poll, /* emo_poll */
siena_mac_up,   /* emo_up */
siena_mac_reconfigure,  /* emo_addr_set */
@@ -66,7 +66,7 @@ static const efx_mac_ops_t__efx_siena_mac_ops = {
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
-static const efx_mac_ops_t __efx_ef10_mac_ops = {
+static const efx_mac_ops_t __efx_mac_ef10_ops = {
ef10_mac_poll,  /* emo_poll */
ef10_mac_up,/* emo_up */
ef10_mac_addr_set,  /* emo_addr_set */
@@ -818,21 +818,21 @@ efx_mac_select(
switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
case EFX_FAMILY_SIENA:
-   emop = &__efx_siena_mac_ops;
+   emop = &__efx_mac_siena_ops;
type = EFX_MAC_SIENA;
break;
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
case EFX_FAMILY_HUNTINGTON:
-   emop = &__efx_ef10_mac_ops;
+   emop = &__efx_mac_ef10_ops;
type = EFX_MAC_HUNTINGTON;
break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
case EFX_FAMILY_MEDFORD:
-   emop = &__efx_ef10_mac_ops;
+   emop = &__efx_mac_ef10_ops;
type = EFX_MAC_MEDFORD;
break;
 #endif /* EFSYS_OPT_MEDFORD */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342492 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:01:25 2018
New Revision: 342492
URL: https://svnweb.freebsd.org/changeset/base/342492

Log:
  MFC r340826
  
  sfxge(4): fix ignoring function return value
  
  fix PreFAST issue, add missing annotation that function return value
  should not be ignored. Fix alignment.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18096

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:00:25 2018
(r342491)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:01:25 2018
(r342492)
@@ -911,13 +911,13 @@ efx_phy_media_type_get(
__inefx_nic_t *enp,
__out   efx_phy_media_type_t *typep);
 
-extern efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_phy_module_get_info(
-   __inefx_nic_t *enp,
-   __inuint8_t dev_addr,
-   __inuint8_t offset,
-   __inuint8_t len,
-   __out_bcount(len)   uint8_t *data);
+   __inefx_nic_t *enp,
+   __inuint8_t dev_addr,
+   __inuint8_t offset,
+   __inuint8_t len,
+   __out_bcount(len)   uint8_t *data);
 
 #if EFSYS_OPT_PHY_STATS
 

Modified: stable/10/sys/dev/sfxge/common/efx_phy.c
==
--- stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:00:25 2018
(r342491)
+++ stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:01:25 2018
(r342492)
@@ -299,7 +299,7 @@ efx_phy_media_type_get(
*typep = epp->ep_fixed_port_type;
 }
 
-   __checkReturn   efx_rc_t
+   __checkReturn   efx_rc_t
 efx_phy_module_get_info(
__inefx_nic_t *enp,
__inuint8_t dev_addr,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342491 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:00:25 2018
New Revision: 342491
URL: https://svnweb.freebsd.org/changeset/base/342491

Log:
  MFC r340822
  
  sfxge(4): fix check in NVRAM validate
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18092

Modified:
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 09:59:24 2018
(r342490)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:00:25 2018
(r342491)
@@ -460,10 +460,11 @@ efx_nvram_validate(
if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
 
-   if (envop->envo_type_to_partn != NULL &&
-   ((rc = envop->envo_buffer_validate(enp, partn,
-   partn_data, partn_size)) != 0))
-   goto fail2;
+   if (envop->envo_buffer_validate != NULL) {
+   if ((rc = envop->envo_buffer_validate(enp, partn,
+   partn_data, partn_size)) != 0)
+   goto fail2;
+   }
 
return (0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342490 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:59:24 2018
New Revision: 342490
URL: https://svnweb.freebsd.org/changeset/base/342490

Log:
  MFC r340814
  
  sfxge(4): fix result code in MCDI NVRAM update finish
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18084

Modified:
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 09:44:08 2018
(r342489)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 09:59:24 2018
(r342490)
@@ -924,7 +924,7 @@ efx_mcdi_nvram_update_finish(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN,
MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)];
-   uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */
+   uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN;
efx_rc_t rc;
 
(void) memset(payload, 0, sizeof (payload));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342489 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:44:08 2018
New Revision: 342489
URL: https://svnweb.freebsd.org/changeset/base/342489

Log:
  MFC r340806
  
  sfxge(4): fix default RSS context check on Siena
  
  Default RSS context check is carried out during filter
  insertion on Siena and it needs to be fixed
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18076

Modified:
  stable/10/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_filter.c
==
--- stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:43:38 2018
(r342488)
+++ stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:44:08 2018
(r342489)
@@ -525,9 +525,9 @@ siena_filter_spec_from_gen_spec(
else
EFSYS_ASSERT3U(gen_spec->efs_flags, &, EFX_FILTER_FLAG_RX);
 
-   /* Falconsiena only has one RSS context */
+   /* Siena only has one RSS context */
if ((gen_spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) &&
-   gen_spec->efs_rss_context != 0) {
+   gen_spec->efs_rss_context != EFX_RSS_CONTEXT_DEFAULT) {
rc = EINVAL;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342488 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:43:38 2018
New Revision: 342488
URL: https://svnweb.freebsd.org/changeset/base/342488

Log:
  MFC r340805
  
  sfxge(4): define a handle to denote default RSS context
  
  Make the existing filter-specific define more general.
  This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18075

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:42:40 2018
(r342487)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:43:38 2018
(r342488)
@@ -1824,6 +1824,9 @@ efx_rx_scatter_enable(
__inunsigned int buf_size);
 #endif /* EFSYS_OPT_RX_SCATTER */
 
+/* Handle to represent use of the default RSS context. */
+#defineEFX_RSS_CONTEXT_DEFAULT 0x
+
 #if EFSYS_OPT_RX_SCALE
 
 typedef enum efx_rx_hash_alg_e {
@@ -2223,7 +2226,6 @@ typedef struct efx_filter_spec_s {
 
 
 /* Default values for use in filter specifications */
-#defineEFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0x
 #defineEFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff
 #defineEFX_FILTER_SPEC_VID_UNSPEC  0x
 

Modified: stable/10/sys/dev/sfxge/common/efx_filter.c
==
--- stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:42:40 2018
(r342487)
+++ stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:43:38 2018
(r342488)
@@ -305,7 +305,7 @@ efx_filter_spec_init_rx(
memset(spec, 0, sizeof (*spec));
spec->efs_priority = priority;
spec->efs_flags = EFX_FILTER_FLAG_RX | flags;
-   spec->efs_rss_context = EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT;
+   spec->efs_rss_context = EFX_RSS_CONTEXT_DEFAULT;
spec->efs_dmaq_id = (uint16_t)erp->er_index;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342487 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:42:40 2018
New Revision: 342487
URL: https://svnweb.freebsd.org/changeset/base/342487

Log:
  MFC r340804
  
  sfxge(4): insert filters for encapsulated packets
  
  On Medford, with full-featured firmware running, encapsulated
  packets may not be delivered unless filters are inserted for
  them, as ordinary filters are not applied to encapsulated
  packets. So filters for encapsulated packets need to be
  inserted for each class of encapsulated packet. For simplicity,
  catch-all filters are always inserted. These may match more
  packets than the OS has asked for, but trying to insert more
  precise filters increases complexity for little gain.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18074

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/ef10_impl.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:41:04 
2018(r342486)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:42:40 
2018(r342487)
@@ -1234,6 +1234,108 @@ fail1:
return (rc);
 }
 
+typedef struct ef10_filter_encap_entry_s {
+   uint16_tether_type;
+   efx_tunnel_protocol_t   encap_type;
+   uint32_tinner_frame_match;
+} ef10_filter_encap_entry_t;
+
+#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match)\
+   { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type,   
\
+   EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_##inner_frame_match }
+
+static ef10_filter_encap_entry_t ef10_filter_encap_list[] = {
+   EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, MCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, MCAST_DST),
+
+   EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, MCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, MCAST_DST),
+
+   EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, MCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, MCAST_DST),
+};
+
+#undef EF10_ENCAP_FILTER_ENTRY
+
+static __checkReturn   efx_rc_t
+ef10_filter_insert_encap_filters(
+   __inefx_nic_t *enp,
+   __inboolean_t mulcst,
+   __inefx_filter_flags_t filter_flags)
+{
+   ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table;
+   uint32_t i;
+   efx_rc_t rc;
+
+   EFX_STATIC_ASSERT(EFX_ARRAY_SIZE(ef10_filter_encap_list) <=
+   EFX_ARRAY_SIZE(table->eft_encap_filter_indexes));
+
+   /*
+* On Medford, full-featured firmware can identify packets as being
+* tunnel encapsulated, even if no encapsulated packet offloads are in
+* use. When packets are identified as such, ordinary filters are not
+* applied, only ones specific to encapsulated packets. Hence we need to
+* insert filters for encapsulated packets in order to receive them.
+*
+* Separate filters need to be inserted for each ether type,
+* encapsulation type, and inner frame type (unicast or multicast). To
+* keep things simple and reduce the number of filters needed, catch-all
+* filters for all combinations of types are inserted, even if
+* all_unicst or all_mulcst have not been set. (These catch-all filters
+* may well, however, fail to insert on unprivileged functions.)
+*/
+   table->eft_encap_filter_count = 0;
+   for (i = 0; i < EFX_ARRAY_SIZE(ef10_filter_encap_list); i++) {
+   efx_filter_spec_t spec;
+   ef10_filter_encap_entry_t *encap_filter =
+   &ef10_filter_encap_list[i];
+
+   /*
+* Skip multicast filters if we've not been asked for
+* any multicast traffic.
+*/
+   if ((mulcst == B_FALSE) &&
+   (encap_filter->inner_frame_match ==
+EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST))
+   continue;
+
+   efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
+   filter_flags,
+   table->eft_default_rxq);
+   efx_filter_spec_set_ether_type(&spec, encap_filter->ether_type);
+   rc = efx_filter_spec_set_encap_type(&spec,
+   encap_filter->encap_

svn commit: r342486 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:41:04 2018
New Revision: 342486
URL: https://svnweb.freebsd.org/changeset/base/342486

Log:
  MFC r340803
  
  sfxge(4): support filters for encapsulated packets
  
  This supports filters which match all unicast or multicast
  inner frames in VXLAN, GENEVE, or NVGRE packets.
  (Additional fields to match on can be added easily.)
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18073

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:40:13 
2018(r342485)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:41:04 
2018(r342486)
@@ -145,6 +145,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_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 ==
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST ==
MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST));
EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST ==
@@ -274,18 +278,47 @@ efx_mcdi_filter_op_add(
memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP),
&spec->efs_loc_host.eo_byte[0],
MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN);
+
+   /*
+* On Medford, filters for encapsulated packets match based on
+* the ether type and IP protocol in the outer frame.  In
+* addition we need to fill in the VNI or VSID type field.
+*/
+   switch (spec->efs_encap_type) {
+   case EFX_TUNNEL_PROTOCOL_NONE:
+   break;
+   case EFX_TUNNEL_PROTOCOL_VXLAN:
+   case EFX_TUNNEL_PROTOCOL_GENEVE:
+   MCDI_IN_POPULATE_DWORD_1(req,
+   FILTER_OP_EXT_IN_VNI_OR_VSID,
+   FILTER_OP_EXT_IN_VNI_TYPE,
+   spec->efs_encap_type == EFX_TUNNEL_PROTOCOL_VXLAN ?
+   MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN :
+   MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE);
+   break;
+   case EFX_TUNNEL_PROTOCOL_NVGRE:
+   MCDI_IN_POPULATE_DWORD_1(req,
+   FILTER_OP_EXT_IN_VNI_OR_VSID,
+   FILTER_OP_EXT_IN_VSID_TYPE,
+   MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE);
+   break;
+   default:
+   EFSYS_ASSERT(0);
+   rc = EINVAL;
+   goto fail2;
+   }
}
 
efx_mcdi_execute(enp, &req);
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail2;
+   goto fail3;
}
 
if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) {
rc = EMSGSIZE;
-   goto fail3;
+   goto fail4;
}
 
handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO);
@@ -293,6 +326,8 @@ efx_mcdi_filter_op_add(
 
return (0);
 
+fail4:
+   EFSYS_PROBE(fail4);
 fail3:
EFSYS_PROBE(fail3);
 fail2:
@@ -392,6 +427,8 @@ ef10_filter_equal(
if (left->efs_ether_type != right->efs_ether_type)
return (B_FALSE);
if (left->efs_ip_proto != right->efs_ip_proto)
+   return (B_FALSE);
+   if (left->efs_encap_type != right->efs_encap_type)
return (B_FALSE);
 
return (B_TRUE);

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:40:13 2018
(r342485)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:41:04 2018
(r342486)
@@ -2137,6 +2137,7 @@ efx_tx_qdestroy(
 
 #defineEFX_IPPROTO_TCP 6
 #defineEFX_IPPROTO_UDP 17
+#defineEFX_IPPROTO_GRE 47
 
 /* Use RSS to spread across multiple queues */
 #defineEFX_FILTER_FLAG_RX_RSS  0x01
@@ -2155,6 +2156,10 @@ efx_tx_qdestroy(
 
 typedef unsigned int efx_filter_flags_t;
 
+/*
+ * Flags which specify the fiel

svn commit: r342485 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:40:13 2018
New Revision: 342485
URL: https://svnweb.freebsd.org/changeset/base/342485

Log:
  MFC r340802
  
  sfxge(4): use proper MCDI command for encap filters
  
  MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated
  packets.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18072

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:38:50 
2018(r342484)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:40:13 
2018(r342485)
@@ -126,29 +126,29 @@ ef10_filter_init(
 
 #defineMATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match))
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_IP));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_HOST ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_IP));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_MAC ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_PORT ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_MAC ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_MAC));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_PORT ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_PORT));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_ETHER_TYPE ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_INNER_VID ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_OUTER_VID ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN));
+   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_IN_MATCH_IP_PROTO));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST));
EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST));
 #undef MATCH_MASK
 
EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp);
@@ -189,27 +189,27 @@ efx_mcdi_filter_op_add(
__inout ef10_filter_handle_t *handle)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN,
-   MC_CMD_FILTER_OP_OUT_LEN)];
+   uint8_t payload[MAX(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_IN_LEN;
+   req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN;
req.emr_out_buf = payload;
-   req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN;
+   req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN;
 
switch (filter_op) {
case MC_CMD_FILTER_OP_IN_OP_REPLACE:
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO,
+   MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO,
handle->efh_lo);
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI,
+   MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI,
handle->efh_hi);
/* Fall through */
case MC_CMD_FILTER_OP_IN_OP_INSERT:
case MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE:
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, filter_op);
+   MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, filter_op);
break;
default:
EFSYS_ASSERT(0);
@@ -217,63 +217,63 @@ efx_mcdi_filter_op_add(
goto fail1;
}
 
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID,
+   MCDI_IN_SET_DWORD(r

svn commit: r342484 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:38:50 2018
New Revision: 342484
URL: https://svnweb.freebsd.org/changeset/base/342484

Log:
  MFC r340801
  
  sfxge(4): provide information about supported tunnels
  
  VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with
  full-feature firmware variant running.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18071

Modified:
  stable/10/sys/dev/sfxge/common/ef10_nic.c
  stable/10/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:37:30 2018
(r342483)
+++ stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:38:50 2018
(r342484)
@@ -1117,6 +1117,16 @@ ef10_get_datapath_caps(
encp->enc_mac_stats_40g_tx_size_bins =
CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE;
 
+   /*
+* Check if firmware supports VXLAN and NVGRE tunnels.
+* The capability indicates Geneve protocol support as well.
+*/
+   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);
+
 #undef CAP_FLAG
 #undef CAP_FLAG2
 

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:37:30 2018
(r342483)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:38:50 2018
(r342484)
@@ -1085,6 +1085,14 @@ efx_bist_stop(
 #defineEFX_FEATURE_FW_ASSISTED_TSO 0x1000
 #defineEFX_FEATURE_FW_ASSISTED_TSO_V2  0x2000
 
+typedef enum efx_tunnel_protocol_e {
+   EFX_TUNNEL_PROTOCOL_NONE = 0,
+   EFX_TUNNEL_PROTOCOL_VXLAN,
+   EFX_TUNNEL_PROTOCOL_GENEVE,
+   EFX_TUNNEL_PROTOCOL_NVGRE,
+   EFX_TUNNEL_NPROTOS
+} efx_tunnel_protocol_t;
+
 typedef struct efx_nic_cfg_s {
uint32_tenc_board_type;
uint32_tenc_phy_type;
@@ -1182,6 +1190,7 @@ typedef struct efx_nic_cfg_s {
boolean_t   enc_init_evq_v2_supported;
boolean_t   enc_pm_and_rxdp_counters;
boolean_t   enc_mac_stats_40g_tx_size_bins;
+   uint32_tenc_tunnel_encapsulations_supported;
/* External port identifier */
uint8_t enc_external_port;
uint32_tenc_mcdi_max_payload_length;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342483 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:37:30 2018
New Revision: 342483
URL: https://svnweb.freebsd.org/changeset/base/342483

Log:
  MFC r340800
  
  sfxge(4): let caller know that queue is already flushed
  
  Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or
  MC reboot. Caller needs to know that the queue is already flushed to
  avoid waiting for flush done event.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18070

Modified:
  stable/10/sys/dev/sfxge/common/ef10_ev.c
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 09:36:42 2018
(r342482)
+++ stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 09:37:30 2018
(r342483)
@@ -434,7 +434,12 @@ efx_mcdi_fini_evq(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the EVQ has already been destroyed.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }

Modified: stable/10/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:36:42 2018
(r342482)
+++ stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:37:30 2018
(r342483)
@@ -130,7 +130,7 @@ efx_mcdi_fini_rxq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+   if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail1;
}
@@ -138,7 +138,12 @@ efx_mcdi_fini_rxq(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the RXQ has already been destroyed.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }
@@ -720,7 +725,14 @@ ef10_rx_qflush(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the RXQ has already been destroyed. Callers need to know that
+* the RXQ flush has completed to avoid waiting until timeout for a
+* flush done event that will not be delivered.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:36:42 2018
(r342482)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:37:30 2018
(r342483)
@@ -151,7 +151,7 @@ efx_mcdi_fini_txq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+   if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail1;
}
@@ -159,7 +159,12 @@ efx_mcdi_fini_txq(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the TXQ has already been destroyed.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }
@@ -690,7 +695,14 @@ ef10_tx_qpace(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the TXQ has already been destroyed. Callers need to know that
+* the TXQ flush has completed to avoid waiting until timeout for a
+* flush done event that will not be delivered.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342482 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:36:42 2018
New Revision: 342482
URL: https://svnweb.freebsd.org/changeset/base/342482

Log:
  MFC r340799
  
  sfxge(4): fix error code usage
  
  MCDI results returned in req.emr_rc have already been translated
  from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value
  is incorrect.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18069

Modified:
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:34:26 2018
(r342481)
+++ stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:36:42 2018
(r342482)
@@ -130,7 +130,7 @@ efx_mcdi_fini_rxq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
+   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
rc = req.emr_rc;
goto fail1;
}

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:34:26 2018
(r342481)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:36:42 2018
(r342482)
@@ -151,7 +151,7 @@ efx_mcdi_fini_txq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
+   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
rc = req.emr_rc;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342481 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:34:26 2018
New Revision: 342481
URL: https://svnweb.freebsd.org/changeset/base/342481

Log:
  MFC r340798
  
  sfxge(4): fix out of bounds read in VIs allocation
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18068

Modified:
  stable/10/sys/dev/sfxge/common/ef10_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:33:26 2018
(r342480)
+++ stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:34:26 2018
(r342481)
@@ -557,7 +557,7 @@ efx_mcdi_alloc_vis(
 {
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN,
-   MC_CMD_ALLOC_VIS_OUT_LEN)];
+   MC_CMD_ALLOC_VIS_EXT_OUT_LEN)];
efx_rc_t rc;
 
if (vi_countp == NULL) {
@@ -570,7 +570,7 @@ efx_mcdi_alloc_vis(
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN;
req.emr_out_buf = payload;
-   req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN;
+   req.emr_out_length = MC_CMD_ALLOC_VIS_EXT_OUT_LEN;
 
MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count);
MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342480 - in stable/10/sys/dev/sfxge: . common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:33:26 2018
New Revision: 342480
URL: https://svnweb.freebsd.org/changeset/base/342480

Log:
  MFC r340767
  
  sfxge(4): limit max TXQ size on Medford to 2048
  
  Queues with 4096 descriptors are not supported as the top bit is used
  for vfifo stuffing.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D8948

Modified:
  stable/10/sys/dev/sfxge/common/ef10_tx.c   (contents, props changed)
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_tx.c
  stable/10/sys/dev/sfxge/common/hunt_nic.c
  stable/10/sys/dev/sfxge/common/medford_nic.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
  stable/10/sys/dev/sfxge/sfxge.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:33:26 2018
(r342480)
@@ -67,7 +67,7 @@ efx_mcdi_init_txq(
efx_rc_t rc;
 
EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >=
-   EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg)));
+   EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs));
 
npages = EFX_TXQ_NBUFS(size);
if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) {

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:33:26 2018
(r342480)
@@ -1105,6 +1105,7 @@ typedef struct efx_nic_cfg_s {
uint32_tenc_evq_limit;
uint32_tenc_txq_limit;
uint32_tenc_rxq_limit;
+   uint32_tenc_txq_max_ndescs;
uint32_tenc_buftbl_limit;
uint32_tenc_piobuf_limit;
uint32_tenc_piobuf_size;
@@ -1974,12 +1975,6 @@ efx_tx_init(
 extern void
 efx_tx_fini(
__inefx_nic_t *enp);
-
-#defineEFX_BUG35388_WORKAROUND(_encp)  
\
-   (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0))
-
-#defineEFX_TXQ_MAXNDESCS(_encp)
\
-   ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096)
 
 #defineEFX_TXQ_MINNDESCS   512
 

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==
--- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 09:33:26 2018
(r342480)
@@ -911,7 +911,7 @@ siena_tx_qcreate(
(1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH));
EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);
 
-   EFSYS_ASSERT(ISP2(EFX_TXQ_MAXNDESCS(encp)));
+   EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs));
EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS));
 
if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) {
@@ -923,7 +923,7 @@ siena_tx_qcreate(
goto fail2;
}
for (size = 0;
-   (1 << size) <= (EFX_TXQ_MAXNDESCS(encp) / EFX_TXQ_MINNDESCS);
+   (1 << size) <= (int)(encp->enc_txq_max_ndescs / EFX_TXQ_MINNDESCS);
size++)
if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS))
break;

Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c
==
--- stable/10/sys/dev/sfxge/common/hunt_nic.c   Wed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/hunt_nic.c   Wed Dec 26 09:33:26 2018
(r342480)
@@ -318,6 +318,12 @@ hunt_board_cfg(
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 = 0x;
 
encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS;

Modified: stable/10/sys/dev/sfxge/common/medford_nic.c
==
--- stable/10/sys/dev/sfxge/common/medford_nic.cWed Dec 26 09:32:30 
2018(r342479)
+++ stable/10/sys/dev/sfxge/common/medford_nic.cWed Dec 26 09:33:26 
2018(r342480)
@@ -315,6 +315,13 @@ medford_board_cfg(
encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET;
encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET;
 
+   /*
+

svn commit: r342479 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:32:30 2018
New Revision: 342479
URL: https://svnweb.freebsd.org/changeset/base/342479

Log:
  MFC r312885
  
  sfxge(4): compact the first hot part of RxQ control
  
  buf_base_id is used on RxQ control operations only and not used on
  datapath.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge_rx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_rx.h
==
--- stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:31:36 2018
(r342478)
+++ stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:32:30 2018
(r342479)
@@ -155,7 +155,6 @@ struct sfxge_rxq {
struct sfxge_softc  *sc __aligned(CACHE_LINE_SIZE);
unsigned intindex;
efsys_mem_t mem;
-   unsigned intbuf_base_id;
enum sfxge_rxq_stateinit_state;
unsigned intentries;
unsigned intptr_mask;
@@ -175,6 +174,7 @@ struct sfxge_rxq {
unsigned intrefill_delay;
 
volatile enum sfxge_flush_state flush_state __aligned(CACHE_LINE_SIZE);
+   unsigned intbuf_base_id;
 };
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342478 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:31:36 2018
New Revision: 342478
URL: https://svnweb.freebsd.org/changeset/base/342478

Log:
  MFC r312884
  
  sfxge(4): fix RxQ structure layout vs usage on datapath
  
  Recent changes in the pseudo header accessor prototypes start to
  use common code RxQ handle on datapath. The handle was located
  at the end of the structure with members not used on datapath.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D9359

Modified:
  stable/10/sys/dev/sfxge/sfxge_rx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_rx.h
==
--- stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:30:53 2018
(r342477)
+++ stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:31:36 2018
(r342478)
@@ -159,6 +159,7 @@ struct sfxge_rxq {
enum sfxge_rxq_stateinit_state;
unsigned intentries;
unsigned intptr_mask;
+   efx_rxq_t   *common;
 
struct sfxge_rx_sw_desc *queue __aligned(CACHE_LINE_SIZE);
unsigned intadded;
@@ -173,8 +174,7 @@ struct sfxge_rxq {
struct callout  refill_callout;
unsigned intrefill_delay;
 
-   efx_rxq_t   *common __aligned(CACHE_LINE_SIZE);
-   volatile enum sfxge_flush_state flush_state;
+   volatile enum sfxge_flush_state flush_state __aligned(CACHE_LINE_SIZE);
 };
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342477 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:30:53 2018
New Revision: 342477
URL: https://svnweb.freebsd.org/changeset/base/342477

Log:
  MFC r312883
  
  sfxge(4): fix invalid VLAN tagging after stop/start
  
  TxQ is destroyed on stop and last used tag should be reset to default 0
  on the next start.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D9358

Modified:
  stable/10/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:30:06 2018
(r342476)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:30:53 2018
(r342477)
@@ -1604,6 +1604,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int i
txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, txq->type,
  tso_fw_assisted);
 
+   txq->hw_vlan_tci = 0;
+
SFXGE_TXQ_UNLOCK(txq);
 
return (0);
@@ -1820,7 +1822,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int tx
txq->type = type;
txq->evq_index = evq_index;
txq->init_state = SFXGE_TXQ_INITIALIZED;
-   txq->hw_vlan_tci = 0;
 
return (0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342476 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:30:06 2018
New Revision: 342476
URL: https://svnweb.freebsd.org/changeset/base/342476

Log:
  MFC r312868
  
  sfxge(4): cleanup: remove unused soft context struct member rxq_cache
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.h
==
--- stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 09:29:26 2018
(r342475)
+++ stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 09:30:06 2018
(r342476)
@@ -301,7 +301,6 @@ struct sfxge_softc {
 #endif
 
unsigned intmax_rss_channels;
-   uma_zone_t  rxq_cache;
struct sfxge_rxq*rxq[SFXGE_RX_SCALE_MAX];
unsigned intrx_indir_table[EFX_RSS_TBL_SIZE];
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342475 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:29:26 2018
New Revision: 342475
URL: https://svnweb.freebsd.org/changeset/base/342475

Log:
  MFC r312867
  
  sfxge(4): cleanup: remvoe trailing tab
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge_rx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_rx.c
==
--- stable/10/sys/dev/sfxge/sfxge_rx.c  Wed Dec 26 09:28:40 2018
(r342474)
+++ stable/10/sys/dev/sfxge/sfxge_rx.c  Wed Dec 26 09:29:26 2018
(r342475)
@@ -1096,7 +1096,7 @@ sfxge_rx_start(struct sfxge_softc *sc)
encp = efx_nic_cfg_get(sc->enp);
sc->rx_buffer_size = EFX_MAC_PDU(sc->ifnet->if_mtu);
 
-   /* Calculate the receive packet buffer size. */ 
+   /* Calculate the receive packet buffer size. */
sc->rx_prefix_size = encp->enc_rx_prefix_size;
 
/* Ensure IP headers are 32bit aligned */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342474 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:28:40 2018
New Revision: 342474
URL: https://svnweb.freebsd.org/changeset/base/342474

Log:
  MFC r312866
  
  sfxge(4): cleanup: remove unused txq_index TxQ control structure member
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge_tx.c
  stable/10/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:23:13 2018
(r342473)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:28:40 2018
(r342474)
@@ -1819,7 +1819,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int tx
 
txq->type = type;
txq->evq_index = evq_index;
-   txq->txq_index = txq_index;
txq->init_state = SFXGE_TXQ_INITIALIZED;
txq->hw_vlan_tci = 0;
 

Modified: stable/10/sys/dev/sfxge/sfxge_tx.h
==
--- stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 09:23:13 2018
(r342473)
+++ stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 09:28:40 2018
(r342474)
@@ -172,7 +172,6 @@ struct sfxge_txq {
enum sfxge_flush_state  flush_state;
unsigned inttso_fw_assisted;
enum sfxge_txq_type type;
-   unsigned inttxq_index;
unsigned intevq_index;
efsys_mem_t mem;
unsigned intbuf_base_id;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342473 - stable/11/share/man/man4

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 09:23:13 2018
New Revision: 342473
URL: https://svnweb.freebsd.org/changeset/base/342473

Log:
  MFC r342204: cyapa.4, isl.4: cross-reference and document use of 
chromebook_platform(4)

Modified:
  stable/11/share/man/man4/cyapa.4
  stable/11/share/man/man4/isl.4
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/cyapa.4
==
--- stable/11/share/man/man4/cyapa.4Wed Dec 26 09:21:58 2018
(r342472)
+++ stable/11/share/man/man4/cyapa.4Wed Dec 26 09:23:13 2018
(r342473)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 03, 2016
+.Dd December 18, 2018
 .Dt CYAPA 4
 .Os
 .Sh NAME
@@ -46,7 +46,13 @@ cyapa_load="YES"
 ig4_load="YES"
 .Ed
 .Pp
-In
+On many Chromebook models this driver can be automatically configured with the
+help of the
+.Xr chromebook_platform 4
+driver.
+Alternatively, the
+.Nm
+driver can be manually configured in
 .Pa /boot/device.hints :
 .Cd hint.cyapa.0.at="iicbus0"
 .Cd hint.cyapa.0.addr="0xCE"
@@ -195,6 +201,7 @@ file:
 .Dl debug.cyapa_thumbarea_percent=0
 .Dl debug.cyapa_enable_tapclick=2
 .Sh SEE ALSO
+.Xr chromebook_platform 4 ,
 .Xr ig4 4 ,
 .Xr iicbus 4 ,
 .Xr sysmouse 4 ,

Modified: stable/11/share/man/man4/isl.4
==
--- stable/11/share/man/man4/isl.4  Wed Dec 26 09:21:58 2018
(r342472)
+++ stable/11/share/man/man4/isl.4  Wed Dec 26 09:23:13 2018
(r342473)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 03, 2016
+.Dd December 18, 2018
 .Dt ISL 4
 .Os
 .Sh NAME
@@ -46,7 +46,13 @@ isl_load="YES"
 ig4_load="YES"
 .Ed
 .Pp
-In
+On many Chromebook models this driver can be automatically configured with the
+help of the
+.Xr chromebook_platform 4
+driver.
+Alternatively, the
+.Nm
+driver can be manually configured in
 .Pa /boot/device.hints :
 .Cd hint.isl.0.at="iicbus0"
 .Cd hint.isl.0.addr="0x88"
@@ -106,6 +112,7 @@ $ pkg install intel-backlight
 $ sh /usr/local/share/examples/intel-backlight/isl_backlight.sh
 .Ed
 .Sh SEE ALSO
+.Xr chromebook_platform 4 ,
 .Xr ig4 4 ,
 .Xr iicbus 4
 .Sh AUTHORS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342472 - stable/12/share/man/man4

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 09:21:58 2018
New Revision: 342472
URL: https://svnweb.freebsd.org/changeset/base/342472

Log:
  MFC r342204: cyapa.4, isl.4: cross-reference and document use of 
chromebook_platform(4)
  
  PR:   218632

Modified:
  stable/12/share/man/man4/cyapa.4
  stable/12/share/man/man4/isl.4
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/cyapa.4
==
--- stable/12/share/man/man4/cyapa.4Wed Dec 26 09:19:13 2018
(r342471)
+++ stable/12/share/man/man4/cyapa.4Wed Dec 26 09:21:58 2018
(r342472)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 03, 2016
+.Dd December 18, 2018
 .Dt CYAPA 4
 .Os
 .Sh NAME
@@ -46,7 +46,13 @@ cyapa_load="YES"
 ig4_load="YES"
 .Ed
 .Pp
-In
+On many Chromebook models this driver can be automatically configured with the
+help of the
+.Xr chromebook_platform 4
+driver.
+Alternatively, the
+.Nm
+driver can be manually configured in
 .Pa /boot/device.hints :
 .Cd hint.cyapa.0.at="iicbus0"
 .Cd hint.cyapa.0.addr="0xCE"
@@ -195,6 +201,7 @@ file:
 .Dl debug.cyapa_thumbarea_percent=0
 .Dl debug.cyapa_enable_tapclick=2
 .Sh SEE ALSO
+.Xr chromebook_platform 4 ,
 .Xr ig4 4 ,
 .Xr iicbus 4 ,
 .Xr sysmouse 4 ,

Modified: stable/12/share/man/man4/isl.4
==
--- stable/12/share/man/man4/isl.4  Wed Dec 26 09:19:13 2018
(r342471)
+++ stable/12/share/man/man4/isl.4  Wed Dec 26 09:21:58 2018
(r342472)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 03, 2016
+.Dd December 18, 2018
 .Dt ISL 4
 .Os
 .Sh NAME
@@ -46,7 +46,13 @@ isl_load="YES"
 ig4_load="YES"
 .Ed
 .Pp
-In
+On many Chromebook models this driver can be automatically configured with the
+help of the
+.Xr chromebook_platform 4
+driver.
+Alternatively, the
+.Nm
+driver can be manually configured in
 .Pa /boot/device.hints :
 .Cd hint.isl.0.at="iicbus0"
 .Cd hint.isl.0.addr="0x88"
@@ -106,6 +112,7 @@ $ pkg install intel-backlight
 $ sh /usr/local/share/examples/intel-backlight/isl_backlight.sh
 .Ed
 .Sh SEE ALSO
+.Xr chromebook_platform 4 ,
 .Xr ig4 4 ,
 .Xr iicbus 4
 .Sh AUTHORS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342471 - stable/11/sys/cam/scsi

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 09:19:13 2018
New Revision: 342471
URL: https://svnweb.freebsd.org/changeset/base/342471

Log:
  MFC r341681: daprobedone: announce if a disk is write-protected

Modified:
  stable/11/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/scsi/scsi_da.c
==
--- stable/11/sys/cam/scsi/scsi_da.cWed Dec 26 09:16:03 2018
(r342470)
+++ stable/11/sys/cam/scsi/scsi_da.cWed Dec 26 09:19:13 2018
(r342471)
@@ -2263,6 +2263,11 @@ daprobedone(struct cam_periph *periph, union ccb *ccb)
printf("%s%d: %s\n", periph->periph_name,
periph->unit_number, buf);
}
+   if ((softc->disk->d_flags & DISKFLAG_WRITE_PROTECT) != 0 &&
+   (softc->flags & DA_FLAG_ANNOUNCED) == 0) {
+   printf("%s%d: Write Protected\n", periph->periph_name,
+   periph->unit_number);
+   }
 
/*
 * Since our peripheral may be invalidated by an error
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342470 - stable/12/sys/cam/scsi

2018-12-26 Thread Andriy Gapon
Author: avg
Date: Wed Dec 26 09:16:03 2018
New Revision: 342470
URL: https://svnweb.freebsd.org/changeset/base/342470

Log:
  MFC r341681: daprobedone: announce if a disk is write-protected

Modified:
  stable/12/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/scsi/scsi_da.c
==
--- stable/12/sys/cam/scsi/scsi_da.cWed Dec 26 07:57:21 2018
(r342469)
+++ stable/12/sys/cam/scsi/scsi_da.cWed Dec 26 09:16:03 2018
(r342470)
@@ -2457,6 +2457,11 @@ daprobedone(struct cam_periph *periph, union ccb *ccb)
printf("%s%d: %s\n", periph->periph_name,
periph->unit_number, buf);
}
+   if ((softc->disk->d_flags & DISKFLAG_WRITE_PROTECT) != 0 &&
+   (softc->flags & DA_FLAG_ANNOUNCED) == 0) {
+   printf("%s%d: Write Protected\n", periph->periph_name,
+   periph->unit_number);
+   }
 
/*
 * Since our peripheral may be invalidated by an error
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"