svn commit: r314194 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs cddl/contrib/opensolaris/uts/common/sys conf modules/zfs

2017-02-23 Thread Andriy Gapon
Author: avg
Date: Fri Feb 24 07:53:56 2017
New Revision: 314194
URL: https://svnweb.freebsd.org/changeset/base/314194

Log:
  zfs: clean up unused files and definitions
  
  MFC after:1 month
  X-MFC after:  r314048

Deleted:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h
Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
  head/sys/cddl/compat/opensolaris/sys/pathname.h
  head/sys/conf/files
  head/sys/modules/zfs/Makefile

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c  Fri Feb 24 
07:47:50 2017(r314193)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c  Fri Feb 24 
07:53:56 2017(r314194)
@@ -62,55 +62,3 @@ lookupnameat(char *dirname, enum uio_seg
vn_lock(startvp, ltype | LK_RETRY);
return (error);
 }
-
-int
-traverse(vnode_t **cvpp, int lktype)
-{
-   vnode_t *cvp;
-   vnode_t *tvp;
-   vfs_t *vfsp;
-   int error;
-
-   cvp = *cvpp;
-   tvp = NULL;
-
-   /*
-* If this vnode is mounted on, then we transparently indirect
-* to the vnode which is the root of the mounted file system.
-* Before we do this we must check that an unmount is not in
-* progress on this vnode.
-*/
-
-   for (;;) {
-   /*
-* Reached the end of the mount chain?
-*/
-   vfsp = vn_mountedvfs(cvp);
-   if (vfsp == NULL)
-   break;
-   error = vfs_busy(vfsp, 0);
-
-   /*
-* tvp is NULL for *cvpp vnode, which we can't unlock.
-*/
-   if (tvp != NULL)
-   vput(cvp);
-   else
-   vrele(cvp);
-   if (error)
-   return (error);
-
-   /*
-* The read lock must be held across the call to VFS_ROOT() to
-* prevent a concurrent unmount from destroying the vfs.
-*/
-   error = VFS_ROOT(vfsp, lktype, );
-   vfs_unbusy(vfsp);
-   if (error != 0)
-   return (error);
-   cvp = tvp;
-   }
-
-   *cvpp = cvp;
-   return (0);
-}

Modified: head/sys/cddl/compat/opensolaris/sys/pathname.h
==
--- head/sys/cddl/compat/opensolaris/sys/pathname.h Fri Feb 24 07:47:50 
2017(r314193)
+++ head/sys/cddl/compat/opensolaris/sys/pathname.h Fri Feb 24 07:53:56 
2017(r314194)
@@ -34,20 +34,9 @@
 #include 
 #include 
 
-typedef struct pathname {
-   char*pn_buf;/* underlying storage */
-   char*pn_path;   /* remaining pathname */
-   size_t  pn_pathlen; /* remaining length */
-   size_t  pn_bufsize; /* total size of pn_buf */
-} pathname_t;
-
-#definepn_alloc(pnp)   panic("pn_alloc() called")
-#definepn_free(pnp)panic("pn_free() called")
-
 int lookupname(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **);
 int lookupnameat(char *, enum uio_seg, enum symfollow, vnode_t **, vnode_t **,
 vnode_t *);
-int traverse(vnode_t **, int);
 
 #endif /* _KERNEL */
 

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Feb 24 07:47:50 2017(r314193)
+++ head/sys/conf/files Fri Feb 24 07:53:56 2017(r314194)
@@ -158,7 +158,6 @@ cddl/contrib/opensolaris/common/zfs/zfs_
 cddl/contrib/opensolaris/common/zfs/zfs_prop.c 
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zpool_prop.c   
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/common/zfs/zprop_common.c 
optional zfs compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/uts/common/fs/gfs.c   
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/vnode.c 
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   
optional zfs compile-with "${ZFS_C}"
 cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c
optional zfs compile-with "${ZFS_C}"

Modified: head/sys/modules/zfs/Makefile
==
--- head/sys/modules/zfs/Makefile   Fri Feb 24 07:47:50 2017
(r314193)
+++ head/sys/modules/zfs/Makefile   Fri Feb 24 07:53:56 2017
(r314194)
@@ -46,7 +46,6 @@ SRCS+=opensolaris_atomic.c
 .endif
 
 .PATH: ${SUNW}/uts/common/fs
-SRCS+= gfs.c
 SRCS+= vnode.c
 
 .PATH: 

svn commit: r314193 - head/sys/cam/ctl

2017-02-23 Thread Alexander Motin
Author: mav
Date: Fri Feb 24 07:47:50 2017
New Revision: 314193
URL: https://svnweb.freebsd.org/changeset/base/314193

Log:
  Some code cleanup.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Feb 24 07:07:58 2017(r314192)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Feb 24 07:47:50 2017(r314193)
@@ -836,52 +836,32 @@ ctlfestart(struct cam_periph *periph, un
(io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) {
io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED;
 
-   /*
-* If this command was aborted, we don't
-* need to send status back to the SIM.
-* Just free the CTIO and ctl_io, and
-* recycle the ATIO back to the SIM.
-*/
-   xpt_print(periph->path, "%s: aborted "
- "command 0x%04x discarded\n",
- __func__, io->scsiio.tag_num);
-   /*
-* For a wildcard attachment, commands can
-* come in with a specific target/lun.  Reset
-* the target and LUN fields back to the
-* wildcard values before we send them back
-* down to the SIM.  The SIM has a wildcard
-* LUN enabled, not whatever target/lun
-* these happened to be.
-*/
-   if (softc->flags & CTLFE_LUN_WILDCARD) {
-   atio->ccb_h.target_id = CAM_TARGET_WILDCARD;
-   atio->ccb_h.target_lun = CAM_LUN_WILDCARD;
-   }
-
-   if (atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) {
-   xpt_print(periph->path, "%s: func_code "
- "is %#x\n", __func__,
- atio->ccb_h.func_code);
-   }
+   /* Tell the SIM that we've aborted this ATIO */
+#ifdef CTLFEDEBUG
+   printf("%s: tag %04x abort\n", __func__, atio->tag_id);
+#endif
+   KASSERT(atio->ccb_h.func_code == XPT_ACCEPT_TARGET_IO,
+   ("func_code %#x is not ATIO", 
atio->ccb_h.func_code));
start_ccb->ccb_h.func_code = XPT_ABORT;
start_ccb->cab.abort_ccb = (union ccb *)atio;
-
-   /* Tell the SIM that we've aborted this ATIO */
xpt_action(start_ccb);
softc->ccbs_freed++;
xpt_release_ccb(start_ccb);
 
/*
 * Send the ATIO back down to the SIM.
+* For a wildcard attachment, commands can come in
+* with a specific target/lun.  Reset the target and
+* LUN fields back to the wildcard values before we
+* send them back down to the SIM.
 */
+   if (softc->flags & CTLFE_LUN_WILDCARD) {
+   atio->ccb_h.target_id = CAM_TARGET_WILDCARD;
+   atio->ccb_h.target_lun = CAM_LUN_WILDCARD;
+   }
xpt_action((union ccb *)atio);
 
-   /*
-* If we still have work to do, ask for
-* another CCB.  Otherwise, deactivate our
-* callout.
-*/
+   /* If we still have work to do, ask for another CCB. */
if (!TAILQ_EMPTY(>work_queue))
xpt_schedule(periph, /*priority*/ 1);
return;
@@ -905,9 +885,6 @@ ctlfestart(struct cam_periph *periph, un
if (csio->sense_len != 0) {
csio->sense_data = io->scsiio.sense_data;
flags |= CAM_SEND_SENSE;
-   } else if (scsi_status == SCSI_STATUS_CHECK_COND) {
-   xpt_print(periph->path, "%s: check condition "
- "with no sense\n", __func__);
}
}
 
___
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: r314192 - in head/sys: conf dev/iwm modules/iwm

2017-02-23 Thread Adrian Chadd
Author: adrian
Date: Fri Feb 24 07:07:58 2017
New Revision: 314192
URL: https://svnweb.freebsd.org/changeset/base/314192

Log:
  [iwm] Add support for Firmware paging, needed for newer 8000C firmware.
  
  * Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware
what memory ranges to use for paging.
  
  Obtained from:dragonflybsd.git 
8a5b199964f8e7bdb00039f0b48817a01b402f18

Modified:
  head/sys/conf/files
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_debug.h
  head/sys/dev/iwm/if_iwmreg.h
  head/sys/dev/iwm/if_iwmvar.h
  head/sys/modules/iwm/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Feb 24 06:49:31 2017(r314191)
+++ head/sys/conf/files Fri Feb 24 07:07:58 2017(r314192)
@@ -1864,6 +1864,7 @@ dev/iwm/if_iwm.c  optional iwm
 dev/iwm/if_iwm_7000.c  optional iwm
 dev/iwm/if_iwm_8000.c  optional iwm
 dev/iwm/if_iwm_binding.c   optional iwm
+dev/iwm/if_iwm_fw.coptional iwm
 dev/iwm/if_iwm_led.c   optional iwm
 dev/iwm/if_iwm_mac_ctxt.c  optional iwm
 dev/iwm/if_iwm_notif_wait.coptional iwm

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri Feb 24 06:49:31 2017(r314191)
+++ head/sys/dev/iwm/if_iwm.c   Fri Feb 24 07:07:58 2017(r314192)
@@ -166,6 +166,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 const uint8_t iwm_nvm_channels[] = {
/* 2.4 GHz */
@@ -2869,9 +2870,21 @@ iwm_mvm_load_ucode_wait_alive(struct iwm
 * included in the IWM_UCODE_INIT image.
 */
if (fw->paging_mem_size) {
-   /* XXX implement FW paging */
-   device_printf(sc->sc_dev,
-   "%s: XXX FW paging not implemented yet\n", __func__);
+   error = iwm_save_fw_paging(sc, fw);
+   if (error) {
+   device_printf(sc->sc_dev,
+   "%s: failed to save the FW paging image\n",
+   __func__);
+   return error;
+   }
+
+   error = iwm_send_paging_cmd(sc, fw);
+   if (error) {
+   device_printf(sc->sc_dev,
+   "%s: failed to send the paging cmd\n", __func__);
+   iwm_free_fw_paging(sc);
+   return error;
+   }
}
 
if (!error)
@@ -5517,6 +5530,7 @@ iwm_notif_intr(struct iwm_softc *sc)
case IWM_REMOVE_STA:
case IWM_TXPATH_FLUSH:
case IWM_LQ_CMD:
+   case IWM_FW_PAGING_BLOCK_CMD:
case IWM_BT_CONFIG:
case IWM_REPLY_THERMAL_MNG_BACKOFF:
cresp = (void *)pkt->data;
@@ -6475,6 +6489,8 @@ iwm_detach_local(struct iwm_softc *sc, i
iwm_dma_contig_free(>kw_dma);
iwm_dma_contig_free(>fw_dma);
 
+   iwm_free_fw_paging(sc);
+
/* Finished with the hardware - detach things */
iwm_pci_detach(dev);
 

Modified: head/sys/dev/iwm/if_iwm_debug.h
==
--- head/sys/dev/iwm/if_iwm_debug.h Fri Feb 24 06:49:31 2017
(r314191)
+++ head/sys/dev/iwm/if_iwm_debug.h Fri Feb 24 07:07:58 2017
(r314192)
@@ -42,6 +42,7 @@ enum {
IWM_DEBUG_TRANS = 0x0004,   /* Transport layer (eg PCIe) */
IWM_DEBUG_EEPROM= 0x0008,   /* EEPROM/channel information */
IWM_DEBUG_TEMP  = 0x0010,   /* Thermal Sensor handling */
+   IWM_DEBUG_FW= 0x0020,   /* Firmware management */
IWM_DEBUG_REGISTER  = 0x2000,   /* print chipset register */
IWM_DEBUG_TRACE = 0x4000,   /* Print begin and start driver 
function */
IWM_DEBUG_FATAL = 0x8000,   /* fatal errors */

Modified: head/sys/dev/iwm/if_iwmreg.h
==
--- head/sys/dev/iwm/if_iwmreg.hFri Feb 24 06:49:31 2017
(r314191)
+++ head/sys/dev/iwm/if_iwmreg.hFri Feb 24 07:07:58 2017
(r314192)
@@ -888,28 +888,6 @@ struct iwm_fw_cipher_scheme {
uint8_t hw_cipher;
 } __packed;
 
-/*
- * Block paging calculations
- */
-#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */
-#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */
-#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3
-/* 8 pages per group */
-#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE)
-/* don't change, support only 32KB size */
-#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE)
-/* 32K == 2^15 */
-#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + 
IWM_PAGE_PER_GROUP_2_EXP_SIZE)
-
-/*
- * Image paging 

svn commit: r314191 - head/lib/libcam

2017-02-23 Thread Ngie Cooper
Author: ngie
Date: Fri Feb 24 06:49:31 2017
New Revision: 314191
URL: https://svnweb.freebsd.org/changeset/base/314191

Log:
  Fix up r314189
  
  The conditional in do_buff_decode(..) after the while loop was accidentally
  inverted. Only increment the pointer for fmt if it's not NUL.
  
  MFC after:2 weeks
  X-MFC with:   r314189
  Reported by:  pstef
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libcam/scsi_cmdparse.c

Modified: head/lib/libcam/scsi_cmdparse.c
==
--- head/lib/libcam/scsi_cmdparse.c Fri Feb 24 06:28:58 2017
(r314190)
+++ head/lib/libcam/scsi_cmdparse.c Fri Feb 24 06:49:31 2017
(r314191)
@@ -169,7 +169,7 @@ do_buff_decode(u_int8_t *buff, size_t le
 
fmt++;
}
-   if (*fmt == '\0')
+   if (*fmt != '\0')
fmt++;  /* Skip '}' */
field_name[i] = '\0';
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314190 - head/lib/libcam

2017-02-23 Thread Ngie Cooper
Author: ngie
Date: Fri Feb 24 06:28:58 2017
New Revision: 314190
URL: https://svnweb.freebsd.org/changeset/base/314190

Log:
  Fix some minor style nits: put parentheses around return values
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libcam/scsi_cmdparse.c

Modified: head/lib/libcam/scsi_cmdparse.c
==
--- head/lib/libcam/scsi_cmdparse.c Fri Feb 24 06:24:39 2017
(r314189)
+++ head/lib/libcam/scsi_cmdparse.c Fri Feb 24 06:28:58 2017
(r314190)
@@ -530,7 +530,7 @@ next_field(const char **pp, char *fmt, i
 
if (is_error) {
*error_p = 1;
-   return 0;
+   return (0);
}
 
*error_p = 0;
@@ -659,9 +659,9 @@ do_encode(u_char *buff, size_t vec_max, 
*used = ind;
 
if (error)
-   return -1;
+   return (-1);
 
-   return encoded;
+   return (encoded);
 }
 
 int
@@ -723,7 +723,7 @@ buff_decode_visit(u_int8_t *buff, size_t
 * the arg_put function.
 */
if (arg_put == NULL)
-   return(-1);
+   return (-1);
 
return (do_buff_decode(buff, len, arg_put, puthook, fmt, NULL));
 }
@@ -779,20 +779,20 @@ csio_build_visit(struct ccb_scsiio *csio
int retval;
 
if (csio == NULL)
-   return(0);
+   return (0);
 
/*
 * We need something to encode, but we can't get it without the
 * arg_get function.
 */
if (arg_get == NULL)
-   return(-1);
+   return (-1);
 
bzero(csio, sizeof(struct ccb_scsiio));
 
if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN,
, arg_get, gethook, cmd_spec, NULL)) == 
-1)
-   return(retval);
+   return (retval);
 
cam_fill_csio(csio,
  /* retries */ retry_count,
@@ -805,7 +805,7 @@ csio_build_visit(struct ccb_scsiio *csio
  /* cdb_len */ cmdlen,
  /* timeout */ timeout ? timeout : 5000);
 
-   return(retval);
+   return (retval);
 }
 
 int
@@ -837,7 +837,7 @@ buff_encode_visit(u_int8_t *buff, size_t
 * arg_get function.
 */
if (arg_get == NULL)
-   return(-1);
+   return (-1);
 
return (do_encode(buff, len, NULL, arg_get, gethook, fmt, NULL));
 }
@@ -852,7 +852,7 @@ csio_encode_visit(struct ccb_scsiio *csi
 * arg_get function.
 */
if (arg_get == NULL)
-   return(-1);
+   return (-1);
 
return (do_encode(csio->data_ptr, csio->dxfer_len, NULL, arg_get,
 gethook, fmt, NULL));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314189 - head/lib/libcam

2017-02-23 Thread Ngie Cooper
Author: ngie
Date: Fri Feb 24 06:24:39 2017
New Revision: 314189
URL: https://svnweb.freebsd.org/changeset/base/314189

Log:
  Fix up NULL/'\0' uses and fix 2 derefs after NULL
  
  MFC after:2 weeks
  Reported by:  Coverity
  CID:  1018898, 1018899
  Differential Revision:https://reviews.freebsd.org/D6142
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libcam/scsi_cmdparse.c

Modified: head/lib/libcam/scsi_cmdparse.c
==
--- head/lib/libcam/scsi_cmdparse.c Fri Feb 24 01:39:12 2017
(r314188)
+++ head/lib/libcam/scsi_cmdparse.c Fri Feb 24 06:24:39 2017
(r314189)
@@ -128,14 +128,14 @@ do_buff_decode(u_int8_t *buff, size_t le
*(va_arg(*ap, int *)) = (ARG); \
assigned++; \
} \
-   field_name[0] = 0; \
+   field_name[0] = '\0'; \
suppress = 0; \
} while (0)
 
u_char bits = 0;/* For bit fields */
int shift = 0;  /* Bits already shifted out */
suppress = 0;
-   field_name[0] = 0;
+   field_name[0] = '\0';
 
while (!done) {
switch(letter = *fmt) {
@@ -169,9 +169,9 @@ do_buff_decode(u_int8_t *buff, size_t le
 
fmt++;
}
-   if (fmt)
+   if (*fmt == '\0')
fmt++;  /* Skip '}' */
-   field_name[i] = 0;
+   field_name[i] = '\0';
break;
}
 
@@ -255,7 +255,7 @@ do_buff_decode(u_int8_t *buff, size_t le
break;
}
if (!suppress) {
-   if (arg_put)
+   if (arg_put != NULL)
(*arg_put)(puthook,
(letter == 't' ? 'b' : letter),
[ind], width, field_name);
@@ -268,7 +268,7 @@ do_buff_decode(u_int8_t *buff, size_t le
for (p = dest + width - 1;
p >= dest && *p == ' ';
p--)
-   *p = 0;
+   *p = '\0';
}
}
assigned++;
@@ -379,22 +379,22 @@ next_field(const char **pp, char *fmt, i
field_size = 8; /* Default to byte field type... */
*fmt = 'i';
field_width = 1;/* 1 byte wide */
-   if (name)
-   *name = 0;
+   if (name != NULL)
+   *name = '\0';
 
state = BETWEEN_FIELDS;
 
while (state != DONE) {
switch(state) {
case BETWEEN_FIELDS:
-   if (*p == 0)
+   if (*p == '\0')
state = DONE;
else if (isspace(*p))
p++;
else if (*p == '#') {
while (*p && *p != '\n')
p++;
-   if (p)
+   if (*p != '\0')
p++;
} else if (*p == '{') {
int i = 0;
@@ -410,7 +410,7 @@ next_field(const char **pp, char *fmt, i
}
 
if(name && i < n_name)
-   name[i] = 0;
+   name[i] = '\0';
 
if (*p == '}')
p++;
@@ -568,7 +568,7 @@ do_encode(u_char *buff, size_t vec_max, 
if (suppress)
value = 0;
else
-   value = arg_get ?
+   value = arg_get != NULL ?
(*arg_get)(gethook, field_name) :
va_arg(*ap, int);
}
@@ -672,8 +672,8 @@ csio_decode(struct ccb_scsiio *csio, con
 
va_start(ap, fmt);
 
-   retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, 0, 0,
-fmt, );
+   retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len,
+   NULL, NULL, fmt, );
 
va_end(ap);
 
@@ -705,7 +705,7 @@ buff_decode(u_int8_t *buff, size_t len, 
 
va_start(ap, fmt);
 
-   retval = do_buff_decode(buff, len, 0, 0, fmt, );
+   retval = do_buff_decode(buff, len, NULL, NULL, fmt, );
 

Re: svn commit: r314142 - head/sys/dev/ce

2017-02-23 Thread Pedro Giffuni

Hello,

On 2/23/2017 10:05 PM, Alexey Dokuchaev wrote:

On Thu, Feb 23, 2017 at 12:49:01PM -0500, Pedro Giffuni wrote:

On 2/23/2017 12:13 PM, Benjamin Kaduk wrote:

On Thu, Feb 23, 2017 at 9:30 AM, Pedro F. Giffuni > wrote:
 @@ -632,8 +632,8 @@ void ce_stop_chan (ce_chan_t *c)
   "UserRequest (%s:%d)\n",
 __FUNCTION__, __LINE__));
 return;
 }
 -   req->Command = TAU32_Configure_Commit |
 -  TAU32_Tx_Stop | TAU32_Rx_Stop;
 +// req->Command = TAU32_Configure_Commit |
 +//TAU32_Tx_Stop | TAU32_Rx_Stop;

Should probably stick to C-style comments, though.

They are valid C99 comments but I understand what you mean,

Using comments (regardless of style) for disabling a code block is wrong;
may I suggest `#if 0' instead?  (This also does not hurt `svn blame'.)


This is not covered by style(9) so I guess it's personal choice.

As I see it, '#if 0' is WIP: code that is not ready but is kept to be 
enabled at later time. I would generally prefer to remove such code and 
hunt it back through svn if I need it.
In this case the code is only to serve as a reference, JIC someone wants 
to implement it for real.


Since the main comment starts with "XXXRIK: .." and states "it is VERY 
BUGGY!!! Do not use it ... ", I just don't think it is worth to spend 
much time deciding how to comment it out.


Let me CC rik@ though, maybe he has a real fix ;).

Pedro.

ps. for Roman ... we are discussing this change:
https://svnweb.freebsd.org/changeset/base/314142

Feel free to chime in if you have a cleaner workaround.

___
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: r314142 - head/sys/dev/ce

2017-02-23 Thread Alexey Dokuchaev
On Thu, Feb 23, 2017 at 12:49:01PM -0500, Pedro Giffuni wrote:
> On 2/23/2017 12:13 PM, Benjamin Kaduk wrote:
> > On Thu, Feb 23, 2017 at 9:30 AM, Pedro F. Giffuni  > > wrote:
> > @@ -632,8 +632,8 @@ void ce_stop_chan (ce_chan_t *c)
> >   "UserRequest (%s:%d)\n",
> > __FUNCTION__, __LINE__));
> > return;
> > }
> > -   req->Command = TAU32_Configure_Commit |
> > -  TAU32_Tx_Stop | TAU32_Rx_Stop;
> > +// req->Command = TAU32_Configure_Commit |
> > +//TAU32_Tx_Stop | TAU32_Rx_Stop;
> >
> > Should probably stick to C-style comments, though.
> 
> They are valid C99 comments but I understand what you mean,

Using comments (regardless of style) for disabling a code block is wrong;
may I suggest `#if 0' instead?  (This also does not hurt `svn blame'.)

./danfe
___
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: r314188 - head/sys/kern

2017-02-23 Thread Warner Losh
Author: imp
Date: Fri Feb 24 01:39:12 2017
New Revision: 314188
URL: https://svnweb.freebsd.org/changeset/base/314188

Log:
  Cast values to (int) before comparing them to the range of the
  enum. This ensures they are in range w/o the warnings.

Modified:
  head/sys/kern/kern_pmc.c

Modified: head/sys/kern/kern_pmc.c
==
--- head/sys/kern/kern_pmc.cFri Feb 24 01:39:08 2017(r314187)
+++ head/sys/kern/kern_pmc.cFri Feb 24 01:39:12 2017(r314188)
@@ -287,8 +287,8 @@ pmc_soft_ev_deregister(struct pmc_soft *
 
if (ps->ps_ev.pm_ev_code != 0 &&
(ps->ps_ev.pm_ev_code - PMC_EV_SOFT_FIRST) < pmc_softevents) {
-   KASSERT(ps->ps_ev.pm_ev_code >= PMC_EV_SOFT_FIRST &&
-   ps->ps_ev.pm_ev_code <= PMC_EV_SOFT_LAST,
+   KASSERT((int)ps->ps_ev.pm_ev_code >= PMC_EV_SOFT_FIRST &&
+   (int)ps->ps_ev.pm_ev_code <= PMC_EV_SOFT_LAST,
("pmc_soft_deregister: invalid event value"));
pmc_softs[ps->ps_ev.pm_ev_code - PMC_EV_SOFT_FIRST] = NULL;
}
@@ -304,8 +304,8 @@ pmc_soft_ev_acquire(enum pmc_event ev)
if (ev == 0 || (ev - PMC_EV_SOFT_FIRST) >= pmc_softevents)
return NULL;
 
-   KASSERT(ev >= PMC_EV_SOFT_FIRST &&
-   ev <= PMC_EV_SOFT_LAST,
+   KASSERT((int)ev >= PMC_EV_SOFT_FIRST &&
+   (int)ev <= PMC_EV_SOFT_LAST,
("event out of range"));
 
mtx_lock_spin(_softs_mtx);
___
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: r314187 - head/sys/kern

2017-02-23 Thread Warner Losh
Author: imp
Date: Fri Feb 24 01:39:08 2017
New Revision: 314187
URL: https://svnweb.freebsd.org/changeset/base/314187

Log:
  KDTRACE_HOOKS isn't guaranteed to be defined. Change to check to see
  if it is defined or not rather than if it is non-zero.
  
  Sponsored by: Netflix, Inc

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Thu Feb 23 23:48:44 2017(r314186)
+++ head/sys/kern/kern_mutex.c  Fri Feb 24 01:39:08 2017(r314187)
@@ -514,7 +514,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
m->lock_object.lo_name, (void *)m->mtx_lock, file, line);
 #ifdef LOCK_PROFILING
doing_lockprof = 1;
-#elif KDTRACE_HOOKS
+#elif defined(KDTRACE_HOOKS)
doing_lockprof = lockstat_enabled;
if (__predict_false(doing_lockprof))
all_time -= lockstat_nsecs(>lock_object);
@@ -720,7 +720,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t
lock_profile_obtain_lock_failed(>lock_object, , );
 #ifdef LOCK_PROFILING
doing_lockprof = 1;
-#elif KDTRACE_HOOKS
+#elif defined(KDTRACE_HOOKS)
doing_lockprof = lockstat_enabled;
if (__predict_false(doing_lockprof))
spin_time -= lockstat_nsecs(>lock_object);
@@ -804,7 +804,7 @@ thread_lock_flags_(struct thread *td, in
 
 #ifdef LOCK_PROFILING
doing_lockprof = 1;
-#elif KDTRACE_HOOKS
+#elif defined(KDTRACE_HOOKS)
doing_lockprof = lockstat_enabled;
if (__predict_false(doing_lockprof))
spin_time -= lockstat_nsecs(>td_lock->lock_object);
___
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: r314142 - head/sys/dev/ce

2017-02-23 Thread Warner Losh
On Thu, Feb 23, 2017 at 5:28 PM, Gleb Smirnoff  wrote:
> On Thu, Feb 23, 2017 at 03:30:21PM +, Pedro F. Giffuni wrote:
> P> Author: pfg
> P> Date: Thu Feb 23 15:30:21 2017
> P> New Revision: 314142
> P> URL: https://svnweb.freebsd.org/changeset/base/314142
> P>
> P> Log:
> P>   dev/ce: double assignment.
> P>
> P>   The code is not operational right now so just comment away an obviously
> P>   useless assignment. Fix some typos while here.
> P>
> P>   Found with: coccinelle (da.cocci)
>
> What is interesting is that vendor still exists and sells the hardware, but
> explicitly says "FreeBSD 7.x isn't supported" :)
>
> http://cronyx.ru/hardware/tau32.html
>
> I don't see any reasons for the driver to get broken between 6.0 and 7.0.

Murray Stokely was the contact for this hardware. I think he gave it
to me years ago, but I just checked and I can't find it in the usual
places. IIRC, they were ISA cards though, not PCI...

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: r314186 - head/sys/arm/at91

2017-02-23 Thread Olivier Houchard
On Thu, Feb 23, 2017 at 07:23:36PM -0500, Pedro Giffuni wrote:
> Hi;
> 
> > Il giorno 23 feb 2017, alle ore 19:05, Ian Lepore  ha 
> > scritto:
> > 
> > On Thu, 2017-02-23 at 23:48 +, Pedro F. Giffuni wrote:
> >> Author: pfg
> >> Date: Thu Feb 23 23:48:44 2017
> >> New Revision: 314186
> >> URL: https://svnweb.freebsd.org/changeset/base/314186
> >> 
> >> Log:
> >>   at91: double assignment.
> >>   
> >>   Found with:  coccinelle (da.cocci)
> >>   Suggested by:cognet
> >> 
> >> Modified:
> >>   head/sys/arm/at91/at91sam9260.c
> >> 
> >> Modified: head/sys/arm/at91/at91sam9260.c
> >> =
> >> =
> >> --- head/sys/arm/at91/at91sam9260.cThu Feb 23 22:46:01 2017
> >> (r314185)
> >> +++ head/sys/arm/at91/at91sam9260.cThu Feb 23 23:48:44 2017
> >> (r314186)
> >> @@ -193,7 +193,6 @@ at91_clock_init(void)
> >> */
> >>clk = at91_pmc_clock_ref("pllb");
> >>clk->pll_min_in= SAM9260_PLL_B_MIN_IN_FREQ; 
> >> /*   1 MHz */
> >> -  clk->pll_max_in= SAM9260_PLL_B_MAX_IN_FREQ; 
> >> /*   5 MHz */
> >>clk->pll_max_in= 299;   
> >> /*  ~3 MHz */
> >>clk->pll_min_out   = SAM9260_PLL_B_MIN_OUT_FREQ;/*  
> >> 70 MHz */
> >>clk->pll_max_out   = SAM9260_PLL_B_MAX_OUT_FREQ;/*
> >> 130 MHz */
> >> 
> > 
> > Just looking at this by eye (but without digging out the at91 manuals)
> > I'd say this looks like fallout from a mismerge and the correct line to
> > keep would be the named constant.  Keeping the one that has actually
> > been in effect all this time isn't the same as keeping the right one,
> > and this deletion may remove the only clue someone might find when they
> > eventually get around to debugging this (if ever, the sam9260 is a
> > pretty old chip).
> > 
> > -- ian
> > 
> > 
> 
> According to SVN annotations it is not a mismerge:. The first line looks more 
> technical but cognet@ stated from the second one is correct and matches the 
> (long) initial comment.
> 
> It???s also what is in effective use now, so I wouldn???t change it unless 
> someone with the hardware confirms first.
> 

As Pedro says, there's a large comment that says :
 * Fudge MAX pll in frequence down below 3.0 MHz to ensure
 * PMC alogrithm choose the divisor that causes the input clock
 * to be near the optimal 2 MHz per datasheet.  We know
 * we are going to be using this for the USB
 * clock at 96 MHz.
 * Causes no extra frequency deviation  for all recommended crystal
 * values.  See Note 1, table 40-16 SAM9260 doc.
 

So I just assumed it was OK. (And it's been that way since the code was
first submitted).

Olivier

___
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: r314142 - head/sys/dev/ce

2017-02-23 Thread Gleb Smirnoff
On Thu, Feb 23, 2017 at 03:30:21PM +, Pedro F. Giffuni wrote:
P> Author: pfg
P> Date: Thu Feb 23 15:30:21 2017
P> New Revision: 314142
P> URL: https://svnweb.freebsd.org/changeset/base/314142
P> 
P> Log:
P>   dev/ce: double assignment.
P>   
P>   The code is not operational right now so just comment away an obviously
P>   useless assignment. Fix some typos while here.
P>   
P>   Found with: coccinelle (da.cocci)

What is interesting is that vendor still exists and sells the hardware, but
explicitly says "FreeBSD 7.x isn't supported" :)

http://cronyx.ru/hardware/tau32.html

I don't see any reasons for the driver to get broken between 6.0 and 7.0.

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


Re: svn commit: r314186 - head/sys/arm/at91

2017-02-23 Thread Pedro Giffuni
Hi;

> Il giorno 23 feb 2017, alle ore 19:05, Ian Lepore  ha 
> scritto:
> 
> On Thu, 2017-02-23 at 23:48 +, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Thu Feb 23 23:48:44 2017
>> New Revision: 314186
>> URL: https://svnweb.freebsd.org/changeset/base/314186
>> 
>> Log:
>>   at91: double assignment.
>>   
>>   Found with:coccinelle (da.cocci)
>>   Suggested by:  cognet
>> 
>> Modified:
>>   head/sys/arm/at91/at91sam9260.c
>> 
>> Modified: head/sys/arm/at91/at91sam9260.c
>> =
>> =
>> --- head/sys/arm/at91/at91sam9260.c  Thu Feb 23 22:46:01 2017
>> (r314185)
>> +++ head/sys/arm/at91/at91sam9260.c  Thu Feb 23 23:48:44 2017
>> (r314186)
>> @@ -193,7 +193,6 @@ at91_clock_init(void)
>>   */
>>  clk = at91_pmc_clock_ref("pllb");
>>  clk->pll_min_in= SAM9260_PLL_B_MIN_IN_FREQ; 
>> /*   1 MHz */
>> -clk->pll_max_in= SAM9260_PLL_B_MAX_IN_FREQ; 
>> /*   5 MHz */
>>  clk->pll_max_in= 299;   
>> /*  ~3 MHz */
>>  clk->pll_min_out   = SAM9260_PLL_B_MIN_OUT_FREQ;/*  
>> 70 MHz */
>>  clk->pll_max_out   = SAM9260_PLL_B_MAX_OUT_FREQ;/*
>> 130 MHz */
>> 
> 
> Just looking at this by eye (but without digging out the at91 manuals)
> I'd say this looks like fallout from a mismerge and the correct line to
> keep would be the named constant.  Keeping the one that has actually
> been in effect all this time isn't the same as keeping the right one,
> and this deletion may remove the only clue someone might find when they
> eventually get around to debugging this (if ever, the sam9260 is a
> pretty old chip).
> 
> -- ian
> 
> 

According to SVN annotations it is not a mismerge:. The first line looks more 
technical but cognet@ stated from the second one is correct and matches the 
(long) initial comment.

It’s also what is in effective use now, so I wouldn’t change it unless someone 
with the hardware confirms first.

Pedro.

___
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: r314186 - head/sys/arm/at91

2017-02-23 Thread Warner Losh
On Thu, Feb 23, 2017 at 5:05 PM, Ian Lepore  wrote:
> On Thu, 2017-02-23 at 23:48 +, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Thu Feb 23 23:48:44 2017
>> New Revision: 314186
>> URL: https://svnweb.freebsd.org/changeset/base/314186
>>
>> Log:
>>   at91: double assignment.
>>
>>   Found with: coccinelle (da.cocci)
>>   Suggested by:   cognet
>>
>> Modified:
>>   head/sys/arm/at91/at91sam9260.c
>>
>> Modified: head/sys/arm/at91/at91sam9260.c
>> =
>> =
>> --- head/sys/arm/at91/at91sam9260.c   Thu Feb 23 22:46:01 2017
>> (r314185)
>> +++ head/sys/arm/at91/at91sam9260.c   Thu Feb 23 23:48:44 2017
>> (r314186)
>> @@ -193,7 +193,6 @@ at91_clock_init(void)
>>*/
>>   clk = at91_pmc_clock_ref("pllb");
>>   clk->pll_min_in= SAM9260_PLL_B_MIN_IN_FREQ;
>> /*   1 MHz */
>> - clk->pll_max_in= SAM9260_PLL_B_MAX_IN_FREQ;
>> /*   5 MHz */
>>   clk->pll_max_in= 299;
>> /*  ~3 MHz */
>>   clk->pll_min_out   = SAM9260_PLL_B_MIN_OUT_FREQ;/*
>> 70 MHz */
>>   clk->pll_max_out   = SAM9260_PLL_B_MAX_OUT_FREQ;/*
>> 130 MHz */
>>
>
> Just looking at this by eye (but without digging out the at91 manuals)
> I'd say this looks like fallout from a mismerge and the correct line to
> keep would be the named constant.  Keeping the one that has actually
> been in effect all this time isn't the same as keeping the right one,
> and this deletion may remove the only clue someone might find when they
> eventually get around to debugging this (if ever, the sam9260 is a
> pretty old chip).

I was going to test boot on my SAM9260EK board since I had the same
thought, but wasn't completely sure.

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: r314186 - head/sys/arm/at91

2017-02-23 Thread Ian Lepore
On Thu, 2017-02-23 at 23:48 +, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Thu Feb 23 23:48:44 2017
> New Revision: 314186
> URL: https://svnweb.freebsd.org/changeset/base/314186
> 
> Log:
>   at91: double assignment.
>   
>   Found with: coccinelle (da.cocci)
>   Suggested by:   cognet
> 
> Modified:
>   head/sys/arm/at91/at91sam9260.c
> 
> Modified: head/sys/arm/at91/at91sam9260.c
> =
> =
> --- head/sys/arm/at91/at91sam9260.c   Thu Feb 23 22:46:01 2017
> (r314185)
> +++ head/sys/arm/at91/at91sam9260.c   Thu Feb 23 23:48:44 2017
> (r314186)
> @@ -193,7 +193,6 @@ at91_clock_init(void)
>    */
>   clk = at91_pmc_clock_ref("pllb");
>   clk->pll_min_in= SAM9260_PLL_B_MIN_IN_FREQ; 
> /*   1 MHz */
> - clk->pll_max_in= SAM9260_PLL_B_MAX_IN_FREQ; 
> /*   5 MHz */
>   clk->pll_max_in= 299;   
> /*  ~3 MHz */
>   clk->pll_min_out   = SAM9260_PLL_B_MIN_OUT_FREQ;/*  
> 70 MHz */
>   clk->pll_max_out   = SAM9260_PLL_B_MAX_OUT_FREQ;/*
> 130 MHz */
> 

Just looking at this by eye (but without digging out the at91 manuals)
I'd say this looks like fallout from a mismerge and the correct line to
keep would be the named constant.  Keeping the one that has actually
been in effect all this time isn't the same as keeping the right one,
and this deletion may remove the only clue someone might find when they
eventually get around to debugging this (if ever, the sam9260 is a
pretty old chip).

-- ian

___
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: r314186 - head/sys/arm/at91

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 23:48:44 2017
New Revision: 314186
URL: https://svnweb.freebsd.org/changeset/base/314186

Log:
  at91: double assignment.
  
  Found with:   coccinelle (da.cocci)
  Suggested by: cognet

Modified:
  head/sys/arm/at91/at91sam9260.c

Modified: head/sys/arm/at91/at91sam9260.c
==
--- head/sys/arm/at91/at91sam9260.c Thu Feb 23 22:46:01 2017
(r314185)
+++ head/sys/arm/at91/at91sam9260.c Thu Feb 23 23:48:44 2017
(r314186)
@@ -193,7 +193,6 @@ at91_clock_init(void)
 */
clk = at91_pmc_clock_ref("pllb");
clk->pll_min_in= SAM9260_PLL_B_MIN_IN_FREQ; /*   1 MHz */
-   clk->pll_max_in= SAM9260_PLL_B_MAX_IN_FREQ; /*   5 MHz */
clk->pll_max_in= 299;   /*  ~3 MHz */
clk->pll_min_out   = SAM9260_PLL_B_MIN_OUT_FREQ;/*  70 MHz */
clk->pll_max_out   = SAM9260_PLL_B_MAX_OUT_FREQ;/* 130 MHz */
___
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: r314179 - in head: contrib/netbsd-tests/lib/librt include lib/libc/gen lib/libc/include share/man/man3 sys/kern

2017-02-23 Thread Ngie Cooper
On Thu, Feb 23, 2017 at 11:36 AM, Eric van Gyzen  wrote:
> Author: vangyzen
> Date: Thu Feb 23 19:36:38 2017
> New Revision: 314179
> URL: https://svnweb.freebsd.org/changeset/base/314179
>
> Log:
>   Add sem_clockwait_np()
>
>   This function allows the caller to specify the reference clock
>   and choose between absolute and relative mode.  In relative mode,
>   the remaining time can be returned.
>
>   The API is similar to clock_nanosleep(3).  Thanks to Ed Schouten
>   for that suggestion.
>
>   While I'm here, reduce the sleep time in the semaphore "child"
>   test to greatly reduce its runtime.  Also add a reasonable timeout.
>
>   Reviewed by:  ed (userland)
>   MFC after:2 weeks
>   Relnotes: yes
>   Sponsored by: Dell EMC
>   Differential Revision:https://reviews.freebsd.org/D9656
>
> Modified:
>   head/contrib/netbsd-tests/lib/librt/t_sem.c
>   head/include/semaphore.h
>   head/lib/libc/gen/Makefile.inc
>   head/lib/libc/gen/Symbol.map
>   head/lib/libc/gen/sem_new.c
>   head/lib/libc/gen/sem_timedwait.3
>   head/lib/libc/include/namespace.h
>   head/lib/libc/include/un-namespace.h
>   head/share/man/man3/pthread_testcancel.3
>   head/sys/kern/kern_umtx.c
>
> Modified: head/contrib/netbsd-tests/lib/librt/t_sem.c

...

*sigh* I really wish people would read MAINTAINERS and include me on
CRs to contrib/netbsd-tests/ (especially since I spent a few weekends
cleaning this up to diff reduce and contribute back changes to
NetBSD).
Thanks,
-Ngie
___
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: r314185 - head/sys/kern

2017-02-23 Thread Mateusz Guzik
Author: mjg
Date: Thu Feb 23 22:46:01 2017
New Revision: 314185
URL: https://svnweb.freebsd.org/changeset/base/314185

Log:
  mtx: microoptimize lockstat handling in spin mutexes and thread lock
  
  While here make the code compilablle on kernels with LOCK_PROFILING but 
without
  KDTRACE_HOOKS.

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Thu Feb 23 22:10:37 2017(r314184)
+++ head/sys/kern/kern_mutex.c  Thu Feb 23 22:46:01 2017(r314185)
@@ -468,7 +468,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
u_int sleep_cnt = 0;
int64_t sleep_time = 0;
int64_t all_time = 0;
-   int doing_lockstat;
+#endif
+#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+   int doing_lockprof;
 #endif
 
if (SCHEDULER_STOPPED())
@@ -510,13 +512,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
CTR4(KTR_LOCK,
"_mtx_lock_sleep: %s contested (lock=%p) at %s:%d",
m->lock_object.lo_name, (void *)m->mtx_lock, file, line);
-#ifdef KDTRACE_HOOKS
 #ifdef LOCK_PROFILING
-   doing_lockstat = 1;
-#else
-   doing_lockstat = lockstat_enabled;
-#endif
-   if (__predict_false(doing_lockstat))
+   doing_lockprof = 1;
+#elif KDTRACE_HOOKS
+   doing_lockprof = lockstat_enabled;
+   if (__predict_false(doing_lockprof))
all_time -= lockstat_nsecs(>lock_object);
 #endif
 
@@ -631,9 +631,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
m->lock_object.lo_name, (void *)tid, file, line);
}
 #endif
-#ifdef KDTRACE_HOOKS
-   if (__predict_true(!doing_lockstat))
+#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+   if (__predict_true(!doing_lockprof))
return;
+#endif
+#ifdef KDTRACE_HOOKS
all_time += lockstat_nsecs(>lock_object);
 #endif
LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested,
@@ -689,6 +691,9 @@ _mtx_lock_spin_cookie(volatile uintptr_t
 #ifdef KDTRACE_HOOKS
int64_t spin_time = 0;
 #endif
+#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+   int doing_lockprof;
+#endif
 
if (SCHEDULER_STOPPED())
return;
@@ -713,8 +718,12 @@ _mtx_lock_spin_cookie(volatile uintptr_t
PMC_SOFT_CALL( , , lock, failed);
 #endif
lock_profile_obtain_lock_failed(>lock_object, , );
-#ifdef KDTRACE_HOOKS
-   spin_time -= lockstat_nsecs(>lock_object);
+#ifdef LOCK_PROFILING
+   doing_lockprof = 1;
+#elif KDTRACE_HOOKS
+   doing_lockprof = lockstat_enabled;
+   if (__predict_false(doing_lockprof))
+   spin_time -= lockstat_nsecs(>lock_object);
 #endif
for (;;) {
if (v == MTX_UNOWNED) {
@@ -740,18 +749,22 @@ _mtx_lock_spin_cookie(volatile uintptr_t
} while (v != MTX_UNOWNED);
spinlock_enter();
}
-#ifdef KDTRACE_HOOKS
-   spin_time += lockstat_nsecs(>lock_object);
-#endif
 
if (LOCK_LOG_TEST(>lock_object, opts))
CTR1(KTR_LOCK, "_mtx_lock_spin: %p spin done", m);
KTR_STATE0(KTR_SCHED, "thread", sched_tdname((struct thread *)tid),
"running");
 
+#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+   if (__predict_true(!doing_lockprof))
+   return;
+#endif
 #ifdef KDTRACE_HOOKS
+   spin_time += lockstat_nsecs(>lock_object);
+#endif
LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m,
contested, waittime, file, line);
+#ifdef KDTRACE_HOOKS
if (spin_time != 0)
LOCKSTAT_RECORD1(spin__spin, m, spin_time);
 #endif
@@ -771,6 +784,9 @@ thread_lock_flags_(struct thread *td, in
 #ifdef KDTRACE_HOOKS
int64_t spin_time = 0;
 #endif
+#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+   int doing_lockprof = 1;
+#endif
 
tid = (uintptr_t)curthread;
 
@@ -786,8 +802,12 @@ thread_lock_flags_(struct thread *td, in
 
lock_delay_arg_init(, _spin_delay);
 
-#ifdef KDTRACE_HOOKS
-   spin_time -= lockstat_nsecs(>td_lock->lock_object);
+#ifdef LOCK_PROFILING
+   doing_lockprof = 1;
+#elif KDTRACE_HOOKS
+   doing_lockprof = lockstat_enabled;
+   if (__predict_false(doing_lockprof))
+   spin_time -= lockstat_nsecs(>td_lock->lock_object);
 #endif
for (;;) {
 retry:
@@ -843,15 +863,20 @@ retry:
break;
__mtx_unlock_spin(m);   /* does spinlock_exit() */
}
+   LOCK_LOG_LOCK("LOCK", >lock_object, opts, m->mtx_recurse, file,
+   line);
+   WITNESS_LOCK(>lock_object, opts | LOP_EXCLUSIVE, file, line);
+
+#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+   if (__predict_true(!doing_lockprof))
+   return;
+#endif
 #ifdef KDTRACE_HOOKS
spin_time += lockstat_nsecs(>lock_object);
 #endif
if (m->mtx_recurse == 0)

svn commit: r314183 - head/share/man/man4

2017-02-23 Thread Andriy Gapon
Author: avg
Date: Thu Feb 23 22:08:35 2017
New Revision: 314183
URL: https://svnweb.freebsd.org/changeset/base/314183

Log:
  add jedec_ts.4 to the list of manual pages
  
  Reported by:  rpokala
  MFC after:3 days

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Feb 23 21:54:16 2017
(r314182)
+++ head/share/man/man4/MakefileThu Feb 23 22:08:35 2017
(r314183)
@@ -241,6 +241,7 @@ MAN=aac.4 \
ixgbe.4 \
ixl.4 \
ixlv.4 \
+   jedec_ts.4 \
jme.4 \
joy.4 \
kbdmux.4 \
___
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: r314151 - head/sys/modules/iwm

2017-02-23 Thread Adrian Chadd
thanks! was busy in meetings this morning :(


-a


On 23 February 2017 at 09:47, Ngie Cooper (yaneurabeya)
 wrote:
>
>> On Feb 23, 2017, at 09:44, Ngie Cooper  wrote:
>>
>> Author: ngie
>> Date: Thu Feb 23 17:44:06 2017
>> New Revision: 314151
>> URL: https://svnweb.freebsd.org/changeset/base/314151
>>
>> Log:
>>  Unbreak if_iwm.ko after r314076
>>
>>  Add if_iwm_7000.c/if_iwm_8000.c to SRCS to match similar additions made
>>  to sys/conf/files after refactoring done in the commit noted.
>>
>>  PR:  217308
>>  Pointyhat to:adrian
>>  Submitted by:Andreas Nilsson 
>>  Reported by: Jakob Alvermark , Juan Ramómon Molina 
>> Menor 
>
> Ugh… that didn’t come out as expected after the UTF-8 conversion >_>...
___
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: r314181 - head/sbin/ifconfig

2017-02-23 Thread Adrian Chadd
Author: adrian
Date: Thu Feb 23 20:49:17 2017
New Revision: 314181
URL: https://svnweb.freebsd.org/changeset/base/314181

Log:
  [ifconfig] handle illegal WPS frames
  
  Some APs broadcast WPS IE frames with totally broken data.  Ifconfig's 
printwpsie()
  loops through WPS frames printing the attributes out; if the frame's data is 
bad,
  printwpsie() can end up looking at out-of-bounds addresses causing ifconfig to
  bus error.
  
  Thanks to Takashi Inoue at Nihon U for his efforts in debugging this.
  
  PR:   bin/217312
  Submitted by: f...@opal.com
  MFC after:1 week

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==
--- head/sbin/ifconfig/ifieee80211.cThu Feb 23 20:41:55 2017
(r314180)
+++ head/sbin/ifconfig/ifieee80211.cThu Feb 23 20:49:17 2017
(r314181)
@@ -3160,6 +3160,14 @@ printwpsie(const char *tag, const u_int8
uint16_t tlv_type = BE_READ_2(ie);
uint16_t tlv_len  = BE_READ_2(ie + 2);
 
+   /* some devices broadcast invalid WPS frames */
+   if (tlv_len > len) {
+   printf("bad frame length tlv_type=0x%02x "
+   "tlv_len=%d len=%d", tlv_type, tlv_len,
+   len);
+   break;
+   }
+
ie += 4, len -= 4;
 
switch (tlv_type) {
___
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: r314180 - head/sys/mips/conf

2017-02-23 Thread Brooks Davis
Author: brooks
Date: Thu Feb 23 20:41:55 2017
New Revision: 314180
URL: https://svnweb.freebsd.org/changeset/base/314180

Log:
  Fix and shorten BERI kernel builds during universe.
  
  Stop building BERI_DE4_BASE and BERI_SIM_BASE, they aren't particularly
  valid as they don't have a root dev.  Do build BERI_DE4_SDROOT which
  does so devices get coverage.
  
  Remove ident from BERI_DE4_BASE for the reasons above which will cause
  it to fail to build.  BERI_SIM_BASE was already this way and broke
  universe.[0]
  
  Reported by:  rpokala
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/mips/conf/BERI_DE4_BASE
  head/sys/mips/conf/BERI_DE4_SDROOT
  head/sys/mips/conf/BERI_SIM_BASE

Modified: head/sys/mips/conf/BERI_DE4_BASE
==
--- head/sys/mips/conf/BERI_DE4_BASEThu Feb 23 19:36:38 2017
(r314179)
+++ head/sys/mips/conf/BERI_DE4_BASEThu Feb 23 20:41:55 2017
(r314180)
@@ -7,9 +7,9 @@
 # $FreeBSD$
 #
 
-include "std.BERI"
+#NO_UNIVERSE
 
-ident  BERI_DE4_BASE
+include "std.BERI"
 
 optionsNFSCL   # Network Filesystem Client
 optionsNFSLOCKD# Network Lock Manager

Modified: head/sys/mips/conf/BERI_DE4_SDROOT
==
--- head/sys/mips/conf/BERI_DE4_SDROOT  Thu Feb 23 19:36:38 2017
(r314179)
+++ head/sys/mips/conf/BERI_DE4_SDROOT  Thu Feb 23 20:41:55 2017
(r314180)
@@ -6,8 +6,6 @@
 # $FreeBSD$
 #
 
-#NO_UNIVERSE
-
 include "BERI_DE4_BASE"
 
 ident  BERI_DE4_SDROOT

Modified: head/sys/mips/conf/BERI_SIM_BASE
==
--- head/sys/mips/conf/BERI_SIM_BASEThu Feb 23 19:36:38 2017
(r314179)
+++ head/sys/mips/conf/BERI_SIM_BASEThu Feb 23 20:41:55 2017
(r314180)
@@ -6,6 +6,8 @@
 # $FreeBSD$
 #
 
+#NO_UNIVERSE
+
 include "std.BERI"
 
 optionsFDT
___
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: r314155 - head/sys/netinet

2017-02-23 Thread Steven Hartland
You might also be interested in reviewing my fix for TCP buffer scaling 
too Michael.

https://reviews.freebsd.org/D9668

This fixes slow transfers due to no receive buffer scaling if TCP 
timestamps aren't negotiated.


Its still got debug stuff in it ATM and I'm toying with removing the 
different cases between estimated RTT and timestamps as there appears to 
be no difference in practice.


Tests here show jump from ~3MB/s @ 1Gbps and 17ms latency to 100MB/s, 
pretty much line rate, which is in line with Linux results.


Any feedback welcome.

Regards
Steve

On 23/02/2017 18:14, Michael Tuexen wrote:

Author: tuexen
Date: Thu Feb 23 18:14:36 2017
New Revision: 314155
URL: https://svnweb.freebsd.org/changeset/base/314155

Log:
   TCP window updates are only sent if the window can be increased by at
   least 2 * MSS. However, if the receive buffer size is small, this might
   be impossible. Add back a criterion to send a TCP window update if
   the window can be increased by at least half of the receive buffer size.
   This condition was removed in r242252. This patch simply brings it back.
   PR:  211003
   Reviewed by: gnn
   MFC after:   1 week
   Sponsored by:Netflix, Inc.
   Differential Revision:   https://reviews.freebsd.org/D9475

Modified:
   head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu Feb 23 17:56:24 2017
(r314154)
+++ head/sys/netinet/tcp_output.c   Thu Feb 23 18:14:36 2017
(r314155)
@@ -696,6 +696,8 @@ after_sack_rexmit:
 recwin <= (so->so_rcv.sb_hiwat / 8) ||
 so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg))
goto send;
+   if (2 * adv >= (int32_t)so->so_rcv.sb_hiwat)
+   goto send;
}
  dontupdate:
  



___
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: r314179 - in head: contrib/netbsd-tests/lib/librt include lib/libc/gen lib/libc/include share/man/man3 sys/kern

2017-02-23 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Feb 23 19:36:38 2017
New Revision: 314179
URL: https://svnweb.freebsd.org/changeset/base/314179

Log:
  Add sem_clockwait_np()
  
  This function allows the caller to specify the reference clock
  and choose between absolute and relative mode.  In relative mode,
  the remaining time can be returned.
  
  The API is similar to clock_nanosleep(3).  Thanks to Ed Schouten
  for that suggestion.
  
  While I'm here, reduce the sleep time in the semaphore "child"
  test to greatly reduce its runtime.  Also add a reasonable timeout.
  
  Reviewed by:  ed (userland)
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D9656

Modified:
  head/contrib/netbsd-tests/lib/librt/t_sem.c
  head/include/semaphore.h
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/sem_new.c
  head/lib/libc/gen/sem_timedwait.3
  head/lib/libc/include/namespace.h
  head/lib/libc/include/un-namespace.h
  head/share/man/man3/pthread_testcancel.3
  head/sys/kern/kern_umtx.c

Modified: head/contrib/netbsd-tests/lib/librt/t_sem.c
==
--- head/contrib/netbsd-tests/lib/librt/t_sem.c Thu Feb 23 19:32:25 2017
(r314178)
+++ head/contrib/netbsd-tests/lib/librt/t_sem.c Thu Feb 23 19:36:38 2017
(r314179)
@@ -60,18 +60,24 @@ __COPYRIGHT("@(#) Copyright (c) 2008, 20
  The NetBSD Foundation, inc. All rights reserved.");
 __RCSID("$NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $");
 
+#include 
 #include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
 
 #define NCHILDREN 10
 
+#define SEM_REQUIRE(x) \
+   ATF_REQUIRE_EQ_MSG(x, 0, "%s", strerror(errno))
+
 ATF_TC_WITH_CLEANUP(basic);
 ATF_TC_HEAD(basic, tc)
 {
@@ -118,6 +124,7 @@ ATF_TC_HEAD(child, tc)
 {
atf_tc_set_md_var(tc, "descr", "Checks using semaphores to synchronize "
"parent with multiple child processes");
+   atf_tc_set_md_var(tc, "timeout", "5");
 }
 ATF_TC_BODY(child, tc)
 {
@@ -153,7 +160,7 @@ ATF_TC_BODY(child, tc)
}
 
for (i = 0; i < NCHILDREN; i++) {
-   sleep(1);
+   usleep(10);
printf("main loop %d: posting...\n", j);
ATF_REQUIRE_EQ(sem_post(sem_a), 0);
}
@@ -173,11 +180,151 @@ ATF_TC_CLEANUP(child, tc)
(void)sem_unlink("/sem_a");
 }
 
+static inline void
+timespec_add_ms(struct timespec *ts, int ms)
+{
+   ts->tv_nsec += ms * 1000*1000;
+   if (ts->tv_nsec > 1000*1000*1000) {
+   ts->tv_sec++;
+   ts->tv_nsec -= 1000*1000*1000;
+   }
+}
+
+volatile sig_atomic_t got_sigalrm = 0;
+
+static void
+sigalrm_handler(int sig __unused)
+{
+   got_sigalrm = 1;
+}
+
+ATF_TC(timedwait);
+ATF_TC_HEAD(timedwait, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests sem_timedwait(3)"
+#ifdef __FreeBSD__
+   " and sem_clockwait_np(3)"
+#endif
+   );
+   atf_tc_set_md_var(tc, "timeout", "20");
+}
+ATF_TC_BODY(timedwait, tc)
+{
+   struct timespec ts;
+   sem_t sem;
+   int result;
+
+   SEM_REQUIRE(sem_init(, 0, 0));
+   SEM_REQUIRE(sem_post());
+   ATF_REQUIRE_MSG(clock_gettime(CLOCK_REALTIME, ) == 0,
+   "%s", strerror(errno));
+timespec_add_ms(, 100);
+   SEM_REQUIRE(sem_timedwait(, ));
+   ATF_REQUIRE_ERRNO(ETIMEDOUT, sem_timedwait(, ));
+ts.tv_sec--;
+   ATF_REQUIRE_ERRNO(ETIMEDOUT, sem_timedwait(, ));
+   SEM_REQUIRE(sem_post());
+   SEM_REQUIRE(sem_timedwait(, ));
+
+   /* timespec validation, in the past */
+   ts.tv_nsec += 1000*1000*1000;
+   ATF_REQUIRE_ERRNO(EINVAL, sem_timedwait(, ));
+   ts.tv_nsec = -1;
+   ATF_REQUIRE_ERRNO(EINVAL, sem_timedwait(, ));
+   /* timespec validation, in the future */
+   ATF_REQUIRE_MSG(clock_gettime(CLOCK_REALTIME, ) == 0,
+   "%s", strerror(errno));
+   ts.tv_sec++;
+   ts.tv_nsec = 1000*1000*1000;
+   ATF_REQUIRE_ERRNO(EINVAL, sem_timedwait(, ));
+   ts.tv_nsec = -1;
+   ATF_REQUIRE_ERRNO(EINVAL, sem_timedwait(, ));
+
+   /* EINTR */
+   struct sigaction act = {
+   .sa_handler = sigalrm_handler,
+   .sa_flags = 0   /* not SA_RESTART */
+   };
+   ATF_REQUIRE_MSG(sigemptyset(_mask) == 0,
+   "%s", strerror(errno));
+   ATF_REQUIRE_MSG(sigaction(SIGALRM, , NULL) == 0,
+   "%s", strerror(errno));
+   struct itimerval it = {
+   .it_value.tv_usec = 50*1000
+   };
+   ATF_REQUIRE_MSG(setitimer(ITIMER_REAL, , NULL) == 0,
+   "%s", strerror(errno));
+   ATF_REQUIRE_MSG(clock_gettime(CLOCK_REALTIME, ) == 0,
+   "%s", strerror(errno));
+timespec_add_ms(, 100);
+   ATF_REQUIRE_ERRNO(EINTR, sem_timedwait(, ));
+   

svn commit: r314176 - head/contrib/ofed/libcxgb4/src

2017-02-23 Thread Navdeep Parhar
Author: np
Date: Thu Feb 23 19:21:47 2017
New Revision: 314176
URL: https://svnweb.freebsd.org/changeset/base/314176

Log:
  Add support for RDMA from userspace with T6 cards.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  Sponsored by: Chelsio Communications

Modified:
  head/contrib/ofed/libcxgb4/src/dev.c
  head/contrib/ofed/libcxgb4/src/qp.c
  head/contrib/ofed/libcxgb4/src/t4.h
  head/contrib/ofed/libcxgb4/src/t4_chip_type.h
  head/contrib/ofed/libcxgb4/src/t4_pci_id_tbl.h
  head/contrib/ofed/libcxgb4/src/t4_regs.h
  head/contrib/ofed/libcxgb4/src/verbs.c

Modified: head/contrib/ofed/libcxgb4/src/dev.c
==
--- head/contrib/ofed/libcxgb4/src/dev.cThu Feb 23 19:14:16 2017
(r314175)
+++ head/contrib/ofed/libcxgb4/src/dev.cThu Feb 23 19:21:47 2017
(r314176)
@@ -145,10 +145,10 @@ static struct ibv_context *c4iw_alloc_co
context->ibv_ctx.ops = c4iw_ctx_ops;
 
switch (rhp->chip_version) {
+   case CHELSIO_T6:
case CHELSIO_T5:
-   PDBG("%s T5/T4 device\n", __FUNCTION__);
case CHELSIO_T4:
-   PDBG("%s T4 device\n", __FUNCTION__);
+   PDBG("%s T%d device\n", __FUNCTION__, rhp->chip_version);
context->ibv_ctx.ops.async_event = c4iw_async_event;
context->ibv_ctx.ops.post_send = c4iw_post_send;
context->ibv_ctx.ops.post_recv = c4iw_post_receive;
@@ -390,29 +390,26 @@ static struct ibv_device *cxgb4_driver_i
int abi_version)
 {
char devstr[IBV_SYSFS_PATH_MAX], ibdev[16], value[128], *cp;
-   char t5nexstr[IBV_SYSFS_PATH_MAX];
+   char dev_str[IBV_SYSFS_PATH_MAX];
struct c4iw_dev *dev;
unsigned vendor, device, fw_maj, fw_min;
int i;
-   char devnum=0;
+   char devnum;
 char ib_param[16];
 
 #ifndef __linux__
if (ibv_read_sysfs_file(uverbs_sys_path, "ibdev",
ibdev, sizeof ibdev) < 0)
return NULL;
-   /* 
-* Extract the non-numeric part of ibdev
-* say "t5nex0" -> devname=="t5nex", devnum=0
-*/
-   if (strstr(ibdev,"t5nex")) {
-   devnum = atoi(ibdev+strlen("t5nex"));
-   sprintf(t5nexstr, "/dev/t5nex/%d", devnum);
+
+   if (ibdev[0] == 't' && ibdev[1] >= '4' && ibdev[1] <= '6' &&
+   strstr([2], "nex") && (devnum = atoi([5])) >= 0) {
+   snprintf(dev_str, sizeof(dev_str), "/dev/t%cnex/%d", ibdev[1],
+   devnum);
} else
return NULL;
 
-   if (ibv_read_sysfs_file(t5nexstr, "\%pnpinfo",
-   value, sizeof value) < 0)
+   if (ibv_read_sysfs_file(dev_str, "\%pnpinfo", value, sizeof value) < 0)
return NULL;
else {
if (strstr(value,"vendor=")) {
@@ -449,7 +446,7 @@ found:
 
 
 #ifndef __linux__
-   if (ibv_read_sysfs_file(t5nexstr, "firmware_version",
+   if (ibv_read_sysfs_file(dev_str, "firmware_version",
value, sizeof value) < 0)
return NULL;
 #else

Modified: head/contrib/ofed/libcxgb4/src/qp.c
==
--- head/contrib/ofed/libcxgb4/src/qp.c Thu Feb 23 19:14:16 2017
(r314175)
+++ head/contrib/ofed/libcxgb4/src/qp.c Thu Feb 23 19:21:47 2017
(r314176)
@@ -393,7 +393,7 @@ int c4iw_post_send(struct ibv_qp *ibqp, 
idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE);
}
 
-   t4_ring_sq_db(>wq, idx, dev_is_t5(qhp->rhp),
+   t4_ring_sq_db(>wq, idx, dev_is_t4(qhp->rhp),
len16, wqe);
qhp->wq.sq.queue[qhp->wq.sq.size].status.host_wq_pidx = \
(qhp->wq.sq.wq_pidx);
@@ -457,7 +457,7 @@ int c4iw_post_receive(struct ibv_qp *ibq
num_wrs--;
}
 
-   t4_ring_rq_db(>wq, idx, dev_is_t5(qhp->rhp),
+   t4_ring_rq_db(>wq, idx, dev_is_t4(qhp->rhp),
len16, wqe);
qhp->wq.rq.queue[qhp->wq.rq.size].status.host_wq_pidx = \
(qhp->wq.rq.wq_pidx);

Modified: head/contrib/ofed/libcxgb4/src/t4.h
==
--- head/contrib/ofed/libcxgb4/src/t4.h Thu Feb 23 19:14:16 2017
(r314175)
+++ head/contrib/ofed/libcxgb4/src/t4.h Thu Feb 23 19:21:47 2017
(r314176)
@@ -484,11 +484,11 @@ static void copy_wqe_to_udb(volatile u32
 extern int ma_wr;
 extern int t5_en_wc;
 
-static inline void t4_ring_sq_db(struct t4_wq *wq, u16 inc, u8 t5, u8 len16,
+static inline void t4_ring_sq_db(struct t4_wq *wq, u16 inc, u8 t4, u8 len16,
 union t4_wr *wqe)
 {
wc_wmb();
-   if (t5) {
+   if (!t4) {
if (t5_en_wc && inc == 1 && wq->sq.wc_reg_available) {
   

svn commit: r314167 - head/sys/dev/cxgbe/iw_cxgbe

2017-02-23 Thread Navdeep Parhar
Author: np
Date: Thu Feb 23 19:02:40 2017
New Revision: 314167
URL: https://svnweb.freebsd.org/changeset/base/314167

Log:
  cxgbe/iw_cxgbe: Minor changes for T6.
  
  Submitted by: Krishnamraju Eraparaju at Chelsio
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/device.c
  head/sys/dev/cxgbe/iw_cxgbe/mem.c
  head/sys/dev/cxgbe/iw_cxgbe/provider.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/device.cThu Feb 23 19:02:31 2017
(r314166)
+++ head/sys/dev/cxgbe/iw_cxgbe/device.cThu Feb 23 19:02:40 2017
(r314167)
@@ -330,7 +330,7 @@ c4iw_modevent(module_t mod, int cmd, voi
case MOD_LOAD:
rc = c4iw_mod_load();
if (rc == 0)
-   printf("iw_cxgbe: Chelsio T4/T5 RDMA driver loaded.\n");
+   printf("iw_cxgbe: Chelsio T4/T5/T6 RDMA driver 
loaded.\n");
break;
 
case MOD_UNLOAD:

Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/mem.c   Thu Feb 23 19:02:31 2017
(r314166)
+++ head/sys/dev/cxgbe/iw_cxgbe/mem.c   Thu Feb 23 19:02:40 2017
(r314167)
@@ -46,11 +46,11 @@ __FBSDID("$FreeBSD$");
 #define T4_ULPTX_MIN_IO 32
 #define C4IW_MAX_INLINE_SIZE 96
 
-static int mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length)
+static int
+mr_exceeds_hw_limits(struct c4iw_dev *dev __unused, u64 length)
 {
-   return (is_t4(dev->rdev.adap) ||
-   is_t5(dev->rdev.adap)) &&
-   length >= 8*1024*1024*1024ULL;
+
+   return (length >= 8*1024*1024*1024ULL);
 }
 static int
 write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data)

Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/provider.c  Thu Feb 23 19:02:31 2017
(r314166)
+++ head/sys/dev/cxgbe/iw_cxgbe/provider.c  Thu Feb 23 19:02:40 2017
(r314167)
@@ -190,7 +190,7 @@ static int c4iw_mmap(struct ib_ucontext 
"%s:6 USER DB-GTS addr %p region %p, reglen %u",
__func__, addr, va_udbs_res, len_udbs_res);
 #ifdef DOT5
-   if (is_t5(rdev->lldi.adapter_type) && map_udb_as_wc)
+   if (!is_t4(rdev->lldi.adapter_type) && map_udb_as_wc)
vma->vm_page_prot = 
t4_pgprot_wc(vma->vm_page_prot);
else
 #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"


Re: svn commit: r314145 - in head/sys/dev/vxge: . vxgehal

2017-02-23 Thread Pedro Giffuni



On 02/23/17 13:16, John Baldwin wrote:

On Thursday, February 23, 2017 04:10:16 PM Pedro F. Giffuni wrote:

Author: pfg
Date: Thu Feb 23 16:10:15 2017
New Revision: 314145
URL: https://svnweb.freebsd.org/changeset/base/314145

Log:
  dev/vxe: double assignments.

  Fix some suspicious code, likely caused by excessive copy-pasting.

  Found with:   coccinelle (da.cocci)
  MFC after:2 weeks

Modified:
  head/sys/dev/vxge/vxge.c
  head/sys/dev/vxge/vxgehal/vxgehal-config.c

Modified: head/sys/dev/vxge/vxge.c
==
--- head/sys/dev/vxge/vxge.cThu Feb 23 16:07:45 2017(r314144)
+++ head/sys/dev/vxge/vxge.cThu Feb 23 16:10:15 2017(r314145)
@@ -2312,7 +2312,7 @@ vxge_vpath_open(vxge_dev_t *vdev)
vpath->rx_ticks = ticks;

vpath->tti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
-   vpath->tti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
+   vpath->rti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;


Probably use VXGE_DEFAULT_TI_RTIMER_VAL instead of TI?


Good catch, fixed as r314158.

Thanks!

Pedro.
___
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: r314158 - head/sys/dev/vxge

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 18:56:31 2017
New Revision: 314158
URL: https://svnweb.freebsd.org/changeset/base/314158

Log:
  vxge(4): Yet another (minor) mismatch.
  
  VXGE_DEFAULT_TTI_RTIMER_VAL and VXGE_DEFAULT_RTI_RTIMER_VAL have value
  zero but nevertheless we should use the right value on each.
  
  Pointed by:   jhb
  X-MFC with:   r314145

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

Modified: head/sys/dev/vxge/vxge.c
==
--- head/sys/dev/vxge/vxge.cThu Feb 23 18:54:33 2017(r314157)
+++ head/sys/dev/vxge/vxge.cThu Feb 23 18:56:31 2017(r314158)
@@ -2312,7 +2312,7 @@ vxge_vpath_open(vxge_dev_t *vdev)
vpath->rx_ticks = ticks;
 
vpath->tti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
-   vpath->rti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
+   vpath->rti_rtimer_val = VXGE_DEFAULT_RTI_RTIMER_VAL;
 
vpath->tx_intr_coalesce = vdev->config.intr_coalesce;
vpath->rx_intr_coalesce = vdev->config.intr_coalesce;
___
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: r314145 - in head/sys/dev/vxge: . vxgehal

2017-02-23 Thread John Baldwin
On Thursday, February 23, 2017 04:10:16 PM Pedro F. Giffuni wrote:
> Author: pfg
> Date: Thu Feb 23 16:10:15 2017
> New Revision: 314145
> URL: https://svnweb.freebsd.org/changeset/base/314145
> 
> Log:
>   dev/vxe: double assignments.
>   
>   Fix some suspicious code, likely caused by excessive copy-pasting.
>   
>   Found with: coccinelle (da.cocci)
>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/dev/vxge/vxge.c
>   head/sys/dev/vxge/vxgehal/vxgehal-config.c
> 
> Modified: head/sys/dev/vxge/vxge.c
> ==
> --- head/sys/dev/vxge/vxge.c  Thu Feb 23 16:07:45 2017(r314144)
> +++ head/sys/dev/vxge/vxge.c  Thu Feb 23 16:10:15 2017(r314145)
> @@ -2312,7 +2312,7 @@ vxge_vpath_open(vxge_dev_t *vdev)
>   vpath->rx_ticks = ticks;
>  
>   vpath->tti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
> - vpath->tti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
> + vpath->rti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;

Probably use VXGE_DEFAULT_TI_RTIMER_VAL instead of TI?

-- 
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: r314156 - head/sys/dev/rt

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 18:15:04 2017
New Revision: 314156
URL: https://svnweb.freebsd.org/changeset/base/314156

Log:
  rt_attach(): double assignment.
  
  Found with:   coccinelle (da.cocci)

Modified:
  head/sys/dev/rt/if_rt.c

Modified: head/sys/dev/rt/if_rt.c
==
--- head/sys/dev/rt/if_rt.c Thu Feb 23 18:14:36 2017(r314155)
+++ head/sys/dev/rt/if_rt.c Thu Feb 23 18:15:04 2017(r314156)
@@ -438,7 +438,6 @@ rt_attach(device_t dev)
sc->fe_int_status=GE_PORT_BASE+FE_INT_STATUS;
sc->fe_int_enable=GE_PORT_BASE+FE_INT_ENABLE;
sc->pdma_glo_cfg=PDMA_BASE+PDMA_GLO_CFG;
-   sc->pdma_glo_cfg=PDMA_BASE+PDMA_GLO_CFG;
sc->pdma_rst_idx=PDMA_BASE+PDMA_RST_IDX;
for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) {
  sc->tx_base_ptr[i]=PDMA_BASE+TX_BASE_PTR(i);
___
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: r314155 - head/sys/netinet

2017-02-23 Thread Michael Tuexen
Author: tuexen
Date: Thu Feb 23 18:14:36 2017
New Revision: 314155
URL: https://svnweb.freebsd.org/changeset/base/314155

Log:
  TCP window updates are only sent if the window can be increased by at
  least 2 * MSS. However, if the receive buffer size is small, this might
  be impossible. Add back a criterion to send a TCP window update if
  the window can be increased by at least half of the receive buffer size.
  This condition was removed in r242252. This patch simply brings it back.
  PR:   211003
  Reviewed by:  gnn
  MFC after:1 week
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D9475

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu Feb 23 17:56:24 2017
(r314154)
+++ head/sys/netinet/tcp_output.c   Thu Feb 23 18:14:36 2017
(r314155)
@@ -696,6 +696,8 @@ after_sack_rexmit:
 recwin <= (so->so_rcv.sb_hiwat / 8) ||
 so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg))
goto send;
+   if (2 * adv >= (int32_t)so->so_rcv.sb_hiwat)
+   goto send;
}
 dontupdate:
 
___
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: r314153 - head/cddl/contrib/opensolaris/lib/libctf/common

2017-02-23 Thread Mark Johnston
On Thu, Feb 23, 2017 at 05:54:17PM +, Mark Johnston wrote:
> Author: markj
> Date: Thu Feb 23 17:54:17 2017
> New Revision: 314153
> URL: https://svnweb.freebsd.org/changeset/base/314153
> 
> Log:
>   Fix a memory leak in an error case in libctf.
>   
>   Submitted by:   Tom Rix 
>   MFC after:  1 week

Sorry, I accidentally omitted:

Differential Revision: https://reviews.freebsd.org/D9767
___
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: r314154 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2017-02-23 Thread Mark Johnston
Author: markj
Date: Thu Feb 23 17:56:24 2017
New Revision: 314154
URL: https://svnweb.freebsd.org/changeset/base/314154

Log:
  Fix memory leaks in error cases in libdtrace.
  
  Submitted by: Tom Rix 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9705

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

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cThu Feb 
23 17:54:17 2017(r314153)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cThu Feb 
23 17:56:24 2017(r314154)
@@ -931,9 +931,11 @@ dt_provmod_open(dt_provmod_t **provmod, 
 * reallocate it. We normally won't need to do this
 * because providers aren't being loaded all the time.
 */
-   if ((p = realloc(p_providers,len)) == NULL)
+   if ((p = realloc(p_providers,len)) == NULL) {
+   free(p_providers);
/* How do we report errors here? */
return;
+   }
p_providers = p;
} else
break;
@@ -1148,8 +1150,10 @@ dt_vopen(int version, int flags, int *er
(void) fcntl(ftfd, F_SETFD, FD_CLOEXEC);
 
 alloc:
-   if ((dtp = malloc(sizeof (dtrace_hdl_t))) == NULL)
+   if ((dtp = malloc(sizeof (dtrace_hdl_t))) == NULL) {
+   dt_provmod_destroy();
return (set_open_errno(dtp, errp, EDT_NOMEM));
+   }
 
bzero(dtp, sizeof (dtrace_hdl_t));
dtp->dt_oflags = flags;

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c  Thu Feb 
23 17:54:17 2017(r314153)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c  Thu Feb 
23 17:56:24 2017(r314154)
@@ -256,8 +256,10 @@ dt_strtab_insert(dt_strtab_t *sp, const 
 * Now copy the string data into our buffer list, and then update
 * the global counts of strings and bytes.  Return str's byte offset.
 */
-   if (dt_strtab_copyin(sp, str, len + 1) == -1)
+   if (dt_strtab_copyin(sp, str, len + 1) == -1) {
+   free(hp);
return (-1L);
+   }
 
sp->str_nstrs++;
sp->str_size += len + 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314153 - head/cddl/contrib/opensolaris/lib/libctf/common

2017-02-23 Thread Mark Johnston
Author: markj
Date: Thu Feb 23 17:54:17 2017
New Revision: 314153
URL: https://svnweb.freebsd.org/changeset/base/314153

Log:
  Fix a memory leak in an error case in libctf.
  
  Submitted by: Tom Rix 
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c

Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
==
--- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c   Thu Feb 23 
17:46:38 2017(r314152)
+++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c   Thu Feb 23 
17:54:17 2017(r314153)
@@ -346,6 +346,7 @@ ctf_fdopen(int fd, int *errp)
if ((sp32 = malloc(nbytes)) == NULL || pread64(fd,
sp32, nbytes, hdr.e64.e_shoff) != nbytes) {
free(sp);
+   free(sp32);
return (ctf_set_open_errno(errp, 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"


Re: svn commit: r314151 - head/sys/modules/iwm

2017-02-23 Thread Ngie Cooper (yaneurabeya)

> On Feb 23, 2017, at 09:44, Ngie Cooper  wrote:
> 
> Author: ngie
> Date: Thu Feb 23 17:44:06 2017
> New Revision: 314151
> URL: https://svnweb.freebsd.org/changeset/base/314151
> 
> Log:
>  Unbreak if_iwm.ko after r314076
> 
>  Add if_iwm_7000.c/if_iwm_8000.c to SRCS to match similar additions made
>  to sys/conf/files after refactoring done in the commit noted.
> 
>  PR:  217308
>  Pointyhat to:adrian
>  Submitted by:Andreas Nilsson 
>  Reported by: Jakob Alvermark , Juan Ramómon Molina 
> Menor 

Ugh… that didn’t come out as expected after the UTF-8 conversion >_>...


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r314152 - head/lib/libcompiler_rt

2017-02-23 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 23 17:46:38 2017
New Revision: 314152
URL: https://svnweb.freebsd.org/changeset/base/314152

Log:
  Remove an assembler flag, which is redundant since r309124.  The upstream
  took care of it by introducing a macro NO_EXEC_STACK_DIRECTIVE.
  
  http://llvm.org/viewvc/llvm-project?rev=273500=rev
  
  Reviewed by:  dim

Modified:
  head/lib/libcompiler_rt/Makefile

Modified: head/lib/libcompiler_rt/Makefile
==
--- head/lib/libcompiler_rt/MakefileThu Feb 23 17:44:06 2017
(r314151)
+++ head/lib/libcompiler_rt/MakefileThu Feb 23 17:46:38 2017
(r314152)
@@ -25,10 +25,4 @@ SYMLINKS+=   libcompiler_rt.a ${LIBDIR}/li
 SYMLINKS+= libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a
 .endif
 
-.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
-${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*}
-AFLAGS+=   --noexecstack
-ACFLAGS+=  -Wa,--noexecstack
-.endif
-
 .include 
___
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: r314142 - head/sys/dev/ce

2017-02-23 Thread Pedro Giffuni



On 2/23/2017 12:13 PM, Benjamin Kaduk wrote:
On Thu, Feb 23, 2017 at 9:30 AM, Pedro F. Giffuni > wrote:


Author: pfg
Date: Thu Feb 23 15:30:21 2017
New Revision: 314142
URL: https://svnweb.freebsd.org/changeset/base/314142


Log:
  dev/ce: double assignment.

  The code is not operational right now so just comment away an
obviously
  useless assignment. Fix some typos while here.

  Found with: coccinelle (da.cocci)

Modified:
  head/sys/dev/ce/ceddk.c

Modified: head/sys/dev/ce/ceddk.c

==
--- head/sys/dev/ce/ceddk.c Thu Feb 23 15:10:46 2017  
(r314141)
+++ head/sys/dev/ce/ceddk.c Thu Feb 23 15:30:21 2017  
(r314142)

@@ -632,8 +632,8 @@ void ce_stop_chan (ce_chan_t *c)
  "UserRequest (%s:%d)\n",
__FUNCTION__, __LINE__));
return;
}
-   req->Command = TAU32_Configure_Commit |
-  TAU32_Tx_Stop | TAU32_Rx_Stop;
+// req->Command = TAU32_Configure_Commit |
+//TAU32_Tx_Stop | TAU32_Rx_Stop;


Should probably stick to C-style comments, though.



They are valid C99 comments but I understand what you mean,

OTOH, the code block appears to be so broken, that it doesn't matter.

Pedro.

-Ben


___
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: r314151 - head/sys/modules/iwm

2017-02-23 Thread Ngie Cooper
Author: ngie
Date: Thu Feb 23 17:44:06 2017
New Revision: 314151
URL: https://svnweb.freebsd.org/changeset/base/314151

Log:
  Unbreak if_iwm.ko after r314076
  
  Add if_iwm_7000.c/if_iwm_8000.c to SRCS to match similar additions made
  to sys/conf/files after refactoring done in the commit noted.
  
  PR:   217308
  Pointyhat to: adrian
  Submitted by: Andreas Nilsson 
  Reported by:  Jakob Alvermark , Juan Ramómon Molina 
Menor 
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/modules/iwm/Makefile

Modified: head/sys/modules/iwm/Makefile
==
--- head/sys/modules/iwm/Makefile   Thu Feb 23 16:54:30 2017
(r314150)
+++ head/sys/modules/iwm/Makefile   Thu Feb 23 17:44:06 2017
(r314151)
@@ -7,6 +7,7 @@ KMOD=   if_iwm
 SRCS=  if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c
 SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c
 SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c
+SRCS+= if_iwm_7000.c if_iwm_8000.c
 # bus layer
 SRCS+= if_iwm_pcie_trans.c
 SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h
___
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: r314142 - head/sys/dev/ce

2017-02-23 Thread Mateusz Guzik
On Thu, Feb 23, 2017 at 03:30:21PM +, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Thu Feb 23 15:30:21 2017
> New Revision: 314142
> URL: https://svnweb.freebsd.org/changeset/base/314142
> 
> Log:
>   dev/ce: double assignment.
>   
>   The code is not operational right now so just comment away an obviously
>   useless assignment. Fix some typos while here.
>   
>  
> - /* XXXRIK: This function should be for comleteness, but for now I
> -  * don't use it. So I just start to write and didn't finished it yet.
> -  * It and it is VERY BUGGY!!! Do not use it. If you really
> -  * need it ask me to fix it or rewrite it by your self.
> + /* XXXRIK: This function should be for completeness, but for now I
> +  * don't use it. I just started to write and haven't finished it yet.
> +  * It is VERY BUGGY!!! Do not use it. If you really need
> +  * it ask me to fix it or rewrite it by yourself.
>* Note: most buggy part of it in ce_on_config_stop!
>*/

Please don't fix typos etc. unless they seriouslyl harm readability.
Changes of this sort make it harder to svn blame.

-- 
Mateusz Guzik 
___
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: r313996 - in head/sys: kern sys

2017-02-23 Thread Mateusz Guzik
On Wed, Feb 22, 2017 at 03:09:24PM -0800, Gleb Smirnoff wrote:
>   Mateusz,
> 
>   why do you __predict_false() the recursion scenario? I'm afraid
> that performance loss for mispredictions could outweight the
> gain due to predictions. AFAIK, mutex recursion is still a pretty
> common event in the kernel.
> 

Do you mean spin mutexes or blocking ones sa well?

For blocking mutexes, recursion almost never happens and I'm confident
in the prediction to not do it. It may be there is a lock somewere which
recurses a lot and its singlethreaded operation is harmed by the
prediction. For such locks a separate wrappers shouldl be introduced
which expect recursion to happen.

For spin mutexes the above is almost correct. Most calls do the slow
path to spin.

There is an important lock which sometimes recurses (sched lock) but it
is unclear if it got hurt by the change.

Note that lock clean up is a work in progress. For spin mutexes I'm
pondering revamping them a little - the inline path is extremelly long
and already constains a function call to spinlock_enter/exit. So the
plan would be to create a primitive with an inlined spinlock code to
keep one call and reduce inline code.

Finally, while mfcability of the work prevents riping out recursion
support from the code, an additional set of primitives which expect
recursion to happen can be introduced and used in places which do
recurse.

TL;DR I think the changes are a net win to spinlocks even if they
recurse and will be a bigger win with coming cleanups.

On the other hand if you profiled a regression with the above, I'm happy
to unpredict the change.


> On Mon, Feb 20, 2017 at 07:08:36PM +, Mateusz Guzik wrote:
> M> Author: mjg
> M> Date: Mon Feb 20 19:08:36 2017
> M> New Revision: 313996
> M> URL: https://svnweb.freebsd.org/changeset/base/313996
> M> 
> M> Log:
> M>   mtx: fix spin mutexes interaction with failed fcmpset
> M>   
> M>   While doing so move recursion support down to the fallback routine.
> M> 
> M> Modified:
> M>   head/sys/kern/kern_mutex.c
> M>   head/sys/sys/mutex.h
> M> 
> M> Modified: head/sys/kern/kern_mutex.c
> M> 
> ==
> M> --- head/sys/kern/kern_mutex.c Mon Feb 20 17:33:25 2017
> (r313995)
> M> +++ head/sys/kern/kern_mutex.c Mon Feb 20 19:08:36 2017
> (r313996)
> M> @@ -696,6 +696,14 @@ _mtx_lock_spin_cookie(volatile uintptr_t
> M>lock_delay_arg_init(, _spin_delay);
> M>m = mtxlock2mtx(c);
> M>  
> M> +  if (__predict_false(v == MTX_UNOWNED))
> M> +  v = MTX_READ_VALUE(m);
> M> +
> M> +  if (__predict_false(v == tid)) {
> M> +  m->mtx_recurse++;
> M> +  return;
> M> +  }
> M> +
> M>if (LOCK_LOG_TEST(>lock_object, opts))
> M>CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m);
> M>KTR_STATE1(KTR_SCHED, "thread", sched_tdname((struct thread *)tid),
> M> 
> M> Modified: head/sys/sys/mutex.h
> M> 
> ==
> M> --- head/sys/sys/mutex.h   Mon Feb 20 17:33:25 2017(r313995)
> M> +++ head/sys/sys/mutex.h   Mon Feb 20 19:08:36 2017(r313996)
> M> @@ -223,12 +223,9 @@ void  thread_lock_flags_(struct thread *,
> M>uintptr_t _v = MTX_UNOWNED; \
> M>\
> M>spinlock_enter();   \
> M> -  if (!_mtx_obtain_lock_fetch((mp), &_v, _tid)) { \
> M> -  if (_v == _tid) \
> M> -  (mp)->mtx_recurse++;\
> M> -  else\
> M> -  _mtx_lock_spin((mp), _v, _tid, (opts), (file), (line));\
> M> -  } else  \
> M> +  if (!_mtx_obtain_lock_fetch((mp), &_v, _tid))   \
> M> +  _mtx_lock_spin((mp), _v, _tid, (opts), (file), (line)); \
> M> +  else\
> M>LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, \
> M>mp, 0, 0, file, line);  \
> M>  } while (0)
> M> ___
> M> svn-src-...@freebsd.org mailing list
> M> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> M> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
> 
> -- 
> Totus tuus, Glebius.
> ___
> svn-src-...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

-- 
Mateusz Guzik 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any 

Re: svn commit: r314142 - head/sys/dev/ce

2017-02-23 Thread Benjamin Kaduk
On Thu, Feb 23, 2017 at 9:30 AM, Pedro F. Giffuni  wrote:

> Author: pfg
> Date: Thu Feb 23 15:30:21 2017
> New Revision: 314142
> URL: https://svnweb.freebsd.org/changeset/base/314142
>
> Log:
>   dev/ce: double assignment.
>
>   The code is not operational right now so just comment away an obviously
>   useless assignment. Fix some typos while here.
>
>   Found with: coccinelle (da.cocci)
>
> Modified:
>   head/sys/dev/ce/ceddk.c
>
> Modified: head/sys/dev/ce/ceddk.c
> 
> ==
> --- head/sys/dev/ce/ceddk.c Thu Feb 23 15:10:46 2017(r314141)
> +++ head/sys/dev/ce/ceddk.c Thu Feb 23 15:30:21 2017(r314142)
> @@ -632,8 +632,8 @@ void ce_stop_chan (ce_chan_t *c)
>   "UserRequest (%s:%d)\n", __FUNCTION__,
> __LINE__));
> return;
> }
> -   req->Command = TAU32_Configure_Commit |
> -  TAU32_Tx_Stop | TAU32_Rx_Stop;
> +// req->Command = TAU32_Configure_Commit |
> +//TAU32_Tx_Stop | TAU32_Rx_Stop;
>

Should probably stick to C-style comments, though.

-Ben
___
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: r314150 - head/sys/dev/xen/netback

2017-02-23 Thread Alan Somers
Author: asomers
Date: Thu Feb 23 16:54:30 2017
New Revision: 314150
URL: https://svnweb.freebsd.org/changeset/base/314150

Log:
  Fix the xnb(4) unit tests
  
  One test was inadvertently expecting a bug in the kernel's sscanf
  implementation circa 2012. I don't know when that bug got fixed.
  
  Reported by:  royger
  Reviewed by:  royger
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D9766

Modified:
  head/sys/dev/xen/netback/netback_unit_tests.c

Modified: head/sys/dev/xen/netback/netback_unit_tests.c
==
--- head/sys/dev/xen/netback/netback_unit_tests.c   Thu Feb 23 16:42:48 
2017(r314149)
+++ head/sys/dev/xen/netback/netback_unit_tests.c   Thu Feb 23 16:54:30 
2017(r314150)
@@ -2528,7 +2528,7 @@ xnb_sscanf_hhn(char *buffer, size_t bufl
XNB_ASSERT(sscanf(mystr,
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
"202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"
-   "404142434445464748494a4b4c4d4e4f%hhn", [4]) == 1);
+   "404142434445464748494a4b4c4d4e4f%hhn", [4]) == 0);
for (i = 0; i < 12; i++)
XNB_ASSERT(dest[i] == (i == 4 ? 160 : '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"


svn commit: r314149 - head/etc

2017-02-23 Thread Takahashi Yoshihiro
Author: nyan
Date: Thu Feb 23 16:42:48 2017
New Revision: 314149
URL: https://svnweb.freebsd.org/changeset/base/314149

Log:
  The ct driver was removed by r312910.

Modified:
  head/etc/devd.conf

Modified: head/etc/devd.conf
==
--- head/etc/devd.conf  Thu Feb 23 16:31:04 2017(r314148)
+++ head/etc/devd.conf  Thu Feb 23 16:42:48 2017(r314149)
@@ -19,7 +19,7 @@ options {
# Setup some shorthand for regex that we use later in the file.
#XXX Yes, these are gross -- imp
set scsi-controller-regex
-   "(aac|adv|adw|aha|ahc|ahd|aic|amr|bt|ciss|ct|dpt|\
+   "(aac|adv|adw|aha|ahc|ahd|aic|amr|bt|ciss|dpt|\
esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm)\
[0-9]+";
set wifi-driver-regex
___
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: r314148 - head/sys/dev/xen/netback

2017-02-23 Thread Alan Somers
Author: asomers
Date: Thu Feb 23 16:31:04 2017
New Revision: 314148
URL: https://svnweb.freebsd.org/changeset/base/314148

Log:
  Misc Coverity fixes in xnb(4)
  
  Most of these are null pointer dereferences or missing error checks in the
  unit tests. One is a missing error check in xnb_attach_failed. None can
  cause real problems in running systems.
  
  Reported by:  Coverity
  CIDs: 1092469 1092468 1092467 2092466 1092465 1092512 1092511 1092510
  CIDs: 1092510 1092509 1092508 1092507
  Reviewed by:  royger
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D9234

Modified:
  head/sys/dev/xen/netback/netback.c
  head/sys/dev/xen/netback/netback_unit_tests.c

Modified: head/sys/dev/xen/netback/netback.c
==
--- head/sys/dev/xen/netback/netback.c  Thu Feb 23 16:18:57 2017
(r314147)
+++ head/sys/dev/xen/netback/netback.c  Thu Feb 23 16:31:04 2017
(r314148)
@@ -1101,14 +1101,13 @@ xnb_attach_failed(struct xnb_softc *xnb,
xs_vprintf(XST_NIL, xenbus_get_node(xnb->dev),
  "hotplug-error", fmt, ap_hotplug);
va_end(ap_hotplug);
-   xs_printf(XST_NIL, xenbus_get_node(xnb->dev),
+   (void)xs_printf(XST_NIL, xenbus_get_node(xnb->dev),
  "hotplug-status", "error");
 
xenbus_dev_vfatal(xnb->dev, err, fmt, ap);
va_end(ap);
 
-   xs_printf(XST_NIL, xenbus_get_node(xnb->dev),
- "online", "0");
+   (void)xs_printf(XST_NIL, xenbus_get_node(xnb->dev), "online", "0");
xnb_detach(xnb->dev);
 }
 

Modified: head/sys/dev/xen/netback/netback_unit_tests.c
==
--- head/sys/dev/xen/netback/netback_unit_tests.c   Thu Feb 23 16:18:57 
2017(r314147)
+++ head/sys/dev/xen/netback/netback_unit_tests.c   Thu Feb 23 16:31:04 
2017(r314148)
@@ -1227,6 +1227,10 @@ xnb_txpkt2gnttab_2cluster(char *buffer, 
xnb_ring2pkt(, _unit_pvt.txb, xnb_unit_pvt.txb.req_cons);
 
pMbuf = xnb_pkt2mbufc(, xnb_unit_pvt.ifp);
+   XNB_ASSERT(pMbuf != NULL);
+   if (pMbuf == NULL)
+   return;
+
n_entries = xnb_txpkt2gnttab(, pMbuf, xnb_unit_pvt.gnttab,
_unit_pvt.txb, DOMID_FIRST_RESERVED);
 
@@ -1271,8 +1275,7 @@ xnb_txpkt2gnttab_2cluster(char *buffer, 
/* should never get here */
XNB_ASSERT(0);
}
-   if (pMbuf != NULL)
-   m_freem(pMbuf);
+   m_freem(pMbuf);
 }
 
 
@@ -1494,15 +1497,14 @@ xnb_mbufc2pkt_2short(char *buffer, size_
struct mbuf *mbufc, *mbufc2;
 
mbufc = m_getm(NULL, size1, M_WAITOK, MT_DATA);
-   mbufc->m_flags |= M_PKTHDR;
-   if (mbufc == NULL) {
-   XNB_ASSERT(mbufc != NULL);
+   XNB_ASSERT(mbufc != NULL);
+   if (mbufc == NULL)
return;
-   }
+   mbufc->m_flags |= M_PKTHDR;
 
mbufc2 = m_getm(mbufc, size2, M_WAITOK, MT_DATA);
+   XNB_ASSERT(mbufc2 != NULL);
if (mbufc2 == NULL) {
-   XNB_ASSERT(mbufc2 != NULL);
safe_m_freem();
return;
}
@@ -1537,11 +1539,10 @@ xnb_mbufc2pkt_long(char *buffer, size_t 
struct mbuf *mbufc, *m;
 
mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA);
-   mbufc->m_flags |= M_PKTHDR;
-   if (mbufc == NULL) {
-   XNB_ASSERT(mbufc != NULL);
+   XNB_ASSERT(mbufc != NULL);
+   if (mbufc == NULL)
return;
-   }
+   mbufc->m_flags |= M_PKTHDR;
 
mbufc->m_pkthdr.len = size;
size_remaining = size;
@@ -1576,10 +1577,9 @@ xnb_mbufc2pkt_extra(char *buffer, size_t
struct mbuf *mbufc, *m;
 
mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA);
-   if (mbufc == NULL) {
-   XNB_ASSERT(mbufc != NULL);
+   XNB_ASSERT(mbufc != NULL);
+   if (mbufc == NULL)
return;
-   }
 
mbufc->m_flags |= M_PKTHDR;
mbufc->m_pkthdr.len = size;
@@ -1619,11 +1619,10 @@ xnb_mbufc2pkt_nospace(char *buffer, size
int error;
 
mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA);
-   mbufc->m_flags |= M_PKTHDR;
-   if (mbufc == NULL) {
-   XNB_ASSERT(mbufc != NULL);
+   XNB_ASSERT(mbufc != NULL);
+   if (mbufc == NULL)
return;
-   }
+   mbufc->m_flags |= M_PKTHDR;
 
mbufc->m_pkthdr.len = size;
size_remaining = size;
@@ -1840,10 +1839,9 @@ xnb_rxpkt2rsp_extra(char *buffer, size_t
struct netif_extra_info *ext;
 
mbufc = m_getm(NULL, size, M_WAITOK, MT_DATA);
-   if (mbufc == NULL) {
-   XNB_ASSERT(mbufc != NULL);
+   XNB_ASSERT(mbufc != NULL);
+   if (mbufc == NULL)
return;
-   }
 
mbufc->m_flags |= M_PKTHDR;
mbufc->m_pkthdr.len = size;
@@ 

svn commit: r314147 - head/sys/dev/bktr

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 16:18:57 2017
New Revision: 314147
URL: https://svnweb.freebsd.org/changeset/base/314147

Log:
  bktr(4): double assignment.
  
  First assignment is obviously overwritten by the next line.
  Leave newest assignment: it was introduced in r29233.
  
  Found with:   coccinelle (da.cocci)

Modified:
  head/sys/dev/bktr/bktr_core.c

Modified: head/sys/dev/bktr/bktr_core.c
==
--- head/sys/dev/bktr/bktr_core.c   Thu Feb 23 16:15:42 2017
(r314146)
+++ head/sys/dev/bktr/bktr_core.c   Thu Feb 23 16:18:57 2017
(r314147)
@@ -3121,7 +3121,6 @@ yuvpack_prog( bktr_ptr_t bktr, char i_fl
OUTB(bktr, BKTR_COLOR_CTL, INB(bktr, BKTR_COLOR_CTL) | 
BT848_COLOR_CTL_RGB_DED | BT848_COLOR_CTL_GAMMA);
OUTB(bktr, BKTR_ADC, SYNC_LEVEL);
 
-   bktr->capcontrol =   1 << 6 | 1 << 4 | 1 << 2 | 3;
bktr->capcontrol = 3 << 2 |  3;
 
dma_prog = (uint32_t *) bktr->dma_prog;
___
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: r314145 - in head/sys/dev/vxge: . vxgehal

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 16:10:15 2017
New Revision: 314145
URL: https://svnweb.freebsd.org/changeset/base/314145

Log:
  dev/vxe: double assignments.
  
  Fix some suspicious code, likely caused by excessive copy-pasting.
  
  Found with:   coccinelle (da.cocci)
  MFC after:2 weeks

Modified:
  head/sys/dev/vxge/vxge.c
  head/sys/dev/vxge/vxgehal/vxgehal-config.c

Modified: head/sys/dev/vxge/vxge.c
==
--- head/sys/dev/vxge/vxge.cThu Feb 23 16:07:45 2017(r314144)
+++ head/sys/dev/vxge/vxge.cThu Feb 23 16:10:15 2017(r314145)
@@ -2312,7 +2312,7 @@ vxge_vpath_open(vxge_dev_t *vdev)
vpath->rx_ticks = ticks;
 
vpath->tti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
-   vpath->tti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
+   vpath->rti_rtimer_val = VXGE_DEFAULT_TTI_RTIMER_VAL;
 
vpath->tx_intr_coalesce = vdev->config.intr_coalesce;
vpath->rx_intr_coalesce = vdev->config.intr_coalesce;

Modified: head/sys/dev/vxge/vxgehal/vxgehal-config.c
==
--- head/sys/dev/vxge/vxgehal/vxgehal-config.c  Thu Feb 23 16:07:45 2017
(r314144)
+++ head/sys/dev/vxge/vxgehal/vxgehal-config.c  Thu Feb 23 16:10:15 2017
(r314145)
@@ -2312,9 +2312,6 @@ vxge_hal_device_config_default_get(
port_config->host_chosen_aggr =
VXGE_HAL_LAG_PORT_HOST_CHOSEN_AGGR_DEFAULT;
 
-   port_config->host_chosen_aggr =
-   VXGE_HAL_LAG_PORT_HOST_CHOSEN_AGGR_DEFAULT;
-
port_config->discard_unknown_slow_proto =
VXGE_HAL_LAG_PORT_DISCARD_UNKNOWN_SLOW_PROTO_DEFAULT;
 
@@ -2348,9 +2345,6 @@ vxge_hal_device_config_default_get(
port_config->actor_distributing =
VXGE_HAL_LAG_PORT_ACTOR_DISTRIBUTING_DEFAULT;
 
-   port_config->actor_distributing =
-   VXGE_HAL_LAG_PORT_ACTOR_DISTRIBUTING_DEFAULT;
-
port_config->actor_defaulted =
VXGE_HAL_LAG_PORT_ACTOR_DEFAULTED_DEFAULT;
 
@@ -2387,9 +2381,6 @@ vxge_hal_device_config_default_get(
port_config->partner_distributing =
VXGE_HAL_LAG_PORT_PARTNER_DISTRIBUTING_DEFAULT;
 
-   port_config->partner_distributing =
-   VXGE_HAL_LAG_PORT_PARTNER_DISTRIBUTING_DEFAULT;
-
port_config->partner_defaulted =
VXGE_HAL_LAG_PORT_PARTNER_DEFAULTED_DEFAULT;
 
___
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: r314142 - head/sys/dev/ce

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 15:30:21 2017
New Revision: 314142
URL: https://svnweb.freebsd.org/changeset/base/314142

Log:
  dev/ce: double assignment.
  
  The code is not operational right now so just comment away an obviously
  useless assignment. Fix some typos while here.
  
  Found with: coccinelle (da.cocci)

Modified:
  head/sys/dev/ce/ceddk.c

Modified: head/sys/dev/ce/ceddk.c
==
--- head/sys/dev/ce/ceddk.c Thu Feb 23 15:10:46 2017(r314141)
+++ head/sys/dev/ce/ceddk.c Thu Feb 23 15:30:21 2017(r314142)
@@ -621,10 +621,10 @@ void ce_stop_chan (ce_chan_t *c)
TAU32_UserRequest *req;
CE_DEQUEUE (b->cr.queue, req);
 
-   /* XXXRIK: This function should be for comleteness, but for now I
-* don't use it. So I just start to write and didn't finished it yet.
-* It and it is VERY BUGGY!!! Do not use it. If you really
-* need it ask me to fix it or rewrite it by your self.
+   /* XXXRIK: This function should be for completeness, but for now I
+* don't use it. I just started to write and haven't finished it yet.
+* It is VERY BUGGY!!! Do not use it. If you really need
+* it ask me to fix it or rewrite it by yourself.
 * Note: most buggy part of it in ce_on_config_stop!
 */
if (!req) {
@@ -632,8 +632,8 @@ void ce_stop_chan (ce_chan_t *c)
  "UserRequest (%s:%d)\n", __FUNCTION__, __LINE__));
return;
}
-   req->Command = TAU32_Configure_Commit |
-  TAU32_Tx_Stop | TAU32_Rx_Stop;
+// req->Command = TAU32_Configure_Commit |
+//TAU32_Tx_Stop | TAU32_Rx_Stop;
req->Command = 0;
req->Io.ChannelNumber = c->num;
req->pCallback = ce_on_config_stop;
___
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: r314141 - head/usr.sbin/rtadvd

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 15:10:46 2017
New Revision: 314141
URL: https://svnweb.freebsd.org/changeset/base/314141

Log:
  rtadvd(8): double assignment.
  
  Remove doubtful initialization since the value will be overwritten
  immediately afterwards.
  
  Found with: coccinelle (da.cocci)

Modified:
  head/usr.sbin/rtadvd/config.c

Modified: head/usr.sbin/rtadvd/config.c
==
--- head/usr.sbin/rtadvd/config.c   Thu Feb 23 15:05:01 2017
(r314140)
+++ head/usr.sbin/rtadvd/config.c   Thu Feb 23 15:10:46 2017
(r314141)
@@ -1395,7 +1395,6 @@ make_packet(struct rainfo *rai)
ra->nd_ra_code = 0;
ra->nd_ra_cksum = 0;
ra->nd_ra_curhoplimit = (uint8_t)(0xff & rai->rai_hoplimit);
-   ra->nd_ra_flags_reserved = 0; /* just in case */
/*
 * XXX: the router preference field, which is a 2-bit field, should be
 * initialized before other fields.
___
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: r314140 - head/usr.sbin/camdd

2017-02-23 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 23 15:05:01 2017
New Revision: 314140
URL: https://svnweb.freebsd.org/changeset/base/314140

Log:
  camdd(8): double assignment.
  
  Why do a calculation twice when you can do it just once.
  
  Found with: coccinelle (da.cocci)

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

Modified: head/usr.sbin/camdd/camdd.c
==
--- head/usr.sbin/camdd/camdd.c Thu Feb 23 14:39:51 2017(r314139)
+++ head/usr.sbin/camdd/camdd.c Thu Feb 23 15:05:01 2017(r314140)
@@ -3107,10 +3107,6 @@ camdd_rw(struct camdd_io_opts *io_opts, 
(devs[i]->start_offset_bytes /
devs[i]->sector_size) +
(max_io / devs[i]->sector_size) - 1;
-   devs[i]->sector_io_limit =
-   (devs[i]->start_offset_bytes /
-   devs[i]->sector_size) +
-   (max_io / devs[i]->sector_size) - 1;
}
 
devs[i]->next_io_pos_bytes = devs[i]->start_offset_bytes;
___
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: r314139 - head/usr.bin/vi/catalog

2017-02-23 Thread Ed Maste
Author: emaste
Date: Thu Feb 23 14:39:51 2017
New Revision: 314139
URL: https://svnweb.freebsd.org/changeset/base/314139

Log:
  make vi message catalogues build independent of locale
  
  r275234 addressed sort automatically converting 8-bit locales to UTF-8
  by using "LANG=C sort", but LC_ALL overrides LANG if set, so the issue
  may still be present depending on the user's environment. Use LC_ALL=C
  instead.
  
  Reported by:  tests.reproducible-builds.org
  Reviewed by:  bapt
  MFC after:1 week
  Sponsored by: The Linux Foundation / Core Infrastructure Initiative
  Differential Revision:https://reviews.freebsd.org/D9765

Modified:
  head/usr.bin/vi/catalog/Makefile

Modified: head/usr.bin/vi/catalog/Makefile
==
--- head/usr.bin/vi/catalog/MakefileThu Feb 23 13:14:28 2017
(r314138)
+++ head/usr.bin/vi/catalog/MakefileThu Feb 23 14:39:51 2017
(r314139)
@@ -39,7 +39,7 @@ CAT+= $c.UTF-8
 ${c}:  ${c}.base 
echo "... $c";  \
rm -f $c;   \
-   env LANG=C sort -u ${.ALLSRC} | \
+   env LC_ALL=C sort -u ${.ALLSRC} |   \
awk '{  \
if ($$1 == 1) { \
print "\nMESSAGE NUMBER 1 IS NOT LEGAL";\
@@ -86,13 +86,13 @@ ${c}.check: ${c}.base
echo =; \
echo "MESSAGES WITH THE SAME MESSAGE ID's (FIX!):"; \
for j in\
-   `sed '/^$$/d' < $$f.base | LANG=C sort -u | \
+   `sed '/^$$/d' < $$f.base | LC_ALL=C sort -u |   \
awk '{print $$1}' | uniq -d`; do\
egrep $$j $$f.base; \
done;   \
echo =; \
echo "Duplicate messages, both id and message (this is okay):"; \
-   sed '/^$$/d' < $$f.base | LANG=C sort | uniq -c |   
\
+   sed '/^$$/d' < $$f.base | LC_ALL=C sort | uniq -c | \
awk '$$1 != 1 { print $$0 }' | sort -n; \
echo =) > $c
 .endfor
___
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: r314138 - head/sys/dev/xen/gntdev

2017-02-23 Thread Roger Pau Monné
Author: royger
Date: Thu Feb 23 13:14:28 2017
New Revision: 314138
URL: https://svnweb.freebsd.org/changeset/base/314138

Log:
  xen/gndev: use UOFF_TO_IDX instead of OFF_TO_IDX
  
  The Xen grant table device treats the mmap offset parameter as an unsigned
  type, and as so it must use the newly introduced UOFF_TO_IDX.
  
  Sponsored by:   Citrix Systems R
  MFC after:  2 weeks
  X-MFC-with: r313690

Modified:
  head/sys/dev/xen/gntdev/gntdev.c

Modified: head/sys/dev/xen/gntdev/gntdev.c
==
--- head/sys/dev/xen/gntdev/gntdev.cThu Feb 23 09:55:55 2017
(r314137)
+++ head/sys/dev/xen/gntdev/gntdev.cThu Feb 23 13:14:28 2017
(r314138)
@@ -796,8 +796,8 @@ gntdev_gmap_pg_fault(vm_object_t object,
 
relative_offset = offset - gmap->file_index;
 
-   pidx = OFF_TO_IDX(offset);
-   ridx = OFF_TO_IDX(relative_offset);
+   pidx = UOFF_TO_IDX(offset);
+   ridx = UOFF_TO_IDX(relative_offset);
if (ridx >= gmap->count ||
gmap->grant_map_ops[ridx].status != GNTST_okay)
return (VM_PAGER_FAIL);
@@ -1067,7 +1067,7 @@ mmap_gref(struct per_user_data *priv_use
break;
 
vm_page_insert(gref->page, mem_obj,
-   OFF_TO_IDX(gref->file_index));
+   UOFF_TO_IDX(gref->file_index));
 
count--;
}
@@ -1207,7 +1207,7 @@ gntdev_mmap_single(struct cdev *cdev, vm
if (error != 0)
return (EINVAL);
 
-   count = OFF_TO_IDX(size);
+   count = UOFF_TO_IDX(size);
 
gref_start = gntdev_find_grefs(priv_user, *offset, count);
if (gref_start) {
___
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: r314136 - head/sys/compat/linuxkpi/common/include/linux

2017-02-23 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Feb 23 09:53:54 2017
New Revision: 314136
URL: https://svnweb.freebsd.org/changeset/base/314136

Log:
  Implement __test_and_clear_bit() and __test_and_set_bit() in the LinuxKPI.
  
  The clang compiler will optimise these functions down to three AMD64
  instructions if the bit argument is a constant during compilation.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/bitops.h

Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h
==
--- head/sys/compat/linuxkpi/common/include/linux/bitops.h  Thu Feb 23 
09:52:22 2017(r314135)
+++ head/sys/compat/linuxkpi/common/include/linux/bitops.h  Thu Feb 23 
09:53:54 2017(r314136)
@@ -338,6 +338,21 @@ test_and_clear_bit(long bit, volatile un
 }
 
 static inline int
+__test_and_clear_bit(long bit, volatile unsigned long *var)
+{
+   long val;
+
+   var += BIT_WORD(bit);
+   bit %= BITS_PER_LONG;
+   bit = (1UL << bit);
+
+   val = *var;
+   *var &= ~bit;
+
+   return !!(val & bit);
+}
+
+static inline int
 test_and_set_bit(long bit, volatile unsigned long *var)
 {
long val;
@@ -352,6 +367,21 @@ test_and_set_bit(long bit, volatile unsi
return !!(val & bit);
 }
 
+static inline int
+__test_and_set_bit(long bit, volatile unsigned long *var)
+{
+   long val;
+
+   var += BIT_WORD(bit);
+   bit %= BITS_PER_LONG;
+   bit = (1UL << bit);
+
+   val = *var;
+   *var |= bit;
+
+   return !!(val & bit);
+}
+
 static inline void
 bitmap_set(unsigned long *map, int start, int nr)
 {
___
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: r314132 - head/sys/compat/linux

2017-02-23 Thread Dmitry Chagin
Author: dchagin
Date: Thu Feb 23 08:17:42 2017
New Revision: 314132
URL: https://svnweb.freebsd.org/changeset/base/314132

Log:
  Right clock defines specified in linux_timer.h.
  Get rid of spirious clock defines from linux_misc.h.
  
  MFC after:1 week

Modified:
  head/sys/compat/linux/linux_misc.h

Modified: head/sys/compat/linux/linux_misc.h
==
--- head/sys/compat/linux/linux_misc.h  Thu Feb 23 07:48:58 2017
(r314131)
+++ head/sys/compat/linux/linux_misc.h  Thu Feb 23 08:17:42 2017
(r314132)
@@ -114,13 +114,6 @@ struct l_new_utsname {
chardomainname[LINUX_MAX_UTSNAME];
 };
 
-#defineLINUX_CLOCK_REALTIME0
-#defineLINUX_CLOCK_MONOTONIC   1
-#defineLINUX_CLOCK_PROCESS_CPUTIME_ID  2
-#defineLINUX_CLOCK_THREAD_CPUTIME_ID   3
-#defineLINUX_CLOCK_REALTIME_HR 4
-#defineLINUX_CLOCK_MONOTONIC_HR5
-
 #define LINUX_UTIME_NOW0x3FFF
 #define LINUX_UTIME_OMIT   0x3FFE
 
___
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"