shortcut-fe: delete connection gracefully
Before this change, there are two steps for connection deletion:
In the first step, SFE hold spin lock, and remove connection from
3 tables/lists: <connection entry hash table>, <match entry hash table>,
<match entry active list>. But connection is kept in <all connection list>
for traversing. At the end of this step, SFE release spin lock.
In the second step, SFE hold spin lock, and check if anybody are traversing
the connection which is to be deleted. If nobody are traversing this
connection, SFE remove it from <all connection list>, and free it. At the
end of this step, SFE release spin lock.
The risk is that another execution flow which also want to delete this
connection can take this connection between step 1 and step 2. This may
result in connection are removed and freed twice.
What this change do is to merge step 1 and step 2 to a single step. Then
connection deletion will be an atomic operation.
Change-Id: I63b4757f61ef08fe543b5217c8d2ad130e8bb408
Signed-off-by: Xiaoping Fan <xfan@codeaurora.org>
2 files changed