svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys

2017-10-11 Thread Matt Joras
Author: mjoras
Date: Wed Oct 11 21:53:50 2017
New Revision: 324541
URL: https://svnweb.freebsd.org/changeset/base/324541

Log:
  Add clearing function for unr(9).
  
  Previously before you could call unrhdr_delete you needed to
  individually free every allocated unit. It is useful to be able to tear
  down the unr without having to go through this process, as it is
  significantly faster than freeing the individual units.
  
  Reviewed by:  cem, lidl
  Approved by:  rstone (mentor)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D12591

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/unr.9
  head/sys/kern/subr_unit.c
  head/sys/sys/systm.h

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileWed Oct 11 20:36:22 2017
(r324540)
+++ head/share/man/man9/MakefileWed Oct 11 21:53:50 2017
(r324541)
@@ -414,6 +414,7 @@ MAN=accept_filter.9 \
 MLINKS=unr.9 alloc_unr.9 \
unr.9 alloc_unrl.9 \
unr.9 alloc_unr_specific.9 \
+   unr.9 clear_unrhdr.9 \
unr.9 delete_unrhdr.9 \
unr.9 free_unr.9 \
unr.9 new_unrhdr.9

Modified: head/share/man/man9/unr.9
==
--- head/share/man/man9/unr.9   Wed Oct 11 20:36:22 2017(r324540)
+++ head/share/man/man9/unr.9   Wed Oct 11 21:53:50 2017(r324541)
@@ -24,11 +24,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 5, 2010
+.Dd October 4, 2017
 .Dt UNR 9
 .Os
 .Sh NAME
 .Nm new_unrhdr ,
+.Nm clear_unrhdr ,
 .Nm delete_unrhdr ,
 .Nm alloc_unr ,
 .Nm alloc_unr_specific ,
@@ -39,6 +40,8 @@
 .Ft "struct unrhdr *"
 .Fn new_unrhdr "int low" "int high" "struct mtx *mutex"
 .Ft void
+.Fn clear_unrhdr "struct unrhdr *uh"
+.Ft void
 .Fn delete_unrhdr "struct unrhdr *uh"
 .Ft int
 .Fn alloc_unr "struct unrhdr *uh"
@@ -70,8 +73,16 @@ is not
 .Dv NULL ,
 it is used for locking when allocating and freeing units.
 Otherwise, internal mutex is used.
+.It Fn clear_unrhdr uh
+Clear all units from the specified unit number allocator entity.
+This function resets the entity as if it were just initialized with
+.Fn new_unrhdr .
 .It Fn delete_unrhdr uh
-Destroy specified unit number allocator entity.
+Delete specified unit number allocator entity.
+This function frees the memory associated with the entity, it does not free
+any units.
+To free all units use
+.Fn clear_unrhdr .
 .It Fn alloc_unr uh
 Return a new unit number.
 The lowest free number is always allocated.

Modified: head/sys/kern/subr_unit.c
==
--- head/sys/kern/subr_unit.c   Wed Oct 11 20:36:22 2017(r324540)
+++ head/sys/kern/subr_unit.c   Wed Oct 11 21:53:50 2017(r324541)
@@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh)
Free(uh);
 }
 
+void
+clear_unrhdr(struct unrhdr *uh)
+{
+   struct unr *up, *uq;
+
+   KASSERT(TAILQ_EMPTY(>ppfree),
+   ("unrhdr has postponed item for free"));
+   up = TAILQ_FIRST(>head);
+   while (up != NULL) {
+   uq = TAILQ_NEXT(up, list);
+   if (up->ptr != uh) {
+   Free(up->ptr);
+   }
+   Free(up);
+   up = uq;
+   }
+   TAILQ_INIT(>head);
+   uh->busy = 0;
+   uh->alloc = 0;
+}
+
 static __inline int
 is_bitmap(struct unrhdr *uh, struct unr *up)
 {

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hWed Oct 11 20:36:22 2017(r324540)
+++ head/sys/sys/systm.hWed Oct 11 21:53:50 2017(r324541)
@@ -450,6 +450,7 @@ struct unrhdr;
 struct unrhdr *new_unrhdr(int low, int high, struct mtx *mutex);
 void init_unrhdr(struct unrhdr *uh, int low, int high, struct mtx *mutex);
 void delete_unrhdr(struct unrhdr *uh);
+void clear_unrhdr(struct unrhdr *uh);
 void clean_unrhdr(struct unrhdr *uh);
 void clean_unrhdrl(struct unrhdr *uh);
 int alloc_unr(struct unrhdr *uh);
___
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: r324542 - head/sys/fs/tmpfs

2017-10-11 Thread Matt Joras
Author: mjoras
Date: Wed Oct 11 21:53:53 2017
New Revision: 324542
URL: https://svnweb.freebsd.org/changeset/base/324542

Log:
  When unmounting a tmpfs, do not call free_unr.
  
  tmpfs uses unr(9) to allocate inodes. Previously when unmounting it
  would individually free the units when it freed each vnode. This is
  unnecessary as we can use the newly-added unrhdr_clear function to clear
  out the unr in onde go. This measurably reduces the time to unmount a
  tmpfs with many files.
  
  Reviewed by:  cem, lidl
  Approved by:  rstone (mentor)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D12591

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/fs/tmpfs/tmpfs_vfsops.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Wed Oct 11 21:53:50 2017
(r324541)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Wed Oct 11 21:53:53 2017
(r324542)
@@ -362,7 +362,13 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct
panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type);
}
 
-   free_unr(tmp->tm_ino_unr, node->tn_id);
+   /*
+* If we are unmounting there is no need for going through the overhead
+* of freeing the inodes from the unr individually, so free them all in
+* one go later.
+*/
+   if (!detach)
+   free_unr(tmp->tm_ino_unr, node->tn_id);
uma_zfree(tmp->tm_node_pool, node);
TMPFS_LOCK(tmp);
tmpfs_free_tmp(tmp);

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cWed Oct 11 21:53:50 2017
(r324541)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cWed Oct 11 21:53:53 2017
(r324542)
@@ -317,6 +317,8 @@ tmpfs_unmount(struct mount *mp, int mntflags)
TMPFS_NODE_UNLOCK(node);
}
 
+   clear_unrhdr(tmp->tm_ino_unr);
+
mp->mnt_data = NULL;
tmpfs_free_tmp(tmp);
vfs_write_resume(mp, VR_START_WRITE);
___
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: r324539 - in head/sys/netinet: . tcp_stacks

2017-10-11 Thread Gleb Smirnoff
Author: glebius
Date: Wed Oct 11 20:36:09 2017
New Revision: 324539
URL: https://svnweb.freebsd.org/changeset/base/324539

Log:
  Declare more TCP globals in tcp_var.h, so that alternative TCP stacks
  can use them.  Gather all TCP tunables in tcp_var.h in one place and
  alphabetically sort them, to ease maintainance of the list.
  
  Don't copy and paste declarations in tcp_stacks/fastpath.c.

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_sack.c
  head/sys/netinet/tcp_stacks/fastpath.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cWed Oct 11 20:22:01 2017
(r324538)
+++ head/sys/netinet/tcp_input.cWed Oct 11 20:36:09 2017
(r324539)
@@ -145,7 +145,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFL
 "Delay ACK to try and piggyback it onto a data packet");
 
 VNET_DEFINE(int, drop_synfin) = 0;
-#defineV_drop_synfin   VNET(drop_synfin)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(drop_synfin), 0,
 "Drop TCP packets with SYN+FIN set");
@@ -156,7 +155,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc6675_pipe, CTLF
 "Use calculated pipe/in-flight bytes per RFC 6675");
 
 VNET_DEFINE(int, tcp_do_rfc3042) = 1;
-#defineV_tcp_do_rfc3042VNET(tcp_do_rfc3042)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_do_rfc3042), 0,
 "Enable RFC 3042 (Limited Transmit)");
@@ -194,13 +192,11 @@ SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, maxretries, CT
 "Max retries before giving up on ECN");
 
 VNET_DEFINE(int, tcp_insecure_syn) = 0;
-#defineV_tcp_insecure_syn  VNET(tcp_insecure_syn)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_syn, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_insecure_syn), 0,
 "Follow RFC793 instead of RFC5961 criteria for accepting SYN packets");
 
 VNET_DEFINE(int, tcp_insecure_rst) = 0;
-#defineV_tcp_insecure_rst  VNET(tcp_insecure_rst)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_insecure_rst), 0,
 "Follow RFC793 instead of RFC5961 criteria for accepting RST packets");
@@ -211,19 +207,16 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace,
 _NAME(tcp_recvspace), 0, "Initial receive socket buffer size");
 
 VNET_DEFINE(int, tcp_do_autorcvbuf) = 1;
-#defineV_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_do_autorcvbuf), 0,
 "Enable automatic receive buffer sizing");
 
 VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024;
-#defineV_tcp_autorcvbuf_incVNET(tcp_autorcvbuf_inc)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_autorcvbuf_inc), 0,
 "Incrementor step size of automatic receive buffer");
 
 VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024;
-#defineV_tcp_autorcvbuf_maxVNET(tcp_autorcvbuf_max)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_autorcvbuf_max), 0,
 "Max size of automatic receive buffer");

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Wed Oct 11 20:22:01 2017
(r324538)
+++ head/sys/netinet/tcp_output.c   Wed Oct 11 20:36:09 2017
(r324539)
@@ -102,7 +102,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, path_mtu_discovery
"Enable Path MTU Discovery");
 
 VNET_DEFINE(int, tcp_do_tso) = 1;
-#defineV_tcp_do_tsoVNET(tcp_do_tso)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_VNET | CTLFLAG_RW,
_NAME(tcp_do_tso), 0,
"Enable TCP Segmentation Offload");
@@ -113,19 +112,16 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace,
_NAME(tcp_sendspace), 0, "Initial send socket buffer size");
 
 VNET_DEFINE(int, tcp_do_autosndbuf) = 1;
-#defineV_tcp_do_autosndbuf VNET(tcp_do_autosndbuf)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_VNET | CTLFLAG_RW,
_NAME(tcp_do_autosndbuf), 0,
"Enable automatic send buffer sizing");
 
 VNET_DEFINE(int, tcp_autosndbuf_inc) = 8*1024;
-#defineV_tcp_autosndbuf_incVNET(tcp_autosndbuf_inc)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_VNET | CTLFLAG_RW,
_NAME(tcp_autosndbuf_inc), 0,
"Incrementor step size of automatic send buffer");
 
 VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024;
-#defineV_tcp_autosndbuf_maxVNET(tcp_autosndbuf_max)
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_VNET | CTLFLAG_RW,
_NAME(tcp_autosndbuf_max), 0,
"Max size of automatic send buffer");

Modified: head/sys/netinet/tcp_sack.c

svn commit: r324538 - head/sys/dev/qlxgbe

2017-10-11 Thread David C Somayajulu
Author: davidcs
Date: Wed Oct 11 20:22:01 2017
New Revision: 324538
URL: https://svnweb.freebsd.org/changeset/base/324538

Log:
  Added support driver state capture/retrieval
  
  MFC after:5 days

Modified:
  head/sys/dev/qlxgbe/ql_def.h
  head/sys/dev/qlxgbe/ql_glbl.h
  head/sys/dev/qlxgbe/ql_hw.h
  head/sys/dev/qlxgbe/ql_ioctl.c
  head/sys/dev/qlxgbe/ql_ioctl.h
  head/sys/dev/qlxgbe/ql_os.c
  head/sys/dev/qlxgbe/ql_ver.h

Modified: head/sys/dev/qlxgbe/ql_def.h
==
--- head/sys/dev/qlxgbe/ql_def.hWed Oct 11 20:04:30 2017
(r324537)
+++ head/sys/dev/qlxgbe/ql_def.hWed Oct 11 20:22:01 2017
(r324538)
@@ -201,7 +201,6 @@ struct qla_host {
 
qla_rx_buf_t*rxb_free;
uint32_trxb_free_count;
-   volatile uint32_t   posting;
 
/* stats */
uint32_terr_m_getcl;

Modified: head/sys/dev/qlxgbe/ql_glbl.h
==
--- head/sys/dev/qlxgbe/ql_glbl.h   Wed Oct 11 20:04:30 2017
(r324537)
+++ head/sys/dev/qlxgbe/ql_glbl.h   Wed Oct 11 20:22:01 2017
(r324538)
@@ -112,4 +112,8 @@ extern unsigned int ql83xx_resetseq_len;
 extern unsigned char ql83xx_minidump[];
 extern unsigned int ql83xx_minidump_len;
 
+extern void ql_alloc_drvr_state_buffer(qla_host_t *ha);
+extern void ql_free_drvr_state_buffer(qla_host_t *ha);
+extern void ql_capture_drvr_state(qla_host_t *ha);
+
 #endif /* #ifndef_QL_GLBL_H_ */

Modified: head/sys/dev/qlxgbe/ql_hw.h
==
--- head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:04:30 2017(r324537)
+++ head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:22:01 2017(r324538)
@@ -1703,6 +1703,9 @@ typedef struct _qla_hw {
uint32_tmdump_buffer_size;
void*mdump_template;
uint32_tmdump_template_size;
+
+   /* driver state related */
+   void*drvr_state;
 } qla_hw_t;
 
 #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \

Modified: head/sys/dev/qlxgbe/ql_ioctl.c
==
--- head/sys/dev/qlxgbe/ql_ioctl.c  Wed Oct 11 20:04:30 2017
(r324537)
+++ head/sys/dev/qlxgbe/ql_ioctl.c  Wed Oct 11 20:22:01 2017
(r324538)
@@ -39,7 +39,11 @@ __FBSDID("$FreeBSD$");
 #include "ql_inline.h"
 #include "ql_glbl.h"
 #include "ql_ioctl.h"
+#include "ql_ver.h"
+#include "ql_dbg.h"
 
+static int ql_drvr_state(qla_host_t *ha, qla_driver_state_t *drvr_state);
+static uint32_t ql_drvr_state_size(qla_host_t *ha);
 static int ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
struct thread *td);
 
@@ -279,6 +283,10 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, 
rval = ENXIO;
break;
 
+   case QLA_RD_DRVR_STATE:
+   rval = ql_drvr_state(ha, (qla_driver_state_t *)data);
+   break;
+
case QLA_RD_PCI_IDS:
pci_ids = (qla_rd_pci_ids_t *)data;
pci_ids->ven_id = pci_get_vendor(pci_dev);
@@ -293,5 +301,225 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, 
 }
 
 return rval;
+}
+
+
+static int
+ql_drvr_state(qla_host_t *ha, qla_driver_state_t *state)
+{
+   int rval = 0;
+   uint32_t drvr_state_size;
+   qla_drvr_state_hdr_t *hdr;
+
+   drvr_state_size = ql_drvr_state_size(ha);
+
+   if (state->buffer == NULL) {
+   state->size = drvr_state_size;
+   return (0);
+   }
+   
+   if (state->size < drvr_state_size)
+   return (ENXIO);
+
+   if (ha->hw.drvr_state == NULL)
+   return (ENOMEM);
+
+   hdr = ha->hw.drvr_state;
+
+   if (!hdr->drvr_version_major)
+   ql_capture_drvr_state(ha);
+
+   rval = copyout(ha->hw.drvr_state, state->buffer, drvr_state_size);
+
+   bzero(ha->hw.drvr_state, drvr_state_size);
+
+   return (rval);
+}
+
+static uint32_t
+ql_drvr_state_size(qla_host_t *ha)
+{
+   uint32_t drvr_state_size;
+   uint32_t size;
+
+   size = sizeof (qla_drvr_state_hdr_t);
+   drvr_state_size = QL_ALIGN(size, 64);
+
+   size =  ha->hw.num_tx_rings * (sizeof (qla_drvr_state_tx_t));
+   drvr_state_size += QL_ALIGN(size, 64);
+
+   size =  ha->hw.num_rds_rings * (sizeof (qla_drvr_state_rx_t));
+   drvr_state_size += QL_ALIGN(size, 64);
+
+   size =  ha->hw.num_sds_rings * (sizeof (qla_drvr_state_sds_t));
+   drvr_state_size += QL_ALIGN(size, 64);
+
+   size = sizeof(q80_tx_cmd_t) * NUM_TX_DESCRIPTORS * ha->hw.num_tx_rings;
+   drvr_state_size += QL_ALIGN(size, 64);
+
+   size = sizeof(q80_recv_desc_t) * NUM_RX_DESCRIPTORS * 
ha->hw.num_rds_rings;
+   drvr_state_size += QL_ALIGN(size, 64);

svn commit: r324537 - head/sys/opencrypto

2017-10-11 Thread Conrad Meyer
Author: cem
Date: Wed Oct 11 20:04:30 2017
New Revision: 324537
URL: https://svnweb.freebsd.org/changeset/base/324537

Log:
  crypto(9): Print flags in more useful hex
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/opencrypto/crypto.c

Modified: head/sys/opencrypto/crypto.c
==
--- head/sys/opencrypto/crypto.cWed Oct 11 19:26:39 2017
(r324536)
+++ head/sys/opencrypto/crypto.cWed Oct 11 20:04:30 2017
(r324537)
@@ -572,7 +572,7 @@ crypto_get_driverid(device_t dev, int flags)
crypto_drivers[i].cc_dev = dev;
crypto_drivers[i].cc_flags = flags;
if (bootverbose)
-   printf("crypto: assign %s driver id %u, flags %u\n",
+   printf("crypto: assign %s driver id %u, flags 0x%x\n",
device_get_nameunit(dev), i, flags);
 
CRYPTO_DRIVER_UNLOCK();
___
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: r324536 - head/contrib/llvm/projects/libunwind/src

2017-10-11 Thread Ed Maste
Author: emaste
Date: Wed Oct 11 19:26:39 2017
New Revision: 324536
URL: https://svnweb.freebsd.org/changeset/base/324536

Log:
  libunwind: use upstream patch to disable executable stacks
  
  arm uses '@' as a comment character, and cannot use @progbits in the
  .section directive. Apply the upstream noexec stach change which avoids
  this issue.
  
  Obtained from:LLVM r277868

Modified:
  head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S
  head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S
  head/contrib/llvm/projects/libunwind/src/assembly.h

Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S
==
--- head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S   Wed Oct 
11 18:25:05 2017(r324535)
+++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S   Wed Oct 
11 19:26:39 2017(r324536)
@@ -528,4 +528,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Regis
 
 #endif
 
-  .section .note.GNU-stack,"",@progbits
+NO_EXEC_STACK_DIRECTIVE
+

Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S
==
--- head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S  Wed Oct 
11 18:25:05 2017(r324535)
+++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S  Wed Oct 
11 19:26:39 2017(r324536)
@@ -470,4 +470,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext)
 
 #endif
 
-.section .note.GNU-stack,"",@progbits
+NO_EXEC_STACK_DIRECTIVE
+

Modified: head/contrib/llvm/projects/libunwind/src/assembly.h
==
--- head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 18:25:05 
2017(r324535)
+++ head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 19:26:39 
2017(r324536)
@@ -35,19 +35,34 @@
 #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
 
 #if defined(__APPLE__)
+
 #define SYMBOL_IS_FUNC(name)
+#define NO_EXEC_STACK_DIRECTIVE
+
 #elif defined(__ELF__)
+
 #if defined(__arm__)
 #define SYMBOL_IS_FUNC(name) .type name,%function
 #else
 #define SYMBOL_IS_FUNC(name) .type name,@function
 #endif
+
+#if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__)
+#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
 #else
+#define NO_EXEC_STACK_DIRECTIVE
+#endif
+
+#else
+
 #define SYMBOL_IS_FUNC(name)   
\
   .def name SEPARATOR  
\
 .scl 2 SEPARATOR   
\
 .type 32 SEPARATOR 
\
   .endef
+
+#define NO_EXEC_STACK_DIRECTIVE
+
 #endif
 
 #define DEFINE_LIBUNWIND_FUNCTION(name)   \
___
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: r324471 - head/sys/boot

2017-10-11 Thread Warner Losh
On Wed, Oct 11, 2017 at 11:47 AM, John Baldwin  wrote:

> On Monday, October 09, 2017 10:56:45 PM Warner Losh wrote:
> > DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME.
> >
> > DO NOT MAKE ANY COMMITS TO sys/boot.
> >
> > BACK OFF.
> >
> > Seriously, though, extra changes create extra friction, and these changes
> > aren't worth any friction at all. I'm deleting LIBSAU and this
> guarantees a
> > conflict when I update.
> >
> > So please, do not make any edits to sys/boot whatsoever, no matter how
> > trivial.
> >
> > At least until I'm done.
> >
> > Thanks.
>
> Umm, I know you are working on sys/boot but I never saw any mail or headsup
> claiming a lock on that part of the tree.  It would be a reasonable
> assumption
> for someone based on the public commits that you had finished a milestone
> for
> now.  I only knew about you wanting to remove LIBSAU via a private reply
> you
> sent to my earlier mail, but there was no public mention that you have more
> work.  To that end I think this mail was a bit harsh.
>

The specific issue was that several people had made suggestions in this
area, some of which were conflicting, and I was mulling over what the right
thing to commit was. They were made to me, but in a public forum, in
response to my original commit. Since I had other changes in flight, I
wasn't sure the right way to roll them in. Then with no warning or heads
up, the issue was forced by ngie committing changes to something that I'd
just touched without even so much as a heads up. And it didn't help that
the friction this created wasted 10 minutes of my time dealing with git svn
rebase tripping over 3 or 4 commits in my queue.

So I was harsh. Perhaps a bit too harsh and too public, but this wasn't a
first offense. I'll try to moderate that in the future.

Warner
___
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: r324471 - head/sys/boot

2017-10-11 Thread John Baldwin
On Monday, October 09, 2017 10:56:45 PM Warner Losh wrote:
> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME.
> 
> DO NOT MAKE ANY COMMITS TO sys/boot.
> 
> BACK OFF.
> 
> Seriously, though, extra changes create extra friction, and these changes
> aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a
> conflict when I update.
> 
> So please, do not make any edits to sys/boot whatsoever, no matter how
> trivial.
> 
> At least until I'm done.
> 
> Thanks.

Umm, I know you are working on sys/boot but I never saw any mail or headsup
claiming a lock on that part of the tree.  It would be a reasonable assumption
for someone based on the public commits that you had finished a milestone for
now.  I only knew about you wanting to remove LIBSAU via a private reply you
sent to my earlier mail, but there was no public mention that you have more
work.  To that end I think this mail was a bit harsh.

-- 
John Baldwin
___
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: r324535 - head/sys/dev/qlxgbe

2017-10-11 Thread David C Somayajulu
Author: davidcs
Date: Wed Oct 11 18:25:05 2017
New Revision: 324535
URL: https://svnweb.freebsd.org/changeset/base/324535

Log:
  Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots
  in Tx Ring map to empty slot in Tx_buf array before Transmits. If the
  checks fail further Transmission on that Tx Ring is prevented.
  
  MFC after:5 days

Modified:
  head/sys/dev/qlxgbe/ql_hw.c
  head/sys/dev/qlxgbe/ql_os.c

Modified: head/sys/dev/qlxgbe/ql_hw.c
==
--- head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 15:13:40 2017(r324534)
+++ head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 18:25:05 2017(r324535)
@@ -2374,6 +2374,20 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in
}
}
 
+   for (i = 0; i < num_tx_cmds; i++) {
+   int j;
+
+   j = (tx_idx+i) & (NUM_TX_DESCRIPTORS - 1);
+
+   if (NULL != ha->tx_ring[txr_idx].tx_buf[j].m_head) {
+   QL_ASSERT(ha, 0, \
+   ("%s [%d]: txr_idx = %d tx_idx = %d mbuf = 
%p\n",\
+   __func__, __LINE__, txr_idx, j,\
+   ha->tx_ring[txr_idx].tx_buf[j].m_head));
+   return (EINVAL);
+   }
+   }
+
tx_cmd = >tx_cntxt[txr_idx].tx_ring_base[tx_idx];
 
 if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) {

Modified: head/sys/dev/qlxgbe/ql_os.c
==
--- head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 15:13:40 2017(r324534)
+++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 18:25:05 2017(r324535)
@@ -1232,6 +1232,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32
QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__));
 
tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next;
+
+   if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) {
+   QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\
+   "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\
+   ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head));
+   if (m_head)
+   m_freem(m_head);
+   *m_headp = NULL;
+   return (ret);
+   }
+
map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map;
 
ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, ,
___
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: r324534 - head/sys/dev/hwpmc

2017-10-11 Thread Conrad Meyer
Author: cem
Date: Wed Oct 11 15:13:40 2017
New Revision: 324534
URL: https://svnweb.freebsd.org/changeset/base/324534

Log:
  hwpmc(4): Actually use a sufficiently wide type
  
  jhibbits@ points out that left shifting bits 8-11 24 bits won't fit in a 
32-bit
  integer either.
  
  Corrects r324533.
  
  Submitted by: jhibbits
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/dev/hwpmc/hwpmc_amd.h

Modified: head/sys/dev/hwpmc/hwpmc_amd.h
==
--- head/sys/dev/hwpmc/hwpmc_amd.h  Wed Oct 11 14:59:04 2017
(r324533)
+++ head/sys/dev/hwpmc/hwpmc_amd.h  Wed Oct 11 15:13:40 2017
(r324534)
@@ -67,7 +67,7 @@
 #defineAMD_PMC_EVENTMASK   0xF00FF
 
 #defineAMD_PMC_TO_UNITMASK(x)  (((x) << 8) & AMD_PMC_UNITMASK)
-#defineAMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint32_t)(x) & 
0xF00) << 24))
+#defineAMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint64_t)(x) & 
0xF00) << 24))
 #defineAMD_VALID_BITS  (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | 
\
AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE |  \
AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK)
___
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: r324533 - head/sys/dev/hwpmc

2017-10-11 Thread Conrad Meyer
Author: cem
Date: Wed Oct 11 14:59:04 2017
New Revision: 324533
URL: https://svnweb.freebsd.org/changeset/base/324533

Log:
  hwpmc(4): Force sufficiently wide type for left shift
  
  Ordinary input to this macro comes from pe_code, which is uint16_t.  Coverity
  points out that shifting such a value discards the result of a 24 bit shift,
  which is not what we want.
  
  A follow-up to r324291.
  
  CID:  1381676
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/dev/hwpmc/hwpmc_amd.h

Modified: head/sys/dev/hwpmc/hwpmc_amd.h
==
--- head/sys/dev/hwpmc/hwpmc_amd.h  Wed Oct 11 14:41:11 2017
(r324532)
+++ head/sys/dev/hwpmc/hwpmc_amd.h  Wed Oct 11 14:59:04 2017
(r324533)
@@ -67,7 +67,7 @@
 #defineAMD_PMC_EVENTMASK   0xF00FF
 
 #defineAMD_PMC_TO_UNITMASK(x)  (((x) << 8) & AMD_PMC_UNITMASK)
-#defineAMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((x) & 0xF00) << 24))
+#defineAMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint32_t)(x) & 
0xF00) << 24))
 #defineAMD_VALID_BITS  (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | 
\
AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE |  \
AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK)
___
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: r324532 - head/tools/build/mk

2017-10-11 Thread Baptiste Daroussin
Author: bapt
Date: Wed Oct 11 14:41:11 2017
New Revision: 324532
URL: https://svnweb.freebsd.org/changeset/base/324532

Log:
  Do not try to remove diff.7 optionaly has it is always removed
  since GNU diff(1) has been replaced with BSD diff(1)

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Oct 11 14:34:06 
2017(r324531)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Oct 11 14:41:11 
2017(r324532)
@@ -2482,7 +2482,6 @@ OLD_FILES+=usr/share/man/man8/gpioctl.8.gz
 .if ${MK_GNU_DIFF} == no
 OLD_FILES+=usr/bin/diff3
 OLD_FILES+=usr/share/man/man1/diff3.1.gz
-OLD_FILES+=usr/share/man/man7/diff.7.gz
 .endif
 
 .if ${MK_GNU_GREP} == no
___
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: r324531 - head/tools/build/mk

2017-10-11 Thread Ed Maste
Author: emaste
Date: Wed Oct 11 14:34:06 2017
New Revision: 324531
URL: https://svnweb.freebsd.org/changeset/base/324531

Log:
  OptionalObsoleteFiles: remove diff from MK_GNU_DIFF=no block
  
  diff (and man page) are not from GNU, as of r317209, and should not be
  deleted if WITHOUT_GNU_DIFF is set. (WITHOUT_GNU_DIFF still controls
  whether diff3 is built.)
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Oct 11 13:33:11 
2017(r324530)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Oct 11 14:34:06 
2017(r324531)
@@ -2480,9 +2480,7 @@ OLD_FILES+=usr/share/man/man8/gpioctl.8.gz
 .endif
 
 .if ${MK_GNU_DIFF} == no
-OLD_FILES+=usr/bin/diff
 OLD_FILES+=usr/bin/diff3
-OLD_FILES+=usr/share/man/man1/diff.1.gz
 OLD_FILES+=usr/share/man/man1/diff3.1.gz
 OLD_FILES+=usr/share/man/man7/diff.7.gz
 .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: r324528 - head/sys/kern

2017-10-11 Thread Konstantin Belousov
Author: kib
Date: Wed Oct 11 11:03:11 2017
New Revision: 324528
URL: https://svnweb.freebsd.org/changeset/base/324528

Log:
  The th_bintime, th_microtime and th_nanotime members of the timehand
  all cache the last system time (uptime + boottime).  Only the format
  differs.  Do not re-calculate the bintime and simply use the value
  used to calculate the microtime and nanotime.
  
  Group all the updates under the relevant comment.  Remove obsoleted
  XXX part.
  
  Submitted by: Sebastian Huber 
  MFC after:1 week

Modified:
  head/sys/kern/kern_tc.c

Modified: head/sys/kern/kern_tc.c
==
--- head/sys/kern/kern_tc.c Wed Oct 11 10:56:59 2017(r324527)
+++ head/sys/kern/kern_tc.c Wed Oct 11 11:03:11 2017(r324528)
@@ -1413,10 +1413,8 @@ tc_windup(struct bintime *new_boottimebin)
if (bt.sec != t)
th->th_boottime.sec += bt.sec - t;
}
-   th->th_bintime = th->th_offset;
-   bintime_add(>th_bintime, >th_boottime);
/* Update the UTC timestamps used by the get*() functions. */
-   /* XXX shouldn't do this here.  Should force non-`get' versions. */
+   th->th_bintime = bt;
bintime2timeval(, >th_microtime);
bintime2timespec(, >th_nanotime);
 
___
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: r324519 - head/sys/net

2017-10-11 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Oct 11 06:08:01 2017
New Revision: 324519
URL: https://svnweb.freebsd.org/changeset/base/324519

Log:
  rss: Remove never defined UDP_IPV4_EX
  
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D12455

Modified:
  head/sys/net/rss_config.c
  head/sys/net/rss_config.h

Modified: head/sys/net/rss_config.c
==
--- head/sys/net/rss_config.c   Wed Oct 11 05:55:52 2017(r324518)
+++ head/sys/net/rss_config.c   Wed Oct 11 06:08:01 2017(r324519)
@@ -489,7 +489,6 @@ rss_gethashconfig(void)
|RSS_HASHTYPE_RSS_TCP_IPV6_EX
 #if 0
|RSS_HASHTYPE_RSS_UDP_IPV4
-   |RSS_HASHTYPE_RSS_UDP_IPV4_EX
|RSS_HASHTYPE_RSS_UDP_IPV6
|RSS_HASHTYPE_RSS_UDP_IPV6_EX
 #endif

Modified: head/sys/net/rss_config.h
==
--- head/sys/net/rss_config.h   Wed Oct 11 05:55:52 2017(r324518)
+++ head/sys/net/rss_config.h   Wed Oct 11 06:08:01 2017(r324519)
@@ -66,7 +66,6 @@
 #defineRSS_HASHTYPE_RSS_IPV6_EX(1 << 5)/* IPv6 2-tuple 
+ ext hdrs */
 #defineRSS_HASHTYPE_RSS_TCP_IPV6_EX(1 << 6)/* TCPv6 
4-tiple + ext hdrs */
 #defineRSS_HASHTYPE_RSS_UDP_IPV4   (1 << 7)/* IPv4 UDP 
4-tuple */
-#defineRSS_HASHTYPE_RSS_UDP_IPV4_EX(1 << 8)/* IPv4 UDP 
4-tuple + ext hdrs */
 #defineRSS_HASHTYPE_RSS_UDP_IPV6   (1 << 9)/* IPv6 UDP 
4-tuple */
 #defineRSS_HASHTYPE_RSS_UDP_IPV6_EX(1 << 10)   /* IPv6 UDP 
4-tuple + ext hdrs */
 
___
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"