[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190605.120559.1335640243691845984.davem@davemloft.net>
Date: Wed, 05 Jun 2019 12:05:59 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: pabeni@...hat.com
Cc: netdev@...r.kernel.org, mcroce@...hat.com
Subject: Re: [PATCH net] pktgen: do not sleep with the thread lock held.
From: Paolo Abeni <pabeni@...hat.com>
Date: Wed, 5 Jun 2019 14:34:46 +0200
> @@ -3062,20 +3062,49 @@ static int thread_is_running(const struct pktgen_thread *t)
> return 0;
> }
>
> -static int pktgen_wait_thread_run(struct pktgen_thread *t)
> +static bool pktgen_lookup_thread(struct pktgen_net *pn, struct pktgen_thread *t)
> +{
> + struct pktgen_thread *tmp;
> +
> + list_for_each_entry(tmp, &pn->pktgen_threads, th_list)
> + if (tmp == t)
> + return true;
> + return false;
> +}
Pointer equality is not object equality.
It is possible for a pktgen thread to be terminated, a new one started,
and the new one to have the same pointer value as the old one.
Powered by blists - more mailing lists