summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2020-02-23 23:05:05 -0700
committerGitHub <noreply@github.com>2020-02-23 23:05:05 -0700
commit68c91bcbb5b72edda10154c48d2f64edc11bd132 (patch)
treeb8ec1b6d48c4f4a729dd0885f68b8865bee10ee2 /libs
parent36dc3c2aabc9985f040eb7702bda87fdd068c524 (diff)
downloadbcm5719-ortega-68c91bcbb5b72edda10154c48d2f64edc11bd132.tar.gz
bcm5719-ortega-68c91bcbb5b72edda10154c48d2f64edc11bd132.zip
ncsi: Print network statistics on a Get Link Status command instead of for each packet. (#38)
Diffstat (limited to 'libs')
-rw-r--r--libs/NCSI/ncsi.c8
-rw-r--r--libs/Network/rx.c4
-rw-r--r--libs/Network/tx.c5
3 files changed, 13 insertions, 4 deletions
diff --git a/libs/NCSI/ncsi.c b/libs/NCSI/ncsi.c
index e34957e..3ecabdc 100644
--- a/libs/NCSI/ncsi.c
+++ b/libs/NCSI/ncsi.c
@@ -403,6 +403,12 @@ static void getLinkStatusHandler(NetworkFrame_t *frame)
int ch = frame->controlPacket.ChannelID & CHANNEL_ID_MASK;
NetworkPort_t *port = gPackageState.port[ch];
uint8_t phy = MII_getPhy(port->device);
+
+ uint32_t rx = port->shm_channel->NcsiChannelCtrlstatAllRx.r32;
+ uint32_t tx = port->shm_channel->NcsiChannelCtrlstatAllRx.r32;
+
+ debug("Link Status [%d], TX %d, RX %d\n", frame->controlPacket.ChannelID, tx, rx);
+
APE_aquireLock();
uint16_t status_value = MII_readRegister(port->device, phy, (mii_reg_t)REG_MII_STATUS);
stat.r16 = status_value;
@@ -435,7 +441,6 @@ static void getLinkStatusHandler(NetworkFrame_t *frame)
uint32_t LinkStatus = linkStatus.r32;
uint32_t OEMLinkStatus = 0;
uint32_t OtherIndications = 0;
- debug("Get Link Status: channel %x\n", frame->controlPacket.ChannelID);
sendNCSILinkStatusResponse(frame->controlPacket.InstanceID, frame->controlPacket.ChannelID, LinkStatus, OEMLinkStatus, OtherIndications);
}
@@ -674,6 +679,7 @@ void resetChannel(int ch)
port->shm_channel->NcsiChannelInfo.r32 = 0;
port->shm_channel->NcsiChannelCtrlstatRx.r32 = 0;
port->shm_channel->NcsiChannelCtrlstatAllTx.r32 = 0;
+ port->shm_channel->NcsiChannelCtrlstatAllRx.r32 = 0;
port->shm_channel->NcsiChannelInfo.bits.Ready = false;
uint8_t phy = MII_getPhy(port->device);
diff --git a/libs/Network/rx.c b/libs/Network/rx.c
index 69e7391..ce2d277 100644
--- a/libs/Network/rx.c
+++ b/libs/Network/rx.c
@@ -131,7 +131,6 @@ bool Network_PassthroughRxPatcket(NetworkPort_t *port)
rxbuf = *((RegAPERxbufoffset_t *)port->rx_offset);
if ((int)rxbuf.bits.Valid)
{
- printf("***RX***\n");
#if CXX_SIMULATOR
rxbuf.print();
#endif
@@ -214,6 +213,9 @@ bool Network_PassthroughRxPatcket(NetworkPort_t *port)
rxbuf.bits.Finished = 1;
*((RegAPERxbufoffset_t *)port->rx_offset) = rxbuf;
+ // Packet recieved.
+ ++port->shm_channel->NcsiChannelCtrlstatAllRx.r32;
+
return true;
}
else
diff --git a/libs/Network/tx.c b/libs/Network/tx.c
index 42231d6..c83edaf 100644
--- a/libs/Network/tx.c
+++ b/libs/Network/tx.c
@@ -424,8 +424,6 @@ bool Network_TX_transmitPassthroughPacket(uint32_t length, NetworkPort_t *port)
uint32_t blocks = Network_TX_numBlocksNeeded(length);
int total_blocks = blocks;
- printf("Sending passhrough packet to Net. First block: %d (%d total).\n", first, blocks);
-
if (blocks > 1)
{
next_block = Network_TX_allocateBlock(port);
@@ -473,5 +471,8 @@ bool Network_TX_transmitPassthroughPacket(uint32_t length, NetworkPort_t *port)
uint32_t data = APE_PERI.BmcToNcReadBuffer.r32;
(void)data;
+ // Packet transmitted.
+ ++port->shm_channel->NcsiChannelCtrlstatAllTx.r32;
+
return true;
}
OpenPOWER on IntegriCloud