Thread (8 messages) flat view 8 messages, 3 authors, 2018-01-20

Re: net: r8169: a question of memory barrier in the r8169 driver

From: Francois Romieu <romieu@fr.zoreil.com>
Date: 2018-01-20 00:01:12
Also in: lkml

Peter Zijlstra [off-list ref] :
On Fri, Jan 19, 2018 at 02:11:18AM +0100, Francois Romieu wrote:
quoted
Peter Zijlstra [off-list ref] :
[...]
quoted
There is only 1 variable afaict. Memory barriers need at least 2 in
order to be able to do _anything_.
I don't get your point: why don't {cur_tx, dirty_tx} qualify as said
two variables ?
There wasn't any cur_tx in the code you provided.
/* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */
#define TX_FRAGS_READY_FOR(tp,nr_frags) \
        (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1))

#define TX_SLOTS_AVAIL(tp) \
        (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx)

Both are also used in rtl_tx.

I don't get your point. Even a single variable is scattered through
the system.

-- 
Ueimor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help