From: Pkshih <pkshih@realtek.com>
To: Brian Norris <briannorris@chromium.org>
Cc: Yan-Hsuan Chuang <tony0620emma@gmail.com>,
Kalle Valo <kvalo@codeaurora.org>,
linux-wireless <linux-wireless@vger.kernel.org>,
Bernie Huang <phhuang@realtek.com>
Subject: RE: [PATCH v4 3/8] rtw88: add napi support
Date: Mon, 1 Feb 2021 06:38:19 +0000 [thread overview]
Message-ID: <e8e451faf35e47b494f6d49fe92d1858@realtek.com> (raw)
In-Reply-To: <CA+ASDXM7e4eSiJNoVMES7=mZ3M-NGpVZ9jLbjNm4yqMSYH4r+Q@mail.gmail.com>
> -----Original Message-----
> From: Brian Norris [mailto:briannorris@chromium.org]
> Sent: Saturday, January 30, 2021 7:39 AM
> To: Pkshih
> Cc: Yan-Hsuan Chuang; Kalle Valo; linux-wireless; Bernie Huang
> Subject: Re: [PATCH v4 3/8] rtw88: add napi support
>
> On Thu, Jan 28, 2021 at 1:45 AM Pkshih <pkshih@realtek.com> wrote:
> > > -----Original Message-----
> > > From: Brian Norris [mailto:briannorris@chromium.org]
> > > On Fri, Jan 15, 2021 at 1:26 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
> > > > +static u32 rtw_pci_rx_napi(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci,
> > > > u8 hw_queue)
> > > ...
> > >
> > > Are you sure you don't want any locking in rtw_pci_rx_napi()?
> > > Previously, you held irq_lock for the entirety of rtw_pci_rx_isr(),
> > > but now all the RX work is being deferred to a NAPI context, without
> > > any additional lock. IIUC, that means you can be both handling RX and
> > > other ISR operations at the same time. Is that intentional?
> > >
> >
> > irq_lock is used to protect TX ring->queue. The TX skb(s) are queued into the
> > queue, and unlink the skb until TX_OK_ISR is received. So, RX doesn't need to
> > hold this lock.
>
> I could be misunderstanding your locking model, but IIUC, you're left
> with zero locking between NAPI RX and all other operations (H2C, link
> up/down -- including DMA free, etc.). irq_lock used to protect you
> from that.
>
Sorry, I'm wrong. I think irq_lock is used to protect not only TX ring->queue
but also TX/RX rings. The RX ring rtwpci->rx_rings[RTW_RX_QUEUE_MPDU] is reset
by rtw_pci_reset_buf_desc() when pci_stop(), and napi_poll() also uses it to
know how many RX packets are needed to be received. Therefore, we plan to
use irq_lock to protect napi_poll(), and then see if it affects performance.
> If I'm right, maybe it needs a rename and/or some additional comments.
>
The original name and comment:
/* Used for PCI TX queueing. */
spinlock_t irq_lock;
Will change to
/* Used for PCI TX/RX rings and TX queueing. */
spinlock_t irq_lock;
---
Ping-Ke
next prev parent reply other threads:[~2021-02-01 6:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 9:23 [PATCH v4 0/8] rtw88: improve TX performance in field Ping-Ke Shih
2021-01-15 9:23 ` [PATCH v4 1/8] rtw88: add dynamic rrsr configuration Ping-Ke Shih
2021-02-08 10:50 ` Kalle Valo
2021-01-15 9:23 ` [PATCH v4 2/8] rtw88: add rts condition Ping-Ke Shih
2021-01-15 9:24 ` [PATCH v4 3/8] rtw88: add napi support Ping-Ke Shih
2021-01-22 22:57 ` Brian Norris
2021-01-28 9:45 ` Pkshih
2021-01-29 23:39 ` Brian Norris
2021-02-01 6:38 ` Pkshih [this message]
2021-02-09 7:19 ` Pkshih
2021-02-11 20:30 ` Brian Norris
2021-01-15 9:24 ` [PATCH v4 4/8] rtw88: replace tx tasklet with work queue Ping-Ke Shih
2021-01-22 22:59 ` Brian Norris
2021-01-15 9:24 ` [PATCH v4 5/8] rtw88: 8822c: update MAC/BB parameter tables to v60 Ping-Ke Shih
2021-01-15 9:24 ` [PATCH v4 6/8] rtw88: 8822c: update RF_A " Ping-Ke Shih
2021-01-15 9:24 ` [PATCH v4 7/8] rtw88: 8822c: update RF_B (1/2) " Ping-Ke Shih
2021-01-15 9:24 ` [PATCH v4 8/8] rtw88: 8822c: update RF_B (2/2) " Ping-Ke Shih
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=e8e451faf35e47b494f6d49fe92d1858@realtek.com \
--to=pkshih@realtek.com \
--cc=briannorris@chromium.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=phhuang@realtek.com \
--cc=tony0620emma@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.