@@ -384,7 +384,8 @@ static inline int is_hmac(struct crypto_tfm *tfm)
384
384
385
385
static void write_phys_cpl (struct cpl_rx_phys_dsgl * phys_cpl ,
386
386
struct scatterlist * sg ,
387
- struct phys_sge_parm * sg_param )
387
+ struct phys_sge_parm * sg_param ,
388
+ int pci_chan_id )
388
389
{
389
390
struct phys_sge_pairs * to ;
390
391
unsigned int len = 0 , left_size = sg_param -> obsize ;
@@ -402,6 +403,7 @@ static void write_phys_cpl(struct cpl_rx_phys_dsgl *phys_cpl,
402
403
phys_cpl -> rss_hdr_int .opcode = CPL_RX_PHYS_ADDR ;
403
404
phys_cpl -> rss_hdr_int .qid = htons (sg_param -> qid );
404
405
phys_cpl -> rss_hdr_int .hash_val = 0 ;
406
+ phys_cpl -> rss_hdr_int .channel = pci_chan_id ;
405
407
to = (struct phys_sge_pairs * )((unsigned char * )phys_cpl +
406
408
sizeof (struct cpl_rx_phys_dsgl ));
407
409
for (i = 0 ; nents && left_size ; to ++ ) {
@@ -418,7 +420,8 @@ static void write_phys_cpl(struct cpl_rx_phys_dsgl *phys_cpl,
418
420
static inline int map_writesg_phys_cpl (struct device * dev ,
419
421
struct cpl_rx_phys_dsgl * phys_cpl ,
420
422
struct scatterlist * sg ,
421
- struct phys_sge_parm * sg_param )
423
+ struct phys_sge_parm * sg_param ,
424
+ int pci_chan_id )
422
425
{
423
426
if (!sg || !sg_param -> nents )
424
427
return - EINVAL ;
@@ -428,7 +431,7 @@ static inline int map_writesg_phys_cpl(struct device *dev,
428
431
pr_err ("CHCR : DMA mapping failed\n" );
429
432
return - EINVAL ;
430
433
}
431
- write_phys_cpl (phys_cpl , sg , sg_param );
434
+ write_phys_cpl (phys_cpl , sg , sg_param , pci_chan_id );
432
435
return 0 ;
433
436
}
434
437
@@ -608,7 +611,7 @@ static inline void create_wreq(struct chcr_context *ctx,
608
611
is_iv ? iv_loc : IV_NOP , !!lcb ,
609
612
ctx -> tx_qidx );
610
613
611
- chcr_req -> ulptx .cmd_dest = FILL_ULPTX_CMD_DEST (ctx -> dev -> tx_channel_id ,
614
+ chcr_req -> ulptx .cmd_dest = FILL_ULPTX_CMD_DEST (ctx -> tx_chan_id ,
612
615
qid );
613
616
chcr_req -> ulptx .len = htonl ((DIV_ROUND_UP ((calc_tx_flits_ofld (skb ) * 8 ),
614
617
16 ) - ((sizeof (chcr_req -> wreq )) >> 4 )));
@@ -698,7 +701,8 @@ static struct sk_buff *create_cipher_wr(struct cipher_wr_param *wrparam)
698
701
sg_param .obsize = wrparam -> bytes ;
699
702
sg_param .qid = wrparam -> qid ;
700
703
error = map_writesg_phys_cpl (& u_ctx -> lldi .pdev -> dev , phys_cpl ,
701
- reqctx -> dst , & sg_param );
704
+ reqctx -> dst , & sg_param ,
705
+ ctx -> pci_chan_id );
702
706
if (error )
703
707
goto map_fail1 ;
704
708
@@ -1228,16 +1232,23 @@ static int chcr_device_init(struct chcr_context *ctx)
1228
1232
adap -> vres .ncrypto_fc );
1229
1233
rxq_perchan = u_ctx -> lldi .nrxq / u_ctx -> lldi .nchan ;
1230
1234
txq_perchan = ntxq / u_ctx -> lldi .nchan ;
1231
- rxq_idx = ctx -> dev -> tx_channel_id * rxq_perchan ;
1232
- rxq_idx += id % rxq_perchan ;
1233
- txq_idx = ctx -> dev -> tx_channel_id * txq_perchan ;
1234
- txq_idx += id % txq_perchan ;
1235
1235
spin_lock (& ctx -> dev -> lock_chcr_dev );
1236
- ctx -> rx_qidx = rxq_idx ;
1237
- ctx -> tx_qidx = txq_idx ;
1236
+ ctx -> tx_chan_id = ctx -> dev -> tx_channel_id ;
1238
1237
ctx -> dev -> tx_channel_id = !ctx -> dev -> tx_channel_id ;
1239
1238
ctx -> dev -> rx_channel_id = 0 ;
1240
1239
spin_unlock (& ctx -> dev -> lock_chcr_dev );
1240
+ rxq_idx = ctx -> tx_chan_id * rxq_perchan ;
1241
+ rxq_idx += id % rxq_perchan ;
1242
+ txq_idx = ctx -> tx_chan_id * txq_perchan ;
1243
+ txq_idx += id % txq_perchan ;
1244
+ ctx -> rx_qidx = rxq_idx ;
1245
+ ctx -> tx_qidx = txq_idx ;
1246
+ /* Channel Id used by SGE to forward packet to Host.
1247
+ * Same value should be used in cpl_fw6_pld RSS_CH field
1248
+ * by FW. Driver programs PCI channel ID to be used in fw
1249
+ * at the time of queue allocation with value "pi->tx_chan"
1250
+ */
1251
+ ctx -> pci_chan_id = txq_idx / txq_perchan ;
1241
1252
}
1242
1253
out :
1243
1254
return err ;
@@ -2066,7 +2077,8 @@ static struct sk_buff *create_authenc_wr(struct aead_request *req,
2066
2077
sg_param .obsize = req -> cryptlen + (op_type ? - authsize : authsize );
2067
2078
sg_param .qid = qid ;
2068
2079
error = map_writesg_phys_cpl (& u_ctx -> lldi .pdev -> dev , phys_cpl ,
2069
- reqctx -> dst , & sg_param );
2080
+ reqctx -> dst , & sg_param ,
2081
+ ctx -> pci_chan_id );
2070
2082
if (error )
2071
2083
goto dstmap_fail ;
2072
2084
@@ -2389,7 +2401,7 @@ static struct sk_buff *create_aead_ccm_wr(struct aead_request *req,
2389
2401
sg_param .obsize = req -> cryptlen + (op_type ? - authsize : authsize );
2390
2402
sg_param .qid = qid ;
2391
2403
error = map_writesg_phys_cpl (& u_ctx -> lldi .pdev -> dev , phys_cpl ,
2392
- reqctx -> dst , & sg_param );
2404
+ reqctx -> dst , & sg_param , ctx -> pci_chan_id );
2393
2405
if (error )
2394
2406
goto dstmap_fail ;
2395
2407
@@ -2545,7 +2557,8 @@ static struct sk_buff *create_gcm_wr(struct aead_request *req,
2545
2557
sg_param .obsize = req -> cryptlen + (op_type ? - authsize : authsize );
2546
2558
sg_param .qid = qid ;
2547
2559
error = map_writesg_phys_cpl (& u_ctx -> lldi .pdev -> dev , phys_cpl ,
2548
- reqctx -> dst , & sg_param );
2560
+ reqctx -> dst , & sg_param ,
2561
+ ctx -> pci_chan_id );
2549
2562
if (error )
2550
2563
goto dstmap_fail ;
2551
2564
0 commit comments