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

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

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

Signed-off-by: Shuotian Cheng <>
Signed-off-by: Pavel Shirshov <>
Signed-off-by: Jiri Pirko <>
1 file changed