diff options
author | Ariel Elior <ariele@broadcom.com> | 2011-07-14 04:31:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-14 19:02:29 -0400 |
commit | 7be08a7222c345798b0697a89ea3dd2c7c83f47c (patch) | |
tree | ac88d5d5595ffd21fce1af25ecadc1e218f719b9 | |
parent | 39770653ca4423562e88726a629886c41139610b (diff) |
bnx2x: Renaming the "reset_task" to "sp_rtnl_task"
Renaming the "reset_task" to a more general purpose name,
"sp_rtnl_task", as it is already used for another purpose
other than reset which is parity recovery, and since I
plan to add a third operation for this task, updating the
priority to traffic class and traffic class to transmission
queues mappings after dcbx negotiation takes place.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bnx2x/bnx2x.h | 11 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_cmn.c | 7 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 48 |
3 files changed, 45 insertions, 21 deletions
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index 0d4b98126241..16dc2c9df8b7 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h | |||
@@ -1046,6 +1046,12 @@ struct bnx2x_fw_stats_data { | |||
1046 | struct per_queue_stats queue_stats[1]; | 1046 | struct per_queue_stats queue_stats[1]; |
1047 | }; | 1047 | }; |
1048 | 1048 | ||
1049 | /* Public slow path states */ | ||
1050 | enum { | ||
1051 | BNX2X_SP_RTNL_TX_TIMEOUT, | ||
1052 | }; | ||
1053 | |||
1054 | |||
1049 | struct bnx2x { | 1055 | struct bnx2x { |
1050 | /* Fields used in the tx and intr/napi performance paths | 1056 | /* Fields used in the tx and intr/napi performance paths |
1051 | * are grouped together in the beginning of the structure | 1057 | * are grouped together in the beginning of the structure |
@@ -1159,7 +1165,7 @@ struct bnx2x { | |||
1159 | int mrrs; | 1165 | int mrrs; |
1160 | 1166 | ||
1161 | struct delayed_work sp_task; | 1167 | struct delayed_work sp_task; |
1162 | struct delayed_work reset_task; | 1168 | struct delayed_work sp_rtnl_task; |
1163 | 1169 | ||
1164 | struct delayed_work period_task; | 1170 | struct delayed_work period_task; |
1165 | struct timer_list timer; | 1171 | struct timer_list timer; |
@@ -1403,6 +1409,9 @@ struct bnx2x { | |||
1403 | 1409 | ||
1404 | unsigned long sp_state; | 1410 | unsigned long sp_state; |
1405 | 1411 | ||
1412 | /* operation indication for the sp_rtnl task */ | ||
1413 | unsigned long sp_rtnl_state; | ||
1414 | |||
1406 | /* DCBX Negotation results */ | 1415 | /* DCBX Negotation results */ |
1407 | struct dcbx_features dcbx_local_feat; | 1416 | struct dcbx_features dcbx_local_feat; |
1408 | u32 dcbx_error; | 1417 | u32 dcbx_error; |
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index bb7556016f41..8763625b09d0 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -3233,8 +3233,13 @@ void bnx2x_tx_timeout(struct net_device *dev) | |||
3233 | if (!bp->panic) | 3233 | if (!bp->panic) |
3234 | bnx2x_panic(); | 3234 | bnx2x_panic(); |
3235 | #endif | 3235 | #endif |
3236 | |||
3237 | smp_mb__before_clear_bit(); | ||
3238 | set_bit(BNX2X_SP_RTNL_TX_TIMEOUT, &bp->sp_rtnl_state); | ||
3239 | smp_mb__after_clear_bit(); | ||
3240 | |||
3236 | /* This allows the netif to be shutdown gracefully before resetting */ | 3241 | /* This allows the netif to be shutdown gracefully before resetting */ |
3237 | schedule_delayed_work(&bp->reset_task, 0); | 3242 | schedule_delayed_work(&bp->sp_rtnl_task, 0); |
3238 | } | 3243 | } |
3239 | 3244 | ||
3240 | int bnx2x_suspend(struct pci_dev *pdev, pm_message_t state) | 3245 | int bnx2x_suspend(struct pci_dev *pdev, pm_message_t state) |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 5b4a8f34b13c..53f4ec3d1d9e 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -4020,7 +4020,7 @@ static void bnx2x_attn_int_deasserted(struct bnx2x *bp, u32 deasserted) | |||
4020 | if (bnx2x_chk_parity_attn(bp, &global, true)) { | 4020 | if (bnx2x_chk_parity_attn(bp, &global, true)) { |
4021 | #ifndef BNX2X_STOP_ON_ERROR | 4021 | #ifndef BNX2X_STOP_ON_ERROR |
4022 | bp->recovery_state = BNX2X_RECOVERY_INIT; | 4022 | bp->recovery_state = BNX2X_RECOVERY_INIT; |
4023 | schedule_delayed_work(&bp->reset_task, 0); | 4023 | schedule_delayed_work(&bp->sp_rtnl_task, 0); |
4024 | /* Disable HW interrupts */ | 4024 | /* Disable HW interrupts */ |
4025 | bnx2x_int_disable(bp); | 4025 | bnx2x_int_disable(bp); |
4026 | /* In case of parity errors don't handle attentions so that | 4026 | /* In case of parity errors don't handle attentions so that |
@@ -7963,7 +7963,7 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
7963 | /* Wait until all other functions get | 7963 | /* Wait until all other functions get |
7964 | * down. | 7964 | * down. |
7965 | */ | 7965 | */ |
7966 | schedule_delayed_work(&bp->reset_task, | 7966 | schedule_delayed_work(&bp->sp_rtnl_task, |
7967 | HZ/10); | 7967 | HZ/10); |
7968 | return; | 7968 | return; |
7969 | } else { | 7969 | } else { |
@@ -8000,7 +8000,7 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
8000 | break; | 8000 | break; |
8001 | } | 8001 | } |
8002 | 8002 | ||
8003 | schedule_delayed_work(&bp->reset_task, | 8003 | schedule_delayed_work(&bp->sp_rtnl_task, |
8004 | HZ/10); | 8004 | HZ/10); |
8005 | return; | 8005 | return; |
8006 | 8006 | ||
@@ -8011,7 +8011,8 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
8011 | */ | 8011 | */ |
8012 | if (bnx2x_reset_is_global(bp)) { | 8012 | if (bnx2x_reset_is_global(bp)) { |
8013 | schedule_delayed_work( | 8013 | schedule_delayed_work( |
8014 | &bp->reset_task, HZ/10); | 8014 | &bp->sp_rtnl_task, |
8015 | HZ/10); | ||
8015 | return; | 8016 | return; |
8016 | } | 8017 | } |
8017 | 8018 | ||
@@ -8035,30 +8036,39 @@ static void bnx2x_parity_recover(struct bnx2x *bp) | |||
8035 | /* bnx2x_nic_unload() flushes the bnx2x_wq, thus reset task is | 8036 | /* bnx2x_nic_unload() flushes the bnx2x_wq, thus reset task is |
8036 | * scheduled on a general queue in order to prevent a dead lock. | 8037 | * scheduled on a general queue in order to prevent a dead lock. |
8037 | */ | 8038 | */ |
8038 | static void bnx2x_reset_task(struct work_struct *work) | 8039 | static void bnx2x_sp_rtnl_task(struct work_struct *work) |
8039 | { | 8040 | { |
8040 | struct bnx2x *bp = container_of(work, struct bnx2x, reset_task.work); | 8041 | struct bnx2x *bp = container_of(work, struct bnx2x, sp_rtnl_task.work); |
8041 | |||
8042 | #ifdef BNX2X_STOP_ON_ERROR | ||
8043 | BNX2X_ERR("reset task called but STOP_ON_ERROR defined" | ||
8044 | " so reset not done to allow debug dump,\n" | ||
8045 | KERN_ERR " you will need to reboot when done\n"); | ||
8046 | return; | ||
8047 | #endif | ||
8048 | 8042 | ||
8049 | rtnl_lock(); | 8043 | rtnl_lock(); |
8050 | 8044 | ||
8051 | if (!netif_running(bp->dev)) | 8045 | if (!netif_running(bp->dev)) |
8052 | goto reset_task_exit; | 8046 | goto sp_rtnl_exit; |
8047 | |||
8048 | /* if stop on error is defined no recovery flows should be executed */ | ||
8049 | #ifdef BNX2X_STOP_ON_ERROR | ||
8050 | BNX2X_ERR("recovery flow called but STOP_ON_ERROR defined " | ||
8051 | "so reset not done to allow debug dump,\n" | ||
8052 | "you will need to reboot when done\n"); | ||
8053 | goto sp_rtnl_exit; | ||
8054 | #endif | ||
8053 | 8055 | ||
8054 | if (unlikely(bp->recovery_state != BNX2X_RECOVERY_DONE)) | 8056 | if (unlikely(bp->recovery_state != BNX2X_RECOVERY_DONE)) { |
8057 | /* | ||
8058 | * Clear TX_TIMEOUT bit as we are going to reset the function | ||
8059 | * anyway. | ||
8060 | */ | ||
8061 | smp_mb__before_clear_bit(); | ||
8062 | clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, &bp->sp_rtnl_state); | ||
8063 | smp_mb__after_clear_bit(); | ||
8055 | bnx2x_parity_recover(bp); | 8064 | bnx2x_parity_recover(bp); |
8056 | else { | 8065 | } else if (test_and_clear_bit(BNX2X_SP_RTNL_TX_TIMEOUT, |
8066 | &bp->sp_rtnl_state)){ | ||
8057 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); | 8067 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); |
8058 | bnx2x_nic_load(bp, LOAD_NORMAL); | 8068 | bnx2x_nic_load(bp, LOAD_NORMAL); |
8059 | } | 8069 | } |
8060 | 8070 | ||
8061 | reset_task_exit: | 8071 | sp_rtnl_exit: |
8062 | rtnl_unlock(); | 8072 | rtnl_unlock(); |
8063 | } | 8073 | } |
8064 | 8074 | ||
@@ -9291,7 +9301,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
9291 | #endif | 9301 | #endif |
9292 | 9302 | ||
9293 | INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); | 9303 | INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); |
9294 | INIT_DELAYED_WORK(&bp->reset_task, bnx2x_reset_task); | 9304 | INIT_DELAYED_WORK(&bp->sp_rtnl_task, bnx2x_sp_rtnl_task); |
9295 | INIT_DELAYED_WORK(&bp->period_task, bnx2x_period_task); | 9305 | INIT_DELAYED_WORK(&bp->period_task, bnx2x_period_task); |
9296 | rc = bnx2x_get_hwinfo(bp); | 9306 | rc = bnx2x_get_hwinfo(bp); |
9297 | if (rc) | 9307 | if (rc) |
@@ -10342,7 +10352,7 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev) | |||
10342 | bnx2x_set_power_state(bp, PCI_D3hot); | 10352 | bnx2x_set_power_state(bp, PCI_D3hot); |
10343 | 10353 | ||
10344 | /* Make sure RESET task is not scheduled before continuing */ | 10354 | /* Make sure RESET task is not scheduled before continuing */ |
10345 | cancel_delayed_work_sync(&bp->reset_task); | 10355 | cancel_delayed_work_sync(&bp->sp_rtnl_task); |
10346 | 10356 | ||
10347 | if (bp->regview) | 10357 | if (bp->regview) |
10348 | iounmap(bp->regview); | 10358 | iounmap(bp->regview); |