svn commit: r312207 - in projects/clang400-import/sys: dev/etherswitch/micrel kern mips/conf net
Dimitry Andric
dim at FreeBSD.org
Sun Jan 15 01:36:47 UTC 2017
Author: dim
Date: Sun Jan 15 01:36:45 2017
New Revision: 312207
URL: https://svnweb.freebsd.org/changeset/base/312207
Log:
Merge ^/head r312201 through r312206.
Added:
projects/clang400-import/sys/dev/etherswitch/micrel/
- copied from r312206, head/sys/dev/etherswitch/micrel/
Modified:
projects/clang400-import/sys/kern/subr_gtaskqueue.c
projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints
projects/clang400-import/sys/net/iflib.c
Directory Properties:
projects/clang400-import/ (props changed)
Modified: projects/clang400-import/sys/kern/subr_gtaskqueue.c
==============================================================================
--- projects/clang400-import/sys/kern/subr_gtaskqueue.c Sun Jan 15 01:34:07 2017 (r312206)
+++ projects/clang400-import/sys/kern/subr_gtaskqueue.c Sun Jan 15 01:36:45 2017 (r312207)
@@ -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: projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints
==============================================================================
--- projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints Sun Jan 15 01:34:07 2017 (r312206)
+++ projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints Sun Jan 15 01:36:45 2017 (r312207)
@@ -31,6 +31,10 @@ hint.arge.1.media=1000
hint.arge.1.fduplex=1
hint.arge.1.eeprommac=0x1fff0006
+# ath0
+hint.ath.0.eepromaddr=0x1fff0000
+hint.ath.0.eepromsize=16384
+
# 16MB flash layout:
# [ 0.510000] 5 tp-link partitions found on MTD device spi0.0
# [ 0.510000] Creating 5 MTD partitions on "spi0.0":
@@ -92,3 +96,30 @@ hint.map.6.start=0x00ff0000
hint.map.6.end=0x01000000
hint.map.6.name="ART"
hint.map.6.readonly=1
+
+# GPIO
+hint.gpio.0.pinmask=0x0c8ff1c3
+
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.pins=0x08000000
+hint.gpioled.0.name="board"
+hint.gpioled.0.invert=0
+
+#Red
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.pins=0x00020000
+hint.gpioled.1.name="red"
+hint.gpioled.1.invert=0
+
+#Green
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.pins=0x00010000
+hint.gpioled.2.name="green"
+hint.gpioled.2.invert=0
+
+#Blue
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.pins=0x00008000
+hint.gpioled.3.name="blue"
+hint.gpioled.3.invert=0
+
Modified: projects/clang400-import/sys/net/iflib.c
==============================================================================
--- projects/clang400-import/sys/net/iflib.c Sun Jan 15 01:34:07 2017 (r312206)
+++ projects/clang400-import/sys/net/iflib.c Sun Jan 15 01:36:45 2017 (r312207)
@@ -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 {
#define IFC_MULTISEG 0x04
#define IFC_DMAR 0x08
#define IFC_SC_ALLOCATED 0x10
+#define IFC_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, iflib_fast_intr, NULL, info, name)) != 0)
More information about the svn-src-projects
mailing list