diff options
author | Juliet Kim <julietk@linux.vnet.ibm.com> | 2019-09-20 16:11:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-25 13:41:41 +0200 |
commit | 7ed5b31f4a6695a21f617df07646e9b15c6c1d29 (patch) | |
tree | 39af057ff37d6c677c89f83279134ee22aace6ab /drivers/net/ethernet/ibm/ibmvnic.h | |
parent | b27507bb59ed504d7fa4d6a35f25a8cc39903b54 (diff) | |
download | lwn-7ed5b31f4a6695a21f617df07646e9b15c6c1d29.tar.gz lwn-7ed5b31f4a6695a21f617df07646e9b15c6c1d29.zip |
net/ibmvnic: prevent more than one thread from running in reset
The current code allows more than one thread to run in reset. This can
corrupt struct adapter data. Check adapter->resetting before performing
a reset, if there is another reset running delay (100 msec) before trying
again.
Signed-off-by: Juliet Kim <julietk@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ibm/ibmvnic.h')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h index 9d3d35cc91d6..ebc39248b334 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.h +++ b/drivers/net/ethernet/ibm/ibmvnic.h @@ -39,6 +39,8 @@ #define IBMVNIC_MAX_LTB_SIZE ((1 << (MAX_ORDER - 1)) * PAGE_SIZE) #define IBMVNIC_BUFFER_HLEN 500 +#define IBMVNIC_RESET_DELAY 100 + static const char ibmvnic_priv_flags[][ETH_GSTRING_LEN] = { #define IBMVNIC_USE_SERVER_MAXES 0x1 "use-server-maxes" @@ -1077,7 +1079,8 @@ struct ibmvnic_adapter { spinlock_t rwi_lock; struct list_head rwi_list; struct work_struct ibmvnic_reset; - bool resetting; + struct delayed_work ibmvnic_delayed_reset; + unsigned long resetting; bool napi_enabled, from_passive_init; bool failover_pending; |