LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Scott Feldman <sfeldma@gmail.com>
To: Hayes Wang <hayeswang@realtek.com>
Cc: David Miller <davem@davemloft.net>,
"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 1/7] r8152: adjust rx_bottom
Date: Mon, 26 Jan 2015 01:14:06 -0800 [thread overview]
Message-ID: <CAE4R7bAoTAMMtq0JQK0vmyLqooU88VVuoLkZcFd=1WfxCaqyaw@mail.gmail.com> (raw)
In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2EE6E76@RTITMBSV03.realtek.com.tw>
On Mon, Jan 19, 2015 at 6:48 PM, Hayes Wang <hayeswang@realtek.com> wrote:
> David Miller [mailto:davem@davemloft.net]
>> Sent: Tuesday, January 20, 2015 5:14 AM
> [...]
>> >> - r8152_submit_rx(tp, agg, GFP_ATOMIC);
>> >> + if (!ret) {
>> >> + ret = r8152_submit_rx(tp, agg, GFP_ATOMIC);
>> >> + } else {
>> >> + urb->actual_length = 0;
>> >> + list_add_tail(&agg->list, next);
>> >
>> > Do you need a spin_lock_irqsave(&tp->rx_lock, flags) around this?
>>
>> Indeed, and rtl_start_rx() seems to also access agg->list without
>> proper locking.
>
> It is unnecessary because I deal with them in a local list_head. My steps are
> 1. Move the whole list from tp->rx_done to local rx_queue. (with spin lock)
> 2. dequeue/enqueue the lists in rx_queue.
> 3. Move the lists in rx_queue to tp->rx_done if it is necessary. (spin lock)
> For step 2, it wouldn't have race, because the list_head is local and no other
> function would change it. Therefore, I don't think it needs the spin lock.
Sorry guys, I think I made a mistake in my review and caused some
confusion/grief.
My mistake was getting the params to list_add_tail() backwards. It's
list_add_tail(entry, head). I saw list_add_tail(&agg->list, next) and
was fooled into thinking agg->list was the list getting appended with
the entry 'next'. It's the opposite. Duh. So locking isn't needed
because the list is indeed local.
-scott
next prev parent reply other threads:[~2015-01-26 9:14 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 7:13 [PATCH net-next 0/7] r8152: adjust the code Hayes Wang
2015-01-19 7:13 ` [PATCH net-next 1/7] r8152: adjust rx_bottom Hayes Wang
2015-01-19 8:03 ` Scott Feldman
2015-01-19 21:13 ` David Miller
2015-01-20 2:48 ` Hayes Wang
2015-01-20 2:52 ` David Miller
2015-01-20 3:24 ` Hayes Wang
2015-01-25 6:43 ` David Miller
2015-01-26 7:14 ` Hayes Wang
2015-02-02 2:38 ` Hayes Wang
2015-01-26 9:14 ` Scott Feldman [this message]
2015-01-19 7:13 ` [PATCH net-next 2/7] r8152: adjust lpm timer Hayes Wang
2015-01-19 7:13 ` [PATCH net-next 3/7] r8152: check linking status with netif_carrier_ok Hayes Wang
2015-01-19 7:13 ` [PATCH net-next 4/7] r8152: check RTL8152_UNPLUG for rtl8152_close Hayes Wang
2015-01-19 7:13 ` [PATCH net-next 5/7] r8152: adjust the link feed for hw_features Hayes Wang
2015-01-19 7:13 ` [PATCH net-next 6/7] r8152: replace get_protocol with vlan_get_protocol Hayes Wang
2015-01-19 7:13 ` [PATCH net-next 7/7] r8152: use BIT macro Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 0/7] r8152: adjust the code Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 1/7] r8152: adjust rx_bottom Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 2/7] r8152: adjust lpm timer Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 3/7] r8152: check linking status with netif_carrier_ok Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 4/7] r8152: check RTL8152_UNPLUG for rtl8152_close Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 5/7] r8152: adjust the line feed for hw_features Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 6/7] r8152: replace get_protocol with vlan_get_protocol Hayes Wang
2015-02-06 3:30 ` [PATCH net-next v2 7/7] r8152: use BIT macro Hayes Wang
2015-02-08 6:46 ` [PATCH net-next v2 0/7] r8152: adjust the code 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='CAE4R7bAoTAMMtq0JQK0vmyLqooU88VVuoLkZcFd=1WfxCaqyaw@mail.gmail.com' \
--to=sfeldma@gmail.com \
--cc=davem@davemloft.net \
--cc=hayeswang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--subject='Re: [PATCH net-next 1/7] r8152: adjust rx_bottom' \
/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
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).