summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2018-01-04 11:02:58 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2018-01-04 11:02:58 +0000
commit4042be6b988c476b7e9660a236cd5aeb02141247 (patch)
treee8910541753c3c023e5db584f37b8deb29f31ee8 /sys/net
parentd8c182527c8cbf6ab11007350397b2fc0e1633c6 (diff)
Back out tx mitigation again because it breaks suspend and resume at
least on x230 and x240. Problem noted by claudio on icb. ok dlg
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/ifq.c43
-rw-r--r--sys/net/ifq.h11
2 files changed, 8 insertions, 46 deletions
diff --git a/sys/net/ifq.c b/sys/net/ifq.c
index 6b71376a1b4..99b4704f8d0 100644
--- a/sys/net/ifq.c
+++ b/sys/net/ifq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifq.c,v 1.20 2018/01/02 07:08:10 dlg Exp $ */
+/* $OpenBSD: ifq.c,v 1.21 2018/01/04 11:02:57 tb Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
@@ -70,16 +70,9 @@ struct priq {
void ifq_start_task(void *);
void ifq_restart_task(void *);
void ifq_barrier_task(void *);
-void ifq_bundle_task(void *);
#define TASK_ONQUEUE 0x1
-static inline void
-ifq_run_start(struct ifqueue *ifq)
-{
- ifq_serialize(ifq, &ifq->ifq_start);
-}
-
void
ifq_serialize(struct ifqueue *ifq, struct task *t)
{
@@ -121,16 +114,6 @@ ifq_is_serialized(struct ifqueue *ifq)
}
void
-ifq_start(struct ifqueue *ifq)
-{
- if (ifq_len(ifq) >= min(4, ifq->ifq_maxlen)) {
- task_del(ifq->ifq_softnet, &ifq->ifq_bundle);
- ifq_run_start(ifq);
- } else
- task_add(ifq->ifq_softnet, &ifq->ifq_bundle);
-}
-
-void
ifq_start_task(void *p)
{
struct ifqueue *ifq = p;
@@ -154,31 +137,11 @@ ifq_restart_task(void *p)
}
void
-ifq_bundle_task(void *p)
-{
- struct ifqueue *ifq = p;
-
- ifq_run_start(ifq);
-}
-
-void
ifq_barrier(struct ifqueue *ifq)
{
struct cond c = COND_INITIALIZER();
struct task t = TASK_INITIALIZER(ifq_barrier_task, &c);
- if (!task_del(ifq->ifq_softnet, &ifq->ifq_bundle)) {
- int netlocked = (rw_status(&netlock) == RW_WRITE);
-
- if (netlocked) /* XXXSMP breaks atomicity */
- NET_UNLOCK();
-
- taskq_barrier(ifq->ifq_softnet);
-
- if (netlocked)
- NET_LOCK();
- }
-
if (ifq->ifq_serializer == NULL)
return;
@@ -203,7 +166,6 @@ void
ifq_init(struct ifqueue *ifq, struct ifnet *ifp, unsigned int idx)
{
ifq->ifq_if = ifp;
- ifq->ifq_softnet = net_tq(ifp->if_index);
ifq->ifq_softc = NULL;
mtx_init(&ifq->ifq_mtx, IPL_NET);
@@ -225,7 +187,6 @@ ifq_init(struct ifqueue *ifq, struct ifnet *ifp, unsigned int idx)
mtx_init(&ifq->ifq_task_mtx, IPL_NET);
TAILQ_INIT(&ifq->ifq_task_list);
ifq->ifq_serializer = NULL;
- task_set(&ifq->ifq_bundle, ifq_bundle_task, ifq);
task_set(&ifq->ifq_start, ifq_start_task, ifq);
task_set(&ifq->ifq_restart, ifq_restart_task, ifq);
@@ -277,8 +238,6 @@ ifq_destroy(struct ifqueue *ifq)
{
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
- ifq_barrier(ifq); /* ensure nothing is running with the ifq */
-
/* don't need to lock because this is the last use of the ifq */
ifq->ifq_ops->ifqop_purge(ifq, &ml);
diff --git a/sys/net/ifq.h b/sys/net/ifq.h
index 345d1068594..3ce402b34c1 100644
--- a/sys/net/ifq.h
+++ b/sys/net/ifq.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifq.h,v 1.19 2018/01/02 07:08:10 dlg Exp $ */
+/* $OpenBSD: ifq.h,v 1.20 2018/01/04 11:02:57 tb Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
@@ -25,7 +25,6 @@ struct ifq_ops;
struct ifqueue {
struct ifnet *ifq_if;
- struct taskq *ifq_softnet;
union {
void *_ifq_softc;
/*
@@ -58,7 +57,6 @@ struct ifqueue {
struct mutex ifq_task_mtx;
struct task_list ifq_task_list;
void *ifq_serializer;
- struct task ifq_bundle;
/* work to be serialised */
struct task ifq_start;
@@ -407,7 +405,6 @@ void ifq_attach(struct ifqueue *, const struct ifq_ops *, void *);
void ifq_destroy(struct ifqueue *);
void ifq_add_data(struct ifqueue *, struct if_data *);
int ifq_enqueue(struct ifqueue *, struct mbuf *);
-void ifq_start(struct ifqueue *);
struct mbuf *ifq_deq_begin(struct ifqueue *);
void ifq_deq_commit(struct ifqueue *, struct mbuf *);
void ifq_deq_rollback(struct ifqueue *, struct mbuf *);
@@ -444,6 +441,12 @@ ifq_is_oactive(struct ifqueue *ifq)
}
static inline void
+ifq_start(struct ifqueue *ifq)
+{
+ ifq_serialize(ifq, &ifq->ifq_start);
+}
+
+static inline void
ifq_restart(struct ifqueue *ifq)
{
ifq_serialize(ifq, &ifq->ifq_restart);