projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'gcc-plugins-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git]
/
net
/
core
/
pktgen.c
diff --git
a/net/core/pktgen.c
b/net/core/pktgen.c
index
5219a9e
..
306b8f0
100644
(file)
--- a/
net/core/pktgen.c
+++ b/
net/core/pktgen.c
@@
-216,8
+216,8
@@
#define M_QUEUE_XMIT 2 /* Inject packet into qdisc */
/* If lock -- protects updating of if_list */
#define M_QUEUE_XMIT 2 /* Inject packet into qdisc */
/* If lock -- protects updating of if_list */
-#define if_lock(t)
spin
_lock(&(t->if_lock));
-#define if_unlock(t)
spin
_unlock(&(t->if_lock));
+#define if_lock(t)
mutex
_lock(&(t->if_lock));
+#define if_unlock(t)
mutex
_unlock(&(t->if_lock));
/* Used to help with determining the pkts on receive */
#define PKTGEN_MAGIC 0xbe9be955
/* Used to help with determining the pkts on receive */
#define PKTGEN_MAGIC 0xbe9be955
@@
-423,7
+423,7
@@
struct pktgen_net {
};
struct pktgen_thread {
};
struct pktgen_thread {
- s
pinlock_t if_lock;
/* for list of devices */
+ s
truct mutex if_lock;
/* for list of devices */
struct list_head if_list; /* All device here */
struct list_head th_list;
struct task_struct *tsk;
struct list_head if_list; /* All device here */
struct list_head th_list;
struct task_struct *tsk;
@@
-2010,11
+2010,13
@@
static void pktgen_change_name(const struct pktgen_net *pn, struct net_device *d
{
struct pktgen_thread *t;
{
struct pktgen_thread *t;
+ mutex_lock(&pktgen_thread_lock);
+
list_for_each_entry(t, &pn->pktgen_threads, th_list) {
struct pktgen_dev *pkt_dev;
list_for_each_entry(t, &pn->pktgen_threads, th_list) {
struct pktgen_dev *pkt_dev;
-
rcu_read_lock(
);
- list_for_each_entry
_rcu
(pkt_dev, &t->if_list, list) {
+
if_lock(t
);
+ list_for_each_entry(pkt_dev, &t->if_list, list) {
if (pkt_dev->odev != dev)
continue;
if (pkt_dev->odev != dev)
continue;
@@
-2029,8
+2031,9
@@
static void pktgen_change_name(const struct pktgen_net *pn, struct net_device *d
dev->name);
break;
}
dev->name);
break;
}
-
rcu_read_unlock(
);
+
if_unlock(t
);
}
}
+ mutex_unlock(&pktgen_thread_lock);
}
static int pktgen_device_event(struct notifier_block *unused,
}
static int pktgen_device_event(struct notifier_block *unused,
@@
-3762,7
+3765,7
@@
static int __net_init pktgen_create_thread(int cpu, struct pktgen_net *pn)
return -ENOMEM;
}
return -ENOMEM;
}
-
spin_lock
_init(&t->if_lock);
+
mutex
_init(&t->if_lock);
t->cpu = cpu;
INIT_LIST_HEAD(&t->if_list);
t->cpu = cpu;
INIT_LIST_HEAD(&t->if_list);