staticvoid txgbevf_set_num_queues(struct wx *wx)
{
u32 def_q = 0, num_tcs = 0;
u16 rss, queue; int ret = 0;
/* Start with base case */
wx->num_rx_queues = 1;
wx->num_tx_queues = 1;
spin_lock_bh(&wx->mbx.mbx_lock); /* fetch queue configuration from the PF */
ret = wx_get_queues_vf(wx, &num_tcs, &def_q);
spin_unlock_bh(&wx->mbx.mbx_lock);
if (ret) return;
/* we need as many queues as traffic classes */ if (num_tcs > 1) {
wx->num_rx_queues = num_tcs;
} else {
rss = min_t(u16, num_online_cpus(), TXGBEVF_MAX_RSS_NUM);
queue = min_t(u16, wx->mac.max_rx_queues, wx->mac.max_tx_queues);
rss = min_t(u16, queue, rss);
staticvoid txgbevf_init_type_code(struct wx *wx)
{ switch (wx->device_id) { case TXGBEVF_DEV_ID_SP1000: case TXGBEVF_DEV_ID_WX1820:
wx->mac.type = wx_mac_sp; break; case TXGBEVF_DEV_ID_AML500F: case TXGBEVF_DEV_ID_AML510F: case TXGBEVF_DEV_ID_AML5024: case TXGBEVF_DEV_ID_AML5124: case TXGBEVF_DEV_ID_AML503F: case TXGBEVF_DEV_ID_AML513F:
wx->mac.type = wx_mac_aml; break; default:
wx->mac.type = wx_mac_unknown; break;
}
}
/* Initialize pcie info and common capability flags */
err = wx_sw_init(wx); if (err < 0) goto err_wx_sw_init;
/* Initialize the mailbox */
err = wx_init_mbx_params_vf(wx); if (err) goto err_init_mbx_params;
/* max q_vectors */
wx->mac.max_msix_vectors = TXGBEVF_MAX_MSIX_VECTORS; /* Initialize the device type */
txgbevf_init_type_code(wx); /* lock to protect mailbox accesses */
spin_lock_init(&wx->mbx.mbx_lock);
err = wx_reset_hw_vf(wx); if (err) {
wx_err(wx, "PF still in reset state. Is the PF interface up?\n"); goto err_reset_hw;
}
wx_init_hw_vf(wx);
wx_negotiate_api_vf(wx); if (is_zero_ether_addr(wx->mac.addr))
dev_info(&pdev->dev, "MAC address not assigned by administrator.\n");
eth_hw_addr_set(netdev, wx->mac.addr);
if (!is_valid_ether_addr(netdev->dev_addr)) {
dev_info(&pdev->dev, "Assigning random MAC address\n");
eth_hw_addr_random(netdev);
ether_addr_copy(wx->mac.addr, netdev->dev_addr);
ether_addr_copy(wx->mac.perm_addr, netdev->dev_addr);
}
/** * txgbevf_remove - Device Removal Routine * @pdev: PCI device information struct * * txgbevf_remove is called by the PCI subsystem to alert the driver * that it should release a PCI device. The could be caused by a * Hot-Plug event, or because the driver is going to be removed from * memory.
**/ staticvoid txgbevf_remove(struct pci_dev *pdev)
{
wxvf_remove(pdev);
}
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.