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

2017-09-27 Thread Warner Losh
Author: imp
Date: Thu Sep 28 01:27:00 2017
New Revision: 324075
URL: https://svnweb.freebsd.org/changeset/base/324075

Log:
  Tweak performance of nda completions
  
  Use xpt_done_direct in preference to xpt_done when completing a
  successful I/O. Continue to use xpt_done when there's an error, or for
  completion of the submission of a CCB. This eliminates a context
  switch to the cam_doneq thread.
  
  Sponsored by: Netflix
  Suggested by: scottl@

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

Modified: head/sys/dev/nvme/nvme_sim.c
==
--- head/sys/dev/nvme/nvme_sim.cWed Sep 27 23:23:41 2017
(r324074)
+++ head/sys/dev/nvme/nvme_sim.cThu Sep 28 01:27:00 2017
(r324075)
@@ -73,11 +73,13 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_
 * it means. Make our best guess, though for the status code.
 */
memcpy(>nvmeio.cpl, cpl, sizeof(*cpl));
-   if (nvme_completion_is_error(cpl))
+   if (nvme_completion_is_error(cpl)) {
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
-   else
+   xpt_done(ccb);
+   } else {
ccb->ccb_h.status = CAM_REQ_CMP;
-   xpt_done(ccb);
+   xpt_done_direct(ccb);
+   }
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2017-09-27 Thread Rick Macklem
Author: rmacklem
Date: Wed Sep 27 23:23:41 2017
New Revision: 324074
URL: https://svnweb.freebsd.org/changeset/base/324074

Log:
  Fix a memory leak that occurred in the pNFS client.
  
  When a "pnfs" NFSv4.1 mount was unmounted, it didn't free up the layouts
  and deviceinfo structures. This leak only affects "pnfs" mounts and only
  when the mount is umounted.
  Found while testing the pNFS Flexible File layout client code.
  
  MFC after:2 weeks

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

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==
--- head/sys/fs/nfsclient/nfs_clstate.c Wed Sep 27 23:18:57 2017
(r324073)
+++ head/sys/fs/nfsclient/nfs_clstate.c Wed Sep 27 23:23:41 2017
(r324074)
@@ -1627,6 +1627,14 @@ nfscl_cleanclient(struct nfsclclient *clp)
 {
struct nfsclowner *owp, *nowp;
struct nfsclopen *op, *nop;
+   struct nfscllayout *lyp, *nlyp;
+   struct nfscldevinfo *dip, *ndip;
+
+   TAILQ_FOREACH_SAFE(lyp, >nfsc_layout, nfsly_list, nlyp)
+   nfscl_freelayout(lyp);
+
+   LIST_FOREACH_SAFE(dip, >nfsc_devinfo, nfsdi_list, ndip)
+   nfscl_freedevinfo(dip);
 
/* Now, all the OpenOwners, etc. */
LIST_FOREACH_SAFE(owp, >nfsc_owner, nfsow_list, nowp) {
___
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: r324073 - head/sys/kern

2017-09-27 Thread John Baldwin
Author: jhb
Date: Wed Sep 27 23:18:57 2017
New Revision: 324073
URL: https://svnweb.freebsd.org/changeset/base/324073

Log:
  Use UMA_ALIGNOF() for name cache UMA zones.
  
  This fixes kernel crashes due to misaligned accesses to the 64-bit
  time_t embedded in struct namecache_ts in MIPS n32 kernels.
  
  MFC after:1 week
  Sponsored by: DARPA / AFRL

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Wed Sep 27 23:15:33 2017(r324072)
+++ head/sys/kern/vfs_cache.c   Wed Sep 27 23:18:57 2017(r324073)
@@ -1754,16 +1754,20 @@ nchinit(void *dummy __unused)
 
cache_zone_small = uma_zcreate("S VFS Cache",
sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+   UMA_ZONE_ZINIT);
cache_zone_small_ts = uma_zcreate("STS VFS Cache",
sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+   UMA_ZONE_ZINIT);
cache_zone_large = uma_zcreate("L VFS Cache",
sizeof(struct namecache) + NAME_MAX + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+   UMA_ZONE_ZINIT);
cache_zone_large_ts = uma_zcreate("LTS VFS Cache",
sizeof(struct namecache_ts) + NAME_MAX + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+   UMA_ZONE_ZINIT);
 
nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, );
ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 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: r324072 - head/sys/vm

2017-09-27 Thread John Baldwin
Author: jhb
Date: Wed Sep 27 23:15:33 2017
New Revision: 324072
URL: https://svnweb.freebsd.org/changeset/base/324072

Log:
  Add UMA_ALIGNOF().
  
  This is a wrapper around _Alignof() that sets the alignment for a zone
  to the alignment required by a given type.  This allows the compiler to
  determine the proper alignment rather than having the programmer try to
  guess.
  
  Discussed on: arch@
  MFC after:1 week
  Sponsored by: DARPA / AFRL

Modified:
  head/sys/vm/uma.h

Modified: head/sys/vm/uma.h
==
--- head/sys/vm/uma.h   Wed Sep 27 19:48:34 2017(r324071)
+++ head/sys/vm/uma.h   Wed Sep 27 23:15:33 2017(r324072)
@@ -296,6 +296,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma
 #define UMA_ALIGN_SHORT(sizeof(short) - 1) /* "" short */
 #define UMA_ALIGN_CHAR (sizeof(char) - 1)  /* "" char */
 #define UMA_ALIGN_CACHE(0 - 1) /* Cache line size 
align */
+#defineUMA_ALIGNOF(type) (_Alignof(type) - 1)  /* Alignment fit for 
'type' */
 
 /*
  * Destroys an empty uma zone.  If the zone is not empty uma complains loudly.
___
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: r324071 - in head/sys: dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/siba mips/broadcom modules/bhnd/bhndb_pci

2017-09-27 Thread Landon J. Fuller
Author: landonf
Date: Wed Sep 27 19:48:34 2017
New Revision: 324071
URL: https://svnweb.freebsd.org/changeset/base/324071

Log:
  bhnd: Add support for supplying bus I/O callbacks when initializing an EROM
  parser.
  
  This allows us to use the EROM parser API in cases where the standard bus
  space I/O APIs are unsuitable. In particular, this will allow us to parse
  the device enumeration table directly from bhndb(4) drivers, prior to
  full attach and configuration of the bridge.
  
  Approved by:  adrian (mentor)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D12510

Added:
  head/sys/dev/bhnd/bhnd_eromvar.h   (contents, props changed)
Modified:
  head/sys/dev/bhnd/bcma/bcma.c
  head/sys/dev/bhnd/bcma/bcma_erom.c
  head/sys/dev/bhnd/bhnd_erom.c
  head/sys/dev/bhnd/bhnd_erom.h
  head/sys/dev/bhnd/bhnd_erom_if.m
  head/sys/dev/bhnd/bhndb/bhndb.c
  head/sys/dev/bhnd/bhndb/bhndb_pci.c
  head/sys/dev/bhnd/bhndb/bhndb_pcivar.h
  head/sys/dev/bhnd/bhndb/bhndb_private.h
  head/sys/dev/bhnd/bhndb/bhndb_subr.c
  head/sys/dev/bhnd/bhndb/bhndbvar.h
  head/sys/dev/bhnd/bhndreg.h
  head/sys/dev/bhnd/siba/siba.c
  head/sys/dev/bhnd/siba/siba_erom.c
  head/sys/mips/broadcom/bcm_machdep.c
  head/sys/mips/broadcom/bcm_machdep.h
  head/sys/modules/bhnd/bhndb_pci/Makefile

Modified: head/sys/dev/bhnd/bcma/bcma.c
==
--- head/sys/dev/bhnd/bcma/bcma.c   Wed Sep 27 19:44:23 2017
(r324070)
+++ head/sys/dev/bhnd/bcma/bcma.c   Wed Sep 27 19:48:34 2017
(r324071)
@@ -686,6 +686,7 @@ bcma_add_children(device_t bus)
 {
bhnd_erom_t *erom;
struct bcma_erom*bcma_erom;
+   struct bhnd_erom_io *eio;
const struct bhnd_chipid*cid;
struct bcma_corecfg *corecfg;
struct bcma_devinfo *dinfo;
@@ -696,9 +697,12 @@ bcma_add_children(device_t bus)
corecfg = NULL;
 
/* Allocate our EROM parser */
-   erom = bhnd_erom_alloc(_erom_parser, cid, bus, BCMA_EROM_RID);
-   if (erom == NULL)
+   eio = bhnd_erom_iores_new(bus, BCMA_EROM_RID);
+   erom = bhnd_erom_alloc(_erom_parser, cid, eio);
+   if (erom == NULL) {
+   bhnd_erom_io_fini(eio);
return (ENODEV);
+   }
 
/* Add all cores. */
bcma_erom = (struct bcma_erom *)erom;

Modified: head/sys/dev/bhnd/bcma/bcma_erom.c
==
--- head/sys/dev/bhnd/bcma/bcma_erom.c  Wed Sep 27 19:44:23 2017
(r324070)
+++ head/sys/dev/bhnd/bcma/bcma_erom.c  Wed Sep 27 19:48:34 2017
(r324071)
@@ -1,7 +1,11 @@
 /*-
- * Copyright (c) 2015 Landon Fuller 
+ * Copyright (c) 2015-2017 Landon Fuller 
+ * Copyright (c) 2017 The FreeBSD Foundation
  * All rights reserved.
  *
+ * Portions of this software were developed by Landon Fuller
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -58,13 +62,8 @@ __FBSDID("$FreeBSD$");
  * marker.
  */
 
-struct bcma_erom_io;
-
 static const char  *bcma_erom_entry_type_name (uint8_t entry);
 
-static uint32_t bcma_eio_read4(struct bcma_erom_io *io,
-bus_size_t offset);
-
 static int  bcma_erom_read32(struct bcma_erom *erom,
 uint32_t *entry);
 static int  bcma_erom_skip32(struct bcma_erom *erom);
@@ -105,37 +104,18 @@ static voidbcma_erom_to_core_info(const 
struct bcma
 struct bhnd_core_info *info);
 
 /**
- * BCMA EROM generic I/O context
- */
-struct bcma_erom_io {
-   struct bhnd_resource*res;   /**< memory resource, or NULL 
if initialized
-with bus space tag and 
handle */
-   int  rid;   /**< memory resource id, or -1 
*/
-
-   bus_space_tag_t  bst;   /**< bus space tag, if any */
-   bus_space_handle_t   bsh;   /**< bus space handle, if any */
-
-   bus_size_t   start; /**< base read offset */
-};
-
-/**
  * BCMA EROM per-instance state.
  */
 struct bcma_erom {
-   struct bhnd_eromobj;
-   device_tdev;/**< parent device, or NULL if none. */
-   struct bcma_erom_io io; /**< I/O context */
-   bus_size_t  offset; /**< current read offset */
+   struct bhnd_erom obj;
+   device_t dev;   /**< parent device, or NULL if 
none. */
+   struct bhnd_erom_io *eio;   /**< bus I/O callbacks */
+   bhnd_size_t  offset;

svn commit: r324070 - in head/sys: dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/chipc/pwrctl dev/bhnd/cores/pci dev/bhnd/cores/pmu dev/bhnd/nvram dev/bhnd/siba mips/broadcom

2017-09-27 Thread Landon J. Fuller
Author: landonf
Date: Wed Sep 27 19:44:23 2017
New Revision: 324070
URL: https://svnweb.freebsd.org/changeset/base/324070

Log:
  bhnd: Implement bhnd(4) platform device registration.
  
  Add bhnd(4) API for explicitly registering BHND platform devices (ChipCommon,
  PMU, NVRAM, etc) with the bus, rather than walking the newbus hierarchy to
  discover platform devices. These devices are now also refcounted; attempting
  to deregister an actively used platform device will return EBUSY.
  
  This resolves a lock ordering incompatibility with bwn(4)'s firmware loading
  threads; previously it was necessary to acquire Giant to protect newbus access
  when locating and querying the NVRAM device.
  
  Approved by:  adrian (mentor)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D12392

Added:
  head/sys/dev/bhnd/bhnd_private.h   (contents, props changed)
Modified:
  head/sys/dev/bhnd/bhnd.c
  head/sys/dev/bhnd/bhnd.h
  head/sys/dev/bhnd/bhnd_bus_if.m
  head/sys/dev/bhnd/bhnd_subr.c
  head/sys/dev/bhnd/bhnd_types.h
  head/sys/dev/bhnd/bhndb/bhnd_bhndb.c
  head/sys/dev/bhnd/bhndb/bhndb.c
  head/sys/dev/bhnd/bhndb/bhndbvar.h
  head/sys/dev/bhnd/bhndvar.h
  head/sys/dev/bhnd/cores/chipc/chipc.c
  head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c
  head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c
  head/sys/dev/bhnd/cores/pmu/bhnd_pmu.c
  head/sys/dev/bhnd/nvram/bhnd_sprom.c
  head/sys/dev/bhnd/siba/siba_bhndb.c
  head/sys/mips/broadcom/bcm_machdep.c
  head/sys/mips/broadcom/bcm_machdep.h
  head/sys/mips/broadcom/bcm_nvram_cfe.c
  head/sys/mips/broadcom/bhnd_nexus.c

Modified: head/sys/dev/bhnd/bhnd.c
==
--- head/sys/dev/bhnd/bhnd.cWed Sep 27 19:22:10 2017(r324069)
+++ head/sys/dev/bhnd/bhnd.cWed Sep 27 19:44:23 2017(r324070)
@@ -1,7 +1,11 @@
 /*-
  * Copyright (c) 2015-2016 Landon Fuller 
+ * Copyright (c) 2017 The FreeBSD Foundation
  * All rights reserved.
  *
+ * Portions of this software were developed by Landon Fuller
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -69,12 +73,10 @@ __FBSDID("$FreeBSD$");
 #include "bhnd.h"
 #include "bhndvar.h"
 
+#include "bhnd_private.h"
+
 MALLOC_DEFINE(M_BHND, "bhnd", "bhnd bus data structures");
 
-/* Bus pass at which all bus-required children must be available, and
- * attachment may be finalized. */
-#defineBHND_FINISH_ATTACH_PASS BUS_PASS_DEFAULT
-
 /**
  * bhnd_generic_probe_nomatch() reporting configuration.
  */
@@ -92,23 +94,8 @@ static const struct bhnd_nomatch {
{ BHND_MFGID_INVALID,   BHND_COREID_INVALID,false   }
 };
 
-
 static int  bhnd_delete_children(struct bhnd_softc *sc);
 
-static int  bhnd_finish_attach(struct bhnd_softc *sc);
-
-static device_t bhnd_find_chipc(struct bhnd_softc *sc);
-static struct chipc_caps   *bhnd_find_chipc_caps(struct bhnd_softc *sc);
-static device_t bhnd_find_platform_dev(struct 
bhnd_softc *sc,
-const char *classname);
-static device_t bhnd_find_pmu(struct bhnd_softc *sc);
-static device_t bhnd_find_nvram(struct bhnd_softc *sc);
-
-static int  compare_ascending_probe_order(const void *lhs,
-const void *rhs);
-static int  compare_descending_probe_order(const void *lhs,
-const void *rhs);
-
 /**
  * Default bhnd(4) bus driver implementation of DEVICE_ATTACH().
  *
@@ -119,8 +106,6 @@ int
 bhnd_generic_attach(device_t dev)
 {
struct bhnd_softc   *sc;
-   device_t*devs;
-   int  ndevs;
int  error;
 
if (device_is_attached(dev))
@@ -129,29 +114,13 @@ bhnd_generic_attach(device_t dev)
sc = device_get_softc(dev);
sc->dev = dev;
 
-   if ((error = device_get_children(dev, , )))
-   return (error);
-
/* Probe and attach all children */
-   qsort(devs, ndevs, sizeof(*devs), compare_ascending_probe_order);
-   for (int i = 0; i < ndevs; i++) {
-   device_t child = devs[i];
-   device_probe_and_attach(child);
+   if ((error = bhnd_bus_probe_children(dev))) {
+   bhnd_delete_children(sc);
+   return (error);
}
 
-   /* Try to finalize attachment */
-   if (bus_current_pass >= BHND_FINISH_ATTACH_PASS) {
-   if ((error = bhnd_finish_attach(sc)))
-   goto cleanup;
-   }
-
-cleanup:
-   free(devs, M_TEMP);
-
-   if (error)
-   

Re: svn commit: r324067 - in head/sys/dev/drm2: i915 radeon

2017-09-27 Thread Warner Losh
On Wed, Sep 27, 2017 at 1:14 PM, Conrad Meyer  wrote:

> Author: cem
> Date: Wed Sep 27 19:14:00 2017
> New Revision: 324067
> URL: https://svnweb.freebsd.org/changeset/base/324067
>
> Log:
>   Unrevert r324059
>
>   With a colon and bogus name ("#") added to appease the simplistic parser
>   used in kldxref.
>

'#' isn't a bogus name. It's the name reserved for 'ignore this'.

Warner


>   Sponsored by: Dell EMC Isilon
>
> Modified:
>   head/sys/dev/drm2/i915/i915_drv.c
>   head/sys/dev/drm2/radeon/radeon_drv.c
>
> Modified: head/sys/dev/drm2/i915/i915_drv.c
> 
> ==
> --- head/sys/dev/drm2/i915/i915_drv.c   Wed Sep 27 17:46:38 2017
> (r324066)
> +++ head/sys/dev/drm2/i915/i915_drv.c   Wed Sep 27 19:14:00 2017
> (r324067)
> @@ -1236,6 +1236,8 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iicbus, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iic, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iicbb, 1, 1, 1);
> +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, i915,
> pciidlist,
> +sizeof(pciidlist[0]), nitems(pciidlist));
>
>  /* We give fast paths for the really cool registers */
>  #define NEEDS_FORCE_WAKE(dev_priv, reg) \
>
> Modified: head/sys/dev/drm2/radeon/radeon_drv.c
> 
> ==
> --- head/sys/dev/drm2/radeon/radeon_drv.c   Wed Sep 27 17:46:38 2017
>   (r324066)
> +++ head/sys/dev/drm2/radeon/radeon_drv.c   Wed Sep 27 19:14:00 2017
>   (r324067)
> @@ -401,3 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, iic, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, firmware, 1, 1, 1);
> +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, radeonkms,
> +pciidlist, sizeof(pciidlist[0]), nitems(pciidlist));
>
>
___
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: r324069 - head/sys/dev/pccard

2017-09-27 Thread Warner Losh
Author: imp
Date: Wed Sep 27 19:22:10 2017
New Revision: 324069
URL: https://svnweb.freebsd.org/changeset/base/324069

Log:
  Since the human readable name is actually ignored, and not matching a
  'human' pnp string, change it to #, the name reserved for fields that
  are ignored.

Modified:
  head/sys/dev/pccard/pccardvar.h

Modified: head/sys/dev/pccard/pccardvar.h
==
--- head/sys/dev/pccard/pccardvar.h Wed Sep 27 19:21:52 2017
(r324068)
+++ head/sys/dev/pccard/pccardvar.h Wed Sep 27 19:22:10 2017
(r324069)
@@ -91,7 +91,7 @@ struct pccard_product {
  * are informative, according to the standard, but I have a dim memory of 
using these
  * strings to match things, though I can't find the example right now.
  */
-#define PCCARD_PNP_DESCR 
"D:human;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;"
+#define PCCARD_PNP_DESCR 
"D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;"
 #define PCCARD_PNP_INFO(t) \
MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) 
/ sizeof(t[0])); \
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324068 - head/sys/sys

2017-09-27 Thread Warner Losh
Author: imp
Date: Wed Sep 27 19:21:52 2017
New Revision: 324068
URL: https://svnweb.freebsd.org/changeset/base/324068

Log:
  Improve description of the PNP string a bit.

Modified:
  head/sys/sys/module.h

Modified: head/sys/sys/module.h
==
--- head/sys/sys/module.h   Wed Sep 27 19:14:00 2017(r324067)
+++ head/sys/sys/module.h   Wed Sep 27 19:21:52 2017(r324068)
@@ -183,7 +183,7 @@ struct mod_pnp_match_info 
&_module_pnp_##b##_##unique, #b);
 /**
  * descr is a string that describes each entry in the table. The general
- * form is (TYPE:pnp_name[/pnp_name];)*
+ * form is the grammar (TYPE:pnp_name[/pnp_name];)*
  * where TYPE is one of the following:
  * U8  uint8_t element
  * V8  like U8 and 0xff means match any
@@ -196,12 +196,14 @@ struct mod_pnp_match_info 
  * V32 like U32 and 0x means match any
  * W32 Two 16-bit values with first pnp_name in LSW and second in MSW.
  * Z   pointer to a string to match exactly
- * D   like Z, but is the string passed to device_set_descr()
+ * D   pointer to a string to human readable description for device
  * P   A pointer that should be ignored
  * E   EISA PNP Identifier (in binary, but bus publishes string)
  * K   Key for whole table. pnp_name=value. must be last, if present.
  *
  * The pnp_name "#" is reserved for other fields that should be ignored.
+ * Otherwise pnp_name must match the name from the parent device's pnpinfo
+ * output. The second pnp_name is used for the W32 type.
  */
 
 extern struct sx modules_sx;
___
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: r324067 - in head/sys/dev/drm2: i915 radeon

2017-09-27 Thread Conrad Meyer
Author: cem
Date: Wed Sep 27 19:14:00 2017
New Revision: 324067
URL: https://svnweb.freebsd.org/changeset/base/324067

Log:
  Unrevert r324059
  
  With a colon and bogus name ("#") added to appease the simplistic parser
  used in kldxref.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/dev/drm2/i915/i915_drv.c
  head/sys/dev/drm2/radeon/radeon_drv.c

Modified: head/sys/dev/drm2/i915/i915_drv.c
==
--- head/sys/dev/drm2/i915/i915_drv.c   Wed Sep 27 17:46:38 2017
(r324066)
+++ head/sys/dev/drm2/i915/i915_drv.c   Wed Sep 27 19:14:00 2017
(r324067)
@@ -1236,6 +1236,8 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1);
 MODULE_DEPEND(i915kms, iicbus, 1, 1, 1);
 MODULE_DEPEND(i915kms, iic, 1, 1, 1);
 MODULE_DEPEND(i915kms, iicbb, 1, 1, 1);
+MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, i915, pciidlist,
+sizeof(pciidlist[0]), nitems(pciidlist));
 
 /* We give fast paths for the really cool registers */
 #define NEEDS_FORCE_WAKE(dev_priv, reg) \

Modified: head/sys/dev/drm2/radeon/radeon_drv.c
==
--- head/sys/dev/drm2/radeon/radeon_drv.c   Wed Sep 27 17:46:38 2017
(r324066)
+++ head/sys/dev/drm2/radeon/radeon_drv.c   Wed Sep 27 19:14:00 2017
(r324067)
@@ -401,3 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1);
 MODULE_DEPEND(radeonkms, iic, 1, 1, 1);
 MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1);
 MODULE_DEPEND(radeonkms, firmware, 1, 1, 1);
+MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, radeonkms,
+pciidlist, sizeof(pciidlist[0]), nitems(pciidlist));
___
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: r324065 - head/sys/dev/qlxgbe

2017-09-27 Thread Ed Schouten
2017-09-27 19:46 GMT+02:00 David C Somayajulu :
> +   *(hw_tx_cntxt->tx_cons) = 0;

In this case the parentheses are superfluous, right? -> has a higher
precedence than *.

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
___
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: r324065 - head/sys/dev/qlxgbe

2017-09-27 Thread David C Somayajulu
Author: davidcs
Date: Wed Sep 27 17:46:11 2017
New Revision: 324065
URL: https://svnweb.freebsd.org/changeset/base/324065

Log:
  Tx Ring Shadow Consumer Index Register needs to be cleared prior
  to passing it's physical address to the FW during Tx Create Context.
  
  MFC after:3 days

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

Modified: head/sys/dev/qlxgbe/ql_hw.c
==
--- head/sys/dev/qlxgbe/ql_hw.c Wed Sep 27 16:12:13 2017(r324064)
+++ head/sys/dev/qlxgbe/ql_hw.c Wed Sep 27 17:46:11 2017(r324065)
@@ -3248,6 +3248,7 @@ qla_init_xmt_cntxt_i(qla_host_t *ha, uint32_t txr_idx)
 
hw_tx_cntxt->txr_free = NUM_TX_DESCRIPTORS;
hw_tx_cntxt->txr_next = hw_tx_cntxt->txr_comp = 0;
+   *(hw_tx_cntxt->tx_cons) = 0;
 
 if (qla_mbx_cmd(ha, (uint32_t *)tcntxt,
(sizeof (q80_rq_tx_cntxt_t) >> 2),
___
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: r324066 - in head/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/dev cddl/dev/dtmalloc cddl/dev/fbt cddl/dev/profile cddl/dev/sdt cddl/dev/systrace fs/nfsclient

2017-09-27 Thread Mark Johnston
Author: markj
Date: Wed Sep 27 17:46:38 2017
New Revision: 324066
URL: https://svnweb.freebsd.org/changeset/base/324066

Log:
  Use C99 initializers for DTrace provider methods.
  
  This makes the definitions easier to read and more cscope-friendly.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/cddl/dev/dtmalloc/dtmalloc.c
  head/sys/cddl/dev/fbt/fbt.c
  head/sys/cddl/dev/profile/profile.c
  head/sys/cddl/dev/prototype.c
  head/sys/cddl/dev/sdt/sdt.c
  head/sys/cddl/dev/systrace/systrace.c
  head/sys/fs/nfsclient/nfs_clkdtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Sep 
27 17:46:11 2017(r324065)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Sep 
27 17:46:38 2017(r324066)
@@ -339,17 +339,17 @@ static void
 dtrace_nullop(void)
 {}
 
-static dtrace_pops_t   dtrace_provider_ops = {
-   (void (*)(void *, dtrace_probedesc_t *))dtrace_nullop,
-   (void (*)(void *, modctl_t *))dtrace_nullop,
-   (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
-   (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
-   (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
-   (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
-   NULL,
-   NULL,
-   NULL,
-   (void (*)(void *, dtrace_id_t, void *))dtrace_nullop
+static dtrace_pops_t dtrace_provider_ops = {
+   .dtps_provide = (void (*)(void *, dtrace_probedesc_t *))dtrace_nullop,
+   .dtps_provide_module =  (void (*)(void *, modctl_t *))dtrace_nullop,
+   .dtps_enable =  (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
+   .dtps_disable = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
+   .dtps_suspend = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
+   .dtps_resume =  (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
+   .dtps_getargdesc =  NULL,
+   .dtps_getargval =   NULL,
+   .dtps_usermode =NULL,
+   .dtps_destroy = (void (*)(void *, dtrace_id_t, void *))dtrace_nullop,
 };
 
 static dtrace_id_t dtrace_probeid_begin;   /* special BEGIN probe */

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Wed Sep 
27 17:46:11 2017(r324065)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Wed Sep 
27 17:46:38 2017(r324066)
@@ -1455,29 +1455,29 @@ static const dtrace_pattr_t pid_attr = {
 };
 
 static dtrace_pops_t pid_pops = {
-   fasttrap_pid_provide,
-   NULL,
-   fasttrap_pid_enable,
-   fasttrap_pid_disable,
-   NULL,
-   NULL,
-   fasttrap_pid_getargdesc,
-   fasttrap_pid_getarg,
-   NULL,
-   fasttrap_pid_destroy
+   .dtps_provide = fasttrap_pid_provide,
+   .dtps_provide_module =  NULL,
+   .dtps_enable =  fasttrap_pid_enable,
+   .dtps_disable = fasttrap_pid_disable,
+   .dtps_suspend = NULL,
+   .dtps_resume =  NULL,
+   .dtps_getargdesc =  fasttrap_pid_getargdesc,
+   .dtps_getargval =   fasttrap_pid_getarg,
+   .dtps_usermode =NULL,
+   .dtps_destroy = fasttrap_pid_destroy
 };
 
 static dtrace_pops_t usdt_pops = {
-   fasttrap_pid_provide,
-   NULL,
-   fasttrap_pid_enable,
-   fasttrap_pid_disable,
-   NULL,
-   NULL,
-   fasttrap_pid_getargdesc,
-   fasttrap_usdt_getarg,
-   NULL,
-   fasttrap_pid_destroy
+   .dtps_provide = fasttrap_pid_provide,
+   .dtps_provide_module =  NULL,
+   .dtps_enable =  fasttrap_pid_enable,
+   .dtps_disable = fasttrap_pid_disable,
+   .dtps_suspend = NULL,
+   .dtps_resume =  NULL,
+   .dtps_getargdesc =  fasttrap_pid_getargdesc,
+   .dtps_getargval =   fasttrap_usdt_getarg,
+   .dtps_usermode =NULL,
+   .dtps_destroy = fasttrap_pid_destroy
 };
 
 static fasttrap_proc_t *
@@ -2251,9 +2251,9 @@ fasttrap_meta_remove(void *arg, dtrace_helper_provdesc
 }
 
 static dtrace_mops_t fasttrap_mops = {
-   fasttrap_meta_create_probe,
-   fasttrap_meta_provide,
-   fasttrap_meta_remove
+   .dtms_create_probe =fasttrap_meta_create_probe,
+   .dtms_provide_pid = fasttrap_meta_provide,
+   .dtms_remove_pid =  fasttrap_meta_remove
 };
 
 /*ARGSUSED*/

Modified: head/sys/cddl/dev/dtmalloc/dtmalloc.c
==
--- head/sys/cddl/dev/dtmalloc/dtmalloc.c   Wed Sep 27 

svn commit: r324064 - head/sys/fs/ext2fs

2017-09-27 Thread Fedor Uporov
Author: fsu
Date: Wed Sep 27 16:12:13 2017
New Revision: 324064
URL: https://svnweb.freebsd.org/changeset/base/324064

Log:
  Add check to avoid raw inode iblocks fields overflow in case of huge_file 
feature.
  Use the Linux logic for now.
  
  Reviewed by:pfg (mentor)
  Approved by:pfg (mentor)
  MFC after:  2 weeks
  Differential Revision: https://reviews.freebsd.org/D12131

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c
  head/sys/fs/ext2fs/ext2_extern.h
  head/sys/fs/ext2fs/ext2_inode.c
  head/sys/fs/ext2fs/ext2_inode_cnv.c

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Wed Sep 27 15:29:17 2017
(r324063)
+++ head/sys/fs/ext2fs/ext2_alloc.c Wed Sep 27 16:12:13 2017
(r324064)
@@ -56,7 +56,6 @@
 static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int);
 static daddr_t ext2_clusteralloc(struct inode *, int, daddr_t, int);
 static u_long  ext2_dirpref(struct inode *);
-static voidext2_fserr(struct m_ext2fs *, uid_t, char *);
 static u_long  ext2_hashalloc(struct inode *, int, long, int,
daddr_t (*)(struct inode *, int, daddr_t, 
int));
@@ -1303,7 +1302,7 @@ ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t
  * The form of the error message is:
  * fs: error message
  */
-static void
+void
 ext2_fserr(struct m_ext2fs *fs, uid_t uid, char *cp)
 {
 

Modified: head/sys/fs/ext2fs/ext2_extern.h
==
--- head/sys/fs/ext2fs/ext2_extern.hWed Sep 27 15:29:17 2017
(r324063)
+++ head/sys/fs/ext2fs/ext2_extern.hWed Sep 27 16:12:13 2017
(r324064)
@@ -62,9 +62,10 @@ int  ext2_bmap(struct vop_bmap_args *);
 intext2_bmaparray(struct vnode *, daddr_t, daddr_t *, int *, int *);
 void   ext2_clusteracct(struct m_ext2fs *, char *, int, daddr_t, int);
 void   ext2_dirbad(struct inode *ip, doff_t offset, char *how);
+void   ext2_fserr(struct m_ext2fs *, uid_t, char *);
 void   ext2_ei2i(struct ext2fs_dinode *, struct inode *);
 intext2_getlbns(struct vnode *, daddr_t, struct indir *, int *);
-void   ext2_i2ei(struct inode *, struct ext2fs_dinode *);
+intext2_i2ei(struct inode *, struct ext2fs_dinode *);
 void   ext2_itimes(struct vnode *vp);
 intext2_reallocblks(struct vop_reallocblks_args *);
 intext2_reclaim(struct vop_reclaim_args *);

Modified: head/sys/fs/ext2fs/ext2_inode.c
==
--- head/sys/fs/ext2fs/ext2_inode.c Wed Sep 27 15:29:17 2017
(r324063)
+++ head/sys/fs/ext2fs/ext2_inode.c Wed Sep 27 16:12:13 2017
(r324064)
@@ -90,8 +90,12 @@ ext2_update(struct vnode *vp, int waitfor)
brelse(bp);
return (error);
}
-   ext2_i2ei(ip, (struct ext2fs_dinode *)((char *)bp->b_data +
+   error = ext2_i2ei(ip, (struct ext2fs_dinode *)((char *)bp->b_data +
EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)));
+   if (error) {
+   brelse(bp);
+   return (error);
+   }
if (waitfor && !DOINGASYNC(vp))
return (bwrite(bp));
else {

Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c
==
--- head/sys/fs/ext2fs/ext2_inode_cnv.c Wed Sep 27 15:29:17 2017
(r324063)
+++ head/sys/fs/ext2fs/ext2_inode_cnv.c Wed Sep 27 16:12:13 2017
(r324064)
@@ -136,11 +136,13 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip)
 /*
  * inode to raw ext2 inode
  */
-void
+int
 ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei)
 {
+   struct m_ext2fs *fs;
int i;
 
+   fs = ip->i_e2fs;
ei->e2di_mode = ip->i_mode;
ei->e2di_nlink = ip->i_nlink;
/*
@@ -167,8 +169,19 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei)
ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP : 0;
ei->e2di_flags |= (ip->i_flag & IN_E3INDEX) ? EXT3_INDEX : 0;
ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS : 0;
-   ei->e2di_nblock = ip->i_blocks & 0x;
-   ei->e2di_nblock_high = ip->i_blocks >> 32 & 0x;
+   if (ip->i_blocks > ~0U &&
+   !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_HUGE_FILE)) {
+   ext2_fserr(fs, ip->i_uid, "i_blocks value is out of range");
+   return (EIO);
+   }
+   if (ip->i_blocks <= 0xULL) {
+   ei->e2di_nblock = ip->i_blocks & 0x;
+   ei->e2di_nblock_high = ip->i_blocks >> 32 & 0x;
+   } else {
+   ei->e2di_flags |= EXT4_HUGE_FILE;
+   ei->e2di_nblock = dbtofsb(fs, ip->i_blocks);
+   ei->e2di_nblock_high = dbtofsb(fs, ip->i_blocks) >> 32 & 0x;
+   }

svn commit: r324059 - in head/sys/dev/drm2: i915 radeon

2017-09-27 Thread Conrad Meyer
Author: cem
Date: Wed Sep 27 14:59:18 2017
New Revision: 324059
URL: https://svnweb.freebsd.org/changeset/base/324059

Log:
  Remove PNP metadata from drm2 drivers until kldxref problem is resolved
  
  Reported by:  np
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/dev/drm2/i915/i915_drv.c
  head/sys/dev/drm2/radeon/radeon_drv.c

Modified: head/sys/dev/drm2/i915/i915_drv.c
==
--- head/sys/dev/drm2/i915/i915_drv.c   Wed Sep 27 14:19:47 2017
(r324058)
+++ head/sys/dev/drm2/i915/i915_drv.c   Wed Sep 27 14:59:18 2017
(r324059)
@@ -1236,8 +1236,6 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1);
 MODULE_DEPEND(i915kms, iicbus, 1, 1, 1);
 MODULE_DEPEND(i915kms, iic, 1, 1, 1);
 MODULE_DEPEND(i915kms, iicbb, 1, 1, 1);
-MODULE_PNP_INFO("U32:vendor;U32:device;P;D:human", vgapci, i915, pciidlist,
-sizeof(pciidlist[0]), nitems(pciidlist));
 
 /* We give fast paths for the really cool registers */
 #define NEEDS_FORCE_WAKE(dev_priv, reg) \

Modified: head/sys/dev/drm2/radeon/radeon_drv.c
==
--- head/sys/dev/drm2/radeon/radeon_drv.c   Wed Sep 27 14:19:47 2017
(r324058)
+++ head/sys/dev/drm2/radeon/radeon_drv.c   Wed Sep 27 14:59:18 2017
(r324059)
@@ -401,5 +401,3 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1);
 MODULE_DEPEND(radeonkms, iic, 1, 1, 1);
 MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1);
 MODULE_DEPEND(radeonkms, firmware, 1, 1, 1);
-MODULE_PNP_INFO("U32:vendor;U32:device;P;D:human", vgapci, radeonkms,
-pciidlist, sizeof(pciidlist[0]), nitems(pciidlist));
___
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: r324038 - in head/sys: dev/bnxt dev/drm dev/drm2/i915 dev/drm2/radeon dev/e1000 net

2017-09-27 Thread Pintér , Olivér
On Wed, Sep 27, 2017 at 1:23 AM, Conrad Meyer  wrote:

> Author: cem
> Date: Tue Sep 26 23:23:58 2017
> New Revision: 324038
> URL: https://svnweb.freebsd.org/changeset/base/324038
>
> Log:
>   Add PNP metadata to more drivers
>
>   GPUs: radeonkms, i915kms
>   NICs: if_em, if_igb, if_bnxt
>
>   This metadata isn't used yet, but it will be handy to have later to
>   implement automatic module loading.
>
>   Reviewed by:  imp, mmacy
>   Sponsored by: Dell EMC Isilon
>   Differential Revision:https://reviews.freebsd.org/D12488
>
> Modified:
>   head/sys/dev/bnxt/if_bnxt.c
>   head/sys/dev/drm/drmP.h
>   head/sys/dev/drm2/i915/i915_drv.c
>   head/sys/dev/drm2/radeon/radeon_drv.c
>   head/sys/dev/e1000/if_em.c
>   head/sys/net/iflib.h
>
> Modified: head/sys/dev/bnxt/if_bnxt.c
> 
> ==
> --- head/sys/dev/bnxt/if_bnxt.c Tue Sep 26 23:12:32 2017(r324037)
> +++ head/sys/dev/bnxt/if_bnxt.c Tue Sep 26 23:23:58 2017(r324038)
> @@ -243,6 +243,8 @@ MODULE_DEPEND(bnxt, pci, 1, 1, 1);
>  MODULE_DEPEND(bnxt, ether, 1, 1, 1);
>  MODULE_DEPEND(bnxt, iflib, 1, 1, 1);
>
> +IFLIB_PNP_INFO(pci, bnxt, bnxt_vendor_info_array);
> +
>  static device_method_t bnxt_iflib_methods[] = {
> DEVMETHOD(ifdi_tx_queues_alloc, bnxt_tx_queues_alloc),
> DEVMETHOD(ifdi_rx_queues_alloc, bnxt_rx_queues_alloc),
>
> Modified: head/sys/dev/drm/drmP.h
> 
> ==
> --- head/sys/dev/drm/drmP.h Tue Sep 26 23:12:32 2017(r324037)
> +++ head/sys/dev/drm/drmP.h Tue Sep 26 23:23:58 2017(r324038)
> @@ -321,7 +321,7 @@ typedef struct drm_pci_id_list
>  {
> int vendor;
> int device;
> -   long driver_private;
> +   intptr_t driver_private;
> char *name;
>  } drm_pci_id_list_t;
>
>
> Modified: head/sys/dev/drm2/i915/i915_drv.c
> 
> ==
> --- head/sys/dev/drm2/i915/i915_drv.c   Tue Sep 26 23:12:32 2017
> (r324037)
> +++ head/sys/dev/drm2/i915/i915_drv.c   Tue Sep 26 23:23:58 2017
> (r324038)
> @@ -1236,6 +1236,8 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iicbus, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iic, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iicbb, 1, 1, 1);
> +MODULE_PNP_INFO("U32:vendor;U32:device;P;D:human", vgapci, i915,
> pciidlist,
> +sizeof(pciidlist[0]), nitems(pciidlist));
>
>  /* We give fast paths for the really cool registers */
>  #define NEEDS_FORCE_WAKE(dev_priv, reg) \
>
> Modified: head/sys/dev/drm2/radeon/radeon_drv.c
> 
> ==
> --- head/sys/dev/drm2/radeon/radeon_drv.c   Tue Sep 26 23:12:32 2017
>   (r324037)
> +++ head/sys/dev/drm2/radeon/radeon_drv.c   Tue Sep 26 23:23:58 2017
>   (r324038)
> @@ -401,3 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, iic, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, firmware, 1, 1, 1);
> +MODULE_PNP_INFO("U32:vendor;U32:device;P;D:human", vgapci, radeonkms,
> +pciidlist, sizeof(pciidlist[0]), nitems(pciidlist));
>
> Modified: head/sys/dev/e1000/if_em.c
> 
> ==
> --- head/sys/dev/e1000/if_em.c  Tue Sep 26 23:12:32 2017(r324037)
> +++ head/sys/dev/e1000/if_em.c  Tue Sep 26 23:23:58 2017(r324038)
> @@ -339,6 +339,8 @@ MODULE_DEPEND(em, pci, 1, 1, 1);
>  MODULE_DEPEND(em, ether, 1, 1, 1);
>  MODULE_DEPEND(em, iflib, 1, 1, 1);
>
> +IFLIB_PNP_INFO(pci, em, em_vendor_info_array);
> +
>  static driver_t igb_driver = {
> "igb", igb_methods, sizeof(struct adapter),
>  };
> @@ -350,6 +352,7 @@ MODULE_DEPEND(igb, pci, 1, 1, 1);
>  MODULE_DEPEND(igb, ether, 1, 1, 1);
>  MODULE_DEPEND(igb, iflib, 1, 1, 1);
>
> +IFLIB_PNP_INFO(pci, igb, igb_vendor_info_array);
>
>  static device_method_t em_if_methods[] = {
> DEVMETHOD(ifdi_attach_pre, em_if_attach_pre),
>
> Modified: head/sys/net/iflib.h
> 
> ==
> --- head/sys/net/iflib.hTue Sep 26 23:12:32 2017(r324037)
> +++ head/sys/net/iflib.hTue Sep 26 23:23:58 2017(r324038)
> @@ -173,6 +173,11 @@ typedef struct pci_vendor_info {
>  #define PVID_OEM(vendor, devid, svid, sdevid, revid, name) {vendor,
> devid, svid, sdevid, revid, 0, name}
>  #define PVID_END {0, 0, 0, 0, 0, 0, NULL}
>
> +#define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;"
> \
> +"U32:revision;U32:class;D:human"
>
This will be MODULE_PNP_INFO.



> +#define IFLIB_PNP_INFO(b, u, t) \
> +MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t))
>
And this IFLIB_PNP_DESCR.


> +
>  typedef struct if_txrx {
> int (*ift_txd_encap) (void *, 

svn commit: r324056 - head/sys/netinet

2017-09-27 Thread Michael Tuexen
Author: tuexen
Date: Wed Sep 27 13:05:23 2017
New Revision: 324056
URL: https://svnweb.freebsd.org/changeset/base/324056

Log:
  Remove unused function.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_asconf.h

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Wed Sep 27 11:31:11 2017
(r324055)
+++ head/sys/netinet/sctp_asconf.c  Wed Sep 27 13:05:23 2017
(r324056)
@@ -2305,39 +2305,6 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, 
return (0);
 }
 
-void
-sctp_set_primary_ip_address(struct sctp_ifa *ifa)
-{
-   struct sctp_inpcb *inp;
-
-   /* go through all our PCB's */
-   LIST_FOREACH(inp, _BASE_INFO(listhead), sctp_list) {
-   struct sctp_tcb *stcb;
-
-   /* process for all associations for this endpoint */
-   LIST_FOREACH(stcb, >sctp_asoc_list, sctp_tcblist) {
-   /* queue an ASCONF:SET_PRIM_ADDR to be sent */
-   if (!sctp_asconf_queue_add(stcb, ifa,
-   SCTP_SET_PRIM_ADDR)) {
-   /* set primary queuing succeeded */
-   SCTPDBG(SCTP_DEBUG_ASCONF1, 
"set_primary_ip_address: queued on stcb=%p, ",
-   (void *)stcb);
-   SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, 
>address.sa);
-   if ((SCTP_GET_STATE(>asoc) == 
SCTP_STATE_OPEN) ||
-   (SCTP_GET_STATE(>asoc) == 
SCTP_STATE_SHUTDOWN_RECEIVED)) {
-#ifdef SCTP_TIMER_BASED_ASCONF
-   sctp_timer_start(SCTP_TIMER_TYPE_ASCONF,
-   stcb->sctp_ep, stcb,
-   stcb->asoc.primary_destination);
-#else
-   sctp_send_asconf(stcb, NULL, 
SCTP_ADDR_NOT_LOCKED);
-#endif
-   }
-   }
-   }   /* for each stcb */
-   }   /* for each inp */
-}
-
 int
 sctp_is_addr_pending(struct sctp_tcb *stcb, struct sctp_ifa *sctp_ifa)
 {

Modified: head/sys/netinet/sctp_asconf.h
==
--- head/sys/netinet/sctp_asconf.h  Wed Sep 27 11:31:11 2017
(r324055)
+++ head/sys/netinet/sctp_asconf.h  Wed Sep 27 13:05:23 2017
(r324056)
@@ -73,9 +73,6 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *,
 struct sockaddr *);
 
 extern void
- sctp_set_primary_ip_address(struct sctp_ifa *ifa);
-
-extern void
 sctp_check_address_list(struct sctp_tcb *, struct mbuf *, int, int,
 struct sockaddr *, uint16_t, uint16_t, uint16_t, uint16_t);
 
___
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: r324054 - head/sys/kern

2017-09-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Sep 27 09:39:16 2017
New Revision: 324054
URL: https://svnweb.freebsd.org/changeset/base/324054

Log:
  vfs_export: Simplify vfs_export_lookup
  
  If the filesystem is not exported directly return NULL.
  If no address is given and filesystem is exported using some default
  one return it directly, if it doesn't have a default one directly
  return NULL.
  
  Reviewed by:  kib, bapt
  MFC after:1 week
  Sponsored by: Gandi.net
  Differential Revision:https://reviews.freebsd.org/D12505

Modified:
  head/sys/kern/vfs_export.c

Modified: head/sys/kern/vfs_export.c
==
--- head/sys/kern/vfs_export.c  Wed Sep 27 06:33:55 2017(r324053)
+++ head/sys/kern/vfs_export.c  Wed Sep 27 09:39:16 2017(r324054)
@@ -448,44 +448,46 @@ static struct netcred *
 vfs_export_lookup(struct mount *mp, struct sockaddr *nam)
 {
struct netexport *nep;
-   struct netcred *np;
+   struct netcred *np = NULL;
struct radix_node_head *rnh;
struct sockaddr *saddr;
 
nep = mp->mnt_export;
if (nep == NULL)
return (NULL);
-   np = NULL;
-   if (mp->mnt_flag & MNT_EXPORTED) {
-   /*
-* Lookup in the export list first.
-*/
-   if (nam != NULL) {
-   saddr = nam;
-   rnh = NULL;
-   switch (saddr->sa_family) {
-   case AF_INET:
-   rnh = nep->ne4;
-   break;
-   case AF_INET6:
-   rnh = nep->ne6;
-   break;
-   }
-   if (rnh != NULL) {
-   RADIX_NODE_HEAD_RLOCK(rnh);
-   np = (struct netcred *)
-   (*rnh->rnh_matchaddr)(saddr, >rh);
-   RADIX_NODE_HEAD_RUNLOCK(rnh);
-   if (np && np->netc_rnodes->rn_flags & RNF_ROOT)
-   np = NULL;
-   }
-   }
-   /*
-* If no address match, use the default if it exists.
-*/
-   if (np == NULL && mp->mnt_flag & MNT_DEFEXPORTED)
-   np = >ne_defexported;
+   if ((mp->mnt_flag & MNT_EXPORTED) == 0)
+   return (NULL);
+
+   /*
+* If no address is provided, use the default if it exists.
+*/
+   if (nam == NULL) {
+   if ((mp->mnt_flag & MNT_DEFEXPORTED) != 0)
+   return (>ne_defexported);
+   return (NULL);
}
+
+   /*
+* Lookup in the export list
+*/
+   saddr = nam;
+   rnh = NULL;
+   switch (saddr->sa_family) {
+   case AF_INET:
+   rnh = nep->ne4;
+   break;
+   case AF_INET6:
+   rnh = nep->ne6;
+   break;
+   }
+   if (rnh != NULL) {
+   RADIX_NODE_HEAD_RLOCK(rnh);
+   np = (struct netcred *) (*rnh->rnh_matchaddr)(saddr, >rh);
+   RADIX_NODE_HEAD_RUNLOCK(rnh);
+   if (np != NULL && (np->netc_rnodes->rn_flags & RNF_ROOT) != 0)
+   return (NULL);
+   }
+
return (np);
 }
 
___
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: r324053 - head/sys/sys

2017-09-27 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Sep 27 06:33:55 2017
New Revision: 324053
URL: https://svnweb.freebsd.org/changeset/base/324053

Log:
  kernel: Bump __FreeBSD_version for the removal of M_HASHTYPE_RSS_UDP_IPV4_EX
  
  Sponsored by: Microsoft

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Sep 27 06:31:35 2017(r324052)
+++ head/sys/sys/param.hWed Sep 27 06:33:55 2017(r324053)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200046  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200047  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r324052 - head/sys/sys

2017-09-27 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Sep 27 06:31:35 2017
New Revision: 324052
URL: https://svnweb.freebsd.org/changeset/base/324052

Log:
  mbuf: Remove UDP_IPV4_EX, which was never defined.
  
  Add comment to explain the IPV6_EX suffix.  The confusion about
  these RSS hash type probably stems from the facts that they were
  never widely implemented by hardwares.
  
  Reviewed by:  rwatson
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D12453

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Wed Sep 27 05:59:54 2017(r324051)
+++ head/sys/sys/mbuf.h Wed Sep 27 06:31:35 2017(r324052)
@@ -335,6 +335,16 @@ struct mbuf {
  * for ordering and distribution without explicit affinity.  Additionally,
  * M_HASHTYPE_OPAQUE_HASH indicates that the flow identifier has hash
  * properties.
+ *
+ * The meaning of the IPV6_EX suffix:
+ * "o  Home address from the home address option in the IPv6 destination
+ * options header.  If the extension header is not present, use the Source
+ * IPv6 Address.
+ *  o  IPv6 address that is contained in the Routing-Header-Type-2 from the
+ * associated extension header.  If the extension header is not present,
+ * use the Destination IPv6 Address."
+ * Quoted from:
+ * 
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/rss-hashing-types#ndishashipv6ex
  */
 #defineM_HASHTYPE_HASHPROP 0x80/* has hash properties 
*/
 #defineM_HASHTYPE_HASH(t)  (M_HASHTYPE_HASHPROP | (t))
@@ -348,10 +358,7 @@ struct mbuf {
* ext hdrs */
 #defineM_HASHTYPE_RSS_TCP_IPV6_EX  M_HASHTYPE_HASH(6) /* TCPv6 
4-tuple +
* ext hdrs */
-/* Non-standard RSS hash types */
 #defineM_HASHTYPE_RSS_UDP_IPV4 M_HASHTYPE_HASH(7) /* IPv4 UDP 
4-tuple*/
-#defineM_HASHTYPE_RSS_UDP_IPV4_EX  M_HASHTYPE_HASH(8) /* IPv4 UDP 
4-tuple +
-   * ext hdrs */
 #defineM_HASHTYPE_RSS_UDP_IPV6 M_HASHTYPE_HASH(9) /* IPv6 UDP 
4-tuple*/
 #defineM_HASHTYPE_RSS_UDP_IPV6_EX  M_HASHTYPE_HASH(10)/* IPv6 UDP 
4-tuple +
* ext hdrs */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r324051 - head/sys/dev/ixl

2017-09-27 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Sep 27 05:59:54 2017
New Revision: 324051
URL: https://svnweb.freebsd.org/changeset/base/324051

Log:
  ixl: Fix mbuf hash type settings.
  
  IPV6_EXs in RSS never mean fragment.  They mean:
  "- Home address from the home address option in the IPv6 destination
 options header.  If the extension header is not present, use the
 Source IPv6 Address.
   - IPv6 address that is contained in the Routing-Header-Type-2 from
 the associated extension header.  If the extension header is not
 present, use the Destination IPv6 Address."
  
  UDP_IPV4_EX is an invalid RSS hash type, which will be removed.
  
  Quoted from:
  
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/rss-hashing-types#ndishashipv6ex
  
  Reviewed by:  erj
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D12450

Modified:
  head/sys/dev/ixl/ixl_txrx.c

Modified: head/sys/dev/ixl/ixl_txrx.c
==
--- head/sys/dev/ixl/ixl_txrx.c Wed Sep 27 05:52:37 2017(r324050)
+++ head/sys/dev/ixl/ixl_txrx.c Wed Sep 27 05:59:54 2017(r324051)
@@ -1446,10 +1446,8 @@ static inline int
 ixl_ptype_to_hash(u8 ptype)
 {
 struct i40e_rx_ptype_decoded   decoded;
-   u8  ex = 0;
 
decoded = decode_rx_desc_ptype(ptype);
-   ex = decoded.outer_frag;
 
if (!decoded.known)
return M_HASHTYPE_OPAQUE_HASH;
@@ -1460,34 +1458,22 @@ ixl_ptype_to_hash(u8 ptype)
/* Note: anything that gets to this point is IP */
 if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV6) { 
switch (decoded.inner_prot) {
-   case I40E_RX_PTYPE_INNER_PROT_TCP:
-   if (ex)
-   return M_HASHTYPE_RSS_TCP_IPV6_EX;
-   else
-   return M_HASHTYPE_RSS_TCP_IPV6;
-   case I40E_RX_PTYPE_INNER_PROT_UDP:
-   if (ex)
-   return M_HASHTYPE_RSS_UDP_IPV6_EX;
-   else
-   return M_HASHTYPE_RSS_UDP_IPV6;
-   default:
-   if (ex)
-   return M_HASHTYPE_RSS_IPV6_EX;
-   else
-   return M_HASHTYPE_RSS_IPV6;
+   case I40E_RX_PTYPE_INNER_PROT_TCP:
+   return M_HASHTYPE_RSS_TCP_IPV6;
+   case I40E_RX_PTYPE_INNER_PROT_UDP:
+   return M_HASHTYPE_RSS_UDP_IPV6;
+   default:
+   return M_HASHTYPE_RSS_IPV6;
}
}
 if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV4) { 
switch (decoded.inner_prot) {
-   case I40E_RX_PTYPE_INNER_PROT_TCP:
-   return M_HASHTYPE_RSS_TCP_IPV4;
-   case I40E_RX_PTYPE_INNER_PROT_UDP:
-   if (ex)
-   return M_HASHTYPE_RSS_UDP_IPV4_EX;
-   else
-   return M_HASHTYPE_RSS_UDP_IPV4;
-   default:
-   return M_HASHTYPE_RSS_IPV4;
+   case I40E_RX_PTYPE_INNER_PROT_TCP:
+   return M_HASHTYPE_RSS_TCP_IPV4;
+   case I40E_RX_PTYPE_INNER_PROT_UDP:
+   return M_HASHTYPE_RSS_UDP_IPV4;
+   default:
+   return M_HASHTYPE_RSS_IPV4;
}
}
/* We should never get here!! */
___
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"