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

2017-01-24 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 24 16:05:42 2017
New Revision: 312698
URL: https://svnweb.freebsd.org/changeset/base/312698

Log:
  iflib:
   Add internal tracking of smp startup status to reliably figure out
   what methods are to be used to get gtaskqueue up and running.
  
  e1000:
   Calculating this pointer gives undefined behaviour when (last == -1)
   (it is before the buffer).  The pointer is always followed.  Panics
   occurred when it points to an unmapped page.  Otherwise, the pointed-to
   garbage tends to not have the E1000_TXD_STAT_DD bit set in it, so in the
   broken case the loop was usually null and the function just returned, and
   this was acidentally correct.
  
  Submitted by: bde
  Reported by:  Matt Macy 

Modified:
  head/sys/dev/e1000/em_txrx.c
  head/sys/kern/subr_gtaskqueue.c
  head/sys/net/iflib.c
  head/sys/sys/gtaskqueue.h

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cTue Jan 24 15:55:52 2017
(r312697)
+++ head/sys/dev/e1000/em_txrx.cTue Jan 24 16:05:42 2017
(r312698)
@@ -408,10 +408,13 @@ em_isc_txd_credits_update(void *arg, uin
cidx = cidx_init;
buf = &txr->tx_buffers[cidx];
tx_desc = &txr->tx_base[cidx];
-last = buf->eop;
+   last = buf->eop;
+   if (last == -1)
+   return (processed);
eop_desc = &txr->tx_base[last];
 
-   DPRINTF(iflib_get_dev(adapter->ctx), "credits_update: cidx_init=%d 
clear=%d last=%d\n",
+   DPRINTF(iflib_get_dev(adapter->ctx),
+ "credits_update: cidx_init=%d clear=%d last=%d\n",
  cidx_init, clear, last);
/*
 * What this does is get the index of the
@@ -420,7 +423,7 @@ em_isc_txd_credits_update(void *arg, uin
 * simple comparison on the inner while loop.
 */
if (++last == scctx->isc_ntxd[0])
-last = 0;
+   last = 0;
done = last;
 
 
@@ -436,7 +439,7 @@ em_isc_txd_credits_update(void *arg, uin
tx_desc++;
buf++;
processed++;
- 
+
/* wrap the ring ? */
if (++cidx == scctx->isc_ntxd[0]) {
cidx = 0;

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Jan 24 15:55:52 2017
(r312697)
+++ head/sys/kern/subr_gtaskqueue.c Tue Jan 24 16:05:42 2017
(r312698)
@@ -630,6 +630,29 @@ taskqgroup_find(struct taskqgroup *qgrou
 
return (idx);
 }
+/*
+ * smp_started is unusable since it is not set for UP kernels or even for
+ * SMP kernels when there is 1 CPU.  This is usually handled by adding a
+ * (mp_ncpus == 1) test, but that would be broken here since we need to
+ * to synchronize with the SI_SUB_SMP ordering.  Even in the pure SMP case
+ * smp_started only gives a fuzzy ordering relative to SI_SUB_SMP.
+ *
+ * So maintain our own flag.  It must be set after all CPUs are started
+ * and before SI_SUB_SMP:SI_ORDER_ANY so that the SYSINIT for delayed
+ * adjustment is properly delayed.  SI_ORDER_FOURTH is clearly before
+ * SI_ORDER_ANY and unclearly after the CPUs are started.  It would be
+ * simpler for adjustment to pass a flag indicating if it is delayed.
+ */ 
+static int tqg_smp_started;
+
+static void
+tqg_record_smp_started(void *arg)
+{
+   tqg_smp_started = 1;
+}
+
+SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_FOURTH,
+   tqg_record_smp_started, NULL);
 
 void
 taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask,
@@ -647,7 +670,7 @@ taskqgroup_attach(struct taskqgroup *qgr
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-   if (irq != -1 && (smp_started || mp_ncpus == 1)) {
+   if (irq != -1 && tqg_smp_started ) {
gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
CPU_ZERO(&mask);
CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
@@ -697,7 +720,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
gtask->gt_irq = irq;
gtask->gt_cpu = cpu;
mtx_lock(&qgroup->tqg_lock);
-   if (smp_started || mp_ncpus == 1) {
+   if (tqg_smp_started) {
for (i = 0; i < qgroup->tqg_cnt; i++)
if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
qid = i;
@@ -731,7 +754,7 @@ taskqgroup_attach_cpu_deferred(struct ta
qid = -1;
irq = gtask->gt_irq;
cpu = gtask->gt_cpu;
-   MPASS(smp_started || mp_ncpus == 1);
+   MPASS(tqg_smp_started);
mtx_lock(&qgroup->tqg_lock);
for (i = 0; i < qgroup->tqg_

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

2017-01-24 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 24 15:55:52 2017
New Revision: 312697
URL: https://svnweb.freebsd.org/changeset/base/312697

Log:
  Revert 312696 due to build tests.

Modified:
  head/sys/dev/e1000/em_txrx.c
  head/sys/kern/subr_gtaskqueue.c
  head/sys/net/iflib.c
  head/sys/sys/gtaskqueue.h

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cTue Jan 24 14:48:32 2017
(r312696)
+++ head/sys/dev/e1000/em_txrx.cTue Jan 24 15:55:52 2017
(r312697)
@@ -408,13 +408,10 @@ em_isc_txd_credits_update(void *arg, uin
cidx = cidx_init;
buf = &txr->tx_buffers[cidx];
tx_desc = &txr->tx_base[cidx];
-   last = buf->eop;
-   if (last == -1)
-   return (processed);
+last = buf->eop;
eop_desc = &txr->tx_base[last];
 
-   DPRINTF(iflib_get_dev(adapter->ctx),
- "credits_update: cidx_init=%d clear=%d last=%d\n",
+   DPRINTF(iflib_get_dev(adapter->ctx), "credits_update: cidx_init=%d 
clear=%d last=%d\n",
  cidx_init, clear, last);
/*
 * What this does is get the index of the
@@ -423,7 +420,7 @@ em_isc_txd_credits_update(void *arg, uin
 * simple comparison on the inner while loop.
 */
if (++last == scctx->isc_ntxd[0])
-   last = 0;
+last = 0;
done = last;
 
 
@@ -439,7 +436,7 @@ em_isc_txd_credits_update(void *arg, uin
tx_desc++;
buf++;
processed++;
-
+ 
/* wrap the ring ? */
if (++cidx == scctx->isc_ntxd[0]) {
cidx = 0;

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Jan 24 14:48:32 2017
(r312696)
+++ head/sys/kern/subr_gtaskqueue.c Tue Jan 24 15:55:52 2017
(r312697)
@@ -630,29 +630,6 @@ taskqgroup_find(struct taskqgroup *qgrou
 
return (idx);
 }
-/*
- * smp_started is unusable since it is not set for UP kernels or even for
- * SMP kernels when there is 1 CPU.  This is usually handled by adding a
- * (mp_ncpus == 1) test, but that would be broken here since we need to
- * to synchronize with the SI_SUB_SMP ordering.  Even in the pure SMP case
- * smp_started only gives a fuzzy ordering relative to SI_SUB_SMP.
- *
- * So maintain our own flag.  It must be set after all CPUs are started
- * and before SI_SUB_SMP:SI_ORDER_ANY so that the SYSINIT for delayed
- * adjustment is properly delayed.  SI_ORDER_FOURTH is clearly before
- * SI_ORDER_ANY and unclearly after the CPUs are started.  It would be
- * simpler for adjustment to pass a flag indicating if it is delayed.
- */ 
-static int tqg_smp_started;
-
-static void
-tqg_record_smp_started(void *arg)
-{
-   tqg_smp_started = 1;
-}
-
-SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_FOURTH,
-   tqg_record_smp_started, NULL);
 
 void
 taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask,
@@ -670,7 +647,7 @@ taskqgroup_attach(struct taskqgroup *qgr
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-   if (irq != -1 && tqg_smp_started ) {
+   if (irq != -1 && (smp_started || mp_ncpus == 1)) {
gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
CPU_ZERO(&mask);
CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
@@ -720,7 +697,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
gtask->gt_irq = irq;
gtask->gt_cpu = cpu;
mtx_lock(&qgroup->tqg_lock);
-   if (tqg_smp_started)
+   if (smp_started || mp_ncpus == 1) {
for (i = 0; i < qgroup->tqg_cnt; i++)
if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
qid = i;
@@ -754,7 +731,7 @@ taskqgroup_attach_cpu_deferred(struct ta
qid = -1;
irq = gtask->gt_irq;
cpu = gtask->gt_cpu;
-   MPASS(tqg_smp_started);
+   MPASS(smp_started || mp_ncpus == 1);
mtx_lock(&qgroup->tqg_lock);
for (i = 0; i < qgroup->tqg_cnt; i++)
if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
@@ -847,10 +824,9 @@ _taskqgroup_adjust(struct taskqgroup *qg
 
mtx_assert(&qgroup->tqg_lock, MA_OWNED);
 
-   if (cnt < 1 || cnt * stride > mp_ncpus || !tqg_smp_started) {
-   printf("%s: failed cnt: %d stride: %d "
-  "mp_ncpus: %d smp_started: %d\n",
-   __func__, cnt, stride, mp_ncpus, smp_started);
+   if (cnt < 1 || cnt * stride > mp_ncpus || (!smp_started && (mp_ncpus != 
1))) {
+   printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: 
%d 

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

2017-01-24 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 24 14:48:32 2017
New Revision: 312696
URL: https://svnweb.freebsd.org/changeset/base/312696

Log:
  iflib:
 Add internal tracking of smp startup status to reliably figure out
 what methods are to be used to get gtaskqueue up and running.
  
  e1000:
 Calculating this pointer gives undefined behaviour when (last == -1)
 (it is before the buffer).  The pointer is always followed.  Panics
 occurred when it points to an unmapped page.  Otherwise, the pointed-to
 garbage tends to not have the E1000_TXD_STAT_DD bit set in it, so in the
 broken case the loop was usually null and the function just returned, and
 this was acidentally correct.
  
  Submitted by: bde
  Reviewed by:  Matt Macy 

Modified:
  head/sys/dev/e1000/em_txrx.c
  head/sys/kern/subr_gtaskqueue.c
  head/sys/net/iflib.c
  head/sys/sys/gtaskqueue.h

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cTue Jan 24 12:15:10 2017
(r312695)
+++ head/sys/dev/e1000/em_txrx.cTue Jan 24 14:48:32 2017
(r312696)
@@ -408,10 +408,13 @@ em_isc_txd_credits_update(void *arg, uin
cidx = cidx_init;
buf = &txr->tx_buffers[cidx];
tx_desc = &txr->tx_base[cidx];
-last = buf->eop;
+   last = buf->eop;
+   if (last == -1)
+   return (processed);
eop_desc = &txr->tx_base[last];
 
-   DPRINTF(iflib_get_dev(adapter->ctx), "credits_update: cidx_init=%d 
clear=%d last=%d\n",
+   DPRINTF(iflib_get_dev(adapter->ctx),
+ "credits_update: cidx_init=%d clear=%d last=%d\n",
  cidx_init, clear, last);
/*
 * What this does is get the index of the
@@ -420,7 +423,7 @@ em_isc_txd_credits_update(void *arg, uin
 * simple comparison on the inner while loop.
 */
if (++last == scctx->isc_ntxd[0])
-last = 0;
+   last = 0;
done = last;
 
 
@@ -436,7 +439,7 @@ em_isc_txd_credits_update(void *arg, uin
tx_desc++;
buf++;
processed++;
- 
+
/* wrap the ring ? */
if (++cidx == scctx->isc_ntxd[0]) {
cidx = 0;

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Jan 24 12:15:10 2017
(r312695)
+++ head/sys/kern/subr_gtaskqueue.c Tue Jan 24 14:48:32 2017
(r312696)
@@ -630,6 +630,29 @@ taskqgroup_find(struct taskqgroup *qgrou
 
return (idx);
 }
+/*
+ * smp_started is unusable since it is not set for UP kernels or even for
+ * SMP kernels when there is 1 CPU.  This is usually handled by adding a
+ * (mp_ncpus == 1) test, but that would be broken here since we need to
+ * to synchronize with the SI_SUB_SMP ordering.  Even in the pure SMP case
+ * smp_started only gives a fuzzy ordering relative to SI_SUB_SMP.
+ *
+ * So maintain our own flag.  It must be set after all CPUs are started
+ * and before SI_SUB_SMP:SI_ORDER_ANY so that the SYSINIT for delayed
+ * adjustment is properly delayed.  SI_ORDER_FOURTH is clearly before
+ * SI_ORDER_ANY and unclearly after the CPUs are started.  It would be
+ * simpler for adjustment to pass a flag indicating if it is delayed.
+ */ 
+static int tqg_smp_started;
+
+static void
+tqg_record_smp_started(void *arg)
+{
+   tqg_smp_started = 1;
+}
+
+SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_FOURTH,
+   tqg_record_smp_started, NULL);
 
 void
 taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask,
@@ -647,7 +670,7 @@ taskqgroup_attach(struct taskqgroup *qgr
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-   if (irq != -1 && (smp_started || mp_ncpus == 1)) {
+   if (irq != -1 && tqg_smp_started ) {
gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
CPU_ZERO(&mask);
CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
@@ -697,7 +720,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
gtask->gt_irq = irq;
gtask->gt_cpu = cpu;
mtx_lock(&qgroup->tqg_lock);
-   if (smp_started || mp_ncpus == 1) {
+   if (tqg_smp_started)
for (i = 0; i < qgroup->tqg_cnt; i++)
if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
qid = i;
@@ -731,7 +754,7 @@ taskqgroup_attach_cpu_deferred(struct ta
qid = -1;
irq = gtask->gt_irq;
cpu = gtask->gt_cpu;
-   MPASS(smp_started || mp_ncpus == 1);
+   MPASS(tqg_smp_started);
mtx_lock(&qgroup->tqg_lock);
for (i = 0; i < qgroup->tqg_cnt; i++)

svn commit: r312641 - head/sys/dev/e1000

2017-01-22 Thread Sean Bruno
Author: sbruno
Date: Sun Jan 22 18:04:57 2017
New Revision: 312641
URL: https://svnweb.freebsd.org/changeset/base/312641

Log:
  igb(4) enable WOL features for this class of devices.
  
  PR:   208343
  Submitted by: Kaho Tashikazu 

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Sun Jan 22 18:04:41 2017(r312640)
+++ head/sys/dev/e1000/if_em.c  Sun Jan 22 18:04:57 2017(r312641)
@@ -1738,7 +1738,7 @@ em_if_stop(if_ctx_t ctx)

e1000_reset_hw(&adapter->hw);
if (adapter->hw.mac.type >= e1000_82544)
-   E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0);
+   E1000_WRITE_REG(&adapter->hw, E1000_WUFC, 0);
 
e1000_led_off(&adapter->hw);
e1000_cleanup_led(&adapter->hw);
@@ -2313,7 +2313,7 @@ em_reset(if_ctx_t ctx)
 
/* Issue a global reset */
e1000_reset_hw(hw);
-   E1000_WRITE_REG(hw, E1000_WUC, 0);
+   E1000_WRITE_REG(hw, E1000_WUFC, 0);
em_disable_aspm(adapter);
/* and a re-init */
if (e1000_init_hw(hw) < 0) {
@@ -2514,9 +2514,12 @@ em_setup_interface(if_ctx_t ctx)
 
/* Enable only WOL MAGIC by default */
if (adapter->wol) {
-   if_setcapabilitiesbit(ifp, IFCAP_WOL, 0);
-   if_setcapenablebit(ifp, IFCAP_WOL_MAGIC, 0);
-   }
+   if_setcapenablebit(ifp, IFCAP_WOL_MAGIC,
+IFCAP_WOL_MCAST| IFCAP_WOL_UCAST);
+   } else {
+   if_setcapenablebit(ifp, 0, IFCAP_WOL_MAGIC |
+IFCAP_WOL_MCAST| IFCAP_WOL_UCAST);
+   } 

/*
 * Specify the media types supported by this adapter and register
@@ -3314,6 +3317,15 @@ em_get_wakeup(if_ctx_t ctx)
case e1000_pch2lan:
case e1000_pch_lpt:
case e1000_pch_spt:
+   case e1000_82575:   /* listing all igb devices */
+   case e1000_82576:
+   case e1000_82580:
+   case e1000_i350:
+   case e1000_i354:
+   case e1000_i210:
+   case e1000_i211:
+   case e1000_vfadapt:
+   case e1000_vfadapt_i350:
apme_mask = E1000_WUC_APME;
adapter->has_amt = TRUE;
eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC);
@@ -3393,7 +3405,7 @@ em_enable_wakeup(if_ctx_t ctx)
ctrl |= (E1000_CTRL_SWDPIN2 | E1000_CTRL_SWDPIN3);
E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl);
wuc = E1000_READ_REG(&adapter->hw, E1000_WUC);
-   wuc |= E1000_WUC_PME_EN ;
+   wuc |= (E1000_WUC_PME_EN | E1000_WUC_APME);
E1000_WRITE_REG(&adapter->hw, E1000_WUC, wuc);
 
if ((adapter->hw.mac.type == e1000_ich8lan) ||
@@ -3417,6 +3429,9 @@ em_enable_wakeup(if_ctx_t ctx)
if ((if_getcapenable(ifp) & IFCAP_WOL_MAGIC) == 0)
adapter->wol &= ~E1000_WUFC_MAG;
 
+   if ((if_getcapenable(ifp) & IFCAP_WOL_UCAST) == 0)
+   adapter->wol &= ~E1000_WUFC_EX;
+
if ((if_getcapenable(ifp) & IFCAP_WOL_MCAST) == 0)
adapter->wol &= ~E1000_WUFC_MC;
else {
@@ -3425,10 +3440,7 @@ em_enable_wakeup(if_ctx_t ctx)
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl);
}
 
-   if ((adapter->hw.mac.type == e1000_pchlan) ||
-   (adapter->hw.mac.type == e1000_pch2lan) ||
-   (adapter->hw.mac.type == e1000_pch_lpt) ||
-   (adapter->hw.mac.type == e1000_pch_spt)) {
+   if ( adapter->hw.mac.type >= e1000_pchlan) {
if (em_enable_phy_wakeup(adapter))
return;
} else {
@@ -3493,7 +3505,7 @@ em_enable_phy_wakeup(struct adapter *ada
 
/* enable PHY wakeup in MAC register */
E1000_WRITE_REG(hw, E1000_WUC,
-   E1000_WUC_PHY_WAKE | E1000_WUC_PME_EN);
+   E1000_WUC_PHY_WAKE | E1000_WUC_PME_EN | E1000_WUC_APME);
E1000_WRITE_REG(hw, E1000_WUFC, adapter->wol);
 
/* configure and enable PHY wakeup in PHY registers */
___
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: r312434 - head/sys/sys

2017-01-19 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 19 19:58:08 2017
New Revision: 312434
URL: https://svnweb.freebsd.org/changeset/base/312434

Log:
  Adjust gtaskqueue startup again  so that we catch the !SMP case and
  users that choose not to use EARLY_AP_STARTUP.
  
  There is still an initialization issue/panic with !SMP and !EARLY_AP_STARTUP
  that we have yet to resolve.
  
  Submitted by: bde

Modified:
  head/sys/sys/gtaskqueue.h

Modified: head/sys/sys/gtaskqueue.h
==
--- head/sys/sys/gtaskqueue.h   Thu Jan 19 19:47:32 2017(r312433)
+++ head/sys/sys/gtaskqueue.h   Thu Jan 19 19:58:08 2017(r312434)
@@ -81,7 +81,7 @@ int   taskqgroup_adjust(struct taskqgroup 
 extern struct taskqgroup *qgroup_##name
 
 
-#ifdef EARLY_AP_STARTUP
+#if (!defined(SMP) || defined(EARLY_AP_STARTUP))
 #define TASKQGROUP_DEFINE(name, cnt, stride)   \
\
 struct taskqgroup *qgroup_##name;  \
@@ -95,7 +95,7 @@ taskqgroup_define_##name(void *arg)   

\
 SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
taskqgroup_define_##name, NULL)
-#else
+#else /* SMP && !EARLY_AP_STARTUP */
 #define TASKQGROUP_DEFINE(name, cnt, stride)   \
\
 struct taskqgroup *qgroup_##name;  \
@@ -104,6 +104,15 @@ static void
\
 taskqgroup_define_##name(void *arg)\
 {  \
qgroup_##name = taskqgroup_create(#name);   \
+   /* Adjustment will be null unless smp_cpus == 1. */ \
+   /*  \
+* XXX this was intended to fix the smp_cpus == 1 case, but \
+* doesn't actually work for that.  It gives thes same strange  \
+* panic as adjustment at SI_SUB_INIT_IF:SI_ORDER_ANY for a \
+* device that works with a pure UP kernel. \
+*/ \
+   /* XXX this code is common now, so should not be ifdefed. */\
+   taskqgroup_adjust(qgroup_##name, (cnt), (stride));  \
 }  \
\
 SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
@@ -112,14 +121,18 @@ SYSINIT(taskqgroup_##name, SI_SUB_INIT_I
 static void\
 taskqgroup_adjust_##name(void *arg)\
 {  \
+   /*  \
+* Adjustment when smp_cpus > 1 only works accidentally \
+* (when there is no device interrupt before adjustment).   \
+*/ \
taskqgroup_adjust(qgroup_##name, (cnt), (stride));  \
 }  \
\
-SYSINIT(taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY,   \
+SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY,   \
taskqgroup_adjust_##name, NULL);\
-   \
-struct __hack
-#endif
+
+#endif /* !SMP || EARLY_AP_STARTUP */
+
 TASKQGROUP_DECLARE(net);
 
 #endif /* !_SYS_GTASKQUEUE_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"


svn commit: r312383 - head/sys/dev/e1000

2017-01-18 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 18 14:23:43 2017
New Revision: 312383
URL: https://svnweb.freebsd.org/changeset/base/312383

Log:
  ugh, device_t not device_t *
  
  Reported by:  hps

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

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Wed Jan 18 14:14:00 2017(r312382)
+++ head/sys/dev/e1000/if_em.h  Wed Jan 18 14:23:43 2017(r312383)
@@ -436,7 +436,7 @@ struct adapter {
 #define intr_type shared->isc_intr
/* FreeBSD operating-system-specific structures. */
struct e1000_osdep osdep;
-   device_t*dev;
+   device_tdev;
struct cdev *led_dev;
 
 struct em_tx_queue *tx_queues;
___
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: r312380 - head/sys/dev/e1000

2017-01-18 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 18 13:57:29 2017
New Revision: 312380
URL: https://svnweb.freebsd.org/changeset/base/312380

Log:
  Change device type to unbreak drm-next testing and builds.
  
  Submitted by: Matt Macy 

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

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Wed Jan 18 13:31:17 2017(r312379)
+++ head/sys/dev/e1000/if_em.h  Wed Jan 18 13:57:29 2017(r312380)
@@ -436,7 +436,7 @@ struct adapter {
 #define intr_type shared->isc_intr
/* FreeBSD operating-system-specific structures. */
struct e1000_osdep osdep;
-   struct device   *dev;
+   device_t*dev;
struct cdev *led_dev;
 
 struct em_tx_queue *tx_queues;
___
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: r312344 - in head/sys/cam: ata scsi

2017-01-17 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 17 14:52:48 2017
New Revision: 312344
URL: https://svnweb.freebsd.org/changeset/base/312344

Log:
  Add 4k quirk for Micron 5100 and Intel S3610 SSDs
  
  Submitted by: Jason Wolfe 
  MFH:  1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D9209

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Tue Jan 17 14:13:14 2017(r312343)
+++ head/sys/cam/ata/ata_da.c   Tue Jan 17 14:52:48 2017(r312344)
@@ -513,6 +513,14 @@ static struct ada_quirk_entry ada_quirk_
},
{
/*
+* Intel S3610 Series SSDs
+* 4k optimised & trim only works in 4k requests + 4k aligned
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2BX*", "*" },
+   /*quirks*/ADA_Q_4K
+   },
+   {
+   /*
 * Intel X25-M Series SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
@@ -569,6 +577,14 @@ static struct ada_quirk_entry ada_quirk_
},
{
/*
+* Micron 5100 SSDs
+* 4k optimised & trim only works in 4k requests + 4k aligned
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "Micron 5100 MTFDDAK*", "*" },
+   /*quirks*/ADA_Q_4K
+   },
+   {
+   /*
 * OCZ Agility 2 SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Tue Jan 17 14:13:14 2017(r312343)
+++ head/sys/cam/scsi/scsi_da.c Tue Jan 17 14:52:48 2017(r312344)
@@ -829,6 +829,11 @@ static struct da_quirk_entry da_quirk_ta
/*quirks*/DA_Q_4K
},
{
+   /* Micron Advanced Format (4k) drives */
+   { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Micron 5100 MTFDDAK*", "*" 
},
+   /*quirks*/DA_Q_4K
+   },
+   {
/* Samsung Advanced Format (4k) drives */
{ T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG HD155UI*", "*" },
/*quirks*/DA_Q_4K
@@ -1151,6 +1156,14 @@ static struct da_quirk_entry da_quirk_ta
},
{
/*
+* Intel S3610 Series SSDs
+* 4k optimised & trim only works in 4k requests + 4k aligned
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2BX*", "*" },
+   /*quirks*/DA_Q_4K
+   },
+   {
+   /*
 * Intel X25-M Series SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
___
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: r312305 - head/sys/kern

2017-01-16 Thread Sean Bruno
Author: sbruno
Date: Mon Jan 16 19:01:41 2017
New Revision: 312305
URL: https://svnweb.freebsd.org/changeset/base/312305

Log:
  Remove Assert that seems to be hit in various configurations during
  normal operations.

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Mon Jan 16 18:52:05 2017
(r312304)
+++ head/sys/kern/subr_gtaskqueue.c Mon Jan 16 19:01:41 2017
(r312305)
@@ -646,7 +646,6 @@ taskqgroup_attach(struct taskqgroup *qgr
qid = taskqgroup_find(qgroup, uniq);
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
-   MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
if (irq != -1 && (smp_started || mp_ncpus == 1)) {
gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
___
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: r312293 - in head/sys: kern sys

2017-01-16 Thread Sean Bruno
Author: sbruno
Date: Mon Jan 16 16:58:12 2017
New Revision: 312293
URL: https://svnweb.freebsd.org/changeset/base/312293

Log:
  Change startup order for the no EARLY_AP_STARTUP case to initialize
  gtaskqueue bits at SI_SUB_INIT_IF instead of waiting until SI_SUB_SMP
  which is far too late.
  
  Add an assertion in taskqgroup_attach() to catch startup initialization
  failures in the future.
  
  Reported by:  kib bde

Modified:
  head/sys/kern/subr_gtaskqueue.c
  head/sys/sys/gtaskqueue.h

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Mon Jan 16 16:44:13 2017
(r312292)
+++ head/sys/kern/subr_gtaskqueue.c Mon Jan 16 16:58:12 2017
(r312293)
@@ -646,6 +646,7 @@ taskqgroup_attach(struct taskqgroup *qgr
qid = taskqgroup_find(qgroup, uniq);
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
+   MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
if (irq != -1 && (smp_started || mp_ncpus == 1)) {
gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;

Modified: head/sys/sys/gtaskqueue.h
==
--- head/sys/sys/gtaskqueue.h   Mon Jan 16 16:44:13 2017(r312292)
+++ head/sys/sys/gtaskqueue.h   Mon Jan 16 16:58:12 2017(r312293)
@@ -115,7 +115,7 @@ taskqgroup_adjust_##name(void *arg) 

taskqgroup_adjust(qgroup_##name, (cnt), (stride));  \
 }  \
\
-SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY,   \
+SYSINIT(taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY,   \
taskqgroup_adjust_##name, NULL);\
\
 struct __hack
___
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: r312205 - in head/sys: kern net

2017-01-14 Thread Sean Bruno
Author: sbruno
Date: Sun Jan 15 00:50:10 2017
New Revision: 312205
URL: https://svnweb.freebsd.org/changeset/base/312205

Log:
  Fix hangs in a uniprocessor configuration (qemu, virtualbox, real hw).
  
  sys/net/iflib.c:
Add ctx to filter_info and don't skpi interrupt early on unless we're on an
SMP system
  
  sys/kern/subr_gtaskqueue.c:
Skip smp check if we're running UP
  
  Submitted by: Matt Macy 
  Reported by:  emaste bde

Modified:
  head/sys/kern/subr_gtaskqueue.c
  head/sys/net/iflib.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Sat Jan 14 23:24:50 2017
(r312204)
+++ head/sys/kern/subr_gtaskqueue.c Sun Jan 15 00:50:10 2017
(r312205)
@@ -647,7 +647,7 @@ taskqgroup_attach(struct taskqgroup *qgr
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-   if (irq != -1 && smp_started) {
+   if (irq != -1 && (smp_started || mp_ncpus == 1)) {
gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
CPU_ZERO(&mask);
CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
@@ -697,7 +697,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
gtask->gt_irq = irq;
gtask->gt_cpu = cpu;
mtx_lock(&qgroup->tqg_lock);
-   if (smp_started) {
+   if (smp_started || mp_ncpus == 1) {
for (i = 0; i < qgroup->tqg_cnt; i++)
if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
qid = i;
@@ -717,7 +717,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
 
CPU_ZERO(&mask);
CPU_SET(cpu, &mask);
-   if (irq != -1 && smp_started)
+   if (irq != -1 && (smp_started || mp_ncpus == 1))
intr_setaffinity(irq, &mask);
return (0);
 }
@@ -731,7 +731,7 @@ taskqgroup_attach_cpu_deferred(struct ta
qid = -1;
irq = gtask->gt_irq;
cpu = gtask->gt_cpu;
-   MPASS(smp_started);
+   MPASS(smp_started || mp_ncpus == 1);
mtx_lock(&qgroup->tqg_lock);
for (i = 0; i < qgroup->tqg_cnt; i++)
if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
@@ -824,7 +824,7 @@ _taskqgroup_adjust(struct taskqgroup *qg
 
mtx_assert(&qgroup->tqg_lock, MA_OWNED);
 
-   if (cnt < 1 || cnt * stride > mp_ncpus || !smp_started) {
+   if (cnt < 1 || cnt * stride > mp_ncpus || (!smp_started && (mp_ncpus != 
1))) {
printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: 
%d smp_started: %d\n",
   cnt, stride, mp_ncpus, smp_started);
return (EINVAL);

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cSat Jan 14 23:24:50 2017(r312204)
+++ head/sys/net/iflib.cSun Jan 15 00:50:10 2017(r312205)
@@ -133,10 +133,13 @@ typedef struct iflib_rxq *iflib_rxq_t;
 struct iflib_fl;
 typedef struct iflib_fl *iflib_fl_t;
 
+struct iflib_ctx;
+
 typedef struct iflib_filter_info {
driver_filter_t *ifi_filter;
void *ifi_filter_arg;
struct grouptask *ifi_task;
+   struct iflib_ctx *ifi_ctx;
 } *iflib_filter_info_t;
 
 struct iflib_ctx {
@@ -300,6 +303,8 @@ typedef struct iflib_sw_tx_desc_array {
 #defineIFC_MULTISEG0x04
 #defineIFC_DMAR0x08
 #defineIFC_SC_ALLOCATED0x10
+#defineIFC_INIT_DONE   0x20
+
 
 #define CSUM_OFFLOAD   (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \
 CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \
@@ -1194,7 +1199,7 @@ iflib_fast_intr(void *arg)
iflib_filter_info_t info = arg;
struct grouptask *gtask = info->ifi_task;
 
-   if (!smp_started)
+   if (!smp_started && mp_ncpus > 1)
return (FILTER_HANDLED);
 
DBG_COUNTER_INC(fast_intrs);
@@ -3753,6 +3758,7 @@ iflib_device_register(device_t dev, void
 
if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter);
iflib_add_device_sysctl_post(ctx);
+   ctx->ifc_flags |= IFC_INIT_DONE;
return (0);
 fail_detach:
ether_ifdetach(ctx->ifc_ifp);
@@ -4471,6 +4477,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
info->ifi_filter = filter;
info->ifi_filter_arg = filter_arg;
info->ifi_task = gtask;
+   info->ifi_ctx = ctx;
 
err = _iflib_irq_alloc(ctx, irq, rid, iflib_fast_intr, NULL, info,  
name);
if (err != 0) {
@@ -4567,6 +4574,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_
info->ifi_filter = filter;
info->ifi_filter_arg = filter_arg;
info->ifi_task = gtask;
+   info->ifi_ctx = ctx;
 
/* We allocate a single interrupt resource */
if ((err = _iflib_irq_alloc(ctx, irq, tqrid, i

svn commit: r311990 - head/sys/conf

2017-01-12 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 12 17:18:25 2017
New Revision: 311990
URL: https://svnweb.freebsd.org/changeset/base/311990

Log:
  Purge surprise change to sys/conf/files for ixgbe(4).
  
  Reported by:  imp

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Jan 12 17:02:29 2017(r311989)
+++ head/sys/conf/files Thu Jan 12 17:18:25 2017(r311990)
@@ -2139,8 +2139,6 @@ dev/ixgbe/ix_txrx.c   optional ix inet | 
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_osdep.coptional ix inet | ixv inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
-dev/ixgbe/ixgbe_sysctl.c   optional ix inet | ixv inet \
-   compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_phy.c  optional ix inet | ixv inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_api.c  optional ix inet | ixv inet \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2017-01-12 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 12 16:44:40 2017
New Revision: 311988
URL: https://svnweb.freebsd.org/changeset/base/311988

Log:
  Purge EM_MULTIQUEUE references from the man page for em(4).

Modified:
  head/share/man/man4/em.4

Modified: head/share/man/man4/em.4
==
--- head/share/man/man4/em.4Thu Jan 12 16:30:27 2017(r311987)
+++ head/share/man/man4/em.4Thu Jan 12 16:44:40 2017(r311988)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 16, 2015
+.Dd January 12, 2016
 .Dt EM 4
 .Os
 .Sh NAME
@@ -45,14 +45,6 @@ kernel configuration file:
 .Cd "device em"
 .Ed
 .Pp
-Optional multiqueue support is available via the following kernel
-compile options:
-.Bd -ragged -offset indent
-.Cd "options EM_MULTIQUEUE"
-.Ed
-.Pp
-Note:  Activating EM_MULTIQUEUE support is not supported by Intel.
-.Pp
 Alternatively, to load the driver as a
 module at boot time, place the following line in
 .Xr loader.conf 5 :
@@ -253,12 +245,6 @@ If
 .Va hw.em.tx_int_delay
 is non-zero, this tunable limits the maximum delay in which a transmit
 interrupt is generated.
-.It Va hw.em.num_queues
-Number of hardware queues that will be configured on this adapter (maximum of 
2)
-Defaults to 1.
-Only valid with kernel configuration
-.Cd "options EM_MULTIQUEUE".
-.El
 .Sh FILES
 .Bl -tag -width /dev/led/em*
 .It Pa /dev/led/em*
@@ -311,5 +297,3 @@ The
 .Nm
 driver was written by
 .An Intel Corporation Aq Mt free...@intel.com .
-.Sh BUGS
-Activating EM_MULTIQUEUE support requires MSI-X features.
___
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: r311986 - head/sys/dev/netmap

2017-01-12 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 12 16:24:10 2017
New Revision: 311986
URL: https://svnweb.freebsd.org/changeset/base/311986

Log:
  Fix panic on mb_free_ext() due to NULL destructor.
  
  This used to happen because of the SET_MBUF_DESTRUCTOR() called
  on unregif.
  
  Submitted by: Vincenzo Maffione 

Modified:
  head/sys/dev/netmap/netmap_generic.c

Modified: head/sys/dev/netmap/netmap_generic.c
==
--- head/sys/dev/netmap/netmap_generic.cThu Jan 12 16:22:28 2017
(r311985)
+++ head/sys/dev/netmap/netmap_generic.cThu Jan 12 16:24:10 2017
(r311986)
@@ -165,12 +165,12 @@ nm_os_get_mbuf(struct ifnet *ifp, int le
  * has a KASSERT(), checking that the mbuf dtor function is not NULL.
  */
 
+static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { }
+
 #define SET_MBUF_DESTRUCTOR(m, fn) do {\
-   (m)->m_ext.ext_free = (void *)fn;   \
+   (m)->m_ext.ext_free = fn ? (void *)fn : (void *)void_mbuf_dtor; \
 } while (0)
 
-static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { }
-
 static inline struct mbuf *
 nm_os_get_mbuf(struct ifnet *ifp, int len)
 {
___
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: r311982 - head/sys/dev/e1000

2017-01-12 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 12 14:47:44 2017
New Revision: 311982
URL: https://svnweb.freebsd.org/changeset/base/311982

Log:
  Restore fixup for newer em(4) devices WOL capabilities post iflib integration.
  
  PR:   208343

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Jan 12 14:44:41 2017(r311981)
+++ head/sys/dev/e1000/if_em.c  Thu Jan 12 14:47:44 2017(r311982)
@@ -3308,6 +3308,8 @@ em_get_wakeup(if_ctx_t ctx)
case e1000_ich10lan:
case e1000_pchlan:
case e1000_pch2lan:
+   case e1000_pch_lpt:
+   case e1000_pch_spt:
apme_mask = E1000_WUC_APME;
adapter->has_amt = TRUE;
eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC);
@@ -3376,7 +3378,7 @@ em_enable_wakeup(if_ctx_t ctx)
struct adapter  *adapter = iflib_get_softc(ctx);
device_t dev = iflib_get_dev(ctx);
if_t ifp = iflib_get_ifp(ctx);
-   u32 pmc, ctrl, ctrl_ext, rctl;
+   u32 pmc, ctrl, ctrl_ext, rctl, wuc;
u16 status;
 
if ((pci_find_cap(dev, PCIY_PMG, &pmc) != 0))
@@ -3386,7 +3388,9 @@ em_enable_wakeup(if_ctx_t ctx)
ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL);
ctrl |= (E1000_CTRL_SWDPIN2 | E1000_CTRL_SWDPIN3);
E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl);
-   E1000_WRITE_REG(&adapter->hw, E1000_WUC, E1000_WUC_PME_EN);
+   wuc = E1000_READ_REG(&adapter->hw, E1000_WUC);
+   wuc |= E1000_WUC_PME_EN ;
+   E1000_WRITE_REG(&adapter->hw, E1000_WUC, wuc);
 
if ((adapter->hw.mac.type == e1000_ich8lan) ||
(adapter->hw.mac.type == e1000_pchlan) ||
@@ -3418,7 +3422,9 @@ em_enable_wakeup(if_ctx_t ctx)
}
 
if ((adapter->hw.mac.type == e1000_pchlan) ||
-   (adapter->hw.mac.type == e1000_pch2lan)) {
+   (adapter->hw.mac.type == e1000_pch2lan) ||
+   (adapter->hw.mac.type == e1000_pch_lpt) ||
+   (adapter->hw.mac.type == e1000_pch_spt)) {
if (em_enable_phy_wakeup(adapter))
return;
} else {
___
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: r311980 - in head: . sys/conf sys/dev/e1000 sys/modules/em

2017-01-12 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 12 14:38:18 2017
New Revision: 311980
URL: https://svnweb.freebsd.org/changeset/base/311980

Log:
  Deprecate kernel configuration option EM_MULTIQUEUE now that the em(4)
  driver conforms to iflib.

Modified:
  head/UPDATING
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/dev/e1000/if_em.h
  head/sys/modules/em/Makefile

Modified: head/UPDATING
==
--- head/UPDATING   Thu Jan 12 14:28:32 2017(r311979)
+++ head/UPDATING   Thu Jan 12 14:38:18 2017(r311980)
@@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 ** SPECIAL WARNING: **
 
+20170112:
+   The EM_MULTIQUEUE kernel configuration option is deprecated now that
+   the em(4) driver conforms to iflib specifications.
+
 20170109:
The igb(4), em(4) and lem(4) ethernet drivers are now implemented via
IFLIB.  If you have a custom kernel configuration that excludes em(4)

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Thu Jan 12 14:28:32 2017(r311979)
+++ head/sys/conf/NOTES Thu Jan 12 14:38:18 2017(r311980)
@@ -3055,9 +3055,6 @@ options   RANDOM_ENABLE_UMA   # slab alloca
 # Module to enable execution of application via emulators like QEMU
 options IMAGACT_BINMISC
 
-# Intel em(4) driver
-optionsEM_MULTIQUEUE # Activate multiqueue features/disable 
MSI-X
-
 # zlib I/O stream support
 # This enables support for compressed core dumps.
 optionsGZIO

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Jan 12 14:28:32 2017(r311979)
+++ head/sys/conf/files Thu Jan 12 14:38:18 2017(r311980)
@@ -2139,6 +2139,8 @@ dev/ixgbe/ix_txrx.c   optional ix inet | 
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_osdep.coptional ix inet | ixv inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
+dev/ixgbe/ixgbe_sysctl.c   optional ix inet | ixv inet \
+   compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_phy.c  optional ix inet | ixv inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_api.c  optional ix inet | ixv inet \

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Thu Jan 12 14:28:32 2017(r311979)
+++ head/sys/conf/options   Thu Jan 12 14:38:18 2017(r311980)
@@ -986,9 +986,6 @@ RANDOM_LOADABLE opt_global.h
 # the uma slab allocator.
 RANDOM_ENABLE_UMA  opt_global.h
 
-# Intel em(4) driver
-EM_MULTIQUEUE  opt_em.h
-
 # BHND(4) driver
 BHND_LOGLEVEL  opt_global.h
 

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Thu Jan 12 14:28:32 2017(r311979)
+++ head/sys/dev/e1000/if_em.h  Thu Jan 12 14:38:18 2017(r311980)
@@ -25,7 +25,6 @@
  */
 
 /*$FreeBSD$*/
-#include "opt_em.h"
 #include "opt_ddb.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -176,11 +175,7 @@
  *restoring the network connection. To eliminate the potential
  *for the hang ensure that EM_RDTR is set to 0.
  */
-#ifdef EM_MULTIQUEUE
-#define EM_RDTR 64
-#else
 #define EM_RDTR 0
-#endif
 
 /*
  * Receive Interrupt Absolute Delay Timer (Not valid for 82542/82543/82544)
@@ -193,11 +188,7 @@
  *   along with EM_RDTR, may improve traffic throughput in specific network
  *   conditions.
  */
-#ifdef EM_MULTIQUEUE
-#define EM_RADV 128
-#else
 #define EM_RADV 64
-#endif
 
 /*
  * This parameter controls whether or not autonegotation is enabled.

Modified: head/sys/modules/em/Makefile
==
--- head/sys/modules/em/MakefileThu Jan 12 14:28:32 2017
(r311979)
+++ head/sys/modules/em/MakefileThu Jan 12 14:38:18 2017
(r311980)
@@ -3,7 +3,7 @@
 
 .PATH:  ${.CURDIR}/../../dev/e1000
 KMOD= if_em
-SRCS= device_if.h bus_if.h pci_if.h opt_ddb.h opt_em.h opt_inet.h \
+SRCS= device_if.h bus_if.h pci_if.h opt_ddb.h opt_inet.h \
  opt_inet6.h ifdi_if.h
 SRCS+= $(CORE_SRC) $(LEGACY_SRC)
 SRCS   += $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED)
___
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: r311979 - head/sys/dev/e1000

2017-01-12 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 12 14:28:32 2017
New Revision: 311979
URL: https://svnweb.freebsd.org/changeset/base/311979

Log:
  Reset the EIAC register to include the LINK status bit and restore
  link up/down notifications.
  
  Submitted by: Franco Fichtner 

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Jan 12 14:18:52 2017(r311978)
+++ head/sys/dev/e1000/if_em.c  Thu Jan 12 14:28:32 2017(r311979)
@@ -3117,7 +3117,7 @@ em_if_enable_intr(if_ctx_t ctx)
u32 ims_mask = IMS_ENABLE_MASK;
 
if (hw->mac.type == e1000_82574) {
-   E1000_WRITE_REG(hw, EM_EIAC, adapter->ims);
+   E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK);
ims_mask |= adapter->ims;
} if (adapter->intr_type == IFLIB_INTR_MSIX && hw->mac.type >= 
igb_mac_min)  {
u32 mask = (adapter->que_mask | adapter->link_mask);
___
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: r311978 - head/sys/dev/e1000

2017-01-12 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 12 14:18:52 2017
New Revision: 311978
URL: https://svnweb.freebsd.org/changeset/base/311978

Log:
  Attempt to use the "new" BAR address for newer igb(4) devices.  This code
  was dropped during the IFLIB migration.
  
  Reported by:  olivier
  Reviewed by:  mm...@nextbsd.org

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Jan 12 13:00:17 2017(r311977)
+++ head/sys/dev/e1000/if_em.c  Thu Jan 12 14:18:52 2017(r311978)
@@ -770,6 +770,8 @@ em_if_attach_pre(if_ctx_t ctx) 
 
 
if (adapter->hw.mac.type >= igb_mac_min) {
+   int try_second_bar;
+
scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * 
sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN);
scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * 
sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN);
scctx->isc_txrx = &igb_txrx;
@@ -779,6 +781,15 @@ em_if_attach_pre(if_ctx_t ctx) 
if (adapter->hw.mac.type != e1000_82575)
scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP;
 
+   /*
+   ** Some new devices, as with ixgbe, now may
+   ** use a different BAR, so we need to keep
+   ** track of which is used.
+   */
+   try_second_bar = pci_read_config(dev, scctx->isc_msix_bar, 4);
+   if (try_second_bar == 0)
+   scctx->isc_msix_bar += 4;
+
} else if (adapter->hw.mac.type >= em_mac_min) {
scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* 
sizeof(struct e1000_tx_desc), EM_DBA_ALIGN);
scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * 
sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN);
___
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: r311931 - head/sys/dev/e1000

2017-01-11 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 11 19:29:33 2017
New Revision: 311931
URL: https://svnweb.freebsd.org/changeset/base/311931

Log:
  Restore v6 offload caps for igb(4) class devices.
  
  Reported by:  tuxen

Modified:
  head/sys/dev/e1000/em_txrx.c
  head/sys/dev/e1000/if_em.h
  head/sys/dev/e1000/igb_txrx.c

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cWed Jan 11 19:29:28 2017
(r311930)
+++ head/sys/dev/e1000/em_txrx.cWed Jan 11 19:29:33 2017
(r311931)
@@ -304,7 +304,7 @@ em_isc_txd_encap(void *arg, if_pkt_info_
if (do_tso) {
i = em_tso_setup(sc, pi, &txd_upper, &txd_lower);
tso_desc = TRUE;
-   } else if (csum_flags & CSUM_OFFLOAD) {
+   } else if (csum_flags & EM_CSUM_OFFLOAD) {
i = em_transmit_checksum_setup(sc, pi, &txd_upper, &txd_lower);
}
 

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Wed Jan 11 19:29:28 2017(r311930)
+++ head/sys/dev/e1000/if_em.h  Wed Jan 11 19:29:33 2017(r311931)
@@ -330,7 +330,8 @@
 #define EM_MSIX_LINK   0x0100 /* For 82574 use */
 #define ETH_ZLEN   60
 #define ETH_ADDR_LEN   6
-#define CSUM_OFFLOAD   7   /* Offload bits in mbuf flag */
+#define EM_CSUM_OFFLOAD7   /* Offload bits in mbuf flag */
+#define IGB_CSUM_OFFLOAD   0x0E0F  /* Offload bits in mbuf flag */
 
 #define IGB_PKTTYPE_MASK   0xFFF0
 #define IGB_DMCTLX_DCFLUSH_DIS 0x8000  /* Disable DMA Coalesce Flush */

Modified: head/sys/dev/e1000/igb_txrx.c
==
--- head/sys/dev/e1000/igb_txrx.c   Wed Jan 11 19:29:28 2017
(r311930)
+++ head/sys/dev/e1000/igb_txrx.c   Wed Jan 11 19:29:33 2017
(r311931)
@@ -171,7 +171,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if
*/
 if (pi->ipi_mflags & M_VLANTAG) {
vlan_macip_lens |= (pi->ipi_vtag << E1000_ADVTXD_VLAN_SHIFT);
-   } else if ((pi->ipi_csum_flags & CSUM_OFFLOAD) == 0) {
+   } else if ((pi->ipi_csum_flags & IGB_CSUM_OFFLOAD) == 0) {
return (0);
}

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


svn commit: r311900 - head/sys/modules/em

2017-01-10 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 21:21:00 2017
New Revision: 311900
URL: https://svnweb.freebsd.org/changeset/base/311900

Log:
  Set CFLAGS correctly for sys/modules/em
  
  Unbreak gcc sparc64 builds (or any gcc build that uses em(4)).
  
  Reported by:  l...@freebsd.org

Modified:
  head/sys/modules/em/Makefile

Modified: head/sys/modules/em/Makefile
==
--- head/sys/modules/em/MakefileTue Jan 10 21:18:32 2017
(r311899)
+++ head/sys/modules/em/MakefileTue Jan 10 21:21:00 2017
(r311900)
@@ -17,7 +17,7 @@ PCIE_SHARED = e1000_80003es2lan.c e1000_
 LEGACY_SHARED = e1000_82540.c e1000_82542.c e1000_82541.c e1000_82543.c
 
 
-CFLAGS += -I${.CURDIR}/../../../dev/e1000
+CFLAGS += -I${.CURDIR}/../../dev/e1000
 
 # DEVICE_POLLING for a non-interrupt-driven method
 #CFLAGS  += -DDEVICE_POLLING
___
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: r311854 - head/sys/dev/e1000

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 04:50:26 2017
New Revision: 311854
URL: https://svnweb.freebsd.org/changeset/base/311854

Log:
  Add copywrite notices, 2-clause BSD.
  
  Reported by:  jmallett

Modified:
  head/sys/dev/e1000/em_txrx.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/dev/e1000/igb_txrx.c

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cTue Jan 10 04:49:59 2017
(r311853)
+++ head/sys/dev/e1000/em_txrx.cTue Jan 10 04:50:26 2017
(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 /* $FreeBSD$ */
 #include "if_em.h"
 

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Tue Jan 10 04:49:59 2017(r311853)
+++ head/sys/dev/e1000/if_em.c  Tue Jan 10 04:50:26 2017(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 /* $FreeBSD$ */
 #include "if_em.h"
 #include 

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Tue Jan 10 04:49:59 2017(r311853)
+++ head/sys/dev/e1000/if_em.h  Tue Jan 10 04:50:26 2017(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CON

svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 03:23:22 2017
New Revision: 311849
URL: https://svnweb.freebsd.org/changeset/base/311849

Log:
  Migrate e1000 to the IFLIB framework:
  - em(4) igb(4) and lem(4)
  - deprecate the igb device from kernel configurations
  - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
  
  Devices tested:
  - 82574L
  - I218-LM
  - 82546GB
  - 82579LM
  - I350
  - I217
  
  Please report problems to freebsd-...@freebsd.org
  
  Partial review from jhb and suggestions on how to *not* brick folks who
  originally would have lost their igbX device.
  
  Submitted by: mm...@nextbsd.org
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: Limelight Networks and Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8299

Added:
  head/sys/dev/e1000/em_txrx.c   (contents, props changed)
  head/sys/dev/e1000/igb_txrx.c   (contents, props changed)
Deleted:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_igb.h
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/e1000/if_lem.h
  head/sys/modules/igb/
Modified:
  head/UPDATING
  head/sys/amd64/conf/GENERIC
  head/sys/arm64/conf/GENERIC
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/makeLINT.mk
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/i386/conf/GENERIC
  head/sys/mips/conf/OCTEON1
  head/sys/modules/Makefile
  head/sys/modules/em/Makefile
  head/sys/powerpc/conf/GENERIC64

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jan 10 01:36:50 2017(r311848)
+++ head/UPDATING   Tue Jan 10 03:23:22 2017(r311849)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 ** SPECIAL WARNING: **
 
+20170109:
+   The igb(4), em(4) and lem(4) ethernet drivers are now implemented via
+   IFLIB.  If you have a custom kernel configuration that excludes em(4)
+   but you use igb(4), you need to re-add em(4) to your custom 
configuration.
+
 20161217:
Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.1.
Please see the 20141231 entry below for information about prerequisites

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/amd64/conf/GENERIC Tue Jan 10 03:23:22 2017(r311849)
@@ -230,7 +230,6 @@ device  puc # Multi I/O 
cards and mult
 device bxe # Broadcom NetXtreme II 
BCM5771X/BCM578XX 10GbE
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel PRO/1000 Gigabit Ethernet Family
-device igb # Intel PRO/1000 PCIE Server Gigabit 
Family
 device ix  # Intel PRO/10GbE PCIE PF Ethernet
 device ixv # Intel PRO/10GbE PCIE VF Ethernet
 device ixl # Intel XL710 40Gbe PCIE Ethernet

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/arm64/conf/GENERIC Tue Jan 10 03:23:22 2017(r311849)
@@ -120,7 +120,6 @@ device  mii
 device miibus  # MII bus support
 device awg # Allwinner EMAC Gigabit Ethernet
 device em  # Intel PRO/1000 Gigabit Ethernet Family
-device igb # Intel PRO/1000 PCIE Server Gigabit Family
 device ix  # Intel 10Gb Ethernet Family
 device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
 device smc # SMSC LAN91C111

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/conf/NOTES Tue Jan 10 03:23:22 2017(r311849)
@@ -1972,7 +1972,6 @@ devicexmphy   # XaQti XMAC II
 #   KNE110TX.
 # de:   Digital Equipment DC21040
 # em:   Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters.
-# igb:  Intel Pro/1000 PCI Express Gigabit Ethernet: 82575 and later adapters.
 # ep:   3Com 3C509, 3C529, 3C556, 3C562D, 3C563D, 3C572, 3C574X, 3C579, 3C589
 #   and PC Card devices using these chipsets.
 # ex:   Intel EtherExpress Pro/10 and other i82595-based adapters,
@@ -2145,7 +2144,6 @@ devicecxgbe   # Chelsio T4-T6 
1/10/25/4
 device cxgbev  # Chelsio T4-T6 Virtual Functions
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel Pro/1000 Gigabit Ethernet
-device igb # Intel Pro/1000 PCIE Gigabit Ethernet
 device   

svn commit: r311840 - head/sys/conf

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Mon Jan  9 23:45:40 2017
New Revision: 311840
URL: https://svnweb.freebsd.org/changeset/base/311840

Log:
  White space cleanup from an cut-n-paste.
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Jan  9 23:43:42 2017(r311839)
+++ head/sys/conf/files Mon Jan  9 23:45:40 2017(r311840)
@@ -3905,9 +3905,9 @@ net/if_tun.c  optional tun
 net/if_tap.c   optional tap
 net/if_vlan.c  optional vlan
 net/if_vxlan.c optional vxlan inet | vxlan inet6
-net/ifdi_if.m  optional ether pci
-net/iflib.coptional ether pci
-net/mp_ring.c  optional ether
+net/ifdi_if.m  optional ether pci
+net/iflib.coptional ether pci
+net/mp_ring.c  optional ether
 net/mppcc.coptional netgraph_mppc_compression
 net/mppcd.coptional netgraph_mppc_compression
 net/netisr.c   standard
___
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: r311837 - head/sys/net

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Mon Jan  9 23:41:10 2017
New Revision: 311837
URL: https://svnweb.freebsd.org/changeset/base/311837

Log:
  Remove unused mtx_held() macro.

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cMon Jan  9 22:49:35 2017(r311836)
+++ head/sys/net/iflib.cMon Jan  9 23:41:10 2017(r311837)
@@ -447,10 +447,6 @@ struct iflib_rxq {
 
 static int enable_msix = 1;
 
-#define mtx_held(m)(((m)->mtx_lock & ~MTX_FLAGMASK) != (uintptr_t)0)
-
-
-
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
 #define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
___
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: r311154 - head/sys/dev/ixl

2017-01-03 Thread Sean Bruno
Author: sbruno
Date: Tue Jan  3 14:52:39 2017
New Revision: 311154
URL: https://svnweb.freebsd.org/changeset/base/311154

Log:
  Restore r302384 that was dropped when r303816 updated the driver to 1.6.6.-k
  
  Original log:
  Do not initialize the adapter on MTU change when adapter status is down.
  This fixes long-standing problems when changing settings of the adapter.
  
  Discussed in:
  https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html
  
  Reported by:  Franco Fichtner 
  MFH:  2 days

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

Modified: head/sys/dev/ixl/ixl_pf_main.c
==
--- head/sys/dev/ixl/ixl_pf_main.c  Tue Jan  3 05:44:24 2017
(r311153)
+++ head/sys/dev/ixl/ixl_pf_main.c  Tue Jan  3 14:52:39 2017
(r311154)
@@ -4927,7 +4927,8 @@ ixl_ioctl(struct ifnet * ifp, u_long com
vsi->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN
+ ETHER_VLAN_ENCAP_LEN;
-   ixl_init_locked(pf);
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   ixl_init_locked(pf);
IXL_PF_UNLOCK(pf);
}
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: r311039 - in head/sys: dev/bnxt kern net

2017-01-01 Thread Sean Bruno
Author: sbruno
Date: Mon Jan  2 00:56:33 2017
New Revision: 311039
URL: https://svnweb.freebsd.org/changeset/base/311039

Log:
  2017 IFLIB updates in preparation for commits to e1000 and ixgbe.
  - iflib - add checksum in place support (mmacy)
  - iflib - initialize IP for TSO (going to be needed for e1000) (mmacy)
  - iflib - move isc_txrx from shared context to softc context (mmacy)
  - iflib - Normalize checks in TXQ drainage. (shurd)
  - iflib - Fix queue capping checks (mmacy)
  - iflib - Fix invalid assert, em can need 2 sentinels (mmacy)
  - iflib - let the driver determine what capabilities are set and what
tx csum flags are used (mmacy)
  - add INVARIANTS debugging hooks to gtaskqueue enqueue (mmacy)
  - update bnxt(4) to support the changes to iflib (shurd)
  
  Some other various, sundry updates.  Slightly more verbose changelog:
  
  Submitted by: mm...@nextbsd.org
  Reviewed by:  shurd
  mFC after:
  Sponsored by: LimeLight Networks and Dell EMC Isilon

Modified:
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/kern/subr_gtaskqueue.c
  head/sys/net/ifdi_if.m
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Sun Jan  1 22:49:15 2017(r311038)
+++ head/sys/dev/bnxt/if_bnxt.c Mon Jan  2 00:56:33 2017(r311039)
@@ -277,7 +277,6 @@ char bnxt_driver_version[] = "FreeBSD ba
 extern struct if_txrx bnxt_txrx;
 static struct if_shared_ctx bnxt_sctx_init = {
.isc_magic = IFLIB_MAGIC,
-   .isc_txrx = &bnxt_txrx,
.isc_driver = &bnxt_iflib_driver,
.isc_nfl = 2,   // Number of Free Lists
.isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ,
@@ -679,6 +678,20 @@ bnxt_attach_pre(if_ctx_t ctx)
goto failed;
iflib_set_mac(ctx, softc->func.mac_addr);
 
+   scctx->isc_txrx = &bnxt_txrx;
+   scctx->isc_tx_csum_flags = (CSUM_IP | CSUM_TCP | CSUM_UDP |
+   CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO);
+   scctx->isc_capenable =
+   /* These are translated to hwassit bits */
+   IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 | IFCAP_TSO4 | IFCAP_TSO6 |
+   /* These are checked by iflib */
+   IFCAP_LRO | IFCAP_VLAN_HWFILTER |
+   /* These are part of the iflib mask */
+   IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_VLAN_MTU |
+   IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO |
+   /* These likely get lost... */
+   IFCAP_VLAN_HWCSUM | IFCAP_JUMBO_MTU;
+
/* Get the queue config */
rc = bnxt_hwrm_queue_qportcfg(softc);
if (rc) {
@@ -793,7 +806,6 @@ bnxt_attach_post(if_ctx_t ctx)
 {
struct bnxt_softc *softc = iflib_get_softc(ctx);
if_t ifp = iflib_get_ifp(ctx);
-   int capabilities, enabling;
int rc;
 
bnxt_create_config_sysctls_post(softc);
@@ -808,26 +820,6 @@ bnxt_attach_post(if_ctx_t ctx)
bnxt_add_media_types(softc);
ifmedia_set(softc->media, IFM_ETHER | IFM_AUTO);
 
-   if_sethwassist(ifp, (CSUM_TCP | CSUM_UDP | CSUM_TCP_IPV6 |
-   CSUM_UDP_IPV6 | CSUM_TSO));
-
-   capabilities =
-   /* These are translated to hwassit bits */
-   IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 | IFCAP_TSO4 | IFCAP_TSO6 |
-   /* These are checked by iflib */
-   IFCAP_LRO | IFCAP_VLAN_HWFILTER |
-   /* These are part of the iflib mask */
-   IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_VLAN_MTU |
-   IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO |
-   /* These likely get lost... */
-   IFCAP_VLAN_HWCSUM | IFCAP_JUMBO_MTU;
-
-   if_setcapabilities(ifp, capabilities);
-
-   enabling = capabilities;
-
-   if_setcapenable(ifp, enabling);
-
softc->scctx->isc_max_frame_size = ifp->if_mtu + ETHER_HDR_LEN +
ETHER_CRC_LEN;
 

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Sun Jan  1 22:49:15 2017
(r311038)
+++ head/sys/kern/subr_gtaskqueue.c Mon Jan  2 00:56:33 2017
(r311039)
@@ -99,6 +99,15 @@ struct gtaskqueue {
} while (0)
 #defineTQ_ASSERT_UNLOCKED(tq)  mtx_assert(&(tq)->tq_mutex, MA_NOTOWNED)
 
+#ifdef INVARIANTS
+static void
+gtask_dump(struct gtask *gtask)
+{
+   printf("gtask: %p ta_flags=%x ta_priority=%d ta_func=%p 
ta_context=%p\n",
+  gtask, gtask->ta_flags, gtask->ta_priority, gtask->ta_func, 
gtask->ta_context);
+}
+#endif
+
 static __inline int
 TQ_SLEEP(struct gtaskqueue *tq, void *p, struct mtx *m, int pri, const char 
*wm,
 int t)
@@ -172,6 +181,12 @@ gtaskqueue_free(struct gtaskqueue *queue
 int
 grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *gtask)
 {
+#ifdef INVARIANTS
+   if (queue == NULL) {
+   gtask_dump(gtask);
+   panic("queue == NULL");

svn commit: r308926 - head/sys/dev/uart

2016-11-21 Thread Sean Bruno
Author: sbruno
Date: Mon Nov 21 14:43:31 2016
New Revision: 308926
URL: https://svnweb.freebsd.org/changeset/base/308926

Log:
  Add Intel Atom Cherryview SOC HSUART support
  
  PR:   207910
  Submitted by: johan...@brilliantservice.co.jp
  MFC after:1 week

Modified:
  head/sys/dev/uart/uart_bus_pci.c

Modified: head/sys/dev/uart/uart_bus_pci.c
==
--- head/sys/dev/uart/uart_bus_pci.cMon Nov 21 14:13:57 2016
(r308925)
+++ head/sys/dev/uart/uart_bus_pci.cMon Nov 21 14:43:31 2016
(r308926)
@@ -128,6 +128,10 @@ static const struct pci_id pci_ns8250_id
 { 0x8086, 0x1c3d, 0x, 0, "Intel AMT - KT Controller", 0x10 },
 { 0x8086, 0x1d3d, 0x, 0, "Intel C600/X79 Series Chipset KT Controller", 
0x10 },
 { 0x8086, 0x1e3d, 0x, 0, "Intel Panther Point KT Controller", 0x10 },
+{ 0x8086, 0x228a, 0x, 0, "Intel Cherryview SIO HSUART#1", 0x10,
+   24 * DEFAULT_RCLK, 2 },
+{ 0x8086, 0x228c, 0x, 0, "Intel Cherryview SIO HSUART#2", 0x10,
+   24 * DEFAULT_RCLK, 2 },
 { 0x8086, 0x2a07, 0x, 0, "Intel AMT - PM965/GM965 KT Controller", 0x10 },
 { 0x8086, 0x2a47, 0x, 0, "Mobile 4 Series Chipset KT Controller", 0x10 },
 { 0x8086, 0x2e17, 0x, 0, "4 Series Chipset Serial KT Controller", 0x10 },
___
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: r308810 - head/bin/dd

2016-11-19 Thread Sean Bruno


On 11/18/16 16:03, Adrian Chadd wrote:
> fwiw, this breaks -head compilation.
> 
> 
> 
> -a
> 

This seems to not allow head to be built on stable/10 (not strictly
supported, but worked until this commit) ... I haven't tried building
head on stable/11 as of yet, but I assume it will break there too?

sean


> 
> On 18 November 2016 at 13:09, Bartek Rutkowski  wrote:
>> Author: robak (ports committer)
>> Date: Fri Nov 18 21:09:57 2016
>> New Revision: 308810
>> URL: https://svnweb.freebsd.org/changeset/base/308810
>>
>> Log:
>>   Capsicum support for dd(1)
>>
>>   Adds Capsicum sandboxing to dd utility.
>>
>>   Submitted by: Pawel Biernacki 
>>   Reviewed by:  allanjude, emaste, oshogbo
>>   Approved by:  oshogbo
>>   Sponsored by: Mysterious Code Ltd.
>>   Differential Revision:https://reviews.freebsd.org/D8543
>>
>> Modified:
>>   head/bin/dd/dd.c
>>
>> Modified: head/bin/dd/dd.c
>> ==
>> --- head/bin/dd/dd.cFri Nov 18 17:18:05 2016(r308809)
>> +++ head/bin/dd/dd.cFri Nov 18 21:09:57 2016(r308810)
>> @@ -48,10 +48,13 @@ __FBSDID("$FreeBSD$");
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>  #include 
>>  #include 
>> +#include 
>>
>>  #include 
>> +#include 
>>  #include 
>>  #include 
>>  #include 
>> @@ -92,6 +95,10 @@ main(int argc __unused, char *argv[])
>> jcl(argv);
>> setup();
>>
>> +   caph_cache_catpages();
>> +   if (cap_enter() == -1 && errno != ENOSYS)
>> +   err(1, "unable to enter capability mode");
>> +
>> (void)signal(SIGINFO, siginfo_handler);
>> (void)signal(SIGINT, terminate);
>>
>> @@ -125,6 +132,8 @@ static void
>>  setup(void)
>>  {
>> u_int cnt;
>> +   cap_rights_t rights;
>> +   unsigned long cmds[] = { FIODTYPE, MTIOCTOP };
>>
>> if (in.name == NULL) {
>> in.name = "stdin";
>> @@ -133,13 +142,20 @@ setup(void)
>> in.fd = open(in.name, O_RDONLY, 0);
>> if (in.fd == -1)
>> err(1, "%s", in.name);
>> +   if (caph_limit_stdin() == -1)
>> +   err(1, "unable to limit capability rights");
>> }
>>
>> getfdtype(&in);
>>
>> +   cap_rights_init(&rights, CAP_READ, CAP_SEEK);
>> +   if (cap_rights_limit(in.fd, &rights) == -1 && errno != ENOSYS)
>> +   err(1, "unable to limit capability rights");
>> +
>> if (files_cnt > 1 && !(in.flags & ISTAPE))
>> errx(1, "files is not supported for non-tape devices");
>>
>> +   cap_rights_set(&rights, CAP_WRITE, CAP_FTRUNCATE, CAP_IOCTL);
>> if (out.name == NULL) {
>> /* No way to check for read access here. */
>> out.fd = STDOUT_FILENO;
>> @@ -156,13 +172,27 @@ setup(void)
>> if (out.fd == -1) {
>> out.fd = open(out.name, O_WRONLY | OFLAGS, 
>> DEFFILEMODE);
>> out.flags |= NOREAD;
>> +   cap_rights_clear(&rights, CAP_READ);
>> }
>> if (out.fd == -1)
>> err(1, "%s", out.name);
>> +   if (caph_limit_stdout() == -1)
>> +   err(1, "unable to limit capability rights");
>> }
>>
>> getfdtype(&out);
>>
>> +   if (cap_rights_limit(out.fd, &rights) == -1 && errno != ENOSYS)
>> +   err(1, "unable to limit capability rights");
>> +   if (cap_ioctls_limit(out.fd, cmds, nitems(cmds)) == -1 &&
>> +   errno != ENOSYS)
>> +   err(1, "unable to limit capability rights");
>> +
>> +   if (in.fd != STDERR_FILENO && out.fd != STDERR_FILENO) {
>> +   if (caph_limit_stderr() == -1)
>> +   err(1, "unable to limit capability rights");
>> +   }
>> +
>> /*
>>  * Allocate space for the input and output buffers.  If not doing
>>  * record oriented I/O, only need a single buffer.
>>
> 
> 



signature.asc
Description: OpenPGP digital signature


svn commit: r308792 - head/sys/net

2016-11-17 Thread Sean Bruno
Author: sbruno
Date: Fri Nov 18 04:19:21 2016
New Revision: 308792
URL: https://svnweb.freebsd.org/changeset/base/308792

Log:
  iflib updates and fixes:
  -reset gen on down
  -initialize admin task statically
  -drain mp_ring on down
  -don't drop context lock on stop
  -reset error stats on down
  -fix typo in min_latency sysctl
  -return ENOBUFS from if_transmit if the driver isn't running or the link 
is down
  
  Submitted by: mm...@nextbsd.org
  Reviewed by:  shurd
  MFC after:2 days
  Sponsored by: Isilon and Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D8558

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Nov 18 03:11:11 2016(r308791)
+++ head/sys/net/iflib.cFri Nov 18 04:19:21 2016(r308792)
@@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-
 /*
  * enable accounting of every mbuf as it comes in to and goes out of iflib's 
software descriptor references
  */
@@ -500,7 +499,7 @@ static SYSCTL_NODE(_net, OID_AUTO, iflib
 static int iflib_min_tx_latency = 0;
 
 SYSCTL_INT(_net_iflib, OID_AUTO, min_tx_latency, CTLFLAG_RW,
-  &iflib_min_tx_latency, 0, "minimize transmit latency at the 
possibel expense of throughput");
+  &iflib_min_tx_latency, 0, "minimize transmit latency at the 
possible expense of throughput");
 
 
 #if IFLIB_DEBUG_COUNTERS
@@ -595,10 +594,23 @@ SYSCTL_INT(_net_iflib, OID_AUTO, verbose
   &iflib_verbose_debug, 0, "enable verbose debugging");
 
 #define DBG_COUNTER_INC(name) atomic_add_int(&(iflib_ ## name), 1)
+static void
+iflib_debug_reset(void)
+{
+   iflib_tx_seen = iflib_tx_sent = iflib_tx_encap = iflib_rx_allocs =
+   iflib_fl_refills = iflib_fl_refills_large = iflib_tx_frees =
+   iflib_txq_drain_flushing = iflib_txq_drain_oactive =
+   iflib_txq_drain_notready = iflib_txq_drain_encapfail =
+   iflib_encap_load_mbuf_fail = iflib_encap_txq_avail_fail =
+   iflib_encap_txd_encap_fail = iflib_task_fn_rxs = 
iflib_rx_intr_enables =
+   iflib_fast_intrs = iflib_intr_link = iflib_intr_msix = 
iflib_rx_unavail =
+   iflib_rx_ctx_inactive = iflib_rx_zero_len = iflib_rx_if_input =
+   iflib_rx_mbuf_null = iflib_rxd_flush = 0;
+}
 
 #else
 #define DBG_COUNTER_INC(name)
-
+static void iflib_debug_reset(void) {}
 #endif
 
 
@@ -619,6 +631,7 @@ static int iflib_register(if_ctx_t);
 static void iflib_init_locked(if_ctx_t ctx);
 static void iflib_add_device_sysctl_pre(if_ctx_t ctx);
 static void iflib_add_device_sysctl_post(if_ctx_t ctx);
+static void iflib_ifmp_purge(iflib_txq_t txq);
 
 
 #ifdef DEV_NETMAP
@@ -1266,11 +1279,6 @@ iflib_txsd_alloc(iflib_txq_t txq)
  sctx->isc_tx_maxsize, nsegments, 
sctx->isc_tx_maxsegsize);
goto fail;
}
-#ifdef IFLIB_DIAGNOSTICS
-   device_printf(dev,"maxsize: %zd nsegments: %d maxsegsize: %zd\n",
- sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
-
-#endif
if ((err = bus_dma_tag_create(bus_get_dma_tag(dev),
   1, 0,/* alignment, bounds */
   BUS_SPACE_MAXADDR,   /* lowaddr */
@@ -1287,11 +1295,6 @@ iflib_txsd_alloc(iflib_txq_t txq)
 
goto fail;
}
-#ifdef IFLIB_DIAGNOSTICS
-   device_printf(dev,"TSO maxsize: %d ntsosegments: %d maxsegsize: %d\n",
- scctx->isc_tx_tso_size_max, ntsosegments,
- scctx->isc_tx_tso_segsize_max);
-#endif
if (!(txq->ift_sds.ifsd_flags =
(uint8_t *) malloc(sizeof(uint8_t) *
scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) {
@@ -1921,20 +1924,23 @@ iflib_stop(if_ctx_t ctx)
if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING);
 
IFDI_INTR_DISABLE(ctx);
-   msleep(ctx, &ctx->ifc_mtx, PUSER, "iflib_init", hz);
+   DELAY(10);
+   IFDI_STOP(ctx);
+   DELAY(10);
 
+   iflib_debug_reset();
/* Wait for current tx queue users to exit to disarm watchdog timer. */
for (i = 0; i < scctx->isc_ntxqsets; i++, txq++) {
/* make sure all transmitters have completed before proceeding 
XXX */
 
/* clean any enqueued buffers */
-   iflib_txq_check_drain(txq, 0);
+   iflib_ifmp_purge(txq);
/* Free any existing tx buffers. */
for (j = 0; j < txq->ift_size; j++) {
iflib_txsd_free(ctx, txq, j);
}
txq->ift_processed = txq->ift_cleaned = txq->ift_cidx_processed 
= 0;
-   txq->ift_in_use = txq->ift_cidx = txq->ift_pidx = 
txq->ift_no_desc_avail = 0;
+ 

svn commit: r308643 - head/sys/dev/e1000

2016-11-14 Thread Sean Bruno
Author: sbruno
Date: Mon Nov 14 17:19:03 2016
New Revision: 308643
URL: https://svnweb.freebsd.org/changeset/base/308643

Log:
  Update WOL support for newer em(4) devices.
  
  Do not overwrite the contents of the WUC register, add E1000_WUC_PME_EN
  to the register contents, leaving the default contents intact.
  
  PR:   208343
  Submitted by: Kaho Toshikazu 
  Reviewed by:  jeffrey piper 
  Approved by:  erj@
  MFC after:2 weeks

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Nov 14 13:20:10 2016(r308642)
+++ head/sys/dev/e1000/if_em.c  Mon Nov 14 17:19:03 2016(r308643)
@@ -5274,6 +5274,8 @@ em_get_wakeup(device_t dev)
case e1000_ich10lan:
case e1000_pchlan:
case e1000_pch2lan:
+   case e1000_pch_lpt:
+   case e1000_pch_spt:
apme_mask = E1000_WUC_APME;
adapter->has_amt = TRUE;
eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC);
@@ -5322,7 +5324,7 @@ em_enable_wakeup(device_t dev)
 {
struct adapter  *adapter = device_get_softc(dev);
if_t ifp = adapter->ifp;
-   u32 pmc, ctrl, ctrl_ext, rctl;
+   u32 pmc, ctrl, ctrl_ext, rctl, wuc;
u16 status;
 
if ((pci_find_cap(dev, PCIY_PMG, &pmc) != 0))
@@ -5332,7 +5334,9 @@ em_enable_wakeup(device_t dev)
ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL);
ctrl |= (E1000_CTRL_SWDPIN2 | E1000_CTRL_SWDPIN3);
E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl);
-   E1000_WRITE_REG(&adapter->hw, E1000_WUC, E1000_WUC_PME_EN);
+   wuc = E1000_READ_REG(&adapter->hw, E1000_WUC);
+   wuc |= E1000_WUC_PME_EN;
+   E1000_WRITE_REG(&adapter->hw, E1000_WUC, wuc);
 
if ((adapter->hw.mac.type == e1000_ich8lan) ||
(adapter->hw.mac.type == e1000_pchlan) ||
@@ -5363,8 +5367,10 @@ em_enable_wakeup(device_t dev)
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl);
}
 
-   if ((adapter->hw.mac.type == e1000_pchlan) ||
-   (adapter->hw.mac.type == e1000_pch2lan)) {
+   if ((adapter->hw.mac.type == e1000_pchlan)  ||
+   (adapter->hw.mac.type == e1000_pch2lan) ||
+   (adapter->hw.mac.type == e1000_pch_lpt) ||
+   (adapter->hw.mac.type == e1000_pch_spt)) {
if (em_enable_phy_wakeup(adapter))
return;
} else {
___
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: r308429 - head/sys/dev/e1000

2016-11-07 Thread Sean Bruno
Author: sbruno
Date: Mon Nov  7 22:24:37 2016
New Revision: 308429
URL: https://svnweb.freebsd.org/changeset/base/308429

Log:
  The igb driver currently requires a VF interface to have a non-zero MAC
  address, but the associated PF is giving the VF an all zeros MAC address
  when one is not administratively assigned. The driver should check for
  this case and generate a random address, similar to how the linux igbvf
  driver does.
  
  Submitted by: skoumj...@juniper.net (Scott Koumjian)
  MFH:  2 weeks
  Differential Revision:https://reviews.freebsd.org/D8399

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Mon Nov  7 21:15:39 2016(r308428)
+++ head/sys/dev/e1000/if_igb.c Mon Nov  7 22:24:37 2016(r308429)
@@ -590,11 +590,20 @@ igb_attach(device_t dev)
error = EIO;
goto err_late;
}
-   /* Check its sanity */
-   if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) {
-   device_printf(dev, "Invalid MAC address\n");
-   error = EIO;
-   goto err_late;
+
+   /* Check its sanity */
+   if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) {
+   if (adapter->vf_ifp) {
+   u8 addr[ETHER_ADDR_LEN];
+   arc4rand(&addr, sizeof(addr), 0);
+   addr[0] &= 0xFE;
+   addr[0] |= 0x02;
+   bcopy(addr, adapter->hw.mac.addr, sizeof(addr));
+   } else {
+   device_printf(dev, "Invalid MAC address\n");
+   error = EIO;
+   goto err_late;
+   }
}
 
/* Setup OS specific network interface */
___
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: r308345 - head/sys/dev/e1000

2016-11-07 Thread Sean Bruno


On 11/06/16 23:37, Sepherosa Ziehau wrote:
> On Sun, Nov 6, 2016 at 7:16 AM, John Baldwin  wrote:
>> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote:
>>> Author: sbruno
>>> Date: Sat Nov  5 16:30:42 2016
>>> New Revision: 308345
>>> URL: https://svnweb.freebsd.org/changeset/base/308345
>>>
>>> Log:
>>>   r295133 attempted to deactivate TSO in the 100Mbit link case with this
>>>   adapter to work around bugs in TSO handling at this speed.
>>>
>>>   em_init_locked is called during first boot of the adapter and will
>>>   see that link_speed is unitialized, effectively turning off tso for
>>>   all cards at all speeds, which I believe was *not* the intent.
>>>
>>>   Move the handling of TSO deactivation to the link handler where we can
>>>   more effectively make the decision about what to do.  In addition,
>>>   completely purge the TSO capabilities instead of disabling just CSUM_TSO.
>>>
>>>   Thanks to jhb for explanation of the hw capabilites api.
>>>
>>>   Thanks to royger and cognet for testing the 100Mbit failure case to
>>>   ensure that their adapters do indeed still work.
>>>
>>>   MFC after:  1 week
>>>   Sponsored by:   Limelight Networks
>>>
>>> Modified:
>>>   head/sys/dev/e1000/if_em.c
>>>
>>> Modified: head/sys/dev/e1000/if_em.c
>>> ==
>>> --- head/sys/dev/e1000/if_em.cSat Nov  5 16:23:33 2016
>>> (r308344)
>>> +++ head/sys/dev/e1000/if_em.cSat Nov  5 16:30:42 2016
>>> (r308345)
>>> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
>>>  #define MAX_INTS_PER_SEC 8000
>>>  #define DEFAULT_ITR  (10/(MAX_INTS_PER_SEC * 256))
>>>
>>> -/* Allow common code without TSO */
>>> -#ifndef CSUM_TSO
>>> -#define CSUM_TSO 0
>>> -#endif
>>> -
>>>  #define TSO_WORKAROUND   4
>>>
>>>  static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver 
>>> parameters");
>>> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter)
>>>   if_clearhwassist(ifp);
>>>   if (if_getcapenable(ifp) & IFCAP_TXCSUM)
>>>   if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
>>> - /*
>>> - ** There have proven to be problems with TSO when not
>>> - ** at full gigabit speed, so disable the assist automatically
>>> - ** when at lower speeds.  -jfv
>>> - */
>>> - if (if_getcapenable(ifp) & IFCAP_TSO4) {
>>> - if (adapter->link_speed == SPEED_1000)
>>> - if_sethwassistbits(ifp, CSUM_TSO, 0);
>>> - }
>>> +
>>> + if (if_getcapenable(ifp) & IFCAP_TSO4)
>>> + if_sethwassistbits(ifp, CSUM_TSO, 0);
>>
>> Does this always disable TSO?  Should this part be removed entirely?
>> (That is, it seems like this would disable TSO even on Gigabit links).
>>
>>>   /* Configure for OS presence */
>>>   em_init_manageability(adapter);
>>> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad
>>>   if (link_check && (adapter->link_active == 0)) {
>>>   e1000_get_speed_and_duplex(hw, &adapter->link_speed,
>>>   &adapter->link_duplex);
>>> + /*
>>> + ** There have proven to be problems with TSO when not
>>> + ** at full gigabit speed, so disable the assist automatically
>>> + ** when at lower speeds.  -jfv
>>> + */
>>> + if (adapter->link_speed != SPEED_1000) {
>>> + if_sethwassistbits(ifp, 0, CSUM_TSO);
>>> + if_setcapenablebit(ifp, 0, IFCAP_TSO4);
>>> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4);
>>> +
>>> + }
>>
>> Even though I suggested it, I wonder if it wouldn't be better to only
>> modify if_capenable and not if_capabilities, that way the admin can
>> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving
>> an adapter from 100 to 1G).
> 
> I believe simply clearing CSUM_TSO should work for the TCP stack;
> messing administrative like capenable and hwcaps does not sound
> correct to me.
> 

I don't disagree, but I also don&

Re: svn commit: r308345 - head/sys/dev/e1000

2016-11-07 Thread Sean Bruno


On 11/05/16 17:16, John Baldwin wrote:
> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote:
>> Author: sbruno
>> Date: Sat Nov  5 16:30:42 2016
>> New Revision: 308345
>> URL: https://svnweb.freebsd.org/changeset/base/308345
>>
>> Log:
>>   r295133 attempted to deactivate TSO in the 100Mbit link case with this
>>   adapter to work around bugs in TSO handling at this speed.
>>   
>>   em_init_locked is called during first boot of the adapter and will
>>   see that link_speed is unitialized, effectively turning off tso for
>>   all cards at all speeds, which I believe was *not* the intent.
>>   
>>   Move the handling of TSO deactivation to the link handler where we can
>>   more effectively make the decision about what to do.  In addition,
>>   completely purge the TSO capabilities instead of disabling just CSUM_TSO.
>>   
>>   Thanks to jhb for explanation of the hw capabilites api.
>>   
>>   Thanks to royger and cognet for testing the 100Mbit failure case to
>>   ensure that their adapters do indeed still work.
>>   
>>   MFC after: 1 week
>>   Sponsored by:  Limelight Networks
>>
>> Modified:
>>   head/sys/dev/e1000/if_em.c
>>
>> Modified: head/sys/dev/e1000/if_em.c
>> ==
>> --- head/sys/dev/e1000/if_em.c   Sat Nov  5 16:23:33 2016
>> (r308344)
>> +++ head/sys/dev/e1000/if_em.c   Sat Nov  5 16:30:42 2016
>> (r308345)
>> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
>>  #define MAX_INTS_PER_SEC8000
>>  #define DEFAULT_ITR (10/(MAX_INTS_PER_SEC * 256))
>>  
>> -/* Allow common code without TSO */
>> -#ifndef CSUM_TSO
>> -#define CSUM_TSO0
>> -#endif
>> -
>>  #define TSO_WORKAROUND  4
>>  
>>  static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver 
>> parameters");
>> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter)
>>  if_clearhwassist(ifp);
>>  if (if_getcapenable(ifp) & IFCAP_TXCSUM)
>>  if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
>> -/* 
>> -** There have proven to be problems with TSO when not
>> -** at full gigabit speed, so disable the assist automatically
>> -** when at lower speeds.  -jfv
>> -*/
>> -if (if_getcapenable(ifp) & IFCAP_TSO4) {
>> -if (adapter->link_speed == SPEED_1000)
>> -if_sethwassistbits(ifp, CSUM_TSO, 0);
>> -}
>> +
>> +if (if_getcapenable(ifp) & IFCAP_TSO4)
>> +if_sethwassistbits(ifp, CSUM_TSO, 0);
> 
> Does this always disable TSO?  Should this part be removed entirely?
> (That is, it seems like this would disable TSO even on Gigabit links).
> 

I was confused by this question.  The old code *always* disabled TSO
because link_speed was always 0 here on boot.  My intention is to ensure
that CSUM_TSO is set if IFCAP_TSO4 is set.


>>  /* Configure for OS presence */
>>  em_init_manageability(adapter);
>> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad
>>  if (link_check && (adapter->link_active == 0)) {
>>  e1000_get_speed_and_duplex(hw, &adapter->link_speed,
>>  &adapter->link_duplex);
>> +/* 
>> +** There have proven to be problems with TSO when not
>> +** at full gigabit speed, so disable the assist automatically
>> +** when at lower speeds.  -jfv
>> +*/
>> +if (adapter->link_speed != SPEED_1000) {
>> +if_sethwassistbits(ifp, 0, CSUM_TSO);
>> +if_setcapenablebit(ifp, 0, IFCAP_TSO4);
>> +if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4);
>> +
>> +}
> 
> Even though I suggested it, I wonder if it wouldn't be better to only
> modify if_capenable and not if_capabilities, that way the admin can
> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving
> an adapter from 100 to 1G).
> 

I spent several hours trying to come up with logic that would allow me
to allow the user to do this.  I am open to suggestions here, but it
would require quite a bit more finesse than my "big hammer" approach.

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r308345 - head/sys/dev/e1000

2016-11-05 Thread Sean Bruno
Author: sbruno
Date: Sat Nov  5 16:30:42 2016
New Revision: 308345
URL: https://svnweb.freebsd.org/changeset/base/308345

Log:
  r295133 attempted to deactivate TSO in the 100Mbit link case with this
  adapter to work around bugs in TSO handling at this speed.
  
  em_init_locked is called during first boot of the adapter and will
  see that link_speed is unitialized, effectively turning off tso for
  all cards at all speeds, which I believe was *not* the intent.
  
  Move the handling of TSO deactivation to the link handler where we can
  more effectively make the decision about what to do.  In addition,
  completely purge the TSO capabilities instead of disabling just CSUM_TSO.
  
  Thanks to jhb for explanation of the hw capabilites api.
  
  Thanks to royger and cognet for testing the 100Mbit failure case to
  ensure that their adapters do indeed still work.
  
  MFC after:1 week
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Sat Nov  5 16:23:33 2016(r308344)
+++ head/sys/dev/e1000/if_em.c  Sat Nov  5 16:30:42 2016(r308345)
@@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
 #define MAX_INTS_PER_SEC   8000
 #define DEFAULT_ITR(10/(MAX_INTS_PER_SEC * 256))
 
-/* Allow common code without TSO */
-#ifndef CSUM_TSO
-#define CSUM_TSO   0
-#endif
-
 #define TSO_WORKAROUND 4
 
 static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters");
@@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter)
if_clearhwassist(ifp);
if (if_getcapenable(ifp) & IFCAP_TXCSUM)
if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
-   /* 
-   ** There have proven to be problems with TSO when not
-   ** at full gigabit speed, so disable the assist automatically
-   ** when at lower speeds.  -jfv
-   */
-   if (if_getcapenable(ifp) & IFCAP_TSO4) {
-   if (adapter->link_speed == SPEED_1000)
-   if_sethwassistbits(ifp, CSUM_TSO, 0);
-   }
+
+   if (if_getcapenable(ifp) & IFCAP_TSO4)
+   if_sethwassistbits(ifp, CSUM_TSO, 0);
 
/* Configure for OS presence */
em_init_manageability(adapter);
@@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad
if (link_check && (adapter->link_active == 0)) {
e1000_get_speed_and_duplex(hw, &adapter->link_speed,
&adapter->link_duplex);
+   /* 
+   ** There have proven to be problems with TSO when not
+   ** at full gigabit speed, so disable the assist automatically
+   ** when at lower speeds.  -jfv
+   */
+   if (adapter->link_speed != SPEED_1000) {
+   if_sethwassistbits(ifp, 0, CSUM_TSO);
+   if_setcapenablebit(ifp, 0, IFCAP_TSO4);
+   if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4);
+
+   }
+
/* Check if we must disable SPEED_MODE bit on PCI-E */
if ((adapter->link_speed != SPEED_1000) &&
((hw->mac.type == e1000_82571) ||
___
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: r308343 - head/sys/dev/bxe

2016-11-05 Thread Sean Bruno
Author: sbruno
Date: Sat Nov  5 16:17:07 2016
New Revision: 308343
URL: https://svnweb.freebsd.org/changeset/base/308343

Log:
  r266979 missed a call to enable capabilities of the hw leading to an
  inability to enable features of the device.
  
  PR: 213845
  Submitted by:   pher...@frenchfries.net
  MFC after:  1 week

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

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Sat Nov  5 15:01:41 2016(r308342)
+++ head/sys/dev/bxe/bxe.c  Sat Nov  5 16:17:07 2016(r308343)
@@ -12691,6 +12691,7 @@ bxe_init_ifnet(struct bxe_softc *sc)
  IFCAP_WOL_MAGIC);
 #endif
 if_setcapabilitiesbit(ifp, capabilities, 0); /* XXX */
+if_setcapenable(ifp, if_getcapabilities(ifp));
 if_setbaudrate(ifp, IF_Gbps(10));
 /* XXX */
 if_setsendqlen(ifp, sc->tx_ring_size);
___
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: r308215 - head/sys/dev/e1000

2016-11-02 Thread Sean Bruno
Author: sbruno
Date: Wed Nov  2 14:25:30 2016
New Revision: 308215
URL: https://svnweb.freebsd.org/changeset/base/308215

Log:
  Removed unused M_TSO_LEN.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Wed Nov  2 13:11:19 2016(r308214)
+++ head/sys/dev/e1000/if_em.c  Wed Nov  2 14:25:30 2016(r308215)
@@ -365,7 +365,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1);
 
 #define EM_TICKS_TO_USECS(ticks)   ((1024 * (ticks) + 500) / 1000)
 #define EM_USECS_TO_TICKS(usecs)   ((1000 * (usecs) + 512) / 1024)
-#define M_TSO_LEN  66
 
 #define MAX_INTS_PER_SEC   8000
 #define DEFAULT_ITR(10/(MAX_INTS_PER_SEC * 256))
___
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: r308038 - head/sys/dev/netmap

2016-10-28 Thread Sean Bruno
Author: sbruno
Date: Fri Oct 28 13:37:58 2016
New Revision: 308038
URL: https://svnweb.freebsd.org/changeset/base/308038

Log:
  The buffer address is always overwritten in the extended descriptor format,
  we have to refresh it ... always.  This fixes problems reported in NetMap
  with em(4) devices after conversion to extended descriptor format in
  svn r293331.
  
  Submitted by: luigi@
  Reported by:  fra...@opnsense.org
  MFC after:2 days

Modified:
  head/sys/dev/netmap/if_em_netmap.h

Modified: head/sys/dev/netmap/if_em_netmap.h
==
--- head/sys/dev/netmap/if_em_netmap.h  Fri Oct 28 12:59:21 2016
(r308037)
+++ head/sys/dev/netmap/if_em_netmap.h  Fri Oct 28 13:37:58 2016
(r308038)
@@ -277,9 +277,9 @@ em_netmap_rxsync(struct netmap_kring *kr
if (addr == NETMAP_BUF_BASE(na)) /* bad buf */
goto ring_reset;
 
+   curr->read.buffer_addr = htole64(paddr);
if (slot->flags & NS_BUF_CHANGED) {
/* buffer has changed, reload map */
-   curr->read.buffer_addr = htole64(paddr);
netmap_reload_map(na, rxr->rxtag, rxbuf->map, 
addr);
slot->flags &= ~NS_BUF_CHANGED;
}
___
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: r307657 - head/sys/kern

2016-10-19 Thread Sean Bruno
Author: sbruno
Date: Wed Oct 19 21:01:24 2016
New Revision: 307657
URL: https://svnweb.freebsd.org/changeset/base/307657

Log:
  Resolve whitespace diff to NextBSD.
  
  Check to see that the taskqueue thread count requires us to acutally
  iterate over the thread count to bind to cpus.
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Wed Oct 19 20:56:21 2016
(r307656)
+++ head/sys/kern/subr_gtaskqueue.c Wed Oct 19 21:01:24 2016
(r307657)
@@ -52,7 +52,6 @@ static MALLOC_DEFINE(M_GTASKQUEUE, "task
 static voidgtaskqueue_thread_enqueue(void *);
 static voidgtaskqueue_thread_loop(void *arg);
 
-
 struct gtaskqueue_busy {
struct gtask*tb_running;
TAILQ_ENTRY(gtaskqueue_busy) tb_link;
@@ -655,11 +654,11 @@ taskqgroup_attach_deferred(struct taskqg
if (gtask->gt_irq != -1) {
mtx_unlock(&qgroup->tqg_lock);
 
-   CPU_ZERO(&mask);
-   CPU_SET(cpu, &mask);
-   intr_setaffinity(gtask->gt_irq, &mask);
+   CPU_ZERO(&mask);
+   CPU_SET(cpu, &mask);
+   intr_setaffinity(gtask->gt_irq, &mask);
 
-   mtx_lock(&qgroup->tqg_lock);
+   mtx_lock(&qgroup->tqg_lock);
}
qgroup->tqg_queue[qid].tgc_cnt++;
 
@@ -789,6 +788,9 @@ taskqgroup_bind(struct taskqgroup *qgrou
 * Bind taskqueue threads to specific CPUs, if they have been assigned
 * one.
 */
+   if (qgroup->tqg_cnt == 1)
+   return;
+
for (i = 0; i < qgroup->tqg_cnt; i++) {
gtask = malloc(sizeof (*gtask), M_DEVBUF, M_WAITOK);
GTASK_INIT(>ask->bt_task, 0, 0, taskqgroup_binder, gtask);
@@ -855,7 +857,6 @@ _taskqgroup_adjust(struct taskqgroup *qg
LIST_INSERT_HEAD(>ask_head, gtask, gt_list);
}
}
-
mtx_unlock(&qgroup->tqg_lock);
 
while ((gtask = LIST_FIRST(>ask_head))) {
___
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: r307569 - head/sys/dev/netmap

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 14:48:41 2016
New Revision: 307569
URL: https://svnweb.freebsd.org/changeset/base/307569

Log:
  Restore svn r306772 that was overwritten by netmap import at svn r307394
  
  #include  should be here as all drivers that support
  netmap need to use this file regardless.

Modified:
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/netmap_kern.h
==
--- head/sys/dev/netmap/netmap_kern.h   Tue Oct 18 14:02:45 2016
(r307568)
+++ head/sys/dev/netmap/netmap_kern.h   Tue Oct 18 14:48:41 2016
(r307569)
@@ -73,6 +73,7 @@
 #endif
 
 #if defined(__FreeBSD__)
+#include 
 
 #define likely(x)  __builtin_expect((long)!!(x), 1L)
 #define unlikely(x)__builtin_expect((long)!!(x), 0L)
___
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: r307568 - head/sys/net

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 14:02:45 2016
New Revision: 307568
URL: https://svnweb.freebsd.org/changeset/base/307568

Log:
  Set default capabilities at attach.
  
  ref: 
https://github.com/NextBSD/NextBSD/commit/6425f45e5fc89f64925995bbcfc09c7558d896ea
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Oct 18 14:00:26 2016(r307567)
+++ head/sys/net/iflib.cTue Oct 18 14:02:45 2016(r307568)
@@ -3903,6 +3903,10 @@ _iflib_assert(if_shared_ctx_t sctx)
MPASS(sctx->isc_ntxd_default[0]);
 }
 
+#define DEFAULT_CAPS (IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM_IPV6 | IFCAP_HWCSUM | 
IFCAP_LRO | \
+IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING |   \
+IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO | 
IFCAP_HWSTATS)
+
 static int
 iflib_register(if_ctx_t ctx)
 {
@@ -3937,8 +3941,9 @@ iflib_register(if_ctx_t ctx)
if_setqflushfn(ifp, iflib_if_qflush);
if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
 
-   if_setcapabilities(ifp, 0);
-   if_setcapenable(ifp, 0);
+   /* XXX - move this in to the driver for non-default settings */
+   if_setcapabilities(ifp, DEFAULT_CAPS);
+   if_setcapenable(ifp, DEFAULT_CAPS);
 
ctx->ifc_vlan_attach_event =
EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx,
___
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: r307567 - head/sys/kern

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 14:00:26 2016
New Revision: 307567
URL: https://svnweb.freebsd.org/changeset/base/307567

Log:
  Assert that we're assigning a non-null taskqueue.
  ref: 
https://github.com/NextBSD/NextBSD/commit/535865d02c162e415d7436899cd6db5000a0cc7b
  
  Fix cpu assignment by assuring stride is non-zero, assert that all tasks
  have a valid taskqueue.
  ref: 
https://github.com/NextBSD/NextBSD/commit/db398176234fe3ce9f8e8b671f56000f8276feba
  
  Start cpu assignment from zero.
  ref: 
https://github.com/NextBSD/NextBSD/commit/d99d39b6b6c5dfac1eb440c41e36ebf4c897198e
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:55:34 2016
(r307566)
+++ head/sys/kern/subr_gtaskqueue.c Tue Oct 18 14:00:26 2016
(r307567)
@@ -665,6 +665,7 @@ taskqgroup_attach_deferred(struct taskqg
 
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask,
 gt_list);
+   MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
mtx_unlock(&qgroup->tqg_lock);
 }
@@ -729,6 +730,7 @@ taskqgroup_attach_cpu_deferred(struct ta
}
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
+   MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
mtx_unlock(&qgroup->tqg_lock);
 
@@ -834,10 +836,10 @@ _taskqgroup_adjust(struct taskqgroup *qg
 */
cpu = old_cpu;
for (i = old_cnt; i < cnt; i++) {
-   for (k = 0; k < qgroup->tqg_stride; k++)
-   cpu = CPU_NEXT(cpu);
-
taskqgroup_cpu_create(qgroup, i, cpu);
+
+   for (k = 0; k < stride; k++)
+   cpu = CPU_NEXT(cpu);
}
mtx_lock(&qgroup->tqg_lock);
qgroup->tqg_cnt = cnt;
@@ -864,6 +866,15 @@ _taskqgroup_adjust(struct taskqgroup *qg
taskqgroup_attach_deferred(qgroup, gtask);
}
 
+#ifdef INVARIANTS
+   mtx_lock(&qgroup->tqg_lock);
+   for (i = 0; i < qgroup->tqg_cnt; i++) {
+   MPASS(qgroup->tqg_queue[i].tgc_taskq != NULL);
+   LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list)
+   MPASS(gtask->gt_taskqueue != NULL);
+   }
+   mtx_unlock(&qgroup->tqg_lock);
+#endif
/*
 * If taskq thread count has been reduced.
 */
___
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: r307566 - head/sys/kern

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 13:55:34 2016
New Revision: 307566
URL: https://svnweb.freebsd.org/changeset/base/307566

Log:
  Ensure that tasks with a specific cpu set prior to smp starting get
  re-attached to a thread running on that cpu.
  
  ref: 
https://github.com/NextBSD/NextBSD/commit/fcc20e306bc93ebbbe51f3775d1afb527970a2e9
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:39:55 2016
(r307565)
+++ head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:55:34 2016
(r307566)
@@ -554,7 +554,7 @@ struct taskq_bind_task {
 };
 
 static void
-taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx)
+taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx, int cpu)
 {
struct taskqgroup_cpu *qcpu;
 
@@ -564,7 +564,7 @@ taskqgroup_cpu_create(struct taskqgroup 
taskqueue_thread_enqueue, &qcpu->tgc_taskq);
gtaskqueue_start_threads(&qcpu->tgc_taskq, 1, PI_SOFT,
"%s_%d", qgroup->tqg_name, idx);
-   qcpu->tgc_cpu = idx * qgroup->tqg_stride;
+   qcpu->tgc_cpu = cpu;
 }
 
 static void
@@ -633,8 +633,8 @@ taskqgroup_attach(struct taskqgroup *qgr
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-   gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
if (irq != -1 && smp_started) {
+   gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
CPU_ZERO(&mask);
CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
mtx_unlock(&qgroup->tqg_lock);
@@ -643,6 +643,32 @@ taskqgroup_attach(struct taskqgroup *qgr
mtx_unlock(&qgroup->tqg_lock);
 }
 
+static void
+taskqgroup_attach_deferred(struct taskqgroup *qgroup, struct grouptask *gtask)
+{
+   cpuset_t mask;
+   int qid, cpu;
+
+   mtx_lock(&qgroup->tqg_lock);
+   qid = taskqgroup_find(qgroup, gtask->gt_uniq);
+   cpu = qgroup->tqg_queue[qid].tgc_cpu;
+   if (gtask->gt_irq != -1) {
+   mtx_unlock(&qgroup->tqg_lock);
+
+   CPU_ZERO(&mask);
+   CPU_SET(cpu, &mask);
+   intr_setaffinity(gtask->gt_irq, &mask);
+
+   mtx_lock(&qgroup->tqg_lock);
+   }
+   qgroup->tqg_queue[qid].tgc_cnt++;
+
+   LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask,
+gt_list);
+   gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
+   mtx_unlock(&qgroup->tqg_lock);
+}
+
 int
 taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask,
void *uniq, int cpu, int irq, char *name)
@@ -671,13 +697,46 @@ taskqgroup_attach_cpu(struct taskqgroup 
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-   if (irq != -1 && smp_started) {
-   CPU_ZERO(&mask);
-   CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
-   mtx_unlock(&qgroup->tqg_lock);
+   cpu = qgroup->tqg_queue[qid].tgc_cpu;
+   mtx_unlock(&qgroup->tqg_lock);
+
+   CPU_ZERO(&mask);
+   CPU_SET(cpu, &mask);
+   if (irq != -1 && smp_started)
intr_setaffinity(irq, &mask);
-   } else
+   return (0);
+}
+
+static int
+taskqgroup_attach_cpu_deferred(struct taskqgroup *qgroup, struct grouptask 
*gtask)
+{
+   cpuset_t mask;
+   int i, qid, irq, cpu;
+
+   qid = -1;
+   irq = gtask->gt_irq;
+   cpu = gtask->gt_cpu;
+   MPASS(smp_started);
+   mtx_lock(&qgroup->tqg_lock);
+   for (i = 0; i < qgroup->tqg_cnt; i++)
+   if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
+   qid = i;
+   break;
+   }
+   if (qid == -1) {
mtx_unlock(&qgroup->tqg_lock);
+   return (EINVAL);
+   }
+   qgroup->tqg_queue[qid].tgc_cnt++;
+   LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
+   gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
+   mtx_unlock(&qgroup->tqg_lock);
+
+   CPU_ZERO(&mask);
+   CPU_SET(cpu, &mask);
+
+   if (irq != -1)
+   intr_setaffinity(irq, &mask);
return (0);
 }
 
@@ -741,9 +800,8 @@ static int
 _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride)
 {
LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL);
-   cpuset_t mask;
struct grouptask *gtask;
-   int i, k, old_cnt, qid, cpu;
+   int i, k, old_cnt, old_cpu, cpu;
 
mtx_assert(&qgroup->tqg_lock, MA_OWNED);
 
@@ -758,6 +816,9 @@ _taskqgroup_adjust(struct taskqgroup *qg
}
q

svn commit: r307563 - head/sys/net

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 13:29:30 2016
New Revision: 307563
URL: https://svnweb.freebsd.org/changeset/base/307563

Log:
  When deciding whether or not to call tqg_attach_cpu(), reference rid
  directly.
  
  ref: 
https://github.com/NextBSD/NextBSD/commit/c9b47b468b8a3350811acfd9e167a8b91dc8f0c6
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Oct 18 13:22:44 2016(r307562)
+++ head/sys/net/iflib.cTue Oct 18 13:29:30 2016(r307563)
@@ -4327,6 +4327,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
void *q;
 
info = &ctx->ifc_filter_info;
+   tqrid = rid;
 
switch (type) {
/* XXX merge tx/rx for netmap? */
@@ -4335,7 +4336,6 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
info = &ctx->ifc_txqs[qid].ift_filter_info;
gtask = &ctx->ifc_txqs[qid].ift_task;
tqg = qgroup_if_io_tqg;
-   tqrid = irq->ii_rid;
fn = _task_fn_tx;
break;
case IFLIB_INTR_RX:
@@ -4343,7 +4343,6 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
info = &ctx->ifc_rxqs[qid].ifr_filter_info;
gtask = &ctx->ifc_rxqs[qid].ifr_task;
tqg = qgroup_if_io_tqg;
-   tqrid = irq->ii_rid;
fn = _task_fn_rx;
break;
case IFLIB_INTR_ADMIN:
@@ -4351,7 +4350,6 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
info = &ctx->ifc_filter_info;
gtask = &ctx->ifc_admin_task;
tqg = qgroup_if_config_tqg;
-   tqrid = -1;
fn = _task_fn_admin;
break;
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: r307562 - head/sys/net

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 13:22:44 2016
New Revision: 307562
URL: https://svnweb.freebsd.org/changeset/base/307562

Log:
  Toggle v4/v6 rxcsum together
  
  Only re-init if driver is running
  
  ref: 
https://github.com/NextBSD/NextBSD/commit/106518e874ec9a61daf4c09894170d24e2f4d60d
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Oct 18 13:16:27 2016(r307561)
+++ head/sys/net/iflib.cTue Oct 18 13:22:44 2016(r307562)
@@ -3162,8 +3162,6 @@ iflib_if_qflush(if_t ifp)
 IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING |   \
 IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO)
 
-#define IFCAP_REINIT IFCAP_FLAGS
-
 static int
 iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
 {
@@ -3288,6 +3286,8 @@ iflib_if_ioctl(if_t ifp, u_long command,
 #endif
setmask |= (mask & IFCAP_FLAGS);
 
+   if (setmask  & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
+   setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
if ((mask & IFCAP_WOL) &&
(if_getcapabilities(ifp) & IFCAP_WOL) != 0)
setmask |= (mask & (IFCAP_WOL_MCAST|IFCAP_WOL_MAGIC));
@@ -3298,10 +3298,10 @@ iflib_if_ioctl(if_t ifp, u_long command,
if (setmask) {
CTX_LOCK(ctx);
bits = if_getdrvflags(ifp);
-   if (setmask & IFCAP_REINIT)
+   if (bits & IFF_DRV_RUNNING)
iflib_stop(ctx);
if_togglecapenable(ifp, setmask);
-   if (setmask & IFCAP_REINIT)
+   if (bits & IFF_DRV_RUNNING)
iflib_init_locked(ctx);
if_setdrvflags(ifp, bits);
CTX_UNLOCK(ctx);
___
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: r307561 - head/sys/kern

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 13:16:27 2016
New Revision: 307561
URL: https://svnweb.freebsd.org/changeset/base/307561

Log:
  Tell gtask to what we've been bound.
  
  ref: 
https://github.com/NextBSD/NextBSD/commit/54414984cfebb920bbc40aadeb601bdce448d8d7
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:12:19 2016
(r307560)
+++ head/sys/kern/subr_gtaskqueue.c Tue Oct 18 13:16:27 2016
(r307561)
@@ -633,6 +633,7 @@ taskqgroup_attach(struct taskqgroup *qgr
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
+   gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
if (irq != -1 && smp_started) {
CPU_ZERO(&mask);
CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
___
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: r307560 - head/sys/net

2016-10-18 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 18 13:12:19 2016
New Revision: 307560
URL: https://svnweb.freebsd.org/changeset/base/307560

Log:
  Fix misusage of CPU_FFS when binding queues to cpus
  
  ref: 
https://github.com/NextBSD/NextBSD/commit/922d0bdf2277f30954f143107d2a3eddb02abd2d
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Oct 18 12:58:17 2016(r307559)
+++ head/sys/net/iflib.cTue Oct 18 13:12:19 2016(r307560)
@@ -4294,17 +4294,23 @@ iflib_irq_alloc(if_ctx_t ctx, if_irq_t i
return (_iflib_irq_alloc(ctx, irq, rid, filter, handler, arg, name));
 }
 
-static void
+static int
 find_nth(if_ctx_t ctx, cpuset_t *cpus, int qid)
 {
-   int i, cpuid;
+   int i, cpuid, eqid, count;
 
CPU_COPY(&ctx->ifc_cpus, cpus);
+   count = CPU_COUNT(&ctx->ifc_cpus);
+   eqid = qid % count;
/* clear up to the qid'th bit */
-   for (i = 0; i < qid; i++) {
+   for (i = 0; i < eqid; i++) {
cpuid = CPU_FFS(cpus);
-   CPU_CLR(cpuid, cpus);
+   MPASS(cpuid != 0);
+   CPU_CLR(cpuid-1, cpus);
}
+   cpuid = CPU_FFS(cpus);
+   MPASS(cpuid != 0);
+   return (cpuid-1);
 }
 
 int
@@ -4317,7 +4323,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
iflib_filter_info_t info;
cpuset_t cpus;
gtask_fn_t *fn;
-   int tqrid, err;
+   int tqrid, err, cpuid;
void *q;
 
info = &ctx->ifc_filter_info;
@@ -4363,11 +4369,11 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
if (err != 0)
return (err);
if (tqrid != -1) {
-   find_nth(ctx, &cpus, qid);
-   taskqgroup_attach_cpu(tqg, gtask, q, CPU_FFS(&cpus), 
irq->ii_rid, name);
-   } else
+   cpuid = find_nth(ctx, &cpus, qid);
+   taskqgroup_attach_cpu(tqg, gtask, q, cpuid, irq->ii_rid, name);
+   } else {
taskqgroup_attach(tqg, gtask, q, tqrid, name);
-
+   }
 
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307327 - in head: sys/boot/efi/loader/arch/i386 targets/pseudo/userland/misc

2016-10-14 Thread Sean Bruno
Author: sbruno
Date: Fri Oct 14 17:25:29 2016
New Revision: 307327
URL: https://svnweb.freebsd.org/changeset/base/307327

Log:
  Update i386 build of loader.efi (but leave it disabled) so that we at
  least build it now.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D7801

Modified:
  head/sys/boot/efi/loader/arch/i386/efimd.c
  head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c
  head/sys/boot/efi/loader/arch/i386/exec.c
  head/targets/pseudo/userland/misc/Makefile.depend

Modified: head/sys/boot/efi/loader/arch/i386/efimd.c
==
--- head/sys/boot/efi/loader/arch/i386/efimd.c  Fri Oct 14 17:10:53 2016
(r307326)
+++ head/sys/boot/efi/loader/arch/i386/efimd.c  Fri Oct 14 17:25:29 2016
(r307327)
@@ -48,7 +48,10 @@ static EFI_GUID hcdp_guid = HCDP_TABLE_G
 
 static UINTN mapkey;
 
-uint64_t
+int ldr_bootinfo(struct bootinfo *, uint64_t *);
+int ldr_enter(const char *);
+
+static uint64_t
 ldr_alloc(vm_offset_t va)
 {
 

Modified: head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c
==
--- head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c  Fri Oct 14 17:10:53 
2016(r307326)
+++ head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c  Fri Oct 14 17:25:29 
2016(r307327)
@@ -35,12 +35,16 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+
 #include "bootstrap.h"
 #include "../libi386/libi386.h"
 #include "../btx/lib/btxv86.h"
 
 extern void __exec(caddr_t addr, ...);
-
+extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp);
+extern int ldr_enter(const char *kernel);
 
 static int elf32_exec(struct preloaded_file *amp);
 static int elf32_obj_exec(struct preloaded_file *amp);
@@ -72,14 +76,14 @@ elf32_exec(struct preloaded_file *fp)
 ehdr = (Elf_Ehdr *)&(md->md_data);
 
 efi_time_fini();
-err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, 
&kernend);
+err = bi_load(fp->f_args, &modulep, &kernend);
 if (err != 0) {
efi_time_init();
return(err);
 }
 entry = ehdr->e_entry & 0xff;
 
-printf("Start @ 0x%lx ...\n", entry);
+printf("Start @ 0x%x ...\n", entry);
 
 ldr_enter(fp->f_name);
 

Modified: head/sys/boot/efi/loader/arch/i386/exec.c
==
--- head/sys/boot/efi/loader/arch/i386/exec.c   Fri Oct 14 17:10:53 2016
(r307326)
+++ head/sys/boot/efi/loader/arch/i386/exec.c   Fri Oct 14 17:25:29 2016
(r307327)
@@ -36,6 +36,12 @@ __FBSDID("$FreeBSD$");
 uint32_t __base;
 struct __v86 __v86;
 
+/* XXX - Needed a definition here to implicitly define exit(); do not remove. 
*/
+static void
+exit(int x)
+{
+}
+
 void
 __v86int()
 {

Modified: head/targets/pseudo/userland/misc/Makefile.depend
==
--- head/targets/pseudo/userland/misc/Makefile.depend   Fri Oct 14 17:10:53 
2016(r307326)
+++ head/targets/pseudo/userland/misc/Makefile.depend   Fri Oct 14 17:25:29 
2016(r307327)
@@ -77,7 +77,7 @@ DIRDEPS.amd64+= \
 
 DIRDEPS.arm= ${_sys_boot_fdt} ${_sys_boot_efi}
 DIRDEPS.arm64= ${_sys_boot_fdt} ${_sys_boot_efi}
-DIRDEPS.i386= ${DIRDEPS.x86sys} sys/boot/efi/libefi
+DIRDEPS.i386= ${DIRDEPS.x86sys} ${_sys_boot_efi}
 DIRDEPS.powerpc= ${_sys_boot_fdt} sys/boot/libstand32 sys/boot/ofw 
sys/boot/uboot
 DIRDEPS.pc98= sys/boot/libstand32
 DIRDEPS.sparc64= sys/boot/ofw ${_sys_boot_zfs}
___
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: r307041 - head/sys/kern

2016-10-11 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 11 14:08:53 2016
New Revision: 307041
URL: https://svnweb.freebsd.org/changeset/base/307041

Log:
  Fix bug where malloc(.., M_NOWAIT) return value is not checked, Change to
  M_WAITOK and move outside the mutex
  
  Submitted by: shurd
  Reviewed by:  mm...@nextbsd.org
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D7649

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Oct 11 13:30:39 2016
(r307040)
+++ head/sys/kern/subr_gtaskqueue.c Tue Oct 11 14:08:53 2016
(r307041)
@@ -728,7 +728,7 @@ taskqgroup_bind(struct taskqgroup *qgrou
 * one.
 */
for (i = 0; i < qgroup->tqg_cnt; i++) {
-   gtask = malloc(sizeof (*gtask), M_DEVBUF, M_NOWAIT);
+   gtask = malloc(sizeof (*gtask), M_DEVBUF, M_WAITOK);
GTASK_INIT(>ask->bt_task, 0, 0, taskqgroup_binder, gtask);
gtask->bt_cpuid = qgroup->tqg_queue[i].tgc_cpu;
grouptaskqueue_enqueue(qgroup->tqg_queue[i].tgc_taskq,
@@ -827,11 +827,11 @@ _taskqgroup_adjust(struct taskqgroup *qg
for (i = cnt; i < old_cnt; i++)
taskqgroup_cpu_remove(qgroup, i);
 
+   taskqgroup_bind(qgroup);
+
mtx_lock(&qgroup->tqg_lock);
qgroup->tqg_adjusting = 0;
 
-   taskqgroup_bind(qgroup);
-
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r306772 - head/sys/dev/netmap

2016-10-06 Thread Sean Bruno
Author: sbruno
Date: Thu Oct  6 17:54:34 2016
New Revision: 306772
URL: https://svnweb.freebsd.org/changeset/base/306772

Log:
  Move netmap selinfo.h in to sensible location.
  
  netmap_kern.h currently requires all drivers including it to include
  selinfo.h.
  
  Submitted by: mm...@nextbsd.org
  Reviewed by:  gnn
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D5334

Modified:
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/netmap_kern.h
==
--- head/sys/dev/netmap/netmap_kern.h   Thu Oct  6 17:35:50 2016
(r306771)
+++ head/sys/dev/netmap/netmap_kern.h   Thu Oct  6 17:54:34 2016
(r306772)
@@ -62,6 +62,7 @@
 #endif
 
 #if defined(__FreeBSD__)
+#include 
 
 #define likely(x)  __builtin_expect((long)!!(x), 1L)
 #define unlikely(x)__builtin_expect((long)!!(x), 0L)
___
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: r304149 - head/sys/dev/e1000

2016-08-15 Thread Sean Bruno
Author: sbruno
Date: Mon Aug 15 11:24:30 2016
New Revision: 304149
URL: https://svnweb.freebsd.org/changeset/base/304149

Log:
  e1000:  Add support for Kaby Lake IDs
  
  Fixup some errors when transitioning to/from low power states.
  
  Submitted by: erj
  Reviewed by:  Jeffery Piper (jeffrey.e.pi...@intel.com)
  MFC after:3 days
  Relnotes: yes
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D7478

Modified:
  head/sys/dev/e1000/e1000_api.c
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/e1000/e1000_ich8lan.h
  head/sys/dev/e1000/e1000_phy.c
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/e1000_api.c
==
--- head/sys/dev/e1000/e1000_api.c  Mon Aug 15 11:16:43 2016
(r304148)
+++ head/sys/dev/e1000/e1000_api.c  Mon Aug 15 11:24:30 2016
(r304149)
@@ -304,6 +304,10 @@ s32 e1000_set_mac_type(struct e1000_hw *
case E1000_DEV_ID_PCH_SPT_I219_LM2:
case E1000_DEV_ID_PCH_SPT_I219_V2:
case E1000_DEV_ID_PCH_LBG_I219_LM3:
+   case E1000_DEV_ID_PCH_SPT_I219_LM4:
+   case E1000_DEV_ID_PCH_SPT_I219_V4:
+   case E1000_DEV_ID_PCH_SPT_I219_LM5:
+   case E1000_DEV_ID_PCH_SPT_I219_V5:
mac->type = e1000_pch_spt;
break;
case E1000_DEV_ID_82575EB_COPPER:

Modified: head/sys/dev/e1000/e1000_hw.h
==
--- head/sys/dev/e1000/e1000_hw.h   Mon Aug 15 11:16:43 2016
(r304148)
+++ head/sys/dev/e1000/e1000_hw.h   Mon Aug 15 11:24:30 2016
(r304149)
@@ -142,6 +142,10 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_SPT_I219_LM2  0x15B7 /* Sunrise Point-H PCH */
 #define E1000_DEV_ID_PCH_SPT_I219_V2   0x15B8 /* Sunrise Point-H PCH */
 #define E1000_DEV_ID_PCH_LBG_I219_LM3  0x15B9 /* LEWISBURG PCH */
+#define E1000_DEV_ID_PCH_SPT_I219_LM4  0x15D7
+#define E1000_DEV_ID_PCH_SPT_I219_V4   0x15D8
+#define E1000_DEV_ID_PCH_SPT_I219_LM5  0x15E3
+#define E1000_DEV_ID_PCH_SPT_I219_V5   0x15D6
 #define E1000_DEV_ID_82576 0x10C9
 #define E1000_DEV_ID_82576_FIBER   0x10E6
 #define E1000_DEV_ID_82576_SERDES  0x10E7
@@ -957,9 +961,13 @@ struct e1000_dev_spec_ich8lan {
E1000_MUTEX nvm_mutex;
E1000_MUTEX swflag_mutex;
bool nvm_k1_enabled;
+   bool disable_k1_off;
bool eee_disable;
u16 eee_lp_ability;
enum e1000_ulp_state ulp_state;
+   bool ulp_capability_disabled;
+   bool during_suspend_flow;
+   bool during_dpg_exit;
 };
 
 struct e1000_dev_spec_82575 {

Modified: head/sys/dev/e1000/e1000_ich8lan.c
==
--- head/sys/dev/e1000/e1000_ich8lan.c  Mon Aug 15 11:16:43 2016
(r304148)
+++ head/sys/dev/e1000/e1000_ich8lan.c  Mon Aug 15 11:24:30 2016
(r304149)
@@ -288,7 +288,7 @@ static void e1000_toggle_lanphypc_pch_lp
mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE;
E1000_WRITE_REG(hw, E1000_CTRL, mac_reg);
E1000_WRITE_FLUSH(hw);
-   usec_delay(10);
+   msec_delay(1);
mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
E1000_WRITE_REG(hw, E1000_CTRL, mac_reg);
E1000_WRITE_FLUSH(hw);
@@ -1625,7 +1625,17 @@ static s32 e1000_check_for_copper_link_i
hw->phy.ops.write_reg_locked(hw,
 I217_PLL_CLOCK_GATE_REG,
 phy_reg);
-   }
+
+   if (speed == SPEED_1000) {
+   hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL,
+   &phy_reg);
+
+   phy_reg |= HV_PM_CTRL_K1_CLK_REQ;
+
+   hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL,
+phy_reg);
+   }
+}
hw->phy.ops.release(hw);
 
if (ret_val)
@@ -1718,7 +1728,8 @@ static s32 e1000_check_for_copper_link_i
u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG);
u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6);
 
-   if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE)
+   if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) &&
+   (hw->dev_spec.ich8lan.disable_k1_off == FALSE))
fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE;
else
fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE;

Modified: head/sys/dev/e1000/e1000_ich8lan.h
==
--- head/sys/dev/e1000/e1000_ich8lan.h  Mon Au

Re: svn commit: r303848 - head/sys/netgraph

2016-08-12 Thread Sean Bruno
The original problem was reported in this review, it doesn't look like
an "old" problem IMO.

sean

https://reviews.freebsd.org/D7209
___
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: r303848 - head/sys/netgraph

2016-08-08 Thread Sean Bruno
Author: sbruno
Date: Mon Aug  8 19:31:01 2016
New Revision: 303848
URL: https://svnweb.freebsd.org/changeset/base/303848

Log:
  Avoid panic from ng_uncallout when unpluggin ethernet cable with active
  PPTP VPN connection.
  
  Submitted by: Michael Zhilin 
  Reviewed by:  ngie
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D7209

Modified:
  head/sys/netgraph/ng_base.c

Modified: head/sys/netgraph/ng_base.c
==
--- head/sys/netgraph/ng_base.c Mon Aug  8 18:57:50 2016(r303847)
+++ head/sys/netgraph/ng_base.c Mon Aug  8 19:31:01 2016(r303848)
@@ -3815,7 +3815,7 @@ ng_uncallout(struct callout *c, node_p n
item = c->c_arg;
/* Do an extra check */
if ((rval > 0) && (c->c_func == &ng_callout_trampoline) &&
-   (NGI_NODE(item) == node)) {
+   (item != NULL) && (NGI_NODE(item) == node)) {
/*
 * We successfully removed it from the queue before it ran
 * So now we need to unreference everything that was
___
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: r303847 - head/sys/dev/ixl

2016-08-08 Thread Sean Bruno
Author: sbruno
Date: Mon Aug  8 18:57:50 2016
New Revision: 303847
URL: https://svnweb.freebsd.org/changeset/base/303847

Log:
  Fixup ixl(4) options parsing to actually compile when using RSS/PCBGROUP
  in GENERIC.
  
  Fixup #ifdef RSS code blocks so that they build and add/delete variables
  that were missesd during the creation of this code.
  
  This code is untested and should have a big red warning on it.
  
  Reported by:  npn@
  MFC after:2 days

Modified:
  head/sys/dev/ixl/ixl.h
  head/sys/dev/ixl/ixl_pf_main.c
  head/sys/dev/ixl/ixlvc.c

Modified: head/sys/dev/ixl/ixl.h
==
--- head/sys/dev/ixl/ixl.h  Mon Aug  8 18:31:28 2016(r303846)
+++ head/sys/dev/ixl/ixl.h  Mon Aug  8 18:57:50 2016(r303847)
@@ -36,6 +36,10 @@
 #ifndef _IXL_H_
 #define _IXL_H_
 
+#include "opt_inet.h"
+#include "opt_inet6.h"
+#include "opt_rss.h"
+
 #include 
 #include 
 #include 
@@ -93,12 +97,9 @@
 
 #ifdef RSS
 #include 
+#include 
 #endif
 
-#include "opt_inet.h"
-#include "opt_inet6.h"
-#include "opt_rss.h"
-
 #include "i40e_type.h"
 #include "i40e_prototype.h"
 

Modified: head/sys/dev/ixl/ixl_pf_main.c
==
--- head/sys/dev/ixl/ixl_pf_main.c  Mon Aug  8 18:31:28 2016
(r303846)
+++ head/sys/dev/ixl/ixl_pf_main.c  Mon Aug  8 18:57:50 2016
(r303847)
@@ -1155,6 +1155,10 @@ ixl_setup_queue_tqs(struct ixl_vsi *vsi)
 {
struct ixl_queue *que = vsi->queues;
device_t dev = vsi->dev;
+#ifdef  RSS
+   int cpu_id = 0;
+cpuset_t   cpu_mask;
+#endif
 
/* Create queue tasks and start queue taskqueues */
for (int i = 0; i < vsi->num_queues; i++, que++) {
@@ -1246,9 +1250,6 @@ ixl_setup_queue_msix(struct ixl_vsi *vsi
struct  ixl_queue *que = vsi->queues;
struct  tx_ring  *txr;
int error, rid, vector = 1;
-#ifdef RSS
-   cpuset_t cpu_mask;
-#endif
 
/* Queue interrupt vector numbers start at 1 (adminq intr is 0) */
for (int i = 0; i < vsi->num_queues; i++, vector++, que++) {

Modified: head/sys/dev/ixl/ixlvc.c
==
--- head/sys/dev/ixl/ixlvc.cMon Aug  8 18:31:28 2016(r303846)
+++ head/sys/dev/ixl/ixlvc.cMon Aug  8 18:57:50 2016(r303847)
@@ -836,13 +836,10 @@ ixlv_config_rss_key(struct ixlv_sc *sc)
struct i40e_virtchnl_rss_key *rss_key_msg;
int msg_len, key_length;
u8  rss_seed[IXL_RSS_KEY_SIZE];
-#ifdef RSS
-   u32 rss_hash_config;
-#endif
 
 #ifdef RSS
/* Fetch the configured RSS key */
-   rss_getkey(&rss_seed);
+   rss_getkey((uint8_t *) &rss_seed);
 #else
ixl_get_default_rss_key((u32 *)rss_seed);
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303816 - in head/sys: conf dev/ixl modules/ixl modules/ixlv

2016-08-07 Thread Sean Bruno
Author: sbruno
Date: Sun Aug  7 18:12:36 2016
New Revision: 303816
URL: https://svnweb.freebsd.org/changeset/base/303816

Log:
  ixl(4): Update to ixl-1.6.6-k.
  
  Submitted by: erj
  Reviewed by:  jeffrey.e.pie...@intel.com
  MFC after:3 days
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D7391

Added:
  head/sys/dev/ixl/ixl_pf_iov.c   (contents, props changed)
  head/sys/dev/ixl/ixl_pf_iov.h
 - copied, changed from r303815, head/sys/dev/ixl/i40e_devids.h
  head/sys/dev/ixl/ixl_pf_main.c
 - copied, changed from r303815, head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/ixl_pf_qmgr.c   (contents, props changed)
  head/sys/dev/ixl/ixl_pf_qmgr.h   (contents, props changed)
Modified:
  head/sys/conf/files.amd64
  head/sys/dev/ixl/i40e_adminq.c
  head/sys/dev/ixl/i40e_adminq.h
  head/sys/dev/ixl/i40e_adminq_cmd.h
  head/sys/dev/ixl/i40e_common.c
  head/sys/dev/ixl/i40e_devids.h
  head/sys/dev/ixl/i40e_nvm.c
  head/sys/dev/ixl/i40e_osdep.c
  head/sys/dev/ixl/i40e_osdep.h
  head/sys/dev/ixl/i40e_prototype.h
  head/sys/dev/ixl/i40e_register.h
  head/sys/dev/ixl/i40e_type.h
  head/sys/dev/ixl/i40e_virtchnl.h
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c
  head/sys/dev/ixl/ixl.h
  head/sys/dev/ixl/ixl_pf.h
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/ixl/ixlv.h
  head/sys/dev/ixl/ixlvc.c
  head/sys/modules/ixl/Makefile
  head/sys/modules/ixlv/Makefile   (contents, props changed)

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Sun Aug  7 17:07:53 2016(r303815)
+++ head/sys/conf/files.amd64   Sun Aug  7 18:12:36 2016(r303816)
@@ -216,6 +216,12 @@ dev/ipmi/ipmi_pci.coptionalipmi pci
 dev/ipmi/ipmi_linux.c  optionalipmi compat_linux32
 dev/ixl/if_ixl.c   optionalixl pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_main.c  optionalixl pci \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_qmgr.c  optionalixl pci \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/ixl_pf_iov.c   optionalixl pci \
+   compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/if_ixlv.c  optionalixlv pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/ixlvc.coptionalixlv pci \

Modified: head/sys/dev/ixl/i40e_adminq.c
==
--- head/sys/dev/ixl/i40e_adminq.c  Sun Aug  7 17:07:53 2016
(r303815)
+++ head/sys/dev/ixl/i40e_adminq.c  Sun Aug  7 18:12:36 2016
(r303816)
@@ -39,16 +39,6 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_is_nvm_update_op - return TRUE if this is an NVM update operation
- * @desc: API request descriptor
- **/
-static INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc)
-{
-   return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase)) ||
-   (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update));
-}
-
-/**
  *  i40e_adminq_init_regs - Initialize AdminQ registers
  *  @hw: pointer to the hardware structure
  *
@@ -661,13 +651,9 @@ enum i40e_status_code i40e_init_adminq(s
 
/* pre-emptive resource lock release */
i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);
-   hw->aq.nvm_release_on_done = FALSE;
+   hw->nvm_release_on_done = FALSE;
hw->nvmupd_state = I40E_NVMUPD_STATE_INIT;
 
-   ret_code = i40e_aq_set_hmc_resource_profile(hw,
-   I40E_HMC_PROFILE_DEFAULT,
-   0,
-   NULL);
ret_code = I40E_SUCCESS;
 
/* success! */
@@ -1081,26 +1067,7 @@ enum i40e_status_code i40e_clean_arq_ele
hw->aq.arq.next_to_clean = ntc;
hw->aq.arq.next_to_use = ntu;
 
-   if (i40e_is_nvm_update_op(&e->desc)) {
-   if (hw->aq.nvm_release_on_done) {
-   i40e_release_nvm(hw);
-   hw->aq.nvm_release_on_done = FALSE;
-   }
-
-   switch (hw->nvmupd_state) {
-   case I40E_NVMUPD_STATE_INIT_WAIT:
-   hw->nvmupd_state = I40E_NVMUPD_STATE_INIT;
-   break;
-
-   case I40E_NVMUPD_STATE_WRITE_WAIT:
-   hw->nvmupd_state = I40E_NVMUPD_STATE_WRITING;
-   break;
-
-   default:
-   break;
-   }
-   }
-
+   i40e_nvmupd_check_wait_event(hw, LE16_TO_CPU(e->desc.opcode));
 clean_arq_element_out:
/* Set pending if needed, unlock and return */
if (pending != NULL)

Modified: head/sys/dev/ixl/i40e_adminq.h
==
--- head/sys/de

svn commit: r303638 - head/sys/dev/e1000

2016-08-01 Thread Sean Bruno
Author: sbruno
Date: Mon Aug  1 21:19:51 2016
New Revision: 303638
URL: https://svnweb.freebsd.org/changeset/base/303638

Log:
  r293331 mistakingly failed to add an assignment of paddr to the rxbuf
  but only in the NETMAP code.  This lead to the NETMAP code paths
  passing nothing up to userland.
  
  Submitted by: Ad Schellevis 
  Reported by:  Franco Fichtner 
  MFC after:1 day

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Aug  1 20:54:54 2016(r303637)
+++ head/sys/dev/e1000/if_em.c  Mon Aug  1 21:19:51 2016(r303638)
@@ -4392,6 +4392,7 @@ em_setup_receive_ring(struct rx_ring *rx
 
addr = PNMB(na, slot + si, &paddr);
netmap_load_map(na, rxr->rxtag, rxbuf->map, addr);
+   rxbuf->paddr = paddr;
em_setup_rxdesc(&rxr->rx_base[j], rxbuf);
continue;
}
___
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: r303327 - head/sys/dev/iwm

2016-07-25 Thread Sean Bruno
Author: sbruno
Date: Tue Jul 26 00:02:17 2016
New Revision: 303327
URL: https://svnweb.freebsd.org/changeset/base/303327

Log:
  iwm(4) synchronize driver to DragonFlyBSD version and recent f/w update.
  
  Submitted by: Kevin Bowling (kevin.bowl...@kev009.com)
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D6967

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_led.c
  head/sys/dev/iwm/if_iwm_led.h
  head/sys/dev/iwm/if_iwm_mac_ctxt.c
  head/sys/dev/iwm/if_iwm_pcie_trans.c
  head/sys/dev/iwm/if_iwm_phy_ctxt.c
  head/sys/dev/iwm/if_iwm_phy_db.c
  head/sys/dev/iwm/if_iwm_power.c
  head/sys/dev/iwm/if_iwm_scan.c
  head/sys/dev/iwm/if_iwm_scan.h
  head/sys/dev/iwm/if_iwm_time_event.c
  head/sys/dev/iwm/if_iwm_util.c
  head/sys/dev/iwm/if_iwm_util.h
  head/sys/dev/iwm/if_iwmreg.h
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Mon Jul 25 23:44:44 2016(r303326)
+++ head/sys/dev/iwm/if_iwm.c   Tue Jul 26 00:02:17 2016(r303327)
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.39 2015/03/23 00:35:19 jsg Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.42 2015/05/30 02:49:23 deraadt Exp $ */
 
 /*
  * Copyright (c) 2014 genua mbh 
@@ -173,11 +173,23 @@ const uint8_t iwm_nvm_channels[] = {
100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144,
149, 153, 157, 161, 165
 };
-#define IWM_NUM_2GHZ_CHANNELS  14
-
 _Static_assert(nitems(iwm_nvm_channels) <= IWM_NUM_CHANNELS,
 "IWM_NUM_CHANNELS is too small");
 
+const uint8_t iwm_nvm_channels_8000[] = {
+   /* 2.4 GHz */
+   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+   /* 5 GHz */
+   36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92,
+   96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144,
+   149, 153, 157, 161, 165, 169, 173, 177, 181
+};
+_Static_assert(nitems(iwm_nvm_channels_8000) <= IWM_NUM_CHANNELS_8000,
+"IWM_NUM_CHANNELS_8000 is too small");
+
+#define IWM_NUM_2GHZ_CHANNELS  14
+#define IWM_N_HW_ADDR_MASK 0xF
+
 /*
  * XXX For now, there's simply a fixed set of rate table entries
  * that are populated.
@@ -205,6 +217,11 @@ const struct iwm_rate {
 #define IWM_RIDX_IS_CCK(_i_) ((_i_) < IWM_RIDX_OFDM)
 #define IWM_RIDX_IS_OFDM(_i_) ((_i_) >= IWM_RIDX_OFDM)
 
+struct iwm_nvm_section {
+   uint16_t length;
+   uint8_t *data;
+};
+
 static int iwm_store_cscheme(struct iwm_softc *, const uint8_t *, size_t);
 static int iwm_firmware_store_section(struct iwm_softc *,
enum iwm_ucode_type,
@@ -242,27 +259,45 @@ static void   iwm_mvm_nic_config(struct iw
 static int iwm_nic_rx_init(struct iwm_softc *);
 static int iwm_nic_tx_init(struct iwm_softc *);
 static int iwm_nic_init(struct iwm_softc *);
-static voidiwm_enable_txq(struct iwm_softc *, int, int);
+static int iwm_enable_txq(struct iwm_softc *, int, int, int);
 static int iwm_post_alive(struct iwm_softc *);
 static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t,
uint16_t, uint8_t *, uint16_t *);
 static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *,
-uint16_t *);
+uint16_t *, size_t);
 static uint32_tiwm_eeprom_channel_flags(uint16_t);
 static voidiwm_add_channel_band(struct iwm_softc *,
-   struct ieee80211_channel[], int, int *, int, int,
+   struct ieee80211_channel[], int, int *, int, size_t,
const uint8_t[]);
 static voidiwm_init_channel_map(struct ieee80211com *, int, int *,
struct ieee80211_channel[]);
 static int iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *,
-  const uint16_t *, const uint16_t *, uint8_t,
-  uint8_t);
-struct iwm_nvm_section;
+  const uint16_t *, const uint16_t *,
+  const uint16_t *, const uint16_t *,
+  const uint16_t *);
+static voidiwm_set_hw_address_8000(struct iwm_softc *,
+   struct iwm_nvm_data *,
+   const uint16_t *, const uint16_t *);
+static int iwm_get_sku(const struct iwm_softc *, const uint16_t *,
+   const uint16_t *);
+static int iwm_get_nvm_version(const struct iwm_softc *, const uint16_t *);
+static int iwm_get_radio_cfg(const struct iwm_softc *, const uint16_t *,
+ const uint16_t *);
+static int iwm_get_n_hw_addrs(const struct iwm_softc *,
+  const uint16_t *);
+static voidiwm_set_radio_cfg(const struct iwm_softc *,
+

svn commit: r303326 - head/sys/dev/iwm

2016-07-25 Thread Sean Bruno
Author: sbruno
Date: Mon Jul 25 23:44:44 2016
New Revision: 303326
URL: https://svnweb.freebsd.org/changeset/base/303326

Log:
  iwm(4): switch to ieee80211_runtask()
  
  Submitted by: Andiry Voskoboinyk (s3er...@gmail.com)
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D5054

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Mon Jul 25 23:38:14 2016(r303325)
+++ head/sys/dev/iwm/if_iwm.c   Mon Jul 25 23:44:44 2016(r303326)
@@ -4092,6 +4092,7 @@ do {  
\
 static void
 iwm_notif_intr(struct iwm_softc *sc)
 {
+   struct ieee80211com *ic = &sc->sc_ic;
uint16_t hw;
 
bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map,
@@ -4145,7 +4146,6 @@ iwm_notif_intr(struct iwm_softc *sc)
int missed;
 
/* XXX look at mac_id to determine interface ID */
-   struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
 
SYNC_RESP_STRUCT(resp, pkt);
@@ -4253,7 +4253,7 @@ iwm_notif_intr(struct iwm_softc *sc)
case IWM_SCAN_COMPLETE_NOTIFICATION: {
struct iwm_scan_complete_notif *notif;
SYNC_RESP_STRUCT(notif, pkt);
-   taskqueue_enqueue(sc->sc_tq, &sc->sc_es_task);
+   ieee80211_runtask(ic, &sc->sc_es_task);
break; }
 
case IWM_REPLY_ERROR: {
@@ -4627,14 +4627,6 @@ iwm_attach(device_t dev)
callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0);
callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0);
TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc);
-   sc->sc_tq = taskqueue_create("iwm_taskq", M_WAITOK,
-taskqueue_thread_enqueue, &sc->sc_tq);
-error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwm_taskq");
-if (error != 0) {
-device_printf(dev, "can't start threads, error %d\n",
-   error);
-   goto fail;
-}
 
/* PCI attach */
error = iwm_pci_attach(dev);
@@ -5015,10 +5007,8 @@ iwm_detach_local(struct iwm_softc *sc, i
device_t dev = sc->sc_dev;
int i;
 
-   if (sc->sc_tq) {
-   taskqueue_drain_all(sc->sc_tq);
-   taskqueue_free(sc->sc_tq);
-   }
+   ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task);
+
callout_drain(&sc->sc_led_blink_to);
callout_drain(&sc->sc_watchdog_to);
iwm_stop_device(sc);

Modified: head/sys/dev/iwm/if_iwmvar.h
==
--- head/sys/dev/iwm/if_iwmvar.hMon Jul 25 23:38:14 2016
(r303325)
+++ head/sys/dev/iwm/if_iwmvar.hMon Jul 25 23:44:44 2016
(r303326)
@@ -495,7 +495,6 @@ struct iwm_softc {
uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX];
int sc_wantresp;
 
-   struct taskqueue*sc_tq;
struct task sc_es_task;
 
struct iwm_rx_phy_info  sc_last_phy_info;
___
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: r303322 - in head: share/man/man4 sys/conf sys/contrib/dev/iwm sys/modules/iwmfw sys/modules/iwmfw/iwm3160fw sys/modules/iwmfw/iwm7260fw sys/modules/iwmfw/iwm7265fw sys/modules/iwmfw/iw...

2016-07-25 Thread Sean Bruno
Author: sbruno
Date: Mon Jul 25 23:05:25 2016
New Revision: 303322
URL: https://svnweb.freebsd.org/changeset/base/303322

Log:
  Update iwmfw(4) to include support for 8260 series units and update
  f/w for the other devices supported by this driver.
  
  Patch linked in https://reviews.freebsd.org/D6967 but not actually
  a part of the review.
  
  Obtained from DragonflyBSD.
  
  Submitted by:   Kevin Bowling 
  MFC after:  2 weeks
  Relnotes:   yes

Added:
  head/sys/contrib/dev/iwm/iwm-3160-16.fw.uu
  head/sys/contrib/dev/iwm/iwm-7260-16.fw.uu
  head/sys/contrib/dev/iwm/iwm-7265-16.fw.uu
  head/sys/contrib/dev/iwm/iwm-8000C-16.fw.uu
  head/sys/modules/iwmfw/iwm8000Cfw/
  head/sys/modules/iwmfw/iwm8000Cfw/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/iwmfw.4
  head/sys/conf/files
  head/sys/contrib/dev/iwm/iwm-3160-9.fw.uu
  head/sys/contrib/dev/iwm/iwm-7260-9.fw.uu
  head/sys/contrib/dev/iwm/iwm-7265-9.fw.uu
  head/sys/modules/iwmfw/Makefile
  head/sys/modules/iwmfw/iwm3160fw/Makefile
  head/sys/modules/iwmfw/iwm7260fw/Makefile
  head/sys/modules/iwmfw/iwm7265fw/Makefile

Modified: head/share/man/man4/iwmfw.4
==
--- head/share/man/man4/iwmfw.4 Mon Jul 25 23:04:21 2016(r303321)
+++ head/share/man/man4/iwmfw.4 Mon Jul 25 23:05:25 2016(r303322)
@@ -22,7 +22,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 28, 2015
+.Dd June 25, 2016
 .Dt IWMFW 4
 .Os
 .Sh NAME
@@ -45,6 +45,7 @@ of the following:
 .Cd "device iwm3160fw"
 .Cd "device iwm7260fw"
 .Cd "device iwm7265fw"
+.Cd "device iwm8000Cfw"
 .Ed
 .Pp
 Alternatively, to load the driver as a
@@ -54,10 +55,11 @@ module at boot time, place the following
 iwm3160fw_load="YES"
 iwm7260fw_load="YES"
 iwm7265fw_load="YES"
+iwm8000Cfw_load="YES"
 .Ed
 .Sh DESCRIPTION
 This module provides access to firmware sets for the
-Intel Dual Band Wireless WiFi 3160, 7260 and 7265 series of
+Intel Dual Band Wireless WiFi 3160, 7260, 7265 and 8260 series of
 IEEE 802.11n/11ac adapters.
 It may be
 statically linked into the kernel, or loaded as a module.

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Jul 25 23:04:21 2016(r303321)
+++ head/sys/conf/files Mon Jul 25 23:05:25 2016(r303322)
@@ -1735,7 +1735,7 @@ iwm3160fw.fwo optional iwm3160fw | iwm
no-implicit-rule\
clean   "iwm3160fw.fwo"
 iwm3160.fw optional iwm3160fw | iwmfw  \
-   dependency  "$S/contrib/dev/iwm/iwm-3160-9.fw.uu" \
+   dependency  "$S/contrib/dev/iwm/iwm-3160-16.fw.uu" \
compile-with"${NORMAL_FW}"  \
no-obj no-implicit-rule \
clean   "iwm3160.fw"
@@ -1749,7 +1749,7 @@ iwm7260fw.fwo optional iwm7260fw | iwm
no-implicit-rule\
clean   "iwm7260fw.fwo"
 iwm7260.fw optional iwm7260fw | iwmfw  \
-   dependency  "$S/contrib/dev/iwm/iwm-7260-9.fw.uu" \
+   dependency  "$S/contrib/dev/iwm/iwm-7260-16.fw.uu" \
compile-with"${NORMAL_FW}"  \
no-obj no-implicit-rule \
clean   "iwm7260.fw"
@@ -1763,10 +1763,24 @@ iwm7265fw.fwo   optional iwm7265fw | iwm
no-implicit-rule\
clean   "iwm7265fw.fwo"
 iwm7265.fw optional iwm7265fw | iwmfw  \
-   dependency  "$S/contrib/dev/iwm/iwm-7265-9.fw.uu" \
+   dependency  "$S/contrib/dev/iwm/iwm-7265-16.fw.uu" \
compile-with"${NORMAL_FW}"  \
no-obj no-implicit-rule \
clean   "iwm7265.fw"
+iwm8000Cfw.c   optional iwm8000Cfw | iwmfw \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk iwm8000C.fw:iwm8000Cfw 
-miwm8000Cfw -c${.TARGET}" \
+   no-implicit-rule before-depend local\
+   clean   "iwm8000Cfw.c"
+iwm8000Cfw.fwo optional iwm8000Cfw | iwmfw \
+   dependency  "iwm8000C.fw"   \
+   compile-with"${NORMAL_FWO}" \
+   no-implicit-rule\
+   clean   "iwm8000Cfw.fwo"
+iwm8000C.fwoptional iwm8000Cfw | iwmfw \
+   dependency  "$S/contrib/dev/iwm/iwm-8000C-16.fw.uu" \
+   compile-with"${NORMAL_FW}"  \
+   no-obj no-implicit-r

svn commit: r303110 - head/sys/dev/e1000

2016-07-20 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 20 19:21:11 2016
New Revision: 303110
URL: https://svnweb.freebsd.org/changeset/base/303110

Log:
  Remove uneeded parens.
  
  MFC after:1 day

Modified:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Wed Jul 20 18:41:47 2016(r303109)
+++ head/sys/dev/e1000/if_igb.c Wed Jul 20 19:21:11 2016(r303110)
@@ -1106,7 +1106,7 @@ igb_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   if ((ifp->if_drv_flags & IFF_DRV_RUNNING))
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
igb_init_locked(adapter);
IGB_CORE_UNLOCK(adapter);
break;

Modified: head/sys/dev/e1000/if_lem.c
==
--- head/sys/dev/e1000/if_lem.c Wed Jul 20 18:41:47 2016(r303109)
+++ head/sys/dev/e1000/if_lem.c Wed Jul 20 19:21:11 2016(r303110)
@@ -1053,7 +1053,7 @@ lem_ioctl(if_t ifp, u_long command, cadd
if_setmtu(ifp, ifr->ifr_mtu);
adapter->max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING))
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
lem_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
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: r303032 - head/sys/dev/ixgbe

2016-07-19 Thread Sean Bruno
Author: sbruno
Date: Tue Jul 19 17:31:48 2016
New Revision: 303032
URL: https://svnweb.freebsd.org/changeset/base/303032

Log:
  Fixup DA cable detection routines to not set the cable type to
  unknown if they do not match one of two cable types.
  
  PR:   150249
  Submitted by: bor...@sarenet.es
  Reviewed by:  erj
  MFC after:3 days

Modified:
  head/sys/dev/ixgbe/ixgbe_phy.c

Modified: head/sys/dev/ixgbe/ixgbe_phy.c
==
--- head/sys/dev/ixgbe/ixgbe_phy.c  Tue Jul 19 17:15:07 2016
(r303031)
+++ head/sys/dev/ixgbe/ixgbe_phy.c  Tue Jul 19 17:31:48 2016
(r303032)
@@ -1534,21 +1534,18 @@ s32 ixgbe_identify_sfp_module_generic(st
hw->phy.type = ixgbe_phy_sfp_intel;
break;
default:
-   if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
-   hw->phy.type =
-ixgbe_phy_sfp_passive_unknown;
-   else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
-   hw->phy.type =
-   ixgbe_phy_sfp_active_unknown;
-   else
-   hw->phy.type = ixgbe_phy_sfp_unknown;
+   hw->phy.type = ixgbe_phy_sfp_unknown;
break;
}
}
 
/* Allow any DA cable vendor */
if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE |
-   IXGBE_SFF_DA_ACTIVE_CABLE)) {
+   IXGBE_SFF_DA_ACTIVE_CABLE)) {
+   if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
+   hw->phy.type = ixgbe_phy_sfp_passive_unknown;
+   else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
+   hw->phy.type = ixgbe_phy_sfp_active_unknown;
status = IXGBE_SUCCESS;
goto out;
}
___
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: r302384 - in head/sys/dev: e1000 ixgb ixgbe ixl

2016-07-06 Thread Sean Bruno
Author: sbruno
Date: Thu Jul  7 03:39:18 2016
New Revision: 302384
URL: https://svnweb.freebsd.org/changeset/base/302384

Log:
  Do not initialize the adapter on MTU change when adapter status is down.
  This fixes long-standing problems when changing settings of the adapter.
  
  Discussed in:
  https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html
  
  Submitted by: arnaud.ys...@stormshield.eu
  Reviewed by:  e...@freebsd.org
  Approved by:  re (gjb)
  Differential Revision:https://reviews.freebsd.org/D7030

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/ixgbe/if_ix.c
  head/sys/dev/ixgbe/if_ixv.c
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/e1000/if_em.c  Thu Jul  7 03:39:18 2016(r302384)
@@ -1214,7 +1214,8 @@ em_ioctl(if_t ifp, u_long command, caddr
if_setmtu(ifp, ifr->ifr_mtu);
adapter->hw.mac.max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   em_init_locked(adapter);
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
+   em_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/e1000/if_igb.c Thu Jul  7 03:39:18 2016(r302384)
@@ -1106,7 +1106,8 @@ igb_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   igb_init_locked(adapter);
+   if ((ifp->if_drv_flags & IFF_DRV_RUNNING))
+   igb_init_locked(adapter);
IGB_CORE_UNLOCK(adapter);
break;
}

Modified: head/sys/dev/e1000/if_lem.c
==
--- head/sys/dev/e1000/if_lem.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/e1000/if_lem.c Thu Jul  7 03:39:18 2016(r302384)
@@ -1053,7 +1053,8 @@ lem_ioctl(if_t ifp, u_long command, cadd
if_setmtu(ifp, ifr->ifr_mtu);
adapter->max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   lem_init_locked(adapter);
+   if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING))
+   lem_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

Modified: head/sys/dev/ixgb/if_ixgb.c
==
--- head/sys/dev/ixgb/if_ixgb.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/ixgb/if_ixgb.c Thu Jul  7 03:39:18 2016(r302384)
@@ -539,7 +539,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD
adapter->hw.max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
 
-   ixgb_init_locked(adapter);
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   ixgb_init_locked(adapter);
IXGB_UNLOCK(adapter);
}
break;

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/ixgbe/if_ix.c  Thu Jul  7 03:39:18 2016(r302384)
@@ -893,7 +893,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
-   ixgbe_init_locked(adapter);
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   ixgbe_init_locked(adapter);
 #ifdef PCI_IOV
ixgbe_recalculate_max_frame(adapter);
 #endif

Modified: head/sys/dev/ixgbe/if_ixv.c
==
--- head/sys/dev/ixgbe/if_ixv.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/ixgbe/if_ixv.c Thu Jul  7 03:39:18 2016(r302384)
@@ -578,7 +578,8 @@ ixv_ioctl(struct ifnet * ifp, u_long com
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
-   ixv_init_locked(adapter);
+   if (ifp->if_drv_flags & IFF_DRV_R

svn commit: r302281 - head/sys/cam/scsi

2016-06-29 Thread Sean Bruno
Author: sbruno
Date: Wed Jun 29 16:41:37 2016
New Revision: 302281
URL: https://svnweb.freebsd.org/changeset/base/302281

Log:
  Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length.
  
  PR:   202625
  Submitted by: niakr...@gmail.com
  Reviewed by:  scottl kenm
  Approved by:  re (gjb)
  MFC after:2 weeks

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cWed Jun 29 16:34:56 2016
(r302280)
+++ head/sys/cam/scsi/scsi_all.cWed Jun 29 16:41:37 2016
(r302281)
@@ -8788,6 +8788,7 @@ scsi_persistent_reserve_out(struct ccb_s
scsi_cmd->opcode = PERSISTENT_RES_OUT;
scsi_cmd->action = service_action;
scsi_cmd->scope_type = scope | res_type;
+   scsi_ulto4b(dxfer_len, scsi_cmd->length);
 
cam_fill_csio(csio,
  retries,
___
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: r302254 - head/sys/cam/scsi

2016-06-28 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 28 18:32:15 2016
New Revision: 302254
URL: https://svnweb.freebsd.org/changeset/base/302254

Log:
  Revert svn r302253 at the request/review of Ken M.  This commit is
  incorrect.
  
  PR:   202625
  Approved by:  re (implicit)

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cTue Jun 28 18:08:47 2016
(r302253)
+++ head/sys/cam/scsi/scsi_all.cTue Jun 28 18:32:15 2016
(r302254)
@@ -8788,7 +8788,6 @@ scsi_persistent_reserve_out(struct ccb_s
scsi_cmd->opcode = PERSISTENT_RES_OUT;
scsi_cmd->action = service_action;
scsi_cmd->scope_type = scope | res_type;
-   scsi_ulto2b(dxfer_len, scsi_cmd->length);
 
cam_fill_csio(csio,
  retries,
___
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: r302253 - head/sys/cam/scsi

2016-06-28 Thread Sean Bruno


On 06/28/16 11:17, Ken Merry wrote:
> This is incorrect.  It should be scsi_ulto4b() instead.
> 
> The dxfer_len argument to scsi_persistent_reserve_out() is a uint32_t, and 
> the length field in the CDB structure is 4 bytes long.
> 
> Sorry I didn’t get around to commenting on the PR, otherwise I would have 
> caught this previously.
> 
> Ken
> — 
> Ken Merry
> k...@freebsd.org

Ok, I shall revert this then generate a new diff for your review and
submission to re for commit.

sean

> 
> 
> 
>> On Jun 28, 2016, at 2:08 PM, Sean Bruno  wrote:
>>
>> Author: sbruno
>> Date: Tue Jun 28 18:08:47 2016
>> New Revision: 302253
>> URL: https://svnweb.freebsd.org/changeset/base/302253
>>
>> Log:
>>  Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length.
>>
>>  PR: 202625
>>  Submitted by:   niakr...@gmail.com
>>  Reviewed by:scottl
>>  Approved by:re (hrs)
>>  MFC after:  2 weeks
>>
>> Modified:
>>  head/sys/cam/scsi/scsi_all.c
>>
>> Modified: head/sys/cam/scsi/scsi_all.c
>> ==
>> --- head/sys/cam/scsi/scsi_all.c Tue Jun 28 16:43:23 2016
>> (r302252)
>> +++ head/sys/cam/scsi/scsi_all.c Tue Jun 28 18:08:47 2016
>> (r302253)
>> @@ -8788,6 +8788,7 @@ scsi_persistent_reserve_out(struct ccb_s
>>  scsi_cmd->opcode = PERSISTENT_RES_OUT;
>>  scsi_cmd->action = service_action;
>>  scsi_cmd->scope_type = scope | res_type;
>> +scsi_ulto2b(dxfer_len, scsi_cmd->length);
>>
>>  cam_fill_csio(csio,
>>retries,
>>
> 
> 



signature.asc
Description: OpenPGP digital signature


svn commit: r302253 - head/sys/cam/scsi

2016-06-28 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 28 18:08:47 2016
New Revision: 302253
URL: https://svnweb.freebsd.org/changeset/base/302253

Log:
  Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length.
  
  PR:   202625
  Submitted by: niakr...@gmail.com
  Reviewed by:  scottl
  Approved by:  re (hrs)
  MFC after:2 weeks

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cTue Jun 28 16:43:23 2016
(r302252)
+++ head/sys/cam/scsi/scsi_all.cTue Jun 28 18:08:47 2016
(r302253)
@@ -8788,6 +8788,7 @@ scsi_persistent_reserve_out(struct ccb_s
scsi_cmd->opcode = PERSISTENT_RES_OUT;
scsi_cmd->action = service_action;
scsi_cmd->scope_type = scope | res_type;
+   scsi_ulto2b(dxfer_len, scsi_cmd->length);
 
cam_fill_csio(csio,
  retries,
___
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: r300612 - head/sys/dev/an

2016-05-24 Thread Sean Bruno
Author: sbruno
Date: Tue May 24 13:57:23 2016
New Revision: 300612
URL: https://svnweb.freebsd.org/changeset/base/300612

Log:
  Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
  than sc->areq.  This is a bounds check to ensure we're not just cramming
  arbitrarily sized nonsense into the driver and overflowing the heap.
  
  PR:   209545
  Submitted by: ct...@hardenedbsd.org
  MFC after:2 weeks

Modified:
  head/sys/dev/an/if_an.c

Modified: head/sys/dev/an/if_an.c
==
--- head/sys/dev/an/if_an.c Tue May 24 13:57:23 2016(r300611)
+++ head/sys/dev/an/if_an.c Tue May 24 13:57:23 2016(r300612)
@@ -3749,6 +3749,9 @@ flashcard(struct ifnet *ifp, struct airo
return ENOBUFS;
break;
case AIROFLSHGCHR:  /* Get char from aux */
+   if (l_ioctl->len > sizeof(sc->areq)) {
+   return -EINVAL;
+   }
AN_UNLOCK(sc);
status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len);
AN_LOCK(sc);
@@ -3760,6 +3763,9 @@ flashcard(struct ifnet *ifp, struct airo
else
return -1;
case AIROFLSHPCHR:  /* Send char to card. */
+   if (l_ioctl->len > sizeof(sc->areq)) {
+   return -EINVAL;
+   }
AN_UNLOCK(sc);
status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len);
AN_LOCK(sc);
___
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: r300551 - head/sys/dev/ciss

2016-05-23 Thread Sean Bruno
Author: sbruno
Date: Tue May 24 01:42:21 2016
New Revision: 300551
URL: https://svnweb.freebsd.org/changeset/base/300551

Log:
  Update some of the TBD entries in ciss(4) to match what's in the pci
  IDS data.
  
  Submitted by: Dmitry Luhtionov 
  MFC after:2 weeks

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

Modified: head/sys/dev/ciss/ciss.c
==
--- head/sys/dev/ciss/ciss.cTue May 24 01:33:49 2016(r300550)
+++ head/sys/dev/ciss/ciss.cTue May 24 01:42:21 2016(r300551)
@@ -345,21 +345,22 @@ static struct
 { 0x103C, 0x1928, CISS_BOARD_SA5,   "HP Smart Array P230i" },
 { 0x103C, 0x1929, CISS_BOARD_SA5,   "HP Smart Array P530" },
 { 0x103C, 0x192A, CISS_BOARD_SA5,   "HP Smart Array P531" },
-{ 0x103C, 0x21BD, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21BE, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21BF, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C0, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C2, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C3, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C5, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C6, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C7, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C8, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CA, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CB, CISS_BOARD_SA5,   "HP Smart Array TBD" },
+{ 0x103C, 0x21BD, CISS_BOARD_SA5,   "HP Smart Array P244br" },
+{ 0x103C, 0x21BE, CISS_BOARD_SA5,   "HP Smart Array P741m" },
+{ 0x103C, 0x21BF, CISS_BOARD_SA5,   "HP Smart Array H240ar" },
+{ 0x103C, 0x21C0, CISS_BOARD_SA5,   "HP Smart Array P440ar" },
+{ 0x103C, 0x21C1, CISS_BOARD_SA5,   "HP Smart Array P840ar" },
+{ 0x103C, 0x21C2, CISS_BOARD_SA5,   "HP Smart Array P440" },
+{ 0x103C, 0x21C3, CISS_BOARD_SA5,   "HP Smart Array P441" },
+{ 0x103C, 0x21C5, CISS_BOARD_SA5,   "HP Smart Array P841" },
+{ 0x103C, 0x21C6, CISS_BOARD_SA5,   "HP Smart Array H244br" },
+{ 0x103C, 0x21C7, CISS_BOARD_SA5,   "HP Smart Array H240" },
+{ 0x103C, 0x21C8, CISS_BOARD_SA5,   "HP Smart Array H241" },
+{ 0x103C, 0x21CA, CISS_BOARD_SA5,   "HP Smart Array P246br" },
+{ 0x103C, 0x21CB, CISS_BOARD_SA5,   "HP Smart Array P840" },
 { 0x103C, 0x21CC, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CD, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CE, CISS_BOARD_SA5,   "HP Smart Array TBD" },
+{ 0x103C, 0x21CD, CISS_BOARD_SA5,   "HP Smart Array P240nr" },
+{ 0x103C, 0x21CE, CISS_BOARD_SA5,   "HP Smart Array H240nr" },
 { 0, 0, 0, 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: r299188 - head/sys/dev/e1000

2016-05-06 Thread Sean Bruno
Author: sbruno
Date: Fri May  6 17:00:45 2016
New Revision: 299188
URL: https://svnweb.freebsd.org/changeset/base/299188

Log:
  Since igb_detach() cleans up all the data structures that will be
  free'd by the functions following its call, we can simply return instead
  of crashing and burning in the event of igb_detach() failing.
  
  PR:   197139
  Submitted by: rupav...@juniper.net
  MFC after:2 weeks

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Fri May  6 16:59:04 2016(r299187)
+++ head/sys/dev/e1000/if_igb.c Fri May  6 17:00:45 2016(r299188)
@@ -659,7 +659,8 @@ igb_attach(device_t dev)
return (0);
 
 err_late:
-   igb_detach(dev);
+   if (igb_detach(dev) == 0) /* igb_detach() already did the cleanup */
+   return(error);
igb_free_transmit_structures(adapter);
igb_free_receive_structures(adapter);
igb_release_hw_control(adapter);
___
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: r299182 - head/sys/dev/e1000

2016-05-06 Thread Sean Bruno
Author: sbruno
Date: Fri May  6 15:41:38 2016
New Revision: 299182
URL: https://svnweb.freebsd.org/changeset/base/299182

Log:
  If ALTQ is defined in the kern conf, switch to Legacy Mode.
  
  PR:   208409
  Submitted by: free...@mcwest.org
  MFC after:2 weeks

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

Modified: head/sys/dev/e1000/if_igb.h
==
--- head/sys/dev/e1000/if_igb.h Fri May  6 15:37:06 2016(r299181)
+++ head/sys/dev/e1000/if_igb.h Fri May  6 15:41:38 2016(r299182)
@@ -35,6 +35,10 @@
 #ifndef _IF_IGB_H_
 #define _IF_IGB_H_
 
+#ifdef ALTQ
+#define IGB_LEGACY_TX
+#endif
+
 #include 
 #include 
 #ifndef IGB_LEGACY_TX
___
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: r298351 - head/sys/nlm

2016-04-20 Thread Sean Bruno
Author: sbruno
Date: Wed Apr 20 15:31:03 2016
New Revision: 298351
URL: https://svnweb.freebsd.org/changeset/base/298351

Log:
  Avoid a possible heap overflow in our nlm code by limiting the number
  of service to the arbitrary value of 256.  Log an appropriate message
  that indicates the hard limit.
  
  PR:   208808
  Submitted by: ct...@hardenedbsd.org
  Reviewed by:  dfr
  Obtained from:HardenedBSD
  MFC after:2 weeks

Modified:
  head/sys/nlm/nlm_prot_impl.c

Modified: head/sys/nlm/nlm_prot_impl.c
==
--- head/sys/nlm/nlm_prot_impl.cWed Apr 20 14:47:16 2016
(r298350)
+++ head/sys/nlm/nlm_prot_impl.cWed Apr 20 15:31:03 2016
(r298351)
@@ -1439,6 +1439,12 @@ nlm_register_services(SVCPOOL *pool, int
return (EINVAL);
}
 
+   if (addr_count < 0 || addr_count > 256 ) {
+   NLM_ERR("NLM:  too many service addresses (%d) given, "
+   "max 256 - can't start server\n", addr_count);
+   return (EINVAL);
+   }
+
xprts = malloc(addr_count * sizeof(SVCXPRT *), M_NLM, M_WAITOK|M_ZERO);
for (i = 0; i < version_count; i++) {
for (j = 0; j < addr_count; j++) {
___
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: r298280 - in head/sys/dev: aac aacraid

2016-04-19 Thread Sean Bruno
Author: sbruno
Date: Tue Apr 19 18:27:28 2016
New Revision: 298280
URL: https://svnweb.freebsd.org/changeset/base/298280

Log:
  aacraid(4): Sanely copyin userland pointers and ensure that we don't get
  anything janky from a user. (cturt)
  
  aac(4): landergriffith+freebsdbugzi...@gmail.com pointed out that aacraid(4)
  had the same issue and handling of pointers, so let's change that too.
  
  PR:   206573
  Submitted by: ct...@hardenedbsd.org
  Obtained from:HardenedBSD
  MFC after:1 week

Modified:
  head/sys/dev/aac/aac.c
  head/sys/dev/aacraid/aacraid.c

Modified: head/sys/dev/aac/aac.c
==
--- head/sys/dev/aac/aac.c  Tue Apr 19 16:48:14 2016(r298279)
+++ head/sys/dev/aac/aac.c  Tue Apr 19 18:27:28 2016(r298280)
@@ -3103,18 +3103,30 @@ aac_ioctl_send_raw_srb(struct aac_softc 
/* Retrieve correct SG entries. */
if (fibsize == (sizeof(struct aac_srb) +
srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) {
+   struct aac_sg_entry sg;
+
sge = srbcmd->sg_map.SgEntry;
sge64 = NULL;
-   srb_sg_bytecount = sge->SgByteCount;
-   srb_sg_address = (void *)(uintptr_t)sge->SgAddress;
+
+   if ((error = copyin(sge, &sg, sizeof(sg))) != 0)
+   goto out;
+
+   srb_sg_bytecount = sg.SgByteCount;
+   srb_sg_address = (void *)(uintptr_t)sg.SgAddress;
}
 #ifdef __amd64__
else if (fibsize == (sizeof(struct aac_srb) +
srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) {
+   struct aac_sg_entry64 sg;
+
sge = NULL;
sge64 = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry;
-   srb_sg_bytecount = sge64->SgByteCount;
-   srb_sg_address = (void *)sge64->SgAddress;
+
+   if ((error = copyin(sge64, &sg, sizeof(sg))) != 0)
+   goto out;
+
+   srb_sg_bytecount = sg.SgByteCount;
+   srb_sg_address = (void *)sg.SgAddress;
if (sge64->SgAddress > 0xull &&
(sc->flags & AAC_FLAGS_SG_64BIT) == 0) {
error = EINVAL;

Modified: head/sys/dev/aacraid/aacraid.c
==
--- head/sys/dev/aacraid/aacraid.c  Tue Apr 19 16:48:14 2016
(r298279)
+++ head/sys/dev/aacraid/aacraid.c  Tue Apr 19 18:27:28 2016
(r298280)
@@ -2873,15 +2873,25 @@ aac_ioctl_send_raw_srb(struct aac_softc 
if (fibsize == (sizeof(struct aac_srb) + 
srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) {
struct aac_sg_entry *sgp = srbcmd->sg_map.SgEntry;
-   srb_sg_bytecount = sgp->SgByteCount;
-   srb_sg_address = (u_int64_t)sgp->SgAddress;
+   struct aac_sg_entry sg;
+
+   if ((error = copyin(sgp, &sg, sizeof(sg))) != 0)
+   goto out;
+
+   srb_sg_bytecount = sg.SgByteCount;
+   srb_sg_address = (u_int64_t)sg.SgAddress;
} else if (fibsize == (sizeof(struct aac_srb) + 
srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) {
 #ifdef __LP64__
struct aac_sg_entry64 *sgp = 
(struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry;
-   srb_sg_bytecount = sgp->SgByteCount;
-   srb_sg_address = sgp->SgAddress;
+   struct aac_sg_entry64 sg;
+
+   if ((error = copyin(sgp, &sg, sizeof(sg))) != 0)
+   goto out;
+
+   srb_sg_bytecount = sg.SgByteCount;
+   srb_sg_address = sg.SgAddress;
if (srb_sg_address > 0xull && 
!(sc->flags & AAC_FLAGS_SG_64BIT))
 #endif 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-19 Thread Sean Bruno
Author: sbruno
Date: Tue Apr 19 16:48:14 2016
New Revision: 298279
URL: https://svnweb.freebsd.org/changeset/base/298279

Log:
  Plug memory leak in ctl(4) when ctl_copyin_args() is called with a non-
  null terminated ASCII string.
  
  PR:   207626
  Submitted by: ct...@hardenedbsd.org
  MFC after:2 days

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

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Tue Apr 19 15:56:39 2016(r298278)
+++ head/sys/cam/ctl/ctl.c  Tue Apr 19 16:48:14 2016(r298279)
@@ -2445,6 +2445,7 @@ ctl_copyin_args(int num_args, struct ctl
 && (tmpptr[args[i].vallen - 1] != '\0')) {
snprintf(error_str, error_str_len, "Argument "
"%d value is not NUL-terminated", i);
+   free(tmpptr, M_CTL);
goto bailout;
}
args[i].kvalue = tmpptr;
___
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: r298231 - head/sys/dev/hptmv

2016-04-18 Thread Sean Bruno
Author: sbruno
Date: Mon Apr 18 23:26:11 2016
New Revision: 298231
URL: https://svnweb.freebsd.org/changeset/base/298231

Log:
  hptmv(4) Fix potential buffer overflow in hpt_set_info.
  
  While here, adjust some whitespace and yeild some useful debug info.
  
  This is untested on this hardware, testing requests to -scsi went
  unanswered.
  
  PR:   206585
  Submitted by: ct...@hardenedbsd.org
  MFC after:2 weeks

Modified:
  head/sys/dev/hptmv/hptproc.c

Modified: head/sys/dev/hptmv/hptproc.c
==
--- head/sys/dev/hptmv/hptproc.cMon Apr 18 23:09:22 2016
(r298230)
+++ head/sys/dev/hptmv/hptproc.cMon Apr 18 23:26:11 2016
(r298231)
@@ -308,7 +308,9 @@ hpt_set_info(int length)
/*
 * map buffer to kernel.
 */
-   if (piop->nInBufferSize+piop->nOutBufferSize > 
PAGE_SIZE) {
+   if (piop->nInBufferSize > PAGE_SIZE ||
+   piop->nOutBufferSize > PAGE_SIZE ||
+   piop->nInBufferSize+piop->nOutBufferSize > 
PAGE_SIZE) {
KdPrintE(("User buffer too large\n"));
return -EINVAL;
}
@@ -319,8 +321,13 @@ hpt_set_info(int length)
return -EINVAL;
}
 
-   if (piop->nInBufferSize)
-   copyin((void*)(ULONG_PTR)piop->lpInBuffer, 
ke_area, piop->nInBufferSize);
+   if (piop->nInBufferSize) {
+   if (copyin((void*)(ULONG_PTR)piop->lpInBuffer, 
ke_area, piop->nInBufferSize) != 0) {
+   KdPrintE(("Failed to copyin from 
lpInBuffer\n"));
+   free(ke_area, M_DEVBUF);
+   return -EFAULT;
+   }
+   }
 
/*
  * call kernel handler.
@@ -342,7 +349,7 @@ hpt_set_info(int length)
else  KdPrintW(("Kernel_ioctl(): return %d\n", err));
 
free(ke_area, M_DEVBUF);
-   return -EINVAL;
+   return -EINVAL;
} else  {
KdPrintW(("Wrong signature: %x\n", piop->Magic));
return -EINVAL;
___
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: r298224 - in head/sys/dev: e1000 ixgbe

2016-04-18 Thread Sean Bruno
Author: sbruno
Date: Mon Apr 18 20:33:44 2016
New Revision: 298224
URL: https://svnweb.freebsd.org/changeset/base/298224

Log:
  Correct possible underflow conditions when checking for available space
  in the tx h/w ring buffer.
  
  Reviewed by:  gnn jeb.j.cra...@intel.com
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D5918

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/ixgbe/ix_txrx.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Apr 18 20:16:41 2016(r298223)
+++ head/sys/dev/e1000/if_em.c  Mon Apr 18 20:33:44 2016(r298224)
@@ -2092,7 +2092,7 @@ retry:
txr->tx_tso = FALSE;
}
 
-if (nsegs > (txr->tx_avail - EM_MAX_SCATTER)) {
+if (txr->tx_avail < (nsegs + EM_MAX_SCATTER)) {
 txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Mon Apr 18 20:16:41 2016(r298223)
+++ head/sys/dev/e1000/if_igb.c Mon Apr 18 20:33:44 2016(r298224)
@@ -1887,7 +1887,7 @@ retry:
}
 
/* Make certain there are enough descriptors */
-   if (nsegs > txr->tx_avail - 2) {
+   if (txr->tx_avail < (nsegs + 2)) {
txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);

Modified: head/sys/dev/e1000/if_lem.c
==
--- head/sys/dev/e1000/if_lem.c Mon Apr 18 20:16:41 2016(r298223)
+++ head/sys/dev/e1000/if_lem.c Mon Apr 18 20:33:44 2016(r298224)
@@ -1699,7 +1699,7 @@ lem_xmit(struct adapter *adapter, struct
return (error);
}
 
-if (nsegs > (adapter->num_tx_desc_avail - 2)) {
+if (adapter->num_tx_desc_avail < (nsegs + 2)) {
 adapter->no_tx_desc_avail2++;
bus_dmamap_unload(adapter->txtag, map);
return (ENOBUFS);

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cMon Apr 18 20:16:41 2016
(r298223)
+++ head/sys/dev/ixgbe/ix_txrx.cMon Apr 18 20:33:44 2016
(r298224)
@@ -402,7 +402,7 @@ retry:
}
 
/* Make certain there are enough descriptors */
-   if (nsegs > txr->tx_avail - 2) {
+   if (txr->tx_avail < (nsegs + 2)) {
txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);
___
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: r297488 - head/sys/kern

2016-04-01 Thread Sean Bruno
Author: sbruno
Date: Fri Apr  1 16:16:26 2016
New Revision: 297488
URL: https://svnweb.freebsd.org/changeset/base/297488

Log:
  Repair a overflow condition where a user could submit a string that was
  not getting a proper bounds check.
  
  Thanks to CTurt for pointing at this with a big red blinking neon sign.
  
  PR:   206761
  Submitted by: sson
  Reviewed by:  ct...@hardenedbsd.org
  MFC after:3 days

Modified:
  head/sys/kern/imgact_binmisc.c

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Fri Apr  1 11:32:52 2016
(r297487)
+++ head/sys/kern/imgact_binmisc.c  Fri Apr  1 16:16:26 2016
(r297488)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-15, Stacey D. Son
+ * Copyright (c) 2013-16, Stacey D. Son
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -220,16 +220,17 @@ imgact_binmisc_add_entry(ximgact_binmisc
 {
imgact_binmisc_entry_t *ibe;
char *p;
+   int cnt;
 
if (xbe->xbe_msize > IBE_MAGIC_MAX)
return (EINVAL);
 
-   for(p = xbe->xbe_name; *p != 0; p++)
-   if (!isascii((int)*p))
+   for(cnt = 0, p = xbe->xbe_name; *p != 0; cnt++, p++)
+   if (cnt >= IBE_NAME_MAX || !isascii((int)*p))
return (EINVAL);
 
-   for(p = xbe->xbe_interpreter; *p != 0; p++)
-   if (!isascii((int)*p))
+   for(cnt = 0, p = xbe->xbe_interpreter; *p != 0; cnt++, p++)
+   if (cnt >= IBE_INTERP_LEN_MAX || !isascii((int)*p))
return (EINVAL);
 
/* Make sure we don't have any invalid #'s. */
@@ -266,8 +267,6 @@ imgact_binmisc_add_entry(ximgact_binmisc
 
/* Preallocate a new entry. */
ibe = imgact_binmisc_new_entry(xbe);
-   if (!ibe)
-   return (ENOMEM);
 
SLIST_INSERT_HEAD(&interpreter_list, ibe, link);
interp_list_entry_count++;
___
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: r297237 - in head/sys/cam: ata scsi

2016-03-24 Thread Sean Bruno
Author: sbruno
Date: Thu Mar 24 14:20:33 2016
New Revision: 297237
URL: https://svnweb.freebsd.org/changeset/base/297237

Log:
  Add 4k enabled cam quirks for Samsung SM863 Series SSDs
  
  Submitted by: Jason (j...@nitrology.com)
  MFC after:2 weeks
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D5711

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Thu Mar 24 13:34:39 2016(r297236)
+++ head/sys/cam/ata/ata_da.c   Thu Mar 24 14:20:33 2016(r297237)
@@ -490,6 +490,14 @@ static struct ada_quirk_entry ada_quirk_
},
{
/*
+* Samsung SM863 Series SSDs
+* 4k optimised
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7KM*", "*" },
+   /*quirks*/ADA_Q_4K
+   },
+   {
+   /*
 * SuperTalent TeraDrive CT SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Thu Mar 24 13:34:39 2016(r297236)
+++ head/sys/cam/scsi/scsi_da.c Thu Mar 24 14:20:33 2016(r297237)
@@ -1162,6 +1162,14 @@ static struct da_quirk_entry da_quirk_ta
},
{
/*
+* Samsung SM863 Series SSDs
+* 4k optimised
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7KM*", "*" },
+   /*quirks*/DA_Q_4K
+   },
+   {
+   /*
 * SuperTalent TeraDrive CT SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
___
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: r296385 - head/sys/dev/e1000

2016-03-04 Thread Sean Bruno
Author: sbruno
Date: Fri Mar  4 14:23:34 2016
New Revision: 296385
URL: https://svnweb.freebsd.org/changeset/base/296385

Log:
  The register read/write mphy functions have misleading whitespace around
  the locked check. This cleanup merely preserves the existing functionality
  while improving the ready check.
  
  Submitted by: Jim Thompson
  Reviewed by:  gnn erj
  Obtained from:Netgate
  MFC after:2 weeks
  Sponsored by: Netgate
  Differential Revision:https://reviews.freebsd.org/D5448

Modified:
  head/sys/dev/e1000/e1000_phy.c

Modified: head/sys/dev/e1000/e1000_phy.c
==
--- head/sys/dev/e1000/e1000_phy.c  Fri Mar  4 13:58:39 2016
(r296384)
+++ head/sys/dev/e1000/e1000_phy.c  Fri Mar  4 14:23:34 2016
(r296385)
@@ -4146,13 +4146,12 @@ s32 e1000_read_phy_reg_mphy(struct e1000
*data = E1000_READ_REG(hw, E1000_MPHY_DATA);
 
/* Disable access to mPHY if it was originally disabled */
-   if (locked)
+   if (locked) {
ready = e1000_is_mphy_ready(hw);
if (!ready)
return -E1000_ERR_PHY;
-   E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
-   E1000_MPHY_DIS_ACCESS);
-
+   }
+   E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS);
return E1000_SUCCESS;
 }
 
@@ -4211,13 +4210,12 @@ s32 e1000_write_phy_reg_mphy(struct e100
E1000_WRITE_REG(hw, E1000_MPHY_DATA, data);
 
/* Disable access to mPHY if it was originally disabled */
-   if (locked)
+   if (locked) {
ready = e1000_is_mphy_ready(hw);
if (!ready)
return -E1000_ERR_PHY;
-   E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
-   E1000_MPHY_DIS_ACCESS);
-
+   }
+   E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS);
return E1000_SUCCESS;
 }
 
___
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: r293332 - head/sys/dev/e1000

2016-01-07 Thread Sean Bruno
Author: sbruno
Date: Thu Jan  7 16:48:47 2016
New Revision: 293332
URL: https://svnweb.freebsd.org/changeset/base/293332

Log:
  Disable the reuse of checksum offload context descriptors in the case
  of multiple queues in em(4).  Document errata in the code.
  
  MFC after:2 weeks
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D3995

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Jan  7 16:42:48 2016(r293331)
+++ head/sys/dev/e1000/if_em.c  Thu Jan  7 16:48:47 2016(r293332)
@@ -3735,29 +3735,38 @@ em_transmit_checksum_setup(struct tx_rin
offload |= CSUM_TCP;
tucss = hdr_len;
tucso = hdr_len + offsetof(struct tcphdr, th_sum);
-   /*
-* Setting up new checksum offload context for every frames
-* takes a lot of processing time for hardware. This also
-* reduces performance a lot for small sized frames so avoid
-* it if driver can use previously configured checksum
-* offload context.
-*/
-   if (txr->last_hw_offload == offload) {
-   if (offload & CSUM_IP) {
-   if (txr->last_hw_ipcss == ipcss &&
-   txr->last_hw_ipcso == ipcso &&
-   txr->last_hw_tucss == tucss &&
-   txr->last_hw_tucso == tucso)
-   return;
-   } else {
-   if (txr->last_hw_tucss == tucss &&
-   txr->last_hw_tucso == tucso)
-   return;
-   }
-   }
-   txr->last_hw_offload = offload;
-   txr->last_hw_tucss = tucss;
-   txr->last_hw_tucso = tucso;
+   /*
+* The 82574L can only remember the *last* context used
+* regardless of queue that it was use for.  We cannot reuse
+* contexts on this hardware platform and must generate a new
+* context every time.  82574L hardware spec, section 7.2.6,
+* second note.
+*/
+   if (adapter->num_queues < 2) {
+   /*
+   * Setting up new checksum offload context for every
+   * frames takes a lot of processing time for hardware.
+   * This also reduces performance a lot for small sized
+   * frames so avoid it if driver can use previously
+   * configured checksum offload context.
+   */
+   if (txr->last_hw_offload == offload) {
+   if (offload & CSUM_IP) {
+   if (txr->last_hw_ipcss == ipcss &&
+   txr->last_hw_ipcso == ipcso &&
+   txr->last_hw_tucss == tucss &&
+   txr->last_hw_tucso == tucso)
+   return;
+   } else {
+   if (txr->last_hw_tucss == tucss &&
+   txr->last_hw_tucso == tucso)
+   return;
+   }
+   }
+   txr->last_hw_offload = offload;
+   txr->last_hw_tucss = tucss;
+   txr->last_hw_tucso = tucso;
+   }
/*
 * Start offset for payload checksum calculation.
 * End offset for payload checksum calculation.
@@ -3773,29 +3782,38 @@ em_transmit_checksum_setup(struct tx_rin
*txd_upper |= E1000_TXD_POPTS_TXSM << 8;
tucss = hdr_len;
tucso = hdr_len + offsetof(struct udphdr, uh_sum);
-   /*
-* Setting up new checksum offload context for every frames
-* takes a lot of processing time for hardware. This also
-* reduces performance a lot for small sized frames so avoid
-* it if driver can use previously configured checksum
-* offload context.
-*/
-   if (txr->last_hw_offload == offload) {
-   if (offload & CSUM_IP) {
-   if (txr->last_hw_ipcss == ipcss &&
-   txr->last_hw_ipcso == ipcso &&
-   txr->last_hw_tucss == tucss &&
-   txr->last_hw_tucso == tucso)
-   

svn commit: r292697 - head/sys/dev/ixgbe

2015-12-24 Thread Sean Bruno
Author: sbruno
Date: Thu Dec 24 17:05:25 2015
New Revision: 292697
URL: https://svnweb.freebsd.org/changeset/base/292697

Log:
  Fix NO INET6 build broken at svn r292674
  
  Reported by: ohart...@zedat.fu-berlin.de

Modified:
  head/sys/dev/ixgbe/ix_txrx.c

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cThu Dec 24 16:55:09 2015
(r292696)
+++ head/sys/dev/ixgbe/ix_txrx.cThu Dec 24 17:05:25 2015
(r292697)
@@ -808,12 +808,14 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
*olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8;
}
break;
+#ifdef INET6
case ETHERTYPE_IPV6:
ip6 = (struct ip6_hdr *)(l3d);
ip_hlen = sizeof(struct ip6_hdr);
ipproto = ip6->ip6_nxt;
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6;
break;
+#endif
default:
offload = FALSE;
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: r292674 - in head/sys: conf dev/ixgbe modules/ix modules/ixv

2015-12-23 Thread Sean Bruno
Author: sbruno
Date: Wed Dec 23 22:45:17 2015
New Revision: 292674
URL: https://svnweb.freebsd.org/changeset/base/292674

Log:
  ixgbe(4): Update to version 3.1.13-k
  
  Add support for two new devices:  X552 SFP+ 10 GbE, and the single port
  version of X550T.
  
  Submitted by: erj
  Reviewed by:  gnn
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D4186

Added:
  head/sys/dev/ixgbe/ixgbe_osdep.c
 - copied, changed from r292671, head/sys/dev/ixgbe/LICENSE
Deleted:
  head/sys/dev/ixgbe/LICENSE
  head/sys/dev/ixgbe/README
Modified:
  head/sys/conf/files
  head/sys/dev/ixgbe/if_ix.c
  head/sys/dev/ixgbe/if_ixv.c
  head/sys/dev/ixgbe/ix_txrx.c
  head/sys/dev/ixgbe/ixgbe.h
  head/sys/dev/ixgbe/ixgbe_82598.c
  head/sys/dev/ixgbe/ixgbe_82599.c
  head/sys/dev/ixgbe/ixgbe_api.c
  head/sys/dev/ixgbe/ixgbe_api.h
  head/sys/dev/ixgbe/ixgbe_common.c
  head/sys/dev/ixgbe/ixgbe_dcb.c
  head/sys/dev/ixgbe/ixgbe_osdep.h
  head/sys/dev/ixgbe/ixgbe_phy.c
  head/sys/dev/ixgbe/ixgbe_phy.h
  head/sys/dev/ixgbe/ixgbe_type.h
  head/sys/dev/ixgbe/ixgbe_vf.c
  head/sys/dev/ixgbe/ixgbe_x540.c
  head/sys/dev/ixgbe/ixgbe_x550.c
  head/sys/dev/ixgbe/ixgbe_x550.h
  head/sys/modules/ix/Makefile
  head/sys/modules/ixv/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Dec 23 21:59:38 2015(r292673)
+++ head/sys/conf/files Wed Dec 23 22:45:17 2015(r292674)
@@ -1861,6 +1861,8 @@ dev/ixgbe/if_ixv.coptional ixv inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP"
 dev/ixgbe/ix_txrx.coptional ix inet | ixv inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
+dev/ixgbe/ixgbe_osdep.coptional ix inet | ixv inet \
+   compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_phy.c  optional ix inet | ixv inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_api.c  optional ix inet | ixv inet \

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Wed Dec 23 21:59:38 2015(r292673)
+++ head/sys/dev/ixgbe/if_ix.c  Wed Dec 23 22:45:17 2015(r292674)
@@ -47,14 +47,10 @@
 #endif
 
 /*
- *  Set this to one to display debug statistics
- */
-int ixgbe_display_debug_stats = 0;
-
-/*
  *  Driver version
  */
-char ixgbe_driver_version[] = "3.1.0";
+char ixgbe_driver_version[] = "3.1.13-k";
+
 
 /*
  *  PCI Device ID Table
@@ -95,9 +91,11 @@ static ixgbe_vendor_info_t ixgbe_vendor_
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, 0, 0, 0},
+   {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, 0, 0, 0},
+   {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, 0, 0, 0},
/* required last entry */
{0, 0, 0, 0, 0}
 };
@@ -131,7 +129,7 @@ static void ixgbe_media_status(struc
 static int  ixgbe_media_change(struct ifnet *);
 static void ixgbe_identify_hardware(struct adapter *);
 static int  ixgbe_allocate_pci_resources(struct adapter *);
-static voidixgbe_get_slot_info(struct ixgbe_hw *);
+static voidixgbe_get_slot_info(struct adapter *);
 static int  ixgbe_allocate_msix(struct adapter *);
 static int  ixgbe_allocate_legacy(struct adapter *);
 static int ixgbe_setup_msix(struct adapter *);
@@ -142,7 +140,6 @@ static void ixgbe_config_gpie(struct ada
 static voidixgbe_config_dmac(struct adapter *);
 static voidixgbe_config_delay_values(struct adapter *);
 static voidixgbe_config_link(struct adapter *);
-static voidixgbe_check_eee_support(struct adapter *);
 static voidixgbe_check_wol_support(struct adapter *);
 static int ixgbe_setup_low_power_mode(struct adapter *);
 static voidixgbe_rearm_queues(struct adapter *, u64);
@@ -151,6 +148,7 @@ static void ixgbe_initialize_transmi
 static void ixgbe_initialize_receive_units(struct adapter *);
 static voidixgbe_enable_rx_drop(struct adapter *);
 static voidixgbe_disable_rx_drop(struct adapter *);
+static voidixgbe_initialize_rss_mapping(struct adapter *);
 
 static void ixgbe_enable_intr(struct adapter *);
 static void ixgbe_disable_intr(struct adapter *);
@@ -171,19 +169,

svn commit: r292671 - head

2015-12-23 Thread Sean Bruno
Author: sbruno
Date: Wed Dec 23 21:55:54 2015
New Revision: 292671
URL: https://svnweb.freebsd.org/changeset/base/292671

Log:
  Fixup native-xtools target for poudriere cross build jails after svn
  r291955 by excluding all debug files.
  
  Reported by:  swills
  
  Reviewed by:  emaste

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Dec 23 21:54:05 2015(r292670)
+++ head/Makefile.inc1  Wed Dec 23 21:55:54 2015(r292671)
@@ -1677,7 +1677,7 @@ NXBMAKE=  ${NXBENV} ${MAKE} \
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
-   MK_LLDB=no
+   MK_LLDB=no MK_DEBUG_FILES=no
 
 # native-xtools is the current target for qemu-user cross builds of ports
 # via poudriere and the imgact_binmisc kernel module.
___
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: r292670 - head/sys/dev/e1000

2015-12-23 Thread Sean Bruno
Author: sbruno
Date: Wed Dec 23 21:54:05 2015
New Revision: 292670
URL: https://svnweb.freebsd.org/changeset/base/292670

Log:
  Add support for sysctl knobs to live tune the tx packet processing limits
  in igb and fix a wrap-around bug.
  
  Reviewed by:  hiren
  Obtained from:  Jason (j...@nitrology.com)
  MFC after:2 weeks
  Sponsored by: LimeLight Networks
  Differential Revision:https://reviews.freebsd.org/D4039

Modified:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_igb.h

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Wed Dec 23 21:51:10 2015(r292669)
+++ head/sys/dev/e1000/if_igb.c Wed Dec 23 21:54:05 2015(r292670)
@@ -336,6 +336,12 @@ SYSCTL_INT(_hw_igb, OID_AUTO, rx_process
 &igb_rx_process_limit, 0,
 "Maximum number of received packets to process at a time, -1 means 
unlimited");
 
+/* How many packets txeof tries to clean at a time */
+static int igb_tx_process_limit = -1;
+SYSCTL_INT(_hw_igb, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN,
+&igb_tx_process_limit, 0,
+"Maximum number of sent packets to process at a time, -1 means unlimited");
+
 #ifdef DEV_NETMAP  /* see ixgbe.c for details */
 #include 
 #endif /* DEV_NETMAP */
@@ -453,11 +459,15 @@ igb_attach(device_t dev)
 
e1000_get_bus_info(&adapter->hw);
 
-   /* Sysctl for limiting the amount of work done in the taskqueue */
+   /* Sysctls for limiting the amount of work done in the taskqueues */
igb_set_sysctl_value(adapter, "rx_processing_limit",
"max number of rx packets to process",
&adapter->rx_process_limit, igb_rx_process_limit);
 
+   igb_set_sysctl_value(adapter, "tx_processing_limit",
+   "max number of tx packets to process",
+   &adapter->tx_process_limit, igb_tx_process_limit);
+
/*
 * Validate number of transmit and receive descriptors. It
 * must not exceed hardware maximum, and must be multiple
@@ -3971,7 +3981,7 @@ igb_txeof(struct tx_ring *txr)
struct ifnet*ifp = adapter->ifp;
 #endif /* DEV_NETMAP */
u32 work, processed = 0;
-   u16 limit = txr->process_limit;
+   int limit = adapter->tx_process_limit;
struct igb_tx_buf   *buf;
union e1000_adv_tx_desc *txd;
 

Modified: head/sys/dev/e1000/if_igb.h
==
--- head/sys/dev/e1000/if_igb.h Wed Dec 23 21:51:10 2015(r292669)
+++ head/sys/dev/e1000/if_igb.h Wed Dec 23 21:54:05 2015(r292670)
@@ -355,7 +355,6 @@ struct tx_ring {
volatile u16tx_avail;
u16 next_avail_desc;
u16 next_to_clean;
-   u16 process_limit;
u16 num_desc;
enum {
IGB_QUEUE_IDLE = 1,
@@ -534,6 +533,7 @@ struct adapter {
int has_manage;
int wol;
int rx_process_limit;
+   int tx_process_limit;
u16 vf_ifp;  /* a VF interface */
boolin_detach; /* Used only in igb_ioctl */
 
___
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: r290720 - head

2015-11-12 Thread Sean Bruno
Author: sbruno
Date: Thu Nov 12 17:15:04 2015
New Revision: 290720
URL: https://svnweb.freebsd.org/changeset/base/290720

Log:
  spelling is important.
  
  Submitted by: vangy...@freebsd.org

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSThu Nov 12 17:13:12 2015(r290719)
+++ head/MAINTAINERSThu Nov 12 17:15:04 2015(r290720)
@@ -67,7 +67,7 @@ sys/dev/sound/usb hselaskyIf in doubt, 
 sys/compat/linuxkpihselaskyIf in doubt, ask.
 sys/dev/e1000  erj Pre-commit phabricator review requested.
 sys/dev/ixgbe  erj Pre-commit phabricator review requested.
-sys/dev/ixlerj Pre-commit phabricator reivew requested.
+sys/dev/ixlerj Pre-commit phabricator review requested.
  OLD 
 libc/posix1e   rwatson Pre-commit review requested.
 POSIX.1e ACLs  rwatson Pre-commit review requested.
___
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: r290717 - head

2015-11-12 Thread Sean Bruno
Author: sbruno
Date: Thu Nov 12 16:08:49 2015
New Revision: 290717
URL: https://svnweb.freebsd.org/changeset/base/290717

Log:
  Intel has requested that changes to these driver get a phabricator review
  before commits to keep conflicts down to a minimum.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSThu Nov 12 11:42:01 2015(r290716)
+++ head/MAINTAINERSThu Nov 12 16:08:49 2015(r290717)
@@ -65,6 +65,9 @@ tests freebsd-testing,ngiePre-commit 
 sys/dev/usbhselaskyIf in doubt, ask.
 sys/dev/sound/usb  hselaskyIf in doubt, ask.
 sys/compat/linuxkpihselaskyIf in doubt, ask.
+sys/dev/e1000  erj Pre-commit phabricator review requested.
+sys/dev/ixgbe  erj Pre-commit phabricator review requested.
+sys/dev/ixlerj Pre-commit phabricator reivew requested.
  OLD 
 libc/posix1e   rwatson Pre-commit review requested.
 POSIX.1e ACLs  rwatson Pre-commit review requested.
___
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: r290200 - head/lib/libc/tests/ssp

2015-10-30 Thread Sean Bruno
Author: sbruno
Date: Fri Oct 30 17:05:52 2015
New Revision: 290200
URL: https://svnweb.freebsd.org/changeset/base/290200

Log:
  Not all targets support by clang have a tested or enabled ubsan yet.
  
  Only enable h_raw on x86 targets for today so that a buildworld runs to
  completion for clang enabled targets that are not x86.  This should be
  removed when validation of the sanitizer has occured for all targets
  supported by FreeBSD and clang.

Modified:
  head/lib/libc/tests/ssp/Makefile

Modified: head/lib/libc/tests/ssp/Makefile
==
--- head/lib/libc/tests/ssp/MakefileFri Oct 30 16:35:18 2015
(r290199)
+++ head/lib/libc/tests/ssp/MakefileFri Oct 30 17:05:52 2015
(r290200)
@@ -30,11 +30,15 @@ PROGS+= h_memset
 # XXX: the h_raw/h_read testcases don't cause a SIGABRT with in-tree gcc right
 # now on amd64 when it trips the stack bounds specified in t_ssp.sh . This
 # probably needs to be fixed as it's currently hardcoded.
+#
+# sanitizer is not tested or supported for ARM right now. sbruno
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
 .if ${COMPILER_TYPE} == "clang"
 .if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION}
 PROGS+=h_raw
 .endif
 .endif
+.endif
 PROGS+=h_read
 PROGS+=h_readlink
 PROGS+=h_snprintf
___
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: r289655 - head/sys/mips/conf

2015-10-20 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 20 19:32:26 2015
New Revision: 289655
URL: https://svnweb.freebsd.org/changeset/base/289655

Log:
  Disable SWAPPING as we don't do it on this board.

Modified:
  head/sys/mips/conf/TP-MR3020

Modified: head/sys/mips/conf/TP-MR3020
==
--- head/sys/mips/conf/TP-MR3020Tue Oct 20 19:32:16 2015
(r289654)
+++ head/sys/mips/conf/TP-MR3020Tue Oct 20 19:32:26 2015
(r289655)
@@ -27,6 +27,9 @@ hints "TP-MR3020.hints"
 # Board memory - 32MB
 optionsAR71XX_REALMEM=(32*1024*1024)
 
+# Disable support for paging
+optionsNO_SWAPPING
+
 # i2c GPIO bus
 device gpioiic
 device iicbb
___
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: r289534 - head/sys/mips/conf

2015-10-18 Thread Sean Bruno
Author: sbruno
Date: Sun Oct 18 18:41:30 2015
New Revision: 289534
URL: https://svnweb.freebsd.org/changeset/base/289534

Log:
  Remove geom_uncompress from TP-MR3020 config.  Its now using root on USB
  and there's no need for it now.

Modified:
  head/sys/mips/conf/TP-MR3020

Modified: head/sys/mips/conf/TP-MR3020
==
--- head/sys/mips/conf/TP-MR3020Sun Oct 18 18:40:11 2015
(r289533)
+++ head/sys/mips/conf/TP-MR3020Sun Oct 18 18:41:30 2015
(r289534)
@@ -44,9 +44,6 @@ devicearswitch
 # redboot stuff.
 optionsAR71XX_ENV_UBOOT
 
-# uzip - to boot natively from flash
-device geom_uncompress
-
 # Used for the static uboot partition map
 device geom_map
 
___
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: r289533 - head/sys/mips/conf

2015-10-18 Thread Sean Bruno
Author: sbruno
Date: Sun Oct 18 18:40:11 2015
New Revision: 289533
URL: https://svnweb.freebsd.org/changeset/base/289533

Log:
  Add VM_KMEM_SIZE_SCALE=1 as these systems are going to have super small
  amount of RAM, e.g. 16M or 32M
  
  Reviewed by:  adrian

Modified:
  head/sys/mips/conf/AR933X_BASE

Modified: head/sys/mips/conf/AR933X_BASE
==
--- head/sys/mips/conf/AR933X_BASE  Sun Oct 18 18:39:16 2015
(r289532)
+++ head/sys/mips/conf/AR933X_BASE  Sun Oct 18 18:40:11 2015
(r289533)
@@ -40,6 +40,9 @@ options   SCSI_NO_OP_STRINGS
 # .. And no sysctl strings
 optionsNO_SYSCTL_DESCR
 
+# For small memory footprints
+optionsVM_KMEM_SIZE_SCALE=1
+
 # Limit IO size
 optionsNBUF=128
 
___
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: r289482 - head/sys/mips/conf

2015-10-17 Thread Sean Bruno
Author: sbruno
Date: Sun Oct 18 04:50:51 2015
New Revision: 289482
URL: https://svnweb.freebsd.org/changeset/base/289482

Log:
  Correctly use the default values for location of MAC addrs of arge0,
  arge1, ath0.  woo!
  
  Reviewed by:  adrian

Modified:
  head/sys/mips/conf/TP-MR3020.hints

Modified: head/sys/mips/conf/TP-MR3020.hints
==
--- head/sys/mips/conf/TP-MR3020.hints  Sun Oct 18 04:07:40 2015
(r289481)
+++ head/sys/mips/conf/TP-MR3020.hints  Sun Oct 18 04:50:51 2015
(r289482)
@@ -26,18 +26,18 @@ hint.arswitch.0.is_gmii=1   # arge1 <-> sw
 # arge0 - MII, autoneg, phy(4)
 hint.arge.0.phymask=0x10   # PHY4
 hint.arge.0.mdio=mdioproxy1# .. off of the switch mdiobus
+hint.arge.0.eeprommac=0x1fff
 
 # arge1 - GMII, 1000/full
 hint.arge.1.phymask=0x0# No directly mapped PHYs
 hint.arge.1.media=1000
 hint.arge.1.fduplex=1
+hint.arge.1.eeprommac=0x1fff0006
 
 # Where the ART is - last 64k in the flash
 # 0x9fff1000 ?
-hint.ath.0.eepromaddr=0x1fff1000
+hint.ath.0.eepromaddr=0x1fff
 hint.ath.0.eepromsize=16384
- 
-hint.ar71xx.0.eeprom_mac_addr=0x1f01fc00
 
 # The board 4MiB flash layout in uboot env:
 #
___
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: r289238 - head/sys/dev/ixgbe

2015-10-13 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 13 17:34:18 2015
New Revision: 289238
URL: https://svnweb.freebsd.org/changeset/base/289238

Log:
  Add support for sysctl knobs to live tune the per interrupt rx/tx packet
  processing limits in ixgbe(4)
  
  Differential Revision:https://reviews.freebsd.org/D3719
  Submitted by: jason wolfe (j-nitrology.com)
  MFC after:2 weeks

Modified:
  head/sys/dev/ixgbe/if_ix.c
  head/sys/dev/ixgbe/if_ixv.c
  head/sys/dev/ixgbe/ix_txrx.c
  head/sys/dev/ixgbe/ixgbe.h

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Tue Oct 13 17:31:11 2015(r289237)
+++ head/sys/dev/ixgbe/if_ix.c  Tue Oct 13 17:34:18 2015(r289238)
@@ -170,6 +170,8 @@ static void ixgbe_add_device_sysctls(str
 static void ixgbe_add_hw_stats(struct adapter *);
 
 /* Sysctl handlers */
+static voidixgbe_set_sysctl_value(struct adapter *, const char *,
+   const char *, int *, int);
 static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS);
 static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS);
 static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS);
@@ -461,6 +463,15 @@ ixgbe_attach(device_t dev)
goto err_out;
}
 
+   /* Sysctls for limiting the amount of work done in the taskqueues */
+   ixgbe_set_sysctl_value(adapter, "rx_processing_limit",
+   "max number of rx packets to process",
+   &adapter->rx_process_limit, ixgbe_rx_process_limit);
+
+   ixgbe_set_sysctl_value(adapter, "tx_processing_limit",
+   "max number of tx packets to process",
+   &adapter->tx_process_limit, ixgbe_tx_process_limit);
+
/* Do descriptor calc and sanity checks */
if (((ixgbe_txd * sizeof(union ixgbe_adv_tx_desc)) % DBA_ALIGN) != 0 ||
ixgbe_txd < MIN_TXD || ixgbe_txd > MAX_TXD) {
@@ -2877,9 +2888,6 @@ ixgbe_initialize_transmit_units(struct a
/* Cache the tail address */
txr->tail = IXGBE_TDT(j);
 
-   /* Set the processing limit */
-   txr->process_limit = ixgbe_tx_process_limit;
-
/* Disable Head Writeback */
switch (hw->mac.type) {
case ixgbe_mac_82598EB:
@@ -3136,9 +3144,6 @@ ixgbe_initialize_receive_units(struct ad
IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0);
IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0);
 
-   /* Set the processing limit */
-   rxr->process_limit = ixgbe_rx_process_limit;
-
/* Set the driver rx tail address */
rxr->tail =  IXGBE_RDT(rxr->me);
}
@@ -4458,6 +4463,16 @@ ixgbe_add_hw_stats(struct adapter *adapt
"1024-1522 byte frames transmitted");
 }
 
+static void
+ixgbe_set_sysctl_value(struct adapter *adapter, const char *name,
+const char *description, int *limit, int value)
+{
+   *limit = value;
+   SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)),
+   OID_AUTO, name, CTLFLAG_RW, limit, value, description);
+}
+
 /*
 ** Set flow control using sysctl:
 ** Flow control values:

Modified: head/sys/dev/ixgbe/if_ixv.c
==
--- head/sys/dev/ixgbe/if_ixv.c Tue Oct 13 17:31:11 2015(r289237)
+++ head/sys/dev/ixgbe/if_ixv.c Tue Oct 13 17:34:18 2015(r289238)
@@ -115,6 +115,8 @@ static void ixv_save_stats(struct adapte
 static voidixv_init_stats(struct adapter *);
 static voidixv_update_stats(struct adapter *);
 static voidixv_add_stats_sysctls(struct adapter *);
+static voidixv_set_sysctl_value(struct adapter *, const char *,
+   const char *, int *, int);
 
 /* The MSI/X Interrupt handlers */
 static voidixv_msix_que(void *);
@@ -325,6 +327,15 @@ ixv_attach(device_t dev)
goto err_out;
}
 
+   /* Sysctls for limiting the amount of work done in the taskqueues */
+   ixv_set_sysctl_value(adapter, "rx_processing_limit",
+   "max number of rx packets to process",
+   &adapter->rx_process_limit, ixv_rx_process_limit);
+
+   ixv_set_sysctl_value(adapter, "tx_processing_limit",
+   "max number of tx packets to process",
+   &adapter->tx_process_limit, ixv_tx_process_limit);
+
/* Do descriptor calc and sanity checks */
if (((ixv_txd * sizeof(union ixgbe_adv_tx_desc)) % DBA_ALIGN) != 0 ||
ixv_txd < MIN_TXD || ixv_txd > MAX_TXD) {
@@ -1600,9 +1611,6 @@ ixv_initialize_transmit_units(struct ada
/* Set Tx Tail register */
txr->tail = IXGBE_VFTDT(i);
 
-   /* Set the processing limit */
-   txr->process_limit = ixv_tx_process_limit;
-
/* Set Ring parameters */
IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(i),
  

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

2015-10-13 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 13 17:20:05 2015
New Revision: 289231
URL: https://svnweb.freebsd.org/changeset/base/289231

Log:
  ixl(4): Remove compile warning for unused function.
  
  sys/dev/ixl/if_ixl.c:4377:1: warning: unused function 'ixl_debug_info' 
[-Wunused-function]
  ixl_debug_info(SYSCTL_HANDLER_ARGS)
  
  Differential Revision:https://reviews.freebsd.org/D3718
  Submitted by: bz

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

Modified: head/sys/dev/ixl/if_ixl.c
==
--- head/sys/dev/ixl/if_ixl.c   Tue Oct 13 17:18:26 2015(r289230)
+++ head/sys/dev/ixl/if_ixl.c   Tue Oct 13 17:20:05 2015(r289231)
@@ -160,8 +160,10 @@ static voidixl_free_mac_filters(struct 
 
 
 /* Sysctl debug interface */
+#ifdef IXL_DEBUG_SYSCTL
 static int ixl_debug_info(SYSCTL_HANDLER_ARGS);
 static voidixl_print_debug_info(struct ixl_pf *);
+#endif
 
 /* The MSI/X Interrupt handlers */
 static voidixl_intr(void *);
@@ -4373,6 +4375,7 @@ ixl_do_adminq(void *context, int pending
IXL_PF_UNLOCK(pf);
 }
 
+#ifdef IXL_DEBUG_SYSCTL
 static int
 ixl_debug_info(SYSCTL_HANDLER_ARGS)
 {
@@ -4437,6 +4440,7 @@ ixl_print_debug_info(struct ixl_pf *pf)
reg = rd32(hw, I40E_GLPRT_MLFC(hw->port));
 printf("mac local fault = %x\n", reg);
 }
+#endif
 
 /**
  * Update VSI-specific ethernet statistics counters.
___
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: r289225 - head/usr.sbin/makefs/ffs

2015-10-13 Thread Sean Bruno
Author: sbruno
Date: Tue Oct 13 17:00:14 2015
New Revision: 289225
URL: https://svnweb.freebsd.org/changeset/base/289225

Log:
  makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be 
easily
  checked with dumpfs(8). This may lead to other problems, f.e. geom_label 
kernel
  module sanity checks do not like zero fs_old_size value and skips such UFS1
  file system while tasting (fs_old_size derives from sblock.fs_providersize).
  
  PR:   203704
  Submitted by: eu...@grosbein.net
  Reviewed by:  marcel

Modified:
  head/usr.sbin/makefs/ffs/mkfs.c

Modified: head/usr.sbin/makefs/ffs/mkfs.c
==
--- head/usr.sbin/makefs/ffs/mkfs.c Tue Oct 13 16:51:12 2015
(r289224)
+++ head/usr.sbin/makefs/ffs/mkfs.c Tue Oct 13 17:00:14 2015
(r289225)
@@ -248,7 +248,8 @@ ffs_mkfs(const char *fsys, const fsinfo_
exit(21);
}
sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize);
-   sblock.fs_size = fssize = dbtofsb(&sblock, fssize);
+   sblock.fs_size = sblock.fs_providersize = fssize =
+   dbtofsb(&sblock, fssize);
 
if (Oflag <= 1) {
sblock.fs_magic = FS_UFS1_MAGIC;
___
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: r289147 - head/sys/mips/conf

2015-10-11 Thread Sean Bruno
Author: sbruno
Date: Sun Oct 11 18:37:29 2015
New Revision: 289147
URL: https://svnweb.freebsd.org/changeset/base/289147

Log:
  Correct flash layout (this is a 4M flash unit).
  
  Remove "rootfs" entry and assign the 800K or so to the kernel
  partition as this unit boots from usb mass storage.

Modified:
  head/sys/mips/conf/TP-MR3020.hints

Modified: head/sys/mips/conf/TP-MR3020.hints
==
--- head/sys/mips/conf/TP-MR3020.hints  Sun Oct 11 18:26:06 2015
(r289146)
+++ head/sys/mips/conf/TP-MR3020.hints  Sun Oct 11 18:37:29 2015
(r289147)
@@ -8,7 +8,7 @@ hint.argemdio.0.at="nexus0"
 hint.argemdio.0.maddr=0x1a00
 hint.argemdio.0.msize=0x1000
 hint.argemdio.0.order=0
-
+ 
 # There's no need to set the ar933x GMAC configuration bits.
 # This just creates a switch instance and correctly uses it.
 
@@ -39,7 +39,7 @@ hint.ath.0.eepromsize=16384
  
 hint.ar71xx.0.eeprom_mac_addr=0x1f01fc00
 
-# The board 16MiB flash layout in uboot env:
+# The board 4MiB flash layout in uboot env:
 #
 # 256k(u-boot),64k(u-boot-env),2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
 
@@ -58,35 +58,28 @@ hint.map.1.at="flash/spi0"
 hint.map.1.start=0x0004
 hint.map.1.end=0x0005
 hint.map.1.name="uboot-env"
-hint.map.1.readonly=0
+hint.map.1.readonly=1
 
-# 2752KB
+# 3648KB
 hint.map.2.at="flash/spi0"
 hint.map.2.start=0x0005
-hint.map.2.end="search:0x0010:0x1:.!/bin/sh"
+hint.map.2.end=0x003e
 hint.map.2.name="kernel"
-hint.map.2.readonly=0
+hint.map.2.readonly=1
 
-# 896KB
+# 64K NVRAM
 hint.map.3.at="flash/spi0"
-hint.map.3.start="search:0x0010:0x1:.!/bin/sh"
-hint.map.3.end=0x003e
-hint.map.3.name="rootfs"
+hint.map.3.start=0x003e
+hint.map.3.end=0x003f
+hint.map.3.name="cfg"
 hint.map.3.readonly=0
 
-# 64K NVRAM
-hint.map.4.at="flash/spi0"
-hint.map.4.start=0x003e
-hint.map.4.end=0x003f
-hint.map.4.name="cfg"
-hint.map.4.readonly=0
-
 # 64K ART
-hint.map.5.at="flash/spi0"
-hint.map.5.start=0x003f
-hint.map.5.end=0x0040
-hint.map.5.name="art"
-hint.map.5.readonly=1
+hint.map.4.at="flash/spi0"
+hint.map.4.start=0x003f
+hint.map.4.end=0x0040
+hint.map.4.name="art"
+hint.map.4.readonly=1
 
 # GPIO specific configuration block
 
___
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: r289130 - head/sys/mips/conf

2015-10-10 Thread Sean Bruno
Author: sbruno
Date: Sun Oct 11 03:31:11 2015
New Revision: 289130
URL: https://svnweb.freebsd.org/changeset/base/289130

Log:
  Use machine specific values cleaned from openwrt for the mac address
  location on the TP link mr3020

Modified:
  head/sys/mips/conf/TP-MR3020.hints

Modified: head/sys/mips/conf/TP-MR3020.hints
==
--- head/sys/mips/conf/TP-MR3020.hints  Sun Oct 11 02:00:08 2015
(r289129)
+++ head/sys/mips/conf/TP-MR3020.hints  Sun Oct 11 03:31:11 2015
(r289130)
@@ -34,8 +34,10 @@ hint.arge.1.fduplex=1
 
 # Where the ART is - last 64k in the flash
 # 0x9fff1000 ?
-hint.ath.0.eepromaddr=0x1fff
+hint.ath.0.eepromaddr=0x1fff1000
 hint.ath.0.eepromsize=16384
+ 
+hint.ar71xx.0.eeprom_mac_addr=0x1f01fc00
 
 # The board 16MiB flash layout in uboot env:
 #
___
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: r289117 - head/sys/mips/conf

2015-10-10 Thread Sean Bruno
Author: sbruno
Date: Sat Oct 10 19:08:34 2015
New Revision: 289117
URL: https://svnweb.freebsd.org/changeset/base/289117

Log:
  There's no way a fbsd install + kernel will fit into 4MB of flash.
  
  Assume and enforce the fact that this will always boot a rootfs from
  usb.

Modified:
  head/sys/mips/conf/TP-MR3020

Modified: head/sys/mips/conf/TP-MR3020
==
--- head/sys/mips/conf/TP-MR3020Sat Oct 10 17:32:06 2015
(r289116)
+++ head/sys/mips/conf/TP-MR3020Sat Oct 10 19:08:34 2015
(r289117)
@@ -50,16 +50,6 @@ device   geom_uncompress
 # Used for the static uboot partition map
 device geom_map
 
-# Boot off of the rootfs, as defined in the geom_map setup.
-# Probably, this should be a USB device as the memory available
-# compressed rootfs is simply too small for FreeBSD
-#options   ROOTDEVNAME=\"ufs:map/rootfs.uncompress\"
-
-# Boot off of a uboot tftp ramdisk kernel image.  Because the flash
-# on this unit is so small, this is the only way to do dev work.
-# For full deployment, you will *have* to use a usb storage device
-# as a rootfs and use the flash to hold the kernel only.
-optionsMD_ROOT # md device usable as a potential root 
device
-optionsMD_ROOT_SIZE=10240
-#makeoptions   MFS_IMAGE=/tftpboot/mfsroot-tl-mr3020.img.ulzma
-optionsROOTDEVNAME=\"ufs:md0.uncompress\"
+# With only 4MB of flash, we are stuck using USB
+# for the rootfs.
+optionsROOTDEVNAME=\"ufs:da0\"
___
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: r288672 - head/sys/mips/conf

2015-10-04 Thread Sean Bruno
Author: sbruno
Date: Sun Oct  4 22:50:37 2015
New Revision: 288672
URL: https://svnweb.freebsd.org/changeset/base/288672

Log:
  Set correct argemdio addr, comment out arge1 as its not physically
  connected to anything.  Move a couple of devices out of the kernel
  and into modules.

Modified:
  head/sys/mips/conf/WZR-300HP
  head/sys/mips/conf/WZR-300HP.hints

Modified: head/sys/mips/conf/WZR-300HP
==
--- head/sys/mips/conf/WZR-300HPSun Oct  4 21:16:45 2015
(r288671)
+++ head/sys/mips/conf/WZR-300HPSun Oct  4 22:50:37 2015
(r288672)
@@ -28,9 +28,6 @@ devicegeom_uncompress # compressed in-
 
 optionsROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\"
 
-# options  MD_ROOT
-# options  MD_ROOT_SIZE="6144"
-
 optionsAR71XX_ATH_EEPROM   # Fetch EEPROM/PCI config from flash
 optionsATH_EEPROM_FIRMWARE # Use EEPROM from flash
 device firmware# Used by the above
@@ -42,10 +39,11 @@ device  miiproxy
 device  etherswitch
 device  arswitch
 
-# Enable GPIO
-device gpio
-device gpioled
-
 # hwpmc
 device hwpmc_mips24k
 device hwpmc
+
+# load these via modules, shrink kernel
+nodevice   if_bridge
+nodevice   bridgestp
+nodevice   random

Modified: head/sys/mips/conf/WZR-300HP.hints
==
--- head/sys/mips/conf/WZR-300HP.hints  Sun Oct  4 21:16:45 2015
(r288671)
+++ head/sys/mips/conf/WZR-300HP.hints  Sun Oct  4 22:50:37 2015
(r288672)
@@ -5,11 +5,11 @@
 
 # arge1 MDIO bus
 hint.argemdio.0.at="nexus0"
-hint.argemdio.0.maddr=0x1a00
+hint.argemdio.0.maddr=0x1900
 hint.argemdio.0.msize=0x1000
 hint.argemdio.0.order=0
 
-hint.arge.0.phymask=0x0
+hint.arge.0.phymask=0x1
 hint.arge.0.media=1000
 hint.arge.0.fduplex=1
 hint.arge.0.eeprommac=0x1f05120c
@@ -17,9 +17,9 @@ hint.arge.0.mdio=mdioproxy1 # .. off
 
 
 # arge1: nail to 1000/full, RMII - connected to the switch
-hint.arge.1.media=1000  # Map to 1000/full
-hint.arge.1.fduplex=1   #
-hint.arge.1.phymask=0x0 # no directly mapped PHYs
+#hint.arge.1.media=1000  # Map to 1000/full
+#hint.arge.1.fduplex=1   #
+#hint.arge.1.phymask=0x0 # no directly mapped PHYs
 
 #
 # AR7240 switch config
@@ -28,7 +28,7 @@ hint.arswitch.0.at="mdio0"
 hint.arswitch.0.is_7240=1   # We need to be explicitly told this
 hint.arswitch.0.numphys=4   # 4 active switch PHYs (PHY 0 -> 3)
 hint.arswitch.0.phy4cpu=1   # Yes, PHY 4 == dedicated PHY
-hint.arswitch.0.is_rgmii=0  # No, not RGMII
+hint.arswitch.0.is_rgmii=1  # No, not RGMII
 hint.arswitch.0.is_gmii=0   # No, not GMII
 
 # ath0 - slot 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: r288645 - head/bin/cat

2015-10-03 Thread Sean Bruno
Author: sbruno
Date: Sun Oct  4 01:56:11 2015
New Revision: 288645
URL: https://svnweb.freebsd.org/changeset/base/288645

Log:
  Initialize fd to -1 so that gcc doesn't emit an unitialized warning.

Modified:
  head/bin/cat/cat.c

Modified: head/bin/cat/cat.c
==
--- head/bin/cat/cat.c  Sun Oct  4 00:40:12 2015(r288644)
+++ head/bin/cat/cat.c  Sun Oct  4 01:56:11 2015(r288645)
@@ -306,7 +306,8 @@ udom_open(const char *path, int flags)
 {
struct addrinfo hints, *res, *res0;
char rpath[PATH_MAX];
-   int fd, error;
+   int fd = -1;
+   int error;
 
/*
 * Construct the unix domain socket address and attempt to connect.
___
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: r287990 - head/sys/dev/e1000

2015-09-19 Thread Sean Bruno
Author: sbruno
Date: Sat Sep 19 18:22:59 2015
New Revision: 287990
URL: https://svnweb.freebsd.org/changeset/base/287990

Log:
  Revert 287914,287762.
  
  Reports of breakage on igb(4) have been narrowed down to 287762 and 287914
  is an dependant change.
  
  Submitted by: erj

Modified:
  head/sys/dev/e1000/e1000_80003es2lan.c
  head/sys/dev/e1000/e1000_82540.c
  head/sys/dev/e1000/e1000_82541.c
  head/sys/dev/e1000/e1000_82542.c
  head/sys/dev/e1000/e1000_82543.c
  head/sys/dev/e1000/e1000_82571.h
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_82575.h
  head/sys/dev/e1000/e1000_api.c
  head/sys/dev/e1000/e1000_api.h
  head/sys/dev/e1000/e1000_defines.h
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/e1000_i210.c
  head/sys/dev/e1000/e1000_i210.h
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/e1000/e1000_ich8lan.h
  head/sys/dev/e1000/e1000_mac.c
  head/sys/dev/e1000/e1000_mac.h
  head/sys/dev/e1000/e1000_nvm.c
  head/sys/dev/e1000/e1000_nvm.h
  head/sys/dev/e1000/e1000_osdep.h
  head/sys/dev/e1000/e1000_phy.c
  head/sys/dev/e1000/e1000_regs.h
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/e1000_80003es2lan.c
==
--- head/sys/dev/e1000/e1000_80003es2lan.c  Sat Sep 19 17:47:36 2015
(r287989)
+++ head/sys/dev/e1000/e1000_80003es2lan.c  Sat Sep 19 18:22:59 2015
(r287990)
@@ -851,17 +851,11 @@ static s32 e1000_reset_hw_80003es2lan(st
e1000_release_phy_80003es2lan(hw);
 
/* Disable IBIST slave mode (far-end loopback) */
-   ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
-   E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data);
-   if (!ret_val) {
-   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
-   ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-E1000_KMRNCTRLSTA_INBAND_PARAM,
-kum_reg_data);
-   if (ret_val)
-   DEBUGOUT("Error disabling far-end loopback\n");
-   } else
-   DEBUGOUT("Error disabling far-end loopback\n");
+   e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
+   &kum_reg_data);
+   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
+   e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
+   kum_reg_data);
 
ret_val = e1000_get_auto_rd_done_generic(hw);
if (ret_val)
@@ -917,18 +911,11 @@ static s32 e1000_init_hw_80003es2lan(str
return ret_val;
 
/* Disable IBIST slave mode (far-end loopback) */
-   ret_val =
-   e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
-   &kum_reg_data);
-   if (!ret_val) {
-   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
-   ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-E1000_KMRNCTRLSTA_INBAND_PARAM,
-kum_reg_data);
-   if (ret_val)
-   DEBUGOUT("Error disabling far-end loopback\n");
-   } else
-   DEBUGOUT("Error disabling far-end loopback\n");
+   e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
+   &kum_reg_data);
+   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
+   e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
+kum_reg_data);
 
/* Set the transmit descriptor write-back policy */
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0));

Modified: head/sys/dev/e1000/e1000_82540.c
==
--- head/sys/dev/e1000/e1000_82540.cSat Sep 19 17:47:36 2015
(r287989)
+++ head/sys/dev/e1000/e1000_82540.cSat Sep 19 18:22:59 2015
(r287990)
@@ -66,7 +66,7 @@ static s32  e1000_read_mac_addr_82540(st
 static s32 e1000_init_phy_params_82540(struct e1000_hw *hw)
 {
struct e1000_phy_info *phy = &hw->phy;
-   s32 ret_val;
+   s32 ret_val = E1000_SUCCESS;
 
phy->addr   = 1;
phy->autoneg_mask   = AUTONEG_ADVERTISE_SPEED_DEFAULT;
@@ -329,7 +329,7 @@ static s32 e1000_init_hw_82540(struct e1
 {
struct e1000_mac_info *mac = &hw->mac;
u32 txdctl, ctrl_ext;
-   s32 ret_val;
+   s32 ret_val = E1000_SUCCESS;
u16 i;
 
DEBUGFUNC("e1000_init_hw_82540");
@@ -411,7 +411,7 @@ static s32 e1000_init_hw_82540(struct e1
 static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw)
 {
u32 ctrl;
-   s32 ret_val;
+   s32 ret_val = E1000_SUCCESS;
u16 data;
 
   

svn commit: r287914 - head/sys/dev/e1000

2015-09-17 Thread Sean Bruno
Author: sbruno
Date: Thu Sep 17 15:11:45 2015
New Revision: 287914
URL: https://svnweb.freebsd.org/changeset/base/287914

Log:
  Add Intel Skylake/I219 Support
  - New em(4) device in currently shipping products
  
  Differential Revision:https://reviews.freebsd.org/D3163
  Submitted by: e...@freebsd.org
  Reviewed by:  j...@freebsd.org
  MFC after:2 weeks
  Sponsored by: Intel Corporation

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Sep 17 14:22:52 2015(r287913)
+++ head/sys/dev/e1000/if_em.c  Thu Sep 17 15:11:45 2015(r287914)
@@ -103,7 +103,7 @@ int em_display_debug_stats = 0;
 /*
  *  Driver version:
  */
-char em_driver_version[] = "7.4.2";
+char em_driver_version[] = "7.5.2";
 
 /*
  *  PCI Device ID Table
@@ -191,6 +191,11 @@ static em_vendor_info_t em_vendor_info_a
{ 0x8086, E1000_DEV_ID_PCH_I218_V2, PCI_ANY_ID, PCI_ANY_ID, 0},
{ 0x8086, E1000_DEV_ID_PCH_I218_LM3,PCI_ANY_ID, PCI_ANY_ID, 0},
{ 0x8086, E1000_DEV_ID_PCH_I218_V3, PCI_ANY_ID, PCI_ANY_ID, 0},
+   { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM, PCI_ANY_ID, PCI_ANY_ID, 0},
+   { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V,  PCI_ANY_ID, PCI_ANY_ID, 0},
+   { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2,
+PCI_ANY_ID, PCI_ANY_ID, 0},
+   { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, PCI_ANY_ID, PCI_ANY_ID, 0},
/* required last entry */
{ 0, 0, 0, 0, 0}
 };
@@ -238,6 +243,7 @@ static void em_free_pci_resources(struct
 static voidem_local_timer(void *);
 static voidem_reset(struct adapter *);
 static int em_setup_interface(device_t, struct adapter *);
+static voidem_flush_desc_rings(struct adapter *);
 
 static voidem_setup_transmit_structures(struct adapter *);
 static voidem_initialize_transmit_unit(struct adapter *);
@@ -584,6 +590,20 @@ em_attach(device_t dev)
}
 
/*
+   ** In the new SPT device flash is not  a
+   ** separate BAR, rather it is also in BAR0,
+   ** so use the same tag and handle for the
+   ** FLASH read/write macros in the shared
+   ** code.
+   */
+   if (hw->mac.type == e1000_pch_spt) {
+   adapter->osdep.flash_bus_space_tag =
+   adapter->osdep.mem_bus_space_tag;
+   adapter->osdep.flash_bus_space_handle =
+   adapter->osdep.mem_bus_space_handle;
+   }
+
+   /*
 * Setup MSI/X or MSI if PCI Express
 */
adapter->msix = em_setup_msix(adapter);
@@ -1168,6 +1188,7 @@ em_ioctl(if_t ifp, u_long command, caddr
case e1000_ich10lan:
case e1000_pch2lan:
case e1000_pch_lpt:
+   case e1000_pch_spt:
case e1000_82574:
case e1000_82583:
case e1000_80003es2lan: /* 9K Jumbo Frame size */
@@ -1369,8 +1390,15 @@ em_init_locked(struct adapter *adapter)
if_clearhwassist(ifp);
if (if_getcapenable(ifp) & IFCAP_TXCSUM)
if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0);
-   if (if_getcapenable(ifp) & IFCAP_TSO4)
-   if_sethwassistbits(ifp, CSUM_TSO, 0);
+   /* 
+   ** There have proven to be problems with TSO when not
+   ** at full gigabit speed, so disable the assist automatically
+   ** when at lower speeds.  -jfv
+   */
+   if (if_getcapenable(ifp) & IFCAP_TSO4) {
+   if (adapter->link_speed == SPEED_1000)
+   if_sethwassistbits(ifp, CSUM_TSO, 0);
+   }
 
/* Configure for OS presence */
em_init_manageability(adapter);
@@ -2350,6 +2378,8 @@ em_update_link_status(struct adapter *ad
switch (hw->phy.media_type) {
case e1000_media_type_copper:
if (hw->mac.get_link_status) {
+   if (hw->mac.type == e1000_pch_spt)
+   msec_delay(50);
/* Do the work to read phy */
e1000_check_for_link(hw);
link_check = !hw->mac.get_link_status;
@@ -2441,6 +2471,10 @@ em_stop(void *arg)
EM_TX_UNLOCK(txr);
}
 
+   /* I219 needs some special flushing to avoid hangs */
+   if (adapter->hw.mac.type == e1000_pch_spt)
+   em_flush_desc_rings(adapter);
+
e1000_reset_hw(&adapter->hw);
E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0);
 
@@ -2860,6 +2894,116 @@ msi:
 }
 
 
+/*
+** The 3 following flush routines are used as a workaround in the
+** I219 client parts and only for them.
+**
+** em_flush_tx_ring -

svn commit: r287762 - head/sys/dev/e1000

2015-09-13 Thread Sean Bruno
Author: sbruno
Date: Sun Sep 13 18:26:05 2015
New Revision: 287762
URL: https://svnweb.freebsd.org/changeset/base/287762

Log:
  Update em(4) with D3162 after testing further on hardware that failed
  to attach with the last version of this commit. This commit fixes
  attach failures on "ICH8" class devices via modifications to
  e1000_init_nvm_params_ich8lan()
  
  -   Fix compiler warning in 80003es2lan.c
  -   Add return value handler for e1000_*_kmrn_reg_80003es2lan
  -   Fix usage of DEBUGOUT
  -   Remove unnecessary variable initializations.
  -   Removed unused variables (complaints from gcc).
  -   Edit defines in 82571.h.
  -   Add workaround for igb hw errata.
  -   Shared code changes for Skylake/I219 support.
  -   Remove unused OBFF and LTR functions.
  
  Tested by some of the folks that reported breakage in previous incarnation.
  Thanks to AllanJude, gjb, gnn, tijl for tempting fate with their machines.
  
  Submitted by: e...@freebsd.org
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D3162

Modified:
  head/sys/dev/e1000/e1000_80003es2lan.c
  head/sys/dev/e1000/e1000_82540.c
  head/sys/dev/e1000/e1000_82541.c
  head/sys/dev/e1000/e1000_82542.c
  head/sys/dev/e1000/e1000_82543.c
  head/sys/dev/e1000/e1000_82571.h
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_82575.h
  head/sys/dev/e1000/e1000_api.c
  head/sys/dev/e1000/e1000_api.h
  head/sys/dev/e1000/e1000_defines.h
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/e1000_i210.c
  head/sys/dev/e1000/e1000_i210.h
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/e1000/e1000_ich8lan.h
  head/sys/dev/e1000/e1000_mac.c
  head/sys/dev/e1000/e1000_mac.h
  head/sys/dev/e1000/e1000_nvm.c
  head/sys/dev/e1000/e1000_nvm.h
  head/sys/dev/e1000/e1000_osdep.h
  head/sys/dev/e1000/e1000_phy.c
  head/sys/dev/e1000/e1000_regs.h
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/e1000_80003es2lan.c
==
--- head/sys/dev/e1000/e1000_80003es2lan.c  Sun Sep 13 17:17:52 2015
(r287761)
+++ head/sys/dev/e1000/e1000_80003es2lan.c  Sun Sep 13 18:26:05 2015
(r287762)
@@ -851,11 +851,17 @@ static s32 e1000_reset_hw_80003es2lan(st
e1000_release_phy_80003es2lan(hw);
 
/* Disable IBIST slave mode (far-end loopback) */
-   e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
-   &kum_reg_data);
-   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
-   e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
-   kum_reg_data);
+   ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
+   E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data);
+   if (!ret_val) {
+   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
+   ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
+E1000_KMRNCTRLSTA_INBAND_PARAM,
+kum_reg_data);
+   if (ret_val)
+   DEBUGOUT("Error disabling far-end loopback\n");
+   } else
+   DEBUGOUT("Error disabling far-end loopback\n");
 
ret_val = e1000_get_auto_rd_done_generic(hw);
if (ret_val)
@@ -911,11 +917,18 @@ static s32 e1000_init_hw_80003es2lan(str
return ret_val;
 
/* Disable IBIST slave mode (far-end loopback) */
-   e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
-   &kum_reg_data);
-   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
-   e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
-kum_reg_data);
+   ret_val =
+   e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
+   &kum_reg_data);
+   if (!ret_val) {
+   kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
+   ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
+E1000_KMRNCTRLSTA_INBAND_PARAM,
+kum_reg_data);
+   if (ret_val)
+   DEBUGOUT("Error disabling far-end loopback\n");
+   } else
+   DEBUGOUT("Error disabling far-end loopback\n");
 
/* Set the transmit descriptor write-back policy */
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0));

Modified: head/sys/dev/e1000/e1000_82540.c
==
--- head/sys/dev/e1000/e1000_82540.cSun Sep 13 17:17:52 2015
(r287761)
+++ head/sys/dev/e1000/e1000_82540.cSun Sep 13 18:26:05 2015
(r287762)
@@ -66,7 +66,7 @@ static s32  e1000_read_mac_addr_82540(st
 static s32 e1000_init_phy_params_8254

<    1   2   3   4   5   6   >