while (1) { /* When the AQ is empty, iavf_clean_arq_element will return *nonzeroandthisloopwillterminate.
*/
status = iavf_clean_arq_element(hw, event, NULL); if (status != IAVF_SUCCESS) return iavf_status_to_errno(status);
received_op =
(enum virtchnl_ops)le32_to_cpu(event->desc.cookie_high);
if (vpe->event != VIRTCHNL_EVENT_RESET_IMPENDING) continue;
dev_info(&adapter->pdev->dev, "Reset indication received from the PF\n"); if (!(adapter->flags & IAVF_FLAG_RESET_PENDING))
iavf_schedule_reset(adapter,
IAVF_FLAG_RESET_PENDING);
dev_info(&adapter->pdev->dev, "Received %d queues, but can only have a max of %d\n",
adapter->vf_res->num_queue_pairs,
IAVF_MAX_REQ_QUEUES);
dev_info(&adapter->pdev->dev, "Fixing by reducing queues to %d\n",
IAVF_MAX_REQ_QUEUES);
adapter->vf_res->num_queue_pairs = IAVF_MAX_REQ_QUEUES; for (i = 0; i < adapter->vf_res->num_vsis; i++) {
vsi_res = &adapter->vf_res->vsi_res[i];
vsi_res->num_queue_pairs = IAVF_MAX_REQ_QUEUES;
}
}
}
/* some PFs send more queues than we should have so validate that *wearen'tgettingtoomanyqueues
*/ if (!err)
iavf_validate_num_queues(adapter);
iavf_vf_parse_hw_config(hw, adapter->vf_res);
kfree(event.msg_buf);
return err;
}
int iavf_get_vf_vlan_v2_caps(struct iavf_adapter *adapter)
{ struct iavf_arq_event_info event; int err;
u16 len;
len = sizeof(struct virtchnl_vlan_caps);
event.buf_len = len;
event.msg_buf = kzalloc(len, GFP_KERNEL); if (!event.msg_buf) return -ENOMEM;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot map queues to vectors, command %d pending\n",
adapter->current_op); return;
}
adapter->current_op = VIRTCHNL_OP_CONFIG_IRQ_MAP;
/** *iavf_add_ether_addrs *@adapter:adapterstructure * *RequestthatthePFaddoneormoreaddressestoourfilters.
**/ void iavf_add_ether_addrs(struct iavf_adapter *adapter)
{ struct virtchnl_ether_addr_list *veal; struct iavf_mac_filter *f; int i = 0, count = 0; bool more = false;
size_t len;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot add filters, command %d pending\n",
adapter->current_op); return;
}
spin_lock_bh(&adapter->mac_vlan_list_lock);
list_for_each_entry(f, &adapter->mac_filter_list, list) { if (f->add)
count++;
} if (!count) {
adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_MAC_FILTER;
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
adapter->current_op = VIRTCHNL_OP_ADD_ETH_ADDR;
len = virtchnl_struct_size(veal, list, count); if (len > IAVF_MAX_AQ_BUF_SIZE) {
dev_warn(&adapter->pdev->dev, "Too many add MAC changes in one request\n"); while (len > IAVF_MAX_AQ_BUF_SIZE)
len = virtchnl_struct_size(veal, list, --count);
more = true;
}
veal = kzalloc(len, GFP_ATOMIC); if (!veal) {
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
veal->vsi_id = adapter->vsi_res->vsi_id;
veal->num_elements = count;
list_for_each_entry(f, &adapter->mac_filter_list, list) { if (f->add) {
ether_addr_copy(veal->list[i].addr, f->macaddr);
iavf_set_mac_addr_type(&veal->list[i], f);
i++;
f->add = false; if (i == count) break;
}
} if (!more)
adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_MAC_FILTER;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot remove filters, command %d pending\n",
adapter->current_op); return;
}
spin_lock_bh(&adapter->mac_vlan_list_lock);
list_for_each_entry(f, &adapter->mac_filter_list, list) { if (f->remove)
count++;
} if (!count) {
adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_MAC_FILTER;
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
adapter->current_op = VIRTCHNL_OP_DEL_ETH_ADDR;
len = virtchnl_struct_size(veal, list, count); if (len > IAVF_MAX_AQ_BUF_SIZE) {
dev_warn(&adapter->pdev->dev, "Too many delete MAC changes in one request\n"); while (len > IAVF_MAX_AQ_BUF_SIZE)
len = virtchnl_struct_size(veal, list, --count);
more = true;
}
veal = kzalloc(len, GFP_ATOMIC); if (!veal) {
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
veal->vsi_id = adapter->vsi_res->vsi_id;
veal->num_elements = count;
list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { if (f->remove) {
ether_addr_copy(veal->list[i].addr, f->macaddr);
iavf_set_mac_addr_type(&veal->list[i], f);
i++;
list_del(&f->list);
kfree(f); if (i == count) break;
}
} if (!more)
adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_MAC_FILTER;
/** *iavf_add_vlans *@adapter:adapterstructure * *RequestthatthePFaddoneormoreVLANfilterstoourVSI.
**/ void iavf_add_vlans(struct iavf_adapter *adapter)
{ int len, i = 0, count = 0; struct iavf_vlan_filter *f; bool more = false;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot add VLANs, command %d pending\n",
adapter->current_op); return;
}
if (VLAN_ALLOWED(adapter)) { struct virtchnl_vlan_filter_list *vvfl;
adapter->current_op = VIRTCHNL_OP_ADD_VLAN;
len = virtchnl_struct_size(vvfl, vlan_id, count); if (len > IAVF_MAX_AQ_BUF_SIZE) {
dev_warn(&adapter->pdev->dev, "Too many add VLAN changes in one request\n"); while (len > IAVF_MAX_AQ_BUF_SIZE)
len = virtchnl_struct_size(vvfl, vlan_id,
--count);
more = true;
}
vvfl = kzalloc(len, GFP_ATOMIC); if (!vvfl) {
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
vvfl->vsi_id = adapter->vsi_res->vsi_id;
vvfl->num_elements = count;
list_for_each_entry(f, &adapter->vlan_filter_list, list) { if (f->state == IAVF_VLAN_ADD) {
vvfl->vlan_id[i] = f->vlan.vid;
i++;
f->state = IAVF_VLAN_IS_NEW; if (i == count) break;
}
} if (!more)
adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_VLAN_FILTER;
if ((count + current_vlans) > max_vlans &&
current_vlans < max_vlans) {
count = max_vlans - iavf_get_num_vlans_added(adapter);
more = true;
}
len = virtchnl_struct_size(vvfl_v2, filters, count); if (len > IAVF_MAX_AQ_BUF_SIZE) {
dev_warn(&adapter->pdev->dev, "Too many add VLAN changes in one request\n"); while (len > IAVF_MAX_AQ_BUF_SIZE)
len = virtchnl_struct_size(vvfl_v2, filters,
--count);
more = true;
}
vvfl_v2 = kzalloc(len, GFP_ATOMIC); if (!vvfl_v2) {
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
/* give priority over outer if it's enabled */ if (filtering_support->outer)
vlan = &vvfl_v2->filters[i].outer; else
vlan = &vvfl_v2->filters[i].inner;
/** *iavf_del_vlans *@adapter:adapterstructure * *RequestthatthePFremoveoneormoreVLANfiltersfromourVSI.
**/ void iavf_del_vlans(struct iavf_adapter *adapter)
{ struct iavf_vlan_filter *f, *ftmp; int len, i = 0, count = 0; bool more = false;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot remove VLANs, command %d pending\n",
adapter->current_op); return;
}
spin_lock_bh(&adapter->mac_vlan_list_lock);
list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { /* since VLAN capabilities are not allowed, we dont want to send *aVLANdeleterequestbecauseitwillmostlikelyfailand *createunnecessaryerrors/noise,sojustfreetheVLAN *filtersmarkedforremovaltoenablebailingoutbefore *sendingavirtchnlmessage
*/ if (f->state == IAVF_VLAN_REMOVE &&
!VLAN_FILTERING_ALLOWED(adapter)) {
list_del(&f->list);
kfree(f);
adapter->num_vlan_filters--;
} elseif (f->state == IAVF_VLAN_DISABLE &&
!VLAN_FILTERING_ALLOWED(adapter)) {
f->state = IAVF_VLAN_INACTIVE;
} elseif (f->state == IAVF_VLAN_REMOVE ||
f->state == IAVF_VLAN_DISABLE) {
count++;
}
} if (!count || !VLAN_FILTERING_ALLOWED(adapter)) {
adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_VLAN_FILTER;
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
if (VLAN_ALLOWED(adapter)) { struct virtchnl_vlan_filter_list *vvfl;
adapter->current_op = VIRTCHNL_OP_DEL_VLAN;
len = virtchnl_struct_size(vvfl, vlan_id, count); if (len > IAVF_MAX_AQ_BUF_SIZE) {
dev_warn(&adapter->pdev->dev, "Too many delete VLAN changes in one request\n"); while (len > IAVF_MAX_AQ_BUF_SIZE)
len = virtchnl_struct_size(vvfl, vlan_id,
--count);
more = true;
}
vvfl = kzalloc(len, GFP_ATOMIC); if (!vvfl) {
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
vvfl->vsi_id = adapter->vsi_res->vsi_id;
vvfl->num_elements = count;
list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { if (f->state == IAVF_VLAN_DISABLE) {
vvfl->vlan_id[i] = f->vlan.vid;
f->state = IAVF_VLAN_INACTIVE;
i++; if (i == count) break;
} elseif (f->state == IAVF_VLAN_REMOVE) {
vvfl->vlan_id[i] = f->vlan.vid;
list_del(&f->list);
kfree(f);
adapter->num_vlan_filters--;
i++; if (i == count) break;
}
}
if (!more)
adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_VLAN_FILTER;
len = virtchnl_struct_size(vvfl_v2, filters, count); if (len > IAVF_MAX_AQ_BUF_SIZE) {
dev_warn(&adapter->pdev->dev, "Too many add VLAN changes in one request\n"); while (len > IAVF_MAX_AQ_BUF_SIZE)
len = virtchnl_struct_size(vvfl_v2, filters,
--count);
more = true;
}
vvfl_v2 = kzalloc(len, GFP_ATOMIC); if (!vvfl_v2) {
spin_unlock_bh(&adapter->mac_vlan_list_lock); return;
}
/* give priority over outer if it's enabled */ if (filtering_support->outer)
vlan = &vvfl_v2->filters[i].outer; else
vlan = &vvfl_v2->filters[i].inner;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot set promiscuous mode, command %d pending\n",
adapter->current_op); return;
}
/* prevent changes to promiscuous flags */
spin_lock_bh(&adapter->current_netdev_promisc_flags_lock);
/* sanity check to prevent duplicate AQ calls */ if (!iavf_promiscuous_mode_changed(adapter)) {
adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE;
dev_dbg(&adapter->pdev->dev, "No change in promiscuous mode\n"); /* allow changes to promiscuous flags */
spin_unlock_bh(&adapter->current_netdev_promisc_flags_lock); return;
}
/* there are 2 bits, but only 3 states */ if (!(netdev->flags & IFF_PROMISC) &&
netdev->flags & IFF_ALLMULTI) { /* State 1 - only multicast promiscuous mode enabled *-!IFF_PROMISC&&IFF_ALLMULTI
*/
flags = FLAG_VF_MULTICAST_PROMISC;
adapter->current_netdev_promisc_flags |= IFF_ALLMULTI;
adapter->current_netdev_promisc_flags &= ~IFF_PROMISC;
dev_info(&adapter->pdev->dev, "Entering multicast promiscuous mode\n");
} elseif (!(netdev->flags & IFF_PROMISC) &&
!(netdev->flags & IFF_ALLMULTI)) { /* State 2 - unicast/multicast promiscuous mode disabled *-!IFF_PROMISC&&!IFF_ALLMULTI
*/
flags = 0;
adapter->current_netdev_promisc_flags &=
~(IFF_PROMISC | IFF_ALLMULTI);
dev_info(&adapter->pdev->dev, "Leaving promiscuous mode\n");
} else { /* State 3 - unicast/multicast promiscuous mode enabled *-IFF_PROMISC&&IFF_ALLMULTI *-IFF_PROMISC&&!IFF_ALLMULTI
*/
flags = FLAG_VF_UNICAST_PROMISC | FLAG_VF_MULTICAST_PROMISC;
adapter->current_netdev_promisc_flags |= IFF_PROMISC; if (netdev->flags & IFF_ALLMULTI)
adapter->current_netdev_promisc_flags |= IFF_ALLMULTI; else
adapter->current_netdev_promisc_flags &= ~IFF_ALLMULTI;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* no error message, this isn't crucial */ return;
}
adapter->aq_required &= ~IAVF_FLAG_AQ_REQUEST_STATS;
adapter->current_op = VIRTCHNL_OP_GET_STATS;
vqs.vsi_id = adapter->vsi_res->vsi_id; /* queue maps are ignored for this message - only the vsi is used */ if (iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_STATS, (u8 *)&vqs, sizeof(vqs))) /* if the request failed, don't lock out others */
adapter->current_op = VIRTCHNL_OP_UNKNOWN;
}
/** *iavf_get_rss_hashcfg *@adapter:adapterstructure * *RequestRSSHashenablebitsfromPF
**/ void iavf_get_rss_hashcfg(struct iavf_adapter *adapter)
{ if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot get RSS hash capabilities, command %d pending\n",
adapter->current_op); return;
}
adapter->current_op = VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS;
adapter->aq_required &= ~IAVF_FLAG_AQ_GET_RSS_HASHCFG;
iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS, NULL, 0);
}
if (!adapter->ptp.clock) { /* This shouldn't be possible to hit, since no messages should *bequeuedifPTPisnotinitialized.
*/
pci_err(adapter->pdev, "PTP is not initialized\n");
adapter->aq_required &= ~IAVF_FLAG_AQ_SEND_PTP_CMD; return;
}
mutex_lock(&adapter->ptp.aq_cmd_lock);
cmd = list_first_entry_or_null(&adapter->ptp.aq_cmds, struct iavf_ptp_aq_cmd, list); if (!cmd) { /* no further PTP messages to send */
adapter->aq_required &= ~IAVF_FLAG_AQ_SEND_PTP_CMD; goto out_unlock;
}
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
pci_err(adapter->pdev, "Cannot send PTP command %d, command %d pending\n",
cmd->v_opcode, adapter->current_op); goto out_unlock;
}
err = iavf_send_pf_msg(adapter, cmd->v_opcode, cmd->msg, cmd->msglen); if (!err) { /* Command was sent without errors, so we can remove it from *thelistanddiscardit.
*/
list_del(&cmd->list);
kfree(cmd);
} else { /* We failed to send the command, try again next cycle */
pci_err(adapter->pdev, "Failed to send PTP command %d\n",
cmd->v_opcode);
}
if (list_empty(&adapter->ptp.aq_cmds)) /* no further PTP messages to send */
adapter->aq_required &= ~IAVF_FLAG_AQ_SEND_PTP_CMD;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot set queue quanta size, command %d pending\n",
adapter->current_op); return;
}
/* Set Queue Quanta Size to default */
iavf_set_quanta_size(adapter, quanta_size, 0,
adapter->num_active_queues);
}
/** *iavf_cfg_queues_bw-configurebandwidthofallocatedqueues *@adapter:iavfadapterstructureinstance * *ThisfunctionrequestsPFtoconfigurequeuebandwidthofallocatedqueues
*/ void iavf_cfg_queues_bw(struct iavf_adapter *adapter)
{ struct virtchnl_queues_bw_cfg *qs_bw_cfg; struct net_shaper *q_shaper; int qs_to_update = 0; int i, inx = 0;
size_t len;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot set tc queue bw, command %d pending\n",
adapter->current_op); return;
}
for (i = 0; i < adapter->num_active_queues; i++) { if (adapter->tx_rings[i].q_shaper_update)
qs_to_update++;
}
len = struct_size(qs_bw_cfg, cfg, qs_to_update);
qs_bw_cfg = kzalloc(len, GFP_KERNEL); if (!qs_bw_cfg) return;
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot configure mqprio, command %d pending\n",
adapter->current_op); return;
}
len = virtchnl_struct_size(vti, list, adapter->num_tc);
vti = kzalloc(len, GFP_KERNEL); if (!vti) return;
vti->num_tc = adapter->num_tc; for (i = 0; i < vti->num_tc; i++) {
vti->list[i].count = adapter->ch_config.ch_info[i].count;
vti->list[i].offset = adapter->ch_config.ch_info[i].offset;
vti->list[i].pad = 0;
vti->list[i].max_tx_rate =
adapter->ch_config.ch_info[i].max_tx_rate;
}
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot add Flow Director filter, command %d pending\n",
adapter->current_op); return;
}
len = sizeof(struct virtchnl_fdir_add);
f = kzalloc(len, GFP_KERNEL); if (!f) return;
if (!process_fltr) { /* prevent iavf_add_fdir_filter() from being called when there *arenofilterstoadd
*/
adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_FDIR_FILTER;
kfree(f); return;
}
adapter->current_op = VIRTCHNL_OP_ADD_FDIR_FILTER;
iavf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_FDIR_FILTER, (u8 *)f, len);
kfree(f);
}
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot remove Flow Director filter, command %d pending\n",
adapter->current_op); return;
}
switch (vpe->event) { case VIRTCHNL_EVENT_LINK_CHANGE:
iavf_set_adapter_link_speed_from_vpe(adapter, vpe);
/* we've already got the right link status, bail */ if (adapter->link_up == link_up) break;
if (link_up) { /* If we get link up message and start queues *beforeourqueuesareconfigureditwill *triggeraTXhang.Inthatcase,justignore *thelinkstatusmessage,we'llgetanotherone *afterweenablequeuesandactuallyprepared *tosendtraffic.
*/ if (adapter->state != __IAVF_RUNNING) break;
/* For ADq enabled VF, we reconfigure VSIs and *re-allocatequeues.Hencewaittillall *queuesareenabled.
*/ if (adapter->flags &
IAVF_FLAG_QUEUES_DISABLED) break;
}
adapter->link_up = link_up; if (link_up) {
netif_tx_start_all_queues(netdev);
netif_carrier_on(netdev);
} else {
netif_tx_stop_all_queues(netdev);
netif_carrier_off(netdev);
}
iavf_print_link_message(adapter); break; case VIRTCHNL_EVENT_RESET_IMPENDING:
dev_info(&adapter->pdev->dev, "Reset indication received from the PF\n"); if (!(adapter->flags & IAVF_FLAG_RESET_PENDING)) {
dev_info(&adapter->pdev->dev, "Scheduling reset task\n");
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_PENDING);
} break; default:
dev_err(&adapter->pdev->dev, "Unknown event %d from PF\n",
vpe->event); break;
} return;
} if (v_retval) { switch (v_opcode) { case VIRTCHNL_OP_ADD_VLAN:
dev_err(&adapter->pdev->dev, "Failed to add VLAN filter, error %s\n",
iavf_stat_str(&adapter->hw, v_retval)); break; case VIRTCHNL_OP_ADD_ETH_ADDR:
dev_err(&adapter->pdev->dev, "Failed to add MAC filter, error %s\n",
iavf_stat_str(&adapter->hw, v_retval));
iavf_mac_add_reject(adapter); /* restore administratively set MAC address */
ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr);
wake_up(&adapter->vc_waitqueue); break; case VIRTCHNL_OP_DEL_VLAN:
dev_err(&adapter->pdev->dev, "Failed to delete VLAN filter, error %s\n",
iavf_stat_str(&adapter->hw, v_retval)); break; case VIRTCHNL_OP_DEL_ETH_ADDR:
dev_err(&adapter->pdev->dev, "Failed to delete MAC filter, error %s\n",
iavf_stat_str(&adapter->hw, v_retval)); break; case VIRTCHNL_OP_ENABLE_CHANNELS:
dev_err(&adapter->pdev->dev, "Failed to configure queue channels, error %s\n",
iavf_stat_str(&adapter->hw, v_retval));
adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
adapter->ch_config.state = __IAVF_TC_INVALID;
netdev_reset_tc(netdev);
netif_tx_start_all_queues(netdev); break; case VIRTCHNL_OP_DISABLE_CHANNELS:
dev_err(&adapter->pdev->dev, "Failed to disable queue channels, error %s\n",
iavf_stat_str(&adapter->hw, v_retval));
adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
adapter->ch_config.state = __IAVF_TC_RUNNING;
netif_tx_start_all_queues(netdev); break; case VIRTCHNL_OP_ADD_CLOUD_FILTER: { struct iavf_cloud_filter *cf, *cftmp;
list_for_each_entry(cf, &adapter->cloud_filter_list,
list) { if (cf->state == __IAVF_CF_DEL_PENDING) {
cf->state = __IAVF_CF_ACTIVE;
dev_info(&adapter->pdev->dev, "Failed to del cloud filter, error %s\n",
iavf_stat_str(&adapter->hw,
v_retval));
iavf_print_cloud_filter(adapter,
&cf->f);
}
}
} break; case VIRTCHNL_OP_ADD_FDIR_FILTER: { struct iavf_fdir_fltr *fdir, *fdir_tmp;
spin_lock_bh(&adapter->fdir_fltr_lock);
list_for_each_entry_safe(fdir, fdir_tmp,
&adapter->fdir_list_head,
list) { if (fdir->state == IAVF_FDIR_FLTR_ADD_PENDING) {
dev_info(&adapter->pdev->dev, "Failed to add Flow Director filter, error %s\n",
iavf_stat_str(&adapter->hw,
v_retval));
iavf_print_fdir_fltr(adapter, fdir); if (msglen)
dev_err(&adapter->pdev->dev, "%s\n", msg);
list_del(&fdir->list);
iavf_dec_fdir_active_fltr(adapter, fdir);
kfree(fdir);
}
}
spin_unlock_bh(&adapter->fdir_fltr_lock);
} break; case VIRTCHNL_OP_DEL_FDIR_FILTER: { struct iavf_fdir_fltr *fdir;
spin_lock_bh(&adapter->fdir_fltr_lock);
list_for_each_entry(fdir, &adapter->fdir_list_head,
list) { if (fdir->state == IAVF_FDIR_FLTR_DEL_PENDING ||
fdir->state == IAVF_FDIR_FLTR_DIS_PENDING) {
fdir->state = IAVF_FDIR_FLTR_ACTIVE;
dev_info(&adapter->pdev->dev, "Failed to del Flow Director filter, error %s\n",
iavf_stat_str(&adapter->hw,
v_retval));
iavf_print_fdir_fltr(adapter, fdir);
}
}
spin_unlock_bh(&adapter->fdir_fltr_lock);
} break; case VIRTCHNL_OP_ADD_RSS_CFG: { struct iavf_adv_rss *rss, *rss_tmp;
spin_lock_bh(&adapter->adv_rss_lock);
list_for_each_entry_safe(rss, rss_tmp,
&adapter->adv_rss_list_head,
list) { if (rss->state == IAVF_ADV_RSS_ADD_PENDING) {
iavf_print_adv_rss_cfg(adapter, rss, "Failed to change the input set for",
NULL);
list_del(&rss->list);
kfree(rss);
}
}
spin_unlock_bh(&adapter->adv_rss_lock);
} break; case VIRTCHNL_OP_DEL_RSS_CFG: { struct iavf_adv_rss *rss;
spin_lock_bh(&adapter->adv_rss_lock);
list_for_each_entry(rss, &adapter->adv_rss_list_head,
list) { if (rss->state == IAVF_ADV_RSS_DEL_PENDING) {
rss->state = IAVF_ADV_RSS_ACTIVE;
dev_err(&adapter->pdev->dev, "Failed to delete RSS configuration, error %s\n",
iavf_stat_str(&adapter->hw,
v_retval));
}
}
spin_unlock_bh(&adapter->adv_rss_lock);
} break; case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:
dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n"); /* Vlan stripping could not be enabled by ethtool. *Disableitinnetdev->features.
*/
iavf_netdev_features_vlan_strip_set(netdev, false); break; case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:
dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n"); /* Vlan stripping could not be disabled by ethtool. *Enableitinnetdev->features.
*/
iavf_netdev_features_vlan_strip_set(netdev, true); break; case VIRTCHNL_OP_ADD_VLAN_V2:
iavf_vlan_add_reject(adapter);
dev_warn(&adapter->pdev->dev, "Failed to add VLAN filter, error %s\n",
iavf_stat_str(&adapter->hw, v_retval)); break; case VIRTCHNL_OP_CONFIG_RSS_HFUNC:
dev_warn(&adapter->pdev->dev, "Failed to configure hash function, error %s\n",
iavf_stat_str(&adapter->hw, v_retval));
/* process any state change needed due to new capabilities */
iavf_ptp_process_caps(adapter); break; case VIRTCHNL_OP_1588_PTP_GET_TIME:
iavf_virtchnl_ptp_get_time(adapter, msg, msglen); break; case VIRTCHNL_OP_ENABLE_QUEUES: /* enable transmits */
iavf_irq_enable(adapter, true);
wake_up(&adapter->reset_waitqueue);
adapter->flags &= ~IAVF_FLAG_QUEUES_DISABLED; break; case VIRTCHNL_OP_DISABLE_QUEUES:
iavf_free_all_tx_resources(adapter);
iavf_free_all_rx_resources(adapter); if (adapter->state == __IAVF_DOWN_PENDING) {
iavf_change_state(adapter, __IAVF_DOWN);
wake_up(&adapter->down_waitqueue);
} break; case VIRTCHNL_OP_VERSION: case VIRTCHNL_OP_CONFIG_IRQ_MAP: /* Don't display an error if we get these out of sequence. *Ifthefirmwareneededtogetkicked,we'llgettheseand *it'snoproblem.
*/ if (v_opcode != adapter->current_op) return; break; case VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS: { struct virtchnl_rss_hashcfg *vrh =
(struct virtchnl_rss_hashcfg *)msg;
if (msglen == sizeof(*vrh))
adapter->rss_hashcfg = vrh->hashcfg; else
dev_warn(&adapter->pdev->dev, "Invalid message %d from PF\n", v_opcode);
} break; case VIRTCHNL_OP_REQUEST_QUEUES: { struct virtchnl_vf_res_request *vfres =
(struct virtchnl_vf_res_request *)msg;
if (vfres->num_queue_pairs != adapter->num_req_queues) {
dev_info(&adapter->pdev->dev, "Requested %d queues, PF can support %d\n",
adapter->num_req_queues,
vfres->num_queue_pairs);
adapter->num_req_queues = 0;
adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
}
} break; case VIRTCHNL_OP_ADD_CLOUD_FILTER: { struct iavf_cloud_filter *cf;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.