FreeBSD/sys/dev/ixl/ixlvc.c
/*
** ixlv_map_queues
**
** Request that the PF map queues to interrupt vectors. Misc causes, including
** admin queue, are always mapped to vector 0.
*/
ixlv_map_queues
Request that the PF map queues to interrupt vectors. Misc causes, including
admin queue, are always mapped to vector 0.
ixlv_map_queues Request that the PF map queues to interrupt vectors . Misc causes including admin queue are always mapped to vector 0 .
void
ixlv_map_queues(struct ixlv_sc *sc)
{
	struct i40e_virtchnl_irq_map_info *vm;
	int 			i, q, len;
	struct ixl_vsi		*vsi = &sc->vsi;
	struct ixl_queue	*que = vsi->queues;
	q = sc->msix - 1;
	len = sizeof(struct i40e_virtchnl_irq_map_info) +
	      (sc->msix * sizeof(struct i40e_virtchnl_vector_map));
	vm = malloc(len, M_DEVBUF, M_NOWAIT);
	if (!vm) {
		printf("%s: unable to allocate memory\n", __func__);
		ixl_vc_schedule_retry(&sc->vc_mgr);
		return;
	}
	vm->num_vectors = sc->msix;
	for (i = 0; i < q; i++, que++) {
		vm->vecmap[i].vsi_id = sc->vsi_res->vsi_id;
		vm->vecmap[i].vector_id = i + 1; 
		vm->vecmap[i].txq_map = (1 << que->me);
		vm->vecmap[i].rxq_map = (1 << que->me);
		vm->vecmap[i].rxitr_idx = 0;
		vm->vecmap[i].txitr_idx = 1;
	}
	vm->vecmap[i].vsi_id = sc->vsi_res->vsi_id;
	vm->vecmap[i].vector_id = 0;
	vm->vecmap[i].txq_map = 0;
	vm->vecmap[i].rxq_map = 0;
	vm->vecmap[i].rxitr_idx = 0;
	vm->vecmap[i].txitr_idx = 0;
	ixlv_send_pf_msg(sc, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP,
	    (u8 *)vm, len);
	free(vm, M_DEVBUF);
}
void ixlv_map_queues ( struct ixlv_sc * sc ) { struct i40e_virtchnl_irq_map_info * vm ; int i , q , len ; struct ixl_vsi * vsi = & sc -> vsi ; struct ixl_queue * que = vsi -> queues ; q = sc -> msix - 1 ; len = sizeof ( struct i40e_virtchnl_irq_map_info ) + ( sc -> msix * sizeof ( struct i40e_virtchnl_vector_map ) ) ; vm = malloc ( len , M_DEVBUF , M_NOWAIT ) ; if ( ! vm ) { printf ( " \n " , __func__ ) ; ixl_vc_schedule_retry ( & sc -> vc_mgr ) ; return ; } vm -> num_vectors = sc -> msix ; for ( i = 0 ; i < q ; i ++ , que ++ ) { vm -> vecmap [ i ] . vsi_id = sc -> vsi_res -> vsi_id ; vm -> vecmap [ i ] . vector_id = i + 1 ; vm -> vecmap [ i ] . txq_map = ( 1 << que -> me ) ; vm -> vecmap [ i ] . rxq_map = ( 1 << que -> me ) ; vm -> vecmap [ i ] . rxitr_idx = 0 ; vm -> vecmap [ i ] . txitr_idx = 1 ; } vm -> vecmap [ i ] . vsi_id = sc -> vsi_res -> vsi_id ; vm -> vecmap [ i ] . vector_id = 0 ; vm -> vecmap [ i ] . txq_map = 0 ; vm -> vecmap [ i ] . rxq_map = 0 ; vm -> vecmap [ i ] . rxitr_idx = 0 ; vm -> vecmap [ i ] . txitr_idx = 0 ; ixlv_send_pf_msg ( sc , I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP , ( u8 * ) vm , len ) ; free ( vm , M_DEVBUF ) ; }
ixlv_map_queues
Request that the PF map queues to interrupt vectors.
ixlv_map_queues Request that the PF map queues to interrupt vectors .
/* How many queue vectors, adminq uses one */ /* Queue vectors first */ /* first is adminq */ /* Misc vector last - this is only for AdminQ messages */