diff options
| -rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_ll2.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index 851561fb8224..468c59d2e491 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c | |||
| @@ -829,6 +829,9 @@ static int qed_ll2_lb_rxq_completion(struct qed_hwfn *p_hwfn, void *p_cookie) | |||
| 829 | struct qed_ll2_info *p_ll2_conn = (struct qed_ll2_info *)p_cookie; | 829 | struct qed_ll2_info *p_ll2_conn = (struct qed_ll2_info *)p_cookie; |
| 830 | int rc; | 830 | int rc; |
| 831 | 831 | ||
| 832 | if (!QED_LL2_RX_REGISTERED(p_ll2_conn)) | ||
| 833 | return 0; | ||
| 834 | |||
| 832 | rc = qed_ll2_lb_rxq_handler(p_hwfn, p_ll2_conn); | 835 | rc = qed_ll2_lb_rxq_handler(p_hwfn, p_ll2_conn); |
| 833 | if (rc) | 836 | if (rc) |
| 834 | return rc; | 837 | return rc; |
| @@ -849,6 +852,9 @@ static int qed_ll2_lb_txq_completion(struct qed_hwfn *p_hwfn, void *p_cookie) | |||
| 849 | u16 new_idx = 0, num_bds = 0; | 852 | u16 new_idx = 0, num_bds = 0; |
| 850 | int rc; | 853 | int rc; |
| 851 | 854 | ||
| 855 | if (!QED_LL2_TX_REGISTERED(p_ll2_conn)) | ||
| 856 | return 0; | ||
| 857 | |||
| 852 | new_idx = le16_to_cpu(*p_tx->p_fw_cons); | 858 | new_idx = le16_to_cpu(*p_tx->p_fw_cons); |
| 853 | num_bds = ((s16)new_idx - (s16)p_tx->bds_idx); | 859 | num_bds = ((s16)new_idx - (s16)p_tx->bds_idx); |
| 854 | 860 | ||
| @@ -1902,17 +1908,25 @@ int qed_ll2_terminate_connection(void *cxt, u8 connection_handle) | |||
| 1902 | 1908 | ||
| 1903 | /* Stop Tx & Rx of connection, if needed */ | 1909 | /* Stop Tx & Rx of connection, if needed */ |
| 1904 | if (QED_LL2_TX_REGISTERED(p_ll2_conn)) { | 1910 | if (QED_LL2_TX_REGISTERED(p_ll2_conn)) { |
| 1911 | p_ll2_conn->tx_queue.b_cb_registred = false; | ||
| 1912 | smp_wmb(); /* Make sure this is seen by ll2_lb_rxq_completion */ | ||
| 1905 | rc = qed_sp_ll2_tx_queue_stop(p_hwfn, p_ll2_conn); | 1913 | rc = qed_sp_ll2_tx_queue_stop(p_hwfn, p_ll2_conn); |
| 1906 | if (rc) | 1914 | if (rc) |
| 1907 | goto out; | 1915 | goto out; |
| 1916 | |||
| 1908 | qed_ll2_txq_flush(p_hwfn, connection_handle); | 1917 | qed_ll2_txq_flush(p_hwfn, connection_handle); |
| 1918 | qed_int_unregister_cb(p_hwfn, p_ll2_conn->tx_queue.tx_sb_index); | ||
| 1909 | } | 1919 | } |
| 1910 | 1920 | ||
| 1911 | if (QED_LL2_RX_REGISTERED(p_ll2_conn)) { | 1921 | if (QED_LL2_RX_REGISTERED(p_ll2_conn)) { |
| 1922 | p_ll2_conn->rx_queue.b_cb_registred = false; | ||
| 1923 | smp_wmb(); /* Make sure this is seen by ll2_lb_rxq_completion */ | ||
| 1912 | rc = qed_sp_ll2_rx_queue_stop(p_hwfn, p_ll2_conn); | 1924 | rc = qed_sp_ll2_rx_queue_stop(p_hwfn, p_ll2_conn); |
| 1913 | if (rc) | 1925 | if (rc) |
| 1914 | goto out; | 1926 | goto out; |
| 1927 | |||
| 1915 | qed_ll2_rxq_flush(p_hwfn, connection_handle); | 1928 | qed_ll2_rxq_flush(p_hwfn, connection_handle); |
| 1929 | qed_int_unregister_cb(p_hwfn, p_ll2_conn->rx_queue.rx_sb_index); | ||
| 1916 | } | 1930 | } |
| 1917 | 1931 | ||
| 1918 | if (p_ll2_conn->input.conn_type == QED_LL2_TYPE_OOO) | 1932 | if (p_ll2_conn->input.conn_type == QED_LL2_TYPE_OOO) |
| @@ -1960,16 +1974,6 @@ void qed_ll2_release_connection(void *cxt, u8 connection_handle) | |||
| 1960 | if (!p_ll2_conn) | 1974 | if (!p_ll2_conn) |
| 1961 | return; | 1975 | return; |
| 1962 | 1976 | ||
| 1963 | if (QED_LL2_RX_REGISTERED(p_ll2_conn)) { | ||
| 1964 | p_ll2_conn->rx_queue.b_cb_registred = false; | ||
| 1965 | qed_int_unregister_cb(p_hwfn, p_ll2_conn->rx_queue.rx_sb_index); | ||
| 1966 | } | ||
| 1967 | |||
| 1968 | if (QED_LL2_TX_REGISTERED(p_ll2_conn)) { | ||
| 1969 | p_ll2_conn->tx_queue.b_cb_registred = false; | ||
| 1970 | qed_int_unregister_cb(p_hwfn, p_ll2_conn->tx_queue.tx_sb_index); | ||
| 1971 | } | ||
| 1972 | |||
| 1973 | kfree(p_ll2_conn->tx_queue.descq_mem); | 1977 | kfree(p_ll2_conn->tx_queue.descq_mem); |
| 1974 | qed_chain_free(p_hwfn->cdev, &p_ll2_conn->tx_queue.txq_chain); | 1978 | qed_chain_free(p_hwfn->cdev, &p_ll2_conn->tx_queue.txq_chain); |
| 1975 | 1979 | ||
