Re: [PATCH net-next 1/7] r8152: adjust rx_bottom

From: David Miller
Date: Sun Jan 25 2015 - 01:43:48 EST


From: Hayes Wang <hayeswang@xxxxxxxxxxx>
Date: Tue, 20 Jan 2015 03:24:52 +0000

> David Miller [mailto:davem@xxxxxxxxxxxxx]
>> Sent: Tuesday, January 20, 2015 10:52 AM
> [...]
>> agg->list is not local, you have to use a spinlock to protect
>> modifications to it, some other sites which modify agg->list do take
>> the lock properly.
>>
>> You cannot modify a list like agg->list without proper locking.
>
> Excuse me. I don't understand.
>
> Before step1
> tp_rx_done->listA->listB->listC->listD->...
> rx_queue->
> Because the other function would chage tp->rx_done,
> I need move the lists with spin lock.
>
> After step1
> tp_rx_done->
> rx_queue->listA->listB->listC->listD->...
>
> Now I dequeue one of the lists from the list_head and
> deal with it.
> tp_rx_done->
> rx_queue->listA->listC->listD->...
> listB
>
> Then, if I want to put it back to rx_queue, I have to
> use spin lock. Why? No other function would chage
> rx_queue and the items in it.

What keeps rtl_start_rx() from running in parallel with
r8152_submit_rx(), or any other accessor of the RX agg->list?

You also keep using different terminology from me when
discussing what lists do or do not need protection, and that
is going to make it difficult for anyone to follow our
conversation at all.

We're talking specifically about RX agg->list objects and
whether access to them need synchronization or not.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/