I added the padding to keep the sizeof(OVS_CT_EVENT_ENTRY) ==
sizeof(OVS_VPORT_EVENT_ENTRY)


I should have sent this as part of Patch 0. This is the general idea:

1. Currently we only support subscribing/unsubscribing to Vport related
events. Even for VPORT, we only care about the VPORT-Down event.
2. Event.c maintains a single queue of Event entries that are then read by
user space. This worked because we only supported 1 event type.
3. In order to add support for multiple events, I modified the event queue
into an array (size 2). The size of the event queue array is driven by
value of enum (we explicitly add new event types here).
4. I decided to make Event Queue an array to avoid creating new ones for
every event type. This also meant smaller code changes and not having
multiple if-else in the code.
5. Each event queue can be uniquely identified based on the mcast
EventType and hence the requirement for multiple locks based on the event
id.
6. Though we may not have multiple event queues subscribed for 1 socket, I
still wanted to ensure that we have support for it if it were ever
requested.
7. Each event type will be added to the underlying enum and subtypes can
be represent by means of masks (eg: vport up/down, ct delete/add/update
etc.,)
/* Supported mcast event groups */
enum OVS_MCAST_EVENT_ENTRIES {
    OVS_MCAST_VPORT_EVENT,
    OVS_MCAST_CT_EVENT,
    __OVS_MCAST_EVENT_ENTRIES_MAX
};


I hope this clarifies the questions.

Thanks,
Sairam

On 7/22/16, 6:10 PM, "Alin Serdean" <aserd...@cloudbasesolutions.com>
wrote:

>Looks good. Just a few questions from my side so I get up to speed with
>the changes in events.
>Why do we need a lock per eventid ?
>
>> +typedef struct _OVS_CT_EVENT_ENTRY {
>> +    OVS_CT_ENTRY entry;
>> +    UINT8 type;
>> +    UINT64 pad[10];
>> +} OVS_CT_EVENT_ENTRY, *POVS_CT_EVENT_ENTRY;
>
>Why such a big pad?
>
>Thanks,
>Alin.
>
>> -----Mesaj original-----
>> De la: dev [mailto:dev-boun...@openvswitch.org] În numele Sairam
>> Venugopal
>> Trimis: Thursday, July 14, 2016 2:39 AM
>> Către: dev@openvswitch.org
>> Subiect: [ovs-dev] [PATCH 7/9] datapath-windows: Add support for
>>multiple
>> event queue in Event.c
>> 
>> Update Event.c to have multiple event queues and mechanism to retrieve
>> the associated queue. Introduce OvsPostCtEvent and
>> OvsRemoveCtEventEntry similar to OvsPostVportEvent and
>> OvsRemoveVportEventEntry.

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to