[ovs-dev] [netlink v3 4/5] vport: Add smp_wmb() to vport_alloc().
Jesse Gross
jesse at nicira.com
Fri Dec 3 02:52:26 UTC 2010
On Tue, Nov 16, 2010 at 5:11 PM, Ben Pfaff <blp at nicira.com> wrote:
> I'm not sure whether this is necessary or makes sense. If it does, then
> it should be folded into the previous commit. If it doesn't, then this
> commit should be dropped.
I think it's probably generally unnecessary (it's certainly not needed
by any of the current vport implementations). In order to receive
packets on a different CPU, the vport would need to hand off the
struct vport pointer somehow. To do that without any kind of memory
barrier seems like a bug to me. Furthermore, the vport implementation
is required to execute the corresponding read memory barrier, so it's
better to be symmetrical.
Looking at vport_alloc() further, I would also drop the
rcu_assign_pointer() in the assignment of params->dp to vport->dp from
the last commit. We don't use rcu_dereference on read for it, so
again it would good to be symmetrical.
More information about the dev
mailing list