diff options
author | Nathan Fontenot <nfont@linux.vnet.ibm.com> | 2017-05-03 14:04:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-03 11:33:04 -0400 |
commit | ed651a10875f13135a5f59c1bae4d51b377b3925 (patch) | |
tree | a23701f729c69ad37901b504e02b42949a5ddcf8 /drivers/net/ethernet/ibm/ibmvnic.h | |
parent | 90c8014c2be5e5805d972341b40221da4309d564 (diff) | |
download | linux-ed651a10875f13135a5f59c1bae4d51b377b3925.tar.bz2 |
ibmvnic: Updated reset handling
The ibmvnic driver has multiple handlers for resetting the driver
depending on the reason the reset is needed (failover, lpm,
fatal erors,...). All of the reset handlers do essentially the same
thing, this patch moves this work to a common reset handler.
By doing this we also allow the driver to better handle situations
where we can get a reset while handling a reset.
The updated reset handling works by adding a reset work item to the
list of resets and then scheduling work to perform the reset. This
step is necessary because we can receive a reset in interrupt context
and we want to handle the reset out of interrupt context.
Signed-off-by: Nathan Fontenot <nfont@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 | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h index 03a866f542c4..4702b48cfa44 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.h +++ b/drivers/net/ethernet/ibm/ibmvnic.h @@ -922,6 +922,16 @@ enum vnic_state {VNIC_PROBING = 1, VNIC_REMOVING, VNIC_REMOVED}; +enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1, + VNIC_RESET_MOBILITY, + VNIC_RESET_FATAL, + VNIC_RESET_TIMEOUT}; + +struct ibmvnic_rwi { + enum ibmvnic_reset_reason reset_reason; + struct list_head list; +}; + struct ibmvnic_adapter { struct vio_dev *vdev; struct net_device *netdev; @@ -931,7 +941,6 @@ struct ibmvnic_adapter { dma_addr_t ip_offload_tok; struct ibmvnic_control_ip_offload_buffer ip_offload_ctrl; dma_addr_t ip_offload_ctrl_tok; - bool migrated; u32 msg_enable; /* Statistics */ @@ -1015,9 +1024,11 @@ struct ibmvnic_adapter { __be64 tx_rx_desc_req; u8 map_id; - struct work_struct vnic_crq_init; - struct work_struct ibmvnic_xport; struct tasklet_struct tasklet; - bool failover; enum vnic_state state; + enum ibmvnic_reset_reason reset_reason; + struct mutex reset_lock, rwi_lock; + struct list_head rwi_list; + struct work_struct ibmvnic_reset; + bool resetting; }; |