svn commit: r323519 - head/lib/libefivar

2017-09-12 Thread Warner Losh
Author: imp
Date: Wed Sep 13 04:32:23 2017
New Revision: 323519
URL: https://svnweb.freebsd.org/changeset/base/323519

Log:
  Minor fixes to edge cases in efi_get_next_variable_name
  
  Fix allocating more memory for the names (unlikely to be needed, but
  still best to get right) to ask for the length the kernel told use we
  needed, not the old length of the variable. Mind the proper NUL that
  we add in the space we allocate. Free the old name string before we
  allcoate a new one to limit what we leak to the last one (free passed
  in name for the last one in the list), and detect the last one by rv
  != 0 and errno == ENOENT, rather then just the former to avoid false
  positives if errno happens to be ENOENT on entry.
  
  Sponsored by: Netflix

Modified:
  head/lib/libefivar/efivar.c

Modified: head/lib/libefivar/efivar.c
==
--- head/lib/libefivar/efivar.c Wed Sep 13 03:56:03 2017(r323518)
+++ head/lib/libefivar/efivar.c Wed Sep 13 04:32:23 2017(r323519)
@@ -225,8 +225,13 @@ efi_get_next_variable_name(efi_guid_t **guid, char **n
if (efi_open_dev() == -1)
return -1;
 
+   /*
+* Always allocate enough for an extra NUL on the end, but don't tell
+* the IOCTL about it so we can NUL terminate the name before converting
+* it to UTF8.
+*/
if (buf == NULL)
-   buf = malloc(buflen);
+   buf = malloc(buflen + sizeof(efi_char));
 
 again:
efi_var_reset();
@@ -244,21 +249,23 @@ again:
rv = ioctl(efi_fd, EFIIOC_VAR_NEXT, );
if (rv == 0 && var.name == NULL) {
/*
-* oops, too little space. Try again.
+* Variable name not long enough, so allocate more space for the
+* name and try again. As above, mind the NUL we add.
 */
-   void *new = realloc(buf, buflen);
-   buflen = var.namesize;
+   void *new = realloc(buf, var.namesize + sizeof(efi_char));
if (new == NULL) {
rv = -1;
errno = ENOMEM;
goto done;
}
+   buflen = var.namesize;
buf = new;
goto again;
}
 
if (rv == 0) {
-   *name = NULL; /* XXX */
+   free(*name);/* Free last name, to avoid 
leaking */
+   *name = NULL;   /* Force ucs2_to_utf8 to malloc 
new space */
var.name[var.namesize / sizeof(efi_char)] = 0;  /* EFI doesn't 
NUL terminate */
rv = ucs2_to_utf8(var.name, name);
if (rv != 0)
@@ -269,9 +276,11 @@ again:
 errout:
 
/* XXX The linux interface expects name to be a static buffer -- fix or 
leak memory? */
+   /* XXX for the moment, we free just before we'd leak, but still leak 
last one */
 done:
-   if (errno == ENOENT) {
+   if (rv != 0 && errno == ENOENT) {
errno = 0;
+   free(*name);/* Free last name, to avoid 
leaking */
return 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: r323518 - head/sys/conf

2017-09-12 Thread Sean Bruno
Author: sbruno
Date: Wed Sep 13 03:56:03 2017
New Revision: 323518
URL: https://svnweb.freebsd.org/changeset/base/323518

Log:
  Jenkins i386 LINT build uses NOTES to generate its LINT kernel config.
  
  ixl(4) isn't in here either, so I'll remove lio(4) too.

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Sep 13 02:44:50 2017(r323517)
+++ head/sys/conf/NOTES Wed Sep 13 03:56:03 2017(r323518)
@@ -2144,7 +2144,6 @@ deviceixgb# Intel Pro/10Gbe PCI-X 
Ethernet
 device ix  # Intel Pro/10Gbe PCIE Ethernet
 device ixv # Intel Pro/10Gbe PCIE Ethernet VF
 device le  # AMD Am7900 LANCE and Am79C9xx PCnet
-device lio # Cavium 23XX Ethernet
 device mxge# Myricom Myri-10G 10GbE NIC
 device nxge# Neterion Xframe 10GbE Server/Storage Adapter
 device oce # Emulex 10 GbE (OneConnect Ethernet)
___
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: r323517 - head/sys/dev/e1000

2017-09-12 Thread Stephen Hurd
Author: shurd
Date: Wed Sep 13 02:44:50 2017
New Revision: 323517
URL: https://svnweb.freebsd.org/changeset/base/323517

Log:
  Fix GCC build failure caused by r323516
  
  No need to declare cold when we #include 
  
  Reported by:  Jenkins
  Reviewed by:  sbruno
  Approved by:  sbruno (mentor)
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D12347

Modified:
  head/sys/dev/e1000/e1000_osdep.h

Modified: head/sys/dev/e1000/e1000_osdep.h
==
--- head/sys/dev/e1000/e1000_osdep.hWed Sep 13 01:18:42 2017
(r323516)
+++ head/sys/dev/e1000/e1000_osdep.hWed Sep 13 02:44:50 2017
(r323517)
@@ -78,7 +78,6 @@ ms_scale(int x) {
return (max(1, x/(1000/hz)));
}
 }
-extern int cold;
 
 static inline void
 safe_pause_us(int x) {
___
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: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-12 Thread Ryan Libby
On Tue, Sep 12, 2017 at 6:18 PM, Stephen Hurd  wrote:
> Author: shurd
> Date: Wed Sep 13 01:18:42 2017
> New Revision: 323516
> URL: https://svnweb.freebsd.org/changeset/base/323516
>
> Log:
>   Roll up iflib commits from github.  This pulls in most of the work done
>   by Matt Macy as well as other changes which he has accepted via pull
>   request to his github repo at https://github.com/mattmacy/networking/
>
>   This should bring -CURRENT and the github repo into close enough sync to
>   allow small feature branches rather than a large chain of interdependant
>   patches being developed out of tree.  The reset of the synchronization
>   should be able to be completed on github by splitting the remaining
>   changes that are not yet ready into short feature branches for later
>   review as smaller commits.
>
>   Here is a summary of changes included in this patch:
>
>   1)  More checks when INVARIANTS are enabled for eariler problem
>   detection
>   2)  Group Task Queue cleanups
>   - Fix use of duplicate shortdesc for gtaskqueue malloc type.
> Some interfaces such as memguard(9) use the short description to
> identify malloc types, so duplicates should be avoided.
>   3)  Allow gtaskqueues to use ithreads in addition to taskqueues
>   - In some cases, this can improve performance
>   4)  Better logging when taskqgroup_attach*() fails to set interrupt
>   affinity.
>   5)  Do not start gtaskqueues until they're needed
>   6)  Have mp_ring enqueue function enter the ABDICATED rather than BUSY
>   state.  This moves the TX to the gtaskq and allows processing to
>   continue faster as well as make TX batching more likely.
>   7)  Add an ift_txd_errata function to struct if_txrx.  This allows
>   drivers to inspect/modify mbufs before transmission.
>   8)  Add a new IFLIB_NEED_ZERO_CSUM for drivers to indicate they need
>   checksums zeroed for checksum offload to work.  This avoids modifying
>   packet data in the TX path when possible.
>   9)  Use ithreads for iflib I/O instead of taskqueues
>   10) Clean up ioctl and support async ioctl functions
>   11) Prefetch two cachlines from each mbuf instead of one up to 128B.  We
>   often need to parse packet header info beyond 64B.
>   12) Fix potential memory corruption due to fence post error in
>   bit_nclear() usage.
>   13) Improved hang detection and handling
>   14) If the packet is smaller than MTU, disable the TSO flags.
>   This avoids extra packet parsing when not needed.
>   15) Move TCP header parsing inside the IS_TSO?() test.
>   This avoids extra packet parsing when not needed.
>   16) Pass chains of mbufs that are not consumed by lro to if_input()
>   rather call if_input() for each mbuf.
>   17) Re-arrange packet header loads to get as much work as possible done
>   before a cache stall.
>   18) Lock the context when calling IFDI_ATTACH_PRE()/IFDI_ATTACH_POST()/
>   IFDI_DETACH();
>   19) Attempt to distribute RX/TX tasks across cores more sensibly,
>   especially when RX and TX share an interrupt.  RX will attempt to
>   take the first threads on a core, and TX will attempt to take
>   successive threads.
>   20) Allow iflib_softirq_alloc_generic() to request affinity to the same
>   cpus an interrupt has affinity with.  This allows TX queues to
>   ensure they are serviced by the socket the device is on.
>   21) Add new iflib sysctls to net.iflib:
>   - timer_int - interval at which to run per-queue timers in ticks
>   - force_busdma
>   22) Add new per-device iflib sysctls to dev.X.Y.iflib
>   - rx_budget allows tuning the batch size on the RX path
>   - watchdog_events Count of watchdog events seen since load
>   23) Fix error where netmap_rxq_init() could get called before
>   IFDI_INIT()
>   24) e1000: Fixed version of r323008: post-cold sleep instead of DELAY
>   when waiting for firmware
>   - After interrupts are enabled, convert all waits to sleeps
>   - Eliminates e1000 software/firmware synchronization busy waits after
> startup
>   25) e1000: Remove special case for budget=1 in em_txrx.c
>   - Premature optimization which may actually be incorrect with
> multi-segment packets
>   26) e1000: Split out TX interrupt rather than share an interrupt for
>   RX and TX.
>   - Allows better performance by keeping RX and TX paths separate
>   27) e1000: Separate igb from em code where suitable
>   Much easier to understand separate functions and "if (is_igb)" than
>   previous tests like "if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))"
>
>   #blamebruno
>
>   Reviewed by:  sbruno
>   Approved by:  sbruno (mentor)
>   Sponsored by: Limelight Networks
>   Differential Revision:https://reviews.freebsd.org/D12235
>
> Modified:
>   head/sys/dev/bnxt/if_bnxt.c
>   head/sys/dev/e1000/e1000_80003es2lan.c
>   head/sys/dev/e1000/e1000_82571.c
>   

svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-12 Thread Stephen Hurd
Author: shurd
Date: Wed Sep 13 01:18:42 2017
New Revision: 323516
URL: https://svnweb.freebsd.org/changeset/base/323516

Log:
  Roll up iflib commits from github.  This pulls in most of the work done
  by Matt Macy as well as other changes which he has accepted via pull
  request to his github repo at https://github.com/mattmacy/networking/
  
  This should bring -CURRENT and the github repo into close enough sync to
  allow small feature branches rather than a large chain of interdependant
  patches being developed out of tree.  The reset of the synchronization
  should be able to be completed on github by splitting the remaining
  changes that are not yet ready into short feature branches for later
  review as smaller commits.
  
  Here is a summary of changes included in this patch:
  
  1)  More checks when INVARIANTS are enabled for eariler problem
  detection
  2)  Group Task Queue cleanups
  - Fix use of duplicate shortdesc for gtaskqueue malloc type.
Some interfaces such as memguard(9) use the short description to
identify malloc types, so duplicates should be avoided.
  3)  Allow gtaskqueues to use ithreads in addition to taskqueues
  - In some cases, this can improve performance
  4)  Better logging when taskqgroup_attach*() fails to set interrupt
  affinity.
  5)  Do not start gtaskqueues until they're needed
  6)  Have mp_ring enqueue function enter the ABDICATED rather than BUSY
  state.  This moves the TX to the gtaskq and allows processing to
  continue faster as well as make TX batching more likely.
  7)  Add an ift_txd_errata function to struct if_txrx.  This allows
  drivers to inspect/modify mbufs before transmission.
  8)  Add a new IFLIB_NEED_ZERO_CSUM for drivers to indicate they need
  checksums zeroed for checksum offload to work.  This avoids modifying
  packet data in the TX path when possible.
  9)  Use ithreads for iflib I/O instead of taskqueues
  10) Clean up ioctl and support async ioctl functions
  11) Prefetch two cachlines from each mbuf instead of one up to 128B.  We
  often need to parse packet header info beyond 64B.
  12) Fix potential memory corruption due to fence post error in
  bit_nclear() usage.
  13) Improved hang detection and handling
  14) If the packet is smaller than MTU, disable the TSO flags.
  This avoids extra packet parsing when not needed.
  15) Move TCP header parsing inside the IS_TSO?() test.
  This avoids extra packet parsing when not needed.
  16) Pass chains of mbufs that are not consumed by lro to if_input()
  rather call if_input() for each mbuf.
  17) Re-arrange packet header loads to get as much work as possible done
  before a cache stall.
  18) Lock the context when calling IFDI_ATTACH_PRE()/IFDI_ATTACH_POST()/
  IFDI_DETACH();
  19) Attempt to distribute RX/TX tasks across cores more sensibly,
  especially when RX and TX share an interrupt.  RX will attempt to
  take the first threads on a core, and TX will attempt to take
  successive threads.
  20) Allow iflib_softirq_alloc_generic() to request affinity to the same
  cpus an interrupt has affinity with.  This allows TX queues to
  ensure they are serviced by the socket the device is on.
  21) Add new iflib sysctls to net.iflib:
  - timer_int - interval at which to run per-queue timers in ticks
  - force_busdma
  22) Add new per-device iflib sysctls to dev.X.Y.iflib
  - rx_budget allows tuning the batch size on the RX path
  - watchdog_events Count of watchdog events seen since load
  23) Fix error where netmap_rxq_init() could get called before
  IFDI_INIT()
  24) e1000: Fixed version of r323008: post-cold sleep instead of DELAY
  when waiting for firmware
  - After interrupts are enabled, convert all waits to sleeps
  - Eliminates e1000 software/firmware synchronization busy waits after
startup
  25) e1000: Remove special case for budget=1 in em_txrx.c
  - Premature optimization which may actually be incorrect with
multi-segment packets
  26) e1000: Split out TX interrupt rather than share an interrupt for
  RX and TX.
  - Allows better performance by keeping RX and TX paths separate
  27) e1000: Separate igb from em code where suitable
  Much easier to understand separate functions and "if (is_igb)" than
  previous tests like "if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))"
  
  #blamebruno
  
  Reviewed by:  sbruno
  Approved by:  sbruno (mentor)
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D12235

Modified:
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/dev/e1000/e1000_80003es2lan.c
  head/sys/dev/e1000/e1000_82571.c
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/e1000_i210.c
  head/sys/dev/e1000/e1000_i210.h
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/e1000/e1000_mac.c
  head/sys/dev/e1000/e1000_mac.h
  

svn commit: r323514 - head/usr.sbin/cxgbetool

2017-09-12 Thread Navdeep Parhar
Author: np
Date: Wed Sep 13 00:37:42 2017
New Revision: 323514
URL: https://svnweb.freebsd.org/changeset/base/323514

Log:
  cxgbetool(8): mode must be specified when creating the dump file.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

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

Modified: head/usr.sbin/cxgbetool/cxgbetool.c
==
--- head/usr.sbin/cxgbetool/cxgbetool.c Wed Sep 13 00:25:09 2017
(r323513)
+++ head/usr.sbin/cxgbetool/cxgbetool.c Wed Sep 13 00:37:42 2017
(r323514)
@@ -1896,7 +1896,8 @@ dumpstate(int argc, const char *argv[])
return (EINVAL);
}
 
-   fd = open(fname, O_CREAT | O_TRUNC | O_EXCL | O_WRONLY);
+   fd = open(fname, O_CREAT | O_TRUNC | O_EXCL | O_WRONLY,
+   S_IRUSR | S_IRGRP);
if (fd < 0) {
warn("open(%s)", fname);
return (errno);
___
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: r323513 - head/sys/net

2017-09-12 Thread Matt Joras
Author: mjoras
Date: Wed Sep 13 00:25:09 2017
New Revision: 323513
URL: https://svnweb.freebsd.org/changeset/base/323513

Log:
  Allow vlan interfaces to rx through netmap(4).
  
  Normally after receiving a packet, a vlan(4) interface sends the packet
  back through its parent interface's rx routine so that it can be
  processed as an untagged frame. It does this by using the parent's
  ifp->if_input. This is incompatible with netmap(4), which replaces the
  vlan(4) interface's if_input with a netmap(4) hook. Fix this by using
  the vlan(4) interface's ifp instead of the parent's directly.
  
  Reported by:  Harry Schmalzbauer 
  Reviewed by:  rstone
  Approved by:  rstone (mentor)
  MFC after:3 days
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D12191

Modified:
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_vlan.c
==
--- head/sys/net/if_vlan.c  Tue Sep 12 23:58:38 2017(r323512)
+++ head/sys/net/if_vlan.c  Wed Sep 13 00:25:09 2017(r323513)
@@ -1384,7 +1384,7 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
VLAN_RUNLOCK();
 
/* Pass it back through the parent's input routine. */
-   (*ifp->if_input)(ifv->ifv_ifp, m);
+   (*ifv->ifv_ifp->if_input)(ifv->ifv_ifp, m);
 }
 
 static void
___
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: r323512 - head/sys/conf

2017-09-12 Thread Sean Bruno
Author: sbruno
Date: Tue Sep 12 23:58:38 2017
New Revision: 323512
URL: https://svnweb.freebsd.org/changeset/base/323512

Log:
  Leave the Cavium Liquid IO driver exist in files, not files.amd64
  
  Submitted by: imp

Modified:
  head/sys/conf/files
  head/sys/conf/files.amd64

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Sep 12 23:46:33 2017(r323511)
+++ head/sys/conf/files Tue Sep 12 23:58:38 2017(r323512)
@@ -2216,6 +2216,62 @@ dev/le/if_le_pci.c   optional le pci
 dev/le/lance.c optional le
 dev/led/led.c  standard
 dev/lge/if_lge.c   optional lge
+dev/liquidio/base/cn23xx_pf_device.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_console.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_ctrl.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_device.c optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_droq.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_mem_ops.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_request_manager.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_response_manager.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_core.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_ioctl.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_main.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_rss.c optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_rxtx.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_sysctl.c  optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+lio.c  optional lio\
+   compile-with"${AWK} -f $S/tools/fw_stub.awk 
lio_23xx_nic.bin.fw:lio_23xx_nic.bin -mlio_23xx_nic.bin -c${.TARGET}" \
+   no-implicit-rule before-depend local\
+   clean   "lio.c"
+lio_23xx_nic.bin.fw.fwo optional lio   \
+   dependency  "lio_23xx_nic.bin.fw"   \
+   compile-with"${NORMAL_FWO}" \
+   no-implicit-rule\
+   clean   "lio_23xx_nic.bin.fw.fwo"
+lio_23xx_nic.bin.fwoptional lio\
+   dependency  "$S/contrib/dev/liquidio/lio_23xx_nic.bin.uu"   \
+   compile-with"${NORMAL_FW}"  \
+   no-obj no-implicit-rule \
+   clean   "lio_23xx_nic.bin.fw"
 dev/lmc/if_lmc.c   optional lmc
 dev/malo/if_malo.c optional malo
 dev/malo/if_malohal.c  optional malo

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Sep 12 23:46:33 2017(r323511)
+++ head/sys/conf/files.amd64   Tue Sep 12 23:58:38 2017(r323512)
@@ -328,62 +328,6 @@ dev/hyperv/vmbus/vmbus_res.c   
optionalhyperv
 dev/hyperv/vmbus/vmbus_xact.c  optionalhyperv
 dev/hyperv/vmbus/amd64/hyperv_machdep.c   

svn commit: r323511 - head/sys/cam

2017-09-12 Thread Warner Losh
Author: imp
Date: Tue Sep 12 23:46:33 2017
New Revision: 323511
URL: https://svnweb.freebsd.org/changeset/base/323511

Log:
  cam iosched: Limit the quanta default to hz if it's below 200
  
  The cam_iosched_ticker() can't be scheduled more than once per tick.
  Some limiters depend on quanta matching the number of calls per second
  to enforce the proper limits. Limit the quanta to no faster than 1 per
  clock tick. This fixes some features when running in VMs where the
  default HZ is 100.
  
  PR: 221953
  Obtained from: ElectroBSD
  Differential Revision: https://reviews.freebsd.org/D12337
  Submitted by: Fabian Keil

Modified:
  head/sys/cam/cam_iosched.c

Modified: head/sys/cam/cam_iosched.c
==
--- head/sys/cam/cam_iosched.c  Tue Sep 12 23:42:52 2017(r323510)
+++ head/sys/cam/cam_iosched.c  Tue Sep 12 23:46:33 2017(r323511)
@@ -1022,7 +1022,7 @@ cam_iosched_init(struct cam_iosched_softc **iscp, stru
bioq_init(&(*iscp)->write_queue);
(*iscp)->read_bias = 100;
(*iscp)->current_read_bias = 100;
-   (*iscp)->quanta = 200;
+   (*iscp)->quanta = min(hz, 200);
cam_iosched_iop_stats_init(*iscp, &(*iscp)->read_stats);
cam_iosched_iop_stats_init(*iscp, &(*iscp)->write_stats);
cam_iosched_iop_stats_init(*iscp, &(*iscp)->trim_stats);
___
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: r323510 - head/sys/conf

2017-09-12 Thread Warner Losh
This is  the *WRONG* way to have it build only on 64-bit architectures.

Leave it in files.

Only build the *MODULE* on 64-bit architectures

Warner

On Tue, Sep 12, 2017 at 5:42 PM, Sean Bruno  wrote:

> Author: sbruno
> Date: Tue Sep 12 23:42:52 2017
> New Revision: 323510
> URL: https://svnweb.freebsd.org/changeset/base/323510
>
> Log:
>   Do not try to build the Cavium Liquidio driver on all architechtures.
>
>   For now, limit to amd64 only.
>
> Modified:
>   head/sys/conf/files
>
> Modified: head/sys/conf/files
> 
> ==
> --- head/sys/conf/files Tue Sep 12 23:36:58 2017(r323509)
> +++ head/sys/conf/files Tue Sep 12 23:42:52 2017(r323510)
> @@ -2216,62 +2216,6 @@ dev/le/if_le_pci.c   optional le pci
>  dev/le/lance.c optional le
>  dev/led/led.c  standard
>  dev/lge/if_lge.c   optional lge
> -dev/liquidio/base/cn23xx_pf_device.c   optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/base/lio_console.coptional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/base/lio_ctrl.c   optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/base/lio_device.c optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/base/lio_droq.c   optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/base/lio_mem_ops.coptional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/base/lio_request_manager.coptional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/base/lio_response_manager.c   optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/lio_core.coptional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/lio_ioctl.c   optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/lio_main.coptional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/lio_rss.c optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/lio_rxtx.coptional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -dev/liquidio/lio_sysctl.c  optional lio\
> -   compile-with "${NORMAL_C}   \
> -   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
> -lio.c  optional lio\
> -   compile-with"${AWK} -f $S/tools/fw_stub.awk
> lio_23xx_nic.bin.fw:lio_23xx_nic.bin -mlio_23xx_nic.bin -c${.TARGET}" \
> -   no-implicit-rule before-depend local\
> -   clean   "lio.c"
> -lio_23xx_nic.bin.fw.fwo optional lio   \
> -   dependency  "lio_23xx_nic.bin.fw"   \
> -   compile-with"${NORMAL_FWO}" \
> -   no-implicit-rule\
> -   clean   "lio_23xx_nic.bin.fw.fwo"
> -lio_23xx_nic.bin.fwoptional lio\
> -   dependency  "$S/contrib/dev/liquidio/lio_23xx_nic.bin.uu"   \
> -   compile-with"${NORMAL_FW}"  \
> -   no-obj no-implicit-rule \
> -   clean   "lio_23xx_nic.bin.fw"
>  dev/lmc/if_lmc.c   optional lmc
>  dev/malo/if_malo.c optional malo
>  dev/malo/if_malohal.c  optional malo
>
>
___
svn-src-head@freebsd.org mailing list

svn commit: r323510 - head/sys/conf

2017-09-12 Thread Sean Bruno
Author: sbruno
Date: Tue Sep 12 23:42:52 2017
New Revision: 323510
URL: https://svnweb.freebsd.org/changeset/base/323510

Log:
  Do not try to build the Cavium Liquidio driver on all architechtures.
  
  For now, limit to amd64 only.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Sep 12 23:36:58 2017(r323509)
+++ head/sys/conf/files Tue Sep 12 23:42:52 2017(r323510)
@@ -2216,62 +2216,6 @@ dev/le/if_le_pci.c   optional le pci
 dev/le/lance.c optional le
 dev/led/led.c  standard
 dev/lge/if_lge.c   optional lge
-dev/liquidio/base/cn23xx_pf_device.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_console.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_ctrl.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_device.c optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_droq.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_mem_ops.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_request_manager.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_response_manager.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_core.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_ioctl.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_main.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_rss.c optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_rxtx.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_sysctl.c  optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-lio.c  optional lio\
-   compile-with"${AWK} -f $S/tools/fw_stub.awk 
lio_23xx_nic.bin.fw:lio_23xx_nic.bin -mlio_23xx_nic.bin -c${.TARGET}" \
-   no-implicit-rule before-depend local\
-   clean   "lio.c"
-lio_23xx_nic.bin.fw.fwo optional lio   \
-   dependency  "lio_23xx_nic.bin.fw"   \
-   compile-with"${NORMAL_FWO}" \
-   no-implicit-rule\
-   clean   "lio_23xx_nic.bin.fw.fwo"
-lio_23xx_nic.bin.fwoptional lio\
-   dependency  "$S/contrib/dev/liquidio/lio_23xx_nic.bin.uu"   \
-   compile-with"${NORMAL_FW}"  \
-   no-obj no-implicit-rule \
-   clean   "lio_23xx_nic.bin.fw"
 dev/lmc/if_lmc.c   optional lmc
 dev/malo/if_malo.c optional malo
 dev/malo/if_malohal.c  optional malo
___
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: r323509 - in head: share/man/man4 sys/conf sys/contrib/dev/liquidio sys/dev/liquidio sys/dev/liquidio/base sys/modules sys/modules/lio

2017-09-12 Thread Sean Bruno
Author: sbruno
Date: Tue Sep 12 23:36:58 2017
New Revision: 323509
URL: https://svnweb.freebsd.org/changeset/base/323509

Log:
  The diff is the initial submission of Cavium Liquidio 2350/2360 10/25G
  Intelligent NIC driver.
  
  The submission conconsists of firmware binary file and driver sources.
  
  Submitted by: pkannega...@cavium.com (Prasad V Kanneganti)
  Relnotes: Yes
  Sponsored by: Cavium Networks
  Differential Revision:https://reviews.freebsd.org/D11927

Added:
  head/share/man/man4/liquidio.4   (contents, props changed)
  head/sys/contrib/dev/liquidio/
  head/sys/contrib/dev/liquidio/lio_23xx_nic.bin.uu
  head/sys/dev/liquidio/
  head/sys/dev/liquidio/base/
  head/sys/dev/liquidio/base/cn23xx_pf_device.c   (contents, props changed)
  head/sys/dev/liquidio/base/cn23xx_pf_device.h   (contents, props changed)
  head/sys/dev/liquidio/base/cn23xx_pf_regs.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_common.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_config.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_console.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_ctrl.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_ctrl.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_device.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_device.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_droq.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_droq.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_image.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_iq.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_mem_ops.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_mem_ops.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_request_manager.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_response_manager.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_response_manager.h   (contents, props changed)
  head/sys/dev/liquidio/lio_bsd.h   (contents, props changed)
  head/sys/dev/liquidio/lio_core.c   (contents, props changed)
  head/sys/dev/liquidio/lio_ioctl.c   (contents, props changed)
  head/sys/dev/liquidio/lio_ioctl.h   (contents, props changed)
  head/sys/dev/liquidio/lio_main.c   (contents, props changed)
  head/sys/dev/liquidio/lio_main.h   (contents, props changed)
  head/sys/dev/liquidio/lio_network.h   (contents, props changed)
  head/sys/dev/liquidio/lio_rss.c   (contents, props changed)
  head/sys/dev/liquidio/lio_rss.h   (contents, props changed)
  head/sys/dev/liquidio/lio_rxtx.c   (contents, props changed)
  head/sys/dev/liquidio/lio_rxtx.h   (contents, props changed)
  head/sys/dev/liquidio/lio_sysctl.c   (contents, props changed)
  head/sys/modules/lio/
  head/sys/modules/lio/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/altq.4
  head/share/man/man4/vlan.4
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/files.amd64
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileTue Sep 12 22:19:21 2017
(r323508)
+++ head/share/man/man4/MakefileTue Sep 12 23:36:58 2017
(r323509)
@@ -253,6 +253,7 @@ MAN=aac.4 \
led.4 \
lge.4 \
${_linux.4} \
+   liquidio.4 \
lm75.4 \
lmc.4 \
lo.4 \

Modified: head/share/man/man4/altq.4
==
--- head/share/man/man4/altq.4  Tue Sep 12 22:19:21 2017(r323508)
+++ head/share/man/man4/altq.4  Tue Sep 12 23:36:58 2017(r323509)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2017
+.Dd August 28, 2017
 .Dt ALTQ 4
 .Os
 .Sh NAME
@@ -152,6 +152,7 @@ They have been applied to the following hardware drive
 .Xr ixgbe 4 ,
 .Xr jme 4 ,
 .Xr le 4 ,
+.Xr liquidio 4 ,
 .Xr msk 4 ,
 .Xr mxge 4 ,
 .Xr my 4 ,

Added: head/share/man/man4/liquidio.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/liquidio.4  Tue Sep 12 23:36:58 2017
(r323509)
@@ -0,0 +1,133 @@
+.\"  BSD LICENSE
+.\"
+.\"  Copyright(c) 2017 Cavium, Inc.. All rights reserved.
+.\"  All rights reserved.
+.\"
+.\"  Redistribution and use in source and binary forms, with or without
+.\"  modification, are permitted provided that the following conditions
+.\"  are met:
+.\"
+.\"* Redistributions of source code must retain the above copyright
+.\"  notice, this list of conditions and the following disclaimer.
+.\"* Redistributions in binary form must reproduce the above copyright
+.\"  notice, this list of conditions and the following disclaimer in
+.\"  the documentation and/or 

svn commit: r323508 - head/usr.sbin/bsdinstall/partedit

2017-09-12 Thread Ravi Pokala
Author: rpokala
Date: Tue Sep 12 22:19:21 2017
New Revision: 323508
URL: https://svnweb.freebsd.org/changeset/base/323508

Log:
  When doing a non-interactive installation, don't display an interactive
  warning about a filesystem which doesn't have a mountpoint. Presumably, the
  person who wrote the install script knew what they were doing.
  
  Submitted by: Brian Mueller 
  MFC after:1 month
  Sponsored by: Panasas
  Differential Revision:https://reviews.freebsd.org/D12346

Modified:
  head/usr.sbin/bsdinstall/partedit/gpart_ops.c

Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c
==
--- head/usr.sbin/bsdinstall/partedit/gpart_ops.c   Tue Sep 12 21:36:13 
2017(r323507)
+++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c   Tue Sep 12 22:19:21 
2017(r323508)
@@ -1043,14 +1043,17 @@ addpartform:
/* Warn if no mountpoint set */
if (strcmp(items[0].text, "freebsd-ufs") == 0 &&
items[2].text[0] != '/') {
-   dialog_vars.defaultno = TRUE;
-   choice = dialog_yesno("Warning",
-   "This partition does not have a valid mountpoint "
-   "(for the partition from which you intend to boot the "
-   "operating system, the mountpoint should be /). Are you "
-   "sure you want to continue?"
-   , 0, 0);
-   dialog_vars.defaultno = FALSE;
+   choice = 0;
+   if (interactive) {
+   dialog_vars.defaultno = TRUE;
+   choice = dialog_yesno("Warning",
+   "This partition does not have a valid mountpoint "
+   "(for the partition from which you intend to boot 
the "
+   "operating system, the mountpoint should be /). Are 
you "
+   "sure you want to continue?"
+   , 0, 0);
+   dialog_vars.defaultno = FALSE;
+   }
if (choice == 1) /* cancel */
goto addpartform;
}
___
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: r323507 - head/usr.bin/sockstat

2017-09-12 Thread Michael Tuexen
Author: tuexen
Date: Tue Sep 12 21:36:13 2017
New Revision: 323507
URL: https://svnweb.freebsd.org/changeset/base/323507

Log:
  Add support for printing the path state for SCTP association.

Modified:
  head/usr.bin/sockstat/sockstat.1
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.1
==
--- head/usr.bin/sockstat/sockstat.1Tue Sep 12 21:12:04 2017
(r323506)
+++ head/usr.bin/sockstat/sockstat.1Tue Sep 12 21:36:13 2017
(r323507)
@@ -153,8 +153,12 @@ The address the foreign end of the socket is bound to 
 The remote UDP encapsulation port number if
 .Fl U
 is specified (only for SCTP).
-.It Li STATE
-The protocol state if
+.It Li PATH STATE
+The path state if
+.Fl s
+is specified (only for SCTP).
+.It Li CONN STATE
+The connection state if
 .Fl s
 is specified (only for SCTP or TCP).
 .It Li STACK

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cTue Sep 12 21:12:04 2017
(r323506)
+++ head/usr.bin/sockstat/sockstat.cTue Sep 12 21:36:13 2017
(r323507)
@@ -97,6 +97,7 @@ static int*ports;
 struct addr {
struct sockaddr_storage address;
unsigned int encaps_port;
+   int state;
struct addr *next;
 };
 
@@ -534,6 +535,7 @@ gather_sctp(void)
xraddr->address.sa.sa_family);
}
faddr->encaps_port = xraddr->encaps_port; 
+   faddr->state = xraddr->state;
faddr->next = NULL;
if (prev_faddr == NULL)
sock->faddr = faddr;
@@ -939,7 +941,7 @@ check_ports(struct sock *s)
 }
 
 static const char *
-sctp_state(int state)
+sctp_conn_state(int state)
 {
switch (state) {
case SCTP_CLOSED:
@@ -978,6 +980,25 @@ sctp_state(int state)
}
 }
 
+static const char *
+sctp_path_state(int state)
+{
+   switch (state) {
+   case SCTP_UNCONFIRMED:
+   return "UNCONFIRMED";
+   break;
+   case SCTP_ACTIVE:
+   return "ACTIVE";
+   break;
+   case SCTP_INACTIVE:
+   return "INACTIVE";
+   break;
+   default:
+   return "UNKNOWN";
+   break;
+   }
+}
+
 static void
 displaysock(struct sock *s, int pos)
 {
@@ -1062,6 +1083,19 @@ displaysock(struct sock *s, int pos)
}
offset += 7;
}
+   if (opt_s) {
+   if (faddr != NULL &&
+   s->proto == IPPROTO_SCTP &&
+   s->state != SCTP_CLOSED &&
+   s->state != SCTP_BOUND &&
+   s->state != SCTP_LISTEN) {
+   while (pos < offset)
+   pos += xprintf(" ");
+   pos += xprintf("%s",
+   sctp_path_state(faddr->state));
+   }
+   offset += 13;
+   }
if (first) {
if (opt_s) {
if (s->proto == IPPROTO_SCTP ||
@@ -1071,7 +1105,7 @@ displaysock(struct sock *s, int pos)
switch (s->proto) {
case IPPROTO_SCTP:
pos += xprintf("%s",
-   sctp_state(s->state));
+   sctp_conn_state(s->state));
break;
case IPPROTO_TCP:
if (s->state >= 0 &&
@@ -1118,8 +1152,10 @@ display(void)
"LOCAL ADDRESS", "FOREIGN ADDRESS");
if (opt_U)
printf(" %-6s", "ENCAPS");
-   if (opt_s)
-   printf(" %-12s", "STATE");
+   if (opt_s) {
+   printf(" %-12s", "PATH STATE");
+   printf(" %-12s", "CONN STATE");
+   }
if (opt_S)
printf(" %.*s", TCP_FUNCTION_NAME_LEN_MAX, "STACK");
printf("\n");
___
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: r323506 - head/usr.sbin/iovctl

2017-09-12 Thread Ryan Stone
Author: rstone
Date: Tue Sep 12 21:12:04 2017
New Revision: 323506
URL: https://svnweb.freebsd.org/changeset/base/323506

Log:
  Fix incorrect error message in iovctl
  
  If the iovctl command was invoked with only the -C flag, the user would
  receive a message claiming that they needed to also supply either the
  -d flag or the -f flag.  However, in the case of the -C mode, only the
  -f flag is acceptable.  Correct this error message in this case.
  
  PR:   222050
  Submitted by: Heinz N. Gies
  Reported by:  Heinz N. Gies
  MFC after:1 week

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

Modified: head/usr.sbin/iovctl/iovctl.c
==
--- head/usr.sbin/iovctl/iovctl.c   Tue Sep 12 21:08:50 2017
(r323505)
+++ head/usr.sbin/iovctl/iovctl.c   Tue Sep 12 21:12:04 2017
(r323506)
@@ -230,15 +230,19 @@ main(int argc, char **argv)
usage();
}
 
-   if (device == NULL && filename == NULL) {
+   if (device == NULL && filename == NULL  && action != CONFIG) {
warnx("Either the -d or -f flag must be specified");
usage();
}
 
switch (action) {
case CONFIG:
-   if (filename == NULL) {
+   if (device != NULL) {
warnx("-d flag cannot be used with the -C flag");
+   usage();
+   }
+   if (filename == NULL) {
+   warnx("The -f flag must be specified");
usage();
}
config_action(filename, dryrun);
___
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: r323505 - head/sys/netinet

2017-09-12 Thread Michael Tuexen
Author: tuexen
Date: Tue Sep 12 21:08:50 2017
New Revision: 323505
URL: https://svnweb.freebsd.org/changeset/base/323505

Log:
  Export the UDP encapsualation port and the path state.

Modified:
  head/sys/netinet/sctp_sysctl.c
  head/sys/netinet/sctp_uio.h

Modified: head/sys/netinet/sctp_sysctl.c
==
--- head/sys/netinet/sctp_sysctl.c  Tue Sep 12 21:07:48 2017
(r323504)
+++ head/sys/netinet/sctp_sysctl.c  Tue Sep 12 21:08:50 2017
(r323505)
@@ -506,6 +506,14 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS)
xraddr.rtt = net->rtt / 1000;
xraddr.heartbeat_interval = 
net->heart_beat_delay;
xraddr.ssthresh = net->ssthresh;
+   xraddr.encaps_port = net->port;
+   if (net->dest_state & SCTP_ADDR_UNCONFIRMED) {
+   xraddr.state = SCTP_UNCONFIRMED;
+   } else if (net->dest_state & 
SCTP_ADDR_REACHABLE) {
+   xraddr.state = SCTP_ACTIVE;
+   } else {
+   xraddr.state = SCTP_INACTIVE;
+   }
xraddr.start_time.tv_sec = 
(uint32_t)net->start_time.tv_sec;
xraddr.start_time.tv_usec = 
(uint32_t)net->start_time.tv_usec;
SCTP_INP_RUNLOCK(inp);

Modified: head/sys/netinet/sctp_uio.h
==
--- head/sys/netinet/sctp_uio.h Tue Sep 12 21:07:48 2017(r323504)
+++ head/sys/netinet/sctp_uio.h Tue Sep 12 21:08:50 2017(r323505)
@@ -1239,7 +1239,9 @@ struct xsctp_raddr {
uint32_t rtt;
uint32_t heartbeat_interval;
uint32_t ssthresh;
-   uint32_t extra_padding[30]; /* future */
+   uint16_t encaps_port;
+   uint16_t state;
+   uint32_t extra_padding[29]; /* future */
 };
 
 #define SCTP_MAX_LOGGING_SIZE 3
___
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: r323504 - head/usr.bin/sockstat

2017-09-12 Thread Michael Tuexen
Author: tuexen
Date: Tue Sep 12 21:07:48 2017
New Revision: 323504
URL: https://svnweb.freebsd.org/changeset/base/323504

Log:
  Add printing of the remote encapsulation port for SCTP associations.
  
  Sponsored by: Netflix, Inc.

Modified:
  head/usr.bin/sockstat/sockstat.1
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.1
==
--- head/usr.bin/sockstat/sockstat.1Tue Sep 12 19:36:24 2017
(r323503)
+++ head/usr.bin/sockstat/sockstat.1Tue Sep 12 21:07:48 2017
(r323504)
@@ -35,7 +35,7 @@
 .Nd list open sockets
 .Sh SYNOPSIS
 .Nm
-.Op Fl 46cLlSsu
+.Op Fl 46cLlSsUu
 .Op Fl j Ar jid
 .Op Fl p Ar ports
 .Op Fl P Ar protocols
@@ -89,6 +89,9 @@ This is currently only implemented for TCP.
 .It Fl s
 Display the protocol state, if applicable.
 This is currently only implemented for SCTP and TCP.
+.It Fl U
+Display the remote UDP encapsulation port number, if applicable.
+This is currently only implemented for SCTP.
 .It Fl u
 Show
 .Dv AF_LOCAL
@@ -146,6 +149,10 @@ if the endpoint could not be determined.
 (Internet sockets only)
 The address the foreign end of the socket is bound to (see
 .Xr getpeername 2 ) .
+.It Li ENCAPS
+The remote UDP encapsulation port number if
+.Fl U
+is specified (only for SCTP).
 .It Li STATE
 The protocol state if
 .Fl s

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cTue Sep 12 19:36:24 2017
(r323503)
+++ head/usr.bin/sockstat/sockstat.cTue Sep 12 21:07:48 2017
(r323504)
@@ -75,6 +75,7 @@ static int opt_L; /* Don't show IPv4 or IPv6 
loopbac
 static int  opt_l; /* Show listening sockets */
 static int  opt_S; /* Show protocol stack if applicable */
 static int  opt_s; /* Show protocol state if applicable */
+static int  opt_U; /* Show remote UDP encapsulation port number */
 static int  opt_u; /* Show Unix domain sockets */
 static int  opt_v; /* Verbose mode */
 
@@ -95,6 +96,7 @@ static int*ports;
 
 struct addr {
struct sockaddr_storage address;
+   unsigned int encaps_port;
struct addr *next;
 };
 
@@ -531,6 +533,7 @@ gather_sctp(void)
"address family %d not supported",
xraddr->address.sa.sa_family);
}
+   faddr->encaps_port = xraddr->encaps_port; 
faddr->next = NULL;
if (prev_faddr == NULL)
sock->faddr = faddr;
@@ -979,7 +982,7 @@ static void
 displaysock(struct sock *s, int pos)
 {
void *p;
-   int hash, first;
+   int hash, first, offset;
struct addr *laddr, *faddr;
struct sock *s_tmp;
 
@@ -1045,34 +1048,46 @@ displaysock(struct sock *s, int pos)
default:
abort();
}
-   if (first) {
-   if (opt_s &&
-   (s->proto == IPPROTO_SCTP ||
-s->proto == IPPROTO_TCP)) {
-   while (pos < 80)
+   offset = 80;
+   if (opt_U) {
+   if (faddr != NULL &&
+   s->proto == IPPROTO_SCTP &&
+   s->state != SCTP_CLOSED &&
+   s->state != SCTP_BOUND &&
+   s->state != SCTP_LISTEN) {
+   while (pos < offset)
pos += xprintf(" ");
-   switch (s->proto) {
-   case IPPROTO_SCTP:
-   pos += xprintf("%s",
-   sctp_state(s->state));
-   break;
-   case IPPROTO_TCP:
-   if (s->state >= 0 &&
-   s->state < TCP_NSTATES)
-   pos +=
-   xprintf("%s",
-   tcpstates[s->state]);
-   else
-   pos += xprintf("?");
-   break;
+   pos += xprintf("%u",
+   ntohs(faddr->encaps_port));
+   }
+   offset += 7;
+   }
+   if (first) {
+   if (opt_s) {
+   if (s->proto == IPPROTO_SCTP ||
+   

svn commit: r323503 - in head: . sys/cam/ctl

2017-09-12 Thread Alan Somers
Author: asomers
Date: Tue Sep 12 19:36:24 2017
New Revision: 323503
URL: https://svnweb.freebsd.org/changeset/base/323503

Log:
  Remove spaces from CTL devices' default serial numbers
  
  It's awkward to have spaces in CAM device serial numbers. That leads to
  such things as device nodes named "/dev/diskid/MYSERIAL%20%20%201". Better
  to replace the spaces with "0"s. This change only affects the default
  serial numbers for users who don't provide their own.
  
  Reviewed by:  ken, mav
  MFC after:Never
  Relnotes: Yes
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D12263

Modified:
  head/UPDATING
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c

Modified: head/UPDATING
==
--- head/UPDATING   Tue Sep 12 19:20:24 2017(r323502)
+++ head/UPDATING   Tue Sep 12 19:36:24 2017(r323503)
@@ -52,6 +52,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 ** SPECIAL WARNING: **
 
 20170912:
+   The default serial number format for CTL LUNs has changed.  This will
+   affect users who use /dev/diskid/* device nodes, or whose FibreChannel
+   or iSCSI clients care about their LUNs' serial numbers.  Users who
+   require serial number stability should hardcode serial numbers in
+   /etc/ctl.conf .
+
+20170912:
For 32-bit arm compiled for hard-float support, soft-floating point
binaries now always get their shared libraries from
LD_SOFT_LIBRARY_PATH (in the past, this was only used if

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cTue Sep 12 19:20:24 2017
(r323502)
+++ head/sys/cam/ctl/ctl_backend_block.cTue Sep 12 19:36:24 2017
(r323503)
@@ -2324,7 +2324,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, 
cbe_lun->be = _be_block_driver;
 
if ((params->flags & CTL_LUN_FLAG_SERIAL_NUM) == 0) {
-   snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%4d",
+   snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%04d",
 softc->num_luns);
strncpy((char *)cbe_lun->serial_num, tmpstr,
MIN(sizeof(cbe_lun->serial_num), sizeof(tmpstr)));
@@ -2338,7 +2338,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, 
sizeof(params->serial_num)));
}
if ((params->flags & CTL_LUN_FLAG_DEVID) == 0) {
-   snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%4d", softc->num_luns);
+   snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%04d", 
softc->num_luns);
strncpy((char *)cbe_lun->device_id, tmpstr,
MIN(sizeof(cbe_lun->device_id), sizeof(tmpstr)));
 

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==
--- head/sys/cam/ctl/ctl_backend_ramdisk.c  Tue Sep 12 19:20:24 2017
(r323502)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c  Tue Sep 12 19:36:24 2017
(r323503)
@@ -1096,7 +1096,7 @@ ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc
cbe_lun->lun_config_status = ctl_backend_ramdisk_lun_config_status;
cbe_lun->be = _be_ramdisk_driver;
if ((params->flags & CTL_LUN_FLAG_SERIAL_NUM) == 0) {
-   snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%4d",
+   snprintf(tmpstr, sizeof(tmpstr), "MYSERIAL%04d",
 softc->num_luns);
strncpy((char *)cbe_lun->serial_num, tmpstr,
MIN(sizeof(cbe_lun->serial_num), sizeof(tmpstr)));
@@ -1110,7 +1110,7 @@ ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc
sizeof(params->serial_num)));
}
if ((params->flags & CTL_LUN_FLAG_DEVID) == 0) {
-   snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%4d", softc->num_luns);
+   snprintf(tmpstr, sizeof(tmpstr), "MYDEVID%04d", 
softc->num_luns);
strncpy((char *)cbe_lun->device_id, tmpstr,
MIN(sizeof(cbe_lun->device_id), sizeof(tmpstr)));
 
___
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: r323502 - head/share/misc

2017-09-12 Thread Adriaan de Groot
Author: adridg (ports committer)
Date: Tue Sep 12 19:20:24 2017
New Revision: 323502
URL: https://svnweb.freebsd.org/changeset/base/323502

Log:
  Add self to mentor-mentee data, procedure 1.5.
  
  Approved by: tcberner (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Sep 12 17:46:30 2017
(r323501)
+++ head/share/misc/committers-ports.dotTue Sep 12 19:20:24 2017
(r323502)
@@ -43,6 +43,7 @@ node [color=lightblue2, style=filled, bgcolor=black];
 ache [label="Andrey Chernov\na...@freebsd.org\n1994/11/15"]
 acm [label="Jose Alonso Cardenas Marquez\n...@freebsd.org\n2006/07/18"]
 adamw [label="Adam Weinberger\nad...@freebsd.org\n2002/10/16"]
+adridg [label="Adriaan de Groot\nadr...@freebsd.org\n2017/09/08"]
 ahze [label="Michael Johnson\na...@freebsd.org\n2004/10/29"]
 ak [label="Alex Kozlov\n...@freebsd.org\n2012/02/29"]
 ale [label="Alex Dupre\n...@freebsd.org\n2004/01/12"]
@@ -575,6 +576,7 @@ pi -> tz
 
 rafan -> chinsan
 
+rakuco -> adridg
 rakuco -> alonso
 rakuco -> tcberner
 
@@ -641,6 +643,8 @@ tabthorpe -> pgj
 tabthorpe -> rene
 tabthorpe -> zi
 tabthorpe -> gblach
+
+tcberner -> adridg
 
 thierry -> jadawin
 thierry -> riggs
___
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: r323501 - in head: libexec/rtld-elf libexec/rtld-elf/mips sys/sys

2017-09-12 Thread John Baldwin
Author: jhb
Date: Tue Sep 12 17:46:30 2017
New Revision: 323501
URL: https://svnweb.freebsd.org/changeset/base/323501

Log:
  Handle relocations for newer non-PIC MIPS ABI.
  
  Newer binutils supports extensions to the MIPS ABI for non-PIC code
  that is used when compiling O32 binaries with clang 5 (but not used
  for N64 oddly enough).  These extensions require support for
  R_MIPS_COPY relocations as well as a second PLT GOT using
  R_MIPS_JUMP_SLOT relocations.
  
  For R_MIPS_COPY, use the same approach as on other architectures where
  fixups are deferred to the MD do_copy_relocations.
  
  The additional PLT GOT for jump slots is located in a .got.plt section
  which is identified by a DT_MIPS_PLTGOT dynamic entry.  This GOT also
  requires fixups for the first two GOT entries just as the normal GOT.
  However, the entry point for this second GOT uses a different calling
  convention. Rather than passing an offset into the GOT, it passes an
  offset into the .rel.plt section.  This requires a second entry point
  (_rtld_pltbind_start) which calls the normal _rtld_bind() rather than
  _mips_rtld_bind().  This also means providing a real version of
  reloc_jmpslot() which is used by _rtld_bind().
  
  In addition, add real implementions of reloc_plt() and
  reloc_jmpslots() which walk .rel.plt handling R_MIPS_JUMP_SLOT
  relocations.
  
  Reviewed by:  kib
  Sponsored by: DARPA / AFRL
  Differential Revision:https://reviews.freebsd.org/D12326

Modified:
  head/libexec/rtld-elf/mips/reloc.c
  head/libexec/rtld-elf/mips/rtld_start.S
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h
  head/sys/sys/elf_common.h

Modified: head/libexec/rtld-elf/mips/reloc.c
==
--- head/libexec/rtld-elf/mips/reloc.c  Tue Sep 12 17:06:35 2017
(r323500)
+++ head/libexec/rtld-elf/mips/reloc.c  Tue Sep 12 17:46:30 2017
(r323501)
@@ -67,21 +67,98 @@ __FBSDID("$FreeBSD$");
 #define GOT1_RESERVED_FOR_RTLD(got)((got)[1] & GOT1_MASK)
 #endif
 
+#ifdef __mips_n64
+/*
+ * ELF64 MIPS encodes the relocs uniquely.  The first 32-bits of info contain
+ * the symbol index.  The top 32-bits contain three relocation types encoded
+ * in big-endian integer with first relocation in LSB.  This means for little
+ * endian we have to byte swap that integer (r_type).
+ */
+#defineElf_Sxword  Elf64_Sxword
+#defineELF_R_NXTTYPE_64_P(r_type)  r_type) >> 8) & 0xff) == 
R_TYPE(64))
+#if BYTE_ORDER == LITTLE_ENDIAN
+#undef ELF_R_SYM
+#undef ELF_R_TYPE
+#define ELF_R_SYM(r_info)  ((r_info) & 0x)
+#define ELF_R_TYPE(r_info) bswap32((r_info) >> 32)
+#endif
+#else
+#defineELF_R_NXTTYPE_64_P(r_type)  (0)
+#defineElf_Sxword  Elf32_Sword
+#endif
+
+void _rtld_pltbind_start(void);
+
 void
 init_pltgot(Obj_Entry *obj)
 {
+
if (obj->pltgot != NULL) {
obj->pltgot[0] = (Elf_Addr) &_rtld_bind_start;
if (GOT1_RESERVED_FOR_RTLD(obj->pltgot))
obj->pltgot[1] = (Elf_Addr) obj | GOT1_MASK;
}
+   if (obj->mips_pltgot != NULL) {
+   obj->mips_pltgot[0] = (Elf_Addr) &_rtld_pltbind_start;
+   obj->mips_pltgot[1] = (Elf_Addr) obj;
+   }
 }
 
 int
 do_copy_relocations(Obj_Entry *dstobj)
 {
-   /* Do nothing */
-   return 0;
+   const Obj_Entry *srcobj, *defobj;
+   const Elf_Rel *rellim;
+   const Elf_Rel *rel;
+   const Elf_Sym *srcsym;
+   const Elf_Sym *dstsym;
+   const void *srcaddr;
+   const char *name;
+   void *dstaddr;
+   SymLook req;
+   size_t size;
+   int res;
+
+   /*
+* COPY relocs are invalid outside of the main program
+*/
+   assert(dstobj->mainprog);
+
+   rellim = (const Elf_Rel *)((caddr_t)dstobj->rel + dstobj->relsize);
+   for (rel = dstobj->rel; rel < rellim; rel++) {
+   if (ELF_R_TYPE(rel->r_info) != R_MIPS_COPY)
+   continue;
+
+   dstaddr = (void *)(dstobj->relocbase + rel->r_offset);
+   dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info);
+   name = dstobj->strtab + dstsym->st_name;
+   size = dstsym->st_size;
+
+   symlook_init(, name);
+   req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rel->r_info));
+   req.flags = SYMLOOK_EARLY;
+
+   for (srcobj = globallist_next(dstobj); srcobj != NULL;
+srcobj = globallist_next(srcobj)) {
+   res = symlook_obj(, srcobj);
+   if (res == 0) {
+   srcsym = req.sym_out;
+   defobj = req.defobj_out;
+   break;
+   }
+   }
+   if (srcobj == NULL) {
+   _rtld_error(

svn commit: r323500 - in head: . libexec/rtld-elf/arm

2017-09-12 Thread Warner Losh
Author: imp
Date: Tue Sep 12 17:06:35 2017
New Revision: 323500
URL: https://svnweb.freebsd.org/changeset/base/323500

Log:
  End softfp->hardfp transition period for arm
  
  On hard-float 32-bit arm platforms, always search for the soft float
  binaries in the alternative locations.
  
  Sponsored by: Netflix
  Differential Review: https://reviews.freebsd.org/D12274
  MFC After: 1 week

Modified:
  head/UPDATING
  head/libexec/rtld-elf/arm/reloc.c
  head/libexec/rtld-elf/arm/rtld_machdep.h

Modified: head/UPDATING
==
--- head/UPDATING   Tue Sep 12 16:00:51 2017(r323499)
+++ head/UPDATING   Tue Sep 12 17:06:35 2017(r323500)
@@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ** SPECIAL WARNING: **
 
+20170912:
+   For 32-bit arm compiled for hard-float support, soft-floating point
+   binaries now always get their shared libraries from
+   LD_SOFT_LIBRARY_PATH (in the past, this was only used if
+   /usr/libsoft also existed). Only users with a hard-float ld.so, but
+   soft-float everything else should be affected.
+
 20170826:
During boot the geli passphrase will be hidden. To restore previous
behavior see geli(8) configuration options.

Modified: head/libexec/rtld-elf/arm/reloc.c
==
--- head/libexec/rtld-elf/arm/reloc.c   Tue Sep 12 16:00:51 2017
(r323499)
+++ head/libexec/rtld-elf/arm/reloc.c   Tue Sep 12 17:06:35 2017
(r323500)
@@ -18,11 +18,18 @@ __FBSDID("$FreeBSD$");
 #include "rtld.h"
 #include "paths.h"
 
+#ifdef __ARM_FP
+/*
+ * On processors that have hard floating point supported, we also support
+ * running soft float binaries. If we're being built with hard float support,
+ * check the ELF headers to make sure that this is a hard float binary. If it 
is
+ * a soft float binary, force the dynamic linker to use the alternative soft
+ * float path.
+ */
 void
 arm_abi_variant_hook(Elf_Auxinfo **aux_info)
 {
Elf_Word ehdr;
-   struct stat sb;
 
/*
 * If we're running an old kernel that doesn't provide any data fail
@@ -40,17 +47,6 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
return;
 
/*
-* If there's no /usr/libsoft, then we don't have a system with both
-* hard and soft float. In that case, hope for the best and just
-* return. Such systems are required to have all soft or all hard
-* float ABI binaries and libraries. This is, at best, a transition
-* compatibility hack. Once we're fully hard-float, this should
-* be removed.
-*/
-   if (stat("/usr/libsoft", ) != 0 || !S_ISDIR(sb.st_mode))
-   return;
-
-   /*
 * This is a soft float ABI binary. We need to use the soft float
 * settings.
 */
@@ -60,6 +56,7 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
ld_standard_library_path = SOFT_STANDARD_LIBRARY_PATH;
ld_env_prefix = LD_SOFT_;
 }
+#endif
 
 void
 init_pltgot(Obj_Entry *obj)

Modified: head/libexec/rtld-elf/arm/rtld_machdep.h
==
--- head/libexec/rtld-elf/arm/rtld_machdep.hTue Sep 12 16:00:51 2017
(r323499)
+++ head/libexec/rtld-elf/arm/rtld_machdep.hTue Sep 12 17:06:35 2017
(r323500)
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 struct Struct_Obj_Entry;
 
@@ -74,7 +75,11 @@ extern void *__tls_get_addr(tls_index *ti);
 
 extern void arm_abi_variant_hook(Elf_Auxinfo **);
 
+#ifdef __ARM_FP
 #define md_abi_variant_hook(x) arm_abi_variant_hook(x)
 #define RTLD_VARIANT_ENV_NAMES
+#else
+#define md_abi_variant_hook(x)
+#endif
 
 #endif
___
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: r323499 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs

2017-09-12 Thread Li-Wen Hsu
Author: lwhsu (ports committer)
Date: Tue Sep 12 16:00:51 2017
New Revision: 323499
URL: https://svnweb.freebsd.org/changeset/base/323499

Log:
  Fix DTrace test tst_inet_ntop_d: remove definitions are already in libdtrace
  
  We have D definitions for the named values in socket.h after r323253.  Remove
  them in test script to prevent compiling failure.
  
  Reviewed by:  markj, gnn
  Differential Revision:https://reviews.freebsd.org/D12334

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
==
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d  
Tue Sep 12 14:38:10 2017(r323498)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d  
Tue Sep 12 16:00:51 2017(r323499)
@@ -28,9 +28,6 @@
 
 #pragma D option quiet
 
-inline int AF_INET = 2;
-inline int AF_INET6 = 28;
-
 in_addr_t *ip4a;
 in_addr_t *ip4b;
 in_addr_t *ip4c;
___
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: r323498 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2017-09-12 Thread Mark Johnston
Author: markj
Date: Tue Sep 12 14:38:10 2017
New Revision: 323498
URL: https://svnweb.freebsd.org/changeset/base/323498

Log:
  Add a O_CLOEXEC use missed in r323166.
  
  PR:   199810
  Reported by:  Jukka A. Ukkonen 
  MFC after:3 days

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cTue Sep 
12 14:18:45 2017(r323497)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cTue Sep 
12 14:38:10 2017(r323498)
@@ -1109,7 +1109,7 @@ dt_vopen(int version, int flags, int *errp,
 */
if (err == ENOENT && modfind("dtraceall") < 0) {
kldload("dtraceall"); /* ignore the error */
-   dtfd = open("/dev/dtrace/dtrace", O_RDWR);
+   dtfd = open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC);
err = errno;
}
 #endif
___
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: r323497 - head/sys/boot/efi/libefi

2017-09-12 Thread Toomas Soome
Author: tsoome
Date: Tue Sep 12 14:18:45 2017
New Revision: 323497
URL: https://svnweb.freebsd.org/changeset/base/323497

Log:
  libefi: efipart_open should check the status from disk_open
  
  In case of error from disk_open(), we should clean up properly.
  
  Reviewed by:  allanjude, imp
  Differential Revision:https://reviews.freebsd.org/D12340

Modified:
  head/sys/boot/efi/libefi/efipart.c

Modified: head/sys/boot/efi/libefi/efipart.c
==
--- head/sys/boot/efi/libefi/efipart.c  Tue Sep 12 13:51:18 2017
(r323496)
+++ head/sys/boot/efi/libefi/efipart.c  Tue Sep 12 14:18:45 2017
(r323497)
@@ -723,9 +723,20 @@ efipart_open(struct open_file *f, ...)
pd->pd_bcache = bcache_allocate();
 
if (dev->d_dev->dv_type == DEVT_DISK) {
-   return (disk_open(dev,
+   int rc;
+
+   rc = disk_open(dev,
blkio->Media->BlockSize * (blkio->Media->LastBlock + 1),
-   blkio->Media->BlockSize));
+   blkio->Media->BlockSize);
+   if (rc != 0) {
+   pd->pd_open--;
+   if (pd->pd_open == 0) {
+   pd->pd_blkio = NULL;
+   bcache_free(pd->pd_bcache);
+   pd->pd_bcache = NULL;
+   }
+   }
+   return (rc);
}
return (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: r323496 - head/lib/libstand

2017-09-12 Thread Toomas Soome
Author: tsoome
Date: Tue Sep 12 13:51:18 2017
New Revision: 323496
URL: https://svnweb.freebsd.org/changeset/base/323496

Log:
  libstand: tftp_open() can leak pkt on error
  
  The memory can be leaked if we will have pkt set and will get an error
  during tftp_open() processing.
  
  Differential Revision:https://reviews.freebsd.org/D12202

Modified:
  head/lib/libstand/tftp.c

Modified: head/lib/libstand/tftp.c
==
--- head/lib/libstand/tftp.cTue Sep 12 13:47:54 2017(r323495)
+++ head/lib/libstand/tftp.cTue Sep 12 13:51:18 2017(r323496)
@@ -467,6 +467,7 @@ tftp_open(const char *path, struct open_file *f)
 
if (res) {
free(tftpfile->path);
+   free(tftpfile->pkt);
free(tftpfile);
return (res);
}
___
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: r323494 - in head/sys: boot/zfs cddl/boot/zfs

2017-09-12 Thread Toomas Soome
Author: tsoome
Date: Tue Sep 12 13:45:04 2017
New Revision: 323494
URL: https://svnweb.freebsd.org/changeset/base/323494

Log:
  loader should support large_dnode
  
  The zfsonlinux feature large_dnode is not yet supported by the loader.
  
  Reviewed by:  avg, allanjude
  Differential Revision:https://reviews.freebsd.org/D12288

Modified:
  head/sys/boot/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfsimpl.h

Modified: head/sys/boot/zfs/zfsimpl.c
==
--- head/sys/boot/zfs/zfsimpl.c Tue Sep 12 13:39:44 2017(r323493)
+++ head/sys/boot/zfs/zfsimpl.c Tue Sep 12 13:45:04 2017(r323494)
@@ -60,6 +60,7 @@ static const char *features_for_read[] = {
"org.open-zfs:large_blocks",
"org.illumos:sha512",
"org.illumos:skein",
+   "org.zfsonlinux:large_dnode",
NULL
 };
 
@@ -420,7 +421,7 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void 
psize = size;
}
 
-   /*printf("ZFS: reading %d bytes at 0x%jx to %p\n", psize, 
(uintmax_t)offset, buf);*/
+   /*printf("ZFS: reading %zu bytes at 0x%jx to %p\n", psize, 
(uintmax_t)offset, buf);*/
rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize);
if (rc)
return (rc);
@@ -2280,7 +2281,7 @@ zfs_dnode_stat(const spa_t *spa, dnode_phys_t *dn, str
sahdrp = (sa_hdr_phys_t *)DN_BONUS(dn);
else {
if ((dn->dn_flags & DNODE_FLAG_SPILL_BLKPTR) != 0) {
-   blkptr_t *bp = >dn_spill;
+   blkptr_t *bp = DN_SPILL_BLKPTR(dn);
int error;
 
size = BP_GET_LSIZE(bp);
@@ -2330,7 +2331,7 @@ zfs_dnode_readlink(const spa_t *spa, dnode_phys_t *dn,
 
if ((dn->dn_flags & DNODE_FLAG_SPILL_BLKPTR) == 0)
return (EIO);
-   bp = >dn_spill;
+   bp = DN_SPILL_BLKPTR(dn);
 
size = BP_GET_LSIZE(bp);
buf = zfs_alloc(size);

Modified: head/sys/cddl/boot/zfs/zfsimpl.h
==
--- head/sys/cddl/boot/zfs/zfsimpl.hTue Sep 12 13:39:44 2017
(r323493)
+++ head/sys/cddl/boot/zfs/zfsimpl.hTue Sep 12 13:45:04 2017
(r323494)
@@ -859,10 +859,19 @@ struct uberblock {
 /*
  * Derived constants.
  */
-#defineDNODE_SIZE  (1 << DNODE_SHIFT)
-#defineDN_MAX_NBLKPTR  ((DNODE_SIZE - DNODE_CORE_SIZE) >> 
SPA_BLKPTRSHIFT)
-#defineDN_MAX_BONUSLEN (DNODE_SIZE - DNODE_CORE_SIZE - (1 << 
SPA_BLKPTRSHIFT))
-#defineDN_MAX_OBJECT   (1ULL << DN_MAX_OBJECT_SHIFT)
+#defineDNODE_MIN_SIZE  (1 << DNODE_SHIFT)
+#defineDNODE_MAX_SIZE  (1 << DNODE_BLOCK_SHIFT)
+#defineDNODE_BLOCK_SIZE(1 << DNODE_BLOCK_SHIFT)
+#defineDNODE_MIN_SLOTS (DNODE_MIN_SIZE >> DNODE_SHIFT)
+#defineDNODE_MAX_SLOTS (DNODE_MAX_SIZE >> DNODE_SHIFT)
+#defineDN_BONUS_SIZE(dnsize)   ((dnsize) - DNODE_CORE_SIZE - \
+   (1 << SPA_BLKPTRSHIFT))
+#defineDN_SLOTS_TO_BONUSLEN(slots) DN_BONUS_SIZE((slots) << 
DNODE_SHIFT)
+#defineDN_OLD_MAX_BONUSLEN (DN_BONUS_SIZE(DNODE_MIN_SIZE))
+#defineDN_MAX_NBLKPTR  ((DNODE_MIN_SIZE - DNODE_CORE_SIZE) >> \
+   SPA_BLKPTRSHIFT)
+#defineDN_MAX_OBJECT   (1ULL << DN_MAX_OBJECT_SHIFT)
+#defineDN_ZERO_BONUSLEN(DN_BONUS_SIZE(DNODE_MAX_SIZE) + 1)
 
 #defineDNODES_PER_BLOCK_SHIFT  (DNODE_BLOCK_SHIFT - DNODE_SHIFT)
 #defineDNODES_PER_BLOCK(1ULL << DNODES_PER_BLOCK_SHIFT)
@@ -898,7 +907,8 @@ typedef struct dnode_phys {
uint8_t dn_flags;   /* DNODE_FLAG_* */
uint16_t dn_datablkszsec;   /* data block size in 512b sectors */
uint16_t dn_bonuslen;   /* length of dn_bonus */
-   uint8_t dn_pad2[4];
+   uint8_t dn_extra_slots; /* # of subsequent slots consumed */
+   uint8_t dn_pad2[3];
 
/* accounting is protected by dn_dirty_mtx */
uint64_t dn_maxblkid;   /* largest allocated block ID */
@@ -906,10 +916,39 @@ typedef struct dnode_phys {
 
uint64_t dn_pad3[4];
 
-   blkptr_t dn_blkptr[1];
-   uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)];
-   blkptr_t dn_spill;
+   /*
+* The tail region is 448 bytes for a 512 byte dnode, and
+* correspondingly larger for larger dnode sizes. The spill
+* block pointer, when present, is always at the end of the tail
+* region. There are three ways this space may be used, using
+* a 512 byte dnode for this diagram:
+*
+* 0   64  128 192 256 320 384 448 (offset)
+* 

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

2017-09-12 Thread Michael Tuexen
Author: tuexen
Date: Tue Sep 12 13:39:44 2017
New Revision: 323493
URL: https://svnweb.freebsd.org/changeset/base/323493

Log:
  Allow TCP connections to be filtered by stack and state.
  
  Choose the command line options to be consistent with the ones of
  sockstat.
  
  Sponsored by: Netflix, Inc.

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

Modified: head/usr.sbin/tcpdrop/tcpdrop.8
==
--- head/usr.sbin/tcpdrop/tcpdrop.8 Tue Sep 12 13:34:43 2017
(r323492)
+++ head/usr.sbin/tcpdrop/tcpdrop.8 Tue Sep 12 13:39:44 2017
(r323493)
@@ -17,7 +17,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 30, 2013
+.Dd September 12, 2017
 .Dt TCPDROP 8
 .Os
 .Sh NAME
@@ -32,6 +32,16 @@
 .Nm tcpdrop
 .Op Fl l
 .Fl a
+.Nm tcpdrop
+.Op Fl l
+.Fl S Ar stack
+.Nm tcpdrop
+.Op Fl l
+.Fl s Ar state
+.Nm tcpdrop
+.Op Fl l
+.Fl S Ar stack
+.Fl s Ar state
 .Sh DESCRIPTION
 The
 .Nm
@@ -41,15 +51,49 @@ If
 .Fl a
 is specified then
 .Nm
-will attempt to drop all active connections.
+will attempt to drop all TCP connections.
+.Pp
+If
+.Fl S Ar stack
+is specified then
+.Nm
+will attempt to drop all connections using the TCP stack
+.Ar stack .
+.Pp
+If
+.Fl s Ar state
+is specified then
+.Nm
+will attempt to drop all TCP connections being in the state
+.Ar state .
+.Ar state
+is one of
+.Dv SYN_SENT ,
+.Dv SYN_RCVD ,
+.Dv ESTABLISHED ,
+.Dv CLOSE_WAIT ,
+.Dv FIN_WAIT_1 ,
+.Dv CLOSING ,
+.Dv LAST_ACK ,
+.Dv FIN_WAIT_2 , or
+.Dv TIME_WAIT .
+.Pp
 The
 .Fl l
-flag may be given to list the tcpdrop invocation to drop all active
+flag may be given in addition to the
+.Fl a ,
+.Fl S ,
+or
+.Fl s
+options to list the tcpdrop invocation to drop all corresponding TCP
 connections one at a time.
 .Pp
-If
-.Fl a
-is not specified then only the connection between the given local
+If none of the
+.Fl a ,
+.Fl S ,
+or
+.Fl s
+options are specified then only the connection between the given local
 address
 .Ar local-address ,
 port
@@ -88,6 +132,23 @@ port 22, the port used by
 .Xr sshd 8 :
 .Bd -literal -offset indent
 # tcpdrop -l -a | grep -vw 22 | sh
+.Ed
+.Pp
+The following command will drop all connections using the TCP stack
+fastack:
+.Bd -literal -offset indent
+# tcpdrop -S fastack
+.Ed
+.Pp
+To drop all TCP connections in the LAST_ACK state use:
+.Bd -literal -offset indent
+# tcpdrop -s LAST_ACK
+.Ed
+.Pp
+To drop all TCP connections using the TCP stack fastack and being in the
+LAST_ACK state use:
+.Bd -literal -offset indent
+# tcpdrop -S fastack -s LAST_ACK
 .Ed
 .Sh SEE ALSO
 .Xr netstat 1 ,

Modified: head/usr.sbin/tcpdrop/tcpdrop.c
==
--- head/usr.sbin/tcpdrop/tcpdrop.c Tue Sep 12 13:34:43 2017
(r323492)
+++ head/usr.sbin/tcpdrop/tcpdrop.c Tue Sep 12 13:39:44 2017
(r323493)
@@ -54,7 +54,7 @@ static char *findport(const char *);
 static struct xinpgen *getxpcblist(const char *);
 static void sockinfo(const struct sockaddr *, struct host_service *);
 static bool tcpdrop(const struct sockaddr *, const struct sockaddr *);
-static bool tcpdropall(void);
+static bool tcpdropall(const char *, int);
 static bool tcpdropbyname(const char *, const char *, const char *,
 const char *);
 static bool tcpdropconn(const struct in_conninfo *);
@@ -66,13 +66,17 @@ static void usage(void);
 int
 main(int argc, char *argv[])
 {
+   char stack[TCP_FUNCTION_NAME_LEN_MAX];
char *lport, *fport;
-   bool dropall;
-   int ch;
+   bool dropall, dropallstack;
+   int ch, state;
 
dropall = false;
+   dropallstack = false;
+   memset(stack, 0, TCP_FUNCTION_NAME_LEN_MAX);
+   state = -1;
 
-   while ((ch = getopt(argc, argv, "al")) != -1) {
+   while ((ch = getopt(argc, argv, "alS:s:")) != -1) {
switch (ch) {
case 'a':
dropall = true;
@@ -80,6 +84,17 @@ main(int argc, char *argv[])
case 'l':
tcpdrop_list_commands = true;
break;
+   case 'S':
+   dropallstack = true;
+   strncpy(stack, optarg, TCP_FUNCTION_NAME_LEN_MAX);
+   break;
+   case 's':
+   dropallstack = true;
+   for (state = 0; state < TCP_NSTATES; state++) {
+   if (strcmp(tcpstates[state], optarg) == 0)
+   break;
+   }
+   break;
default:
usage();
}
@@ -87,10 +102,16 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
 
-   if (dropall) {
+   if (state == TCP_NSTATES ||
+   state == TCPS_CLOSED ||
+   state == TCPS_LISTEN)
+   usage();
+   if (dropall 

svn commit: r323492 - in head: sys/netinet usr.bin/sockstat

2017-09-12 Thread Michael Tuexen
Author: tuexen
Date: Tue Sep 12 13:34:43 2017
New Revision: 323492
URL: https://svnweb.freebsd.org/changeset/base/323492

Log:
  Add support to print the TCP stack being used.
  
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/netinet/tcp_var.h
  head/usr.bin/sockstat/sockstat.1
  head/usr.bin/sockstat/sockstat.c

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Tue Sep 12 13:21:14 2017(r323491)
+++ head/sys/netinet/tcp_var.h  Tue Sep 12 13:34:43 2017(r323492)
@@ -655,7 +655,7 @@ struct tcp_hhook_data {
 struct xtcpcb {
size_t  xt_len; /* length of this structure */
struct xinpcb   xt_inp;
-   charxt_stack[TCP_FUNCTION_NAME_LEN_MAX];/* (n) */
+   charxt_stack[TCP_FUNCTION_NAME_LEN_MAX];/* (s) */
int64_t spare64[8];
int32_t t_state;/* (s,p) */
uint32_tt_flags;/* (s,p) */

Modified: head/usr.bin/sockstat/sockstat.1
==
--- head/usr.bin/sockstat/sockstat.1Tue Sep 12 13:21:14 2017
(r323491)
+++ head/usr.bin/sockstat/sockstat.1Tue Sep 12 13:34:43 2017
(r323492)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 27, 2015
+.Dd September 12, 2017
 .Dt SOCKSTAT 1
 .Os
 .Sh NAME
@@ -35,7 +35,7 @@
 .Nd list open sockets
 .Sh SYNOPSIS
 .Nm
-.Op Fl 46cLlsu
+.Op Fl 46cLlSsu
 .Op Fl j Ar jid
 .Op Fl p Ar ports
 .Op Fl P Ar protocols
@@ -83,6 +83,9 @@ The
 argument is a comma-separated list of protocol names,
 as they are defined in
 .Xr protocols 5 .
+.It Fl S
+Display the protocol stack, if applicable.
+This is currently only implemented for TCP.
 .It Fl s
 Display the protocol state, if applicable.
 This is currently only implemented for SCTP and TCP.
@@ -143,6 +146,14 @@ if the endpoint could not be determined.
 (Internet sockets only)
 The address the foreign end of the socket is bound to (see
 .Xr getpeername 2 ) .
+.It Li STATE
+The protocol state if
+.Fl s
+is specified (only for SCTP or TCP).
+.It Li STACK
+The protocol stack if
+.Fl S
+is specified (only for TCP).
 .El
 .Pp
 If a socket is associated with more than one file descriptor,

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cTue Sep 12 13:21:14 2017
(r323491)
+++ head/usr.bin/sockstat/sockstat.cTue Sep 12 13:34:43 2017
(r323492)
@@ -73,6 +73,7 @@ static int opt_c; /* Show connected sockets */
 static int  opt_j; /* Show specified jail */
 static int  opt_L; /* Don't show IPv4 or IPv6 loopback sockets */
 static int  opt_l; /* Show listening sockets */
+static int  opt_S; /* Show protocol stack if applicable */
 static int  opt_s; /* Show protocol state if applicable */
 static int  opt_u; /* Show Unix domain sockets */
 static int  opt_v; /* Verbose mode */
@@ -106,6 +107,7 @@ struct sock {
int proto;
int state;
const char *protoname;
+   char stack[TCP_FUNCTION_NAME_LEN_MAX];
struct addr *laddr;
struct addr *faddr;
struct sock *next;
@@ -698,8 +700,11 @@ gather_inet(int proto)
sock->laddr = laddr;
sock->faddr = faddr;
sock->vflag = xip->inp_vflag;
-   if (proto == IPPROTO_TCP)
+   if (proto == IPPROTO_TCP) {
sock->state = xtp->t_state;
+   memcpy(sock->stack, xtp->xt_stack,
+   TCP_FUNCTION_NAME_LEN_MAX);
+   }
sock->protoname = protoname;
hash = (int)((uintptr_t)sock->socket % HASHSIZE);
sock->next = sockhash[hash];
@@ -1040,22 +1045,37 @@ displaysock(struct sock *s, int pos)
default:
abort();
}
-   if (first && opt_s &&
-   (s->proto == IPPROTO_SCTP || s->proto == IPPROTO_TCP)) {
-   while (pos < 80)
-   pos += xprintf(" ");
-   switch (s->proto) {
-   case IPPROTO_SCTP:
-   pos += xprintf("%s", sctp_state(s->state));
-   break;
-   case IPPROTO_TCP:
-   if (s->state >= 0 && s->state < TCP_NSTATES)
-   pos +=
-   xprintf("%s", tcpstates[s->state]);
-   else
-   pos += xprintf("?");
-   break;
+   if (first) {
+   if (opt_s &&
+ 

svn commit: r323491 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-09-12 Thread Andriy Gapon
Author: avg
Date: Tue Sep 12 13:21:14 2017
New Revision: 323491
URL: https://svnweb.freebsd.org/changeset/base/323491

Log:
  fix a fallout from the ZTOV tightening, r323479
  
  MFC after:13 days
  X-MFC with:   r323479

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c   Tue Sep 
12 10:43:02 2017(r323490)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c   Tue Sep 
12 13:21:14 2017(r323491)
@@ -1602,7 +1602,10 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va
boolean_t   trim = B_FALSE;
boolean_t   inherited = B_FALSE;
 
-   ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__);
+   if ((flag & IS_ROOT_NODE) == 0)
+   ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__);
+   else
+   ASSERT(dzp->z_vnode == NULL);
bzero(acl_ids, sizeof (zfs_acl_ids_t));
acl_ids->z_mode = MAKEIMODE(vap->va_type, vap->va_mode);
 
___
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: r323490 - head/sys/arm/ti

2017-09-12 Thread Olivier Houchard
Author: cognet
Date: Tue Sep 12 10:43:02 2017
New Revision: 323490
URL: https://svnweb.freebsd.org/changeset/base/323490

Log:
  Some devices come with the same name as TI devices, so we can't rely on the
  "probe" method of those drivers to mean we're on e TI SoC. Introduce a new
  function, ti_soc_is_supported(), and use it to be sure we're really a TI
  system.
  
  PR:   50

Modified:
  head/sys/arm/ti/ti_cpuid.c
  head/sys/arm/ti/ti_cpuid.h
  head/sys/arm/ti/ti_scm.c

Modified: head/sys/arm/ti/ti_cpuid.c
==
--- head/sys/arm/ti/ti_cpuid.c  Tue Sep 12 06:34:02 2017(r323489)
+++ head/sys/arm/ti/ti_cpuid.c  Tue Sep 12 10:43:02 2017(r323490)
@@ -272,11 +272,7 @@ am335x_get_revision(void)
 static void
 ti_cpu_ident(void *dummy)
 {
-   phandle_t root;
-
-   root = OF_finddevice("/");
-   if (!ofw_bus_node_is_compatible(root, "ti,omap4") &&
-   !ofw_bus_node_is_compatible(root, "ti,am33xx"))
+   if (!ti_soc_is_supported())
return;
switch(ti_chip()) {
case CHIP_OMAP_4:

Modified: head/sys/arm/ti/ti_cpuid.h
==
--- head/sys/arm/ti/ti_cpuid.h  Tue Sep 12 06:34:02 2017(r323489)
+++ head/sys/arm/ti/ti_cpuid.h  Tue Sep 12 10:43:02 2017(r323490)
@@ -80,4 +80,10 @@ static __inline int ti_chip(void)
 
 uint32_t ti_revision(void);
 
+static __inline bool ti_soc_is_supported(void)
+{
+
+   return (_ti_chip != -1);
+}
+
 #endif  /* _TI_CPUID_H_ */

Modified: head/sys/arm/ti/ti_scm.c
==
--- head/sys/arm/ti/ti_scm.cTue Sep 12 06:34:02 2017(r323489)
+++ head/sys/arm/ti/ti_scm.cTue Sep 12 10:43:02 2017(r323490)
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include "ti_scm.h"
+#include "ti_cpuid.h"
 
 static struct resource_spec ti_scm_res_spec[] = {
{ SYS_RES_MEMORY,   0,  RF_ACTIVE },/* Control memory 
window */
@@ -86,6 +87,10 @@ static struct ti_scm_softc *ti_scm_sc;
 static int
 ti_scm_probe(device_t dev)
 {
+
+   if (!ti_soc_is_supported())
+   return (ENXIO);
+
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
___
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: r323483 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-09-12 Thread Andriy Gapon
Author: avg
Date: Tue Sep 12 06:06:58 2017
New Revision: 323483
URL: https://svnweb.freebsd.org/changeset/base/323483

Log:
  zfsctl_snapdir_lookup should be able to handle an uncovered vnode
  
  The uncovered vnode is possible because there is no guarantee that
  its hold count would go to zero (and it would be inactivated and reclaimed)
  immediately after a covering filesystem is unmounted.
  So, such a vnode should be expected and it is possible to re-use it
  without any trouble.
  
  MFC after:3 weeks
  Sponsored by: Panzura

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cTue Sep 
12 06:05:30 2017(r323482)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cTue Sep 
12 06:06:58 2017(r323483)
@@ -816,6 +816,12 @@ zfsctl_snapshot_vnode_setup(vnode_t *vp, void *arg)
  * Lookup entry point for the 'snapshot' directory.  Try to open the
  * snapshot if it exist, creating the pseudo filesystem vnode as necessary.
  * Perform a mount of the associated dataset on top of the vnode.
+ * There are four possibilities:
+ * - the snapshot node and vnode do not exist
+ * - the snapshot vnode is covered by the mounted snapshot
+ * - the snapshot vnode is not covered yet, the mount operation is in progress
+ * - the snapshot vnode is not covered, because the snapshot has been unmounted
+ * The last two states are transient and should be relatively short-lived.
  */
 int
 zfsctl_snapdir_lookup(ap)
@@ -881,7 +887,7 @@ zfsctl_snapdir_lookup(ap)
 
/*
 * The vnode must be referenced at least by this thread and
-* the mounted snapshot or the thread doing the mounting.
+* the mount point or the thread doing the mounting.
 * There can be more references from concurrent lookups.
 */
KASSERT(vrefcnt(*vpp) > 1, ("found unreferenced mountpoint"));
@@ -893,22 +899,31 @@ zfsctl_snapdir_lookup(ap)
if (err != EJUSTRETURN)
return (err);
 
-#ifdef INVARIANTS
/*
-* If the vnode not covered yet, then the mount operation
-* must be in progress.
+* If the vnode is not covered, then either the mount operation
+* is in progress or the snapshot has already been unmounted
+* but the vnode hasn't been inactivated and reclaimed yet.
+* We can try to re-use the vnode in the latter case.
 */
VI_LOCK(*vpp);
-   KASSERT(((*vpp)->v_iflag & VI_MOUNT) != 0,
-   ("snapshot vnode not covered"));
-   VI_UNLOCK(*vpp);
-#endif
-   vput(*vpp);
+   if (((*vpp)->v_iflag & VI_MOUNT) == 0) {
+   /* Upgrade to exclusive lock in order to:
+* - avoid race conditions
+* - satisfy the contract of mount_snapshot()
+*/
+   err = VOP_LOCK(*vpp, LK_TRYUPGRADE | LK_INTERLOCK);
+   if (err == 0)
+   break;
+   } else {
+   VI_UNLOCK(*vpp);
+   }
 
/*
-* In this situation we can loop on uncontested locks and starve
+* In this state we can loop on uncontested locks and starve
 * the thread doing the lengthy, non-trivial mount operation.
+* So, yield to prevent that from happening.
 */
+   vput(*vpp);
kern_yield(PRI_USER);
}
 
___
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: r323482 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-09-12 Thread Andriy Gapon
Author: avg
Date: Tue Sep 12 06:05:30 2017
New Revision: 323482
URL: https://svnweb.freebsd.org/changeset/base/323482

Log:
  zfs_ctldir: remove obsolete / bogus ARGSUSED lint directives
  
  None of the tagged functions had unused parameters.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cTue Sep 
12 06:04:50 2017(r323481)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cTue Sep 
12 06:05:30 2017(r323482)
@@ -434,7 +434,6 @@ zfsctl_root(zfsvfs_t *zfsvfs, int flags, vnode_t **vpp
 /*
  * Common open routine.  Disallow any write access.
  */
-/* ARGSUSED */
 static int
 zfsctl_common_open(struct vop_open_args *ap)
 {
@@ -459,7 +458,6 @@ zfsctl_common_close(struct vop_close_args *ap)
 /*
  * Common access routine.  Disallow writes.
  */
-/* ARGSUSED */
 static int
 zfsctl_common_access(ap)
struct vop_access_args /* {
@@ -515,7 +513,6 @@ zfsctl_common_getattr(vnode_t *vp, vattr_t *vap)
vap->va_nlink = 2;
 }
 
-/*ARGSUSED*/
 static int
 zfsctl_common_fid(ap)
struct vop_fid_args /* {
@@ -569,7 +566,6 @@ zfsctl_common_print(ap)
 /*
  * Get root directory attributes.
  */
-/* ARGSUSED */
 static int
 zfsctl_root_getattr(ap)
struct vop_getattr_args /* {
@@ -821,7 +817,6 @@ zfsctl_snapshot_vnode_setup(vnode_t *vp, void *arg)
  * snapshot if it exist, creating the pseudo filesystem vnode as necessary.
  * Perform a mount of the associated dataset on top of the vnode.
  */
-/* ARGSUSED */
 int
 zfsctl_snapdir_lookup(ap)
struct vop_lookup_args /* {
@@ -1013,7 +1008,6 @@ zfsctl_snapdir_readdir(ap)
/* NOTREACHED */
 }
 
-/* ARGSUSED */
 static int
 zfsctl_snapdir_getattr(ap)
struct vop_getattr_args /* {
___
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: r323481 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-09-12 Thread Andriy Gapon
Author: avg
Date: Tue Sep 12 06:04:50 2017
New Revision: 323481
URL: https://svnweb.freebsd.org/changeset/base/323481

Log:
  zfsvfs_hold: assert that the busied filesystem can not be unmounted
  
  This is a FreeBSD specific feature.
  
  MFC after:3 weeks
  Sponsored by: Panzura

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 
12 06:04:01 2017(r323480)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 
12 06:04:50 2017(r323481)
@@ -1488,6 +1488,7 @@ zfsvfs_hold(const char *name, void *tag, zfsvfs_t **zf
if (error == 0) {
rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER :
RW_READER, tag);
+#ifdef illumos
if ((*zfvp)->z_unmounted) {
/*
 * XXX we could probably try again, since the unmounting
@@ -1497,6 +1498,13 @@ zfsvfs_hold(const char *name, void *tag, zfsvfs_t **zf
rrm_exit(&(*zfvp)->z_teardown_lock, tag);
return (SET_ERROR(EBUSY));
}
+#else
+   /*
+* vfs_busy() ensures that the filesystem is not and
+* can not be unmounted.
+*/
+   ASSERT(!(*zfvp)->z_unmounted);
+#endif
}
return (error);
 }
___
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: r323480 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-09-12 Thread Andriy Gapon
Author: avg
Date: Tue Sep 12 06:04:01 2017
New Revision: 323480
URL: https://svnweb.freebsd.org/changeset/base/323480

Log:
  zfs_get_vfs: reference a requested filesystem instead of vfs_busy-ing it
  
  The only consumer of zfs_get_vfs, zfs_unmount_snap, does not need
  the filesystem to be busy, it just need a reference that it can pass
  to dounmount.
  
  Also, previously the code was racy as it unbusied the filesystem
  before taking a reference on it.
  
  Now the code should be simpler and safer.
  
  MFC after:2 weeks
  Sponsored by: Panzura

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 
12 06:02:21 2017(r323479)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 
12 06:04:01 2017(r323480)
@@ -3049,13 +3049,11 @@ zfs_get_vfs(const char *resource)
mtx_lock(_mtx);
TAILQ_FOREACH(vfsp, , mnt_list) {
if (strcmp(refstr_value(vfsp->vfs_resource), resource) == 0) {
-   if (vfs_busy(vfsp, MBF_MNTLSTLOCK) != 0)
-   vfsp = NULL;
+   vfs_ref(vfsp);
break;
}
}
-   if (vfsp == NULL)
-   mtx_unlock(_mtx);
+   mtx_unlock(_mtx);
return (vfsp);
 }
 
@@ -3545,7 +3543,9 @@ zfs_unmount_snap(const char *snapname)
 {
vfs_t *vfsp;
zfsvfs_t *zfsvfs;
+#ifdef illumos
int err;
+#endif
 
if (strchr(snapname, '@') == NULL)
return (0);
@@ -3557,23 +3557,19 @@ zfs_unmount_snap(const char *snapname)
zfsvfs = vfsp->vfs_data;
ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os)));
 
-   err = vn_vfswlock(vfsp->vfs_vnodecovered);
 #ifdef illumos
+   err = vn_vfswlock(vfsp->vfs_vnodecovered);
VFS_RELE(vfsp);
-#else
-   vfs_unbusy(vfsp);
-#endif
if (err != 0)
return (SET_ERROR(err));
+#endif
 
/*
 * Always force the unmount for snapshots.
 */
-
 #ifdef illumos
(void) dounmount(vfsp, MS_FORCE, kcred);
 #else
-   vfs_ref(vfsp);
(void) dounmount(vfsp, MS_FORCE, curthread);
 #endif
return (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: r323479 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2017-09-12 Thread Andriy Gapon
Author: avg
Date: Tue Sep 12 06:02:21 2017
New Revision: 323479
URL: https://svnweb.freebsd.org/changeset/base/323479

Log:
  zfs: tighten debug versions of ZTOV and VTOZ
  
  MFC after:2 weeks
  Sponsored by: Panzura

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 
12 04:21:04 2017(r323478)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 
12 06:02:21 2017(r323479)
@@ -227,7 +227,7 @@ ZTOV(znode_t *zp)
 {
vnode_t *vp = zp->z_vnode;
 
-   ASSERT(vp == NULL || vp->v_data == NULL || vp->v_data == zp);
+   ASSERT(vp != NULL && vp->v_data == zp);
return (vp);
 }
 static __inline znode_t *
@@ -235,7 +235,7 @@ VTOZ(vnode_t *vp)
 {
znode_t *zp = (znode_t *)vp->v_data;
 
-   ASSERT(zp == NULL || zp->z_vnode == NULL || zp->z_vnode == vp);
+   ASSERT(zp != NULL && zp->z_vnode == vp);
return (zp);
 }
 #else

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 
12 04:21:04 2017(r323478)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 
12 06:02:21 2017(r323479)
@@ -143,8 +143,7 @@ zfs_znode_cache_destructor(void *buf, void *arg)
znode_t *zp = buf;
 
ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs));
-   ASSERT(ZTOV(zp) == NULL);
-   vn_free(ZTOV(zp));
+   ASSERT3P(zp->z_vnode, ==, NULL);
ASSERT(!list_link_active(>z_link_node));
mutex_destroy(>z_acl_lock);
avl_destroy(>z_range_avl);
___
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"