462
462
(u64)buffer_info->time_stamp,
463
463
buffer_info->skb, next_desc);
465
if (netif_msg_pktdata(adapter) && buffer_info->dma != 0)
465
if (netif_msg_pktdata(adapter) && buffer_info->skb)
466
466
print_hex_dump(KERN_INFO, "",
467
467
DUMP_PREFIX_ADDRESS,
468
16, 1, phys_to_virt(buffer_info->dma),
468
16, 1, buffer_info->skb->data,
469
469
buffer_info->length, true);
547
547
(u64)buffer_info->dma,
548
548
buffer_info->skb, next_desc);
550
if (netif_msg_pktdata(adapter)) {
550
if (netif_msg_pktdata(adapter) &&
551
buffer_info->dma && buffer_info->skb) {
551
552
print_hex_dump(KERN_INFO, "",
554
phys_to_virt(buffer_info->dma),
555
IGB_RX_HDR_LEN, true);
554
16, 1, buffer_info->skb->data,
555
IGB_RX_HDR_LEN, true);
556
556
print_hex_dump(KERN_INFO, "",
557
557
DUMP_PREFIX_ADDRESS,
560
buffer_info->page_dma +
561
buffer_info->page_offset),
559
page_address(buffer_info->page) +
560
buffer_info->page_offset,
562
561
PAGE_SIZE/2, true);
1819
* igb_set_fw_version - Configure version string for ethtool
1820
* @adapter: adapter struct
1823
void igb_set_fw_version(struct igb_adapter *adapter)
1825
struct e1000_hw *hw = &adapter->hw;
1826
u16 eeprom_verh, eeprom_verl, comb_verh, comb_verl, comb_offset;
1827
u16 major, build, patch, fw_version;
1830
hw->nvm.ops.read(hw, 5, 1, &fw_version);
1831
if (adapter->hw.mac.type != e1000_i211) {
1832
hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verh);
1833
hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verl);
1834
etrack_id = (eeprom_verh << IGB_ETRACK_SHIFT) | eeprom_verl;
1836
/* combo image version needs to be found */
1837
hw->nvm.ops.read(hw, NVM_COMB_VER_PTR, 1, &comb_offset);
1838
if ((comb_offset != 0x0) &&
1839
(comb_offset != IGB_NVM_VER_INVALID)) {
1840
hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset
1841
+ 1), 1, &comb_verh);
1842
hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset),
1845
/* Only display Option Rom if it exists and is valid */
1846
if ((comb_verh && comb_verl) &&
1847
((comb_verh != IGB_NVM_VER_INVALID) &&
1848
(comb_verl != IGB_NVM_VER_INVALID))) {
1849
major = comb_verl >> IGB_COMB_VER_SHFT;
1850
build = (comb_verl << IGB_COMB_VER_SHFT) |
1851
(comb_verh >> IGB_COMB_VER_SHFT);
1852
patch = comb_verh & IGB_COMB_VER_MASK;
1853
snprintf(adapter->fw_version,
1854
sizeof(adapter->fw_version),
1855
"%d.%d%d, 0x%08x, %d.%d.%d",
1856
(fw_version & IGB_MAJOR_MASK) >>
1858
(fw_version & IGB_MINOR_MASK) >>
1860
(fw_version & IGB_BUILD_MASK),
1861
etrack_id, major, build, patch);
1865
snprintf(adapter->fw_version, sizeof(adapter->fw_version),
1867
(fw_version & IGB_MAJOR_MASK) >> IGB_MAJOR_SHIFT,
1868
(fw_version & IGB_MINOR_MASK) >> IGB_MINOR_SHIFT,
1869
(fw_version & IGB_BUILD_MASK), etrack_id);
1871
snprintf(adapter->fw_version, sizeof(adapter->fw_version),
1873
(fw_version & IGB_MAJOR_MASK) >> IGB_MAJOR_SHIFT,
1874
(fw_version & IGB_MINOR_MASK) >> IGB_MINOR_SHIFT,
1875
(fw_version & IGB_BUILD_MASK));
1824
1882
* igb_probe - Device Initialization Routine
1825
1883
* @pdev: PCI device information struct
1826
1884
* @ent: entry in igb_pci_tbl
2371
2433
adapter->vfs_allocated_count = max_vfs;
2375
adapter->vfs_allocated_count = 0;
2380
2438
#endif /* CONFIG_PCI_IOV */
2381
switch (hw->mac.type) {
2383
adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES_I210,
2387
adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES_I211,
2391
adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES,
2395
/* i350 cannot do RSS and SR-IOV at the same time */
2396
if (hw->mac.type == e1000_i350 && adapter->vfs_allocated_count)
2397
adapter->rss_queues = 1;
2400
* if rss_queues > 4 or vfs are going to be allocated with rss_queues
2401
* then we should combine the queues into a queue pair in order to
2402
* conserve interrupts due to limited supply
2404
if ((adapter->rss_queues > 4) ||
2405
((adapter->rss_queues > 1) && (adapter->vfs_allocated_count > 6)))
2406
adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
2440
/* Determine the maximum number of RSS queues supported. */
2441
switch (hw->mac.type) {
2443
max_rss_queues = IGB_MAX_RX_QUEUES_I211;
2447
max_rss_queues = IGB_MAX_RX_QUEUES_82575;
2450
/* I350 cannot do RSS and SR-IOV at the same time */
2451
if (!!adapter->vfs_allocated_count) {
2457
if (!!adapter->vfs_allocated_count) {
2464
max_rss_queues = IGB_MAX_RX_QUEUES;
2468
adapter->rss_queues = min_t(u32, max_rss_queues, num_online_cpus());
2470
/* Determine if we need to pair queues. */
2471
switch (hw->mac.type) {
2474
/* Device supports enough interrupts without queue pairing. */
2478
* If VFs are going to be allocated with RSS queues then we
2479
* should pair the queues in order to conserve interrupts due
2480
* to limited supply.
2482
if ((adapter->rss_queues > 1) &&
2483
(adapter->vfs_allocated_count > 6))
2484
adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
2491
* If rss_queues > half of max_rss_queues, pair the queues in
2492
* order to conserve interrupts due to limited supply.
2494
if (adapter->rss_queues > (max_rss_queues / 2))
2495
adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
2408
2499
/* Setup and initialize a copy of the hw vlan table array */
2409
2500
adapter->shadow_vfta = kzalloc(sizeof(u32) *