Page MenuHomeFreeBSD

D58143.diff
No OneTemporary

D58143.diff

diff --git a/sys/dev/aq/aq2_fw.c b/sys/dev/aq/aq2_fw.c
--- a/sys/dev/aq/aq2_fw.c
+++ b/sys/dev/aq/aq2_fw.c
@@ -422,6 +422,8 @@
stats->ptc = u.a0.tx_good_frames;
} else if (hw->aq2_iface == AQ2_FW_INTERFACE_OUT_VERSION_IFACE_VER_B0) {
/* B0 reports aggregate octets only; per-cast stays zero. */
+ stats->brc = u.b0.rx_good_octets;
+ stats->btc = u.b0.tx_good_octets;
stats->uprc = u.b0.rx_unicast_frames;
stats->mprc = u.b0.rx_multicast_frames;
stats->bprc = u.b0.rx_broadcast_frames;
diff --git a/sys/dev/aq/aq_hw.h b/sys/dev/aq/aq_hw.h
--- a/sys/dev/aq/aq_hw.h
+++ b/sys/dev/aq/aq_hw.h
@@ -364,7 +364,7 @@
int aq_hw_fw_downld_dwords(struct aq_hw *hw, uint32_t a, uint32_t *p, uint32_t cnt);
-int aq_hw_reset(struct aq_hw *hw);
+int aq_hw_reset(struct aq_hw *hw, bool reboot);
int aq_hw_mpi_create(struct aq_hw *hw);
diff --git a/sys/dev/aq/aq_hw.c b/sys/dev/aq/aq_hw.c
--- a/sys/dev/aq/aq_hw.c
+++ b/sys/dev/aq/aq_hw.c
@@ -217,13 +217,17 @@
int err;
err = hw->fw_ops->get_stats(hw, stats);
+ if (err != 0)
+ return (err);
+
+ /* No firmware interface reports the RPB drop count; read it directly. */
+ stats->dpc = reg_rx_dma_stat_counter7get(hw);
- if (err == 0) {
- stats->dpc = reg_rx_dma_stat_counter7get(hw);
+ /* The LRO counter has no A2 counterpart in any reference driver. */
+ if (!IS_CHIP_FEATURE(hw, ATLANTIC2))
stats->cprc = stats_rx_lro_coalesced_pkt_count0_get(hw);
- }
- return (err);
+ return (0);
}
static int
@@ -364,19 +368,25 @@
/* HW NIC functions */
int
-aq_hw_reset(struct aq_hw *hw)
+aq_hw_reset(struct aq_hw *hw, bool reboot)
{
int err = 0;
AQ_DBG_ENTER();
- /* A2 resets by rebooting the MCP; A1 uses the RBL/FLB reset. */
- if (IS_CHIP_FEATURE(hw, ATLANTIC2))
- err = aq2_fw_reboot(hw);
- else
- err = aq_fw_reset(hw);
- if (err != 0)
- goto err_exit;
+ /*
+ * A2 resets by rebooting the MCP; A1 uses the RBL/FLB reset. At attach
+ * aq_hw_mpi_create() has already done this, so the caller passes
+ * reboot=false to skip the (costly, on A2) redundant MCP reboot.
+ */
+ if (reboot) {
+ if (IS_CHIP_FEATURE(hw, ATLANTIC2))
+ err = aq2_fw_reboot(hw);
+ else
+ err = aq_fw_reset(hw);
+ if (err != 0)
+ goto err_exit;
+ }
itr_irq_reg_res_dis_set(hw, 0);
itr_res_irq_set(hw, 1);
@@ -569,9 +579,10 @@
/* Tx interrupts */
tdm_tx_desc_wr_wb_irq_en_set(hw, 1U);
- /* misc */
- AQ_WRITE_REG(hw, 0x00007040U,
- IS_CHIP_FEATURE(hw, TPO2) ? 0x00010000U : 0x00000000U);
+ /* misc (Atlantic 1 TPO register; absent on Atlantic 2) */
+ if (!IS_CHIP_FEATURE(hw, ATLANTIC2))
+ AQ_WRITE_REG(hw, 0x00007040U,
+ IS_CHIP_FEATURE(hw, TPO2) ? 0x00010000U : 0x00000000U);
tdm_tx_dca_en_set(hw, 0U);
tdm_tx_dca_mode_set(hw, 0U);
diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c
--- a/sys/dev/aq/aq_main.c
+++ b/sys/dev/aq/aq_main.c
@@ -382,7 +382,7 @@
if (hw->fast_start_enabled)
rc = hw->fw_ops->reset(hw);
else
- rc = aq_hw_reset(&softc->hw);
+ rc = aq_hw_reset(&softc->hw, !IS_CHIP_FEATURE(hw, ATLANTIC2));
if (rc != 0) {
device_printf(softc->dev, "%s: reset failed, err=%d\n",
__func__, rc);
@@ -813,7 +813,7 @@
aq_ring_rx_stop(hw, softc->rx_rings[i]);
}
- aq_hw_reset(&softc->hw);
+ aq_hw_reset(&softc->hw, true);
memset(&softc->last_stats, 0, sizeof(softc->last_stats));
softc->linkup = false;
aq_if_update_admin_status(ctx);

File Metadata

Mime Type
text/plain
Expires
Sat, Jul 18, 2:07 AM (2 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35183979
Default Alt Text
D58143.diff (3 KB)

Event Timeline