[ovs-dev] [PATCH v2 08/15] connmgr: Make connmgr_wants_packet_in_on_miss() lock-free.
Jarno Rajahalme
jarno at ovn.org
Thu Sep 1 23:37:20 UTC 2016
> On Sep 1, 2016, at 4:35 PM, Jarno Rajahalme <jarno at ovn.org> wrote:
>
>
>> On Aug 29, 2016, at 2:49 PM, Ben Pfaff <blp at ovn.org> wrote:
>>
>> On Mon, Aug 22, 2016 at 04:31:34PM -0700, Jarno Rajahalme wrote:
>>> Make connmgr_wants_packet_in_on_miss() use an atomic int instead of a
>>> list traversal taking the 'ofproto_mutex'. This allows
>>> connmgr_wants_packet_in_on_miss() to be called also when
>>> 'ofproto_mutex' is already held, and makes it faster, too.
>>>
>>> Remove unused ofproto_dpif_wants_packet_in_on_miss().
>>>
>>> Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
>>
>> The logic doesn't seem right to me. In ofconn_create() below,
>> ofconn_flush() always sets the protocol to OFPUTIL_P_NONE, so
>> update_want_packet_in_on_miss() will always treat the connection as one
>> that wants packet-ins. Later on, the true OpenFlow version of the
>> connection will be learned (unless it drops quickly), but the count
>> won't be updated, but the call to update_want_packet_in_on_miss() from
>> ofconn_destroy() will behave differently depending on the version.
>>
>> ofconn_flush(ofconn);
>>
>> update_want_packet_in_on_miss(ofconn, true);
>
> Oops, I totally missed the dynamic nature of this the first time around. I think I nailed it for the v2, though, updating the status after each ofconn_set_protocol() and ofconn_set_controller_id() change.
>
> Jarno
>
Make that v3.
Jarno
More information about the dev
mailing list