@@ -1435,6 +1435,62 @@ vrb_queue_intr_disable(struct rte_bbdev *dev, uint16_t queue_id)
14351435 return 0 ;
14361436}
14371437
1438+ static int
1439+ vrb_queue_ops_dump (struct rte_bbdev * dev , uint16_t queue_id , FILE * f )
1440+ {
1441+ struct acc_queue * q = dev -> data -> queues [queue_id ].queue_private ;
1442+ struct rte_bbdev_dec_op * op ;
1443+ uint16_t i , int_nb ;
1444+ volatile union acc_info_ring_data * ring_data ;
1445+ uint16_t info_ring_head = q -> d -> info_ring_head ;
1446+ static char str [1024 ];
1447+
1448+ if (f == NULL ) {
1449+ rte_bbdev_log (ERR , "Invalid File input" );
1450+ return - EINVAL ;
1451+ }
1452+
1453+ /** Print generic information on queue status. */
1454+ fprintf (f , "Dump of operations %s on Queue %d by %s\n" ,
1455+ rte_bbdev_op_type_str (q -> op_type ), queue_id , dev -> device -> driver -> name );
1456+ fprintf (f , " AQ Enqueued %d Dequeued %d Depth %d - Available Enq %d Deq %d\n" ,
1457+ q -> aq_enqueued , q -> aq_dequeued , q -> aq_depth ,
1458+ acc_ring_avail_enq (q ), acc_ring_avail_deq (q ));
1459+
1460+ /** Print information captured in the info ring. */
1461+ if (q -> d -> info_ring != NULL ) {
1462+ fprintf (f , "Info Ring Buffer - Head %d\n" , q -> d -> info_ring_head );
1463+ ring_data = q -> d -> info_ring + (q -> d -> info_ring_head & ACC_INFO_RING_MASK );
1464+ while (ring_data -> valid ) {
1465+ int_nb = int_from_ring (* ring_data , q -> d -> device_variant );
1466+ if ((int_nb < ACC_PF_INT_DMA_DL_DESC_IRQ ) || (
1467+ int_nb > ACC_PF_INT_DMA_MLD_DESC_IRQ )) {
1468+ fprintf (f , " InfoRing: ITR:%d Info:0x%x" ,
1469+ int_nb , ring_data -> detailed_info );
1470+ /* Initialize Info Ring entry and move forward. */
1471+ ring_data -> valid = 0 ;
1472+ }
1473+ info_ring_head ++ ;
1474+ ring_data = q -> d -> info_ring + (info_ring_head & ACC_INFO_RING_MASK );
1475+ }
1476+ }
1477+
1478+ fprintf (f , "Ring Content - Head %d Tail %d Depth %d\n" ,
1479+ q -> sw_ring_head , q -> sw_ring_tail , q -> sw_ring_depth );
1480+ /** Print information about each operation in the software ring. */
1481+ for (i = 0 ; i < q -> sw_ring_depth ; ++ i ) {
1482+ op = (q -> ring_addr + i )-> req .op_addr ;
1483+ if (op != NULL )
1484+ fprintf (f , " %d\tn %d %s" , i , (q -> ring_addr + i )-> req .numCBs ,
1485+ rte_bbdev_ops_param_string (op , q -> op_type ,
1486+ str , sizeof (str )));
1487+ }
1488+
1489+ fprintf (f , "== End of File ==\n" );
1490+
1491+ return 0 ;
1492+ }
1493+
14381494static const struct rte_bbdev_ops vrb_bbdev_ops = {
14391495 .setup_queues = vrb_setup_queues ,
14401496 .intr_enable = vrb_intr_enable ,
@@ -1444,7 +1500,8 @@ static const struct rte_bbdev_ops vrb_bbdev_ops = {
14441500 .queue_release = vrb_queue_release ,
14451501 .queue_stop = vrb_queue_stop ,
14461502 .queue_intr_enable = vrb_queue_intr_enable ,
1447- .queue_intr_disable = vrb_queue_intr_disable
1503+ .queue_intr_disable = vrb_queue_intr_disable ,
1504+ .queue_ops_dump = vrb_queue_ops_dump
14481505};
14491506
14501507/* PCI PF address map. */
0 commit comments