Skip to content

Commit

Permalink
Extented network status for support dropped tx congestion packet.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juha Heiuskanen committed Dec 2, 2020
1 parent 11c0763 commit b818f12
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions nanostack/nwk_stats_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ typedef struct nwk_stats_t {
/* MAC */
uint16_t adapt_layer_tx_queue_size; /**< Adaptation layer direct TX queue size. */
uint16_t adapt_layer_tx_queue_peak; /**< Adaptation layer direct TX queue size peak. */
uint32_t adapt_layer_tx_congestion_drop; /**< Adaptation layer direct TX randon early detection drop packet. */
} nwk_stats_t;

/**
Expand Down
2 changes: 1 addition & 1 deletion source/6LoWPAN/adaptation_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ int8_t lowpan_adaptation_interface_tx(protocol_interface_info_entry_t *cur, buff
if (cur->random_early_detection && buf->priority == QOS_NORMAL) {

if (random_early_detection_packet(cur->random_early_detection, interface_ptr->directTxQueue_size)) {
//TODO Update Statisdic drop by congestion
protocol_stats_update(STATS_AL_TX_CONGESTION_DROP, 1);
goto tx_error_handler;
}
}
Expand Down
3 changes: 2 additions & 1 deletion source/NWK_INTERFACE/Include/protocol_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ typedef enum {
STATS_BUFFER_HEADROOM_FAIL,
STATS_ETX_1ST_PARENT,
STATS_ETX_2ND_PARENT,
STATS_AL_TX_QUEUE_SIZE
STATS_AL_TX_QUEUE_SIZE,
STATS_AL_TX_CONGESTION_DROP

} nwk_stats_type_t;

Expand Down
3 changes: 3 additions & 0 deletions source/NWK_INTERFACE/protocol_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ void protocol_stats_update(nwk_stats_type_t type, uint16_t update_val)
nwk_stats_ptr->adapt_layer_tx_queue_peak = nwk_stats_ptr->adapt_layer_tx_queue_size;
}
break;
case STATS_AL_TX_CONGESTION_DROP:
nwk_stats_ptr->adapt_layer_tx_congestion_drop++;
break;
}
}
}
Expand Down

0 comments on commit b818f12

Please sign in to comment.