From: Paolo Abeni <pabeni@redhat.com>
To: Allen <allen.lkml@gmail.com>
Cc: kuba@kernel.org, Guo-Fu Tseng <cooldavid@cooldavid.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
jes@trained-monkey.org, kda@linux-powerpc.org,
cai.huoqing@linux.dev, dougmill@linux.ibm.com,
npiggin@gmail.com, christophe.leroy@csgroup.eu,
aneesh.kumar@kernel.org, naveen.n.rao@linux.ibm.com,
nnac123@linux.ibm.com, tlfalcon@linux.ibm.com,
marcin.s.wojtas@gmail.com, mlindner@marvell.com,
stephen@networkplumber.org, nbd@nbd.name,
sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com,
lorenzo@kernel.org, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com, borisp@nvidia.com,
bryan.whitehead@microchip.com, UNGLinuxDriver@microchip.com,
louis.peens@corigine.com, richardcochran@gmail.com,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-acenic@sunsite.dk, linux-net-drivers@amd.com,
netdev@vger.kernel.org
Subject: Re: [PATCH 13/15] net: jme: Convert tasklet API to new bottom half workqueue mechanism
Date: Mon, 01 Jul 2024 16:23:56 +0200 [thread overview]
Message-ID: <7348f2c9f594dd494732c481c0e35638ae064988.camel@redhat.com> (raw)
In-Reply-To: <CAOMdWSKKyqaJB2Psgcy9piUv3LTDBHhbo_g404fSmqQrVSyr7Q@mail.gmail.com>
On Mon, 2024-07-01 at 03:13 -0700, Allen wrote:
> > > @@ -1326,22 +1326,22 @@ static void jme_link_change_work(struct work_struct *work)
> > > jme_start_shutdown_timer(jme);
> > > }
> > >
> > > - goto out_enable_tasklet;
> > > + goto out_enable_bh_work;
> > >
> > > err_out_free_rx_resources:
> > > jme_free_rx_resources(jme);
> > > -out_enable_tasklet:
> > > - tasklet_enable(&jme->txclean_task);
> > > - tasklet_enable(&jme->rxclean_task);
> > > - tasklet_enable(&jme->rxempty_task);
> > > +out_enable_bh_work:
> > > + enable_and_queue_work(system_bh_wq, &jme->txclean_bh_work);
> > > + enable_and_queue_work(system_bh_wq, &jme->rxclean_bh_work);
> > > + enable_and_queue_work(system_bh_wq, &jme->rxempty_bh_work);
> >
> > This will unconditionally schedule the rxempty_bh_work and is AFAICS a
> > different behavior WRT prior this patch.
> >
> > In turn the rxempty_bh_work() will emit (almost unconditionally) the
> > 'RX Queue Full!' message, so the change should be visibile to the user.
> >
> > I think you should queue the work only if it was queued at cancel time.
> > You likely need additional status to do that.
> >
>
> Thank you for taking the time out to review. Now that it's been a week, I was
> preparing to send out version 3. Before I do that, I want to make sure if this
> the below approach is acceptable.
I _think_ the following does not track the rxempty_bh_work 'queued'
status fully/correctly.
> @@ -1282,9 +1282,9 @@ static void jme_link_change_work(struct work_struct *work)
> jme_stop_shutdown_timer(jme);
>
> jme_stop_pcc_timer(jme);
> - tasklet_disable(&jme->txclean_task);
> - tasklet_disable(&jme->rxclean_task);
> - tasklet_disable(&jme->rxempty_task);
> + disable_work_sync(&jme->txclean_bh_work);
> + disable_work_sync(&jme->rxclean_bh_work);
> + disable_work_sync(&jme->rxempty_bh_work);
I think the above should be:
jme->rxempty_bh_work_queued = disable_work_sync(&jme->rxempty_bh_work);
[...]
> @@ -1326,22 +1326,23 @@ static void jme_link_change_work(struct
> work_struct *work)
> jme_start_shutdown_timer(jme);
> }
>
> - goto out_enable_tasklet;
> + goto out_enable_bh_work;
>
> err_out_free_rx_resources:
> jme_free_rx_resources(jme);
> -out_enable_tasklet:
> - tasklet_enable(&jme->txclean_task);
> - tasklet_enable(&jme->rxclean_task);
> - tasklet_enable(&jme->rxempty_task);
> +out_enable_bh_work:
> + enable_and_queue_work(system_bh_wq, &jme->txclean_bh_work);
> + enable_and_queue_work(system_bh_wq, &jme->rxclean_bh_work);
> + if (jme->rxempty_bh_work_queued)
> + enable_and_queue_work(system_bh_wq, &jme->rxempty_bh_work);
Missing:
else
enable_work(system_bh_wq, &jme->rxempty_bh_work);
[...]
> @@ -3180,9 +3182,9 @@ jme_suspend(struct device *dev)
> netif_stop_queue(netdev);
> jme_stop_irq(jme);
>
> - tasklet_disable(&jme->txclean_task);
> - tasklet_disable(&jme->rxclean_task);
> - tasklet_disable(&jme->rxempty_task);
> + disable_work_sync(&jme->txclean_bh_work);
> + disable_work_sync(&jme->rxclean_bh_work);
> + disable_work_sync(&jme->rxempty_bh_work);
should be:
jme->rxempty_bh_work_queued = disable_work_sync(&jme->rxempty_bh_work);
>
> @@ -3198,9 +3200,10 @@ jme_suspend(struct device *dev)
> jme->phylink = 0;
> }
>
> - tasklet_enable(&jme->txclean_task);
> - tasklet_enable(&jme->rxclean_task);
> - tasklet_enable(&jme->rxempty_task);
> + enable_and_queue_work(system_bh_wq, &jme->txclean_bh_work);
> + enable_and_queue_work(system_bh_wq, &jme->rxclean_bh_work);
> + jme->rxempty_bh_work_queued = true;
> + enable_and_queue_work(system_bh_wq, &jme->rxempty_bh_work);
should be:
if (jme->rxempty_bh_work_queued)
enable_and_queue_work(system_bh_wq, &jme->rxempty_bh_work);
else
enable_work(system_bh_wq, &jme->rxempty_bh_work);
I think the above ones are the only places where you need to touch
'rxempty_bh_work_queued'.
[...]
> Do we need a flag for rxclean and txclean too?
Functionally speaking I don't think it will be necessary, as
rxclean_bh_work() and txclean_bh_work() don't emit warnings on spurious
invocation.
Thanks,
Paolo
next prev parent reply other threads:[~2024-07-01 14:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 5:05 [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
2024-06-21 5:05 ` [PATCH 01/15] net: alteon: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
2024-06-21 5:05 ` [PATCH 02/15] net: xgbe: " Allen Pais
2024-06-21 5:05 ` [PATCH 03/15] net: cnic: " Allen Pais
2024-06-21 5:05 ` [PATCH 04/15] net: macb: " Allen Pais
2024-06-21 5:05 ` [PATCH 05/15] net: cavium/liquidio: " Allen Pais
2024-06-21 11:45 ` Sunil Kovvuri Goutham
2024-06-21 5:05 ` [PATCH 06/15] net: octeon: " Allen Pais
2024-06-21 5:05 ` [PATCH 07/15] net: thunderx: " Allen Pais
2024-06-21 11:49 ` Sunil Kovvuri Goutham
2024-06-21 5:05 ` [PATCH 08/15] net: chelsio: " Allen Pais
2024-06-21 5:05 ` [PATCH 09/15] net: sundance: " Allen Pais
2024-06-21 5:05 ` [PATCH 10/15] net: hinic: " Allen Pais
2024-06-25 10:47 ` Paolo Abeni
2024-06-21 5:05 ` [PATCH 11/15] net: ehea: " Allen Pais
2024-06-21 5:05 ` [PATCH 12/15] net: ibmvnic: " Allen Pais
2024-06-21 5:05 ` [PATCH 13/15] net: jme: " Allen Pais
2024-06-25 10:38 ` Paolo Abeni
2024-07-01 10:13 ` Allen
2024-07-01 14:23 ` Paolo Abeni [this message]
2024-07-15 17:50 ` Allen
2024-07-16 8:47 ` Paolo Abeni
2024-07-17 16:55 ` Allen
2024-06-21 5:05 ` [PATCH 14/15] net: marvell: " Allen Pais
2024-06-21 5:05 ` [PATCH 15/15] net: mtk-wed: " Allen Pais
2024-06-21 15:25 ` [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Stephen Hemminger
2024-06-21 17:49 ` Allen
2024-06-25 10:24 ` Paolo Abeni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7348f2c9f594dd494732c481c0e35638ae064988.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=Mark-MC.Lee@mediatek.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=allen.lkml@gmail.com \
--cc=aneesh.kumar@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=borisp@nvidia.com \
--cc=bryan.whitehead@microchip.com \
--cc=cai.huoqing@linux.dev \
--cc=christophe.leroy@csgroup.eu \
--cc=cooldavid@cooldavid.org \
--cc=davem@davemloft.net \
--cc=dougmill@linux.ibm.com \
--cc=edumazet@google.com \
--cc=jes@trained-monkey.org \
--cc=kda@linux-powerpc.org \
--cc=kuba@kernel.org \
--cc=linux-acenic@sunsite.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=linux-rdma@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=louis.peens@corigine.com \
--cc=marcin.s.wojtas@gmail.com \
--cc=matthias.bgg@gmail.com \
--cc=mlindner@marvell.com \
--cc=naveen.n.rao@linux.ibm.com \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=nnac123@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=richardcochran@gmail.com \
--cc=sean.wang@mediatek.com \
--cc=stephen@networkplumber.org \
--cc=tlfalcon@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®