Skip to content

Commit

Permalink
mod_sonic map back to sonic port names on counter poll callback
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed May 28, 2024
1 parent 6edc82d commit a3ce481
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Linux/mod_sonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1947,20 +1947,26 @@ extern "C" {
if(mdata->state < HSP_SONIC_STATE_DISCOVER)
return; // this can happen if we lose the redis connection and go back

EVDebug(mod, 1, "pollCounters(adaptor=%s)", adaptor->deviceName);

HSPAdaptorNIO *nio = ADAPTOR_NIO(adaptor);


EVDebug(mod, 1, "pollCounters(adaptor=%s, alias=%s)",
adaptor->deviceName,
nio->deviceAlias ?: "<none>");

if(nio->loopback)
return;

if(nio->bond_master) {
// trigger synthesizeBondMetaData
accumulateNioCounters(sp, adaptor, NULL, NULL);
return;
}

HSPSonicPort *prt = getPort(mod, adaptor->deviceName, NO);
if(prt == NULL
&& nio->deviceAlias)
prt = getPort(mod, nio->deviceAlias, NO);

if(prt) {
// OK to queue 4 requests on the TCP connection, and ordering
// is preserved, so can just ask for state-refresh and counters
Expand Down

0 comments on commit a3ce481

Please sign in to comment.