Comment 13 for bug 1677571

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/30284
Committed: http://github.org/Juniper/contrail-vrouter/commit/9fbebe12ede8a762296ef21964941347c933c547
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit 9fbebe12ede8a762296ef21964941347c933c547
Author: Divakar D <email address hidden>
Date: Thu Apr 6 10:33:18 2017 +0530

Cleanup SubVIF properly if addition fails

On a given physical interface there can only be one subinterface per
given Vlan ID. If Agent attempts to add multiple subinterfaces with same
Valn ID, vrouter rejects that addition with -EEXIST error. As part of
this rejection, the temproary subinterface need to be properly
cleaned up. Right now the clean up is not proper w.r.t memory and the
refcount of the physical interface is lso not handled well. This is
leading to either memory leak/corruption.

Also currently the ref counting of VIF is not symetric w.r.t increment
and decrement. Decrement of ref count is done in atomic way but not
increment. This as such can lead to issues when RCU callbacks
of NH (which eventually decrement VIF ref count in atomic manner) are
executed in parallel to new NH addition from Agent (which increments VIF
ref count non atomic manner).

As a fix, sub VIF is cleaned up properly and VIF ref count is
incremented in atomic manner

Change-Id: I2a9d41f2b0152f700e2c5c96c9f39825c22ce482
closes-bug: #1677571