src/dpdk/drivers/net/hinic/base/hinic_pmd_eqs.c
static int
hinic_aeqs_init(struct hinic_hwdev *hwdev, u16 num_aeqs,
		struct irq_info *msix_entries)
{
	struct hinic_aeqs *aeqs;
	int err;
	u16 i, q_id;

	aeqs = kzalloc(sizeof(*aeqs), GFP_KERNEL);
	if (!aeqs)
		return -ENOMEM;

	hwdev->aeqs = aeqs;
	aeqs->hwdev = hwdev;
	aeqs->num_aeqs = num_aeqs;

	for (q_id = HINIC_AEQN_START; q_id < num_aeqs; q_id++) {
		err = init_aeq(&aeqs->aeq[q_id], hwdev, q_id,
			      HINIC_DEFAULT_AEQ_LEN, HINIC_EQ_PAGE_SIZE,
			      &msix_entries[q_id]);
		if (err) {
			PMD_DRV_LOG(ERR, "Init aeq %d failed", q_id);
			goto init_aeq_err;
		}
	}

	return 0;

init_aeq_err:
	for (i = 0; i < q_id; i++)
		remove_aeq(&aeqs->aeq[i]);

	kfree(aeqs);

	return err;
}
/**
 * hinic_aeqs_init - init all the aeqs
 * @hwdev: the pointer to the private hardware device object
 * @num_aeqs: number of aeq
 * @msix_entries: msix entries associated with the event queues
 * Return: 0 - Success, Negative - failure
 */
init all the aeqs
@hwdev: the pointer to the private hardware device object
@num_aeqs: number of aeq
@msix_entries: msix entries associated with the event queues
Return: 0 - Success, Negative - failure
init all the aeqs @hwdev : the pointer to the private hardware device object @num_aeqs : number of aeq @msix_entries : msix entries associated with the event queues Return : 0 - Success Negative - failure
static int
hinic_aeqs_init(struct hinic_hwdev *hwdev, u16 num_aeqs,
		struct irq_info *msix_entries)
{
	struct hinic_aeqs *aeqs;
	int err;
	u16 i, q_id;
	aeqs = kzalloc(sizeof(*aeqs), GFP_KERNEL);
	if (!aeqs)
		return -ENOMEM;
	hwdev->aeqs = aeqs;
	aeqs->hwdev = hwdev;
	aeqs->num_aeqs = num_aeqs;
	for (q_id = HINIC_AEQN_START; q_id < num_aeqs; q_id++) {
		err = init_aeq(&aeqs->aeq[q_id], hwdev, q_id,
			      HINIC_DEFAULT_AEQ_LEN, HINIC_EQ_PAGE_SIZE,
			      &msix_entries[q_id]);
		if (err) {
			PMD_DRV_LOG(ERR, "Init aeq %d failed", q_id);
			goto init_aeq_err;
		}
	}
	return 0;
init_aeq_err:
	for (i = 0; i < q_id; i++)
		remove_aeq(&aeqs->aeq[i]);
	kfree(aeqs);
	return err;
}
static int hinic_aeqs_init ( struct hinic_hwdev * hwdev , u16 num_aeqs , struct irq_info * msix_entries ) { struct hinic_aeqs * aeqs ; int err ; u16 i , q_id ; aeqs = kzalloc ( sizeof ( * aeqs ) , GFP_KERNEL ) ; if ( ! aeqs ) return - ENOMEM ; hwdev -> aeqs = aeqs ; aeqs -> hwdev = hwdev ; aeqs -> num_aeqs = num_aeqs ; for ( q_id = HINIC_AEQN_START ; q_id < num_aeqs ; q_id ++ ) { err = init_aeq ( & aeqs -> aeq [ q_id ] , hwdev , q_id , HINIC_DEFAULT_AEQ_LEN , HINIC_EQ_PAGE_SIZE , & msix_entries [ q_id ] ) ; if ( err ) { PMD_DRV_LOG ( ERR , " " , q_id ) ; goto init_aeq_err ; } } return 0 ; init_aeq_err : for ( i = 0 ; i < q_id ; i ++ ) remove_aeq ( & aeqs -> aeq [ i ] ) ; kfree ( aeqs ) ; return err ; }
hinic_aeqs_init - init all the aeqs
 @hwdev: the pointer to the private hardware device object
 @num_aeqs: number of aeq
 @msix_entries: msix entries associated with the event queues
 Return: 0 - Success, Negative - failure
hinic_aeqs_init - init all the aeqs @hwdev : the pointer to the private hardware device object @num_aeqs : number of aeq @msix_entries : msix entries associated with the event queues Return : 0 - Success Negative - failure