Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/if_ixl.c
Show First 20 Lines • Show All 5,909 Lines • ▼ Show 20 Lines | for (i = 0; i < map->num_vectors; i++) { | ||||
ixl_vf_config_vector(pf, vf, vector); | ixl_vf_config_vector(pf, vf, vector); | ||||
} | } | ||||
ixl_send_vf_ack(pf, vf, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP); | ixl_send_vf_ack(pf, vf, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP); | ||||
} | } | ||||
static void | static void | ||||
ixl_vf_enable_queues_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, | |||||
uint16_t msg_size) | |||||
{ | |||||
struct i40e_virtchnl_queue_select *select; | |||||
int error; | |||||
if (msg_size != sizeof(*select)) { | |||||
i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_ENABLE_QUEUES, | |||||
I40E_ERR_PARAM); | |||||
return; | |||||
} | |||||
select = msg; | |||||
if (select->vsi_id != vf->vsi.vsi_num || | |||||
select->rx_queues == 0 || select->tx_queues == 0) { | |||||
i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_ENABLE_QUEUES, | |||||
I40E_ERR_PARAM); | |||||
return; | |||||
} | |||||
error = ixl_enable_rings(&vf->vsi); | |||||
if (error) { | |||||
i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_ENABLE_QUEUES, | |||||
I40E_ERR_TIMEOUT); | |||||
return; | |||||
} | |||||
ixl_send_vf_ack(pf, vf, I40E_VIRTCHNL_OP_ENABLE_QUEUES); | |||||
} | |||||
static void | |||||
ixl_vf_disable_queues_msg(struct ixl_pf *pf, struct ixl_vf *vf, | |||||
void *msg, uint16_t msg_size) | |||||
{ | |||||
struct i40e_virtchnl_queue_select *select; | |||||
int error; | |||||
if (msg_size != sizeof(*select)) { | |||||
i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_DISABLE_QUEUES, | |||||
I40E_ERR_PARAM); | |||||
return; | |||||
} | |||||
select = msg; | |||||
if (select->vsi_id != vf->vsi.vsi_num || | |||||
select->rx_queues == 0 || select->tx_queues == 0) { | |||||
i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_DISABLE_QUEUES, | |||||
I40E_ERR_PARAM); | |||||
return; | |||||
} | |||||
error = ixl_disable_rings(&vf->vsi); | |||||
if (error) { | |||||
i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_DISABLE_QUEUES, | |||||
I40E_ERR_TIMEOUT); | |||||
return; | |||||
} | |||||
ixl_send_vf_ack(pf, vf, I40E_VIRTCHNL_OP_DISABLE_QUEUES); | |||||
} | |||||
static void | |||||
ixl_handle_vf_msg(struct ixl_pf *pf, struct i40e_arq_event_info *event) | ixl_handle_vf_msg(struct ixl_pf *pf, struct i40e_arq_event_info *event) | ||||
{ | { | ||||
struct ixl_vf *vf; | struct ixl_vf *vf; | ||||
void *msg; | void *msg; | ||||
uint16_t vf_num, msg_size; | uint16_t vf_num, msg_size; | ||||
uint32_t opcode; | uint32_t opcode; | ||||
vf_num = le16toh(event->desc.retval); | vf_num = le16toh(event->desc.retval); | ||||
Show All 28 Lines | ixl_handle_vf_msg(struct ixl_pf *pf, struct i40e_arq_event_info *event) | ||||
case I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE: | case I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE: | ||||
ixl_vf_config_rx_msg(pf, vf, msg, msg_size); | ixl_vf_config_rx_msg(pf, vf, msg, msg_size); | ||||
break; | break; | ||||
case I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES: | case I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES: | ||||
ixl_vf_config_vsi_msg(pf, vf, msg, msg_size); | ixl_vf_config_vsi_msg(pf, vf, msg, msg_size); | ||||
break; | break; | ||||
case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP: | case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP: | ||||
ixl_vf_config_irq_msg(pf, vf, msg, msg_size); | ixl_vf_config_irq_msg(pf, vf, msg, msg_size); | ||||
break; | |||||
case I40E_VIRTCHNL_OP_ENABLE_QUEUES: | |||||
ixl_vf_enable_queues_msg(pf, vf, msg, msg_size); | |||||
break; | |||||
case I40E_VIRTCHNL_OP_DISABLE_QUEUES: | |||||
ixl_vf_disable_queues_msg(pf, vf, msg, msg_size); | |||||
break; | break; | ||||
default: | default: | ||||
i40e_send_vf_nack(pf, vf, opcode, I40E_ERR_NOT_IMPLEMENTED); | i40e_send_vf_nack(pf, vf, opcode, I40E_ERR_NOT_IMPLEMENTED); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |