netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasesh Mody <rmody@brocade.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <bhutchings@solarflare.com>, <David.Laight@ACULAB.COM>,
	<adapter_linux_open_src_team@brocade.com>,
	Rasesh Mody <rmody@brocade.com>
Subject: [net-next 5/7] bna: Add RX State
Date: Mon, 10 Dec 2012 13:42:03 -0800	[thread overview]
Message-ID: <1355175725-19202-6-git-send-email-rmody@brocade.com> (raw)
In-Reply-To: <1355175725-19202-1-git-send-email-rmody@brocade.com>

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: Rasesh Mody <rmody@brocade.com>
---
 drivers/net/ethernet/brocade/bna/bna_tx_rx.c |   27 +++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
index 4df6d4b..ea6f4a0 100644
--- a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
+++ b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
@@ -1355,6 +1355,8 @@ bfa_fsm_state_decl(bna_rx, stopped,
 	struct bna_rx, enum bna_rx_event);
 bfa_fsm_state_decl(bna_rx, start_wait,
 	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,
 	struct bna_rx, enum bna_rx_event);
 bfa_fsm_state_decl(bna_rx, started,
@@ -1432,7 +1434,7 @@ static void bna_rx_sm_start_wait(struct bna_rx *rx,
 {
 	switch (event) {
 	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;
 
 	case RX_E_FAIL:
@@ -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
 bna_rx_sm_started_entry(struct bna_rx *rx)
 {
-- 
1.7.1

  parent reply	other threads:[~2012-12-10 21:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10 21:41 [net-next 0/7] bna: Driver Version Updated to 3.1.2.1 Rasesh Mody
2012-12-10 21:41 ` [net-next 1/7] bna: Code Cleanup and Enhancements Rasesh Mody
2012-12-10 22:13   ` David Miller
2012-12-11  0:39     ` Rasesh Mody
2012-12-10 21:42 ` [net-next 2/7] bna: Tx and Rx Optimizations Rasesh Mody
2012-12-10 21:42 ` [net-next 3/7] bna: TX Intr Coalescing Fix Rasesh Mody
2012-12-10 21:42 ` [net-next 4/7] bna: Rx Page Based Allocation Rasesh Mody
2012-12-10 21:42 ` Rasesh Mody [this message]
2012-12-10 21:42 ` [net-next 6/7] bna: Firmware update Rasesh Mody
2012-12-10 21:42 ` [net-next 7/7] bna: Driver Version Updated to 3.1.2.1 Rasesh Mody
  -- strict thread matches above, loose matches on Subject: below --
2012-12-11 22:24 [net-next 0/7] " Rasesh Mody
2012-12-11 22:24 ` [net-next 5/7] bna: Add RX State Rasesh Mody
2012-12-06 23:17 [net-next 0/7] bna: Driver Version Updated to 3.1.2.1 Rasesh Mody
2012-12-06 23:17 ` [net-next 5/7] bna: Add RX State Rasesh Mody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355175725-19202-6-git-send-email-rmody@brocade.com \
    --to=rmody@brocade.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=adapter_linux_open_src_team@brocade.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).