Commit 215a64a2 authored by Rasesh Mody's avatar Rasesh Mody Committed by David S. Miller

bna: Add RX State

Change Details:
 -      BNA state machine for Rx in start_wait state moves it to stop_wait on
        receipt of RX_E_STOP. In Rx stop_wait state, on receipt of
                RX_E_STARTED event does enet stop
                RX_E_STOPPED event does rx_cleanup_cbfn
        rx_cleanup_cbfn in this case is called without post_cbfn. post_cbfn
        happens only after RX_E_STARTED event is received in start_wait. Without
        doing post_cbfn, NAPI remains disabled and in cleanup we try to disable
        again causing endless wait. ifconfig process and other workers can thus
        get stuck.
 -      Introducing start_stop_wait state for Rx. This state handles the case of
        if post_cbfn is not done simply do stop without the cleanup.
Signed-off-by: default avatarRasesh Mody <rmody@brocade.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30f9fc94
...@@ -1355,6 +1355,8 @@ bfa_fsm_state_decl(bna_rx, stopped, ...@@ -1355,6 +1355,8 @@ bfa_fsm_state_decl(bna_rx, stopped,
struct bna_rx, enum bna_rx_event); struct bna_rx, enum bna_rx_event);
bfa_fsm_state_decl(bna_rx, start_wait, bfa_fsm_state_decl(bna_rx, start_wait,
struct bna_rx, enum bna_rx_event); struct bna_rx, enum bna_rx_event);
bfa_fsm_state_decl(bna_rx, start_stop_wait,
struct bna_rx, enum bna_rx_event);
bfa_fsm_state_decl(bna_rx, rxf_start_wait, bfa_fsm_state_decl(bna_rx, rxf_start_wait,
struct bna_rx, enum bna_rx_event); struct bna_rx, enum bna_rx_event);
bfa_fsm_state_decl(bna_rx, started, bfa_fsm_state_decl(bna_rx, started,
...@@ -1432,7 +1434,7 @@ static void bna_rx_sm_start_wait(struct bna_rx *rx, ...@@ -1432,7 +1434,7 @@ static void bna_rx_sm_start_wait(struct bna_rx *rx,
{ {
switch (event) { switch (event) {
case RX_E_STOP: case RX_E_STOP:
bfa_fsm_set_state(rx, bna_rx_sm_stop_wait); bfa_fsm_set_state(rx, bna_rx_sm_start_stop_wait);
break; break;
case RX_E_FAIL: case RX_E_FAIL:
...@@ -1488,6 +1490,29 @@ bna_rx_sm_rxf_stop_wait(struct bna_rx *rx, enum bna_rx_event event) ...@@ -1488,6 +1490,29 @@ bna_rx_sm_rxf_stop_wait(struct bna_rx *rx, enum bna_rx_event event)
} }
static void
bna_rx_sm_start_stop_wait_entry(struct bna_rx *rx)
{
}
static void
bna_rx_sm_start_stop_wait(struct bna_rx *rx, enum bna_rx_event event)
{
switch (event) {
case RX_E_FAIL:
case RX_E_STOPPED:
bfa_fsm_set_state(rx, bna_rx_sm_stopped);
break;
case RX_E_STARTED:
bna_rx_enet_stop(rx);
break;
default:
bfa_sm_fault(event);
}
}
void void
bna_rx_sm_started_entry(struct bna_rx *rx) bna_rx_sm_started_entry(struct bna_rx *rx)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment