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