From: Hayes Wang <hayeswang@realtek.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
nic_swsd <nic_swsd@realtek.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH net-next 2/5] r8152: replace array with linking list for rx information
Date: Wed, 7 Aug 2019 04:34:24 +0000 [thread overview]
Message-ID: <0835B3720019904CB8F7AA43166CEEB2F18D04FA@RTITMBSVM03.realtek.com.tw> (raw)
In-Reply-To: <20190806125342.4620a94f@cakuba.netronome.com>
Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
[...]
> > static int rtl_stop_rx(struct r8152 *tp)
> > {
> > - int i;
> > + struct list_head *cursor, *next, tmp_list;
> > + unsigned long flags;
> > +
> > + INIT_LIST_HEAD(&tmp_list);
> >
> > - for (i = 0; i < RTL8152_MAX_RX; i++)
> > - usb_kill_urb(tp->rx_info[i].urb);
> > + /* The usb_kill_urb() couldn't be used in atomic.
> > + * Therefore, move the list of rx_info to a tmp one.
> > + * Then, list_for_each_safe could be used without
> > + * spin lock.
> > + */
>
> Would you mind explaining in a little more detail why taking the
> entries from the list for a brief period of time is safe?
Usually, it needs the spin lock before accessing the entry
of the list "tp->rx_info". However, for some reasons,
if we want to access the entry without spin lock, we
cloud move all entries to a local list temporally. Then,
we could make sure no other one could access the entries
included in the temporal local list.
For this case, when I move all entries to a temporal
local list, no other one could access them. Therefore,
I could access the entries included in the temporal local
list without spin lock.
Best Regards,
Hayes
next prev parent reply other threads:[~2019-08-07 4:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 11:17 [PATCH net-next 0/5] RX improve Hayes Wang
2019-08-06 11:18 ` [PATCH net-next 1/5] r8152: separate the rx buffer size Hayes Wang
2019-08-06 11:18 ` [PATCH net-next 2/5] r8152: replace array with linking list for rx information Hayes Wang
2019-08-06 19:53 ` Jakub Kicinski
2019-08-06 21:40 ` Jakub Kicinski
2019-08-07 4:34 ` Hayes Wang [this message]
2019-08-07 18:21 ` Jakub Kicinski
2019-08-06 11:18 ` [PATCH net-next 3/5] r8152: use alloc_pages for rx buffer Hayes Wang
2019-08-06 11:18 ` [PATCH net-next 4/5] r8152: support skb_add_rx_frag Hayes Wang
2019-08-06 22:08 ` Jakub Kicinski
2019-08-07 4:34 ` Hayes Wang
2019-08-06 11:18 ` [PATCH net-next 5/5] r8152: change rx_frag_head_sz and rx_max_agg_num dynamically Hayes Wang
2019-08-06 22:10 ` Jakub Kicinski
2019-08-07 7:12 ` Hayes Wang
2019-08-07 12:43 ` Maciej Fijalkowski
2019-08-08 1:40 ` Hayes Wang
2019-08-08 8:52 ` Hayes Wang
2019-08-08 11:49 ` Maciej Fijalkowski
2019-08-08 12:16 ` Hayes Wang
2019-08-08 18:43 ` Jakub Kicinski
2019-08-09 3:38 ` Hayes Wang
2019-08-09 4:51 ` David Miller
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=0835B3720019904CB8F7AA43166CEEB2F18D04FA@RTITMBSVM03.realtek.com.tw \
--to=hayeswang@realtek.com \
--cc=jakub.kicinski@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.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;
as well as URLs for NNTP newsgroup(s).