|
41 | 41 | #include "qed_rdma.h"
|
42 | 42 | #include "qed_reg_addr.h"
|
43 | 43 | #include "qed_sp.h"
|
| 44 | +#include "qed_ooo.h" |
44 | 45 |
|
45 | 46 | #define QED_IWARP_ORD_DEFAULT 32
|
46 | 47 | #define QED_IWARP_IRD_DEFAULT 32
|
@@ -119,6 +120,13 @@ static void qed_iwarp_cid_cleaned(struct qed_hwfn *p_hwfn, u32 cid)
|
119 | 120 | spin_unlock_bh(&p_hwfn->p_rdma_info->lock);
|
120 | 121 | }
|
121 | 122 |
|
| 123 | +void qed_iwarp_init_fw_ramrod(struct qed_hwfn *p_hwfn, |
| 124 | + struct iwarp_init_func_params *p_ramrod) |
| 125 | +{ |
| 126 | + p_ramrod->ll2_ooo_q_index = RESC_START(p_hwfn, QED_LL2_QUEUE) + |
| 127 | + p_hwfn->p_rdma_info->iwarp.ll2_ooo_handle; |
| 128 | +} |
| 129 | + |
122 | 130 | static int qed_iwarp_alloc_cid(struct qed_hwfn *p_hwfn, u32 *cid)
|
123 | 131 | {
|
124 | 132 | int rc;
|
@@ -1876,6 +1884,16 @@ static int qed_iwarp_ll2_stop(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
|
1876 | 1884 | iwarp_info->ll2_syn_handle = QED_IWARP_HANDLE_INVAL;
|
1877 | 1885 | }
|
1878 | 1886 |
|
| 1887 | + if (iwarp_info->ll2_ooo_handle != QED_IWARP_HANDLE_INVAL) { |
| 1888 | + rc = qed_ll2_terminate_connection(p_hwfn, |
| 1889 | + iwarp_info->ll2_ooo_handle); |
| 1890 | + if (rc) |
| 1891 | + DP_INFO(p_hwfn, "Failed to terminate ooo connection\n"); |
| 1892 | + |
| 1893 | + qed_ll2_release_connection(p_hwfn, iwarp_info->ll2_ooo_handle); |
| 1894 | + iwarp_info->ll2_ooo_handle = QED_IWARP_HANDLE_INVAL; |
| 1895 | + } |
| 1896 | + |
1879 | 1897 | qed_llh_remove_mac_filter(p_hwfn,
|
1880 | 1898 | p_ptt, p_hwfn->p_rdma_info->iwarp.mac_addr);
|
1881 | 1899 | return rc;
|
@@ -1927,10 +1945,12 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
|
1927 | 1945 | struct qed_iwarp_info *iwarp_info;
|
1928 | 1946 | struct qed_ll2_acquire_data data;
|
1929 | 1947 | struct qed_ll2_cbs cbs;
|
| 1948 | + u16 n_ooo_bufs; |
1930 | 1949 | int rc = 0;
|
1931 | 1950 |
|
1932 | 1951 | iwarp_info = &p_hwfn->p_rdma_info->iwarp;
|
1933 | 1952 | iwarp_info->ll2_syn_handle = QED_IWARP_HANDLE_INVAL;
|
| 1953 | + iwarp_info->ll2_ooo_handle = QED_IWARP_HANDLE_INVAL; |
1934 | 1954 |
|
1935 | 1955 | iwarp_info->max_mtu = params->max_mtu;
|
1936 | 1956 |
|
@@ -1978,6 +1998,29 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
|
1978 | 1998 | if (rc)
|
1979 | 1999 | goto err;
|
1980 | 2000 |
|
| 2001 | + /* Start OOO connection */ |
| 2002 | + data.input.conn_type = QED_LL2_TYPE_OOO; |
| 2003 | + data.input.mtu = params->max_mtu; |
| 2004 | + |
| 2005 | + n_ooo_bufs = (QED_IWARP_MAX_OOO * QED_IWARP_RCV_WND_SIZE_DEF) / |
| 2006 | + iwarp_info->max_mtu; |
| 2007 | + n_ooo_bufs = min_t(u32, n_ooo_bufs, QED_IWARP_LL2_OOO_MAX_RX_SIZE); |
| 2008 | + |
| 2009 | + data.input.rx_num_desc = n_ooo_bufs; |
| 2010 | + data.input.rx_num_ooo_buffers = n_ooo_bufs; |
| 2011 | + |
| 2012 | + data.input.tx_max_bds_per_packet = 1; /* will never be fragmented */ |
| 2013 | + data.input.tx_num_desc = QED_IWARP_LL2_OOO_DEF_TX_SIZE; |
| 2014 | + data.p_connection_handle = &iwarp_info->ll2_ooo_handle; |
| 2015 | + |
| 2016 | + rc = qed_ll2_acquire_connection(p_hwfn, &data); |
| 2017 | + if (rc) |
| 2018 | + goto err; |
| 2019 | + |
| 2020 | + rc = qed_ll2_establish_connection(p_hwfn, iwarp_info->ll2_ooo_handle); |
| 2021 | + if (rc) |
| 2022 | + goto err; |
| 2023 | + |
1981 | 2024 | return rc;
|
1982 | 2025 | err:
|
1983 | 2026 | qed_iwarp_ll2_stop(p_hwfn, p_ptt);
|
@@ -2014,6 +2057,7 @@ int qed_iwarp_setup(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
|
2014 | 2057 |
|
2015 | 2058 | qed_spq_register_async_cb(p_hwfn, PROTOCOLID_IWARP,
|
2016 | 2059 | qed_iwarp_async_event);
|
| 2060 | + qed_ooo_setup(p_hwfn); |
2017 | 2061 |
|
2018 | 2062 | return qed_iwarp_ll2_start(p_hwfn, params, p_ptt);
|
2019 | 2063 | }
|
|
0 commit comments