Lines 1-6
Link Here
|
1 |
/****************************************************************************** |
1 |
/****************************************************************************** |
2 |
|
2 |
|
3 |
Copyright (c) 2001-2013, Intel Corporation |
3 |
Copyright (c) 2001-2014, Intel Corporation |
4 |
All rights reserved. |
4 |
All rights reserved. |
5 |
|
5 |
|
6 |
Redistribution and use in source and binary forms, with or without |
6 |
Redistribution and use in source and binary forms, with or without |
Lines 33-41
Link Here
|
33 |
/*$FreeBSD$*/ |
33 |
/*$FreeBSD$*/ |
34 |
|
34 |
|
35 |
|
35 |
|
|
|
36 |
#ifndef IXGBE_LEGACY_BUILD |
36 |
#include "opt_inet.h" |
37 |
#include "opt_inet.h" |
37 |
#include "opt_inet6.h" |
38 |
#include "opt_inet6.h" |
38 |
#include "opt_rss.h" |
39 |
#include "opt_rss.h" |
|
|
40 |
#endif |
41 |
|
39 |
#include "ixgbe.h" |
42 |
#include "ixgbe.h" |
40 |
|
43 |
|
41 |
#ifdef RSS |
44 |
#ifdef RSS |
Lines 50-56
Link Here
|
50 |
/********************************************************************* |
53 |
/********************************************************************* |
51 |
* Driver version |
54 |
* Driver version |
52 |
*********************************************************************/ |
55 |
*********************************************************************/ |
53 |
char ixgbe_driver_version[] = "2.5.15"; |
56 |
char ixgbe_driver_version[] = "2.5.28"; |
54 |
|
57 |
|
55 |
/********************************************************************* |
58 |
/********************************************************************* |
56 |
* PCI Device ID Table |
59 |
* PCI Device ID Table |
Lines 87-93
Link Here
|
87 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, |
90 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, |
88 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, |
91 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, |
89 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, 0, 0, 0}, |
92 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, 0, 0, 0}, |
|
|
93 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_QSFP_SF_QP, 0, 0, 0}, |
90 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, |
94 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, |
|
|
95 |
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, |
91 |
/* required last entry */ |
96 |
/* required last entry */ |
92 |
{0, 0, 0, 0, 0} |
97 |
{0, 0, 0, 0, 0} |
93 |
}; |
98 |
}; |
Lines 114-126
Link Here
|
114 |
static int ixgbe_mq_start(struct ifnet *, struct mbuf *); |
119 |
static int ixgbe_mq_start(struct ifnet *, struct mbuf *); |
115 |
static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *); |
120 |
static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *); |
116 |
static void ixgbe_qflush(struct ifnet *); |
121 |
static void ixgbe_qflush(struct ifnet *); |
|
|
122 |
#endif /* IXGBE_LEGACY_TX */ |
117 |
static void ixgbe_deferred_mq_start(void *, int); |
123 |
static void ixgbe_deferred_mq_start(void *, int); |
118 |
#endif /* IXGBE_LEGACY_TX */ |
|
|
119 |
static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); |
124 |
static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); |
120 |
static void ixgbe_init(void *); |
125 |
static void ixgbe_init(void *); |
121 |
static void ixgbe_init_locked(struct adapter *); |
126 |
static void ixgbe_init_locked(struct adapter *); |
122 |
static void ixgbe_stop(void *); |
127 |
static void ixgbe_stop(void *); |
|
|
128 |
#if __FreeBSD_version >= 1100036 |
123 |
static uint64_t ixgbe_get_counter(struct ifnet *, ift_counter); |
129 |
static uint64_t ixgbe_get_counter(struct ifnet *, ift_counter); |
|
|
130 |
#endif |
124 |
static void ixgbe_media_status(struct ifnet *, struct ifmediareq *); |
131 |
static void ixgbe_media_status(struct ifnet *, struct ifmediareq *); |
125 |
static int ixgbe_media_change(struct ifnet *); |
132 |
static int ixgbe_media_change(struct ifnet *); |
126 |
static void ixgbe_identify_hardware(struct adapter *); |
133 |
static void ixgbe_identify_hardware(struct adapter *); |
Lines 504-510
Link Here
|
504 |
** system mbuf allocation. Tuning nmbclusters |
511 |
** system mbuf allocation. Tuning nmbclusters |
505 |
** can alleviate this. |
512 |
** can alleviate this. |
506 |
*/ |
513 |
*/ |
507 |
if (nmbclusters > 0 ) { |
514 |
if (nmbclusters > 0) { |
508 |
int s; |
515 |
int s; |
509 |
s = (ixgbe_rxd * adapter->num_queues) * ixgbe_total_ports; |
516 |
s = (ixgbe_rxd * adapter->num_queues) * ixgbe_total_ports; |
510 |
if (s > nmbclusters) { |
517 |
if (s > nmbclusters) { |
Lines 665-670
Link Here
|
665 |
return (EBUSY); |
672 |
return (EBUSY); |
666 |
} |
673 |
} |
667 |
|
674 |
|
|
|
675 |
/* Prevent new requests from coming in */ |
676 |
ether_ifdetach(adapter->ifp); |
677 |
|
668 |
IXGBE_CORE_LOCK(adapter); |
678 |
IXGBE_CORE_LOCK(adapter); |
669 |
ixgbe_stop(adapter); |
679 |
ixgbe_stop(adapter); |
670 |
IXGBE_CORE_UNLOCK(adapter); |
680 |
IXGBE_CORE_UNLOCK(adapter); |
Lines 701-707
Link Here
|
701 |
if (adapter->vlan_detach != NULL) |
711 |
if (adapter->vlan_detach != NULL) |
702 |
EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); |
712 |
EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); |
703 |
|
713 |
|
704 |
ether_ifdetach(adapter->ifp); |
|
|
705 |
callout_drain(&adapter->timer); |
714 |
callout_drain(&adapter->timer); |
706 |
#ifdef DEV_NETMAP |
715 |
#ifdef DEV_NETMAP |
707 |
netmap_detach(adapter->ifp); |
716 |
netmap_detach(adapter->ifp); |
Lines 913-934
Link Here
|
913 |
} |
922 |
} |
914 |
|
923 |
|
915 |
/* |
924 |
/* |
916 |
* Called from a taskqueue to drain queued transmit packets. |
|
|
917 |
*/ |
918 |
static void |
919 |
ixgbe_deferred_mq_start(void *arg, int pending) |
920 |
{ |
921 |
struct tx_ring *txr = arg; |
922 |
struct adapter *adapter = txr->adapter; |
923 |
struct ifnet *ifp = adapter->ifp; |
924 |
|
925 |
IXGBE_TX_LOCK(txr); |
926 |
if (!drbr_empty(ifp, txr->br)) |
927 |
ixgbe_mq_start_locked(ifp, txr); |
928 |
IXGBE_TX_UNLOCK(txr); |
929 |
} |
930 |
|
931 |
/* |
932 |
** Flush all ring buffers |
925 |
** Flush all ring buffers |
933 |
*/ |
926 |
*/ |
934 |
static void |
927 |
static void |
Lines 948-953
Link Here
|
948 |
} |
941 |
} |
949 |
#endif /* IXGBE_LEGACY_TX */ |
942 |
#endif /* IXGBE_LEGACY_TX */ |
950 |
|
943 |
|
|
|
944 |
/* |
945 |
* Called from a taskqueue to drain queued transmit packets. |
946 |
*/ |
947 |
static void |
948 |
ixgbe_deferred_mq_start(void *arg, int pending) |
949 |
{ |
950 |
struct tx_ring *txr = arg; |
951 |
struct adapter *adapter = txr->adapter; |
952 |
struct ifnet *ifp = adapter->ifp; |
953 |
|
954 |
IXGBE_TX_LOCK(txr); |
955 |
#ifndef IXGBE_LEGACY_TX |
956 |
if (!drbr_empty(ifp, txr->br)) |
957 |
ixgbe_mq_start_locked(ifp, txr); |
958 |
#else |
959 |
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) |
960 |
ixgbe_start_locked(txr, ifp); |
961 |
#endif |
962 |
IXGBE_TX_UNLOCK(txr); |
963 |
} |
964 |
|
951 |
/********************************************************************* |
965 |
/********************************************************************* |
952 |
* Ioctl entry point |
966 |
* Ioctl entry point |
953 |
* |
967 |
* |
Lines 961-967
Link Here
|
961 |
ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) |
975 |
ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) |
962 |
{ |
976 |
{ |
963 |
struct adapter *adapter = ifp->if_softc; |
977 |
struct adapter *adapter = ifp->if_softc; |
964 |
struct ixgbe_hw *hw = &adapter->hw; |
|
|
965 |
struct ifreq *ifr = (struct ifreq *) data; |
978 |
struct ifreq *ifr = (struct ifreq *) data; |
966 |
#if defined(INET) || defined(INET6) |
979 |
#if defined(INET) || defined(INET6) |
967 |
struct ifaddr *ifa = (struct ifaddr *)data; |
980 |
struct ifaddr *ifa = (struct ifaddr *)data; |
Lines 1047-1056
Link Here
|
1047 |
IOCTL_DEBUGOUT("ioctl: SIOCSIFCAP (Set Capabilities)"); |
1060 |
IOCTL_DEBUGOUT("ioctl: SIOCSIFCAP (Set Capabilities)"); |
1048 |
if (mask & IFCAP_HWCSUM) |
1061 |
if (mask & IFCAP_HWCSUM) |
1049 |
ifp->if_capenable ^= IFCAP_HWCSUM; |
1062 |
ifp->if_capenable ^= IFCAP_HWCSUM; |
|
|
1063 |
#if __FreeBSD_version > 900505 |
1050 |
if (mask & IFCAP_TSO4) |
1064 |
if (mask & IFCAP_TSO4) |
1051 |
ifp->if_capenable ^= IFCAP_TSO4; |
1065 |
ifp->if_capenable ^= IFCAP_TSO4; |
1052 |
if (mask & IFCAP_TSO6) |
1066 |
if (mask & IFCAP_TSO6) |
1053 |
ifp->if_capenable ^= IFCAP_TSO6; |
1067 |
ifp->if_capenable ^= IFCAP_TSO6; |
|
|
1068 |
#else |
1069 |
if (mask & IFCAP_TSO) |
1070 |
ifp->if_capenable ^= IFCAP_TSO; |
1071 |
#endif |
1054 |
if (mask & IFCAP_LRO) |
1072 |
if (mask & IFCAP_LRO) |
1055 |
ifp->if_capenable ^= IFCAP_LRO; |
1073 |
ifp->if_capenable ^= IFCAP_LRO; |
1056 |
if (mask & IFCAP_VLAN_HWTAGGING) |
1074 |
if (mask & IFCAP_VLAN_HWTAGGING) |
Lines 1067-1074
Link Here
|
1067 |
VLAN_CAPABILITIES(ifp); |
1085 |
VLAN_CAPABILITIES(ifp); |
1068 |
break; |
1086 |
break; |
1069 |
} |
1087 |
} |
|
|
1088 |
#if __FreeBSD_version >= 1100036 |
1070 |
case SIOCGI2C: |
1089 |
case SIOCGI2C: |
1071 |
{ |
1090 |
{ |
|
|
1091 |
struct ixgbe_hw *hw = &adapter->hw; |
1072 |
struct ifi2creq i2c; |
1092 |
struct ifi2creq i2c; |
1073 |
int i; |
1093 |
int i; |
1074 |
IOCTL_DEBUGOUT("ioctl: SIOCGI2C (Get I2C Data)"); |
1094 |
IOCTL_DEBUGOUT("ioctl: SIOCGI2C (Get I2C Data)"); |
Lines 1090-1095
Link Here
|
1090 |
error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); |
1110 |
error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); |
1091 |
break; |
1111 |
break; |
1092 |
} |
1112 |
} |
|
|
1113 |
#endif |
1093 |
default: |
1114 |
default: |
1094 |
IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command); |
1115 |
IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command); |
1095 |
error = ether_ioctl(ifp, command, data); |
1116 |
error = ether_ioctl(ifp, command, data); |
Lines 1551-1557
Link Here
|
1551 |
IXGBE_TX_LOCK(txr); |
1572 |
IXGBE_TX_LOCK(txr); |
1552 |
ixgbe_txeof(txr); |
1573 |
ixgbe_txeof(txr); |
1553 |
#ifdef IXGBE_LEGACY_TX |
1574 |
#ifdef IXGBE_LEGACY_TX |
1554 |
if (!IFQ_DRV_IS_EMPTY(ifp->if_snd)) |
1575 |
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) |
1555 |
ixgbe_start_locked(txr, ifp); |
1576 |
ixgbe_start_locked(txr, ifp); |
1556 |
#else |
1577 |
#else |
1557 |
if (!drbr_empty(ifp, txr->br)) |
1578 |
if (!drbr_empty(ifp, txr->br)) |
Lines 2101-2107
Link Here
|
2101 |
else if (txr->queue_status == IXGBE_QUEUE_WORKING) |
2122 |
else if (txr->queue_status == IXGBE_QUEUE_WORKING) |
2102 |
taskqueue_enqueue(que->tq, &txr->txq_task); |
2123 |
taskqueue_enqueue(que->tq, &txr->txq_task); |
2103 |
} |
2124 |
} |
2104 |
/* Only truely watchdog if all queues show hung */ |
2125 |
/* Only truly watchdog if all queues show hung */ |
2105 |
if (hung == adapter->num_queues) |
2126 |
if (hung == adapter->num_queues) |
2106 |
goto watchdog; |
2127 |
goto watchdog; |
2107 |
|
2128 |
|
Lines 2299-2307
Link Here
|
2299 |
{ |
2320 |
{ |
2300 |
device_t dev = adapter->dev; |
2321 |
device_t dev = adapter->dev; |
2301 |
struct ix_queue *que = adapter->queues; |
2322 |
struct ix_queue *que = adapter->queues; |
2302 |
#ifndef IXGBE_LEGACY_TX |
2323 |
struct tx_ring *txr = adapter->tx_rings; |
2303 |
struct tx_ring *txr = adapter->tx_rings; |
|
|
2304 |
#endif |
2305 |
int error, rid = 0; |
2324 |
int error, rid = 0; |
2306 |
|
2325 |
|
2307 |
/* MSI RID at 1 */ |
2326 |
/* MSI RID at 1 */ |
Lines 2321-2329
Link Here
|
2321 |
* Try allocating a fast interrupt and the associated deferred |
2340 |
* Try allocating a fast interrupt and the associated deferred |
2322 |
* processing contexts. |
2341 |
* processing contexts. |
2323 |
*/ |
2342 |
*/ |
2324 |
#ifndef IXGBE_LEGACY_TX |
|
|
2325 |
TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); |
2343 |
TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); |
2326 |
#endif |
|
|
2327 |
TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); |
2344 |
TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); |
2328 |
que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, |
2345 |
que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, |
2329 |
taskqueue_thread_enqueue, &que->tq); |
2346 |
taskqueue_thread_enqueue, &que->tq); |
Lines 2354-2360
Link Here
|
2354 |
return (error); |
2371 |
return (error); |
2355 |
} |
2372 |
} |
2356 |
/* For simplicity in the handlers */ |
2373 |
/* For simplicity in the handlers */ |
2357 |
adapter->que_mask = IXGBE_EIMS_ENABLE_MASK; |
2374 |
adapter->active_queues = IXGBE_EIMS_ENABLE_MASK; |
2358 |
|
2375 |
|
2359 |
return (0); |
2376 |
return (0); |
2360 |
} |
2377 |
} |
Lines 2420-2426
Link Here
|
2420 |
bus_describe_intr(dev, que->res, que->tag, "que %d", i); |
2437 |
bus_describe_intr(dev, que->res, que->tag, "que %d", i); |
2421 |
#endif |
2438 |
#endif |
2422 |
que->msix = vector; |
2439 |
que->msix = vector; |
2423 |
adapter->que_mask |= (u64)(1 << que->msix); |
2440 |
adapter->active_queues |= (u64)(1 << que->msix); |
2424 |
#ifdef RSS |
2441 |
#ifdef RSS |
2425 |
/* |
2442 |
/* |
2426 |
* The queue ID is used as the RSS layer bucket ID. |
2443 |
* The queue ID is used as the RSS layer bucket ID. |
Lines 2452-2461
Link Here
|
2452 |
i, cpu_id); |
2469 |
i, cpu_id); |
2453 |
#endif |
2470 |
#endif |
2454 |
|
2471 |
|
2455 |
|
|
|
2456 |
#ifndef IXGBE_LEGACY_TX |
2457 |
TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); |
2472 |
TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); |
2458 |
#endif |
|
|
2459 |
TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); |
2473 |
TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); |
2460 |
que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, |
2474 |
que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, |
2461 |
taskqueue_thread_enqueue, &que->tq); |
2475 |
taskqueue_thread_enqueue, &que->tq); |
Lines 2722-2728
Link Here
|
2722 |
ifp->if_softc = adapter; |
2736 |
ifp->if_softc = adapter; |
2723 |
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; |
2737 |
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; |
2724 |
ifp->if_ioctl = ixgbe_ioctl; |
2738 |
ifp->if_ioctl = ixgbe_ioctl; |
2725 |
ifp->if_get_counter = ixgbe_get_counter; |
2739 |
#if __FreeBSD_version >= 1100036 |
|
|
2740 |
if_setgetcounterfn(ifp, ixgbe_get_counter); |
2741 |
#endif |
2726 |
#ifndef IXGBE_LEGACY_TX |
2742 |
#ifndef IXGBE_LEGACY_TX |
2727 |
ifp->if_transmit = ixgbe_mq_start; |
2743 |
ifp->if_transmit = ixgbe_mq_start; |
2728 |
ifp->if_qflush = ixgbe_qflush; |
2744 |
ifp->if_qflush = ixgbe_qflush; |
Lines 3216-3222
Link Here
|
3216 |
|
3232 |
|
3217 |
for (int i = 0; i < adapter->num_queues; i++, txr++) { |
3233 |
for (int i = 0; i < adapter->num_queues; i++, txr++) { |
3218 |
u64 tdba = txr->txdma.dma_paddr; |
3234 |
u64 tdba = txr->txdma.dma_paddr; |
3219 |
u32 txctrl; |
3235 |
u32 txctrl = 0; |
3220 |
|
3236 |
|
3221 |
IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), |
3237 |
IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), |
3222 |
(tdba & 0x00000000ffffffffULL)); |
3238 |
(tdba & 0x00000000ffffffffULL)); |
Lines 3336-3342
Link Here
|
3336 |
tx_buffer->map = NULL; |
3352 |
tx_buffer->map = NULL; |
3337 |
} |
3353 |
} |
3338 |
} |
3354 |
} |
3339 |
#ifdef IXGBE_LEGACY_TX |
3355 |
#ifndef IXGBE_LEGACY_TX |
3340 |
if (txr->br != NULL) |
3356 |
if (txr->br != NULL) |
3341 |
buf_ring_free(txr->br, M_DEVBUF); |
3357 |
buf_ring_free(txr->br, M_DEVBUF); |
3342 |
#endif |
3358 |
#endif |
Lines 5382-5387
Link Here
|
5382 |
{ |
5398 |
{ |
5383 |
struct ixgbe_hw *hw = &adapter->hw; |
5399 |
struct ixgbe_hw *hw = &adapter->hw; |
5384 |
u32 missed_rx = 0, bprc, lxon, lxoff, total; |
5400 |
u32 missed_rx = 0, bprc, lxon, lxoff, total; |
|
|
5401 |
u64 total_missed_rx = 0; |
5385 |
|
5402 |
|
5386 |
adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); |
5403 |
adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); |
5387 |
adapter->stats.illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC); |
5404 |
adapter->stats.illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC); |
Lines 5400-5405
Link Here
|
5400 |
missed_rx += mp; |
5417 |
missed_rx += mp; |
5401 |
/* global total per queue */ |
5418 |
/* global total per queue */ |
5402 |
adapter->stats.mpc[i] += mp; |
5419 |
adapter->stats.mpc[i] += mp; |
|
|
5420 |
/* Total for stats display */ |
5421 |
total_missed_rx += adapter->stats.mpc[i]; |
5403 |
if (hw->mac.type == ixgbe_mac_82598EB) { |
5422 |
if (hw->mac.type == ixgbe_mac_82598EB) { |
5404 |
adapter->stats.rnbc[i] += |
5423 |
adapter->stats.rnbc[i] += |
5405 |
IXGBE_READ_REG(hw, IXGBE_RNBC(i)); |
5424 |
IXGBE_READ_REG(hw, IXGBE_RNBC(i)); |
Lines 5509-5550
Link Here
|
5509 |
adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); |
5528 |
adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); |
5510 |
adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); |
5529 |
adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); |
5511 |
} |
5530 |
} |
|
|
5531 |
|
5532 |
/* Fill out the OS statistics structure */ |
5533 |
IXGBE_SET_IPACKETS(adapter, adapter->stats.gprc); |
5534 |
IXGBE_SET_OPACKETS(adapter, adapter->stats.gptc); |
5535 |
IXGBE_SET_IBYTES(adapter, adapter->stats.gorc); |
5536 |
IXGBE_SET_OBYTES(adapter, adapter->stats.gotc); |
5537 |
IXGBE_SET_IMCASTS(adapter, adapter->stats.mprc); |
5538 |
IXGBE_SET_OMCASTS(adapter, adapter->stats.mptc); |
5539 |
IXGBE_SET_COLLISIONS(adapter, 0); |
5540 |
IXGBE_SET_IQDROPS(adapter, total_missed_rx); |
5541 |
IXGBE_SET_IERRORS(adapter, adapter->stats.crcerrs |
5542 |
+ adapter->stats.rlec); |
5512 |
} |
5543 |
} |
5513 |
|
5544 |
|
|
|
5545 |
#if __FreeBSD_version >= 1100036 |
5514 |
static uint64_t |
5546 |
static uint64_t |
5515 |
ixgbe_get_counter(struct ifnet *ifp, ift_counter cnt) |
5547 |
ixgbe_get_counter(struct ifnet *ifp, ift_counter cnt) |
5516 |
{ |
5548 |
{ |
5517 |
struct adapter *adapter; |
5549 |
struct adapter *adapter; |
5518 |
uint64_t rv; |
|
|
5519 |
|
5550 |
|
5520 |
adapter = if_getsoftc(ifp); |
5551 |
adapter = if_getsoftc(ifp); |
5521 |
|
5552 |
|
5522 |
switch (cnt) { |
5553 |
switch (cnt) { |
5523 |
case IFCOUNTER_IPACKETS: |
5554 |
case IFCOUNTER_IPACKETS: |
5524 |
return (adapter->stats.gprc); |
5555 |
return (adapter->ipackets); |
5525 |
case IFCOUNTER_OPACKETS: |
5556 |
case IFCOUNTER_OPACKETS: |
5526 |
return (adapter->stats.gptc); |
5557 |
return (adapter->opackets); |
5527 |
case IFCOUNTER_IBYTES: |
5558 |
case IFCOUNTER_IBYTES: |
5528 |
return (adapter->stats.gorc); |
5559 |
return (adapter->ibytes); |
5529 |
case IFCOUNTER_OBYTES: |
5560 |
case IFCOUNTER_OBYTES: |
5530 |
return (adapter->stats.gotc); |
5561 |
return (adapter->obytes); |
5531 |
case IFCOUNTER_IMCASTS: |
5562 |
case IFCOUNTER_IMCASTS: |
5532 |
return (adapter->stats.mprc); |
5563 |
return (adapter->imcasts); |
5533 |
case IFCOUNTER_OMCASTS: |
5564 |
case IFCOUNTER_OMCASTS: |
5534 |
return (adapter->stats.mptc); |
5565 |
return (adapter->omcasts); |
5535 |
case IFCOUNTER_COLLISIONS: |
5566 |
case IFCOUNTER_COLLISIONS: |
5536 |
return (0); |
5567 |
return (0); |
5537 |
case IFCOUNTER_IQDROPS: |
5568 |
case IFCOUNTER_IQDROPS: |
5538 |
rv = 0; |
5569 |
return (adapter->iqdrops); |
5539 |
for (int i = 0; i < 8; i++) |
|
|
5540 |
rv += adapter->stats.mpc[i]; |
5541 |
return (rv); |
5542 |
case IFCOUNTER_IERRORS: |
5570 |
case IFCOUNTER_IERRORS: |
5543 |
return (adapter->stats.crcerrs + adapter->stats.rlec); |
5571 |
return (adapter->ierrors); |
5544 |
default: |
5572 |
default: |
5545 |
return (if_get_counter_default(ifp, cnt)); |
5573 |
return (if_get_counter_default(ifp, cnt)); |
5546 |
} |
5574 |
} |
5547 |
} |
5575 |
} |
|
|
5576 |
#endif |
5548 |
|
5577 |
|
5549 |
/** ixgbe_sysctl_tdh_handler - Handler function |
5578 |
/** ixgbe_sysctl_tdh_handler - Handler function |
5550 |
* Retrieves the TDH value from the hardware |
5579 |
* Retrieves the TDH value from the hardware |
Lines 6056-6058
Link Here
|
6056 |
IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); |
6085 |
IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); |
6057 |
} |
6086 |
} |
6058 |
} |
6087 |
} |
|
|
6088 |
|