On Fri, Sep 16, 2011 at 1:08 PM, Ben Pfaff <b...@nicira.com> wrote:
> On Fri, Sep 16, 2011 at 01:02:19PM -0700, Jesse Gross wrote:
>> On Fri, Sep 16, 2011 at 9:42 AM, Ben Pfaff <b...@nicira.com> wrote:
>> > 'dp_ifindex' is never used in the fast path, only in Netlink handling
>> > and in the slow path that sends packets that miss up to userspace. ??We
>> > could get rid of dp_ifindex, replacing it by a function that obtains
>> > the ifindex from vport numbered OVSP_LOCAL or returns 0 if there isn't
>> > one (which could only happen in the slow path). ??When the slow path
>> > sees a return value of 0, it would just drop the packet.
>>
>> I think it's actually even simpler than that - we should be able to
>> just replace dp_ifindex with calls to get the ifindex of OVSP_LOCAL
>> and it should always be available.  All uses other than upcalls are
>> definitely OK because both they and the initialization of the datapath
>> are protected by genl_mutex.  Packets received on the datapath device
>> are also fine because in order for the packet to be received the
>> device (and all of its members) must be visible on the current CPU.
>
> I agree that the device must be visible, but that doesn't mean that
> anything has been assigned to dp->ports[OVSP_LOCAL] yet.  The former
> happens in internal_dev_create(), the latter only happens later in the
> caller (in new_vport()).  I guess we could do it earlier?

I think doing it earlier is essentially equivalent to this patch in
terms of needing memory barriers, etc. (the allocation of the netdev
is separate but things like the ifindex don't exist until registration
time).  It's not really worth it, so just dropping the packets as you
originally suggested is probably the best thing to do.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to