Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys/dev/pci/ixgbe Pull up the following revisions, reques...
details: https://anonhg.NetBSD.org/src/rev/554b8d6f48b0
branches: netbsd-9
changeset: 935842:554b8d6f48b0
user: martin <martin%NetBSD.org@localhost>
date: Fri Jul 10 11:35:51 2020 +0000
description:
Pull up the following revisions, requested by msaitoh in ticket #997:
sys/dev/pci/ixgbe/ix_txrx.c 1.62-1.63 via patch
sys/dev/pci/ixgbe/ixgbe.c 1.225, 1.228-1.229,
1.232 via patch
sys/dev/pci/ixgbe/ixgbe.h 1.64, 1.66
sys/dev/pci/ixgbe/ixv.c 1.146, 1.148-1.150
sys/dev/pci/ixgbe/ixgbe_common.c 1.27
sys/dev/pci/ixgbe/ixgbe_vf.c 1.23
sys/dev/pci/ixgbe/ixgbe_82598.c 1.15
sys/dev/pci/ixgbe/ixgbe_x550.c 1.18
sys/dev/pci/ixgbe/ixgbe_netbsd.c 1.14
sys/dev/pci/ixgbe/ixgbe_phy.c 1.21
sys/dev/pci/ixgbe/ixgbe_osdep.h 1.26
- Fix IXGBE_LE32_TO_CPUS() macro for big endian machine. This problem
was only on X550*.
- Add debug printf()s.
- Use unsigned to avoid undefined behavior in
ixgbe_fc_enable_generic().
- Modify a little to reduce diff between ixgbe.c and ixv.c.
No functional change.
- Modify comment.
- Remove unused macros.
- Whitespace fix.
- Fix typos.
diffstat:
sys/dev/pci/ixgbe/ix_txrx.c | 10 +-
sys/dev/pci/ixgbe/ixgbe.c | 38 ++++++------
sys/dev/pci/ixgbe/ixgbe.h | 115 +++++++++++++++-----------------------
sys/dev/pci/ixgbe/ixgbe_82598.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_common.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_netbsd.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_osdep.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_phy.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_vf.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_x550.c | 3 +-
sys/dev/pci/ixgbe/ixv.c | 36 +++++------
11 files changed, 102 insertions(+), 124 deletions(-)
diffs (truncated from 658 to 300 lines):
diff -r bf38ebacb4ba -r 554b8d6f48b0 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c Fri Jul 10 11:31:59 2020 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c Fri Jul 10 11:35:51 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.3 2020/01/26 11:03:17 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.4 2020/07/10 11:35:51 martin Exp $ */
/******************************************************************************
@@ -926,7 +926,7 @@
vlan_macip_lens |= ip_hlen;
/* No support for offloads for non-L4 next headers */
- switch (ipproto) {
+ switch (ipproto) {
case IPPROTO_TCP:
if (mp->m_pkthdr.csum_flags &
(M_CSUM_TCPv4 | M_CSUM_TCPv6))
@@ -1569,7 +1569,6 @@
rxbuf->addr = htole64(rxbuf->pmap->dm_segs[0].ds_addr);
}
-
/* Setup our descriptor indices */
rxr->next_to_check = 0;
rxr->next_to_refresh = 0;
@@ -1625,6 +1624,7 @@
struct rx_ring *rxr = adapter->rx_rings;
int j;
+ INIT_DEBUGOUT("ixgbe_setup_receive_structures");
for (j = 0; j < adapter->num_queues; j++, rxr++)
if (ixgbe_setup_receive_ring(rxr))
goto fail;
@@ -2233,7 +2233,7 @@
/* First, allocate the top level queue structs */
adapter->queues = (struct ix_queue *)malloc(sizeof(struct ix_queue) *
- adapter->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO);
+ adapter->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO);
if (adapter->queues == NULL) {
aprint_error_dev(dev, "Unable to allocate queue memory\n");
error = ENOMEM;
@@ -2300,7 +2300,7 @@
"Critical Failure setting up transmit buffers\n");
error = ENOMEM;
goto err_tx_desc;
- }
+ }
if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) {
/* Allocate a buf ring */
txr->txr_interq = pcq_create(IXGBE_BR_SIZE, KM_SLEEP);
diff -r bf38ebacb4ba -r 554b8d6f48b0 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Jul 10 11:31:59 2020 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Jul 10 11:35:51 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.10 2020/01/28 11:09:27 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.11 2020/07/10 11:35:51 martin Exp $ */
/******************************************************************************
@@ -168,9 +168,9 @@
static bool ixgbe_resume(device_t, const pmf_qual_t *);
static int ixgbe_ifflags_cb(struct ethercom *);
static int ixgbe_ioctl(struct ifnet *, u_long, void *);
-static void ixgbe_ifstop(struct ifnet *, int);
static int ixgbe_init(struct ifnet *);
static void ixgbe_init_locked(struct adapter *);
+static void ixgbe_ifstop(struct ifnet *, int);
static void ixgbe_stop(void *);
static void ixgbe_init_device_features(struct adapter *);
static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
@@ -408,11 +408,11 @@
#ifdef NET_MPSAFE
#define IXGBE_MPSAFE 1
#define IXGBE_CALLOUT_FLAGS CALLOUT_MPSAFE
-#define IXGBE_SOFTINFT_FLAGS SOFTINT_MPSAFE
+#define IXGBE_SOFTINT_FLAGS SOFTINT_MPSAFE
#define IXGBE_WORKQUEUE_FLAGS WQ_PERCPU | WQ_MPSAFE
#else
#define IXGBE_CALLOUT_FLAGS 0
-#define IXGBE_SOFTINFT_FLAGS 0
+#define IXGBE_SOFTINT_FLAGS 0
#define IXGBE_WORKQUEUE_FLAGS WQ_PERCPU
#endif
#define IXGBE_WORKQUEUE_PRI PRI_SOFTNET
@@ -674,6 +674,8 @@
struct ixgbe_hw *hw = &adapter->hw;
int i;
+ INIT_DEBUGOUT("ixgbe_initialize_transmit_units");
+
/* Setup the Base and Length of the Tx Descriptor Ring */
for (i = 0; i < adapter->num_queues; i++, txr++) {
u64 tdba = txr->txdma.dma_paddr;
@@ -1100,17 +1102,17 @@
goto err_late;
/* Tasklets for Link, SFP, Multispeed Fiber and Flow Director */
- adapter->link_si = softint_establish(SOFTINT_NET |IXGBE_SOFTINFT_FLAGS,
+ adapter->link_si = softint_establish(SOFTINT_NET |IXGBE_SOFTINT_FLAGS,
ixgbe_handle_link, adapter);
- adapter->mod_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ adapter->mod_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_handle_mod, adapter);
- adapter->msf_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ adapter->msf_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_handle_msf, adapter);
- adapter->phy_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ adapter->phy_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_handle_phy, adapter);
if (adapter->feat_en & IXGBE_FEATURE_FDIR)
adapter->fdir_si =
- softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_reinit_fdir, adapter);
if ((adapter->link_si == NULL) || (adapter->mod_si == NULL)
|| (adapter->msf_si == NULL) || (adapter->phy_si == NULL)
@@ -3217,7 +3219,7 @@
if (rate > 0 && rate < 500000) {
if (rate < 1000)
rate = 1000;
- reg |= ((4000000/rate) & 0xff8);
+ reg |= ((4000000 / rate) & 0xff8);
/*
* When RSC is used, ITR interval must be larger than
* RSC_DELAY. Currently, we use 2us for RSC_DELAY.
@@ -4438,7 +4440,7 @@
{
struct adapter *adapter = arg;
device_t dev = adapter->dev;
- struct ix_queue *que = adapter->queues;
+ struct ix_queue *que = adapter->queues;
u64 queues = 0;
u64 v0, v1, v2, v3, v4, v5, v6, v7;
int hung = 0;
@@ -4511,7 +4513,7 @@
}
}
- /* Only truely watchdog if all queues show hung */
+ /* Only truly watchdog if all queues show hung */
if (hung == adapter->num_queues)
goto watchdog;
#if 0 /* XXX Avoid unexpectedly disabling interrupt forever (PR#53294) */
@@ -6221,7 +6223,7 @@
* return 0 on success, positive on failure
************************************************************************/
static int
-ixgbe_ioctl(struct ifnet * ifp, u_long command, void *data)
+ixgbe_ioctl(struct ifnet *ifp, u_long command, void *data)
{
struct adapter *adapter = ifp->if_softc;
struct ixgbe_hw *hw = &adapter->hw;
@@ -6505,7 +6507,7 @@
*/
if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) {
txr->txr_si =
- softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_deferred_mq_start, txr);
snprintf(wqname, sizeof(wqname), "%sdeferTx", device_xname(dev));
@@ -6514,7 +6516,7 @@
IPL_NET, IXGBE_WORKQUEUE_FLAGS);
adapter->txr_wq_enqueued = percpu_alloc(sizeof(u_int));
}
- que->que_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ que->que_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_handle_que, que);
snprintf(wqname, sizeof(wqname), "%sTxRx", device_xname(dev));
error = workqueue_create(&adapter->que_wq, wqname,
@@ -6654,7 +6656,7 @@
if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) {
txr->txr_si = softint_establish(
- SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_deferred_mq_start, txr);
if (txr->txr_si == NULL) {
aprint_error_dev(dev,
@@ -6664,7 +6666,7 @@
}
}
que->que_si
- = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_handle_que, que);
if (que->que_si == NULL) {
aprint_error_dev(dev,
@@ -6726,7 +6728,7 @@
if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) {
adapter->mbx_si =
- softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+ softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
ixgbe_handle_mbx, adapter);
if (adapter->mbx_si == NULL) {
aprint_error_dev(dev,
diff -r bf38ebacb4ba -r 554b8d6f48b0 sys/dev/pci/ixgbe/ixgbe.h
--- a/sys/dev/pci/ixgbe/ixgbe.h Fri Jul 10 11:31:59 2020 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.h Fri Jul 10 11:35:51 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.56.2.2 2020/01/26 11:03:17 martin Exp $ */
+/* $NetBSD: ixgbe.h,v 1.56.2.3 2020/07/10 11:35:51 martin Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -268,10 +268,10 @@
/* This is used to get SFP+ module data */
struct ixgbe_i2c_req {
- u8 dev_addr;
- u8 offset;
- u8 len;
- u8 data[8];
+ u8 dev_addr;
+ u8 offset;
+ u8 len;
+ u8 data[8];
};
struct ixgbe_bp_data {
@@ -334,13 +334,15 @@
char namebuf[32];
char evnamebuf[32];
- kmutex_t dc_mtx; /* lock for disabled_count and this queue's EIMS/EIMC bit */
- int disabled_count;/*
- * means
- * 0 : this queue is enabled
- * > 0 : this queue is disabled
- * the value is ixgbe_disable_queue() called count
- */
+ /* Lock for disabled_count and this queue's EIMS/EIMC bit */
+ kmutex_t dc_mtx;
+ /*
+ * disabled_count means:
+ * 0 : this queue is enabled
+ * > 0 : this queue is disabled
+ * the value is ixgbe_disable_queue() called count
+ */
+ int disabled_count;
bool txrx_use_workqueue;
};
@@ -373,10 +375,10 @@
u16 atr_sample;
u16 atr_count;
- u64 bytes; /* used for AIM */
+ u64 bytes; /* Used for AIM */
u64 packets;
/* Soft Stats */
- struct evcnt tso_tx;
+ struct evcnt tso_tx;
struct evcnt no_desc_avail;
struct evcnt total_packets;
struct evcnt pcq_drops;
@@ -409,7 +411,7 @@
bool hw_rsc;
bool vtag_strip;
u16 next_to_refresh;
- u16 next_to_check;
+ u16 next_to_check;
u16 num_desc;
u16 mbuf_sz;
#if 0
@@ -417,8 +419,8 @@
#endif
struct ixgbe_rx_buf *rx_buffers;
ixgbe_dma_tag_t *ptag;
- u16 last_rx_mbuf_sz;
- u32 last_num_rx_desc;
+ u16 last_rx_mbuf_sz;
+ u32 last_num_rx_desc;
ixgbe_extmem_head_t jcl_head;
u64 bytes; /* Used for AIM calc */
@@ -427,10 +429,10 @@
/* Soft stats */
struct evcnt rx_copies;
struct evcnt rx_packets;
- struct evcnt rx_bytes;
- struct evcnt rx_discarded;
- struct evcnt no_jmbuf;
- u64 rsc_num;
+ struct evcnt rx_bytes;
+ struct evcnt rx_discarded;
+ struct evcnt no_jmbuf;
+ u64 rsc_num;
/* Flow Director */
u64 flm;
@@ -496,7 +498,7 @@
u16 num_segs;
u32 link_speed;
bool link_up;
- u32 vector;
+ u32 vector;
Home |
Main Index |
Thread Index |
Old Index