Skip to contentSkip to conversation

2.6.x net driver fixes

PATCH Linus Torvalds 1 participant 1 message Jul 14, 2004 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 9 lines · Jeff Garzik
Quoted 4 lines

The weaker ordering constraint is called "read_barrier_depends()", and should be a no-op on all but alpha. Would you want to use that to fix the alpha case too?

What would the proper fix be?

	rmb();
	read_barrier_depends();

No, just a

	index = *indexpointer;
	read_barrier_depends();
	data = dataptr[index];

which on most architectures is a no-op, but in case the hardware might do data or address speculation, and needs a dependent load barrier, it will do the right thing.

For stuff that isn't data dependent, you have to use the full rmb(), which obviously isn't a no-op on most setups.

Linus