Fix ifinfo_link_with_port race condition with newlink

When a member port is enslaved into a port channel
immediately after the port channel was created,
it is possible to get member port ifinfo structure
not initialized for the member port because of a race
condition.

The race condition here occurs because order of
following events is not strict:
 - adding the member port to the port channel;
 - creating ifinfo structure for the member port.

The error message "Failed to link port with ifinfo" is
thrown when a member port is tried to be added to the
team handler's port list before ifinfo structure was
initialized.

To fix this situation ifinfo_find_create() is used
to search member ports ifinfo structure in
ifinfo_link_with_port().

Signed-off-by: Shuotian Cheng <shuche@microsoft.com>
Signed-off-by: Pavel Shirshov <pavel.contrib@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
1 file changed