diff options
author | Evan Lojewski <github@meklort.com> | 2020-03-21 19:00:05 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 19:00:05 -0600 |
commit | 4f67a6906d957af6b309eb61142e8a443eda6e0b (patch) | |
tree | 7223729ef99fb9804fe03ccb40bca08492fdaad8 /libs | |
parent | 394bec692789a6045ff5cfdeecdde4e44e8fd978 (diff) | |
download | bcm5719-ortega-4f67a6906d957af6b309eb61142e8a443eda6e0b.tar.gz bcm5719-ortega-4f67a6906d957af6b309eb61142e8a443eda6e0b.zip |
diag: Print additional diagnostic information about TX/RX buffers. (#63)
Diffstat (limited to 'libs')
-rw-r--r-- | libs/NCSI/ncsi.c | 4 | ||||
-rw-r--r-- | libs/Network/include/Network.h | 2 | ||||
-rw-r--r-- | libs/Network/ports.c | 8 |
3 files changed, 13 insertions, 1 deletions
diff --git a/libs/NCSI/ncsi.c b/libs/NCSI/ncsi.c index ce859e4..90416a6 100644 --- a/libs/NCSI/ncsi.c +++ b/libs/NCSI/ncsi.c @@ -412,7 +412,9 @@ static void getLinkStatusHandler(NetworkFrame_t *frame) RegSHM_CHANNELNcsiChannelStatus_t linkStatus = port->shm_channel->NcsiChannelStatus; - debug("Link Status [%d] %s, TX %d, RX %d\n", frame->controlPacket.ChannelID, stat.bits.LinkStatus ? "up" : "down", tx, rx); + uint32_t tx_used = APE_TX_TO_NET_BUFFER_RING_FREE_MAX - port->tx_ring->bits.Free; + uint32_t rx_avail = APE_RX_POOL_FREE_POINTER_FREE_COUNT_MAX - port->rx_ring->bits.FreeCount; + debug("Link Status [%d] %s, TX %d [%d used], RX %d [%d avail]\n", frame->controlPacket.ChannelID, stat.bits.LinkStatus ? "up" : "down", tx, tx_used, rx, rx_avail); if (!stat.bits.LinkStatus) { diff --git a/libs/Network/include/Network.h b/libs/Network/include/Network.h index 9b51526..7633503 100644 --- a/libs/Network/include/Network.h +++ b/libs/Network/include/Network.h @@ -67,12 +67,14 @@ typedef struct VOLATILE TX_PORT_t *tx_port; VOLATILE RegAPETxToNetBufferAllocator_t *tx_allocator; VOLATILE RegAPETxToNetDoorbell_t *tx_doorbell; + VOLATILE RegAPETxToNetBufferRing_t *tx_ring; /* RX Registers */ VOLATILE RegAPERxPoolModeStatus_t *rx_mode; VOLATILE RX_PORT_t *rx_port; VOLATILE RegAPERxbufoffset_t *rx_offset; VOLATILE RegAPERxPoolRetire_t *rx_retire; + VOLATILE RegAPERxPoolFreePointer_t *rx_ring; /* Port Registers */ VOLATILE DEVICE_t *device; diff --git a/libs/Network/ports.c b/libs/Network/ports.c index 4f1ca67..be8e6d8 100644 --- a/libs/Network/ports.c +++ b/libs/Network/ports.c @@ -76,11 +76,13 @@ NetworkPort_t gPort0 = { .tx_port = &TX_PORT0, .tx_allocator = &APE.TxToNetBufferAllocator0, .tx_doorbell = &APE.TxToNetDoorbellFunc0, + .tx_ring = &APE.TxToNetBufferRing0, .tx_mode = &APE.TxToNetPoolModeStatus0, .rx_port = &RX_PORT0, .rx_offset = &APE.RxbufoffsetFunc0, .rx_retire = &APE.RxPoolRetire0, + .rx_ring = &APE.RxPoolFreePointer0, .rx_mode = &APE.RxPoolModeStatus0, #ifndef CXX_SIMULATOR @@ -98,11 +100,13 @@ NetworkPort_t gPort1 = { .tx_port = &TX_PORT1, .tx_allocator = &APE.TxToNetBufferAllocator1, .tx_doorbell = &APE.TxToNetDoorbellFunc1, + .tx_ring = &APE.TxToNetBufferRing1, .tx_mode = &APE.TxToNetPoolModeStatus1, .rx_port = &RX_PORT1, .rx_offset = &APE.RxbufoffsetFunc1, .rx_retire = &APE.RxPoolRetire1, + .rx_ring = &APE.RxPoolFreePointer1, .rx_mode = &APE.RxPoolModeStatus1, #ifndef CXX_SIMULATOR @@ -120,11 +124,13 @@ NetworkPort_t gPort2 = { .tx_port = &TX_PORT2, .tx_allocator = &APE.TxToNetBufferAllocator2, .tx_doorbell = &APE.TxToNetDoorbellFunc2, + .tx_ring = &APE.TxToNetBufferRing2, .tx_mode = &APE.TxToNetPoolModeStatus2, .rx_port = &RX_PORT2, .rx_offset = &APE.RxbufoffsetFunc2, .rx_retire = &APE.RxPoolRetire2, + .rx_ring = &APE.RxPoolFreePointer2, .rx_mode = &APE.RxPoolModeStatus2, #ifndef CXX_SIMULATOR @@ -142,11 +148,13 @@ NetworkPort_t gPort3 = { .tx_port = &TX_PORT3, .tx_allocator = &APE.TxToNetBufferAllocator3, .tx_doorbell = &APE.TxToNetDoorbellFunc3, + .tx_ring = &APE.TxToNetBufferRing3, .tx_mode = &APE.TxToNetPoolModeStatus3, .rx_port = &RX_PORT3, .rx_offset = &APE.RxbufoffsetFunc3, .rx_retire = &APE.RxPoolRetire3, + .rx_ring = &APE.RxPoolFreePointer3, .rx_mode = &APE.RxPoolModeStatus3, #ifndef CXX_SIMULATOR |