Page MenuHomeFreeBSD

D58436.diff
No OneTemporary

D58436.diff

diff --git a/sys/dev/aq/aq_dbg.h b/sys/dev/aq/aq_dbg.h
--- a/sys/dev/aq/aq_dbg.h
+++ b/sys/dev/aq/aq_dbg.h
@@ -150,11 +150,17 @@
#define trace_detail(_hw, _cat, _fmt, args...) \
aq_trace_base(_hw, lvl_detail, _cat, _fmt, ##args)
+#if AQ_CFG_DEBUG_LVL > 2
void trace_aq_tx_descr(struct aq_hw *hw, int ring_idx, unsigned int pointer,
volatile uint64_t descr[2]);
void trace_aq_rx_descr(struct aq_hw *hw, int ring_idx, unsigned int pointer,
volatile uint64_t descr[2]);
void trace_aq_tx_context_descr(struct aq_hw *hw, int ring_idx,
unsigned int pointer, volatile uint64_t descr[2]);
+#else
+#define trace_aq_tx_descr(...) ((void)0)
+#define trace_aq_rx_descr(...) ((void)0)
+#define trace_aq_tx_context_descr(...) ((void)0)
+#endif
#endif // AQ_DBG_H
diff --git a/sys/dev/aq/aq_dbg.c b/sys/dev/aq/aq_dbg.c
--- a/sys/dev/aq/aq_dbg.c
+++ b/sys/dev/aq/aq_dbg.c
@@ -50,6 +50,8 @@
(BIT(BIT_BEGIN - BIT_END + 1) -1))
#define __field(TYPE, VAR) TYPE VAR;
+
+#if AQ_CFG_DEBUG_LVL > 2
void
trace_aq_tx_descr(struct aq_hw *hw, int ring_idx, unsigned int pointer,
volatile uint64_t descr[2])
@@ -192,3 +194,4 @@
__entry->des_typ);
#endif
}
+#endif
diff --git a/sys/dev/aq/aq_device.h b/sys/dev/aq/aq_device.h
--- a/sys/dev/aq/aq_device.h
+++ b/sys/dev/aq/aq_device.h
@@ -92,24 +92,6 @@
uint64_t bbtc;
};
-enum aq_dev_state {
- AQ_DEV_STATE_UNLOAD,
- AQ_DEV_STATE_PCI_STOP,
- AQ_DEV_STATE_DOWN,
- AQ_DEV_STATE_UP,
-};
-
-struct aq_rx_filters {
- unsigned int rule_cnt;
- struct aq_rx_filter_vlan vlan_filters[AQ_HW_VLAN_MAX_FILTERS];
- struct aq_rx_filter_l2 etype_filters[AQ_HW_ETYPE_MAX_FILTERS];
-};
-
-struct aq_vlan_tag {
- SLIST_ENTRY(aq_vlan_tag) next;
- uint16_t tag;
-};
-
struct aq_dev {
device_t dev;
if_ctx_t ctx;
diff --git a/sys/dev/aq/aq_irq.c b/sys/dev/aq/aq_irq.c
--- a/sys/dev/aq/aq_irq.c
+++ b/sys/dev/aq/aq_irq.c
@@ -219,7 +219,7 @@
struct aq_hw_fc_info fc_neg;
aq_hw_get_link_state(hw, &link_speed, &fc_neg);
if (link_speed && !aq_dev->linkup) { /* link was DOWN */
- device_printf(aq_dev->dev, "atlantic: link UP: speed=%d\n", link_speed);
+ device_printf(aq_dev->dev, "link UP: speed=%d\n", link_speed);
aq_dev->linkup = 1;
aq_dev->phy_fault_last = 0;
@@ -234,7 +234,7 @@
/* update ITR settings according new link speed */
aq_hw_interrupt_moderation_set(hw);
} else if (link_speed == 0U && aq_dev->linkup) { /* link was UP */
- device_printf(aq_dev->dev, "atlantic: link DOWN\n");
+ device_printf(aq_dev->dev, "link DOWN\n");
aq_dev->linkup = 0;
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
@@ -629,7 +629,7 @@
M_AQ, M_NOWAIT | M_ZERO);
if (!ring){
rc = ENOMEM;
- device_printf(softc->dev, "atlantic: tx_ring malloc fail\n");
+ device_printf(softc->dev, "tx_ring malloc fail\n");
goto fail;
}
ring->tx_descs = (volatile struct aq_tx_desc*)vaddrs[i];
@@ -644,7 +644,7 @@
rc = aq_ring_stats_alloc(ring);
if (rc != 0) {
device_printf(softc->dev,
- "atlantic: tx_ring stats alloc fail\n");
+ "tx_ring stats alloc fail\n");
goto fail;
}
}
@@ -675,7 +675,7 @@
if (!ring){
rc = ENOMEM;
device_printf(softc->dev,
- "atlantic: rx_ring malloc fail\n");
+ "rx_ring malloc fail\n");
goto fail;
}
@@ -690,7 +690,7 @@
rc = aq_ring_stats_alloc(ring);
if (rc != 0) {
device_printf(softc->dev,
- "atlantic: rx_ring stats alloc fail\n");
+ "rx_ring stats alloc fail\n");
goto fail;
}
}
@@ -756,7 +756,7 @@
err = aq_hw_init(&softc->hw, softc->hw.mac_addr, softc->msix,
softc->scctx->isc_intr == IFLIB_INTR_MSIX);
if (err != 0) {
- device_printf(softc->dev, "atlantic: aq_hw_init: %d\n", err);
+ device_printf(softc->dev, "aq_hw_init: %d\n", err);
AQ_DBG_EXIT(err);
return;
}
@@ -774,12 +774,12 @@
err = aq_ring_tx_init(&softc->hw, ring);
if (err) {
device_printf(softc->dev,
- "atlantic: aq_ring_tx_init: %d\n", err);
+ "aq_ring_tx_init: %d\n", err);
}
err = aq_ring_tx_start(hw, ring);
if (err != 0) {
device_printf(softc->dev,
- "atlantic: aq_ring_tx_start: %d\n", err);
+ "aq_ring_tx_start: %d\n", err);
}
}
for (i = 0; i < softc->rx_rings_count; i++) {
@@ -788,12 +788,12 @@
err = aq_ring_rx_init(&softc->hw, ring);
if (err) {
device_printf(softc->dev,
- "atlantic: aq_ring_rx_init: %d\n", err);
+ "aq_ring_rx_init: %d\n", err);
}
err = aq_ring_rx_start(hw, ring);
if (err != 0) {
device_printf(softc->dev,
- "atlantic: aq_ring_rx_start: %d\n", err);
+ "aq_ring_rx_start: %d\n", err);
}
aq_if_rx_queue_intr_enable(ctx, i);
}
@@ -1325,80 +1325,38 @@
return (0);
}
-static int
-aq_sysctl_print_tx_head(SYSCTL_HANDLER_ARGS)
-{
- struct aq_ring *ring = arg1;
- int error = 0;
- unsigned int val;
-
- if (!ring)
- return (0);
-
- val = tdm_tx_desc_head_ptr_get(&ring->dev->hw, ring->index);
-
- error = sysctl_handle_int(oidp, &val, 0, req);
- if (error || !req->newptr)
- return (error);
-
- return (0);
-}
-
-static int
-aq_sysctl_print_tx_tail(SYSCTL_HANDLER_ARGS)
-{
- struct aq_ring *ring = arg1;
- int error = 0;
- unsigned int val;
-
- if (!ring)
- return (0);
-
- val = reg_tx_dma_desc_tail_ptr_get(&ring->dev->hw, ring->index);
-
- error = sysctl_handle_int(oidp, &val, 0, req);
- if (error || !req->newptr)
- return (error);
-
- return (0);
-}
-
-static int
-aq_sysctl_print_rx_head(SYSCTL_HANDLER_ARGS)
-{
- struct aq_ring *ring = arg1;
- int error = 0;
- unsigned int val;
-
- if (!ring)
- return (0);
-
- val = rdm_rx_desc_head_ptr_get(&ring->dev->hw, ring->index);
-
- error = sysctl_handle_int(oidp, &val, 0, req);
- if (error || !req->newptr)
- return (error);
-
- return (0);
-}
+enum aq_ring_ptr {
+ AQ_RING_TX_HEAD,
+ AQ_RING_TX_TAIL,
+ AQ_RING_RX_HEAD,
+ AQ_RING_RX_TAIL,
+};
static int
-aq_sysctl_print_rx_tail(SYSCTL_HANDLER_ARGS)
+aq_sysctl_print_ring_ptr(SYSCTL_HANDLER_ARGS)
{
- struct aq_ring *ring = arg1;
- int error = 0;
- unsigned int val;
+ struct aq_ring *ring = arg1;
+ unsigned int val;
- if (!ring)
+ if (ring == NULL)
return (0);
- val = reg_rx_dma_desc_tail_ptr_get(&ring->dev->hw, ring->index);
-
- error = sysctl_handle_int(oidp, &val, 0, req);
- if (error || !req->newptr)
- return (error);
+ switch (arg2) {
+ case AQ_RING_TX_HEAD:
+ val = tdm_tx_desc_head_ptr_get(&ring->dev->hw, ring->index);
+ break;
+ case AQ_RING_TX_TAIL:
+ val = reg_tx_dma_desc_tail_ptr_get(&ring->dev->hw, ring->index);
+ break;
+ case AQ_RING_RX_HEAD:
+ val = rdm_rx_desc_head_ptr_get(&ring->dev->hw, ring->index);
+ break;
+ default: /* AQ_RING_RX_TAIL */
+ val = reg_rx_dma_desc_tail_ptr_get(&ring->dev->hw, ring->index);
+ break;
+ }
- return (0);
+ return (sysctl_handle_int(oidp, &val, 0, req));
}
static int
@@ -1467,11 +1425,11 @@
SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "tx_bytes",
CTLFLAG_RD, &(ring->stats.tx_bytes), "TX Octets");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "tx_head",
- CTLTYPE_UINT | CTLFLAG_RD, ring, 0,
- aq_sysctl_print_tx_head, "IU", "ring head pointer");
+ CTLTYPE_UINT | CTLFLAG_RD, ring, AQ_RING_TX_HEAD,
+ aq_sysctl_print_ring_ptr, "IU", "ring head pointer");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "tx_tail",
- CTLTYPE_UINT | CTLFLAG_RD, ring, 0,
- aq_sysctl_print_tx_tail, "IU", "ring tail pointer");
+ CTLTYPE_UINT | CTLFLAG_RD, ring, AQ_RING_TX_TAIL,
+ aq_sysctl_print_ring_ptr, "IU", "ring tail pointer");
}
for (int i = 0; i < softc->rx_rings_count; i++) {
@@ -1490,11 +1448,11 @@
SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "irq",
CTLFLAG_RD, &(ring->stats.irq), "RX interrupts");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rx_head",
- CTLTYPE_UINT | CTLFLAG_RD, ring, 0,
- aq_sysctl_print_rx_head, "IU", "ring head pointer");
+ CTLTYPE_UINT | CTLFLAG_RD, ring, AQ_RING_RX_HEAD,
+ aq_sysctl_print_ring_ptr, "IU", "ring head pointer");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rx_tail",
- CTLTYPE_UINT | CTLFLAG_RD, ring, 0,
- aq_sysctl_print_rx_tail, "IU", " ring tail pointer");
+ CTLTYPE_UINT | CTLFLAG_RD, ring, AQ_RING_RX_TAIL,
+ aq_sysctl_print_ring_ptr, "IU", "ring tail pointer");
}
stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "mac",

File Metadata

Mime Type
text/plain
Expires
Mon, Aug 3, 10:15 AM (13 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35906809
Default Alt Text
D58436.diff (8 KB)

Event Timeline