svn commit: r314502 - in head/sys: kern net sys

Sean Bruno sbruno at FreeBSD.org
Wed Mar 1 18:37:37 UTC 2017


Author: sbruno
Date: Wed Mar  1 18:37:35 2017
New Revision: 314502
URL: https://svnweb.freebsd.org/changeset/base/314502

Log:
  Make gtaskqueue compatible with drm-next such that they can be used with the
  linuxkpi tasklets.
  
  Submitted by:	mmacy at nextbsd.org
  Reported by:	hps

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

Modified: head/sys/kern/subr_gtaskqueue.c
==============================================================================
--- head/sys/kern/subr_gtaskqueue.c	Wed Mar  1 18:23:30 2017	(r314501)
+++ head/sys/kern/subr_gtaskqueue.c	Wed Mar  1 18:37:35 2017	(r314502)
@@ -52,6 +52,8 @@ static MALLOC_DEFINE(M_GTASKQUEUE, "task
 static void	gtaskqueue_thread_enqueue(void *);
 static void	gtaskqueue_thread_loop(void *arg);
 
+TASKQGROUP_DEFINE(softirq, mp_ncpus, 1);
+
 struct gtaskqueue_busy {
 	struct gtask	*tb_running;
 	TAILQ_ENTRY(gtaskqueue_busy) tb_link;

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Wed Mar  1 18:23:30 2017	(r314501)
+++ head/sys/net/iflib.c	Wed Mar  1 18:37:35 2017	(r314502)
@@ -480,7 +480,6 @@ MODULE_VERSION(iflib, 1);
 MODULE_DEPEND(iflib, pci, 1, 1, 1);
 MODULE_DEPEND(iflib, ether, 1, 1, 1);
 
-TASKQGROUP_DEFINE(if_io_tqg, mp_ncpus, 1);
 TASKQGROUP_DEFINE(if_config_tqg, 1, 1);
 
 #ifndef IFLIB_DEBUG_COUNTERS
@@ -3922,7 +3921,7 @@ iflib_device_deregister(if_ctx_t ctx)
 	if (ctx->ifc_led_dev != NULL)
 		led_destroy(ctx->ifc_led_dev);
 	/* XXX drain any dependent tasks */
-	tqg = qgroup_if_io_tqg;
+	tqg = qgroup_softirq;
 	for (txq = ctx->ifc_txqs, i = 0; i < NTXQSETS(ctx); i++, txq++) {
 		callout_drain(&txq->ift_timer);
 		callout_drain(&txq->ift_db_check);
@@ -4552,7 +4551,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
 		q = &ctx->ifc_txqs[qid];
 		info = &ctx->ifc_txqs[qid].ift_filter_info;
 		gtask = &ctx->ifc_txqs[qid].ift_task;
-		tqg = qgroup_if_io_tqg;
+		tqg = qgroup_softirq;
 		fn = _task_fn_tx;
 		GROUPTASK_INIT(gtask, 0, fn, q);
 		break;
@@ -4560,7 +4559,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
 		q = &ctx->ifc_rxqs[qid];
 		info = &ctx->ifc_rxqs[qid].ifr_filter_info;
 		gtask = &ctx->ifc_rxqs[qid].ifr_task;
-		tqg = qgroup_if_io_tqg;
+		tqg = qgroup_softirq;
 		fn = _task_fn_rx;
 		GROUPTASK_INIT(gtask, 0, fn, q);
 		break;
@@ -4611,13 +4610,13 @@ iflib_softirq_alloc_generic(if_ctx_t ctx
 	case IFLIB_INTR_TX:
 		q = &ctx->ifc_txqs[qid];
 		gtask = &ctx->ifc_txqs[qid].ift_task;
-		tqg = qgroup_if_io_tqg;
+		tqg = qgroup_softirq;
 		fn = _task_fn_tx;
 		break;
 	case IFLIB_INTR_RX:
 		q = &ctx->ifc_rxqs[qid];
 		gtask = &ctx->ifc_rxqs[qid].ifr_task;
-		tqg = qgroup_if_io_tqg;
+		tqg = qgroup_softirq;
 		fn = _task_fn_rx;
 		break;
 	case IFLIB_INTR_IOV:
@@ -4661,7 +4660,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_
 	q = &ctx->ifc_rxqs[0];
 	info = &rxq[0].ifr_filter_info;
 	gtask = &rxq[0].ifr_task;
-	tqg = qgroup_if_io_tqg;
+	tqg = qgroup_softirq;
 	tqrid = irq->ii_rid = *rid;
 	fn = _task_fn_rx;
 
@@ -4678,7 +4677,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_
 	taskqgroup_attach(tqg, gtask, q, tqrid, name);
 
 	GROUPTASK_INIT(&txq->ift_task, 0, _task_fn_tx, txq);
-	taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, tqrid, "tx");
+	taskqgroup_attach(qgroup_softirq, &txq->ift_task, txq, tqrid, "tx");
 	return (0);
 }
 
@@ -4728,7 +4727,7 @@ void
 iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, char *name)
 {
 
-	taskqgroup_attach_cpu(qgroup_if_io_tqg, gt, uniq, cpu, -1, name);
+	taskqgroup_attach_cpu(qgroup_softirq, gt, uniq, cpu, -1, name);
 }
 
 void

Modified: head/sys/sys/gtaskqueue.h
==============================================================================
--- head/sys/sys/gtaskqueue.h	Wed Mar  1 18:23:30 2017	(r314501)
+++ head/sys/sys/gtaskqueue.h	Wed Mar  1 18:37:35 2017	(r314502)
@@ -119,5 +119,6 @@ SYSINIT(taskqgroup_adj_##name, SI_SUB_SM
 #endif /* EARLY_AP_STARTUP */
 
 TASKQGROUP_DECLARE(net);
+TASKQGROUP_DECLARE(softirq);
 
 #endif /* !_SYS_GTASKQUEUE_H_ */


More information about the svn-src-head mailing list