@@ -110,6 +110,7 @@ struct src_ent {
110
110
ALIGNED_TYPE_SIZE(union conn_context, p_hwfn)
111
111
112
112
#define SRQ_CXT_SIZE (sizeof(struct rdma_srq_context))
113
+ #define XRC_SRQ_CXT_SIZE (sizeof(struct rdma_xrc_srq_context))
113
114
114
115
#define TYPE0_TASK_CXT_SIZE (p_hwfn ) \
115
116
ALIGNED_TYPE_SIZE(union type0_task_context, p_hwfn)
@@ -293,18 +294,40 @@ static struct qed_tid_seg *qed_cxt_tid_seg_info(struct qed_hwfn *p_hwfn,
293
294
return NULL ;
294
295
}
295
296
296
- static void qed_cxt_set_srq_count (struct qed_hwfn * p_hwfn , u32 num_srqs )
297
+ static void qed_cxt_set_srq_count (struct qed_hwfn * p_hwfn ,
298
+ u32 num_srqs , u32 num_xrc_srqs )
297
299
{
298
300
struct qed_cxt_mngr * p_mgr = p_hwfn -> p_cxt_mngr ;
299
301
300
302
p_mgr -> srq_count = num_srqs ;
303
+ p_mgr -> xrc_srq_count = num_xrc_srqs ;
301
304
}
302
305
303
- u32 qed_cxt_get_srq_count (struct qed_hwfn * p_hwfn )
306
+ u32 qed_cxt_get_ilt_page_size (struct qed_hwfn * p_hwfn ,
307
+ enum ilt_clients ilt_client )
308
+ {
309
+ struct qed_cxt_mngr * p_mngr = p_hwfn -> p_cxt_mngr ;
310
+ struct qed_ilt_client_cfg * p_cli = & p_mngr -> clients [ilt_client ];
311
+
312
+ return ILT_PAGE_IN_BYTES (p_cli -> p_size .val );
313
+ }
314
+
315
+ static u32 qed_cxt_xrc_srqs_per_page (struct qed_hwfn * p_hwfn )
316
+ {
317
+ u32 page_size ;
318
+
319
+ page_size = qed_cxt_get_ilt_page_size (p_hwfn , ILT_CLI_TSDM );
320
+ return page_size / XRC_SRQ_CXT_SIZE ;
321
+ }
322
+
323
+ u32 qed_cxt_get_total_srq_count (struct qed_hwfn * p_hwfn )
304
324
{
305
325
struct qed_cxt_mngr * p_mgr = p_hwfn -> p_cxt_mngr ;
326
+ u32 total_srqs ;
327
+
328
+ total_srqs = p_mgr -> srq_count + p_mgr -> xrc_srq_count ;
306
329
307
- return p_mgr -> srq_count ;
330
+ return total_srqs ;
308
331
}
309
332
310
333
/* set the iids count per protocol */
@@ -692,7 +715,7 @@ int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn, u32 *line_count)
692
715
}
693
716
694
717
/* TSDM (SRQ CONTEXT) */
695
- total = qed_cxt_get_srq_count (p_hwfn );
718
+ total = qed_cxt_get_total_srq_count (p_hwfn );
696
719
697
720
if (total ) {
698
721
p_cli = qed_cxt_set_cli (& p_mngr -> clients [ILT_CLI_TSDM ]);
@@ -1962,11 +1985,9 @@ static void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
1962
1985
struct qed_rdma_pf_params * p_params ,
1963
1986
u32 num_tasks )
1964
1987
{
1965
- u32 num_cons , num_qps , num_srqs ;
1988
+ u32 num_cons , num_qps ;
1966
1989
enum protocol_type proto ;
1967
1990
1968
- num_srqs = min_t (u32 , QED_RDMA_MAX_SRQS , p_params -> num_srqs );
1969
-
1970
1991
if (p_hwfn -> mcp_info -> func_info .protocol == QED_PCI_ETH_RDMA ) {
1971
1992
DP_NOTICE (p_hwfn ,
1972
1993
"Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only\n" );
@@ -1989,6 +2010,8 @@ static void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
1989
2010
}
1990
2011
1991
2012
if (num_cons && num_tasks ) {
2013
+ u32 num_srqs , num_xrc_srqs ;
2014
+
1992
2015
qed_cxt_set_proto_cid_count (p_hwfn , proto , num_cons , 0 );
1993
2016
1994
2017
/* Deliberatly passing ROCE for tasks id. This is because
@@ -1997,7 +2020,13 @@ static void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
1997
2020
qed_cxt_set_proto_tid_count (p_hwfn , PROTOCOLID_ROCE ,
1998
2021
QED_CXT_ROCE_TID_SEG , 1 ,
1999
2022
num_tasks , false);
2000
- qed_cxt_set_srq_count (p_hwfn , num_srqs );
2023
+
2024
+ num_srqs = min_t (u32 , QED_RDMA_MAX_SRQS , p_params -> num_srqs );
2025
+
2026
+ /* XRC SRQs populate a single ILT page */
2027
+ num_xrc_srqs = qed_cxt_xrc_srqs_per_page (p_hwfn );
2028
+
2029
+ qed_cxt_set_srq_count (p_hwfn , num_srqs , num_xrc_srqs );
2001
2030
} else {
2002
2031
DP_INFO (p_hwfn -> cdev ,
2003
2032
"RDMA personality used without setting params!\n" );
@@ -2163,10 +2192,17 @@ qed_cxt_dynamic_ilt_alloc(struct qed_hwfn *p_hwfn,
2163
2192
p_blk = & p_cli -> pf_blks [CDUC_BLK ];
2164
2193
break ;
2165
2194
case QED_ELEM_SRQ :
2195
+ /* The first ILT page is not used for regular SRQs. Skip it. */
2196
+ iid += p_hwfn -> p_cxt_mngr -> xrc_srq_count ;
2166
2197
p_cli = & p_hwfn -> p_cxt_mngr -> clients [ILT_CLI_TSDM ];
2167
2198
elem_size = SRQ_CXT_SIZE ;
2168
2199
p_blk = & p_cli -> pf_blks [SRQ_BLK ];
2169
2200
break ;
2201
+ case QED_ELEM_XRC_SRQ :
2202
+ p_cli = & p_hwfn -> p_cxt_mngr -> clients [ILT_CLI_TSDM ];
2203
+ elem_size = XRC_SRQ_CXT_SIZE ;
2204
+ p_blk = & p_cli -> pf_blks [SRQ_BLK ];
2205
+ break ;
2170
2206
case QED_ELEM_TASK :
2171
2207
p_cli = & p_hwfn -> p_cxt_mngr -> clients [ILT_CLI_CDUT ];
2172
2208
elem_size = TYPE1_TASK_CXT_SIZE (p_hwfn );
@@ -2386,8 +2422,12 @@ int qed_cxt_free_proto_ilt(struct qed_hwfn *p_hwfn, enum protocol_type proto)
2386
2422
return rc ;
2387
2423
2388
2424
/* Free TSDM CXT */
2389
- rc = qed_cxt_free_ilt_range (p_hwfn , QED_ELEM_SRQ , 0 ,
2390
- qed_cxt_get_srq_count (p_hwfn ));
2425
+ rc = qed_cxt_free_ilt_range (p_hwfn , QED_ELEM_XRC_SRQ , 0 ,
2426
+ p_hwfn -> p_cxt_mngr -> xrc_srq_count );
2427
+
2428
+ rc = qed_cxt_free_ilt_range (p_hwfn , QED_ELEM_SRQ ,
2429
+ p_hwfn -> p_cxt_mngr -> xrc_srq_count ,
2430
+ p_hwfn -> p_cxt_mngr -> srq_count );
2391
2431
2392
2432
return rc ;
2393
2433
}
0 commit comments