net/ixgbe: fix link state timing on fiber ports
authorPhil Yang <phil.yang@arm.com>
Fri, 8 May 2020 10:28:27 +0000 (18:28 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 20:27:39 +0000 (22:27 +0200)
commitd70a869db27871db90f86e108fdbb9a22fc6d8c7
tree0353cd40940d4c601b9938c0a6eddaa98389a4cd
parentbd8cf9c0b090d69561ac6ec044bd02a894496748
net/ixgbe: fix link state timing on fiber ports

In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback
to ixgbe_dev_setup_link_thread_handler() is scheduled which should
try to set up the link and clear the flag afterwards. This flag works
as a guard variable between threads.

To avoid potential race condition between threads, set the
IXGBE_FLAG_NEED_LINK_CONFIG flag only when there is no link thread
running.

Bugzilla ID: 388
Fixes: 819d0d1d57f1 ("net/ixgbe: fix blocking system events")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Lijian Zhang <lijian.zhang@arm.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c