pktgen.c (fecdf8be2d91e04b0a9a4f79ff06499a36f5d14f) pktgen.c (1fbe4b46caca5b01b070af93d513031ffbcc480c)
1/*
2 * Authors:
3 * Copyright 2001, 2002 by Robert Olsson <robert.olsson@its.uu.se>
4 * Uppsala University and
5 * Swedish University of Agricultural Sciences
6 *
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 * Ben Greear <greearb@candelatech.com>

--- 3557 unchanged lines hidden (view full) ---

3566 pktgen_stop(t);
3567
3568 pr_debug("%s removing all device\n", t->tsk->comm);
3569 pktgen_rem_all_ifs(t);
3570
3571 pr_debug("%s removing thread\n", t->tsk->comm);
3572 pktgen_rem_thread(t);
3573
1/*
2 * Authors:
3 * Copyright 2001, 2002 by Robert Olsson <robert.olsson@its.uu.se>
4 * Uppsala University and
5 * Swedish University of Agricultural Sciences
6 *
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 * Ben Greear <greearb@candelatech.com>

--- 3557 unchanged lines hidden (view full) ---

3566 pktgen_stop(t);
3567
3568 pr_debug("%s removing all device\n", t->tsk->comm);
3569 pktgen_rem_all_ifs(t);
3570
3571 pr_debug("%s removing thread\n", t->tsk->comm);
3572 pktgen_rem_thread(t);
3573
3574 /* Wait for kthread_stop */
3575 for (;;) {
3576 set_current_state(TASK_INTERRUPTIBLE);
3577 if (kthread_should_stop())
3578 break;
3579 schedule();
3580 }
3581 __set_current_state(TASK_RUNNING);
3582
3583 return 0;
3584}
3585
3586static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
3587 const char *ifname, bool exact)
3588{
3589 struct pktgen_dev *p, *pkt_dev = NULL;
3590 size_t len = strlen(ifname);

--- 175 unchanged lines hidden (view full) ---

3766 PG_PROC_DIR, t->tsk->comm);
3767 kthread_stop(p);
3768 list_del(&t->th_list);
3769 kfree(t);
3770 return -EINVAL;
3771 }
3772
3773 t->net = pn;
3574 return 0;
3575}
3576
3577static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
3578 const char *ifname, bool exact)
3579{
3580 struct pktgen_dev *p, *pkt_dev = NULL;
3581 size_t len = strlen(ifname);

--- 175 unchanged lines hidden (view full) ---

3757 PG_PROC_DIR, t->tsk->comm);
3758 kthread_stop(p);
3759 list_del(&t->th_list);
3760 kfree(t);
3761 return -EINVAL;
3762 }
3763
3764 t->net = pn;
3765 get_task_struct(p);
3774 wake_up_process(p);
3775 wait_for_completion(&t->start_done);
3776
3777 return 0;
3778}
3779
3780/*
3781 * Removes a device from the thread if_list.

--- 106 unchanged lines hidden (view full) ---

3888 mutex_lock(&pktgen_thread_lock);
3889 list_splice_init(&pn->pktgen_threads, &list);
3890 mutex_unlock(&pktgen_thread_lock);
3891
3892 list_for_each_safe(q, n, &list) {
3893 t = list_entry(q, struct pktgen_thread, th_list);
3894 list_del(&t->th_list);
3895 kthread_stop(t->tsk);
3766 wake_up_process(p);
3767 wait_for_completion(&t->start_done);
3768
3769 return 0;
3770}
3771
3772/*
3773 * Removes a device from the thread if_list.

--- 106 unchanged lines hidden (view full) ---

3880 mutex_lock(&pktgen_thread_lock);
3881 list_splice_init(&pn->pktgen_threads, &list);
3882 mutex_unlock(&pktgen_thread_lock);
3883
3884 list_for_each_safe(q, n, &list) {
3885 t = list_entry(q, struct pktgen_thread, th_list);
3886 list_del(&t->th_list);
3887 kthread_stop(t->tsk);
3888 put_task_struct(t->tsk);
3896 kfree(t);
3897 }
3898
3899 remove_proc_entry(PGCTRL, pn->proc_dir);
3900 remove_proc_entry(PG_PROC_DIR, pn->net->proc_net);
3901}
3902
3903static struct pernet_operations pg_net_ops = {

--- 43 unchanged lines hidden ---
3889 kfree(t);
3890 }
3891
3892 remove_proc_entry(PGCTRL, pn->proc_dir);
3893 remove_proc_entry(PG_PROC_DIR, pn->net->proc_net);
3894}
3895
3896static struct pernet_operations pg_net_ops = {

--- 43 unchanged lines hidden ---