Re: svn commit: r317547 - head/sys/net

2017-04-28 Thread Gleb Smirnoff
On Fri, Apr 28, 2017 at 11:00:58AM +, Alexander Motin wrote:
A> Author: mav
A> Date: Fri Apr 28 11:00:58 2017
A> New Revision: 317547
A> URL: https://svnweb.freebsd.org/changeset/base/317547
A> 
A> Log:
A>   Allow some control over enabled capabilities for if_vlan.
A>   
A>   It improves interoperability with if_bridge, which may need to disable
A>   some capabilities not supported by other members.  IMHO there is still
A>   open question about LRO capability, which may need to be disabled on
A>   physical interface.
A>   
A>   MFC after: 2 weeks
A>   Sponsored by:  iXsystems, Inc.

On quick glance this looks like the opposite to what was done in r281885.

As discussed back 2 years ago:

- There are no NICs that are able to have different set of capabilities
turned on on different VLANs, and unlikely such will appear.
- Capabilities should be switched on VLAN trunk.
- Allowing to switch capabilities on a VLAN with magical flip of properties
  of all the VLANs on the same trunk is an ugly design. This is something
  unexpected for a sysadmin. Better refuse that and make him toggle properties
  on the trunk explicitily.

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317578 - head/sys/sparc64/pci

2017-04-28 Thread Marius Strobl
Author: marius
Date: Sat Apr 29 00:53:17 2017
New Revision: 317578
URL: https://svnweb.freebsd.org/changeset/base/317578

Log:
  Fix a bug introduced as part of r287726; use the right device_t for
  determining the softc of the bridge in psycho_route_interrupt(). [1]
  While at it, update the corresponding comment that the code in
  question is also necessary for U30s in addition to E450s (a fact
  that has been known for ages).
  
  PR:   218478
  Submitted by: Yoshihiko Iwama

Modified:
  head/sys/sparc64/pci/psycho.c

Modified: head/sys/sparc64/pci/psycho.c
==
--- head/sys/sparc64/pci/psycho.c   Sat Apr 29 00:46:51 2017
(r317577)
+++ head/sys/sparc64/pci/psycho.c   Sat Apr 29 00:53:17 2017
(r317578)
@@ -944,14 +944,14 @@ psycho_route_interrupt(device_t bridge, 
if (pin > 4)
return (pin);
/*
-* Guess the INO; we always assume that this is a non-OBIO
-* device, and that pin is a "real" intpin number.  Determine
-* the mapping register to be used by the slot number.
-* We only need to do this on E450s, it seems; here, the slot numbers
-* for bus A are one-based, while those for bus B seemingly have an
-* offset of 2 (hence the factor of 3 below).
+* Guess the INO; we always assume that this is a non-OBIO device,
+* and that pin is a "real" intpin number.  Determine the mapping
+* register to be used by the slot number.
+* We only need to do this on E450s and U30s, though; here, the
+* slot numbers for bus A are one-based, while those for bus B
+* seemingly have an offset of 2 (hence the factor of 3 below).
 */
-   sc = device_get_softc(dev);
+   sc = device_get_softc(bridge);
intrmap = PSR_PCIA0_INT_MAP +
8 * (pci_get_slot(dev) - 1 + 3 * sc->sc_half);
mintr = INTINO(PSYCHO_READ8(sc, intrmap)) + pin - 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317576 - head/sys/fs/nfsclient

2017-04-28 Thread Rick Macklem
Author: rmacklem
Date: Sat Apr 29 00:34:53 2017
New Revision: 317576
URL: https://svnweb.freebsd.org/changeset/base/317576

Log:
  Modify the NFSv4.1/pNFS client to ask for a maximum length of layout.
  
  The code specified the length of a layout as INT64_MAX instead of
  UINT64_MAX. This could result in getting a layout for less than the
  full file for extremely large files. Although having little practical
  effect, this patch corrects this in the code.
  Detected during recent testing of the pNFS server.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clrpcops.c

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==
--- head/sys/fs/nfsclient/nfs_clrpcops.cFri Apr 28 23:40:53 2017
(r317575)
+++ head/sys/fs/nfsclient/nfs_clrpcops.cSat Apr 29 00:34:53 2017
(r317576)
@@ -5238,7 +5238,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, v
stateid.other[1] = stateidp->other[1];
stateid.other[2] = stateidp->other[2];
error = nfsrpc_layoutget(nmp, nfhp->nfh_fh,
-   nfhp->nfh_len, iomode, (uint64_t)0, INT64_MAX,
+   nfhp->nfh_len, iomode, (uint64_t)0, UINT64_MAX,
(uint64_t)0, layoutlen, , ,
, cred, p, NULL);
} else {
@@ -5248,7 +5248,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, v
stateid.other[1] = lyp->nfsly_stateid.other[1];
stateid.other[2] = lyp->nfsly_stateid.other[2];
error = nfsrpc_layoutget(nmp, nfhp->nfh_fh,
-   nfhp->nfh_len, iomode, off, INT64_MAX,
+   nfhp->nfh_len, iomode, off, UINT64_MAX,
(uint64_t)0, layoutlen, , ,
, cred, p, NULL);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317573 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2017-04-28 Thread Mark Johnston
Author: markj
Date: Fri Apr 28 22:25:22 2017
New Revision: 317573
URL: https://svnweb.freebsd.org/changeset/base/317573

Log:
  Get rid of some ifdef soup in the fasttrap ioctl handler.
  
  No functional change intended.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Fri Apr 
28 22:24:21 2017(r317572)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Fri Apr 
28 22:25:22 2017(r317573)
@@ -2269,10 +2269,6 @@ static int
 fasttrap_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int fflag,
 struct thread *td)
 {
-#ifdef notyet
-   struct kinfo_proc kp;
-   const cred_t *cr = td->td_ucred;
-#endif
if (!dtrace_attached())
return (EAGAIN);
 
@@ -2328,47 +2324,24 @@ fasttrap_ioctl(struct cdev *dev, u_long 
proc_t *p;
pid_t pid = probe->ftps_pid;
 
-#ifdef illumos
mutex_enter();
-#endif
/*
 * Report an error if the process doesn't exist
 * or is actively being birthed.
 */
-   sx_slock(_lock);
-   p = pfind(pid);
-   if (p)
-   fill_kinfo_proc(p, );
-   sx_sunlock(_lock);
-   if (p == NULL || kp.ki_stat == SIDL) {
-#ifdef illumos
+   if ((p = pfind(pid)) == NULL || p->p_stat == SIDL) {
mutex_exit();
-#endif
return (ESRCH);
}
-#ifdef illumos
mutex_enter(>p_lock);
mutex_exit();
-#else
-   PROC_LOCK_ASSERT(p, MA_OWNED);
-#endif
 
-#ifdef notyet
if ((ret = priv_proc_cred_perm(cr, p, NULL,
VREAD | VWRITE)) != 0) {
-#ifdef illumos
mutex_exit(>p_lock);
-#else
-   PROC_UNLOCK(p);
-#endif
return (ret);
}
-#endif /* notyet */
-#ifdef illumos
mutex_exit(>p_lock);
-#else
-   PROC_UNLOCK(p);
-#endif
}
 #endif /* notyet */
 
@@ -2382,7 +2355,7 @@ err:
fasttrap_instr_query_t instr;
fasttrap_tracepoint_t *tp;
uint_t index;
-#ifdef illumos
+#ifdef notyet
int ret;
 #endif
 
@@ -2396,48 +2369,25 @@ err:
proc_t *p;
pid_t pid = instr.ftiq_pid;
 
-#ifdef illumos
mutex_enter();
-#endif
/*
 * Report an error if the process doesn't exist
 * or is actively being birthed.
 */
-   sx_slock(_lock);
-   p = pfind(pid);
-   if (p)
-   fill_kinfo_proc(p, );
-   sx_sunlock(_lock);
-   if (p == NULL || kp.ki_stat == SIDL) {
-#ifdef illumos
+   if ((p == pfind(pid)) == NULL || p->p_stat == SIDL) {
mutex_exit();
-#endif
return (ESRCH);
}
-#ifdef illumos
mutex_enter(>p_lock);
mutex_exit();
-#else
-   PROC_LOCK_ASSERT(p, MA_OWNED);
-#endif
 
-#ifdef notyet
if ((ret = priv_proc_cred_perm(cr, p, NULL,
VREAD)) != 0) {
-#ifdef illumos
mutex_exit(>p_lock);
-#else
-   PROC_UNLOCK(p);
-#endif
return (ret);
}
-#endif /* notyet */
 
-#ifdef illumos
mutex_exit(>p_lock);
-#else
-   PROC_UNLOCK(p);
-#endif
}
 #endif /* notyet */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317570 - head/lib/libedit

2017-04-28 Thread Conrad Meyer
Author: cem
Date: Fri Apr 28 21:05:28 2017
New Revision: 317570
URL: https://svnweb.freebsd.org/changeset/base/317570

Log:
  editline.3: Add missing argument to H_SET description
  
  The H_SET operation of the history() function takes an int argument which is
  the position of the item to which the cursor should be moved to.
  
  Submitted by: Abhinav Upadhyay 

Modified:
  head/lib/libedit/editline.3

Modified: head/lib/libedit/editline.3
==
--- head/lib/libedit/editline.3 Fri Apr 28 20:51:18 2017(r317569)
+++ head/lib/libedit/editline.3 Fri Apr 28 21:05:28 2017(r317570)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 24, 2016
+.Dd April 28, 2017
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -767,7 +767,7 @@ Return the previous element in the histo
 Return the next element in the history.
 .It Dv H_CURR
 Return the current element in the history.
-.It Dv H_SET
+.It Dv H_SET , Fa "int position"
 Set the cursor to point to the requested element.
 .It Dv H_ADD , Fa "const char *str"
 Append
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317568 - head/sys/dev/mlx5/mlx5_en

2017-04-28 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Apr 28 19:38:57 2017
New Revision: 317568
URL: https://svnweb.freebsd.org/changeset/base/317568

Log:
  Improve sysadmin visibility of physical port error counters in the
  mlx5en driver.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cFri Apr 28 18:25:10 2017
(r317567)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cFri Apr 28 19:38:57 2017
(r317568)
@@ -542,19 +542,33 @@ mlx5e_update_stats_work(struct work_stru
s->tx_csum_offload = s->tx_packets - tx_offload_none;
s->rx_csum_good = s->rx_packets - s->rx_csum_none;
 
-   /* Update per port counters */
+   /* Get physical port counters */
mlx5e_update_pport_counters(priv);
 
 #if (__FreeBSD_version < 110)
/* no get_counters interface in fbsd 10 */
ifp->if_ipackets = s->rx_packets;
-   ifp->if_ierrors = s->rx_error_packets;
+   ifp->if_ierrors = s->rx_error_packets +
+   priv->stats.pport.alignment_err +
+   priv->stats.pport.check_seq_err +
+   priv->stats.pport.crc_align_errors +
+   priv->stats.pport.drop_events +
+   priv->stats.pport.in_range_len_errors +
+   priv->stats.pport.jabbers +
+   priv->stats.pport.out_of_range_len +
+   priv->stats.pport.oversize_pkts +
+   priv->stats.pport.symbol_err +
+   priv->stats.pport.too_long_errors +
+   priv->stats.pport.undersize_pkts +
+   priv->stats.pport.unsupported_op_rx;
ifp->if_iqdrops = s->rx_out_of_buffer;
ifp->if_opackets = s->tx_packets;
ifp->if_oerrors = s->tx_error_packets;
ifp->if_snd.ifq_drops = s->tx_queue_dropped;
ifp->if_ibytes = s->rx_bytes;
ifp->if_obytes = s->tx_bytes;
+   ifp->if_collisions =
+   priv->stats.pport.collisions;
 #endif
 
 free_out:
@@ -2449,7 +2463,19 @@ mlx5e_get_counter(struct ifnet *ifp, ift
retval = priv->stats.vport.rx_packets;
break;
case IFCOUNTER_IERRORS:
-   retval = priv->stats.vport.rx_error_packets;
+   retval = priv->stats.vport.rx_error_packets +
+   priv->stats.pport.alignment_err +
+   priv->stats.pport.check_seq_err +
+   priv->stats.pport.crc_align_errors +
+   priv->stats.pport.drop_events +
+   priv->stats.pport.in_range_len_errors +
+   priv->stats.pport.jabbers +
+   priv->stats.pport.out_of_range_len +
+   priv->stats.pport.oversize_pkts +
+   priv->stats.pport.symbol_err +
+   priv->stats.pport.too_long_errors +
+   priv->stats.pport.undersize_pkts +
+   priv->stats.pport.unsupported_op_rx;
break;
case IFCOUNTER_IQDROPS:
retval = priv->stats.vport.rx_out_of_buffer;
@@ -2475,6 +2501,9 @@ mlx5e_get_counter(struct ifnet *ifp, ift
case IFCOUNTER_OQDROPS:
retval = priv->stats.vport.tx_queue_dropped;
break;
+   case IFCOUNTER_COLLISIONS:
+   retval = priv->stats.pport.collisions;
+   break;
default:
retval = if_get_counter_default(ifp, cnt);
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317567 - head/sys/x86/x86

2017-04-28 Thread Conrad Meyer
Author: cem
Date: Fri Apr 28 18:25:10 2017
New Revision: 317567
URL: https://svnweb.freebsd.org/changeset/base/317567

Log:
  x86 MCA: Fix a deadlock in MCA exception processing
  
  In exceptional circumstances, an MCA exception will trigger when the
  freelist is exhausted. In such a case, no error will be logged on the list
  and 'mca_count' will not be incremented.
  
  Prior to this patch, all CPUs that received the exception would spin
  forever.
  
  With this change, the CPU that detects the error but finds the freelist
  empty will proceed to panic the machine, ending the deadlock.
  
  A follow-up to r260457.
  
  Reported by:  Ryan Libby 
  Reviewed by:  jhb@
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D10536

Modified:
  head/sys/x86/x86/mca.c

Modified: head/sys/x86/x86/mca.c
==
--- head/sys/x86/x86/mca.c  Fri Apr 28 17:58:15 2017(r317566)
+++ head/sys/x86/x86/mca.c  Fri Apr 28 18:25:10 2017(r317567)
@@ -653,7 +653,7 @@ amd_thresholding_update(enum scan_mode m
  * count of the number of valid MC records found.
  */
 static int
-mca_scan(enum scan_mode mode)
+mca_scan(enum scan_mode mode, int *recoverablep)
 {
struct mca_record rec;
uint64_t mcg_cap, ucmask;
@@ -704,7 +704,9 @@ mca_scan(enum scan_mode mode)
}
if (mode == POLLED)
mca_fill_freelist();
-   return (mode == MCE ? recoverable : count);
+   if (recoverablep != NULL)
+   *recoverablep = recoverable;
+   return (count);
 }
 
 /*
@@ -726,7 +728,7 @@ mca_scan_cpus(void *context, int pending
CPU_FOREACH(cpu) {
sched_bind(td, cpu);
thread_unlock(td);
-   count += mca_scan(POLLED);
+   count += mca_scan(POLLED, NULL);
thread_lock(td);
sched_unbind(td);
}
@@ -1150,7 +1152,7 @@ void
 mca_intr(void)
 {
uint64_t mcg_status;
-   int old_count, recoverable;
+   int recoverable, count;
 
if (!(cpu_feature & CPUID_MCA)) {
/*
@@ -1164,20 +1166,18 @@ mca_intr(void)
}
 
/* Scan the banks and check for any non-recoverable errors. */
-   old_count = mca_count;
-   recoverable = mca_scan(MCE);
+   count = mca_scan(MCE, );
mcg_status = rdmsr(MSR_MCG_STATUS);
if (!(mcg_status & MCG_STATUS_RIPV))
recoverable = 0;
 
if (!recoverable) {
/*
-* Wait for at least one error to be logged before
-* panic'ing.  Some errors will assert a machine check
-* on all CPUs, but only certain CPUs will find a valid
-* bank to log.
+* Only panic if the error was detected local to this CPU.
+* Some errors will assert a machine check on all CPUs, but
+* only certain CPUs will find a valid bank to log.
 */
-   while (mca_count == old_count)
+   while (count == 0)
cpu_spinwait();
 
panic("Unrecoverable machine check exception");
@@ -1199,7 +1199,7 @@ cmc_intr(void)
 * Serialize MCA bank scanning to prevent collisions from
 * sibling threads.
 */
-   count = mca_scan(CMCI);
+   count = mca_scan(CMCI, NULL);
 
/* If we found anything, log them to the console. */
if (count != 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317566 - head/tests/sys/kern

2017-04-28 Thread Brooks Davis
Author: brooks
Date: Fri Apr 28 17:58:15 2017
New Revision: 317566
URL: https://svnweb.freebsd.org/changeset/base/317566

Log:
  Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).
  
  These command take an int. The tests work by accident on little-endian,
  64-bit systems.
  
  PR:   218919
  Tested with:  qemu-cheri and CheriBSD built for mips64
  Reviewed by:  asomers, ngie
  Obtained from:CheriBSD
  MFC after:1 week
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D10518

Modified:
  head/tests/sys/kern/unix_seqpacket_test.c

Modified: head/tests/sys/kern/unix_seqpacket_test.c
==
--- head/tests/sys/kern/unix_seqpacket_test.c   Fri Apr 28 17:57:07 2017
(r317565)
+++ head/tests/sys/kern/unix_seqpacket_test.c   Fri Apr 28 17:58:15 2017
(r317566)
@@ -127,7 +127,7 @@ shutdown_send_sigpipe_handler(int __unus
  * Parameterized test function bodies
  */
 static void
-test_eagain(size_t sndbufsize, size_t rcvbufsize)
+test_eagain(int sndbufsize, int rcvbufsize)
 {
int i;
int sv[2];
@@ -165,7 +165,7 @@ test_eagain(size_t sndbufsize, size_t rc
 }
 
 static void
-test_sendrecv_symmetric_buffers(size_t bufsize, int blocking) {
+test_sendrecv_symmetric_buffers(int bufsize, int blocking) {
int s;
int sv[2];
const ssize_t pktsize = bufsize / 2;
@@ -209,7 +209,7 @@ test_sendrecv_symmetric_buffers(size_t b
 }
 
 static void
-test_pipe_simulator(size_t sndbufsize, size_t rcvbufsize)
+test_pipe_simulator(int sndbufsize, int rcvbufsize)
 {
int num_sent, num_received;
int sv[2];
@@ -341,7 +341,7 @@ test_pipe_reader(void* args)
 
 
 static void
-test_pipe(size_t sndbufsize, size_t rcvbufsize)
+test_pipe(int sndbufsize, int rcvbufsize)
 {
test_pipe_thread_data_t writer_data, reader_data;
pthread_t writer, reader;
@@ -875,8 +875,8 @@ ATF_TC_WITHOUT_HEAD(emsgsize);
 ATF_TC_BODY(emsgsize, tc)
 {
int sv[2];
-   const size_t sndbufsize = 8192;
-   const size_t rcvbufsize = 8192;
+   const int sndbufsize = 8192;
+   const int rcvbufsize = 8192;
const size_t pktsize = (sndbufsize + rcvbufsize) * 2;
char sndbuf[pktsize];
ssize_t ssize;
@@ -904,8 +904,8 @@ ATF_TC_WITHOUT_HEAD(emsgsize_nonblocking
 ATF_TC_BODY(emsgsize_nonblocking, tc)
 {
int sv[2];
-   const size_t sndbufsize = 8192;
-   const size_t rcvbufsize = 8192;
+   const int sndbufsize = 8192;
+   const int rcvbufsize = 8192;
const size_t pktsize = (sndbufsize + rcvbufsize) * 2;
char sndbuf[pktsize];
ssize_t ssize;
@@ -962,8 +962,8 @@ ATF_TC_BODY(rcvbuf_oversized, tc)
int i;
int sv[2];
const ssize_t pktsize = 1024;
-   const size_t sndbufsize = 8192;
-   const size_t rcvbufsize = 131072;
+   const int sndbufsize = 8192;
+   const int rcvbufsize = 131072;
const size_t geometric_mean_bufsize = 32768;
const int numpkts = geometric_mean_bufsize / pktsize;
char sndbuf[pktsize];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317561 - head/sys/dev/vt

2017-04-28 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr 28 16:42:52 2017
New Revision: 317561
URL: https://svnweb.freebsd.org/changeset/base/317561

Log:
  Simplify the code a bit.  No functional change.

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Fri Apr 28 16:39:09 2017(r317560)
+++ head/sys/dev/vt/vt_core.c   Fri Apr 28 16:42:52 2017(r317561)
@@ -1150,29 +1150,28 @@ vt_mark_mouse_position_as_dirty(struct v
 #endif
 
 static void
-vt_set_border(struct vt_window *vw, term_color_t c)
+vt_set_border(struct vt_device *vd, term_color_t c)
 {
-   struct vt_device *vd = vw->vw_device;
-   term_rect_t *vda = >vw_draw_area;
+   term_rect_t *tarea = >vd_curwindow->vw_draw_area;
int x, y;
 
/* Top bar. */
-   for (y = 0; y < vda->tr_begin.tp_row; y++)
+   for (y = 0; y < tarea->tr_begin.tp_row; y++)
for (x = 0; x < vd->vd_width; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
 
-   for (y = vda->tr_begin.tp_row; y < vda->tr_end.tp_row; y++) {
+   for (y = tarea->tr_begin.tp_row; y < tarea->tr_end.tp_row; y++) {
/* Left bar. */
-   for (x = 0; x < vda->tr_begin.tp_col; x++)
+   for (x = 0; x < tarea->tr_begin.tp_col; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
 
/* Right bar. */
-   for (x = vda->tr_end.tp_col; x < vd->vd_width; x++)
+   for (x = tarea->tr_end.tp_col; x < vd->vd_width; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
}
 
/* Bottom bar. */
-   for (y = vda->tr_end.tp_row; y < vd->vd_height; y++)
+   for (y = tarea->tr_end.tp_row; y < vd->vd_height; y++)
for (x = 0; x < vd->vd_width; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
 }
@@ -1242,7 +1241,7 @@ vt_flush(struct vt_device *vd)
if (vd->vd_flags & VDF_INVALID) {
vd->vd_flags &= ~VDF_INVALID;
 
-   vt_set_border(vw, TC_BLACK);
+   vt_set_border(vd, TC_BLACK);
vt_termrect(vd, vf, );
if (vt_draw_logo_cpus)
vtterm_draw_cpu_logos(vd);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317560 - head/sys/dev/vt

2017-04-28 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr 28 16:39:09 2017
New Revision: 317560
URL: https://svnweb.freebsd.org/changeset/base/317560

Log:
  Fix end coordinate of the drawable area of border.  Although the name tr_end
  suggests it is the end coordinate, tr_end.tp_row is width and tr_end.tp_col
  is height of the drawable area in reality.
  
  PR:   202288

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Fri Apr 28 16:16:22 2017(r317559)
+++ head/sys/dev/vt/vt_core.c   Fri Apr 28 16:39:09 2017(r317560)
@@ -1161,18 +1161,18 @@ vt_set_border(struct vt_window *vw, term
for (x = 0; x < vd->vd_width; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
 
-   for (y = vda->tr_begin.tp_row; y <= vda->tr_end.tp_row; y++) {
+   for (y = vda->tr_begin.tp_row; y < vda->tr_end.tp_row; y++) {
/* Left bar. */
for (x = 0; x < vda->tr_begin.tp_col; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
 
/* Right bar. */
-   for (x = vda->tr_end.tp_col + 1; x < vd->vd_width; x++)
+   for (x = vda->tr_end.tp_col; x < vd->vd_width; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
}
 
/* Bottom bar. */
-   for (y = vda->tr_end.tp_row + 1; y < vd->vd_height; y++)
+   for (y = vda->tr_end.tp_row; y < vd->vd_height; y++)
for (x = 0; x < vd->vd_width; x++)
vd->vd_driver->vd_setpixel(vd, x, y, c);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r317545 - head/usr.sbin/bhyve

2017-04-28 Thread Roman Bogorodskiy
  Gleb Smirnoff wrote:

> Author: glebius
> Date: Fri Apr 28 05:43:27 2017
> New Revision: 317545
> URL: https://svnweb.freebsd.org/changeset/base/317545
> 
> Log:
>   Document raw framebuffer device and XHCI device configurations.

Thanks for abandoning my work https://reviews.freebsd.org/D10014 (a link
they I gave when you were talking about manpage stuff on #bhyve).

You might want to pull some additional bits from that patch though.

> Modified:
>   head/usr.sbin/bhyve/bhyve.8
> 
> Modified: head/usr.sbin/bhyve/bhyve.8
> ==
> --- head/usr.sbin/bhyve/bhyve.8   Fri Apr 28 05:32:26 2017
> (r317544)
> +++ head/usr.sbin/bhyve/bhyve.8   Fri Apr 28 05:43:27 2017
> (r317545)
> @@ -24,7 +24,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd February 27, 2017
> +.Dd April 27, 2017
>  .Dt BHYVE 8
>  .Os
>  .Sh NAME
> @@ -188,6 +188,10 @@ PCI 16550 serial device.
>  .It Li lpc
>  LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports and a boot ROM.
>  The LPC bridge emulation can only be configured on bus 0.
> +.It Li fbuf
> +Raw framebuffer device attached to VNC server.
> +.It Li xhci
> +XHCI USB controller.
>  .El
>  .It Op Ar conf
>  This optional parameter describes the backend for device emulations.
> @@ -299,6 +303,40 @@ resize at present.
>  Emergency write is advertised, but no-op at present.
>  .El
>  .El
> +.Pp
> +Raw framebuffer device:
> +.Pp
> +.Oo wait Oc Ns Oo ,vga= Ns Ar  Oc Oo ,rfb= Ns Oo Ar IP: Oc Ns Ar 
> port Oc Ns Oo ,w= Ns Ar w Oc Ns Oo ,h= Ns Ar h Oc
> +.Bl -tag -width [vga=on|io|off]
> +.It wait
> +Wait for a VNC client connection before booting the virtual machine.
> +The default is not to wait.
> +.It vga= Ns Ar on|io|off
> +Enable VGA emulation.
> +The default is
> +.Va io
> +mode: VGA is enabled, but only I/O ports are available,
> +no VGA memory is provided.
> +.It rfb= Ns Oo Ar IP: Oc Ns Ar port
> +Set the VNC server to listen at
> +.Va IP:port .
> +The default is to listen on localhost IPv4 address and default VNC port 5900.
> +Listening on a IPv6 address is not supported.
> +.It w= Ns Ar width
> +Set framebuffer width to
> +.Ar width .
> +The default width is 1920.
> +.It h= Ns Ar height
> +Set framebuffer height to
> +.Ar height .
> +The default height is 1080.
> +.El
> +.Pp
> +XHCI USB controller device:
> +.Bl -tag
> +.It Ar tablet
> +Emulate USB tablet mouse.
> +.El
>  .El
>  .It Fl S
>  Wire guest memory.
> ___
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Roman Bogorodskiy


signature.asc
Description: PGP signature


svn commit: r317559 - head/bin/sh

2017-04-28 Thread Jilles Tjoelker
Author: jilles
Date: Fri Apr 28 16:16:22 2017
New Revision: 317559
URL: https://svnweb.freebsd.org/changeset/base/317559

Log:
  sh: Simplify handling of newlines in command substitution.
  
  Unless we need to split on newlines, just append them as normal and remove
  them at the end.

Modified:
  head/bin/sh/expand.c

Modified: head/bin/sh/expand.c
==
--- head/bin/sh/expand.cFri Apr 28 15:38:34 2017(r317558)
+++ head/bin/sh/expand.cFri Apr 28 16:16:22 2017(r317559)
@@ -462,6 +462,7 @@ expbackq(union node *cmd, int quoted, in
int quotes = flag & (EXP_GLOB | EXP_CASE);
size_t nnl;
const char *ifs;
+   int startloc;
 
INTOFF;
p = grabstackstr(dest);
@@ -469,6 +470,7 @@ expbackq(union node *cmd, int quoted, in
ungrabstackstr(p, dest);
 
p = in.buf;
+   startloc = dest - stackblock();
nnl = 0;
if (!quoted && flag & EXP_SPLIT)
ifs = ifsset() ? ifsval() : " \t\n";
@@ -490,31 +492,24 @@ expbackq(union node *cmd, int quoted, in
lastc = *p++;
if (lastc == '\0')
continue;
-   if (lastc == '\n') {
-   nnl++;
-   } else {
-   if (nnl > 0) {
-   if (strchr(ifs, '\n') != NULL) {
-   NEXTWORD('\n', flag, dest, dst);
-   nnl = 0;
-   } else {
-   CHECKSTRSPACE(nnl + 2, dest);
-   while (nnl > 0) {
-   nnl--;
-   USTPUTC('\n', dest);
-   }
-   }
-   }
-   if (strchr(ifs, lastc) != NULL)
+   if (nnl > 0 && lastc != '\n') {
+   NEXTWORD('\n', flag, dest, dst);
+   nnl = 0;
+   }
+   if (strchr(ifs, lastc) != NULL) {
+   if (lastc == '\n')
+   nnl++;
+   else
NEXTWORD(lastc, flag, dest, dst);
-   else {
-   CHECKSTRSPACE(2, dest);
-   if (quotes && syntax[(int)lastc] == CCTL)
-   USTPUTC(CTLESC, dest);
-   USTPUTC(lastc, dest);
-   }
+   } else {
+   CHECKSTRSPACE(2, dest);
+   if (quotes && syntax[(int)lastc] == CCTL)
+   USTPUTC(CTLESC, dest);
+   USTPUTC(lastc, dest);
}
}
+   while (dest > stackblock() + startloc && STTOPC(dest) == '\n')
+   STUNPUTC(dest);
 
if (in.fd >= 0)
close(in.fd);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317558 - head/sys/netinet

2017-04-28 Thread Michael Tuexen
Author: tuexen
Date: Fri Apr 28 15:38:34 2017
New Revision: 317558
URL: https://svnweb.freebsd.org/changeset/base/317558

Log:
  Set the DF bit for responses to out-of-the-blue packets.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Fri Apr 28 15:15:26 2017
(r317557)
+++ head/sys/netinet/sctp_output.c  Fri Apr 28 15:38:34 2017
(r317558)
@@ -11147,7 +11147,7 @@ sctp_send_resp_msg(struct sockaddr *src,
ip->ip_v = IPVERSION;
ip->ip_hl = (sizeof(struct ip) >> 2);
ip->ip_tos = 0;
-   ip->ip_off = 0;
+   ip->ip_off = htons(IP_DF);
ip_fillid(ip);
ip->ip_ttl = MODULE_GLOBAL(ip_defttl);
if (port) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r317547 - head/sys/net

2017-04-28 Thread Alexander Motin
Author: mav
Date: Fri Apr 28 11:00:58 2017
New Revision: 317547
URL: https://svnweb.freebsd.org/changeset/base/317547

Log:
  Allow some control over enabled capabilities for if_vlan.
  
  It improves interoperability with if_bridge, which may need to disable
  some capabilities not supported by other members.  IMHO there is still
  open question about LRO capability, which may need to be disabled on
  physical interface.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_vlan.c
==
--- head/sys/net/if_vlan.c  Fri Apr 28 09:17:16 2017(r317546)
+++ head/sys/net/if_vlan.c  Fri Apr 28 11:00:58 2017(r317547)
@@ -113,6 +113,7 @@ struct  ifvlan {
 #definePARENT(ifv) ((ifv)->ifv_trunk->parent)
void*ifv_cookie;
int ifv_pflags; /* special flags we have set on parent */
+   int ifv_capenable;
struct  ifv_linkmib {
int ifvm_encaplen;  /* encapsulation length */
int ifvm_mtufudge;  /* MTU fudged by this much */
@@ -1294,6 +1295,7 @@ exists:
ifv->ifv_encaplen = ETHER_VLAN_ENCAP_LEN;
ifv->ifv_mintu = ETHERMIN;
ifv->ifv_pflags = 0;
+   ifv->ifv_capenable = -1;
 
/*
 * If the parent supports the VLAN_MTU capability,
@@ -1545,9 +1547,14 @@ vlan_capabilities(struct ifvlan *ifv)
struct ifnet *p = PARENT(ifv);
struct ifnet *ifp = ifv->ifv_ifp;
struct ifnet_hw_tsomax hw_tsomax;
+   int cap = 0, ena = 0, mena;
+   u_long hwa = 0;
 
TRUNK_LOCK_ASSERT(TRUNK(ifv));
 
+   /* Mask parent interface enabled capabilities disabled by user. */
+   mena = p->if_capenable & ifv->ifv_capenable;
+
/*
 * If the parent interface can do checksum offloading
 * on VLANs, then propagate its hardware-assisted
@@ -1555,20 +1562,18 @@ vlan_capabilities(struct ifvlan *ifv)
 * offloading requires hardware VLAN tagging.
 */
if (p->if_capabilities & IFCAP_VLAN_HWCSUM)
-   ifp->if_capabilities =
-   p->if_capabilities & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6);
-
+   cap |= p->if_capabilities & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6);
if (p->if_capenable & IFCAP_VLAN_HWCSUM &&
p->if_capenable & IFCAP_VLAN_HWTAGGING) {
-   ifp->if_capenable =
-   p->if_capenable & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6);
-   ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP |
-   CSUM_UDP | CSUM_SCTP | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 |
-   CSUM_SCTP_IPV6);
-   } else {
-   ifp->if_capenable = 0;
-   ifp->if_hwassist = 0;
+   ena |= mena & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6);
+   if (ena & IFCAP_TXCSUM)
+   hwa |= p->if_hwassist & (CSUM_IP | CSUM_TCP |
+   CSUM_UDP | CSUM_SCTP);
+   if (ena & IFCAP_TXCSUM_IPV6)
+   hwa |= p->if_hwassist & (CSUM_TCP_IPV6 |
+   CSUM_UDP_IPV6 | CSUM_SCTP_IPV6);
}
+
/*
 * If the parent interface can do TSO on VLANs then
 * propagate the hardware-assisted flag. TSO on VLANs
@@ -1578,13 +1583,11 @@ vlan_capabilities(struct ifvlan *ifv)
if_hw_tsomax_common(p, _tsomax);
if_hw_tsomax_update(ifp, _tsomax);
if (p->if_capabilities & IFCAP_VLAN_HWTSO)
-   ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO;
+   cap |= p->if_capabilities & IFCAP_TSO;
if (p->if_capenable & IFCAP_VLAN_HWTSO) {
-   ifp->if_capenable |= p->if_capenable & IFCAP_TSO;
-   ifp->if_hwassist |= p->if_hwassist & CSUM_TSO;
-   } else {
-   ifp->if_capenable &= ~(p->if_capenable & IFCAP_TSO);
-   ifp->if_hwassist &= ~(p->if_hwassist & CSUM_TSO);
+   ena |= mena & IFCAP_TSO;
+   if (ena & IFCAP_TSO)
+   hwa |= p->if_hwassist & CSUM_TSO;
}
 
/*
@@ -1597,20 +1600,31 @@ vlan_capabilities(struct ifvlan *ifv)
 */
 #defineIFCAP_VLAN_TOE IFCAP_TOE
if (p->if_capabilities & IFCAP_VLAN_TOE)
-   ifp->if_capabilities |= p->if_capabilities & IFCAP_TOE;
+   cap |= p->if_capabilities & IFCAP_TOE;
if (p->if_capenable & IFCAP_VLAN_TOE) {
TOEDEV(ifp) = TOEDEV(p);
-   ifp->if_capenable |= p->if_capenable & IFCAP_TOE;
+   ena |= mena & IFCAP_TOE;
}
 
+   /*
+* If the parent interface supports dynamic link state, so does the
+* VLAN interface.
+*/
+   cap |= (p->if_capabilities & IFCAP_LINKSTATE);
+   ena |= (mena & IFCAP_LINKSTATE);
+
 #ifdef RATELIMIT
/*
 * If the parent interface 

svn commit: r317546 - head/usr.sbin/tcpdrop

2017-04-28 Thread Maxim Konovalov
Author: maxim
Date: Fri Apr 28 09:17:16 2017
New Revision: 317546
URL: https://svnweb.freebsd.org/changeset/base/317546

Log:
  o Clean the whole array of IPv4 addresses not just a local part.
  
  PR:   218923
  Submitted by: Daniel McRobb

Modified:
  head/usr.sbin/tcpdrop/tcpdrop.c

Modified: head/usr.sbin/tcpdrop/tcpdrop.c
==
--- head/usr.sbin/tcpdrop/tcpdrop.c Fri Apr 28 05:43:27 2017
(r317545)
+++ head/usr.sbin/tcpdrop/tcpdrop.c Fri Apr 28 09:17:16 2017
(r317546)
@@ -321,7 +321,7 @@ tcpdropconn(const struct in_conninfo *in
sizeof inc->inc6_faddr);
foreign = (struct sockaddr *)[TCPDROP_FOREIGN];
} else {
-   memset([TCPDROP_LOCAL], 0, sizeof sin4[TCPDROP_LOCAL]);
+   memset(sin4, 0, sizeof sin4);
 
sin4[TCPDROP_LOCAL].sin_len = sizeof sin4[TCPDROP_LOCAL];
sin4[TCPDROP_LOCAL].sin_family = AF_INET;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"