28 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30 #include <linux/module.h>
31 #include <linux/types.h>
33 #include <linux/pci.h>
37 #include <linux/netdevice.h>
38 #include <linux/tcp.h>
39 #include <linux/ipv6.h>
40 #include <linux/slab.h>
43 #include <linux/mii.h>
44 #include <linux/ethtool.h>
45 #include <linux/if_vlan.h>
46 #include <linux/prefetch.h>
50 #define DRV_VERSION "2.0.1-k"
53 static const char igbvf_driver_string[] =
54 "Intel(R) Gigabit Virtual Function Network Driver";
55 static const char igbvf_copyright[] =
56 "Copyright (c) 2009 - 2012 Intel Corporation.";
58 #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
59 static int debug = -1;
65 static void igbvf_set_interrupt_capability(
struct igbvf_adapter *);
66 static void igbvf_reset_interrupt_capability(
struct igbvf_adapter *);
75 static struct igbvf_info igbvf_i350_vf_info = {
82 static const struct igbvf_info *igbvf_info_tbl[] = {
113 __vlan_hwaccel_put_tag(skb, vid);
118 static inline void igbvf_rx_checksum_adv(
struct igbvf_adapter *adapter,
121 skb_checksum_none_assert(skb);
168 while (cleaned_count--) {
172 if (!buffer_info->
page) {
174 if (!buffer_info->
page) {
189 if (!buffer_info->
skb) {
190 skb = netdev_alloc_skb_ip_align(netdev, bufsz);
204 rx_desc->
read.pkt_addr =
208 rx_desc->
read.pkt_addr =
210 rx_desc->
read.hdr_addr = 0;
214 if (i == rx_ring->
count)
223 i = (rx_ring->
count - 1);
243 static bool igbvf_clean_rx_irq(
struct igbvf_adapter *adapter,
244 int *work_done,
int work_to_do)
252 bool cleaned =
false;
253 int cleaned_count = 0;
263 if (*work_done >= work_to_do)
275 hlen = (
le16_to_cpu(rx_desc->
wb.lower.lo_dword.hs_rss.hdr_info) &
284 skb = buffer_info->
skb;
291 buffer_info->
dma = 0;
296 if (!skb_shinfo(skb)->nr_frags) {
309 skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
315 (page_count(buffer_info->
page) != 1))
318 get_page(buffer_info->
page);
326 if (i == rx_ring->
count)
333 buffer_info->
skb = next_buffer->
skb;
334 buffer_info->
dma = next_buffer->
dma;
336 next_buffer->
dma = 0;
345 total_bytes += skb->
len;
348 igbvf_rx_checksum_adv(adapter, staterr, skb);
352 igbvf_receive_skb(adapter, netdev, skb, staterr,
353 rx_desc->
wb.upper.vlan);
356 rx_desc->
wb.upper.status_error = 0;
360 igbvf_alloc_rx_buffers(rx_ring, cleaned_count);
366 buffer_info = next_buffer;
372 cleaned_count = igbvf_desc_unused(rx_ring);
375 igbvf_alloc_rx_buffers(rx_ring, cleaned_count);
380 adapter->
net_stats.rx_packets += total_packets;
387 if (buffer_info->
dma) {
398 buffer_info->
dma = 0;
400 if (buffer_info->
skb) {
442 "Unable to allocate memory for the transmit descriptor ring\n");
466 rx_ring->
size = rx_ring->
count * desc_len;
486 "Unable to allocate memory for the receive descriptor ring\n");
505 for (i = 0; i < tx_ring->
count; i++) {
507 igbvf_put_txbuf(adapter, buffer_info);
533 igbvf_clean_tx_ring(tx_ring);
548 static void igbvf_clean_rx_ring(
struct igbvf_ring *rx_ring)
560 for (i = 0; i < rx_ring->
count; i++) {
562 if (buffer_info->
dma) {
572 buffer_info->
dma = 0;
575 if (buffer_info->
skb) {
576 dev_kfree_skb(buffer_info->
skb);
580 if (buffer_info->
page) {
617 igbvf_clean_rx_ring(rx_ring);
649 goto update_itr_done;
651 switch (itr_setting) {
654 if (bytes/packets > 8000)
656 else if ((packets < 5) && (bytes > 512))
662 if (bytes/packets > 8000)
664 else if ((packets < 10) || ((bytes/packets) > 1200))
666 else if ((packets > 35))
668 }
else if (bytes/packets > 2000) {
670 }
else if (packets <= 2 && bytes < 512) {
678 }
else if (bytes < 6000) {
690 static int igbvf_range_to_itr(
enum latency_range current_range)
694 switch (current_range) {
716 adapter->tx_ring->itr_range =
717 igbvf_update_itr(adapter,
718 adapter->tx_ring->itr_val,
727 new_itr = igbvf_range_to_itr(adapter->tx_ring->itr_range);
730 if (new_itr != adapter->tx_ring->itr_val) {
731 u32 current_itr = adapter->tx_ring->itr_val;
737 new_itr = new_itr > current_itr ?
738 min(current_itr + (new_itr >> 2), new_itr) :
740 adapter->tx_ring->itr_val = new_itr;
742 adapter->tx_ring->set_itr = 1;
746 igbvf_update_itr(adapter, adapter->
rx_ring->itr_val,
753 new_itr = igbvf_range_to_itr(adapter->
rx_ring->itr_range);
755 if (new_itr != adapter->
rx_ring->itr_val) {
757 new_itr = new_itr > current_itr ?
758 min(current_itr + (new_itr >> 2), new_itr) :
760 adapter->
rx_ring->itr_val = new_itr;
772 static bool igbvf_clean_tx_irq(
struct igbvf_ring *tx_ring)
779 unsigned int total_bytes = 0, total_packets = 0;
780 unsigned int i, eop,
count = 0;
781 bool cleaned =
false;
788 (count < tx_ring->count)) {
790 for (cleaned =
false; !cleaned; count++) {
793 cleaned = (i == eop);
794 skb = buffer_info->
skb;
797 unsigned int segs, bytecount;
800 segs = skb_shinfo(skb)->gso_segs ?: 1;
802 bytecount = ((segs - 1) * skb_headlen(skb)) +
804 total_packets += segs;
805 total_bytes += bytecount;
808 igbvf_put_txbuf(adapter, buffer_info);
809 tx_desc->
wb.status = 0;
812 if (i == tx_ring->
count)
822 netif_carrier_ok(netdev) &&
828 if (netif_queue_stopped(netdev) &&
830 netif_wake_queue(netdev);
836 adapter->
net_stats.tx_packets += total_packets;
837 return count < tx_ring->
count;
849 hw->
mac.get_link_status = 1;
858 static irqreturn_t igbvf_intr_msix_tx(
int irq,
void *data)
863 struct igbvf_ring *tx_ring = adapter->tx_ring;
868 adapter->tx_ring->set_itr = 0;
876 if (!igbvf_clean_tx_irq(tx_ring))
885 static irqreturn_t igbvf_intr_msix_rx(
int irq,
void *data)
895 if (adapter->
rx_ring->set_itr) {
897 adapter->
hw.hw_addr + adapter->
rx_ring->itr_register);
901 if (napi_schedule_prep(&adapter->
rx_ring->napi)) {
910 #define IGBVF_NO_QUEUE -1
923 index = (rx_queue >> 1);
925 if (rx_queue & 0x1) {
927 ivar = ivar & 0xFF00FFFF;
931 ivar = ivar & 0xFFFFFF00;
934 adapter->
rx_ring[rx_queue].eims_value = 1 << msix_vector;
938 index = (tx_queue >> 1);
940 if (tx_queue & 0x1) {
942 ivar = ivar & 0x00FFFFFF;
946 ivar = ivar & 0xFFFF00FF;
949 adapter->tx_ring[tx_queue].eims_value = 1 << msix_vector;
960 static void igbvf_configure_msix(
struct igbvf_adapter *adapter)
964 struct igbvf_ring *tx_ring = adapter->tx_ring;
981 ew32(IVAR_MISC, tmp);
988 static void igbvf_reset_interrupt_capability(
struct igbvf_adapter *adapter)
1003 static void igbvf_set_interrupt_capability(
struct igbvf_adapter *adapter)
1009 adapter->
msix_entries = kcalloc(3,
sizeof(
struct msix_entry),
1012 for (i = 0; i < 3; i++)
1022 "Failed to initialize MSI-X interrupts.\n");
1023 igbvf_reset_interrupt_capability(adapter);
1033 static int igbvf_request_msix(
struct igbvf_adapter *adapter)
1039 sprintf(adapter->tx_ring->name,
"%s-tx-0", netdev->
name);
1047 igbvf_intr_msix_tx, 0, adapter->tx_ring->name,
1057 igbvf_intr_msix_rx, 0, adapter->
rx_ring->name,
1067 igbvf_msix_other, 0, netdev->
name, netdev);
1071 igbvf_configure_msix(adapter);
1086 if (!adapter->tx_ring)
1091 kfree(adapter->tx_ring);
1112 err = igbvf_request_msix(adapter);
1118 "Unable to allocate interrupt, Error: %d\n", err);
1129 for (vector = 0; vector < 3; vector++)
1137 static void igbvf_irq_disable(
struct igbvf_adapter *adapter)
1171 igbvf_clean_rx_irq(adapter, &work_done, budget);
1174 if (work_done < budget) {
1178 igbvf_set_itr(adapter);
1202 static int igbvf_vlan_rx_add_vid(
struct net_device *netdev,
u16 vid)
1207 if (hw->
mac.ops.set_vfta(hw, vid,
true)) {
1208 dev_err(&adapter->
pdev->dev,
"Failed to add vlan id %d\n", vid);
1215 static int igbvf_vlan_rx_kill_vid(
struct net_device *netdev,
u16 vid)
1220 if (hw->
mac.ops.set_vfta(hw, vid,
false)) {
1222 "Failed to remove vlan id %d\n", vid);
1229 static void igbvf_restore_vlan(
struct igbvf_adapter *adapter)
1234 igbvf_vlan_rx_add_vid(adapter->netdev, vid);
1245 struct e1000_hw *hw = &adapter->hw;
1246 struct igbvf_ring *tx_ring = adapter->tx_ring;
1248 u32 txdctl, dca_txctrl;
1251 txdctl =
er32(TXDCTL(0));
1258 tdba = tx_ring->
dma;
1260 ew32(TDBAH(0), (tdba >> 32));
1270 dca_txctrl =
er32(DCA_TXCTRL(0));
1272 ew32(DCA_TXCTRL(0), dca_txctrl);
1276 ew32(TXDCTL(0), txdctl);
1289 static void igbvf_setup_srrctl(
struct igbvf_adapter *adapter)
1315 ew32(SRRCTL(0), srrctl);
1324 static void igbvf_configure_rx(
struct igbvf_adapter *adapter)
1332 rxdctl =
er32(RXDCTL(0));
1343 rdba = rx_ring->
dma;
1345 ew32(RDBAH(0), (rdba >> 32));
1353 rxdctl &= 0xFFF00000;
1358 igbvf_set_rlpml(adapter);
1361 ew32(RXDCTL(0), rxdctl);
1373 static void igbvf_set_multi(
struct net_device *netdev)
1385 "failed to allocate multicast filter list\n");
1395 hw->
mac.ops.update_mc_addr_list(hw, mta_list, i, 0, 0);
1405 igbvf_set_multi(adapter->netdev);
1407 igbvf_restore_vlan(adapter);
1409 igbvf_configure_tx(adapter);
1410 igbvf_setup_srrctl(adapter);
1411 igbvf_configure_rx(adapter);
1412 igbvf_alloc_rx_buffers(adapter->rx_ring,
1413 igbvf_desc_unused(adapter->rx_ring));
1430 if (mac->
ops.reset_hw(hw))
1431 dev_err(&adapter->
pdev->dev,
"PF still resetting\n");
1433 mac->
ops.init_hw(hw);
1435 if (is_valid_ether_addr(adapter->
hw.mac.addr)) {
1450 igbvf_configure(adapter);
1454 napi_enable(&adapter->
rx_ring->napi);
1456 igbvf_configure_msix(adapter);
1460 igbvf_irq_enable(adapter);
1463 hw->
mac.get_link_status = 1;
1483 rxdctl =
er32(RXDCTL(0));
1486 netif_stop_queue(netdev);
1489 txdctl =
er32(TXDCTL(0));
1496 napi_disable(&adapter->
rx_ring->napi);
1498 igbvf_irq_disable(adapter);
1510 igbvf_reset(adapter);
1511 igbvf_clean_tx_ring(adapter->tx_ring);
1512 igbvf_clean_rx_ring(adapter->
rx_ring);
1551 adapter->
ei->init_ops(&adapter->
hw);
1553 rc = adapter->
hw.mac.ops.init_params(&adapter->
hw);
1557 rc = adapter->
hw.mbx.ops.init_params(&adapter->
hw);
1561 igbvf_set_interrupt_capability(adapter);
1563 if (igbvf_alloc_queues(adapter))
1569 igbvf_irq_disable(adapter);
1577 static void igbvf_initialize_last_counter_stats(
struct igbvf_adapter *adapter)
1581 adapter->
stats.last_gprc =
er32(VFGPRC);
1582 adapter->
stats.last_gorc =
er32(VFGORC);
1583 adapter->
stats.last_gptc =
er32(VFGPTC);
1584 adapter->
stats.last_gotc =
er32(VFGOTC);
1585 adapter->
stats.last_mprc =
er32(VFMPRC);
1586 adapter->
stats.last_gotlbc =
er32(VFGOTLBC);
1587 adapter->
stats.last_gptlbc =
er32(VFGPTLBC);
1588 adapter->
stats.last_gorlbc =
er32(VFGORLBC);
1589 adapter->
stats.last_gprlbc =
er32(VFGPRLBC);
1591 adapter->
stats.base_gprc =
er32(VFGPRC);
1592 adapter->
stats.base_gorc =
er32(VFGORC);
1593 adapter->
stats.base_gptc =
er32(VFGPTC);
1594 adapter->
stats.base_gotc =
er32(VFGOTC);
1595 adapter->
stats.base_mprc =
er32(VFMPRC);
1596 adapter->
stats.base_gotlbc =
er32(VFGOTLBC);
1597 adapter->
stats.base_gptlbc =
er32(VFGPTLBC);
1598 adapter->
stats.base_gorlbc =
er32(VFGORLBC);
1599 adapter->
stats.base_gprlbc =
er32(VFGPRLBC);
1614 static int igbvf_open(
struct net_device *netdev)
1640 igbvf_configure(adapter);
1642 err = igbvf_request_irq(adapter);
1649 napi_enable(&adapter->
rx_ring->napi);
1654 igbvf_irq_enable(adapter);
1657 hw->
mac.get_link_status = 1;
1667 igbvf_reset(adapter);
1683 static int igbvf_close(
struct net_device *netdev)
1690 igbvf_free_irq(adapter);
1704 static int igbvf_set_mac(
struct net_device *netdev,
void *
p)
1710 if (!is_valid_ether_addr(addr->
sa_data))
1715 hw->
mac.ops.rar_set(hw, hw->
mac.addr, 0);
1726 #define UPDATE_VF_COUNTER(reg, name) \
1728 u32 current_counter = er32(reg); \
1729 if (current_counter < adapter->stats.last_##name) \
1730 adapter->stats.name += 0x100000000LL; \
1731 adapter->stats.last_##name = current_counter; \
1732 adapter->stats.name &= 0xFFFFFFFF00000000LL; \
1733 adapter->stats.name |= current_counter; \
1755 if (pci_channel_offline(pdev))
1772 static void igbvf_print_link_info(
struct igbvf_adapter *adapter)
1774 dev_info(&adapter->
pdev->dev,
"Link is Up %d Mbps %s Duplex\n",
1789 ret_val = hw->
mac.ops.check_for_link(hw);
1790 link_active = !hw->
mac.get_link_status;
1803 static void igbvf_watchdog(
unsigned long data)
1818 struct igbvf_ring *tx_ring = adapter->tx_ring;
1823 link = igbvf_has_link(adapter);
1826 if (!netif_carrier_ok(netdev)) {
1827 mac->
ops.get_link_up_info(&adapter->
hw,
1830 igbvf_print_link_info(adapter);
1833 netif_wake_queue(netdev);
1836 if (netif_carrier_ok(netdev)) {
1841 netif_stop_queue(netdev);
1845 if (netif_carrier_ok(netdev)) {
1848 tx_pending = (igbvf_desc_unused(tx_ring) + 1 <
1871 #define IGBVF_TX_FLAGS_CSUM 0x00000001
1872 #define IGBVF_TX_FLAGS_VLAN 0x00000002
1873 #define IGBVF_TX_FLAGS_TSO 0x00000004
1874 #define IGBVF_TX_FLAGS_IPV4 0x00000008
1875 #define IGBVF_TX_FLAGS_VLAN_MASK 0xffff0000
1876 #define IGBVF_TX_FLAGS_VLAN_SHIFT 16
1887 u32 mss_l4len_idx, l4len;
1890 if (skb_header_cloned(skb)) {
1894 "igbvf_tso returning an error\n");
1899 l4len = tcp_hdrlen(skb);
1903 struct iphdr *iph = ip_hdr(skb);
1910 }
else if (skb_is_gso_v6(skb)) {
1911 ipv6_hdr(skb)->payload_len = 0;
1913 &ipv6_hdr(skb)->
daddr,
1925 *hdr_len += skb_network_offset(skb);
1926 info |= (skb_transport_header(skb) - skb_network_header(skb));
1927 *hdr_len += (skb_transport_header(skb) - skb_network_header(skb));
1948 buffer_info->
dma = 0;
1950 if (i == tx_ring->
count)
1958 static inline bool igbvf_tx_csum(
struct igbvf_adapter *adapter,
1973 if (tx_flags & IGBVF_TX_FLAGS_VLAN)
1978 info |= (skb_transport_header(skb) -
1979 skb_network_header(skb));
2008 buffer_info->
dma = 0;
2010 if (i == tx_ring->
count)
2020 static int igbvf_maybe_stop_tx(
struct net_device *netdev,
int size)
2025 if (igbvf_desc_unused(adapter->tx_ring) >= size)
2028 netif_stop_queue(netdev);
2033 if (igbvf_desc_unused(adapter->tx_ring) < size)
2036 netif_wake_queue(netdev);
2042 #define IGBVF_MAX_TXD_PWR 16
2043 #define IGBVF_MAX_DATA_PER_TXD (1 << IGBVF_MAX_TXD_PWR)
2045 static inline int igbvf_tx_map_adv(
struct igbvf_adapter *adapter,
2052 unsigned int len = skb_headlen(skb);
2053 unsigned int count = 0,
i;
2060 buffer_info->
length = len;
2071 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
2076 if (i == tx_ring->
count)
2079 frag = &skb_shinfo(skb)->frags[
f];
2080 len = skb_frag_size(frag);
2084 buffer_info->
length = len;
2088 buffer_info->
dma = skb_frag_dma_map(&pdev->
dev, frag, 0, len,
2103 buffer_info->
dma = 0;
2114 i += tx_ring->
count;
2117 igbvf_put_txbuf(adapter, buffer_info);
2123 static inline void igbvf_tx_queue_adv(
struct igbvf_adapter *adapter,
2125 int tx_flags,
int count,
u32 paylen,
2130 u32 olinfo_status = 0, cmd_type_len;
2136 if (tx_flags & IGBVF_TX_FLAGS_VLAN)
2160 tx_desc->
read.cmd_type_len =
2164 if (i == tx_ring->
count)
2187 unsigned int first, tx_flags = 0;
2197 if (skb->
len <= 0) {
2209 if (igbvf_maybe_stop_tx(netdev, skb_shinfo(skb)->nr_frags + 4)) {
2224 tso = skb_is_gso(skb) ?
2225 igbvf_tso(adapter, tx_ring, skb, tx_flags, &hdr_len) : 0;
2233 else if (igbvf_tx_csum(adapter, tx_ring, skb, tx_flags) &&
2241 count = igbvf_tx_map_adv(adapter, tx_ring, skb, first);
2244 igbvf_tx_queue_adv(adapter, tx_ring, tx_flags, count,
2268 tx_ring = &adapter->tx_ring[0];
2270 return igbvf_xmit_frame_ring_adv(skb, netdev, tx_ring);
2277 static void igbvf_tx_timeout(
struct net_device *netdev)
2286 static void igbvf_reset_task(
struct work_struct *work)
2316 static int igbvf_change_mtu(
struct net_device *netdev,
int new_mtu)
2322 dev_err(&adapter->
pdev->dev,
"Invalid MTU setting\n");
2326 #define MAX_STD_JUMBO_FRAME_SIZE 9234
2327 if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
2328 dev_err(&adapter->
pdev->dev,
"MTU > 9216 not supported.\n");
2336 if (netif_running(netdev))
2348 if (max_frame <= 1024)
2350 else if (max_frame <= 2048)
2353 #if (PAGE_SIZE / 2) > 16384
2366 dev_info(&adapter->
pdev->dev,
"changing MTU from %d to %d\n",
2367 netdev->
mtu, new_mtu);
2368 netdev->
mtu = new_mtu;
2370 if (netif_running(netdev))
2373 igbvf_reset(adapter);
2390 struct net_device *netdev = pci_get_drvdata(pdev);
2398 if (netif_running(netdev)) {
2401 igbvf_free_irq(adapter);
2416 static int igbvf_resume(
struct pci_dev *pdev)
2418 struct net_device *netdev = pci_get_drvdata(pdev);
2425 dev_err(&pdev->
dev,
"Cannot enable PCI device from suspend\n");
2431 if (netif_running(netdev)) {
2432 err = igbvf_request_irq(adapter);
2437 igbvf_reset(adapter);
2439 if (netif_running(netdev))
2448 static void igbvf_shutdown(
struct pci_dev *pdev)
2453 #ifdef CONFIG_NET_POLL_CONTROLLER
2459 static void igbvf_netpoll(
struct net_device *netdev)
2465 igbvf_clean_tx_irq(adapter->tx_ring);
2482 struct net_device *netdev = pci_get_drvdata(pdev);
2490 if (netif_running(netdev))
2507 struct net_device *netdev = pci_get_drvdata(pdev);
2512 "Cannot re-enable PCI device after reset.\n");
2517 igbvf_reset(adapter);
2530 static void igbvf_io_resume(
struct pci_dev *pdev)
2532 struct net_device *netdev = pci_get_drvdata(pdev);
2535 if (netif_running(netdev)) {
2538 "can't bring device back up after reset\n");
2546 static void igbvf_print_device_info(
struct igbvf_adapter *adapter)
2553 dev_info(&pdev->
dev,
"Intel(R) I350 Virtual Function\n");
2555 dev_info(&pdev->
dev,
"Intel(R) 82576 Virtual Function\n");
2559 static int igbvf_set_features(
struct net_device *netdev,
2573 .ndo_open = igbvf_open,
2574 .ndo_stop = igbvf_close,
2575 .ndo_start_xmit = igbvf_xmit_frame,
2576 .ndo_get_stats = igbvf_get_stats,
2577 .ndo_set_rx_mode = igbvf_set_multi,
2578 .ndo_set_mac_address = igbvf_set_mac,
2579 .ndo_change_mtu = igbvf_change_mtu,
2580 .ndo_do_ioctl = igbvf_ioctl,
2581 .ndo_tx_timeout = igbvf_tx_timeout,
2582 .ndo_vlan_rx_add_vid = igbvf_vlan_rx_add_vid,
2583 .ndo_vlan_rx_kill_vid = igbvf_vlan_rx_kill_vid,
2584 #ifdef CONFIG_NET_POLL_CONTROLLER
2585 .ndo_poll_controller = igbvf_netpoll,
2587 .ndo_set_features = igbvf_set_features,
2609 static int cards_found;
2610 int err, pci_using_dac;
2629 "configuration, aborting\n");
2644 goto err_alloc_etherdev;
2648 pci_set_drvdata(pdev, netdev);
2649 adapter = netdev_priv(netdev);
2651 adapter->
netdev = netdev;
2652 adapter->
pdev = pdev;
2657 adapter->
hw.mac.type = ei->
mac;
2672 if (!adapter->
hw.hw_addr)
2682 err = igbvf_sw_init(adapter);
2717 err = hw->
mac.ops.reset_hw(hw);
2720 "PF still in reset state, assigning new address."
2721 " Is the PF interface up?\n");
2722 eth_hw_addr_random(netdev);
2726 err = hw->
mac.ops.read_mac_addr(hw);
2728 dev_err(&pdev->
dev,
"Error reading MAC address\n");
2735 if (!is_valid_ether_addr(netdev->
dev_addr)) {
2736 dev_err(&pdev->
dev,
"Invalid MAC Address: %pM\n",
2745 (
unsigned long) adapter);
2751 adapter->
rx_ring->count = 1024;
2752 adapter->tx_ring->count = 1024;
2755 igbvf_reset(adapter);
2764 netif_stop_queue(netdev);
2766 igbvf_print_device_info(adapter);
2768 igbvf_initialize_last_counter_stats(adapter);
2773 kfree(adapter->tx_ring);
2776 igbvf_reset_interrupt_capability(adapter);
2799 struct net_device *netdev = pci_get_drvdata(pdev);
2815 igbvf_reset_interrupt_capability(adapter);
2822 kfree(adapter->tx_ring);
2837 .error_detected = igbvf_io_error_detected,
2838 .slot_reset = igbvf_io_slot_reset,
2839 .resume = igbvf_io_resume,
2852 .id_table = igbvf_pci_tbl,
2853 .probe = igbvf_probe,
2857 .suspend = igbvf_suspend,
2858 .resume = igbvf_resume,
2860 .shutdown = igbvf_shutdown,
2861 .err_handler = &igbvf_err_handler
2870 static int __init igbvf_init_module(
void)
2874 pr_info(
"%s\n", igbvf_copyright);
2876 ret = pci_register_driver(&igbvf_driver);
2888 static void __exit igbvf_exit_module(
void)